1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-11 20:37:40 +00:00

Dropped inferred volatile.

This commit is contained in:
jespergravgaard 2020-02-06 18:07:56 +01:00
parent 1a978bc82d
commit 45ad6b64b0
104 changed files with 4957 additions and 6306 deletions
src
main/java/dk/camelot64/kickc
test/ref
address-of-0.cfgaddress-of-0.logaddress-of-0.symaddress-of-1.cfgaddress-of-1.logaddress-of-1.symaddress-of-2.cfgaddress-of-2.logaddress-of-2.sym
complex/tetris
const-early-identification.cfgconst-early-identification.logconst-early-identification.symconst-word-pointer.cfgconst-word-pointer.logconst-word-pointer.symhex2dec-ptrptr.asmhex2dec-ptrptr.cfghex2dec-ptrptr.loghex2dec-ptrptr.symhex2dec.asmhex2dec.cfghex2dec.loghex2dec.symlong-pointer-0.cfglong-pointer-0.loglong-pointer-0.symlong-pointer-1.cfglong-pointer-1.loglong-pointer-1.sym
millfork-benchmarks
nes-array.asmnes-array.cfgnes-array.lognes-array.sympointer-cast-2.cfgpointer-cast-2.logpointer-cast-2.sympointer-pointer-1.cfgpointer-pointer-1.logpointer-pointer-1.sympointer-pointer-2.asmpointer-pointer-2.cfgpointer-pointer-2.logpointer-pointer-2.sympointer-pointer-3.cfgpointer-pointer-3.logpointer-pointer-3.sympointer-void-0.cfgpointer-void-0.logpointer-void-0.sympointer-void-1.cfgpointer-void-1.logpointer-void-1.sympointer-void-2.cfgpointer-void-2.logpointer-void-2.symptrptr-optimize-0.cfgptrptr-optimize-0.logptrptr-optimize-0.symptrptr-optimize-1.cfgptrptr-optimize-1.logptrptr-optimize-1.symptrptr-optimize-2.cfgptrptr-optimize-2.logptrptr-optimize-2.symstruct-ptr-12-ref.cfgstruct-ptr-12-ref.logstruct-ptr-12-ref.symtypedef-2.cfgtypedef-2.log

@ -143,7 +143,7 @@ public class LiveRangeEquivalenceClass {
public boolean hasVolatile(Program program) {
for(VariableRef varRef : variables) {
Variable variable = program.getScope().getVariable(varRef);
if(variable.isAnyVolatile()) {
if(variable.isVolatile()) {
return true;
}
}

@ -65,9 +65,6 @@ public class Variable implements Symbol {
/** Specifies that the variable must always live in memory to be available for any multi-threaded accees (eg. in interrupts). (volatile keyword) [Only Variables] */
private boolean isVolatile;
/** Specifies that the variable must always live in memory to be available for any multi-threaded accees (eg. in interrupts). [Only variables] TODO: Remove this */
private boolean inferredVolatile;
/** Specifies that the variable must always be added to the output ASM even if it is never used anywhere. (export keyword) */
private boolean export;
@ -189,7 +186,6 @@ public class Variable implements Symbol {
version.setRegister(phiMaster.getRegister());
version.setVolatile(phiMaster.isVolatile());
version.setExport(phiMaster.isExport());
version.setInferredVolatile(phiMaster.isInferredVolatile());
version.setComments(phiMaster.getComments());
return version;
}
@ -233,7 +229,6 @@ public class Variable implements Symbol {
constVar.setRegister(variable.getRegister());
constVar.setVolatile(variable.isVolatile());
constVar.setExport(variable.isExport());
constVar.setInferredVolatile(variable.isInferredVolatile());
constVar.setComments(variable.getComments());
return constVar;
}
@ -253,7 +248,6 @@ public class Variable implements Symbol {
copy.setVolatile(original.isVolatile());
copy.setExport(original.isExport());
copy.setRegister(original.getRegister());
copy.setInferredVolatile(original.isInferredVolatile());
copy.setComments(original.getComments());
return copy;
}
@ -281,7 +275,6 @@ public class Variable implements Symbol {
memberVariable = new Variable(name, structVar.getKind(), memberDefinition.getType(), structVar.getScope(), memoryArea, structVar.getDataSegment(), memberDefinition.getArraySpec(), memberDefinition.getInitValue());
}
memberVariable.setVolatile(structVar.isVolatile());
memberVariable.setInferredVolatile(structVar.isInferredVolatile());
memberVariable.setNoModify(structVar.isNoModify());
memberVariable.setExport(structVar.isExport());
return memberVariable;
@ -531,18 +524,6 @@ public class Variable implements Symbol {
this.memoryAlignment = memoryAlignment;
}
public void setInferredVolatile(boolean inferredVolatile) {
this.inferredVolatile = inferredVolatile;
}
public boolean isInferredVolatile() {
return inferredVolatile;
}
public boolean isAnyVolatile() {
return isVolatile || inferredVolatile;
}
/**
* Is the variable a struct that should be unwound to member variables
*

@ -55,7 +55,8 @@ public class Pass1AddressOfHandling extends Pass2SsaOptimization {
variable.setKind(Variable.Kind.LOAD_STORE);
getLog().append("Setting struct to load/store in variable affected by address-of " + stmtStr);
} else {
variable.setInferredVolatile(true);
variable.setKind(Variable.Kind.LOAD_STORE);
variable.setVolatile(true);
getLog().append("Setting inferred volatile on symbol affected by address-of " + stmtStr);
}
}

@ -37,7 +37,7 @@ public class Pass1EarlyConstantIdentification extends Pass1Base {
List<Statement> removeStmt = new ArrayList<>();
for(Variable variable : getProgram().getScope().getAllVariables(true)) {
SymbolVariableRef variableRef = variable.getRef();
if(!variable.isKindConstant() && !variable.isAnyVolatile() && !variableRef.isIntermediate()) {
if(!variable.isKindConstant() && !variable.isVolatile() && !variableRef.isIntermediate()) {
if(variable.getScope() instanceof StructDefinition)
// Skip structs
continue;

@ -93,7 +93,7 @@ public class Pass2AliasElimination extends Pass2SsaOptimization {
String unversionedFullName = null;
for(VariableRef variableRef : aliasSet.getVars()) {
Variable variable = programScope.getVariable(variableRef);
if(variable.isAnyVolatile() || variable.isKindLoadStore()) {
if(variable.isVolatile() || variable.isKindLoadStore()) {
anyVolatile = true;
}
if(unversionedFullName == null) {

@ -137,7 +137,7 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization {
if(lValue instanceof VariableRef) {
VariableRef varRef = (VariableRef) lValue;
Variable var = getScope().getVariable(varRef);
if(var.isAnyVolatile() || var.isKindLoadStore())
if(var.isVolatile() || var.isKindLoadStore())
// Do not examine volatiles and non-versioned variables
continue;
ConstantValue constant = getConstant(assignment.getrValue2());
@ -153,7 +153,7 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization {
if(getConstant(phiRValue.getrValue()) != null) {
VariableRef varRef = phiVariable.getVariable();
Variable var = getScope().getVariable(varRef);
if(var.isAnyVolatile() || var.isKindLoadStore())
if(var.isVolatile() || var.isKindLoadStore())
// Do not examine volatiles and non-versioned variables
continue;
ConstantValue constant = getConstant(phiRValue.getrValue());
@ -167,7 +167,7 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization {
// Look for constants among non-versioned variables
for(Variable variable : getScope().getAllVariables(true)) {
if(variable.isAnyVolatile() || !variable.isKindLoadStore())
if(variable.isVolatile() || !variable.isKindLoadStore())
// Do not examine volatiles, non-constants or versioned variables
continue;
List<StatementLValue> assignments = getGraph().getAssignments(variable.getRef());

@ -109,7 +109,7 @@ public class Pass2DuplicateRValueIdentification extends Pass2SsaOptimization {
isVol.set(true);
if(programValue.get() instanceof VariableRef) {
Variable variable = getScope().getVariable((VariableRef) programValue.get());
if(variable.isAnyVolatile())
if(variable.isVolatile())
isVol.set(true);
}
};

@ -142,7 +142,7 @@ public class Pass2LoopHeadConstantIdentification extends Pass2SsaOptimization {
}
if(programValue.get() instanceof VariableRef) {
Variable variable = getScope().getVariable((VariableRef) programValue.get());
if(variable.isAnyVolatile())
if(variable.isVolatile())
isVol.set(true);
}
}, null, null);

@ -33,7 +33,7 @@ public class Pass4LiveRangeEquivalenceClassesFinalize extends Pass2Base {
// Add all versions of volatile variables to the same equivalence class
for(Variable variable : getSymbols().getAllVariables(true)) {
if(variable.isKindPhiVersion() && variable.isAnyVolatile() && !variable.isStructUnwind()) {
if(variable.isKindPhiVersion() && variable.isVolatile() && !variable.isStructUnwind()) {
// Found a volatile non-versioned variable
for(Variable otherVariable : variable.getScope().getAllVariables(false)) {
if(otherVariable.isKindPhiVersion()) {

@ -78,7 +78,7 @@ public class Pass4RegisterUpliftPotentialInitialize extends Pass2Base {
private boolean varVolatile(LiveRangeEquivalenceClass equivalenceClass) {
for(VariableRef variableRef : equivalenceClass.getVariables()) {
Variable variable = getSymbols().getVariable(variableRef);
if(variable.isAnyVolatile() || variable.isKindLoadStore()) {
if(variable.isVolatile() || variable.isKindLoadStore()) {
return true;
}
}

@ -44,7 +44,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
if(variable == null) {
// Already deleted
eliminate = true;
} else if(!variable.isAnyVolatile() && !variable.isExport()) {
} else if(!variable.isVolatile() && !variable.isExport()) {
// Not volatile
eliminate = true;
} else if(variable.isStruct()) {
@ -72,7 +72,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
LValue lValue = call.getlValue();
if(lValue instanceof VariableRef && referenceInfos.isUnused((VariableRef) lValue)) {
Variable variable = getScope().getVariable((VariableRef) lValue);
if(!variable.isAnyVolatile()) {
if(!variable.isVolatile()) {
if(pass2 || getLog().isVerbosePass1CreateSsa()) {
getLog().append("Eliminating unused variable - keeping the call " + lValue.toString(getProgram()));
}
@ -88,7 +88,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
LValue lValue = call.getlValue();
if(lValue instanceof VariableRef && referenceInfos.isUnused((VariableRef) lValue)) {
Variable variable = getScope().getVariable((VariableRef) lValue);
if(!variable.isAnyVolatile()) {
if(!variable.isVolatile()) {
if(pass2 || getLog().isVerbosePass1CreateSsa()) {
getLog().append("Eliminating unused variable - keeping the call " + lValue.toString(getProgram()));
}
@ -104,7 +104,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
LValue lValue = call.getlValue();
if(lValue instanceof VariableRef && referenceInfos.isUnused((VariableRef) lValue)) {
Variable variable = getScope().getVariable((VariableRef) lValue);
if(!variable.isAnyVolatile()) {
if(!variable.isVolatile()) {
if(pass2 || getLog().isVerbosePass1CreateSsa()) {
getLog().append("Eliminating unused variable - keeping the call " + lValue.toString(getProgram()));
}
@ -123,7 +123,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
VariableRef variableRef = phiVariable.getVariable();
if(referenceInfos.isUnused(variableRef)) {
Variable variable = getScope().getVariable(variableRef);
if(!variable.isAnyVolatile()) {
if(!variable.isVolatile()) {
if(pass2 || getLog().isVerbosePass1CreateSsa()) {
getLog().append("Eliminating unused variable - keeping the phi block " + variableRef.toString(getProgram()));
}

@ -10,15 +10,14 @@
(void()) main()
main: scope:[main] from @1
[4] (byte) main::b#0 ← (byte) 0
[4] (byte) main::b ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 )
[6] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1
[7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0
[8] (byte) main::b#1 ← ++ (byte) main::b#2
[9] if((byte) main::b#1!=(byte) $b) goto main::@1
[5] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1
[6] *((const byte*) main::SCREEN + (byte) main::b) ← (byte) main::c#0
[7] (byte) main::b ← ++ (byte) main::b
[8] if((byte) main::b!=(byte) $b) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[10] return
[9] return
to:@return

@ -9,15 +9,14 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte) main::b#0 ← (byte) 0
(byte) main::b ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
(byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 )
(number~) main::$0 ← *((const byte*) main::bp) + (number) 1
(byte) main::c#0 ← (number~) main::$0
*((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0
(byte) main::b#1 ← (byte) main::b#2 + rangenext(0,$a)
(bool~) main::$1 ← (byte) main::b#1 != rangelast(0,$a)
*((const byte*) main::SCREEN + (byte) main::b) ← (byte) main::c#0
(byte) main::b ← (byte) main::b + rangenext(0,$a)
(bool~) main::$1 ← (byte) main::b != rangelast(0,$a)
if((bool~) main::$1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
@ -41,10 +40,7 @@ SYMBOL TABLE SSA
(label) main::@1
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(byte) main::b
(byte) main::b#0
(byte) main::b#1
(byte) main::b#2
(byte) main::b loadstore
(const byte*) main::bp = &(byte) main::b
(byte) main::c
(byte) main::c#0
@ -60,17 +56,16 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← *((const byte*) main::bp) + (byte) 1
Alias (byte) main::c#0 = (byte~) main::$0
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$1 [7] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1
Simple Condition (bool~) main::$1 [6] if((byte) main::b!=rangelast(0,$a)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Resolved ranged next value [5] main::b#1 ← ++ main::b#2 to ++
Resolved ranged comparison value [7] if(main::b#1!=rangelast(0,$a)) goto main::@1 to (number) $b
Adding number conversion cast (unumber) $b in if((byte) main::b#1!=(number) $b) goto main::@1
Resolved ranged next value [4] main::b ← ++ main::b to ++
Resolved ranged comparison value [6] if(main::b!=rangelast(0,$a)) goto main::@1 to (number) $b
Adding number conversion cast (unumber) $b in if((byte) main::b!=(number) $b) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $b
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $b
Successful SSA optimization PassNFinalizeNumberTypeConversions
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
@ -78,12 +73,9 @@ Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced [6] main::b#3 ← main::b#0
Coalesced [13] main::b#4 ← main::b#1
Coalesced down to 1 phi equivalence classes
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
@ -101,36 +93,32 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte) main::b#0 ← (byte) 0
[4] (byte) main::b ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 )
[6] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1
[7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0
[8] (byte) main::b#1 ← ++ (byte) main::b#2
[9] if((byte) main::b#1!=(byte) $b) goto main::@1
[5] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1
[6] *((const byte*) main::SCREEN + (byte) main::b) ← (byte) main::c#0
[7] (byte) main::b ← ++ (byte) main::b
[8] if((byte) main::b!=(byte) $b) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[10] return
[9] return
to:@return
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::b
(byte) main::b#0 4.0
(byte) main::b#1 16.5
(byte) main::b#2 11.666666666666666
(byte) main::b loadstore 11.5
(byte) main::c
(byte) main::c#0 22.0
Initial phi equivalence classes
[ main::b#2 main::b#0 main::b#1 ]
Added variable main::b to live range equivalence class [ main::b ]
Added variable main::c#0 to live range equivalence class [ main::c#0 ]
Complete equivalence classes
[ main::b#2 main::b#0 main::b#1 ]
[ main::b ]
[ main::c#0 ]
Allocated zp[1]:2 [ main::b#2 main::b#0 main::b#1 ]
Allocated zp[1]:2 [ main::b ]
Allocated zp[1]:3 [ main::c#0 ]
INITIAL ASM
@ -162,53 +150,49 @@ main: {
.label bp = b
.label b = 2
.label c = 3
// [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1
// [4] (byte) main::b ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b
// [5] phi from main main::@1 to main::@1 [phi:main/main::@1->main::@1]
__b1_from_main:
__b1_from___b1:
// [5] phi (byte) main::b#2 = (byte) main::b#0 [phi:main/main::@1->main::@1#0] -- register_copy
jmp __b1
// main::@1
__b1:
// [6] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1 -- vbuz1=_deref_pbuc1_plus_1
// [5] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1 -- vbuz1=_deref_pbuc1_plus_1
ldy.z bp
iny
sty.z c
// [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuz2
// [6] *((const byte*) main::SCREEN + (byte) main::b) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuz2
lda.z c
ldy.z b
sta SCREEN,y
// [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
// [7] (byte) main::b ← ++ (byte) main::b -- vbuz1=_inc_vbuz1
inc.z b
// [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
// [8] if((byte) main::b!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$b
cmp.z b
bne __b1_from___b1
bne __b1
jmp __breturn
// main::@return
__breturn:
// [10] return
// [9] return
rts
}
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte) main::b#0 ← (byte) 0 [ main::b#0 ] ( main:2 [ main::b#0 ] ) always clobbers reg byte a
Statement [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 [ main::b#2 ] ( main:2 [ main::b#2 ] ) always clobbers reg byte y
Statement [9] if((byte) main::b#1!=(byte) $b) goto main::@1 [ main::b#1 ] ( main:2 [ main::b#1 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::b#2 main::b#0 main::b#1 ] : zp[1]:2 ,
Statement [4] (byte) main::b ← (byte) 0 [ main::b ] ( main:2 [ main::b ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::SCREEN + (byte) main::b) ← (byte) main::c#0 [ ] ( main:2 [ ] ) always clobbers reg byte y
Statement [8] if((byte) main::b!=(byte) $b) goto main::@1 [ main::b ] ( main:2 [ main::b ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::b ] : zp[1]:2 ,
Potential registers zp[1]:3 [ main::c#0 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 32.17: zp[1]:2 [ main::b#2 main::b#0 main::b#1 ] 22: zp[1]:3 [ main::c#0 ]
Uplift Scope [main] 22: zp[1]:3 [ main::c#0 ] 11.5: zp[1]:2 [ main::b ]
Uplift Scope []
Uplifting [main] best 358 combination zp[1]:2 [ main::b#2 main::b#0 main::b#1 ] reg byte a [ main::c#0 ]
Uplifting [] best 358 combination
Attempting to uplift remaining variables inzp[1]:2 [ main::b#2 main::b#0 main::b#1 ]
Uplifting [main] best 358 combination zp[1]:2 [ main::b#2 main::b#0 main::b#1 ]
Uplifting [main] best 331 combination reg byte a [ main::c#0 ] zp[1]:2 [ main::b ]
Uplifting [] best 331 combination
Attempting to uplift remaining variables inzp[1]:2 [ main::b ]
Uplifting [main] best 331 combination zp[1]:2 [ main::b ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -237,33 +221,29 @@ main: {
.label SCREEN = $400
.label bp = b
.label b = 2
// [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1
// [4] (byte) main::b ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b
// [5] phi from main main::@1 to main::@1 [phi:main/main::@1->main::@1]
__b1_from_main:
__b1_from___b1:
// [5] phi (byte) main::b#2 = (byte) main::b#0 [phi:main/main::@1->main::@1#0] -- register_copy
jmp __b1
// main::@1
__b1:
// [6] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
// [5] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
lda.z bp
clc
adc #1
// [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
// [6] *((const byte*) main::SCREEN + (byte) main::b) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
ldy.z b
sta SCREEN,y
// [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
// [7] (byte) main::b ← ++ (byte) main::b -- vbuz1=_inc_vbuz1
inc.z b
// [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
// [8] if((byte) main::b!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$b
cmp.z b
bne __b1_from___b1
bne __b1
jmp __breturn
// main::@return
__breturn:
// [10] return
// [9] return
rts
}
// File Data
@ -275,12 +255,9 @@ Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Replacing label __b1_from___b1 with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction __bend_from___b1:
Removing instruction __b1_from_main:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __breturn:
@ -299,15 +276,12 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::b
(byte) main::b#0 b zp[1]:2 4.0
(byte) main::b#1 b zp[1]:2 16.5
(byte) main::b#2 b zp[1]:2 11.666666666666666
(byte) main::b loadstore zp[1]:2 11.5
(const byte*) main::bp = &(byte) main::b
(byte) main::c
(byte) main::c#0 reg byte a 22.0
zp[1]:2 [ main::b#2 main::b#0 main::b#1 ]
zp[1]:2 [ main::b ]
reg byte a [ main::c#0 ]
@ -333,32 +307,30 @@ main: {
.label bp = b
.label b = 2
// for( byte b: 0..10)
// [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1
// [4] (byte) main::b ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b
// [5] phi from main main::@1 to main::@1 [phi:main/main::@1->main::@1]
// [5] phi (byte) main::b#2 = (byte) main::b#0 [phi:main/main::@1->main::@1#0] -- register_copy
// main::@1
__b1:
// c = *bp +1
// [6] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
// [5] (byte) main::c#0 ← *((const byte*) main::bp) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
lda.z bp
clc
adc #1
// SCREEN[b] = c
// [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
// [6] *((const byte*) main::SCREEN + (byte) main::b) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
ldy.z b
sta SCREEN,y
// for( byte b: 0..10)
// [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
// [7] (byte) main::b ← ++ (byte) main::b -- vbuz1=_inc_vbuz1
inc.z b
// [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
// [8] if((byte) main::b!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$b
cmp.z b
bne __b1
// main::@return
// }
// [10] return
// [9] return
rts
}
// File Data

@ -5,13 +5,10 @@
(label) main::@1
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::b
(byte) main::b#0 b zp[1]:2 4.0
(byte) main::b#1 b zp[1]:2 16.5
(byte) main::b#2 b zp[1]:2 11.666666666666666
(byte) main::b loadstore zp[1]:2 11.5
(const byte*) main::bp = &(byte) main::b
(byte) main::c
(byte) main::c#0 reg byte a 22.0
zp[1]:2 [ main::b#2 main::b#0 main::b#1 ]
zp[1]:2 [ main::b ]
reg byte a [ main::c#0 ]

@ -10,9 +10,9 @@
(void()) main()
main: scope:[main] from @1
[4] (byte) main::b1#0 ← (byte) 0
[5] (byte) main::b2#0 ← (byte) 0
[6] (byte) main::b3#0 ← (byte) 0
[4] (byte) main::b1 ← (byte) 0
[5] (byte) main::b2 ← (byte) 0
[6] (byte) main::b3 ← (byte) 0
[7] call setByte
to:main::@1
main::@1: scope:[main] from main
@ -24,9 +24,9 @@ main::@2: scope:[main] from main::@1
[11] call setByte
to:main::@3
main::@3: scope:[main] from main::@2
[12] *((const byte*) main::SCREEN) ← (byte) main::b1#0
[13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0
[14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0
[12] *((const byte*) main::SCREEN) ← (byte) main::b1
[13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2
[14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3
to:main::@return
main::@return: scope:[main] from main::@3
[15] return
@ -34,7 +34,7 @@ main::@return: scope:[main] from main::@3
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
setByte: scope:[setByte] from main main::@1 main::@2
[16] (byte*) setByte::ptr#3 ← phi( main/&(byte) main::b1#0 main::@1/&(byte) main::b2#0 main::@2/&(byte) main::b3#0 )
[16] (byte*) setByte::ptr#3 ← phi( main/&(byte) main::b1 main::@1/&(byte) main::b2 main::@2/&(byte) main::b3 )
[16] (byte) setByte::b#3 ← phi( main/(byte) 'c' main::@1/(byte) 'm' main::@2/(byte) 'l' )
[17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3
to:setByte::@return

@ -10,36 +10,27 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte) main::b1#0 ← (byte) 0
(byte) main::b2#0 ← (byte) 0
(byte) main::b3#0 ← (byte) 0
(byte*) setByte::ptr#0 ← &(byte) main::b1#0
(byte) main::b1 ← (byte) 0
(byte) main::b2 ← (byte) 0
(byte) main::b3 ← (byte) 0
(byte*) setByte::ptr#0 ← &(byte) main::b1
(byte) setByte::b#0 ← (byte) 'c'
call setByte
to:main::@1
main::@1: scope:[main] from main
(byte) main::b1#3 ← phi( main/(byte) main::b1#0 )
(byte) main::b3#3 ← phi( main/(byte) main::b3#0 )
(byte) main::b2#1 ← phi( main/(byte) main::b2#0 )
(byte*) setByte::ptr#1 ← &(byte) main::b2#1
(byte*) setByte::ptr#1 ← &(byte) main::b2
(byte) setByte::b#1 ← (byte) 'm'
call setByte
to:main::@2
main::@2: scope:[main] from main::@1
(byte) main::b2#3 ← phi( main::@1/(byte) main::b2#1 )
(byte) main::b1#2 ← phi( main::@1/(byte) main::b1#3 )
(byte) main::b3#1 ← phi( main::@1/(byte) main::b3#3 )
(byte*) setByte::ptr#2 ← &(byte) main::b3#1
(byte*) setByte::ptr#2 ← &(byte) main::b3
(byte) setByte::b#2 ← (byte) 'l'
call setByte
to:main::@3
main::@3: scope:[main] from main::@2
(byte) main::b3#2 ← phi( main::@2/(byte) main::b3#1 )
(byte) main::b2#2 ← phi( main::@2/(byte) main::b2#3 )
(byte) main::b1#1 ← phi( main::@2/(byte) main::b1#2 )
*((const byte*) main::SCREEN + (number) 0) ← (byte) main::b1#1
*((const byte*) main::SCREEN + (number) 1) ← (byte) main::b2#2
*((const byte*) main::SCREEN + (number) 2) ← (byte) main::b3#2
*((const byte*) main::SCREEN + (number) 0) ← (byte) main::b1
*((const byte*) main::SCREEN + (number) 1) ← (byte) main::b2
*((const byte*) main::SCREEN + (number) 2) ← (byte) main::b3
to:main::@return
main::@return: scope:[main] from main::@3
return
@ -72,21 +63,9 @@ SYMBOL TABLE SSA
(label) main::@3
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(byte) main::b1
(byte) main::b1#0
(byte) main::b1#1
(byte) main::b1#2
(byte) main::b1#3
(byte) main::b2
(byte) main::b2#0
(byte) main::b2#1
(byte) main::b2#2
(byte) main::b2#3
(byte) main::b3
(byte) main::b3#0
(byte) main::b3#1
(byte) main::b3#2
(byte) main::b3#3
(byte) main::b1 loadstore
(byte) main::b2 loadstore
(byte) main::b3 loadstore
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
(label) setByte::@return
(byte) setByte::b
@ -100,9 +79,9 @@ SYMBOL TABLE SSA
(byte*) setByte::ptr#2
(byte*) setByte::ptr#3
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← (byte) main::b1#1
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← (byte) main::b2#2
Adding number conversion cast (unumber) 2 in *((const byte*) main::SCREEN + (number) 2) ← (byte) main::b3#2
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← (byte) main::b1
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← (byte) main::b2
Adding number conversion cast (unumber) 2 in *((const byte*) main::SCREEN + (number) 2) ← (byte) main::b3
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
@ -113,18 +92,14 @@ Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::b2#0 = (byte) main::b2#1 (byte) main::b2#3 (byte) main::b2#2
Alias (byte) main::b3#0 = (byte) main::b3#3 (byte) main::b3#1 (byte) main::b3#2
Alias (byte) main::b1#0 = (byte) main::b1#3 (byte) main::b1#2 (byte) main::b1#1
Successful SSA optimization Pass2AliasElimination
Constant (const byte*) setByte::ptr#0 = &main::b1#0
Constant (const byte*) setByte::ptr#0 = &main::b1
Constant (const byte) setByte::b#0 = 'c'
Constant (const byte*) setByte::ptr#1 = &main::b2#0
Constant (const byte*) setByte::ptr#1 = &main::b2
Constant (const byte) setByte::b#1 = 'm'
Constant (const byte*) setByte::ptr#2 = &main::b3#0
Constant (const byte*) setByte::ptr#2 = &main::b3
Constant (const byte) setByte::b#2 = 'l'
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::SCREEN in [15] *((const byte*) main::SCREEN + (byte) 0) ← (byte) main::b1#0
Simplifying expression containing zero main::SCREEN in [12] *((const byte*) main::SCREEN + (byte) 0) ← (byte) main::b1
Successful SSA optimization PassNSimplifyExpressionWithZero
Inlining constant with var siblings (const byte*) setByte::ptr#0
Inlining constant with var siblings (const byte) setByte::b#0
@ -132,9 +107,9 @@ Inlining constant with var siblings (const byte*) setByte::ptr#1
Inlining constant with var siblings (const byte) setByte::b#1
Inlining constant with var siblings (const byte*) setByte::ptr#2
Inlining constant with var siblings (const byte) setByte::b#2
Constant inlined setByte::ptr#1 = &(byte) main::b2#0
Constant inlined setByte::ptr#2 = &(byte) main::b3#0
Constant inlined setByte::ptr#0 = &(byte) main::b1#0
Constant inlined setByte::ptr#1 = &(byte) main::b2
Constant inlined setByte::ptr#2 = &(byte) main::b3
Constant inlined setByte::ptr#0 = &(byte) main::b1
Constant inlined setByte::b#2 = (byte) 'l'
Constant inlined setByte::b#1 = (byte) 'm'
Constant inlined setByte::b#0 = (byte) 'c'
@ -175,9 +150,9 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte) main::b1#0 ← (byte) 0
[5] (byte) main::b2#0 ← (byte) 0
[6] (byte) main::b3#0 ← (byte) 0
[4] (byte) main::b1 ← (byte) 0
[5] (byte) main::b2 ← (byte) 0
[6] (byte) main::b3 ← (byte) 0
[7] call setByte
to:main::@1
main::@1: scope:[main] from main
@ -189,9 +164,9 @@ main::@2: scope:[main] from main::@1
[11] call setByte
to:main::@3
main::@3: scope:[main] from main::@2
[12] *((const byte*) main::SCREEN) ← (byte) main::b1#0
[13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0
[14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0
[12] *((const byte*) main::SCREEN) ← (byte) main::b1
[13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2
[14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3
to:main::@return
main::@return: scope:[main] from main::@3
[15] return
@ -199,7 +174,7 @@ main::@return: scope:[main] from main::@3
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
setByte: scope:[setByte] from main main::@1 main::@2
[16] (byte*) setByte::ptr#3 ← phi( main/&(byte) main::b1#0 main::@1/&(byte) main::b2#0 main::@2/&(byte) main::b3#0 )
[16] (byte*) setByte::ptr#3 ← phi( main/&(byte) main::b1 main::@1/&(byte) main::b2 main::@2/&(byte) main::b3 )
[16] (byte) setByte::b#3 ← phi( main/(byte) 'c' main::@1/(byte) 'm' main::@2/(byte) 'l' )
[17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3
to:setByte::@return
@ -210,12 +185,9 @@ setByte::@return: scope:[setByte] from setByte
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::b1
(byte) main::b1#0 0.36363636363636365
(byte) main::b2
(byte) main::b2#0 0.36363636363636365
(byte) main::b3
(byte) main::b3#0 0.36363636363636365
(byte) main::b1 loadstore 0.36363636363636365
(byte) main::b2 loadstore 0.36363636363636365
(byte) main::b3 loadstore 0.36363636363636365
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
(byte) setByte::b
(byte) setByte::b#3 2.0
@ -225,17 +197,20 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ setByte::b#3 ]
[ setByte::ptr#3 ]
Added variable main::b1 to live range equivalence class [ main::b1 ]
Added variable main::b2 to live range equivalence class [ main::b2 ]
Added variable main::b3 to live range equivalence class [ main::b3 ]
Complete equivalence classes
[ setByte::b#3 ]
[ setByte::ptr#3 ]
[ main::b1#0 ]
[ main::b2#0 ]
[ main::b3#0 ]
[ main::b1 ]
[ main::b2 ]
[ main::b3 ]
Allocated zp[1]:2 [ setByte::b#3 ]
Allocated zp[2]:3 [ setByte::ptr#3 ]
Allocated zp[1]:5 [ main::b1#0 ]
Allocated zp[1]:6 [ main::b2#0 ]
Allocated zp[1]:7 [ main::b3#0 ]
Allocated zp[1]:5 [ main::b1 ]
Allocated zp[1]:6 [ main::b2 ]
Allocated zp[1]:7 [ main::b3 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -266,19 +241,19 @@ main: {
.label b1 = 5
.label b2 = 6
.label b3 = 7
// [4] (byte) main::b1#0 ← (byte) 0 -- vbuz1=vbuc1
// [4] (byte) main::b1 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b1
// [5] (byte) main::b2#0 ← (byte) 0 -- vbuz1=vbuc1
// [5] (byte) main::b2 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b2
// [6] (byte) main::b3#0 ← (byte) 0 -- vbuz1=vbuc1
// [6] (byte) main::b3 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b3
// [7] call setByte
// [16] phi from main to setByte [phi:main->setByte]
setByte_from_main:
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1#0 [phi:main->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1 [phi:main->setByte#0] -- pbuz1=pbuc1
lda #<b1
sta.z setByte.ptr
lda #>b1
@ -295,7 +270,7 @@ main: {
// [9] call setByte
// [16] phi from main::@1 to setByte [phi:main::@1->setByte]
setByte_from___b1:
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2#0 [phi:main::@1->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2 [phi:main::@1->setByte#0] -- pbuz1=pbuc1
lda #<b2
sta.z setByte.ptr
lda #>b2
@ -312,7 +287,7 @@ main: {
// [11] call setByte
// [16] phi from main::@2 to setByte [phi:main::@2->setByte]
setByte_from___b2:
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3#0 [phi:main::@2->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3 [phi:main::@2->setByte#0] -- pbuz1=pbuc1
lda #<b3
sta.z setByte.ptr
lda #>b3
@ -324,13 +299,13 @@ main: {
jmp __b3
// main::@3
__b3:
// [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1
// [12] *((const byte*) main::SCREEN) ← (byte) main::b1 -- _deref_pbuc1=vbuz1
lda.z b1
sta SCREEN
// [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1
// [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2 -- _deref_pbuc1=vbuz1
lda.z b2
sta SCREEN+1
// [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1
// [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3 -- _deref_pbuc1=vbuz1
lda.z b3
sta SCREEN+2
jmp __breturn
@ -357,37 +332,37 @@ setByte: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte) main::b1#0 ← (byte) 0 [ main::b1#0 ] ( main:2 [ main::b1#0 ] ) always clobbers reg byte a
Statement [5] (byte) main::b2#0 ← (byte) 0 [ main::b1#0 main::b2#0 ] ( main:2 [ main::b1#0 main::b2#0 ] ) always clobbers reg byte a
Statement [6] (byte) main::b3#0 ← (byte) 0 [ main::b1#0 main::b2#0 main::b3#0 ] ( main:2 [ main::b1#0 main::b2#0 main::b3#0 ] ) always clobbers reg byte a
Statement [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 [ main::b2#0 main::b3#0 ] ( main:2 [ main::b2#0 main::b3#0 ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 [ main::b3#0 ] ( main:2 [ main::b3#0 ] ) always clobbers reg byte a
Statement [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 [ main::b1#0 main::b2#0 main::b3#0 ] ( main:2::setByte:7 [ main::b1#0 main::b2#0 main::b3#0 ] main:2::setByte:9 [ main::b1#0 main::b2#0 main::b3#0 ] main:2::setByte:11 [ main::b1#0 main::b2#0 main::b3#0 ] ) always clobbers reg byte y
Statement [4] (byte) main::b1 ← (byte) 0 [ main::b1 ] ( main:2 [ main::b1 ] ) always clobbers reg byte a
Statement [5] (byte) main::b2 ← (byte) 0 [ main::b1 main::b2 ] ( main:2 [ main::b1 main::b2 ] ) always clobbers reg byte a
Statement [6] (byte) main::b3 ← (byte) 0 [ main::b1 main::b2 main::b3 ] ( main:2 [ main::b1 main::b2 main::b3 ] ) always clobbers reg byte a
Statement [12] *((const byte*) main::SCREEN) ← (byte) main::b1 [ main::b2 main::b3 ] ( main:2 [ main::b2 main::b3 ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2 [ main::b3 ] ( main:2 [ main::b3 ] ) always clobbers reg byte a
Statement [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 [ main::b1 main::b2 main::b3 ] ( main:2::setByte:7 [ main::b1 main::b2 main::b3 ] main:2::setByte:9 [ main::b1 main::b2 main::b3 ] main:2::setByte:11 [ main::b1 main::b2 main::b3 ] ) always clobbers reg byte y
Potential registers zp[1]:2 [ setByte::b#3 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:3 [ setByte::ptr#3 ] : zp[2]:3 ,
Potential registers zp[1]:5 [ main::b1#0 ] : zp[1]:5 ,
Potential registers zp[1]:6 [ main::b2#0 ] : zp[1]:6 ,
Potential registers zp[1]:7 [ main::b3#0 ] : zp[1]:7 ,
Potential registers zp[1]:5 [ main::b1 ] : zp[1]:5 ,
Potential registers zp[1]:6 [ main::b2 ] : zp[1]:6 ,
Potential registers zp[1]:7 [ main::b3 ] : zp[1]:7 ,
REGISTER UPLIFT SCOPES
Uplift Scope [setByte] 2: zp[1]:2 [ setByte::b#3 ] 2: zp[2]:3 [ setByte::ptr#3 ]
Uplift Scope [main] 0.36: zp[1]:5 [ main::b1#0 ] 0.36: zp[1]:6 [ main::b2#0 ] 0.36: zp[1]:7 [ main::b3#0 ]
Uplift Scope [main] 0.36: zp[1]:5 [ main::b1 ] 0.36: zp[1]:6 [ main::b2 ] 0.36: zp[1]:7 [ main::b3 ]
Uplift Scope []
Uplifting [setByte] best 139 combination reg byte x [ setByte::b#3 ] zp[2]:3 [ setByte::ptr#3 ]
Uplifting [main] best 139 combination zp[1]:5 [ main::b1#0 ] zp[1]:6 [ main::b2#0 ] zp[1]:7 [ main::b3#0 ]
Uplifting [main] best 139 combination zp[1]:5 [ main::b1 ] zp[1]:6 [ main::b2 ] zp[1]:7 [ main::b3 ]
Uplifting [] best 139 combination
Attempting to uplift remaining variables inzp[1]:5 [ main::b1#0 ]
Uplifting [main] best 139 combination zp[1]:5 [ main::b1#0 ]
Attempting to uplift remaining variables inzp[1]:6 [ main::b2#0 ]
Uplifting [main] best 139 combination zp[1]:6 [ main::b2#0 ]
Attempting to uplift remaining variables inzp[1]:7 [ main::b3#0 ]
Uplifting [main] best 139 combination zp[1]:7 [ main::b3#0 ]
Attempting to uplift remaining variables inzp[1]:5 [ main::b1 ]
Uplifting [main] best 139 combination zp[1]:5 [ main::b1 ]
Attempting to uplift remaining variables inzp[1]:6 [ main::b2 ]
Uplifting [main] best 139 combination zp[1]:6 [ main::b2 ]
Attempting to uplift remaining variables inzp[1]:7 [ main::b3 ]
Uplifting [main] best 139 combination zp[1]:7 [ main::b3 ]
Allocated (was zp[2]:3) zp[2]:2 [ setByte::ptr#3 ]
Allocated (was zp[1]:5) zp[1]:4 [ main::b1#0 ]
Allocated (was zp[1]:6) zp[1]:5 [ main::b2#0 ]
Allocated (was zp[1]:7) zp[1]:6 [ main::b3#0 ]
Allocated (was zp[1]:5) zp[1]:4 [ main::b1 ]
Allocated (was zp[1]:6) zp[1]:5 [ main::b2 ]
Allocated (was zp[1]:7) zp[1]:6 [ main::b3 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -417,19 +392,19 @@ main: {
.label b1 = 4
.label b2 = 5
.label b3 = 6
// [4] (byte) main::b1#0 ← (byte) 0 -- vbuz1=vbuc1
// [4] (byte) main::b1 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b1
// [5] (byte) main::b2#0 ← (byte) 0 -- vbuz1=vbuc1
// [5] (byte) main::b2 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b2
// [6] (byte) main::b3#0 ← (byte) 0 -- vbuz1=vbuc1
// [6] (byte) main::b3 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b3
// [7] call setByte
// [16] phi from main to setByte [phi:main->setByte]
setByte_from_main:
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1#0 [phi:main->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1 [phi:main->setByte#0] -- pbuz1=pbuc1
lda #<b1
sta.z setByte.ptr
lda #>b1
@ -445,7 +420,7 @@ main: {
// [9] call setByte
// [16] phi from main::@1 to setByte [phi:main::@1->setByte]
setByte_from___b1:
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2#0 [phi:main::@1->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2 [phi:main::@1->setByte#0] -- pbuz1=pbuc1
lda #<b2
sta.z setByte.ptr
lda #>b2
@ -461,7 +436,7 @@ main: {
// [11] call setByte
// [16] phi from main::@2 to setByte [phi:main::@2->setByte]
setByte_from___b2:
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3#0 [phi:main::@2->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3 [phi:main::@2->setByte#0] -- pbuz1=pbuc1
lda #<b3
sta.z setByte.ptr
lda #>b3
@ -472,13 +447,13 @@ main: {
jmp __b3
// main::@3
__b3:
// [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1
// [12] *((const byte*) main::SCREEN) ← (byte) main::b1 -- _deref_pbuc1=vbuz1
lda.z b1
sta SCREEN
// [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1
// [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2 -- _deref_pbuc1=vbuz1
lda.z b2
sta SCREEN+1
// [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1
// [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3 -- _deref_pbuc1=vbuz1
lda.z b3
sta SCREEN+2
jmp __breturn
@ -548,12 +523,9 @@ FINAL SYMBOL TABLE
(label) main::@3
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::b1
(byte) main::b1#0 b1 zp[1]:4 0.36363636363636365
(byte) main::b2
(byte) main::b2#0 b2 zp[1]:5 0.36363636363636365
(byte) main::b3
(byte) main::b3#0 b3 zp[1]:6 0.36363636363636365
(byte) main::b1 loadstore zp[1]:4 0.36363636363636365
(byte) main::b2 loadstore zp[1]:5 0.36363636363636365
(byte) main::b3 loadstore zp[1]:6 0.36363636363636365
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
(label) setByte::@return
(byte) setByte::b
@ -563,9 +535,9 @@ FINAL SYMBOL TABLE
reg byte x [ setByte::b#3 ]
zp[2]:2 [ setByte::ptr#3 ]
zp[1]:4 [ main::b1#0 ]
zp[1]:5 [ main::b2#0 ]
zp[1]:6 [ main::b3#0 ]
zp[1]:4 [ main::b1 ]
zp[1]:5 [ main::b2 ]
zp[1]:6 [ main::b3 ]
FINAL ASSEMBLER
@ -591,19 +563,19 @@ main: {
.label b2 = 5
.label b3 = 6
// b1 = 0
// [4] (byte) main::b1#0 ← (byte) 0 -- vbuz1=vbuc1
// [4] (byte) main::b1 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z b1
// b2 = 0
// [5] (byte) main::b2#0 ← (byte) 0 -- vbuz1=vbuc1
// [5] (byte) main::b2 ← (byte) 0 -- vbuz1=vbuc1
sta.z b2
// b3 = 0
// [6] (byte) main::b3#0 ← (byte) 0 -- vbuz1=vbuc1
// [6] (byte) main::b3 ← (byte) 0 -- vbuz1=vbuc1
sta.z b3
// setByte(&b1, 'c')
// [7] call setByte
// [16] phi from main to setByte [phi:main->setByte]
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1#0 [phi:main->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1 [phi:main->setByte#0] -- pbuz1=pbuc1
lda #<b1
sta.z setByte.ptr
lda #>b1
@ -616,7 +588,7 @@ main: {
// setByte(&b2, 'm')
// [9] call setByte
// [16] phi from main::@1 to setByte [phi:main::@1->setByte]
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2#0 [phi:main::@1->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2 [phi:main::@1->setByte#0] -- pbuz1=pbuc1
lda #<b2
sta.z setByte.ptr
lda #>b2
@ -629,7 +601,7 @@ main: {
// setByte(&b3, 'l')
// [11] call setByte
// [16] phi from main::@2 to setByte [phi:main::@2->setByte]
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3#0 [phi:main::@2->setByte#0] -- pbuz1=pbuc1
// [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3 [phi:main::@2->setByte#0] -- pbuz1=pbuc1
lda #<b3
sta.z setByte.ptr
lda #>b3
@ -639,15 +611,15 @@ main: {
jsr setByte
// main::@3
// SCREEN[0] = b1
// [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1
// [12] *((const byte*) main::SCREEN) ← (byte) main::b1 -- _deref_pbuc1=vbuz1
lda.z b1
sta SCREEN
// SCREEN[1] = b2
// [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1
// [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2 -- _deref_pbuc1=vbuz1
lda.z b2
sta SCREEN+1
// SCREEN[2] = b3
// [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1
// [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3 -- _deref_pbuc1=vbuz1
lda.z b3
sta SCREEN+2
// main::@return

@ -7,12 +7,9 @@
(label) main::@3
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::b1
(byte) main::b1#0 b1 zp[1]:4 0.36363636363636365
(byte) main::b2
(byte) main::b2#0 b2 zp[1]:5 0.36363636363636365
(byte) main::b3
(byte) main::b3#0 b3 zp[1]:6 0.36363636363636365
(byte) main::b1 loadstore zp[1]:4 0.36363636363636365
(byte) main::b2 loadstore zp[1]:5 0.36363636363636365
(byte) main::b3 loadstore zp[1]:6 0.36363636363636365
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
(label) setByte::@return
(byte) setByte::b
@ -22,6 +19,6 @@
reg byte x [ setByte::b#3 ]
zp[2]:2 [ setByte::ptr#3 ]
zp[1]:4 [ main::b1#0 ]
zp[1]:5 [ main::b2#0 ]
zp[1]:6 [ main::b3#0 ]
zp[1]:4 [ main::b1 ]
zp[1]:5 [ main::b2 ]
zp[1]:6 [ main::b3 ]

@ -1,5 +1,5 @@
@begin: scope:[] from
[0] (byte) val#0 ← (byte) 0
[0] (byte) val ← (byte) 0
to:@1
@1: scope:[] from @begin
[1] phi()
@ -10,26 +10,26 @@
(void()) main()
main: scope:[main] from @1
[4] *((const byte*) main::SCREEN1) ← (byte) val#0
[4] *((const byte*) main::SCREEN1) ← (byte) val
[5] *((const byte*) main::SCREEN2) ← (byte) '.'
[6] (byte) val#1 ← (byte) 1
[7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val#1
[6] (byte) val ← (byte) 1
[7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val
[8] *((const byte*) main::SCREEN2+(byte) 1) ← (byte) '.'
[9] (byte) val#2 ← (byte) 2
[10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val#2
[9] (byte) val ← (byte) 2
[10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val
[11] *((const byte*) main::SCREEN2+(byte) 2) ← *((const byte*) main::ptr)
[12] *((const byte*) main::ptr) ← (byte) 3
[13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val#2
[13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val
[14] *((const byte*) main::SCREEN2+(byte) 3) ← *((const byte*) main::ptr)
[15] call setv
to:main::@1
main::@1: scope:[main] from main
[16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val#12
[16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val
[17] *((const byte*) main::SCREEN2+(byte) 4) ← *((const byte*) main::ptr)
[18] call setp
to:main::@2
main::@2: scope:[main] from main::@1
[19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val#12
[19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val
[20] *((const byte*) main::SCREEN2+(byte) 5) ← *((const byte*) main::ptr)
to:main::@return
main::@return: scope:[main] from main::@2
@ -46,7 +46,7 @@ setp::@return: scope:[setp] from setp
(void()) setv((byte) setv::v)
setv: scope:[setv] from main
[24] (byte) val#12 ← (const byte) setv::v#0
[24] (byte) val ← (const byte) setv::v#0
to:setv::@return
setv::@return: scope:[setv] from setv
[25] return

@ -5,26 +5,25 @@ Culled Empty Block (label) @2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte) val#0 ← (byte) 0
(byte) val ← (byte) 0
to:@3
(void()) main()
main: scope:[main] from @3
(byte) val#8 ← phi( @3/(byte) val#14 )
(byte) main::idx#0 ← (byte) 0
*((const byte*) main::SCREEN1 + (byte) main::idx#0) ← (byte) val#8
*((const byte*) main::SCREEN1 + (byte) main::idx#0) ← (byte) val
*((const byte*) main::SCREEN2 + (byte) main::idx#0) ← (byte) '.'
(byte) main::idx#1 ← ++ (byte) main::idx#0
(byte) val#1 ← (number) 1
*((const byte*) main::SCREEN1 + (byte) main::idx#1) ← (byte) val#1
(byte) val ← (number) 1
*((const byte*) main::SCREEN1 + (byte) main::idx#1) ← (byte) val
*((const byte*) main::SCREEN2 + (byte) main::idx#1) ← (byte) '.'
(byte) main::idx#2 ← ++ (byte) main::idx#1
(byte) val#2 ← (number) 2
*((const byte*) main::SCREEN1 + (byte) main::idx#2) ← (byte) val#2
(byte) val ← (number) 2
*((const byte*) main::SCREEN1 + (byte) main::idx#2) ← (byte) val
*((const byte*) main::SCREEN2 + (byte) main::idx#2) ← *((const byte*) main::ptr)
(byte) main::idx#3 ← ++ (byte) main::idx#2
*((const byte*) main::ptr) ← (number) 3
*((const byte*) main::SCREEN1 + (byte) main::idx#3) ← (byte) val#2
*((const byte*) main::SCREEN1 + (byte) main::idx#3) ← (byte) val
*((const byte*) main::SCREEN2 + (byte) main::idx#3) ← *((const byte*) main::ptr)
(byte) main::idx#4 ← ++ (byte) main::idx#3
(byte) setv::v#0 ← (number) 4
@ -32,9 +31,7 @@ main: scope:[main] from @3
to:main::@1
main::@1: scope:[main] from main
(byte) main::idx#7 ← phi( main/(byte) main::idx#4 )
(byte) val#9 ← phi( main/(byte) val#6 )
(byte) val#3 ← (byte) val#9
*((const byte*) main::SCREEN1 + (byte) main::idx#7) ← (byte) val#3
*((const byte*) main::SCREEN1 + (byte) main::idx#7) ← (byte) val
*((const byte*) main::SCREEN2 + (byte) main::idx#7) ← *((const byte*) main::ptr)
(byte) main::idx#5 ← ++ (byte) main::idx#7
(byte*) setp::p#0 ← (const byte*) main::ptr
@ -43,25 +40,20 @@ main::@1: scope:[main] from main
to:main::@2
main::@2: scope:[main] from main::@1
(byte) main::idx#8 ← phi( main::@1/(byte) main::idx#5 )
(byte) val#10 ← phi( main::@1/(byte) val#3 )
*((const byte*) main::SCREEN1 + (byte) main::idx#8) ← (byte) val#10
*((const byte*) main::SCREEN1 + (byte) main::idx#8) ← (byte) val
*((const byte*) main::SCREEN2 + (byte) main::idx#8) ← *((const byte*) main::ptr)
(byte) main::idx#6 ← ++ (byte) main::idx#8
to:main::@return
main::@return: scope:[main] from main::@2
(byte) val#11 ← phi( main::@2/(byte) val#10 )
(byte) val#4 ← (byte) val#11
return
to:@return
(void()) setv((byte) setv::v)
setv: scope:[setv] from main
(byte) setv::v#1 ← phi( main/(byte) setv::v#0 )
(byte) val#5 ← (byte) setv::v#1
(byte) val ← (byte) setv::v#1
to:setv::@return
setv::@return: scope:[setv] from setv
(byte) val#12 ← phi( setv/(byte) val#5 )
(byte) val#6 ← (byte) val#12
return
to:@return
@ -75,12 +67,9 @@ setp::@return: scope:[setp] from setp
return
to:@return
@3: scope:[] from @begin
(byte) val#14 ← phi( @begin/(byte) val#0 )
call main
to:@4
@4: scope:[] from @3
(byte) val#13 ← phi( @3/(byte) val#4 )
(byte) val#7 ← (byte) val#13
to:@end
@end: scope:[] from @4
@ -119,32 +108,17 @@ SYMBOL TABLE SSA
(byte) setv::v
(byte) setv::v#0
(byte) setv::v#1
(byte) val
(byte) val#0
(byte) val#1
(byte) val#10
(byte) val#11
(byte) val#12
(byte) val#13
(byte) val#14
(byte) val#2
(byte) val#3
(byte) val#4
(byte) val#5
(byte) val#6
(byte) val#7
(byte) val#8
(byte) val#9
(byte) val loadstore
Adding number conversion cast (unumber) $28 in
Adding number conversion cast (unumber) 1 in (byte) val#1 ← (number) 1
Adding number conversion cast (unumber) 2 in (byte) val#2 ← (number) 2
Adding number conversion cast (unumber) 1 in (byte) val ← (number) 1
Adding number conversion cast (unumber) 2 in (byte) val ← (number) 2
Adding number conversion cast (unumber) 3 in *((const byte*) main::ptr) ← (number) 3
Adding number conversion cast (unumber) 4 in (byte) setv::v#0 ← (number) 4
Adding number conversion cast (unumber) 5 in (byte) setp::v#0 ← (number) 5
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) val#1 ← (unumber)(number) 1
Inlining cast (byte) val#2 ← (unumber)(number) 2
Inlining cast (byte) val ← (unumber)(number) 1
Inlining cast (byte) val ← (unumber)(number) 2
Inlining cast *((const byte*) main::ptr) ← (unumber)(number) 3
Inlining cast (byte) setv::v#0 ← (unumber)(number) 4
Inlining cast (byte) setp::v#0 ← (unumber)(number) 5
@ -165,26 +139,19 @@ Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 5
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::idx#4 = (byte) main::idx#7
Alias (byte) val#10 = (byte) val#3 (byte) val#9 (byte) val#11 (byte) val#4
Alias (byte) main::idx#5 = (byte) main::idx#8
Alias (byte) val#12 = (byte) val#5 (byte) val#6
Alias (byte) val#0 = (byte) val#14
Alias (byte) val#13 = (byte) val#7
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) val#8 (byte) val#0
Identical Phi Values (byte) val#10 (byte) val#12
Identical Phi Values (byte) setv::v#1 (byte) setv::v#0
Identical Phi Values (byte) setp::v#1 (byte) setp::v#0
Identical Phi Values (byte*) setp::p#1 (byte*) setp::p#0
Identical Phi Values (byte) val#13 (byte) val#10
Successful SSA optimization Pass2IdenticalPhiElimination
Constant (const byte) main::idx#0 = 0
Constant (const byte) setv::v#0 = 4
Constant (const byte*) setp::p#0 = main::ptr
Constant (const byte) setp::v#0 = 5
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::SCREEN1 in [3] *((const byte*) main::SCREEN1 + (const byte) main::idx#0) ← (byte) val#0
Simplifying expression containing zero main::SCREEN2 in [4] *((const byte*) main::SCREEN2 + (const byte) main::idx#0) ← (byte) '.'
Simplifying expression containing zero main::SCREEN1 in [2] *((const byte*) main::SCREEN1 + (const byte) main::idx#0) ← (byte) val
Simplifying expression containing zero main::SCREEN2 in [3] *((const byte*) main::SCREEN2 + (const byte) main::idx#0) ← (byte) '.'
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) main::idx#6 and assignment [23] (byte) main::idx#6 ← ++ (byte) main::idx#5
Successful SSA optimization PassNEliminateUnusedVars
@ -265,7 +232,7 @@ Adding NOP phi() at start of @end
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] (byte) val#0 ← (byte) 0
[0] (byte) val ← (byte) 0
to:@1
@1: scope:[] from @begin
[1] phi()
@ -276,26 +243,26 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] *((const byte*) main::SCREEN1) ← (byte) val#0
[4] *((const byte*) main::SCREEN1) ← (byte) val
[5] *((const byte*) main::SCREEN2) ← (byte) '.'
[6] (byte) val#1 ← (byte) 1
[7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val#1
[6] (byte) val ← (byte) 1
[7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val
[8] *((const byte*) main::SCREEN2+(byte) 1) ← (byte) '.'
[9] (byte) val#2 ← (byte) 2
[10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val#2
[9] (byte) val ← (byte) 2
[10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val
[11] *((const byte*) main::SCREEN2+(byte) 2) ← *((const byte*) main::ptr)
[12] *((const byte*) main::ptr) ← (byte) 3
[13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val#2
[13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val
[14] *((const byte*) main::SCREEN2+(byte) 3) ← *((const byte*) main::ptr)
[15] call setv
to:main::@1
main::@1: scope:[main] from main
[16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val#12
[16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val
[17] *((const byte*) main::SCREEN2+(byte) 4) ← *((const byte*) main::ptr)
[18] call setp
to:main::@2
main::@2: scope:[main] from main::@1
[19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val#12
[19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val
[20] *((const byte*) main::SCREEN2+(byte) 5) ← *((const byte*) main::ptr)
to:main::@return
main::@return: scope:[main] from main::@2
@ -312,7 +279,7 @@ setp::@return: scope:[setp] from setp
(void()) setv((byte) setv::v)
setv: scope:[setv] from main
[24] (byte) val#12 ← (const byte) setv::v#0
[24] (byte) val ← (const byte) setv::v#0
to:setv::@return
setv::@return: scope:[setv] from setv
[25] return
@ -327,19 +294,13 @@ VARIABLE REGISTER WEIGHTS
(byte) setp::v
(void()) setv((byte) setv::v)
(byte) setv::v
(byte) val
(byte) val#0 2.0
(byte) val#1 4.0
(byte) val#12 1.0
(byte) val#2 1.5
(byte) val loadstore 1.5384615384615383
Initial phi equivalence classes
Coalescing volatile variable equivalence classes [ val#0 ] and [ val#1 ]
Coalescing volatile variable equivalence classes [ val#0 val#1 ] and [ val#2 ]
Coalescing volatile variable equivalence classes [ val#0 val#1 val#2 ] and [ val#12 ]
Added variable val to live range equivalence class [ val ]
Complete equivalence classes
[ val#0 val#1 val#2 val#12 ]
Allocated zp[1]:2 [ val#0 val#1 val#2 val#12 ]
[ val ]
Allocated zp[1]:2 [ val ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -353,7 +314,7 @@ Target platform is c64basic / MOS6502X
.label val = 2
// @begin
__bbegin:
// [0] (byte) val#0 ← (byte) 0 -- vbuz1=vbuc1
// [0] (byte) val ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z val
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -374,27 +335,27 @@ main: {
.label SCREEN2 = SCREEN1+$28
// Use address-of - hereafter all versions of val must be in the same memory
.label ptr = val
// [4] *((const byte*) main::SCREEN1) ← (byte) val#0 -- _deref_pbuc1=vbuz1
// [4] *((const byte*) main::SCREEN1) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1
// [5] *((const byte*) main::SCREEN2) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2
// [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
// [6] (byte) val ← (byte) 1 -- vbuz1=vbuc1
// Here we have not yet used address-of - so val can be versioned freely
lda #1
sta.z val
// [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
// [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+1
// [8] *((const byte*) main::SCREEN2+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2+1
// [9] (byte) val#2 ← (byte) 2 -- vbuz1=vbuc1
// [9] (byte) val ← (byte) 2 -- vbuz1=vbuc1
// Set value directly
lda #2
sta.z val
// [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val#2 -- _deref_pbuc1=vbuz1
// [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+2
// [11] *((const byte*) main::SCREEN2+(byte) 2) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -404,7 +365,7 @@ main: {
// Set value through pointer
lda #3
sta.z ptr
// [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val#2 -- _deref_pbuc1=vbuz1
// [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+3
// [14] *((const byte*) main::SCREEN2+(byte) 3) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -415,7 +376,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val#12 -- _deref_pbuc1=vbuz1
// [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+4
// [17] *((const byte*) main::SCREEN2+(byte) 4) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -426,7 +387,7 @@ main: {
jmp __b2
// main::@2
__b2:
// [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val#12 -- _deref_pbuc1=vbuz1
// [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+5
// [20] *((const byte*) main::SCREEN2+(byte) 5) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -453,7 +414,7 @@ setp: {
// setv
setv: {
.const v = 4
// [24] (byte) val#12 ← (const byte) setv::v#0 -- vbuz1=vbuc1
// [24] (byte) val ← (const byte) setv::v#0 -- vbuz1=vbuc1
lda #v
sta.z val
jmp __breturn
@ -465,38 +426,38 @@ setv: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] (byte) val#0 ← (byte) 0 [ val#0 ] ( [ val#0 ] ) always clobbers reg byte a
Statement [4] *((const byte*) main::SCREEN1) ← (byte) val#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [0] (byte) val ← (byte) 0 [ val ] ( [ val ] ) always clobbers reg byte a
Statement [4] *((const byte*) main::SCREEN1) ← (byte) val [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) main::SCREEN2) ← (byte) '.' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) val#1 ← (byte) 1 [ val#1 ] ( main:2 [ val#1 ] ) always clobbers reg byte a
Statement [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val#1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) val ← (byte) 1 [ val ] ( main:2 [ val ] ) always clobbers reg byte a
Statement [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) main::SCREEN2+(byte) 1) ← (byte) '.' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] (byte) val#2 ← (byte) 2 [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val#2 [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [11] *((const byte*) main::SCREEN2+(byte) 2) ← *((const byte*) main::ptr) [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [12] *((const byte*) main::ptr) ← (byte) 3 [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val#2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] (byte) val ← (byte) 2 [ val ] ( main:2 [ val ] ) always clobbers reg byte a
Statement [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val [ val ] ( main:2 [ val ] ) always clobbers reg byte a
Statement [11] *((const byte*) main::SCREEN2+(byte) 2) ← *((const byte*) main::ptr) [ val ] ( main:2 [ val ] ) always clobbers reg byte a
Statement [12] *((const byte*) main::ptr) ← (byte) 3 [ val ] ( main:2 [ val ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) main::SCREEN2+(byte) 3) ← *((const byte*) main::ptr) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val#12 [ val#12 ] ( main:2 [ val#12 ] ) always clobbers reg byte a
Statement [17] *((const byte*) main::SCREEN2+(byte) 4) ← *((const byte*) main::ptr) [ val#12 ] ( main:2 [ val#12 ] ) always clobbers reg byte a
Statement [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val#12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val [ val ] ( main:2 [ val ] ) always clobbers reg byte a
Statement [17] *((const byte*) main::SCREEN2+(byte) 4) ← *((const byte*) main::ptr) [ val ] ( main:2 [ val ] ) always clobbers reg byte a
Statement [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [20] *((const byte*) main::SCREEN2+(byte) 5) ← *((const byte*) main::ptr) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [22] *((const byte*) main::ptr) ← (const byte) setp::v#0 [ ] ( main:2::setp:18 [ val#12 ] ) always clobbers reg byte a
Statement [24] (byte) val#12 ← (const byte) setv::v#0 [ val#12 ] ( main:2::setv:15 [ val#12 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ val#0 val#1 val#2 val#12 ] : zp[1]:2 ,
Statement [22] *((const byte*) main::ptr) ← (const byte) setp::v#0 [ ] ( main:2::setp:18 [ val ] ) always clobbers reg byte a
Statement [24] (byte) val ← (const byte) setv::v#0 [ val ] ( main:2::setv:15 [ val ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ val ] : zp[1]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 8.5: zp[1]:2 [ val#0 val#1 val#2 val#12 ]
Uplift Scope [] 1.54: zp[1]:2 [ val ]
Uplift Scope [main]
Uplift Scope [setv]
Uplift Scope [setp]
Uplifting [] best 169 combination zp[1]:2 [ val#0 val#1 val#2 val#12 ]
Uplifting [] best 169 combination zp[1]:2 [ val ]
Uplifting [main] best 169 combination
Uplifting [setv] best 169 combination
Uplifting [setp] best 169 combination
Attempting to uplift remaining variables inzp[1]:2 [ val#0 val#1 val#2 val#12 ]
Uplifting [] best 169 combination zp[1]:2 [ val#0 val#1 val#2 val#12 ]
Attempting to uplift remaining variables inzp[1]:2 [ val ]
Uplifting [] best 169 combination zp[1]:2 [ val ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -509,7 +470,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label val = 2
// @begin
__bbegin:
// [0] (byte) val#0 ← (byte) 0 -- vbuz1=vbuc1
// [0] (byte) val ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z val
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -530,27 +491,27 @@ main: {
.label SCREEN2 = SCREEN1+$28
// Use address-of - hereafter all versions of val must be in the same memory
.label ptr = val
// [4] *((const byte*) main::SCREEN1) ← (byte) val#0 -- _deref_pbuc1=vbuz1
// [4] *((const byte*) main::SCREEN1) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1
// [5] *((const byte*) main::SCREEN2) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2
// [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
// [6] (byte) val ← (byte) 1 -- vbuz1=vbuc1
// Here we have not yet used address-of - so val can be versioned freely
lda #1
sta.z val
// [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
// [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+1
// [8] *((const byte*) main::SCREEN2+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2+1
// [9] (byte) val#2 ← (byte) 2 -- vbuz1=vbuc1
// [9] (byte) val ← (byte) 2 -- vbuz1=vbuc1
// Set value directly
lda #2
sta.z val
// [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val#2 -- _deref_pbuc1=vbuz1
// [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+2
// [11] *((const byte*) main::SCREEN2+(byte) 2) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -560,7 +521,7 @@ main: {
// Set value through pointer
lda #3
sta.z ptr
// [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val#2 -- _deref_pbuc1=vbuz1
// [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+3
// [14] *((const byte*) main::SCREEN2+(byte) 3) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -571,7 +532,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val#12 -- _deref_pbuc1=vbuz1
// [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+4
// [17] *((const byte*) main::SCREEN2+(byte) 4) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -582,7 +543,7 @@ main: {
jmp __b2
// main::@2
__b2:
// [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val#12 -- _deref_pbuc1=vbuz1
// [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+5
// [20] *((const byte*) main::SCREEN2+(byte) 5) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -609,7 +570,7 @@ setp: {
// setv
setv: {
.const v = 4
// [24] (byte) val#12 ← (const byte) setv::v#0 -- vbuz1=vbuc1
// [24] (byte) val ← (const byte) setv::v#0 -- vbuz1=vbuc1
lda #v
sta.z val
jmp __breturn
@ -667,13 +628,9 @@ FINAL SYMBOL TABLE
(label) setv::@return
(byte) setv::v
(const byte) setv::v#0 v = (byte) 4
(byte) val
(byte) val#0 val zp[1]:2 2.0
(byte) val#1 val zp[1]:2 4.0
(byte) val#12 val zp[1]:2 1.0
(byte) val#2 val zp[1]:2 1.5
(byte) val loadstore zp[1]:2 1.5384615384615383
zp[1]:2 [ val#0 val#1 val#2 val#12 ]
zp[1]:2 [ val ]
FINAL ASSEMBLER
@ -690,7 +647,7 @@ Score: 148
// @begin
__bbegin:
// val = 0
// [0] (byte) val#0 ← (byte) 0 -- vbuz1=vbuc1
// [0] (byte) val ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta.z val
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -707,7 +664,7 @@ main: {
// Use address-of - hereafter all versions of val must be in the same memory
.label ptr = val
// SCREEN1[idx] = val
// [4] *((const byte*) main::SCREEN1) ← (byte) val#0 -- _deref_pbuc1=vbuz1
// [4] *((const byte*) main::SCREEN1) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1
// SCREEN2[idx++] = '.'
@ -715,24 +672,24 @@ main: {
lda #'.'
sta SCREEN2
// val = 1
// [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
// [6] (byte) val ← (byte) 1 -- vbuz1=vbuc1
// Here we have not yet used address-of - so val can be versioned freely
lda #1
sta.z val
// SCREEN1[idx] = val
// [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
// [7] *((const byte*) main::SCREEN1+(byte) 1) ← (byte) val -- _deref_pbuc1=vbuz1
sta SCREEN1+1
// SCREEN2[idx++] = '.'
// [8] *((const byte*) main::SCREEN2+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2+1
// val = 2
// [9] (byte) val#2 ← (byte) 2 -- vbuz1=vbuc1
// [9] (byte) val ← (byte) 2 -- vbuz1=vbuc1
// Set value directly
lda #2
sta.z val
// SCREEN1[idx] = val
// [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val#2 -- _deref_pbuc1=vbuz1
// [10] *((const byte*) main::SCREEN1+(byte) 2) ← (byte) val -- _deref_pbuc1=vbuz1
sta SCREEN1+2
// SCREEN2[idx++] = *ptr
// [11] *((const byte*) main::SCREEN2+(byte) 2) ← *((const byte*) main::ptr) -- _deref_pbuc1=_deref_pbuc2
@ -744,7 +701,7 @@ main: {
lda #3
sta.z ptr
// SCREEN1[idx] = val
// [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val#2 -- _deref_pbuc1=vbuz1
// [13] *((const byte*) main::SCREEN1+(byte) 3) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+3
// SCREEN2[idx++] = *ptr
@ -756,7 +713,7 @@ main: {
jsr setv
// main::@1
// SCREEN1[idx] = val
// [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val#12 -- _deref_pbuc1=vbuz1
// [16] *((const byte*) main::SCREEN1+(byte) 4) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+4
// SCREEN2[idx++] = *ptr
@ -768,7 +725,7 @@ main: {
jsr setp
// main::@2
// SCREEN1[idx] = val
// [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val#12 -- _deref_pbuc1=vbuz1
// [19] *((const byte*) main::SCREEN1+(byte) 5) ← (byte) val -- _deref_pbuc1=vbuz1
lda.z val
sta SCREEN1+5
// SCREEN2[idx++] = *ptr
@ -796,7 +753,7 @@ setp: {
setv: {
.const v = 4
// val = v
// [24] (byte) val#12 ← (const byte) setv::v#0 -- vbuz1=vbuc1
// [24] (byte) val ← (const byte) setv::v#0 -- vbuz1=vbuc1
lda #v
sta.z val
// setv::@return

@ -18,10 +18,6 @@
(label) setv::@return
(byte) setv::v
(const byte) setv::v#0 v = (byte) 4
(byte) val
(byte) val#0 val zp[1]:2 2.0
(byte) val#1 val zp[1]:2 4.0
(byte) val#12 val zp[1]:2 1.0
(byte) val#2 val zp[1]:2 1.5
(byte) val loadstore zp[1]:2 1.5384615384615383
zp[1]:2 [ val#0 val#1 val#2 val#12 ]
zp[1]:2 [ val ]

@ -118,55 +118,55 @@
// Right side collision (cell beyond the right side of the playfield)
.const COLLISION_RIGHT = 8
.const toSpritePtr1_return = PLAYFIELD_SPRITES/$40
.label render_screen_showing = $1a
.label render_screen_showing = $16
.label score_bcd = $17
.label irq_raster_next = $1b
.label irq_sprite_ypos = $1c
.label irq_sprite_ptr = $1d
.label irq_cnt = $1e
// Keyboard event buffer size. The number of events currently in the event buffer
.label keyboard_events_size = $12
.label score_bcd = 2
.label keyboard_events_size = $e
// The rate of moving down the current piece (number of frames between moves if movedown is not forced)
.label current_movedown_slow = 7
.label current_ypos = $17
.label current_movedown_slow = 3
.label current_ypos = $13
// Position of top left corner of current moving piece on the playfield
.label current_xpos = $2a
// The curent piece orientation - each piece have 4 orientations (00/0x10/0x20/0x30).
// The orientation chooses one of the 4 sub-graphics of the piece.
.label current_orientation = $10
.label current_orientation = $c
// Pointer to the current piece in the current orientation. Updated each time current_orientation is updated.
.label current_piece_gfx = $18
.label current_piece_gfx = $14
// The char of the current piece
.label current_piece_char = $25
// Current level BCD-format
.label level_bcd = 8
.label level_bcd = 4
// The current moving piece. Points to the start of the piece definition.
.label current_piece = $2b
// Is the game over?
.label game_over = $a
.label game_over = 6
// The index of the next moving piece. (0-6)
.label next_piece_idx = 9
.label next_piece_idx = 5
// Current level in normal (non-BCD) format
.label level = 6
.label level = 2
// The screen currently being rendered to. 0x00 for screen 1 / 0x20 for screen 2.
.label render_screen_render = $14
.label render_screen_render = $10
// The screen currently to show next to the user. 0x00 for screen 1 / 0x20 for screen 2.
// Show showing screen 1 and rendering to screen 2
.label render_screen_show = $13
.label render_screen_show = $f
// Counts up to the next movedown of current piece
.label current_movedown_counter = $b
.label current_movedown_counter = 7
// Current number of cleared lines in BCD-format
.label lines_bcd = $15
.label lines_bcd = $11
// The current moving piece. Points to the start of the piece definition.
.label current_piece_1 = $21
// The screen currently being rendered to. 0x00 for screen 1 / 0x20 for screen 2.
.label render_screen_render_1 = $c
.label render_screen_render_1 = 8
// Position of top left corner of current moving piece on the playfield
.label current_xpos_1 = $d
.label current_xpos_1 = 9
// Pointer to the current piece in the current orientation. Updated each time current_orientation is updated.
.label current_piece_gfx_1 = $23
// The char of the current piece
.label current_piece_char_1 = $e
.label current_piece_char_1 = $a
__b1:
// The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2.
lda #0
@ -412,7 +412,7 @@ render_next: {
.label next_piece_char = $20
.label next_piece_gfx = $23
.label screen_next_area = $21
.label l = $c
.label l = 8
cmp #0
beq __b1
lda #<PLAYFIELD_SCREEN_2+next_area_offset
@ -480,11 +480,11 @@ render_next: {
// Render the current moving piece at position (current_xpos, current_ypos)
// Ignores cases where parts of the tetromino is outside the playfield (sides/bottom) since the movement collision routine prevents this.
render_moving: {
.label ypos = $f
.label ypos = $b
.label screen_line = $21
.label xpos = $20
.label i = $1f
.label l = $11
.label l = $d
stx.z ypos
lda #0
sta.z l
@ -536,9 +536,9 @@ render_moving: {
render_playfield: {
.label screen_line = $23
// Do not render the top 2 lines.
.label i = $e
.label c = $f
.label l = $d
.label i = $a
.label c = $b
.label l = 9
lda #PLAYFIELD_COLS*2
sta.z i
lda #2
@ -580,8 +580,8 @@ render_playfield: {
// Returns a byte signaling whether rendering is needed. (0 no render, >0 render needed)
// play_movement(byte zp($1f) key_event)
play_movement: {
.label render = $11
.label return = $11
.label render = $d
.label return = $d
.label key_event = $1f
lda.z key_event
jsr play_move_down
@ -654,17 +654,17 @@ play_move_rotate: {
}
// Test if there is a collision between the current piece moved to (x, y) and anything on the playfield or the playfield boundaries
// Returns information about the type of the collision detected
// play_collision(byte zp($20) xpos, byte zp($c) ypos, byte register(X) orientation)
// play_collision(byte zp($20) xpos, byte zp(8) ypos, byte register(X) orientation)
play_collision: {
.label xpos = $20
.label ypos = $c
.label ypos = 8
.label piece_gfx = $21
.label yp = $c
.label yp = 8
.label playfield_line = $23
.label i = $2e
.label xp = $f
.label l = $d
.label i_1 = $e
.label xp = $b
.label l = 9
.label i_1 = $a
txa
clc
adc.z piece_gfx
@ -863,7 +863,7 @@ play_spawn_current: {
.label __7 = $2d
// Spawn a new next piece
// Pick a random piece (0-6)
.label piece_idx = 9
.label piece_idx = 5
// Move next piece into current
ldx.z next_piece_idx
txa
@ -1014,10 +1014,10 @@ play_increase_level: {
// Returns the number of lines removed
play_remove_lines: {
.label c = $2a
.label x = $d
.label y = $b
.label removed = $c
.label full = $e
.label x = 9
.label y = 7
.label removed = 8
.label full = $a
lda #0
sta.z removed
sta.z y
@ -1069,12 +1069,12 @@ play_remove_lines: {
}
// Lock the current piece onto the playfield
play_lock_current: {
.label yp = $17
.label yp = $13
.label playfield_line = $2b
.label xp = $11
.label xp = $d
.label i = $2e
.label l = $f
.label i_1 = $10
.label l = $b
.label i_1 = $c
lda #0
sta.z l
sta.z i_1
@ -1122,10 +1122,10 @@ play_lock_current: {
}
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zp($11) keycode)
// keyboard_event_pressed(byte zp($d) keycode)
keyboard_event_pressed: {
.label row_bits = $2d
.label keycode = $11
.label keycode = $d
lda.z keycode
lsr
lsr
@ -1278,7 +1278,7 @@ render_show: {
play_init: {
.label pli = $21
// Initialize the playfield line pointers;
.label idx = $13
.label idx = $f
lda #0
sta.z idx
lda #<playfield
@ -1368,7 +1368,7 @@ sprites_irq_init: {
}
// Setup the sprites
sprites_init: {
.label xpos = $14
.label xpos = $10
lda #$f
sta SPRITES_ENABLE
lda #0
@ -1398,7 +1398,7 @@ sprites_init: {
render_init: {
.const vicSelectGfxBank1_toDd001_return = 3
// Initialize the screen line pointers;
.label li_1 = $15
.label li_1 = $11
.label li_2 = $2b
lda #3
sta CIA2_PORT_A_DDR
@ -1473,9 +1473,9 @@ render_screen_original: {
.const SPACE = 0
.label screen = $23
.label cols = $2b
.label oscr = $18
.label oscr = $14
.label ocols = $21
.label y = $17
.label y = $13
lda #0
sta.z y
lda #<PLAYFIELD_COLORS_ORIGINAL+$20*2

@ -3,7 +3,7 @@
to:@1
@1: scope:[] from @begin
[1] (byte) render_screen_showing ← (byte) 0
[2] (dword) score_bcd#0 ← (dword) 0
[2] (dword) score_bcd ← (dword) 0
kickasm(location (const byte*) PLAYFIELD_CHARSET) {{ .fill 8,$00 // Place a filled char at the start of the charset
.import binary "playfield-screen.imap"
}}
@ -105,7 +105,6 @@ main::@17: scope:[main] from main::@16
main::@1: scope:[main] from main::@17 main::@25 main::@6
[40] (byte) level_bcd#11 ← phi( main::@6/(byte) level_bcd#17 main::@17/(byte) 0 main::@25/(byte) level_bcd#17 )
[40] (byte) level#10 ← phi( main::@6/(byte) level#17 main::@17/(byte) 0 main::@25/(byte) level#17 )
[40] (dword) score_bcd#17 ← phi( main::@6/(dword) score_bcd#13 main::@17/(dword) score_bcd#0 main::@25/(dword) score_bcd#13 )
[40] (word) lines_bcd#19 ← phi( main::@6/(word) lines_bcd#15 main::@17/(word) 0 main::@25/(word) lines_bcd#15 )
[40] (byte) current_movedown_counter#16 ← phi( main::@6/(byte) current_movedown_counter#14 main::@17/(byte) 0 main::@25/(byte) current_movedown_counter#14 )
[40] (byte) keyboard_events_size#19 ← phi( main::@6/(byte) keyboard_events_size#16 main::@17/(byte) 0 main::@25/(byte) keyboard_events_size#16 )
@ -636,7 +635,6 @@ play_move_down::@11: scope:[play_move_down] from play_move_down::@10 play_move_
[283] (byte) level_bcd#31 ← phi( play_move_down::@10/(byte) level_bcd#11 play_move_down::@17/(byte) level_bcd#19 )
[283] (byte) current_movedown_slow#37 ← phi( play_move_down::@10/(byte) current_movedown_slow#14 play_move_down::@17/(byte) current_movedown_slow#23 )
[283] (byte) level#33 ← phi( play_move_down::@10/(byte) level#10 play_move_down::@17/(byte) level#19 )
[283] (dword) score_bcd#23 ← phi( play_move_down::@10/(dword) score_bcd#17 play_move_down::@17/(dword) score_bcd#15 )
[283] (word) lines_bcd#26 ← phi( play_move_down::@10/(word) lines_bcd#19 play_move_down::@17/(word) lines_bcd#17 )
[283] (byte) current_ypos#38 ← phi( play_move_down::@10/(byte) current_ypos#3 play_move_down::@17/(byte) current_ypos#6 )
to:play_move_down::@return
@ -651,7 +649,6 @@ play_move_down::@return: scope:[play_move_down] from play_move_down::@11 play_m
[284] (byte) level_bcd#17 ← phi( play_move_down::@11/(byte) level_bcd#31 play_move_down::@3/(byte) level_bcd#11 )
[284] (byte) current_movedown_slow#21 ← phi( play_move_down::@11/(byte) current_movedown_slow#37 play_move_down::@3/(byte) current_movedown_slow#14 )
[284] (byte) level#17 ← phi( play_move_down::@11/(byte) level#33 play_move_down::@3/(byte) level#10 )
[284] (dword) score_bcd#13 ← phi( play_move_down::@11/(dword) score_bcd#23 play_move_down::@3/(dword) score_bcd#17 )
[284] (word) lines_bcd#15 ← phi( play_move_down::@11/(word) lines_bcd#26 play_move_down::@3/(word) lines_bcd#19 )
[284] (byte) current_ypos#19 ← phi( play_move_down::@11/(byte) current_ypos#38 play_move_down::@3/(byte) current_ypos#11 )
[284] (byte) current_movedown_counter#14 ← phi( play_move_down::@11/(byte) 0 play_move_down::@3/(byte) current_movedown_counter#12 )
@ -712,7 +709,7 @@ play_update_score::@1: scope:[play_update_score] from play_update_score
[311] (dword) play_update_score::add_bcd#0 ← *((const dword*) score_add_bcd + (byte~) play_update_score::$9)
asm { sed }
[313] (word) lines_bcd#29 ← (word) lines_bcd#19 + (byte) play_update_score::removed#0
[314] (dword) score_bcd#26 ← (dword) score_bcd#17 + (dword) play_update_score::add_bcd#0
[314] (dword) score_bcd ← (dword) score_bcd + (dword) play_update_score::add_bcd#0
asm { cld }
[316] (byte~) play_update_score::$4 ← < (word) lines_bcd#29
[317] (byte) play_update_score::lines_after#0 ← (byte~) play_update_score::$4 & (byte) $f0
@ -726,7 +723,6 @@ play_update_score::@return: scope:[play_update_score] from play_update_score pl
[321] (byte) level_bcd#19 ← phi( play_update_score/(byte) level_bcd#11 play_update_score::@1/(byte) level_bcd#11 play_update_score::@2/(byte) level_bcd#62 )
[321] (byte) current_movedown_slow#23 ← phi( play_update_score/(byte) current_movedown_slow#14 play_update_score::@1/(byte) current_movedown_slow#14 play_update_score::@2/(byte) current_movedown_slow#65 )
[321] (byte) level#19 ← phi( play_update_score/(byte) level#10 play_update_score::@1/(byte) level#10 play_update_score::@2/(byte) level#21 )
[321] (dword) score_bcd#15 ← phi( play_update_score/(dword) score_bcd#17 play_update_score::@1/(dword) score_bcd#26 play_update_score::@2/(dword) score_bcd#26 )
[321] (word) lines_bcd#17 ← phi( play_update_score/(word) lines_bcd#19 play_update_score::@1/(word) lines_bcd#29 play_update_score::@2/(word) lines_bcd#29 )
[322] return
to:@return

File diff suppressed because it is too large Load Diff

@ -99,25 +99,25 @@
(const byte) VIC_ECM = (byte) $40
(const byte) VIC_RSEL = (byte) 8
(byte) current_movedown_counter
(byte) current_movedown_counter#12 current_movedown_counter zp[1]:11 0.5333333333333333
(byte) current_movedown_counter#14 current_movedown_counter zp[1]:11 3.081081081081081
(byte) current_movedown_counter#16 current_movedown_counter zp[1]:11 8.769230769230768
(byte) current_movedown_counter#12 current_movedown_counter zp[1]:7 0.5333333333333333
(byte) current_movedown_counter#14 current_movedown_counter zp[1]:7 3.081081081081081
(byte) current_movedown_counter#16 current_movedown_counter zp[1]:7 8.769230769230768
(const byte) current_movedown_fast = (byte) $a
(byte) current_movedown_slow
(byte) current_movedown_slow#1 current_movedown_slow zp[1]:7 0.17391304347826086
(byte) current_movedown_slow#10 current_movedown_slow zp[1]:7 4.0
(byte) current_movedown_slow#14 current_movedown_slow zp[1]:7 2.214285714285714
(byte) current_movedown_slow#21 current_movedown_slow zp[1]:7 3.135135135135135
(byte) current_movedown_slow#23 current_movedown_slow zp[1]:7 1.1428571428571428
(byte) current_movedown_slow#37 current_movedown_slow zp[1]:7 6.0
(byte) current_movedown_slow#65 current_movedown_slow zp[1]:7 0.26666666666666666
(byte) current_movedown_slow#1 current_movedown_slow zp[1]:3 0.17391304347826086
(byte) current_movedown_slow#10 current_movedown_slow zp[1]:3 4.0
(byte) current_movedown_slow#14 current_movedown_slow zp[1]:3 2.214285714285714
(byte) current_movedown_slow#21 current_movedown_slow zp[1]:3 3.135135135135135
(byte) current_movedown_slow#23 current_movedown_slow zp[1]:3 1.1428571428571428
(byte) current_movedown_slow#37 current_movedown_slow zp[1]:3 6.0
(byte) current_movedown_slow#65 current_movedown_slow zp[1]:3 0.26666666666666666
(byte) current_orientation
(byte) current_orientation#13 current_orientation zp[1]:16 3.189189189189189
(byte) current_orientation#17 current_orientation zp[1]:16 5.523809523809523
(byte) current_orientation#20 current_orientation zp[1]:16 0.36734693877551017
(byte) current_orientation#25 current_orientation zp[1]:16 1.3333333333333333
(byte) current_orientation#37 current_orientation zp[1]:16 4.0
(byte) current_orientation#7 current_orientation zp[1]:16 3.0
(byte) current_orientation#13 current_orientation zp[1]:12 3.189189189189189
(byte) current_orientation#17 current_orientation zp[1]:12 5.523809523809523
(byte) current_orientation#20 current_orientation zp[1]:12 0.36734693877551017
(byte) current_orientation#25 current_orientation zp[1]:12 1.3333333333333333
(byte) current_orientation#37 current_orientation zp[1]:12 4.0
(byte) current_orientation#7 current_orientation zp[1]:12 3.0
(byte*) current_piece
(byte*) current_piece#10 current_piece zp[2]:43 3.243243243243243
(byte*) current_piece#101 current_piece zp[2]:43 2.0
@ -132,51 +132,51 @@
(byte*) current_piece#99 current_piece_1 zp[2]:33 4.0
(byte) current_piece_char
(byte) current_piece_char#10 current_piece_char zp[1]:37 183.9818181818182
(byte) current_piece_char#100 current_piece_char_1 zp[1]:14 22.0
(byte) current_piece_char#100 current_piece_char_1 zp[1]:10 22.0
(byte) current_piece_char#16 current_piece_char zp[1]:37 3.4324324324324325
(byte) current_piece_char#29 current_piece_char zp[1]:37 6.0
(byte) current_piece_char#5 current_piece_char zp[1]:37 0.25
(byte) current_piece_char#68 current_piece_char_1 zp[1]:14 48.285714285714285
(byte) current_piece_char#99 current_piece_char_1 zp[1]:14 4.0
(byte) current_piece_char#68 current_piece_char_1 zp[1]:10 48.285714285714285
(byte) current_piece_char#99 current_piece_char_1 zp[1]:10 4.0
(byte*) current_piece_gfx
(byte*) current_piece_gfx#111 current_piece_gfx_1 zp[2]:35 2.0
(byte*) current_piece_gfx#112 current_piece_gfx_1 zp[2]:35 11.0
(byte*) current_piece_gfx#116 current_piece_gfx zp[2]:24 4.0
(byte*) current_piece_gfx#123 current_piece_gfx zp[2]:24 4.0
(byte*) current_piece_gfx#13 current_piece_gfx zp[2]:24 183.9818181818182
(byte*) current_piece_gfx#18 current_piece_gfx zp[2]:24 6.047619047619047
(byte*) current_piece_gfx#20 current_piece_gfx zp[2]:24 0.37037037037037035
(byte*) current_piece_gfx#21 current_piece_gfx zp[2]:24 1.3333333333333333
(byte*) current_piece_gfx#35 current_piece_gfx zp[2]:24 6.0
(byte*) current_piece_gfx#116 current_piece_gfx zp[2]:20 4.0
(byte*) current_piece_gfx#123 current_piece_gfx zp[2]:20 4.0
(byte*) current_piece_gfx#13 current_piece_gfx zp[2]:20 183.9818181818182
(byte*) current_piece_gfx#18 current_piece_gfx zp[2]:20 6.047619047619047
(byte*) current_piece_gfx#20 current_piece_gfx zp[2]:20 0.37037037037037035
(byte*) current_piece_gfx#21 current_piece_gfx zp[2]:20 1.3333333333333333
(byte*) current_piece_gfx#35 current_piece_gfx zp[2]:20 6.0
(byte*) current_piece_gfx#64 current_piece_gfx_1 zp[2]:35 48.285714285714285
(byte*) current_piece_gfx#7 current_piece_gfx zp[2]:24 4.0
(byte*) current_piece_gfx#7 current_piece_gfx zp[2]:20 4.0
(byte) current_xpos
(byte) current_xpos#100 current_xpos zp[1]:42 0.3225806451612903
(byte) current_xpos#118 current_xpos_1 zp[1]:13 1.3333333333333333
(byte) current_xpos#119 current_xpos_1 zp[1]:13 7.333333333333333
(byte) current_xpos#118 current_xpos_1 zp[1]:9 1.3333333333333333
(byte) current_xpos#119 current_xpos_1 zp[1]:9 7.333333333333333
(byte) current_xpos#14 current_xpos zp[1]:42 20.38181818181818
(byte) current_xpos#19 current_xpos zp[1]:42 6.047619047619047
(byte) current_xpos#22 current_xpos zp[1]:42 0.7999999999999999
(byte) current_xpos#26 current_xpos zp[1]:42 0.4666666666666666
(byte) current_xpos#43 current_xpos zp[1]:42 6.0
(byte) current_xpos#59 current_xpos_1 zp[1]:13 5.428571428571429
(byte) current_xpos#59 current_xpos_1 zp[1]:9 5.428571428571429
(byte) current_xpos#6 current_xpos zp[1]:42 4.0
(byte) current_xpos#8 current_xpos zp[1]:42 4.0
(byte) current_ypos
(byte) current_ypos#11 current_ypos zp[1]:23 3.297297297297297
(byte) current_ypos#11 current_ypos zp[1]:19 3.297297297297297
(byte) current_ypos#13 reg byte x 15.0
(byte) current_ypos#19 current_ypos zp[1]:23 1.7051282051282046
(byte) current_ypos#3 current_ypos zp[1]:23 4.0
(byte) current_ypos#38 current_ypos zp[1]:23 6.0
(byte) current_ypos#6 current_ypos zp[1]:23 0.3333333333333333
(byte) current_ypos#19 current_ypos zp[1]:19 1.7051282051282046
(byte) current_ypos#3 current_ypos zp[1]:19 4.0
(byte) current_ypos#38 current_ypos zp[1]:19 6.0
(byte) current_ypos#6 current_ypos zp[1]:19 0.3333333333333333
(byte) current_ypos#97 reg byte x 1.0
(byte) current_ypos#98 reg byte x 4.4
(byte) game_over
(byte) game_over#10 game_over zp[1]:10 4.804347826086958
(byte) game_over#15 game_over zp[1]:10 3.189189189189189
(byte) game_over#27 game_over zp[1]:10 6.0
(byte) game_over#52 game_over zp[1]:10 0.34782608695652173
(byte) game_over#65 game_over zp[1]:10 0.42857142857142855
(byte) game_over#10 game_over zp[1]:6 4.804347826086958
(byte) game_over#15 game_over zp[1]:6 3.189189189189189
(byte) game_over#27 game_over zp[1]:6 6.0
(byte) game_over#52 game_over zp[1]:6 0.34782608695652173
(byte) game_over#65 game_over zp[1]:6 0.42857142857142855
(byte) irq_cnt loadstore zp[1]:30 6.0
(byte) irq_raster_next loadstore zp[1]:27 1.0
(byte) irq_sprite_ptr loadstore zp[1]:29 1.5555555555555558
@ -193,7 +193,7 @@
(byte~) keyboard_event_pressed::$1 reg byte a 4.0
(label) keyboard_event_pressed::@return
(byte) keyboard_event_pressed::keycode
(byte) keyboard_event_pressed::keycode#5 keycode zp[1]:17 1.3333333333333333
(byte) keyboard_event_pressed::keycode#5 keycode zp[1]:13 1.3333333333333333
(byte) keyboard_event_pressed::return
(byte) keyboard_event_pressed::return#0 reg byte a 4.0
(byte) keyboard_event_pressed::return#1 reg byte a 4.0
@ -253,15 +253,15 @@
(byte) keyboard_event_scan::row_scan#0 row_scan zp[1]:46 1278.0555555555554
(const byte*) keyboard_events[(number) 8] = { fill( 8, 0) }
(byte) keyboard_events_size
(byte) keyboard_events_size#1 keyboard_events_size zp[1]:18 20002.0
(byte) keyboard_events_size#10 keyboard_events_size zp[1]:18 8100.9000000000015
(byte) keyboard_events_size#13 keyboard_events_size zp[1]:18 97.06451612903226
(byte) keyboard_events_size#16 keyboard_events_size zp[1]:18 4.461538461538461
(byte) keyboard_events_size#19 keyboard_events_size zp[1]:18 18.999999999999996
(byte) keyboard_events_size#2 keyboard_events_size zp[1]:18 20002.0
(byte) keyboard_events_size#29 keyboard_events_size zp[1]:18 10201.2
(byte) keyboard_events_size#30 keyboard_events_size zp[1]:18 429.2857142857143
(byte) keyboard_events_size#4 keyboard_events_size zp[1]:18 3.0
(byte) keyboard_events_size#1 keyboard_events_size zp[1]:14 20002.0
(byte) keyboard_events_size#10 keyboard_events_size zp[1]:14 8100.9000000000015
(byte) keyboard_events_size#13 keyboard_events_size zp[1]:14 97.06451612903226
(byte) keyboard_events_size#16 keyboard_events_size zp[1]:14 4.461538461538461
(byte) keyboard_events_size#19 keyboard_events_size zp[1]:14 18.999999999999996
(byte) keyboard_events_size#2 keyboard_events_size zp[1]:14 20002.0
(byte) keyboard_events_size#29 keyboard_events_size zp[1]:14 10201.2
(byte) keyboard_events_size#30 keyboard_events_size zp[1]:14 429.2857142857143
(byte) keyboard_events_size#4 keyboard_events_size zp[1]:14 3.0
(const byte*) keyboard_matrix_col_bitmask[(number) 8] = { (byte) 1, (byte) 2, (byte) 4, (byte) 8, (byte) $10, (byte) $20, (byte) $40, (byte) $80 }
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
(label) keyboard_matrix_read::@return
@ -275,25 +275,25 @@
(byte) keyboard_modifiers
(const byte*) keyboard_scan_values[(number) 8] = { fill( 8, 0) }
(byte) level
(byte) level#10 level zp[1]:6 1.909090909090909
(byte) level#17 level zp[1]:6 3.135135135135135
(byte) level#19 level zp[1]:6 1.1428571428571428
(byte) level#21 level zp[1]:6 0.4444444444444444
(byte) level#33 level zp[1]:6 6.0
(byte) level#10 level zp[1]:2 1.909090909090909
(byte) level#17 level zp[1]:2 3.135135135135135
(byte) level#19 level zp[1]:2 1.1428571428571428
(byte) level#21 level zp[1]:2 0.4444444444444444
(byte) level#33 level zp[1]:2 6.0
(byte) level_bcd
(byte) level_bcd#11 level_bcd zp[1]:8 2.0
(byte) level_bcd#17 level_bcd zp[1]:8 1.9999999999999998
(byte) level_bcd#19 level_bcd zp[1]:8 1.1428571428571428
(byte) level_bcd#21 level_bcd zp[1]:8 2.6666666666666665
(byte) level_bcd#31 level_bcd zp[1]:8 6.0
(byte) level_bcd#62 level_bcd zp[1]:8 0.6000000000000001
(byte) level_bcd#8 level_bcd zp[1]:8 4.0
(byte) level_bcd#11 level_bcd zp[1]:4 2.0
(byte) level_bcd#17 level_bcd zp[1]:4 1.9999999999999998
(byte) level_bcd#19 level_bcd zp[1]:4 1.1428571428571428
(byte) level_bcd#21 level_bcd zp[1]:4 2.6666666666666665
(byte) level_bcd#31 level_bcd zp[1]:4 6.0
(byte) level_bcd#62 level_bcd zp[1]:4 0.6000000000000001
(byte) level_bcd#8 level_bcd zp[1]:4 4.0
(word) lines_bcd
(word) lines_bcd#15 lines_bcd zp[2]:21 2.0338983050847457
(word) lines_bcd#17 lines_bcd zp[2]:21 1.1428571428571428
(word) lines_bcd#19 lines_bcd zp[2]:21 2.4400000000000004
(word) lines_bcd#26 lines_bcd zp[2]:21 6.0
(word) lines_bcd#29 lines_bcd zp[2]:21 1.0
(word) lines_bcd#15 lines_bcd zp[2]:17 2.0338983050847457
(word) lines_bcd#17 lines_bcd zp[2]:17 1.1428571428571428
(word) lines_bcd#19 lines_bcd zp[2]:17 2.4400000000000004
(word) lines_bcd#26 lines_bcd zp[2]:17 6.0
(word) lines_bcd#29 lines_bcd zp[2]:17 1.0
(void()) main()
(label) main::@1
(label) main::@10
@ -325,11 +325,11 @@
(byte) main::render
(byte) main::render#1 reg byte a 202.0
(byte) next_piece_idx
(byte) next_piece_idx#10 next_piece_idx zp[1]:9 2.608695652173914
(byte) next_piece_idx#10 next_piece_idx zp[1]:5 2.608695652173914
(byte) next_piece_idx#12 reg byte x 3.4
(byte) next_piece_idx#16 next_piece_idx zp[1]:9 3.4324324324324325
(byte) next_piece_idx#17 next_piece_idx zp[1]:9 6.0
(byte) next_piece_idx#30 next_piece_idx zp[1]:9 6.0
(byte) next_piece_idx#16 next_piece_idx zp[1]:5 3.4324324324324325
(byte) next_piece_idx#17 next_piece_idx zp[1]:5 6.0
(byte) next_piece_idx#30 next_piece_idx zp[1]:5 6.0
(byte) next_piece_idx#76 reg byte x 4.0
(byte) next_piece_idx#77 reg byte x 22.0
(byte()) play_collision((byte) play_collision::xpos , (byte) play_collision::ypos , (byte) play_collision::orientation)
@ -351,13 +351,13 @@
(byte) play_collision::c#2 reg byte x 2222.4444444444443
(byte) play_collision::i
(byte) play_collision::i#1 i zp[1]:46 1615.6153846153845
(byte) play_collision::i#10 i_1 zp[1]:14 2002.0
(byte) play_collision::i#12 i_1 zp[1]:14 20002.0
(byte) play_collision::i#2 i_1 zp[1]:14 15502.0
(byte) play_collision::i#3 i_1 zp[1]:14 500.5
(byte) play_collision::i#10 i_1 zp[1]:10 2002.0
(byte) play_collision::i#12 i_1 zp[1]:10 20002.0
(byte) play_collision::i#2 i_1 zp[1]:10 15502.0
(byte) play_collision::i#3 i_1 zp[1]:10 500.5
(byte) play_collision::l
(byte) play_collision::l#1 l zp[1]:13 1001.0
(byte) play_collision::l#6 l zp[1]:13 117.76470588235294
(byte) play_collision::l#1 l zp[1]:9 1001.0
(byte) play_collision::l#6 l zp[1]:9 117.76470588235294
(byte) play_collision::orientation
(byte) play_collision::orientation#0 reg byte x 2.0
(byte) play_collision::orientation#1 reg byte x 2.0
@ -376,9 +376,9 @@
(byte) play_collision::return#14 reg byte a 4.0
(byte) play_collision::return#15 reg byte a 1.4285714285714284
(byte) play_collision::xp
(byte) play_collision::xp#1 xp zp[1]:15 5000.5
(byte) play_collision::xp#2 xp zp[1]:15 6375.75
(byte) play_collision::xp#8 xp zp[1]:15 2002.0
(byte) play_collision::xp#1 xp zp[1]:11 5000.5
(byte) play_collision::xp#2 xp zp[1]:11 6375.75
(byte) play_collision::xp#8 xp zp[1]:11 2002.0
(byte) play_collision::xpos
(byte) play_collision::xpos#0 xpos zp[1]:32 1.3333333333333333
(byte) play_collision::xpos#1 xpos zp[1]:32 1.0
@ -387,15 +387,15 @@
(byte) play_collision::xpos#4 xpos zp[1]:32 1.3333333333333333
(byte) play_collision::xpos#6 xpos zp[1]:32 45.95454545454545
(byte) play_collision::yp
(byte) play_collision::yp#0 yp zp[1]:12 6.0
(byte) play_collision::yp#1 yp zp[1]:12 500.5
(byte) play_collision::yp#2 yp zp[1]:12 812.875
(byte) play_collision::yp#0 yp zp[1]:8 6.0
(byte) play_collision::yp#1 yp zp[1]:8 500.5
(byte) play_collision::yp#2 yp zp[1]:8 812.875
(byte) play_collision::ypos
(byte) play_collision::ypos#0 ypos zp[1]:12 1.0
(byte) play_collision::ypos#1 ypos zp[1]:12 1.3333333333333333
(byte) play_collision::ypos#2 ypos zp[1]:12 1.3333333333333333
(byte) play_collision::ypos#3 ypos zp[1]:12 1.3333333333333333
(byte) play_collision::ypos#4 ypos zp[1]:12 2.0
(byte) play_collision::ypos#0 ypos zp[1]:8 1.0
(byte) play_collision::ypos#1 ypos zp[1]:8 1.3333333333333333
(byte) play_collision::ypos#2 ypos zp[1]:8 1.3333333333333333
(byte) play_collision::ypos#3 ypos zp[1]:8 1.3333333333333333
(byte) play_collision::ypos#4 ypos zp[1]:8 2.0
(void()) play_increase_level()
(byte~) play_increase_level::$1 reg byte a 4.0
(byte~) play_increase_level::$5 reg byte a 4004.0
@ -420,8 +420,8 @@
(byte) play_init::b#1 reg byte x 16.5
(byte) play_init::b#2 reg byte x 11.0
(byte) play_init::idx
(byte) play_init::idx#1 idx zp[1]:19 7.333333333333333
(byte) play_init::idx#2 idx zp[1]:19 6.6000000000000005
(byte) play_init::idx#1 idx zp[1]:15 7.333333333333333
(byte) play_init::idx#2 idx zp[1]:15 6.6000000000000005
(byte) play_init::j
(byte) play_init::j#1 reg byte y 16.5
(byte) play_init::j#2 reg byte y 7.333333333333333
@ -443,23 +443,23 @@
(byte) play_lock_current::c#2 reg byte x 4000.4
(byte) play_lock_current::i
(byte) play_lock_current::i#1 i zp[1]:46 2333.6666666666665
(byte) play_lock_current::i#2 i_1 zp[1]:16 15502.0
(byte) play_lock_current::i#3 i_1 zp[1]:16 500.5
(byte) play_lock_current::i#7 i_1 zp[1]:16 2002.0
(byte) play_lock_current::i#9 i_1 zp[1]:16 20002.0
(byte) play_lock_current::i#2 i_1 zp[1]:12 15502.0
(byte) play_lock_current::i#3 i_1 zp[1]:12 500.5
(byte) play_lock_current::i#7 i_1 zp[1]:12 2002.0
(byte) play_lock_current::i#9 i_1 zp[1]:12 20002.0
(byte) play_lock_current::l
(byte) play_lock_current::l#1 l zp[1]:15 1001.0
(byte) play_lock_current::l#6 l zp[1]:15 154.0
(byte) play_lock_current::l#1 l zp[1]:11 1001.0
(byte) play_lock_current::l#6 l zp[1]:11 154.0
(byte*) play_lock_current::playfield_line
(byte*) play_lock_current::playfield_line#0 playfield_line zp[2]:43 1100.2
(byte) play_lock_current::xp
(byte) play_lock_current::xp#0 xp zp[1]:17 2002.0
(byte) play_lock_current::xp#1 xp zp[1]:17 5000.5
(byte) play_lock_current::xp#2 xp zp[1]:17 7751.0
(byte) play_lock_current::xp#0 xp zp[1]:13 2002.0
(byte) play_lock_current::xp#1 xp zp[1]:13 5000.5
(byte) play_lock_current::xp#2 xp zp[1]:13 7751.0
(byte) play_lock_current::yp
(byte) play_lock_current::yp#0 yp zp[1]:23 4.0
(byte) play_lock_current::yp#1 yp zp[1]:23 500.5
(byte) play_lock_current::yp#2 yp zp[1]:23 250.41666666666669
(byte) play_lock_current::yp#0 yp zp[1]:19 4.0
(byte) play_lock_current::yp#1 yp zp[1]:19 500.5
(byte) play_lock_current::yp#2 yp zp[1]:19 250.41666666666669
(byte()) play_move_down((byte) play_move_down::key_event)
(byte~) play_move_down::$12 reg byte a 4.0
(byte~) play_move_down::$2 reg byte a 4.0
@ -541,11 +541,11 @@
(byte) play_movement::key_event
(byte) play_movement::key_event#0 key_event zp[1]:31 9.727272727272727
(byte) play_movement::render
(byte) play_movement::render#1 render zp[1]:17 1.0
(byte) play_movement::render#2 render zp[1]:17 0.8
(byte) play_movement::render#1 render zp[1]:13 1.0
(byte) play_movement::render#2 render zp[1]:13 0.8
(byte) play_movement::return
(byte) play_movement::return#0 return zp[1]:17 4.0
(byte) play_movement::return#2 return zp[1]:17 34.99999999999999
(byte) play_movement::return#0 return zp[1]:13 4.0
(byte) play_movement::return#2 return zp[1]:13 34.99999999999999
(byte) play_movement::return#3 reg byte a 202.0
(byte()) play_remove_lines()
(label) play_remove_lines::@1
@ -561,16 +561,16 @@
(byte) play_remove_lines::c
(byte) play_remove_lines::c#0 c zp[1]:42 6000.6
(byte) play_remove_lines::full
(byte) play_remove_lines::full#2 full zp[1]:14 4200.6
(byte) play_remove_lines::full#4 full zp[1]:14 4000.4
(byte) play_remove_lines::full#2 full zp[1]:10 4200.6
(byte) play_remove_lines::full#4 full zp[1]:10 4000.4
(byte) play_remove_lines::r
(byte) play_remove_lines::r#1 reg byte y 1500.2142857142858
(byte) play_remove_lines::r#2 reg byte y 15502.0
(byte) play_remove_lines::r#3 reg byte y 2002.0
(byte) play_remove_lines::removed
(byte) play_remove_lines::removed#1 removed zp[1]:12 2002.0
(byte) play_remove_lines::removed#11 removed zp[1]:12 231.0
(byte) play_remove_lines::removed#8 removed zp[1]:12 333.8888888888889
(byte) play_remove_lines::removed#1 removed zp[1]:8 2002.0
(byte) play_remove_lines::removed#11 removed zp[1]:8 231.0
(byte) play_remove_lines::removed#8 removed zp[1]:8 333.8888888888889
(byte) play_remove_lines::return
(byte) play_remove_lines::return#0 reg byte a 4.0
(byte) play_remove_lines::w
@ -582,11 +582,11 @@
(byte) play_remove_lines::w#4 reg byte x 4429.142857142857
(byte) play_remove_lines::w#6 reg byte x 1668.3333333333335
(byte) play_remove_lines::x
(byte) play_remove_lines::x#1 x zp[1]:13 15001.5
(byte) play_remove_lines::x#2 x zp[1]:13 2500.25
(byte) play_remove_lines::x#1 x zp[1]:9 15001.5
(byte) play_remove_lines::x#2 x zp[1]:9 2500.25
(byte) play_remove_lines::y
(byte) play_remove_lines::y#1 y zp[1]:11 1501.5
(byte) play_remove_lines::y#8 y zp[1]:11 133.46666666666667
(byte) play_remove_lines::y#1 y zp[1]:7 1501.5
(byte) play_remove_lines::y#8 y zp[1]:7 133.46666666666667
(void()) play_spawn_current()
(byte~) play_spawn_current::$1 reg byte a 4.0
(byte~) play_spawn_current::$7 zp[1]:45 0.06451612903225806
@ -599,8 +599,8 @@
(byte) play_spawn_current::current_piece_idx
(byte) play_spawn_current::current_piece_idx#0 reg byte x 2.5
(byte) play_spawn_current::piece_idx
(byte) play_spawn_current::piece_idx#1 piece_idx zp[1]:9 2002.0
(byte) play_spawn_current::piece_idx#2 piece_idx zp[1]:9 100.5
(byte) play_spawn_current::piece_idx#1 piece_idx zp[1]:5 2002.0
(byte) play_spawn_current::piece_idx#2 piece_idx zp[1]:5 100.5
(label) play_spawn_current::sid_rnd1
(byte) play_spawn_current::sid_rnd1_return
(byte) play_spawn_current::sid_rnd1_return#0 reg byte a 2002.0
@ -665,8 +665,8 @@
(byte) render_init::i#1 reg byte y 16.5
(byte) render_init::i#2 reg byte y 5.5
(byte*) render_init::li_1
(byte*) render_init::li_1#1 li_1 zp[2]:21 5.5
(byte*) render_init::li_1#2 li_1 zp[2]:21 8.25
(byte*) render_init::li_1#1 li_1 zp[2]:17 5.5
(byte*) render_init::li_1#2 li_1 zp[2]:17 8.25
(byte*) render_init::li_2
(byte*) render_init::li_2#1 li_2 zp[2]:43 7.333333333333333
(byte*) render_init::li_2#2 li_2 zp[2]:43 6.6000000000000005
@ -700,8 +700,8 @@
(byte) render_moving::i#4 i zp[1]:31 1552.0
(byte) render_moving::i#8 i zp[1]:31 300.75
(byte) render_moving::l
(byte) render_moving::l#1 l zp[1]:17 151.5
(byte) render_moving::l#4 l zp[1]:17 11.882352941176471
(byte) render_moving::l#1 l zp[1]:13 151.5
(byte) render_moving::l#4 l zp[1]:13 11.882352941176471
(byte*) render_moving::screen_line
(byte*) render_moving::screen_line#0 screen_line zp[2]:33 110.19999999999999
(byte) render_moving::xpos
@ -709,9 +709,9 @@
(byte) render_moving::xpos#1 xpos zp[1]:32 667.3333333333334
(byte) render_moving::xpos#2 xpos zp[1]:32 620.8
(byte) render_moving::ypos
(byte) render_moving::ypos#0 ypos zp[1]:15 4.0
(byte) render_moving::ypos#1 ypos zp[1]:15 67.33333333333333
(byte) render_moving::ypos#2 ypos zp[1]:15 25.375
(byte) render_moving::ypos#0 ypos zp[1]:11 4.0
(byte) render_moving::ypos#1 ypos zp[1]:11 67.33333333333333
(byte) render_moving::ypos#2 ypos zp[1]:11 25.375
(void()) render_next()
(byte~) render_next::$6 reg byte y 1.0
(label) render_next::@1
@ -729,8 +729,8 @@
(byte) render_next::cell
(byte) render_next::cell#0 reg byte a 1001.0
(byte) render_next::l
(byte) render_next::l#1 l zp[1]:12 151.5
(byte) render_next::l#7 l zp[1]:12 18.363636363636363
(byte) render_next::l#1 l zp[1]:8 151.5
(byte) render_next::l#7 l zp[1]:8 18.363636363636363
(const word) render_next::next_area_offset = (word)(number) $28*(number) $c+(number) $18+(number) 4
(byte) render_next::next_piece_char
(byte) render_next::next_piece_char#0 next_piece_char zp[1]:32 66.86666666666667
@ -753,15 +753,15 @@
(label) render_playfield::@3
(label) render_playfield::@return
(byte) render_playfield::c
(byte) render_playfield::c#1 c zp[1]:15 1501.5
(byte) render_playfield::c#2 c zp[1]:15 500.5
(byte) render_playfield::c#1 c zp[1]:11 1501.5
(byte) render_playfield::c#2 c zp[1]:11 500.5
(byte) render_playfield::i
(byte) render_playfield::i#1 i zp[1]:14 420.59999999999997
(byte) render_playfield::i#2 i zp[1]:14 1034.6666666666667
(byte) render_playfield::i#3 i zp[1]:14 50.5
(byte) render_playfield::i#1 i zp[1]:10 420.59999999999997
(byte) render_playfield::i#2 i zp[1]:10 1034.6666666666667
(byte) render_playfield::i#3 i zp[1]:10 50.5
(byte) render_playfield::l
(byte) render_playfield::l#1 l zp[1]:13 151.5
(byte) render_playfield::l#2 l zp[1]:13 30.299999999999997
(byte) render_playfield::l#1 l zp[1]:9 151.5
(byte) render_playfield::l#2 l zp[1]:9 30.299999999999997
(byte*) render_playfield::screen_line
(byte*) render_playfield::screen_line#0 screen_line zp[2]:35 202.0
(byte*) render_playfield::screen_line#1 screen_line zp[2]:35 500.5
@ -802,9 +802,9 @@
(byte*) render_screen_original::ocols#2 ocols zp[2]:33 67.33333333333333
(byte*) render_screen_original::ocols#4 ocols zp[2]:33 14.0
(byte*) render_screen_original::oscr
(byte*) render_screen_original::oscr#1 oscr zp[2]:24 14.2
(byte*) render_screen_original::oscr#2 oscr zp[2]:24 134.66666666666666
(byte*) render_screen_original::oscr#4 oscr zp[2]:24 14.0
(byte*) render_screen_original::oscr#1 oscr zp[2]:20 14.2
(byte*) render_screen_original::oscr#2 oscr zp[2]:20 134.66666666666666
(byte*) render_screen_original::oscr#4 oscr zp[2]:20 14.0
(byte*) render_screen_original::screen
(byte*) render_screen_original::screen#10 screen zp[2]:35 30.42857142857143
(byte*) render_screen_original::screen#2 screen zp[2]:35 60.599999999999994
@ -822,21 +822,21 @@
(byte) render_screen_original::x#5 reg byte x 43.285714285714285
(byte) render_screen_original::x#6 reg byte x 60.599999999999994
(byte) render_screen_original::y
(byte) render_screen_original::y#1 y zp[1]:23 16.5
(byte) render_screen_original::y#6 y zp[1]:23 0.9166666666666666
(byte) render_screen_original::y#1 y zp[1]:19 16.5
(byte) render_screen_original::y#6 y zp[1]:19 0.9166666666666666
(byte) render_screen_render
(byte) render_screen_render#11 render_screen_render zp[1]:20 3.25
(byte) render_screen_render#11 render_screen_render zp[1]:16 3.25
(byte) render_screen_render#15 reg byte a 13.0
(byte) render_screen_render#18 render_screen_render zp[1]:20 4.8076923076923075
(byte) render_screen_render#18 render_screen_render zp[1]:16 4.8076923076923075
(byte) render_screen_render#22 reg byte x 8.615384615384615
(byte) render_screen_render#33 render_screen_render_1 zp[1]:12 5.333333333333333
(byte) render_screen_render#33 render_screen_render_1 zp[1]:8 5.333333333333333
(byte) render_screen_render#63 reg byte x 22.0
(byte) render_screen_render#64 render_screen_render_1 zp[1]:12 5.5
(byte) render_screen_render#64 render_screen_render_1 zp[1]:8 5.5
(byte) render_screen_render#65 reg byte a 11.0
(byte) render_screen_show
(byte) render_screen_show#13 render_screen_show zp[1]:19 4.333333333333333
(byte) render_screen_show#16 render_screen_show zp[1]:19 5.474999999999999
(byte) render_screen_showing loadstore zp[1]:26 0.6000000000000001
(byte) render_screen_show#13 render_screen_show zp[1]:15 4.333333333333333
(byte) render_screen_show#16 render_screen_show zp[1]:15 5.474999999999999
(byte) render_screen_showing loadstore zp[1]:22 0.6000000000000001
(void()) render_screen_swap()
(label) render_screen_swap::@return
(void()) render_show()
@ -855,13 +855,7 @@
(const byte) render_show::toD0182_return#0 toD0182_return = >(word)(const byte*) PLAYFIELD_SCREEN_2&(word) $3fff*(byte) 4|>(word)(const byte*) PLAYFIELD_CHARSET/(byte) 4&(byte) $f
(byte*) render_show::toD0182_screen
(const dword*) score_add_bcd[(number) 5] = { fill( 5, 0) }
(dword) score_bcd
(dword) score_bcd#0 score_bcd zp[4]:2 0.1111111111111111
(dword) score_bcd#13 score_bcd zp[4]:2 3.135135135135135
(dword) score_bcd#15 score_bcd zp[4]:2 1.1428571428571428
(dword) score_bcd#17 score_bcd zp[4]:2 2.3921568627450975
(dword) score_bcd#23 score_bcd zp[4]:2 6.0
(dword) score_bcd#26 score_bcd zp[4]:2 0.8571428571428571
(dword) score_bcd loadstore zp[4]:23 60.0
(const byte**) screen_lines_1[(const byte) PLAYFIELD_LINES] = { fill( PLAYFIELD_LINES, 0) }
(const byte**) screen_lines_2[(const byte) PLAYFIELD_LINES] = { fill( PLAYFIELD_LINES, 0) }
(void()) sid_rnd_init()
@ -875,8 +869,8 @@
(byte) sprites_init::s2
(byte) sprites_init::s2#0 reg byte x 22.0
(byte) sprites_init::xpos
(byte) sprites_init::xpos#1 xpos zp[1]:20 7.333333333333333
(byte) sprites_init::xpos#2 xpos zp[1]:20 8.25
(byte) sprites_init::xpos#1 xpos zp[1]:16 7.333333333333333
(byte) sprites_init::xpos#2 xpos zp[1]:16 8.25
interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
(byte~) sprites_irq::$0 reg byte x 4.0
(label) sprites_irq::@1
@ -925,39 +919,39 @@ reg byte x [ play_collision::c#2 play_collision::c#1 ]
reg byte a [ play_collision::return#15 ]
reg byte a [ play_move_leftright::return#2 ]
reg byte x [ play_move_down::movedown#6 play_move_down::movedown#7 play_move_down::movedown#10 play_move_down::movedown#2 play_move_down::movedown#3 ]
zp[4]:2 [ score_bcd#23 score_bcd#17 score_bcd#13 score_bcd#0 score_bcd#15 score_bcd#26 ]
zp[1]:6 [ level#33 level#10 level#17 level#19 level#21 ]
zp[1]:7 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#65 current_movedown_slow#10 ]
zp[1]:8 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ]
zp[1]:2 [ level#33 level#10 level#17 level#19 level#21 ]
zp[1]:3 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#65 current_movedown_slow#10 ]
zp[1]:4 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ]
reg byte x [ play_move_down::return#3 ]
zp[1]:9 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ]
zp[1]:10 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ]
zp[1]:5 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ]
zp[1]:6 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ]
reg byte x [ play_increase_level::b#2 play_increase_level::b#1 ]
zp[1]:11 [ play_remove_lines::y#8 play_remove_lines::y#1 current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ]
zp[1]:12 [ play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 render_screen_render#33 render_screen_render#64 render_next::l#7 render_next::l#1 ]
zp[1]:7 [ play_remove_lines::y#8 play_remove_lines::y#1 current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ]
zp[1]:8 [ play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 render_screen_render#33 render_screen_render#64 render_next::l#7 render_next::l#1 ]
reg byte y [ play_remove_lines::r#2 play_remove_lines::r#3 play_remove_lines::r#1 ]
zp[1]:13 [ play_remove_lines::x#2 play_remove_lines::x#1 play_collision::l#6 play_collision::l#1 render_playfield::l#2 render_playfield::l#1 current_xpos#59 current_xpos#118 current_xpos#119 ]
zp[1]:14 [ play_remove_lines::full#4 play_remove_lines::full#2 play_collision::i#2 play_collision::i#3 play_collision::i#10 play_collision::i#12 render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 current_piece_char#68 current_piece_char#99 current_piece_char#100 ]
zp[1]:9 [ play_remove_lines::x#2 play_remove_lines::x#1 play_collision::l#6 play_collision::l#1 render_playfield::l#2 render_playfield::l#1 current_xpos#59 current_xpos#118 current_xpos#119 ]
zp[1]:10 [ play_remove_lines::full#4 play_remove_lines::full#2 play_collision::i#2 play_collision::i#3 play_collision::i#10 play_collision::i#12 render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 current_piece_char#68 current_piece_char#99 current_piece_char#100 ]
reg byte x [ play_remove_lines::w#6 play_remove_lines::w#3 play_remove_lines::w#4 play_remove_lines::w#12 play_remove_lines::w#11 play_remove_lines::w#1 play_remove_lines::w#2 ]
zp[1]:15 [ play_lock_current::l#6 play_lock_current::l#1 play_collision::xp#2 play_collision::xp#8 play_collision::xp#1 render_playfield::c#2 render_playfield::c#1 render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 ]
zp[1]:16 [ play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 current_orientation#37 current_orientation#13 current_orientation#17 current_orientation#20 current_orientation#25 current_orientation#7 ]
zp[1]:11 [ play_lock_current::l#6 play_lock_current::l#1 play_collision::xp#2 play_collision::xp#8 play_collision::xp#1 render_playfield::c#2 render_playfield::c#1 render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 ]
zp[1]:12 [ play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 current_orientation#37 current_orientation#13 current_orientation#17 current_orientation#20 current_orientation#25 current_orientation#7 ]
reg byte x [ play_lock_current::c#2 play_lock_current::c#1 ]
zp[1]:17 [ keyboard_event_pressed::keycode#5 play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 play_movement::return#2 play_movement::render#1 play_movement::return#0 play_movement::render#2 render_moving::l#4 render_moving::l#1 ]
zp[1]:13 [ keyboard_event_pressed::keycode#5 play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 play_movement::return#2 play_movement::render#1 play_movement::return#0 play_movement::render#2 render_moving::l#4 render_moving::l#1 ]
reg byte x [ keyboard_event_get::return#2 keyboard_event_get::return#1 ]
reg byte x [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ]
zp[1]:18 [ keyboard_events_size#10 keyboard_events_size#30 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#29 keyboard_events_size#1 keyboard_events_size#2 ]
zp[1]:14 [ keyboard_events_size#10 keyboard_events_size#30 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#29 keyboard_events_size#1 keyboard_events_size#2 ]
reg byte a [ render_show::d018val#3 ]
reg byte y [ play_init::j#2 play_init::j#1 ]
zp[1]:19 [ play_init::idx#2 play_init::idx#1 render_screen_show#16 render_screen_show#13 ]
zp[1]:15 [ play_init::idx#2 play_init::idx#1 render_screen_show#16 render_screen_show#13 ]
reg byte x [ play_init::b#2 play_init::b#1 ]
reg byte y [ sprites_init::s#2 sprites_init::s#1 ]
zp[1]:20 [ sprites_init::xpos#2 sprites_init::xpos#1 render_screen_render#18 render_screen_render#11 ]
zp[1]:16 [ sprites_init::xpos#2 sprites_init::xpos#1 render_screen_render#18 render_screen_render#11 ]
reg byte y [ render_init::i#2 render_init::i#1 ]
zp[2]:21 [ render_init::li_1#2 render_init::li_1#1 lines_bcd#26 lines_bcd#19 lines_bcd#15 lines_bcd#17 lines_bcd#29 ]
zp[1]:23 [ render_screen_original::y#6 render_screen_original::y#1 current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ]
zp[2]:24 [ render_screen_original::oscr#2 render_screen_original::oscr#4 render_screen_original::oscr#1 current_piece_gfx#35 current_piece_gfx#13 current_piece_gfx#18 current_piece_gfx#123 current_piece_gfx#20 current_piece_gfx#21 current_piece_gfx#7 current_piece_gfx#116 ]
zp[2]:17 [ render_init::li_1#2 render_init::li_1#1 lines_bcd#26 lines_bcd#19 lines_bcd#15 lines_bcd#17 lines_bcd#29 ]
zp[1]:19 [ render_screen_original::y#6 render_screen_original::y#1 current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ]
zp[2]:20 [ render_screen_original::oscr#2 render_screen_original::oscr#4 render_screen_original::oscr#1 current_piece_gfx#35 current_piece_gfx#13 current_piece_gfx#18 current_piece_gfx#123 current_piece_gfx#20 current_piece_gfx#21 current_piece_gfx#7 current_piece_gfx#116 ]
reg byte x [ render_screen_original::x#6 render_screen_original::x#5 render_screen_original::x#4 render_screen_original::x#1 render_screen_original::x#2 render_screen_original::x#3 ]
zp[1]:26 [ render_screen_showing ]
zp[1]:22 [ render_screen_showing ]
zp[4]:23 [ score_bcd ]
zp[1]:27 [ irq_raster_next ]
zp[1]:28 [ irq_sprite_ypos ]
zp[1]:29 [ irq_sprite_ptr ]

@ -1,5 +1,5 @@
@begin: scope:[] from
[0] (byte) A#0 ← (byte) 'a'
[0] (byte) A ← (byte) 'a'
to:@1
@1: scope:[] from @begin
[1] phi()
@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] *((const byte*) SCREEN) ← (byte) A#0
[4] *((const byte*) SCREEN) ← (byte) A
[5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B
[6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA)
[7] call sub
@ -22,7 +22,7 @@ main::@return: scope:[main] from main
(void()) sub()
sub: scope:[sub] from main
[9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C
[10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1
[10] (byte) sub::D#0 ← (byte) A + (byte) 1
[11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0
to:sub::@return
sub::@return: scope:[sub] from sub

@ -7,13 +7,12 @@ Culled Empty Block (label) @1
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte) A#0 ← (byte) 'a'
(byte) A ← (byte) 'a'
to:@2
(void()) main()
main: scope:[main] from @2
(byte) A#1 ← phi( @2/(byte) A#3 )
*((const byte*) SCREEN + (number) 0) ← (byte) A#1
*((const byte*) SCREEN + (number) 0) ← (byte) A
*((const byte*) SCREEN + (number) 1) ← (const byte) main::B
*((const byte*) SCREEN + (number) 2) ← *((const byte*) main::addrA)
call sub
@ -26,9 +25,8 @@ main::@return: scope:[main] from main::@1
(void()) sub()
sub: scope:[sub] from main
(byte) A#2 ← phi( main/(byte) A#1 )
*((const byte*) SCREEN + (number) 3) ← (const byte) sub::C
(number~) sub::$0 ← (byte) A#2 + (number) 1
(number~) sub::$0 ← (byte) A + (number) 1
(byte) sub::D#0 ← (number~) sub::$0
*((const byte*) SCREEN + (number) 4) ← (byte) sub::D#0
to:sub::@return
@ -36,7 +34,6 @@ sub::@return: scope:[sub] from sub
return
to:@return
@2: scope:[] from @begin
(byte) A#3 ← phi( @begin/(byte) A#0 )
call main
to:@3
@3: scope:[] from @2
@ -48,11 +45,7 @@ SYMBOL TABLE SSA
(label) @3
(label) @begin
(label) @end
(byte) A
(byte) A#0
(byte) A#1
(byte) A#2
(byte) A#3
(byte) A loadstore
(const byte*) SCREEN = (byte*)(number) $400
(void()) main()
(label) main::@1
@ -66,12 +59,12 @@ SYMBOL TABLE SSA
(byte) sub::D
(byte) sub::D#0
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← (byte) A#1
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← (byte) A
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← (const byte) main::B
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((const byte*) main::addrA)
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← (const byte) sub::C
Adding number conversion cast (unumber) 1 in (number~) sub::$0 ← (byte) A#2 + (number) 1
Adding number conversion cast (unumber) sub::$0 in (number~) sub::$0 ← (byte) A#2 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (number~) sub::$0 ← (byte) A + (number) 1
Adding number conversion cast (unumber) sub::$0 in (number~) sub::$0 ← (byte) A + (unumber)(number) 1
Adding number conversion cast (unumber) 4 in *((const byte*) SCREEN + (number) 4) ← (byte) sub::D#0
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
@ -89,14 +82,10 @@ Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 4
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) sub::$0 ← (byte) A#2 + (byte) 1
Inferred type updated to byte in (unumber~) sub::$0 ← (byte) A + (byte) 1
Alias (byte) sub::D#0 = (byte~) sub::$0
Alias (byte) A#0 = (byte) A#3
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) A#1 (byte) A#0
Identical Phi Values (byte) A#2 (byte) A#1
Successful SSA optimization Pass2IdenticalPhiElimination
Simplifying expression containing zero SCREEN in [2] *((const byte*) SCREEN + (byte) 0) ← (byte) A#0
Simplifying expression containing zero SCREEN in [1] *((const byte*) SCREEN + (byte) 0) ← (byte) A
Successful SSA optimization PassNSimplifyExpressionWithZero
Consolidated array index constant in *(SCREEN+1)
Consolidated array index constant in *(SCREEN+2)
@ -121,7 +110,7 @@ Adding NOP phi() at start of @end
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] (byte) A#0 ← (byte) 'a'
[0] (byte) A ← (byte) 'a'
to:@1
@1: scope:[] from @begin
[1] phi()
@ -132,7 +121,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] *((const byte*) SCREEN) ← (byte) A#0
[4] *((const byte*) SCREEN) ← (byte) A
[5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B
[6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA)
[7] call sub
@ -144,7 +133,7 @@ main::@return: scope:[main] from main
(void()) sub()
sub: scope:[sub] from main
[9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C
[10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1
[10] (byte) sub::D#0 ← (byte) A + (byte) 1
[11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0
to:sub::@return
sub::@return: scope:[sub] from sub
@ -153,19 +142,19 @@ sub::@return: scope:[sub] from sub
VARIABLE REGISTER WEIGHTS
(byte) A
(byte) A#0 1.0
(byte) A loadstore 1.0
(void()) main()
(void()) sub()
(byte) sub::D
(byte) sub::D#0 4.0
Initial phi equivalence classes
Added variable A to live range equivalence class [ A ]
Added variable sub::D#0 to live range equivalence class [ sub::D#0 ]
Complete equivalence classes
[ A#0 ]
[ A ]
[ sub::D#0 ]
Allocated zp[1]:2 [ A#0 ]
Allocated zp[1]:2 [ A ]
Allocated zp[1]:3 [ sub::D#0 ]
INITIAL ASM
@ -181,7 +170,7 @@ Target platform is c64basic / MOS6502X
.label A = 2
// @begin
__bbegin:
// [0] (byte) A#0 ← (byte) 'a' -- vbuz1=vbuc1
// [0] (byte) A ← (byte) 'a' -- vbuz1=vbuc1
// Not an early constant (address-of is used)
lda #'a'
sta.z A
@ -201,7 +190,7 @@ __bend:
main: {
.const B = 'b'
.label addrA = A
// [4] *((const byte*) SCREEN) ← (byte) A#0 -- _deref_pbuc1=vbuz1
// [4] *((const byte*) SCREEN) ← (byte) A -- _deref_pbuc1=vbuz1
lda.z A
sta SCREEN
// [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B -- _deref_pbuc1=vbuc2
@ -225,7 +214,7 @@ sub: {
// [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C -- _deref_pbuc1=vbuc2
lda #C
sta SCREEN+3
// [10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1 -- vbuz1=vbuz2_plus_1
// [10] (byte) sub::D#0 ← (byte) A + (byte) 1 -- vbuz1=vbuz2_plus_1
ldy.z A
iny
sty.z D
@ -241,24 +230,24 @@ sub: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] (byte) A#0 ← (byte) 'a' [ A#0 ] ( [ A#0 ] ) always clobbers reg byte a
Statement [4] *((const byte*) SCREEN) ← (byte) A#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a
Statement [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a
Statement [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA) [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a
Statement [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C [ A#0 ] ( main:2::sub:7 [ A#0 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ A#0 ] : zp[1]:2 ,
Statement [0] (byte) A ← (byte) 'a' [ A ] ( [ A ] ) always clobbers reg byte a
Statement [4] *((const byte*) SCREEN) ← (byte) A [ A ] ( main:2 [ A ] ) always clobbers reg byte a
Statement [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B [ A ] ( main:2 [ A ] ) always clobbers reg byte a
Statement [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA) [ A ] ( main:2 [ A ] ) always clobbers reg byte a
Statement [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C [ A ] ( main:2::sub:7 [ A ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ A ] : zp[1]:2 ,
Potential registers zp[1]:3 [ sub::D#0 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [sub] 4: zp[1]:3 [ sub::D#0 ]
Uplift Scope [] 1: zp[1]:2 [ A#0 ]
Uplift Scope [] 1: zp[1]:2 [ A ]
Uplift Scope [main]
Uplifting [sub] best 76 combination reg byte x [ sub::D#0 ]
Uplifting [] best 76 combination zp[1]:2 [ A#0 ]
Uplifting [] best 76 combination zp[1]:2 [ A ]
Uplifting [main] best 76 combination
Attempting to uplift remaining variables inzp[1]:2 [ A#0 ]
Uplifting [] best 76 combination zp[1]:2 [ A#0 ]
Attempting to uplift remaining variables inzp[1]:2 [ A ]
Uplifting [] best 76 combination zp[1]:2 [ A ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -272,7 +261,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label A = 2
// @begin
__bbegin:
// [0] (byte) A#0 ← (byte) 'a' -- vbuz1=vbuc1
// [0] (byte) A ← (byte) 'a' -- vbuz1=vbuc1
// Not an early constant (address-of is used)
lda #'a'
sta.z A
@ -292,7 +281,7 @@ __bend:
main: {
.const B = 'b'
.label addrA = A
// [4] *((const byte*) SCREEN) ← (byte) A#0 -- _deref_pbuc1=vbuz1
// [4] *((const byte*) SCREEN) ← (byte) A -- _deref_pbuc1=vbuz1
lda.z A
sta SCREEN
// [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B -- _deref_pbuc1=vbuc2
@ -315,7 +304,7 @@ sub: {
// [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C -- _deref_pbuc1=vbuc2
lda #C
sta SCREEN+3
// [10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1 -- vbuxx=vbuz1_plus_1
// [10] (byte) sub::D#0 ← (byte) A + (byte) 1 -- vbuxx=vbuz1_plus_1
ldx.z A
inx
// [11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuxx
@ -349,8 +338,7 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte) A
(byte) A#0 A zp[1]:2 1.0
(byte) A loadstore zp[1]:2 1.0
(const byte*) SCREEN = (byte*) 1024
(void()) main()
(label) main::@return
@ -362,7 +350,7 @@ FINAL SYMBOL TABLE
(byte) sub::D
(byte) sub::D#0 reg byte x 4.0
zp[1]:2 [ A#0 ]
zp[1]:2 [ A ]
reg byte x [ sub::D#0 ]
@ -381,7 +369,7 @@ Score: 70
// @begin
__bbegin:
// A = 'a'
// [0] (byte) A#0 ← (byte) 'a' -- vbuz1=vbuc1
// [0] (byte) A ← (byte) 'a' -- vbuz1=vbuc1
// Not an early constant (address-of is used)
lda #'a'
sta.z A
@ -397,7 +385,7 @@ main: {
.const B = 'b'
.label addrA = A
// SCREEN[0] = A
// [4] *((const byte*) SCREEN) ← (byte) A#0 -- _deref_pbuc1=vbuz1
// [4] *((const byte*) SCREEN) ← (byte) A -- _deref_pbuc1=vbuz1
lda.z A
sta SCREEN
// SCREEN[1] = B
@ -424,7 +412,7 @@ sub: {
lda #C
sta SCREEN+3
// D = A+1
// [10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1 -- vbuxx=vbuz1_plus_1
// [10] (byte) sub::D#0 ← (byte) A + (byte) 1 -- vbuxx=vbuz1_plus_1
ldx.z A
inx
// SCREEN[4] = D

@ -1,8 +1,7 @@
(label) @1
(label) @begin
(label) @end
(byte) A
(byte) A#0 A zp[1]:2 1.0
(byte) A loadstore zp[1]:2 1.0
(const byte*) SCREEN = (byte*) 1024
(void()) main()
(label) main::@return
@ -14,5 +13,5 @@
(byte) sub::D
(byte) sub::D#0 reg byte x 4.0
zp[1]:2 [ A#0 ]
zp[1]:2 [ A ]
reg byte x [ sub::D#0 ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (word) main::w#0 ← (word) $d03
[4] (word) main::w ← (word) $d03
[5] (byte~) main::$0 ← < *((const word*) main::wp)
[6] *((const byte*) main::screen) ← (byte~) main::$0
[7] (byte~) main::$1 ← > *((const word*) main::wp)

@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(word) main::w#0 ← (word) $d03
(word) main::w ← (word) $d03
(byte~) main::$0 ← < *((const word*) main::wp)
*((const byte*) main::screen + (number) 0) ← (byte~) main::$0
(byte~) main::$1 ← > *((const word*) main::wp)
@ -41,8 +41,7 @@ SYMBOL TABLE SSA
(byte~) main::$3
(label) main::@return
(const byte*) main::screen = (byte*)(number) $400
(word) main::w
(word) main::w#0
(word) main::w loadstore
(const word*) main::wp = &(word) main::w
Adding number conversion cast (unumber) 0 in *((const byte*) main::screen + (number) 0) ← (byte~) main::$0
@ -99,7 +98,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (word) main::w#0 ← (word) $d03
[4] (word) main::w ← (word) $d03
[5] (byte~) main::$0 ← < *((const word*) main::wp)
[6] *((const byte*) main::screen) ← (byte~) main::$0
[7] (byte~) main::$1 ← > *((const word*) main::wp)
@ -121,21 +120,21 @@ VARIABLE REGISTER WEIGHTS
(byte~) main::$1 4.0
(byte~) main::$2 4.0
(byte~) main::$3 4.0
(word) main::w
(word) main::w#0 20.0
(word) main::w loadstore 20.0
Initial phi equivalence classes
Added variable main::w to live range equivalence class [ main::w ]
Added variable main::$0 to live range equivalence class [ main::$0 ]
Added variable main::$1 to live range equivalence class [ main::$1 ]
Added variable main::$2 to live range equivalence class [ main::$2 ]
Added variable main::$3 to live range equivalence class [ main::$3 ]
Complete equivalence classes
[ main::w#0 ]
[ main::w ]
[ main::$0 ]
[ main::$1 ]
[ main::$2 ]
[ main::$3 ]
Allocated zp[2]:2 [ main::w#0 ]
Allocated zp[2]:2 [ main::w ]
Allocated zp[1]:4 [ main::$0 ]
Allocated zp[1]:5 [ main::$1 ]
Allocated zp[1]:6 [ main::$2 ]
@ -169,12 +168,12 @@ __bend:
main: {
.label screen = $400
.label wp = w
.label w = 2
.label __0 = 4
.label __1 = 5
.label __2 = 6
.label __3 = 7
.label w = 2
// [4] (word) main::w#0 ← (word) $d03 -- vwuz1=vwuc1
// [4] (word) main::w ← (word) $d03 -- vwuz1=vwuc1
lda #<$d03
sta.z w
lda #>$d03
@ -217,19 +216,19 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (word) main::w#0 ← (word) $d03 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (word) main::w ← (word) $d03 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const word*) main::wp) ← (word) $210c [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ main::w#0 ] : zp[2]:2 ,
Potential registers zp[2]:2 [ main::w ] : zp[2]:2 ,
Potential registers zp[1]:4 [ main::$0 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ main::$1 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:6 [ main::$2 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:7 [ main::$3 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:2 [ main::w#0 ] 4: zp[1]:4 [ main::$0 ] 4: zp[1]:5 [ main::$1 ] 4: zp[1]:6 [ main::$2 ] 4: zp[1]:7 [ main::$3 ]
Uplift Scope [main] 20: zp[2]:2 [ main::w ] 4: zp[1]:4 [ main::$0 ] 4: zp[1]:5 [ main::$1 ] 4: zp[1]:6 [ main::$2 ] 4: zp[1]:7 [ main::$3 ]
Uplift Scope []
Uplifting [main] best 69 combination zp[2]:2 [ main::w#0 ] reg byte a [ main::$0 ] reg byte a [ main::$1 ] reg byte a [ main::$2 ] reg byte a [ main::$3 ]
Uplifting [main] best 69 combination zp[2]:2 [ main::w ] reg byte a [ main::$0 ] reg byte a [ main::$1 ] reg byte a [ main::$2 ] reg byte a [ main::$3 ]
Limited combination testing to 100 combinations of 256 possible.
Uplifting [] best 69 combination
@ -261,7 +260,7 @@ main: {
.label screen = $400
.label wp = w
.label w = 2
// [4] (word) main::w#0 ← (word) $d03 -- vwuz1=vwuc1
// [4] (word) main::w ← (word) $d03 -- vwuz1=vwuc1
lda #<$d03
sta.z w
lda #>$d03
@ -325,11 +324,10 @@ FINAL SYMBOL TABLE
(byte~) main::$3 reg byte a 4.0
(label) main::@return
(const byte*) main::screen = (byte*) 1024
(word) main::w
(word) main::w#0 w zp[2]:2 20.0
(word) main::w loadstore zp[2]:2 20.0
(const word*) main::wp = &(word) main::w
zp[2]:2 [ main::w#0 ]
zp[2]:2 [ main::w ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]
reg byte a [ main::$2 ]
@ -359,7 +357,7 @@ main: {
.label wp = w
.label w = 2
// w = $0d03
// [4] (word) main::w#0 ← (word) $d03 -- vwuz1=vwuc1
// [4] (word) main::w ← (word) $d03 -- vwuz1=vwuc1
lda #<$d03
sta.z w
lda #>$d03

@ -8,11 +8,10 @@
(byte~) main::$3 reg byte a 4.0
(label) main::@return
(const byte*) main::screen = (byte*) 1024
(word) main::w
(word) main::w#0 w zp[2]:2 20.0
(word) main::w loadstore zp[2]:2 20.0
(const word*) main::wp = &(word) main::w
zp[2]:2 [ main::w#0 ]
zp[2]:2 [ main::w ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]
reg byte a [ main::$2 ]

@ -51,10 +51,10 @@ main: {
rts
}
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zp(4) value, byte* zp(2) dst)
// utoa16w(word zp(2) value, byte* zp(4) dst)
utoa16w: {
.label dst = 2
.label value = 4
.label dst = 4
.label value = 2
lda.z value+1
lsr
lsr
@ -106,7 +106,7 @@ utoa16n: {
}
cls: {
.label screen = $400
.label sc = 4
.label sc = 2
lda #<screen
sta.z sc
lda #>screen

@ -14,23 +14,23 @@ main: scope:[main] from @1
[5] call cls
to:main::@1
main::@1: scope:[main] from main
[6] (byte*) utoa16w::dst#0 ← (byte*) 1024
[6] (byte*) utoa16w::dst ← (byte*) 1024
[7] call utoa16w
to:main::@2
main::@2: scope:[main] from main::@1
[8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28
[8] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28
[9] call utoa16w
to:main::@3
main::@3: scope:[main] from main::@2
[10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28
[10] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28
[11] call utoa16w
to:main::@4
main::@4: scope:[main] from main::@3
[12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[12] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[13] call utoa16w
to:main::@5
main::@5: scope:[main] from main::@4
[14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[14] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[15] call utoa16w
to:main::@return
main::@return: scope:[main] from main::@5
@ -39,7 +39,6 @@ main::@return: scope:[main] from main::@5
(void()) utoa16w((word) utoa16w::value , (byte*) utoa16w::dst)
utoa16w: scope:[utoa16w] from main::@1 main::@2 main::@3 main::@4 main::@5
[17] (byte*) utoa16w::dst#5 ← phi( main::@1/(byte*) utoa16w::dst#0 main::@2/(byte*) utoa16w::dst#1 main::@3/(byte*) utoa16w::dst#2 main::@4/(byte*) utoa16w::dst#3 main::@5/(byte*) utoa16w::dst#4 )
[17] (word) utoa16w::value#5 ← phi( main::@1/(byte) 0 main::@2/(word) $4d2 main::@3/(word) $162e main::@4/(word) $270f main::@5/(word) $e608 )
[18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5
[19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4
@ -67,7 +66,7 @@ utoa16w::@3: scope:[utoa16w] from utoa16w::@2
[35] call utoa16n
to:utoa16w::@4
utoa16w::@4: scope:[utoa16w] from utoa16w::@3
[36] *((byte*) utoa16w::dst#5) ← (byte) 0
[36] *((byte*) utoa16w::dst) ← (byte) 0
to:utoa16w::@return
utoa16w::@return: scope:[utoa16w] from utoa16w::@4
[37] return
@ -87,8 +86,8 @@ utoa16n::@1: scope:[utoa16n] from utoa16n utoa16n::@3
[42] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return
to:utoa16n::@2
utoa16n::@2: scope:[utoa16n] from utoa16n::@1
[43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4)
[44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5)
[43] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4)
[44] *(&(byte*) utoa16w::dst) ← ++ *(&(byte*) utoa16w::dst)
to:utoa16n::@return
utoa16n::@return: scope:[utoa16n] from utoa16n::@1 utoa16n::@2
[45] return

@ -20,35 +20,35 @@ main: scope:[main] from @4
main::@1: scope:[main] from main
(byte*) main::screen#0 ← (byte*)(number) $400
(word) utoa16w::value#0 ← (number) 0
(byte*) utoa16w::dst#0 ← (byte*) main::screen#0
(byte*) utoa16w::dst ← (byte*) main::screen#0
call utoa16w
to:main::@2
main::@2: scope:[main] from main::@1
(byte*) main::screen#5 ← phi( main::@1/(byte*) main::screen#0 )
(byte*) main::screen#1 ← (byte*) main::screen#5 + (number) $28
(word) utoa16w::value#1 ← (number) $4d2
(byte*) utoa16w::dst#1 ← (byte*) main::screen#1
(byte*) utoa16w::dst ← (byte*) main::screen#1
call utoa16w
to:main::@3
main::@3: scope:[main] from main::@2
(byte*) main::screen#6 ← phi( main::@2/(byte*) main::screen#1 )
(byte*) main::screen#2 ← (byte*) main::screen#6 + (number) $28
(word) utoa16w::value#2 ← (number) $162e
(byte*) utoa16w::dst#2 ← (byte*) main::screen#2
(byte*) utoa16w::dst ← (byte*) main::screen#2
call utoa16w
to:main::@4
main::@4: scope:[main] from main::@3
(byte*) main::screen#7 ← phi( main::@3/(byte*) main::screen#2 )
(byte*) main::screen#3 ← (byte*) main::screen#7 + (number) $28
(word) utoa16w::value#3 ← (number) $270f
(byte*) utoa16w::dst#3 ← (byte*) main::screen#3
(byte*) utoa16w::dst ← (byte*) main::screen#3
call utoa16w
to:main::@5
main::@5: scope:[main] from main::@4
(byte*) main::screen#8 ← phi( main::@4/(byte*) main::screen#3 )
(byte*) main::screen#4 ← (byte*) main::screen#8 + (number) $28
(word) utoa16w::value#4 ← (number) $e608
(byte*) utoa16w::dst#4 ← (byte*) main::screen#4
(byte*) utoa16w::dst ← (byte*) main::screen#4
call utoa16w
to:main::@6
main::@6: scope:[main] from main::@5
@ -75,19 +75,17 @@ cls::@return: scope:[cls] from cls::@1
(void()) utoa16w((word) utoa16w::value , (byte*) utoa16w::dst)
utoa16w: scope:[utoa16w] from main::@1 main::@2 main::@3 main::@4 main::@5
(byte*) utoa16w::dst#5 ← phi( main::@1/(byte*) utoa16w::dst#0 main::@2/(byte*) utoa16w::dst#1 main::@3/(byte*) utoa16w::dst#2 main::@4/(byte*) utoa16w::dst#3 main::@5/(byte*) utoa16w::dst#4 )
(word) utoa16w::value#5 ← phi( main::@1/(word) utoa16w::value#0 main::@2/(word) utoa16w::value#1 main::@3/(word) utoa16w::value#2 main::@4/(word) utoa16w::value#3 main::@5/(word) utoa16w::value#4 )
(byte) utoa16w::started#0 ← (byte) 0
(byte~) utoa16w::$0 ← > (word) utoa16w::value#5
(byte~) utoa16w::$1 ← (byte~) utoa16w::$0 >> (number) 4
(byte) utoa16n::nybble#0 ← (byte~) utoa16w::$1
(word**) utoa16n::dst#0 ← &(byte*) utoa16w::dst#5
(word**) utoa16n::dst#0 ← &(byte*) utoa16w::dst
(byte) utoa16n::started#0 ← (byte) utoa16w::started#0
call utoa16n
(byte) utoa16n::return#0 ← (byte) utoa16n::return#5
to:utoa16w::@1
utoa16w::@1: scope:[utoa16w] from utoa16w
(byte*) utoa16w::dst#6 ← phi( utoa16w/(byte*) utoa16w::dst#5 )
(word) utoa16w::value#6 ← phi( utoa16w/(word) utoa16w::value#5 )
(byte) utoa16n::return#6 ← phi( utoa16w/(byte) utoa16n::return#0 )
(byte~) utoa16w::$2 ← (byte) utoa16n::return#6
@ -95,13 +93,12 @@ utoa16w::@1: scope:[utoa16w] from utoa16w
(byte~) utoa16w::$3 ← > (word) utoa16w::value#6
(number~) utoa16w::$4 ← (byte~) utoa16w::$3 & (number) $f
(byte) utoa16n::nybble#1 ← (number~) utoa16w::$4
(word**) utoa16n::dst#1 ← &(byte*) utoa16w::dst#6
(word**) utoa16n::dst#1 ← &(byte*) utoa16w::dst
(byte) utoa16n::started#1 ← (byte) utoa16w::started#1
call utoa16n
(byte) utoa16n::return#1 ← (byte) utoa16n::return#5
to:utoa16w::@2
utoa16w::@2: scope:[utoa16w] from utoa16w::@1
(byte*) utoa16w::dst#7 ← phi( utoa16w::@1/(byte*) utoa16w::dst#6 )
(word) utoa16w::value#7 ← phi( utoa16w::@1/(word) utoa16w::value#6 )
(byte) utoa16n::return#7 ← phi( utoa16w::@1/(byte) utoa16n::return#1 )
(byte~) utoa16w::$5 ← (byte) utoa16n::return#7
@ -109,13 +106,12 @@ utoa16w::@2: scope:[utoa16w] from utoa16w::@1
(byte~) utoa16w::$6 ← < (word) utoa16w::value#7
(byte~) utoa16w::$7 ← (byte~) utoa16w::$6 >> (number) 4
(byte) utoa16n::nybble#2 ← (byte~) utoa16w::$7
(word**) utoa16n::dst#2 ← &(byte*) utoa16w::dst#7
(word**) utoa16n::dst#2 ← &(byte*) utoa16w::dst
(byte) utoa16n::started#2 ← (byte) utoa16w::started#2
call utoa16n
(byte) utoa16n::return#2 ← (byte) utoa16n::return#5
to:utoa16w::@3
utoa16w::@3: scope:[utoa16w] from utoa16w::@2
(byte*) utoa16w::dst#8 ← phi( utoa16w::@2/(byte*) utoa16w::dst#7 )
(word) utoa16w::value#8 ← phi( utoa16w::@2/(word) utoa16w::value#7 )
(byte) utoa16n::return#8 ← phi( utoa16w::@2/(byte) utoa16n::return#2 )
(byte~) utoa16w::$8 ← (byte) utoa16n::return#8
@ -123,14 +119,13 @@ utoa16w::@3: scope:[utoa16w] from utoa16w::@2
(byte~) utoa16w::$9 ← < (word) utoa16w::value#8
(number~) utoa16w::$10 ← (byte~) utoa16w::$9 & (number) $f
(byte) utoa16n::nybble#3 ← (number~) utoa16w::$10
(word**) utoa16n::dst#3 ← &(byte*) utoa16w::dst#8
(word**) utoa16n::dst#3 ← &(byte*) utoa16w::dst
(byte) utoa16n::started#3 ← (number) 1
call utoa16n
(byte) utoa16n::return#3 ← (byte) utoa16n::return#5
to:utoa16w::@4
utoa16w::@4: scope:[utoa16w] from utoa16w::@3
(byte*) utoa16w::dst#9 ← phi( utoa16w::@3/(byte*) utoa16w::dst#8 )
*((byte*) utoa16w::dst#9) ← (number) 0
*((byte*) utoa16w::dst) ← (number) 0
to:utoa16w::@return
utoa16w::@return: scope:[utoa16w] from utoa16w::@4
return
@ -281,17 +276,7 @@ SYMBOL TABLE SSA
(label) utoa16w::@3
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0
(byte*) utoa16w::dst#1
(byte*) utoa16w::dst#2
(byte*) utoa16w::dst#3
(byte*) utoa16w::dst#4
(byte*) utoa16w::dst#5
(byte*) utoa16w::dst#6
(byte*) utoa16w::dst#7
(byte*) utoa16w::dst#8
(byte*) utoa16w::dst#9
(byte*) utoa16w::dst loadstore
(byte) utoa16w::started
(byte) utoa16w::started#0
(byte) utoa16w::started#1
@ -325,7 +310,7 @@ Adding number conversion cast (unumber) 4 in (byte~) utoa16w::$7 ← (byte~) uto
Adding number conversion cast (unumber) $f in (number~) utoa16w::$10 ← (byte~) utoa16w::$9 & (number) $f
Adding number conversion cast (unumber) utoa16w::$10 in (number~) utoa16w::$10 ← (byte~) utoa16w::$9 & (unumber)(number) $f
Adding number conversion cast (unumber) 1 in (byte) utoa16n::started#3 ← (number) 1
Adding number conversion cast (unumber) 0 in *((byte*) utoa16w::dst#9) ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) utoa16w::dst) ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$0 ← (byte) utoa16n::nybble#4 != (number) 0
Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (number) 0
Adding number conversion cast (unumber) 1 in (byte) utoa16n::started#4 ← (number) 1
@ -336,7 +321,7 @@ Inlining cast (word) utoa16w::value#2 ← (unumber)(number) $162e
Inlining cast (word) utoa16w::value#3 ← (unumber)(number) $270f
Inlining cast (word) utoa16w::value#4 ← (unumber)(number) $e608
Inlining cast (byte) utoa16n::started#3 ← (unumber)(number) 1
Inlining cast *((byte*) utoa16w::dst#9) ← (unumber)(number) 0
Inlining cast *((byte*) utoa16w::dst) ← (unumber)(number) 0
Inlining cast (byte) utoa16n::started#4 ← (unumber)(number) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
@ -383,8 +368,8 @@ Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) utoa16w::$4 ← (byte~) utoa16w::$3 & (byte) $f
Inferred type updated to byte in (unumber~) utoa16w::$10 ← (byte~) utoa16w::$9 & (byte) $f
Inversing boolean not [78] (bool~) utoa16n::$1 ← (byte) utoa16n::nybble#4 == (byte) 0 from [77] (bool~) utoa16n::$0 ← (byte) utoa16n::nybble#4 != (byte) 0
Inversing boolean not [82] (bool~) utoa16n::$3 ← (byte) utoa16n::started#5 == (byte) 0 from [81] (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (byte) 0
Inversing boolean not [77] (bool~) utoa16n::$1 ← (byte) utoa16n::nybble#4 == (byte) 0 from [76] (bool~) utoa16n::$0 ← (byte) utoa16n::nybble#4 != (byte) 0
Inversing boolean not [81] (bool~) utoa16n::$3 ← (byte) utoa16n::started#5 == (byte) 0 from [80] (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) main::screen#0 = (byte*) main::screen#5
Alias (byte*) main::screen#1 = (byte*) main::screen#6
@ -393,7 +378,6 @@ Alias (byte*) main::screen#3 = (byte*) main::screen#8
Alias (byte) utoa16n::nybble#0 = (byte~) utoa16w::$1
Alias (byte) utoa16n::return#0 = (byte) utoa16n::return#6
Alias (word) utoa16w::value#5 = (word) utoa16w::value#6 (word) utoa16w::value#7 (word) utoa16w::value#8
Alias (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#6 (byte*) utoa16w::dst#7 (byte*) utoa16w::dst#8 (byte*) utoa16w::dst#9
Alias (byte) utoa16w::started#1 = (byte~) utoa16w::$2
Alias (byte) utoa16n::nybble#1 = (byte~) utoa16w::$4
Alias (byte) utoa16n::return#1 = (byte) utoa16n::return#7
@ -414,8 +398,8 @@ Alias (word**) utoa16n::dst#4 = (word**) utoa16n::dst#6
Alias (byte) utoa16n::return#4 = (byte) utoa16n::started#5
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) cls::$1 [32] if((byte*) cls::sc#1!=rangelast(cls::screen,cls::$0)) goto cls::@1
Simple Condition (bool~) utoa16n::$1 [79] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@1
Simple Condition (bool~) utoa16n::$3 [83] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@2
Simple Condition (bool~) utoa16n::$1 [78] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@1
Simple Condition (bool~) utoa16n::$3 [82] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [26] (byte*~) cls::$0 ← (const byte*) cls::screen + (word) $3e7
Successful SSA optimization Pass2ConstantRValueConsolidation
@ -428,10 +412,10 @@ Constant (const word) utoa16w::value#4 = $e608
Constant (const byte*) cls::$0 = cls::screen+$3e7
Constant (const byte*) cls::sc#0 = cls::screen
Constant (const byte) utoa16w::started#0 = 0
Constant (const word**) utoa16n::dst#0 = &utoa16w::dst#5
Constant (const word**) utoa16n::dst#1 = &utoa16w::dst#5
Constant (const word**) utoa16n::dst#2 = &utoa16w::dst#5
Constant (const word**) utoa16n::dst#3 = &utoa16w::dst#5
Constant (const word**) utoa16n::dst#0 = &utoa16w::dst
Constant (const word**) utoa16n::dst#1 = &utoa16w::dst
Constant (const word**) utoa16n::dst#2 = &utoa16w::dst
Constant (const word**) utoa16n::dst#3 = &utoa16w::dst
Constant (const byte) utoa16n::started#3 = 1
Constant (const byte) utoa16n::started#4 = 1
Successful SSA optimization Pass2ConstantIdentification
@ -498,16 +482,16 @@ Constant inlined main::screen#3 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
Constant inlined utoa16w::started#0 = (byte) 0
Constant inlined utoa16n::started#0 = (byte) 0
Constant inlined cls::$0 = (const byte*) cls::screen+(word) $3e7
Constant inlined utoa16n::dst#1 = &(byte*) utoa16w::dst#5
Constant inlined utoa16n::dst#0 = &(byte*) utoa16w::dst#5
Constant inlined utoa16n::dst#1 = &(byte*) utoa16w::dst
Constant inlined utoa16n::dst#0 = &(byte*) utoa16w::dst
Constant inlined utoa16w::value#4 = (word) $e608
Constant inlined utoa16w::value#3 = (word) $270f
Constant inlined utoa16n::started#3 = (byte) 1
Constant inlined utoa16n::dst#3 = &(byte*) utoa16w::dst#5
Constant inlined utoa16n::dst#3 = &(byte*) utoa16w::dst
Constant inlined utoa16n::started#4 = (byte) 1
Constant inlined utoa16n::dst#2 = &(byte*) utoa16w::dst#5
Constant inlined utoa16n::dst#2 = &(byte*) utoa16w::dst
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (word**) utoa16n::dst#4 &(byte*) utoa16w::dst#5
Identical Phi Values (word**) utoa16n::dst#4 &(byte*) utoa16w::dst
Successful SSA optimization Pass2IdenticalPhiElimination
Added new block during phi lifting cls::@3(between cls::@1 and cls::@1)
Added new block during phi lifting utoa16n::@6(between utoa16n and utoa16n::@1)
@ -522,24 +506,19 @@ Adding NOP phi() at start of utoa16n::@2
Adding NOP phi() at start of cls
CALL GRAPH
Calls in [] to main:2
Calls in [main] to cls:6 utoa16w:9 utoa16w:12 utoa16w:15 utoa16w:18 utoa16w:21
Calls in [utoa16w] to utoa16n:28 utoa16n:36 utoa16n:44 utoa16n:48
Calls in [main] to cls:6 utoa16w:8 utoa16w:10 utoa16w:12 utoa16w:14 utoa16w:16
Calls in [utoa16w] to utoa16n:23 utoa16n:31 utoa16n:39 utoa16n:43
Created 6 initial phi equivalence classes
Coalesced [8] utoa16w::dst#10 ← utoa16w::dst#0
Coalesced [11] utoa16w::dst#11 ← utoa16w::dst#1
Coalesced [14] utoa16w::dst#12 ← utoa16w::dst#2
Coalesced [17] utoa16w::dst#13 ← utoa16w::dst#3
Coalesced [20] utoa16w::dst#14 ← utoa16w::dst#4
Coalesced [27] utoa16n::nybble#8 ← utoa16n::nybble#0
Coalesced [34] utoa16n::nybble#9 ← utoa16n::nybble#1
Coalesced [35] utoa16n::started#9 ← utoa16n::started#1
Coalesced [42] utoa16n::nybble#10 ← utoa16n::nybble#2
Coalesced [43] utoa16n::started#10 ← utoa16n::started#2
Coalesced [47] utoa16n::nybble#11 ← utoa16n::nybble#3
Coalesced [60] utoa16n::return#10 ← utoa16n::started#7
Coalesced [67] cls::sc#3 ← cls::sc#1
Coalesced down to 5 phi equivalence classes
Created 5 initial phi equivalence classes
Coalesced [22] utoa16n::nybble#8 ← utoa16n::nybble#0
Coalesced [29] utoa16n::nybble#9 ← utoa16n::nybble#1
Coalesced [30] utoa16n::started#9 ← utoa16n::started#1
Coalesced [37] utoa16n::nybble#10 ← utoa16n::nybble#2
Coalesced [38] utoa16n::started#10 ← utoa16n::started#2
Coalesced [42] utoa16n::nybble#11 ← utoa16n::nybble#3
Coalesced [55] utoa16n::return#10 ← utoa16n::started#7
Coalesced [62] cls::sc#3 ← cls::sc#1
Coalesced down to 4 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) main::@6
Culled Empty Block (label) utoa16n::@3
@ -572,23 +551,23 @@ main: scope:[main] from @1
[5] call cls
to:main::@1
main::@1: scope:[main] from main
[6] (byte*) utoa16w::dst#0 ← (byte*) 1024
[6] (byte*) utoa16w::dst ← (byte*) 1024
[7] call utoa16w
to:main::@2
main::@2: scope:[main] from main::@1
[8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28
[8] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28
[9] call utoa16w
to:main::@3
main::@3: scope:[main] from main::@2
[10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28
[10] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28
[11] call utoa16w
to:main::@4
main::@4: scope:[main] from main::@3
[12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[12] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[13] call utoa16w
to:main::@5
main::@5: scope:[main] from main::@4
[14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[14] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[15] call utoa16w
to:main::@return
main::@return: scope:[main] from main::@5
@ -597,7 +576,6 @@ main::@return: scope:[main] from main::@5
(void()) utoa16w((word) utoa16w::value , (byte*) utoa16w::dst)
utoa16w: scope:[utoa16w] from main::@1 main::@2 main::@3 main::@4 main::@5
[17] (byte*) utoa16w::dst#5 ← phi( main::@1/(byte*) utoa16w::dst#0 main::@2/(byte*) utoa16w::dst#1 main::@3/(byte*) utoa16w::dst#2 main::@4/(byte*) utoa16w::dst#3 main::@5/(byte*) utoa16w::dst#4 )
[17] (word) utoa16w::value#5 ← phi( main::@1/(byte) 0 main::@2/(word) $4d2 main::@3/(word) $162e main::@4/(word) $270f main::@5/(word) $e608 )
[18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5
[19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4
@ -625,7 +603,7 @@ utoa16w::@3: scope:[utoa16w] from utoa16w::@2
[35] call utoa16n
to:utoa16w::@4
utoa16w::@4: scope:[utoa16w] from utoa16w::@3
[36] *((byte*) utoa16w::dst#5) ← (byte) 0
[36] *((byte*) utoa16w::dst) ← (byte) 0
to:utoa16w::@return
utoa16w::@return: scope:[utoa16w] from utoa16w::@4
[37] return
@ -645,8 +623,8 @@ utoa16n::@1: scope:[utoa16n] from utoa16n utoa16n::@3
[42] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return
to:utoa16n::@2
utoa16n::@2: scope:[utoa16n] from utoa16n::@1
[43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4)
[44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5)
[43] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4)
[44] *(&(byte*) utoa16w::dst) ← ++ *(&(byte*) utoa16w::dst)
to:utoa16n::@return
utoa16n::@return: scope:[utoa16n] from utoa16n::@1 utoa16n::@2
[45] return
@ -695,13 +673,7 @@ VARIABLE REGISTER WEIGHTS
(byte~) utoa16w::$3 4.0
(byte~) utoa16w::$6 4.0
(byte~) utoa16w::$9 4.0
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0 4.0
(byte*) utoa16w::dst#1 4.0
(byte*) utoa16w::dst#2 4.0
(byte*) utoa16w::dst#3 4.0
(byte*) utoa16w::dst#4 4.0
(byte*) utoa16w::dst#5 0.4444444444444444
(byte*) utoa16w::dst loadstore 0.375
(byte) utoa16w::started
(byte) utoa16w::started#1 1.3333333333333333
(byte) utoa16w::started#2 1.3333333333333333
@ -710,10 +682,10 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ utoa16w::value#5 ]
[ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
[ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
[ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
[ cls::sc#2 cls::sc#1 ]
Added variable utoa16w::dst to live range equivalence class [ utoa16w::dst ]
Added variable utoa16w::$0 to live range equivalence class [ utoa16w::$0 ]
Added variable utoa16n::return#0 to live range equivalence class [ utoa16n::return#0 ]
Added variable utoa16w::started#1 to live range equivalence class [ utoa16w::started#1 ]
@ -724,10 +696,10 @@ Added variable utoa16w::$6 to live range equivalence class [ utoa16w::$6 ]
Added variable utoa16w::$9 to live range equivalence class [ utoa16w::$9 ]
Complete equivalence classes
[ utoa16w::value#5 ]
[ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
[ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
[ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
[ cls::sc#2 cls::sc#1 ]
[ utoa16w::dst ]
[ utoa16w::$0 ]
[ utoa16n::return#0 ]
[ utoa16w::started#1 ]
@ -737,10 +709,10 @@ Complete equivalence classes
[ utoa16w::$6 ]
[ utoa16w::$9 ]
Allocated zp[2]:2 [ utoa16w::value#5 ]
Allocated zp[2]:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
Allocated zp[1]:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
Allocated zp[1]:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Allocated zp[2]:8 [ cls::sc#2 cls::sc#1 ]
Allocated zp[1]:4 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
Allocated zp[1]:5 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Allocated zp[2]:6 [ cls::sc#2 cls::sc#1 ]
Allocated zp[2]:8 [ utoa16w::dst ]
Allocated zp[1]:10 [ utoa16w::$0 ]
Allocated zp[1]:11 [ utoa16n::return#0 ]
Allocated zp[1]:12 [ utoa16w::started#1 ]
@ -784,7 +756,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [6] (byte*) utoa16w::dst ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z utoa16w.dst
lda #>$400
@ -792,8 +764,7 @@ main: {
// [7] call utoa16w
// [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
utoa16w_from___b1:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1
// [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#0] -- vwuz1=vbuc1
lda #<0
sta.z utoa16w.value
lda #>0
@ -802,7 +773,7 @@ main: {
jmp __b2
// main::@2
__b2:
// [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
// [8] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28
sta.z utoa16w.dst
lda #>$400+$28
@ -810,8 +781,7 @@ main: {
// [9] call utoa16w
// [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
utoa16w_from___b2:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#0] -- vwuz1=vwuc1
lda #<$4d2
sta.z utoa16w.value
lda #>$4d2
@ -820,7 +790,7 @@ main: {
jmp __b3
// main::@3
__b3:
// [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [10] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28
@ -828,8 +798,7 @@ main: {
// [11] call utoa16w
// [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
utoa16w_from___b3:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#0] -- vwuz1=vwuc1
lda #<$162e
sta.z utoa16w.value
lda #>$162e
@ -838,7 +807,7 @@ main: {
jmp __b4
// main::@4
__b4:
// [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [12] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28+$28
@ -846,8 +815,7 @@ main: {
// [13] call utoa16w
// [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
utoa16w_from___b4:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#0] -- vwuz1=vwuc1
lda #<$270f
sta.z utoa16w.value
lda #>$270f
@ -856,7 +824,7 @@ main: {
jmp __b5
// main::@5
__b5:
// [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [14] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28+$28+$28
@ -864,8 +832,7 @@ main: {
// [15] call utoa16w
// [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
utoa16w_from___b5:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#0] -- vwuz1=vwuc1
lda #<$e608
sta.z utoa16w.value
lda #>$e608
@ -879,13 +846,13 @@ main: {
}
// utoa16w
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zp(2) value, byte* zp(4) dst)
// utoa16w(word zp(2) value, byte* zp(8) dst)
utoa16w: {
.label dst = 8
.label __0 = $a
.label __3 = $d
.label __6 = $10
.label __9 = $11
.label dst = 4
.label started = $c
.label started_1 = $f
.label value = 2
@ -981,7 +948,7 @@ utoa16w: {
jmp __b4
// utoa16w::@4
__b4:
// [36] *((byte*) utoa16w::dst#5) ← (byte) 0 -- _deref_pbuz1=vbuc1
// [36] *((byte*) utoa16w::dst) ← (byte) 0 -- _deref_pbuz1=vbuc1
lda #0
ldy #0
sta (dst),y
@ -993,13 +960,13 @@ utoa16w: {
}
// utoa16n
// Hexadecimal utoa() for a single nybble
// utoa16n(byte zp(6) nybble, byte zp(7) started)
// utoa16n(byte zp(4) nybble, byte zp(5) started)
utoa16n: {
.label nybble = 6
.label nybble = 4
.label return = $b
.label started = 7
.label started = 5
.label return_1 = $e
.label return_2 = 7
.label return_2 = 5
// [39] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@3 -- vbuz1_eq_0_then_la1
lda.z nybble
cmp #0
@ -1028,7 +995,7 @@ utoa16n: {
jmp __b2
// utoa16n::@2
__b2:
// [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) -- _deref_(_deref_pptc1)=pbuc2_derefidx_vbuz1
// [43] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) -- _deref_(_deref_pptc1)=pbuc2_derefidx_vbuz1
ldy.z nybble
lda DIGITS,y
ldy.z utoa16w.dst
@ -1037,7 +1004,7 @@ utoa16n: {
sty.z $ff
ldy #0
sta ($fe),y
// [44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5) -- _deref_pptc1=_inc__deref_pptc1
// [44] *(&(byte*) utoa16w::dst) ← ++ *(&(byte*) utoa16w::dst) -- _deref_pptc1=_inc__deref_pptc1
inc.z utoa16w.dst
bne !+
inc.z utoa16w.dst+1
@ -1051,7 +1018,7 @@ utoa16n: {
// cls
cls: {
.label screen = $400
.label sc = 8
.label sc = 6
// [47] phi from cls to cls::@1 [phi:cls->cls::@1]
__b1_from_cls:
// [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1
@ -1094,45 +1061,45 @@ cls: {
.byte 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 [ utoa16w::dst#0 ] ( main:2 [ utoa16w::dst#0 ] ) always clobbers reg byte a
Statement [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 [ utoa16w::dst#1 ] ( main:2 [ utoa16w::dst#1 ] ) always clobbers reg byte a
Statement [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 [ utoa16w::dst#2 ] ( main:2 [ utoa16w::dst#2 ] ) always clobbers reg byte a
Statement [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#3 ] ( main:2 [ utoa16w::dst#3 ] ) always clobbers reg byte a
Statement [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#4 ] ( main:2 [ utoa16w::dst#4 ] ) always clobbers reg byte a
Statement [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ) always clobbers reg byte a
Statement [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ) always clobbers reg byte a
Statement [23] (byte~) utoa16w::$3 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] ) always clobbers reg byte a
Statement [6] (byte*) utoa16w::dst ← (byte*) 1024 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [8] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [10] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [12] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [14] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] ) always clobbers reg byte a
Statement [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] ) always clobbers reg byte a
Statement [23] (byte~) utoa16w::$3 ← > (word) utoa16w::value#5 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:12 [ utoa16w::started#1 ]
Statement [29] (byte~) utoa16w::$6 ← < (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] ) always clobbers reg byte a
Statement [29] (byte~) utoa16w::$6 ← < (word) utoa16w::value#5 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:15 [ utoa16w::started#2 ]
Statement [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$6 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ) always clobbers reg byte a
Statement [33] (byte~) utoa16w::$9 ← < (word) utoa16w::value#5 [ utoa16w::dst#5 utoa16w::$9 ] ( main:2::utoa16w:7 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:9 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:11 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:13 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:15 [ utoa16w::dst#5 utoa16w::$9 ] ) always clobbers reg byte a
Statement [36] *((byte*) utoa16w::dst#5) ← (byte) 0 [ ] ( main:2::utoa16w:7 [ ] main:2::utoa16w:9 [ ] main:2::utoa16w:11 [ ] main:2::utoa16w:13 [ ] main:2::utoa16w:15 [ ] ) always clobbers reg byte a reg byte y
Statement [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) [ utoa16w::dst#5 utoa16n::return#4 ] ( main:2::utoa16w:7::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp[1]:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Removing always clobbered register reg byte y as potential for zp[1]:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Statement [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$6 >> (byte) 4 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] ) always clobbers reg byte a
Statement [33] (byte~) utoa16w::$9 ← < (word) utoa16w::value#5 [ utoa16w::dst utoa16w::$9 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::$9 ] ) always clobbers reg byte a
Statement [36] *((byte*) utoa16w::dst) ← (byte) 0 [ ] ( main:2::utoa16w:7 [ ] main:2::utoa16w:9 [ ] main:2::utoa16w:11 [ ] main:2::utoa16w:13 [ ] main:2::utoa16w:15 [ ] ) always clobbers reg byte a reg byte y
Statement [43] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) [ utoa16w::dst utoa16n::return#4 ] ( main:2::utoa16w:7::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp[1]:5 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Removing always clobbered register reg byte y as potential for zp[1]:5 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y
Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a
Statement [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 [ utoa16w::dst#0 ] ( main:2 [ utoa16w::dst#0 ] ) always clobbers reg byte a
Statement [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 [ utoa16w::dst#1 ] ( main:2 [ utoa16w::dst#1 ] ) always clobbers reg byte a
Statement [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 [ utoa16w::dst#2 ] ( main:2 [ utoa16w::dst#2 ] ) always clobbers reg byte a
Statement [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#3 ] ( main:2 [ utoa16w::dst#3 ] ) always clobbers reg byte a
Statement [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#4 ] ( main:2 [ utoa16w::dst#4 ] ) always clobbers reg byte a
Statement [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ) always clobbers reg byte a
Statement [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ) always clobbers reg byte a
Statement [23] (byte~) utoa16w::$3 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$3 ] ) always clobbers reg byte a
Statement [29] (byte~) utoa16w::$6 ← < (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$6 ] ) always clobbers reg byte a
Statement [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$6 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ) always clobbers reg byte a
Statement [33] (byte~) utoa16w::$9 ← < (word) utoa16w::value#5 [ utoa16w::dst#5 utoa16w::$9 ] ( main:2::utoa16w:7 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:9 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:11 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:13 [ utoa16w::dst#5 utoa16w::$9 ] main:2::utoa16w:15 [ utoa16w::dst#5 utoa16w::$9 ] ) always clobbers reg byte a
Statement [36] *((byte*) utoa16w::dst#5) ← (byte) 0 [ ] ( main:2::utoa16w:7 [ ] main:2::utoa16w:9 [ ] main:2::utoa16w:11 [ ] main:2::utoa16w:13 [ ] main:2::utoa16w:15 [ ] ) always clobbers reg byte a reg byte y
Statement [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) [ utoa16w::dst#5 utoa16n::return#4 ] ( main:2::utoa16w:7::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] ) always clobbers reg byte a reg byte y
Statement [6] (byte*) utoa16w::dst ← (byte*) 1024 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [8] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [10] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [12] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [14] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst ] ( main:2 [ utoa16w::dst ] ) always clobbers reg byte a
Statement [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::$0 ] ) always clobbers reg byte a
Statement [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16n::nybble#0 ] ) always clobbers reg byte a
Statement [23] (byte~) utoa16w::$3 ← > (word) utoa16w::value#5 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::started#1 utoa16w::$3 ] ) always clobbers reg byte a
Statement [29] (byte~) utoa16w::$6 ← < (word) utoa16w::value#5 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16w::$6 ] ) always clobbers reg byte a
Statement [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$6 >> (byte) 4 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::value#5 utoa16w::started#2 utoa16n::nybble#2 ] ) always clobbers reg byte a
Statement [33] (byte~) utoa16w::$9 ← < (word) utoa16w::value#5 [ utoa16w::dst utoa16w::$9 ] ( main:2::utoa16w:7 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:9 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:11 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:13 [ utoa16w::dst utoa16w::$9 ] main:2::utoa16w:15 [ utoa16w::dst utoa16w::$9 ] ) always clobbers reg byte a
Statement [36] *((byte*) utoa16w::dst) ← (byte) 0 [ ] ( main:2::utoa16w:7 [ ] main:2::utoa16w:9 [ ] main:2::utoa16w:11 [ ] main:2::utoa16w:13 [ ] main:2::utoa16w:15 [ ] ) always clobbers reg byte a reg byte y
Statement [43] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) [ utoa16w::dst utoa16n::return#4 ] ( main:2::utoa16w:7::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:20 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:26 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:32 [ utoa16w::value#5 utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:35 [ utoa16w::dst utoa16n::return#4 ] ) always clobbers reg byte a reg byte y
Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y
Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ utoa16w::value#5 ] : zp[2]:2 ,
Potential registers zp[2]:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] : zp[2]:4 ,
Potential registers zp[1]:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] : zp[1]:7 , reg byte x ,
Potential registers zp[2]:8 [ cls::sc#2 cls::sc#1 ] : zp[2]:8 ,
Potential registers zp[1]:4 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] : zp[1]:5 , reg byte x ,
Potential registers zp[2]:6 [ cls::sc#2 cls::sc#1 ] : zp[2]:6 ,
Potential registers zp[2]:8 [ utoa16w::dst ] : zp[2]:8 ,
Potential registers zp[1]:10 [ utoa16w::$0 ] : zp[1]:10 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:11 [ utoa16n::return#0 ] : zp[1]:11 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:12 [ utoa16w::started#1 ] : zp[1]:12 , reg byte x , reg byte y ,
@ -1143,26 +1110,26 @@ Potential registers zp[1]:16 [ utoa16w::$6 ] : zp[1]:16 , reg byte a , reg byte
Potential registers zp[1]:17 [ utoa16w::$9 ] : zp[1]:17 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [utoa16w] 20.44: zp[2]:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] 4: zp[1]:10 [ utoa16w::$0 ] 4: zp[1]:13 [ utoa16w::$3 ] 4: zp[1]:16 [ utoa16w::$6 ] 4: zp[1]:17 [ utoa16w::$9 ] 1.33: zp[1]:12 [ utoa16w::started#1 ] 1.33: zp[1]:15 [ utoa16w::started#2 ] 0.5: zp[2]:2 [ utoa16w::value#5 ]
Uplift Scope [utoa16n] 14.4: zp[1]:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] 11.14: zp[1]:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] 4: zp[1]:11 [ utoa16n::return#0 ] 4: zp[1]:14 [ utoa16n::return#1 ]
Uplift Scope [cls] 33: zp[2]:8 [ cls::sc#2 cls::sc#1 ]
Uplift Scope [utoa16n] 14.4: zp[1]:4 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] 11.14: zp[1]:5 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] 4: zp[1]:11 [ utoa16n::return#0 ] 4: zp[1]:14 [ utoa16n::return#1 ]
Uplift Scope [cls] 33: zp[2]:6 [ cls::sc#2 cls::sc#1 ]
Uplift Scope [utoa16w] 4: zp[1]:10 [ utoa16w::$0 ] 4: zp[1]:13 [ utoa16w::$3 ] 4: zp[1]:16 [ utoa16w::$6 ] 4: zp[1]:17 [ utoa16w::$9 ] 1.33: zp[1]:12 [ utoa16w::started#1 ] 1.33: zp[1]:15 [ utoa16w::started#2 ] 0.5: zp[2]:2 [ utoa16w::value#5 ] 0.38: zp[2]:8 [ utoa16w::dst ]
Uplift Scope [main]
Uplift Scope []
Uplifting [utoa16w] best 967 combination zp[2]:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] reg byte a [ utoa16w::$0 ] reg byte a [ utoa16w::$3 ] reg byte a [ utoa16w::$6 ] reg byte a [ utoa16w::$9 ] zp[1]:12 [ utoa16w::started#1 ] zp[1]:15 [ utoa16w::started#2 ] zp[2]:2 [ utoa16w::value#5 ]
Limited combination testing to 100 combinations of 2304 possible.
Uplifting [utoa16n] best 915 combination reg byte a [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] reg byte x [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] reg byte x [ utoa16n::return#0 ] reg byte x [ utoa16n::return#1 ]
Uplifting [utoa16n] best 939 combination reg byte a [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] reg byte x [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] reg byte x [ utoa16n::return#0 ] reg byte x [ utoa16n::return#1 ]
Limited combination testing to 100 combinations of 128 possible.
Uplifting [cls] best 915 combination zp[2]:8 [ cls::sc#2 cls::sc#1 ]
Uplifting [cls] best 939 combination zp[2]:6 [ cls::sc#2 cls::sc#1 ]
Uplifting [utoa16w] best 915 combination reg byte a [ utoa16w::$0 ] reg byte a [ utoa16w::$3 ] reg byte a [ utoa16w::$6 ] reg byte a [ utoa16w::$9 ] zp[1]:12 [ utoa16w::started#1 ] zp[1]:15 [ utoa16w::started#2 ] zp[2]:2 [ utoa16w::value#5 ] zp[2]:8 [ utoa16w::dst ]
Limited combination testing to 100 combinations of 2304 possible.
Uplifting [main] best 915 combination
Uplifting [] best 915 combination
Attempting to uplift remaining variables inzp[1]:12 [ utoa16w::started#1 ]
Uplifting [utoa16w] best 909 combination reg byte x [ utoa16w::started#1 ]
Attempting to uplift remaining variables inzp[1]:15 [ utoa16w::started#2 ]
Uplifting [utoa16w] best 903 combination reg byte x [ utoa16w::started#2 ]
Coalescing zero page register [ zp[2]:8 [ cls::sc#2 cls::sc#1 ] ] with [ zp[2]:2 [ utoa16w::value#5 ] ]
Allocated (was zp[2]:4) zp[2]:2 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
Allocated (was zp[2]:8) zp[2]:4 [ cls::sc#2 cls::sc#1 utoa16w::value#5 ]
Coalescing zero page register [ zp[2]:6 [ cls::sc#2 cls::sc#1 ] ] with [ zp[2]:2 [ utoa16w::value#5 ] ]
Allocated (was zp[2]:6) zp[2]:2 [ cls::sc#2 cls::sc#1 utoa16w::value#5 ]
Allocated (was zp[2]:8) zp[2]:4 [ utoa16w::dst ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -1197,7 +1164,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [6] (byte*) utoa16w::dst ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z utoa16w.dst
lda #>$400
@ -1205,8 +1172,7 @@ main: {
// [7] call utoa16w
// [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
utoa16w_from___b1:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1
// [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#0] -- vwuz1=vbuc1
lda #<0
sta.z utoa16w.value
lda #>0
@ -1215,7 +1181,7 @@ main: {
jmp __b2
// main::@2
__b2:
// [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
// [8] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28
sta.z utoa16w.dst
lda #>$400+$28
@ -1223,8 +1189,7 @@ main: {
// [9] call utoa16w
// [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
utoa16w_from___b2:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#0] -- vwuz1=vwuc1
lda #<$4d2
sta.z utoa16w.value
lda #>$4d2
@ -1233,7 +1198,7 @@ main: {
jmp __b3
// main::@3
__b3:
// [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [10] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28
@ -1241,8 +1206,7 @@ main: {
// [11] call utoa16w
// [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
utoa16w_from___b3:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#0] -- vwuz1=vwuc1
lda #<$162e
sta.z utoa16w.value
lda #>$162e
@ -1251,7 +1215,7 @@ main: {
jmp __b4
// main::@4
__b4:
// [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [12] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28+$28
@ -1259,8 +1223,7 @@ main: {
// [13] call utoa16w
// [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
utoa16w_from___b4:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#0] -- vwuz1=vwuc1
lda #<$270f
sta.z utoa16w.value
lda #>$270f
@ -1269,7 +1232,7 @@ main: {
jmp __b5
// main::@5
__b5:
// [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [14] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28+$28+$28
@ -1277,8 +1240,7 @@ main: {
// [15] call utoa16w
// [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
utoa16w_from___b5:
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#0] -- vwuz1=vwuc1
lda #<$e608
sta.z utoa16w.value
lda #>$e608
@ -1292,10 +1254,10 @@ main: {
}
// utoa16w
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zp(4) value, byte* zp(2) dst)
// utoa16w(word zp(2) value, byte* zp(4) dst)
utoa16w: {
.label dst = 2
.label value = 4
.label dst = 4
.label value = 2
// [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1
lda.z value+1
// [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 -- vbuaa=vbuaa_ror_4
@ -1362,7 +1324,7 @@ utoa16w: {
jmp __b4
// utoa16w::@4
__b4:
// [36] *((byte*) utoa16w::dst#5) ← (byte) 0 -- _deref_pbuz1=vbuc1
// [36] *((byte*) utoa16w::dst) ← (byte) 0 -- _deref_pbuz1=vbuc1
lda #0
ldy #0
sta (dst),y
@ -1401,7 +1363,7 @@ utoa16n: {
jmp __b2
// utoa16n::@2
__b2:
// [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) -- _deref_(_deref_pptc1)=pbuc2_derefidx_vbuaa
// [43] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) -- _deref_(_deref_pptc1)=pbuc2_derefidx_vbuaa
tay
lda DIGITS,y
ldy.z utoa16w.dst
@ -1410,7 +1372,7 @@ utoa16n: {
sty.z $ff
ldy #0
sta ($fe),y
// [44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5) -- _deref_pptc1=_inc__deref_pptc1
// [44] *(&(byte*) utoa16w::dst) ← ++ *(&(byte*) utoa16w::dst) -- _deref_pptc1=_inc__deref_pptc1
inc.z utoa16w.dst
bne !+
inc.z utoa16w.dst+1
@ -1424,7 +1386,7 @@ utoa16n: {
// cls
cls: {
.label screen = $400
.label sc = 4
.label sc = 2
// [47] phi from cls to cls::@1 [phi:cls->cls::@1]
__b1_from_cls:
// [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1
@ -1548,8 +1510,8 @@ FINAL SYMBOL TABLE
(label) cls::@1
(label) cls::@return
(byte*) cls::sc
(byte*) cls::sc#1 sc zp[2]:4 16.5
(byte*) cls::sc#2 sc zp[2]:4 16.5
(byte*) cls::sc#1 sc zp[2]:2 16.5
(byte*) cls::sc#2 sc zp[2]:2 16.5
(const byte*) cls::screen = (byte*) 1024
(void()) main()
(label) main::@1
@ -1589,23 +1551,17 @@ FINAL SYMBOL TABLE
(label) utoa16w::@3
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0 dst zp[2]:2 4.0
(byte*) utoa16w::dst#1 dst zp[2]:2 4.0
(byte*) utoa16w::dst#2 dst zp[2]:2 4.0
(byte*) utoa16w::dst#3 dst zp[2]:2 4.0
(byte*) utoa16w::dst#4 dst zp[2]:2 4.0
(byte*) utoa16w::dst#5 dst zp[2]:2 0.4444444444444444
(byte*) utoa16w::dst loadstore zp[2]:4 0.375
(byte) utoa16w::started
(byte) utoa16w::started#1 reg byte x 1.3333333333333333
(byte) utoa16w::started#2 reg byte x 1.3333333333333333
(word) utoa16w::value
(word) utoa16w::value#5 value zp[2]:4 0.5
(word) utoa16w::value#5 value zp[2]:2 0.5
zp[2]:2 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
reg byte a [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
reg byte x [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
zp[2]:4 [ cls::sc#2 cls::sc#1 utoa16w::value#5 ]
zp[2]:2 [ cls::sc#2 cls::sc#1 utoa16w::value#5 ]
zp[2]:4 [ utoa16w::dst ]
reg byte a [ utoa16w::$0 ]
reg byte x [ utoa16n::return#0 ]
reg byte x [ utoa16w::started#1 ]
@ -1641,30 +1597,28 @@ main: {
jsr cls
// main::@1
// utoa16w(00000, screen)
// [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [6] (byte*) utoa16w::dst ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z utoa16w.dst
lda #>$400
sta.z utoa16w.dst+1
// [7] call utoa16w
// [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1
// [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#0] -- vwuz1=vbuc1
lda #<0
sta.z utoa16w.value
sta.z utoa16w.value+1
jsr utoa16w
// main::@2
// utoa16w(01234, screen)
// [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
// [8] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28
sta.z utoa16w.dst
lda #>$400+$28
sta.z utoa16w.dst+1
// [9] call utoa16w
// [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#0] -- vwuz1=vwuc1
lda #<$4d2
sta.z utoa16w.value
lda #>$4d2
@ -1672,15 +1626,14 @@ main: {
jsr utoa16w
// main::@3
// utoa16w(05678, screen)
// [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [10] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28
sta.z utoa16w.dst+1
// [11] call utoa16w
// [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#0] -- vwuz1=vwuc1
lda #<$162e
sta.z utoa16w.value
lda #>$162e
@ -1688,15 +1641,14 @@ main: {
jsr utoa16w
// main::@4
// utoa16w(09999, screen)
// [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [12] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28+$28
sta.z utoa16w.dst+1
// [13] call utoa16w
// [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#0] -- vwuz1=vwuc1
lda #<$270f
sta.z utoa16w.value
lda #>$270f
@ -1704,15 +1656,14 @@ main: {
jsr utoa16w
// main::@5
// utoa16w(58888, screen)
// [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
// [14] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28+$28
sta.z utoa16w.dst
lda #>$400+$28+$28+$28+$28
sta.z utoa16w.dst+1
// [15] call utoa16w
// [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
// [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy
// [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1
// [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#0] -- vwuz1=vwuc1
lda #<$e608
sta.z utoa16w.value
lda #>$e608
@ -1725,10 +1676,10 @@ main: {
}
// utoa16w
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zp(4) value, byte* zp(2) dst)
// utoa16w(word zp(2) value, byte* zp(4) dst)
utoa16w: {
.label dst = 2
.label value = 4
.label dst = 4
.label value = 2
// >value
// [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1
lda.z value+1
@ -1796,7 +1747,7 @@ utoa16w: {
jsr utoa16n
// utoa16w::@4
// *dst = 0
// [36] *((byte*) utoa16w::dst#5) ← (byte) 0 -- _deref_pbuz1=vbuc1
// [36] *((byte*) utoa16w::dst) ← (byte) 0 -- _deref_pbuz1=vbuc1
lda #0
tay
sta (dst),y
@ -1828,7 +1779,7 @@ utoa16n: {
beq __breturn
// utoa16n::@2
// *(*dst)++ = DIGITS[nybble]
// [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) -- _deref_(_deref_pptc1)=pbuc2_derefidx_vbuaa
// [43] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4) -- _deref_(_deref_pptc1)=pbuc2_derefidx_vbuaa
tay
lda DIGITS,y
ldy.z utoa16w.dst
@ -1838,7 +1789,7 @@ utoa16n: {
ldy #0
sta ($fe),y
// *(*dst)++ = DIGITS[nybble];
// [44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5) -- _deref_pptc1=_inc__deref_pptc1
// [44] *(&(byte*) utoa16w::dst) ← ++ *(&(byte*) utoa16w::dst) -- _deref_pptc1=_inc__deref_pptc1
inc.z utoa16w.dst
bne !+
inc.z utoa16w.dst+1
@ -1852,7 +1803,7 @@ utoa16n: {
// cls
cls: {
.label screen = $400
.label sc = 4
.label sc = 2
// [47] phi from cls to cls::@1 [phi:cls->cls::@1]
// [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1
lda #<screen

@ -6,8 +6,8 @@
(label) cls::@1
(label) cls::@return
(byte*) cls::sc
(byte*) cls::sc#1 sc zp[2]:4 16.5
(byte*) cls::sc#2 sc zp[2]:4 16.5
(byte*) cls::sc#1 sc zp[2]:2 16.5
(byte*) cls::sc#2 sc zp[2]:2 16.5
(const byte*) cls::screen = (byte*) 1024
(void()) main()
(label) main::@1
@ -47,23 +47,17 @@
(label) utoa16w::@3
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0 dst zp[2]:2 4.0
(byte*) utoa16w::dst#1 dst zp[2]:2 4.0
(byte*) utoa16w::dst#2 dst zp[2]:2 4.0
(byte*) utoa16w::dst#3 dst zp[2]:2 4.0
(byte*) utoa16w::dst#4 dst zp[2]:2 4.0
(byte*) utoa16w::dst#5 dst zp[2]:2 0.4444444444444444
(byte*) utoa16w::dst loadstore zp[2]:4 0.375
(byte) utoa16w::started
(byte) utoa16w::started#1 reg byte x 1.3333333333333333
(byte) utoa16w::started#2 reg byte x 1.3333333333333333
(word) utoa16w::value
(word) utoa16w::value#5 value zp[2]:4 0.5
(word) utoa16w::value#5 value zp[2]:2 0.5
zp[2]:2 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
reg byte a [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
reg byte x [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
zp[2]:4 [ cls::sc#2 cls::sc#1 utoa16w::value#5 ]
zp[2]:2 [ cls::sc#2 cls::sc#1 utoa16w::value#5 ]
zp[2]:4 [ utoa16w::dst ]
reg byte a [ utoa16w::$0 ]
reg byte x [ utoa16n::return#0 ]
reg byte x [ utoa16w::started#1 ]

@ -6,8 +6,8 @@
.label raster = $d012
.label bordercol = $d020
main: {
.label __1 = 8
.label time_start = 9
.label __1 = 6
.label time_start = 7
sei
jsr cls
__b1:
@ -96,12 +96,12 @@ main: {
.byte 0
}
// Decimal utoa() without using multiply or divide
// utoa10w(word zp(2) value, byte* zp(6) dst)
// utoa10w(word zp(2) value, byte* zp(4) dst)
utoa10w: {
.label value = 2
.label digit = 8
.label dst = 6
.label bStarted = 9
.label digit = 6
.label dst = 4
.label bStarted = 7
lda #<$400+$28+$28+$28+$28+$50
sta.z dst
lda #>$400+$28+$28+$28+$28+$50
@ -177,9 +177,9 @@ utoa10w: {
jmp __b1
}
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zp(2) value, byte* zp(4) dst)
// utoa16w(word zp(2) value, byte* zp(8) dst)
utoa16w: {
.label dst = 4
.label dst = 8
.label value = 2
lda.z value+1
lsr
@ -232,7 +232,7 @@ utoa16n: {
}
cls: {
.label screen = $400
.label sc = 6
.label sc = 4
lda #<screen
sta.z sc
lda #>screen

@ -22,27 +22,27 @@ main::@1: scope:[main] from main main::@1 main::@3
main::@2: scope:[main] from main::@1
[10] *((const byte*) bordercol) ← (byte) 1
[11] (byte) main::time_start#0 ← *((const byte*) raster)
[12] (byte*) utoa16w::dst#0 ← (byte*) 1024
[12] (byte*) utoa16w::dst ← (byte*) 1024
[13] call utoa16w
to:main::@5
main::@5: scope:[main] from main::@2
[14] *((const byte*) bordercol) ← ++ *((const byte*) bordercol)
[15] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28
[15] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28
[16] call utoa16w
to:main::@6
main::@6: scope:[main] from main::@5
[17] *((const byte*) bordercol) ← ++ *((const byte*) bordercol)
[18] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28
[18] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28
[19] call utoa16w
to:main::@7
main::@7: scope:[main] from main::@6
[20] *((const byte*) bordercol) ← ++ *((const byte*) bordercol)
[21] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[21] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[22] call utoa16w
to:main::@8
main::@8: scope:[main] from main::@7
[23] *((const byte*) bordercol) ← ++ *((const byte*) bordercol)
[24] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[24] (byte*) utoa16w::dst ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[25] call utoa16w
to:main::@9
main::@9: scope:[main] from main::@8
@ -111,7 +111,6 @@ utoa10w::@2: scope:[utoa10w] from utoa10w::@1
(void()) utoa16w((word) utoa16w::value , (byte*) utoa16w::dst)
utoa16w: scope:[utoa16w] from main::@2 main::@5 main::@6 main::@7 main::@8
[56] (byte*) utoa16w::dst#5 ← phi( main::@5/(byte*) utoa16w::dst#1 main::@6/(byte*) utoa16w::dst#2 main::@7/(byte*) utoa16w::dst#3 main::@8/(byte*) utoa16w::dst#4 main::@2/(byte*) utoa16w::dst#0 )
[56] (word) utoa16w::value#5 ← phi( main::@5/(word) $4d2 main::@6/(word) $162e main::@7/(word) $270f main::@8/(word) $e608 main::@2/(byte) 0 )
[57] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5
[58] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4
@ -139,7 +138,7 @@ utoa16w::@3: scope:[utoa16w] from utoa16w::@2
[74] call utoa16n
to:utoa16w::@4
utoa16w::@4: scope:[utoa16w] from utoa16w::@3
[75] *((byte*) utoa16w::dst#5) ← (byte) 0
[75] *((byte*) utoa16w::dst) ← (byte) 0
to:utoa16w::@return
utoa16w::@return: scope:[utoa16w] from utoa16w::@4
[76] return
@ -159,8 +158,8 @@ utoa16n::@1: scope:[utoa16n] from utoa16n utoa16n::@3
[81] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return
to:utoa16n::@2
utoa16n::@2: scope:[utoa16n] from utoa16n::@1
[82] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4)
[83] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5)
[82] *(*(&(byte*) utoa16w::dst)) ← *((const byte*) DIGITS + (byte) utoa16n::nybble#4)
[83] *(&(byte*) utoa16w::dst) ← ++ *(&(byte*) utoa16w::dst)
to:utoa16n::@return
utoa16n::@return: scope:[utoa16n] from utoa16n::@1 utoa16n::@2
[84] return

File diff suppressed because it is too large Load Diff

@ -9,12 +9,12 @@
(label) cls::@1
(label) cls::@return
(byte*) cls::sc
(byte*) cls::sc#1 sc zp[2]:6 16.5
(byte*) cls::sc#2 sc zp[2]:6 16.5
(byte*) cls::sc#1 sc zp[2]:4 16.5
(byte*) cls::sc#2 sc zp[2]:4 16.5
(const byte*) cls::screen = (byte*) 1024
(const byte*) control = (byte*) 53265
(void()) main()
(byte~) main::$1 zp[1]:8 101.0
(byte~) main::$1 zp[1]:6 101.0
(byte~) main::$2 reg byte a 202.0
(label) main::@1
(label) main::@2
@ -37,7 +37,7 @@
(byte) main::time_end
(byte) main::time_end#0 reg byte x 11.0
(byte) main::time_start
(byte) main::time_start#0 time_start zp[1]:9 1.2941176470588236
(byte) main::time_start#0 time_start zp[1]:7 1.2941176470588236
(const byte*) raster = (byte*) 53266
(void()) utoa10w((word) utoa10w::value , (byte*) utoa10w::dst)
(byte~) utoa10w::$0 reg byte a 4.0
@ -54,17 +54,17 @@
(label) utoa10w::@8
(label) utoa10w::@return
(byte) utoa10w::bStarted
(byte) utoa10w::bStarted#2 bStarted zp[1]:9 25.25
(byte) utoa10w::bStarted#2 bStarted zp[1]:7 25.25
(byte) utoa10w::digit
(byte) utoa10w::digit#1 digit zp[1]:8 67.33333333333333
(byte) utoa10w::digit#3 digit zp[1]:8 84.16666666666666
(byte) utoa10w::digit#7 digit zp[1]:8 67.33333333333333
(byte) utoa10w::digit#1 digit zp[1]:6 67.33333333333333
(byte) utoa10w::digit#3 digit zp[1]:6 84.16666666666666
(byte) utoa10w::digit#7 digit zp[1]:6 67.33333333333333
(byte*) utoa10w::dst
(byte*) utoa10w::dst#1 dst zp[2]:6 202.0
(byte*) utoa10w::dst#11 dst zp[2]:6 70.7
(byte*) utoa10w::dst#2 dst zp[2]:6 4.0
(byte*) utoa10w::dst#4 dst zp[2]:6 61.39999999999999
(byte*) utoa10w::dst#7 dst zp[2]:6 303.0
(byte*) utoa10w::dst#1 dst zp[2]:4 202.0
(byte*) utoa10w::dst#11 dst zp[2]:4 70.7
(byte*) utoa10w::dst#2 dst zp[2]:4 4.0
(byte*) utoa10w::dst#4 dst zp[2]:4 61.39999999999999
(byte*) utoa10w::dst#7 dst zp[2]:4 303.0
(byte) utoa10w::i
(byte) utoa10w::i#1 reg byte x 151.5
(byte) utoa10w::i#2 reg byte x 62.153846153846146
@ -102,13 +102,7 @@
(label) utoa16w::@3
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0 dst zp[2]:4 22.0
(byte*) utoa16w::dst#1 dst zp[2]:4 22.0
(byte*) utoa16w::dst#2 dst zp[2]:4 22.0
(byte*) utoa16w::dst#3 dst zp[2]:4 22.0
(byte*) utoa16w::dst#4 dst zp[2]:4 22.0
(byte*) utoa16w::dst#5 dst zp[2]:4 2.1111111111111107
(byte*) utoa16w::dst loadstore zp[2]:8 1.78125
(byte) utoa16w::started
(byte) utoa16w::started#1 reg byte x 1.3333333333333333
(byte) utoa16w::started#2 reg byte x 1.3333333333333333
@ -118,14 +112,14 @@
reg byte x [ main::i#2 main::i#1 ]
reg byte x [ utoa10w::i#2 utoa10w::i#1 ]
zp[2]:2 [ utoa16w::value#5 utoa10w::value#10 utoa10w::value#0 utoa10w::value#1 ]
zp[2]:4 [ utoa16w::dst#5 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 utoa16w::dst#0 ]
reg byte a [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
reg byte x [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
zp[2]:6 [ cls::sc#2 cls::sc#1 utoa10w::dst#7 utoa10w::dst#11 utoa10w::dst#4 utoa10w::dst#1 utoa10w::dst#2 ]
zp[1]:8 [ main::$1 utoa10w::digit#3 utoa10w::digit#7 utoa10w::digit#1 ]
zp[2]:4 [ cls::sc#2 cls::sc#1 utoa10w::dst#7 utoa10w::dst#11 utoa10w::dst#4 utoa10w::dst#1 utoa10w::dst#2 ]
zp[1]:6 [ main::$1 utoa10w::digit#3 utoa10w::digit#7 utoa10w::digit#1 ]
reg byte a [ main::$2 ]
reg byte a [ main::rst#0 ]
zp[1]:9 [ main::time_start#0 utoa10w::bStarted#2 ]
zp[1]:7 [ main::time_start#0 utoa10w::bStarted#2 ]
zp[2]:8 [ utoa16w::dst ]
reg byte x [ main::time_end#0 ]
reg byte a [ main::time#0 ]
reg byte a [ utoa10w::$8 ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (dword) main::long_ptr#0 ← (dword) $12345678
[4] (dword) main::long_ptr ← (dword) $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main

@ -7,7 +7,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(dword) main::long_ptr#0 ← (dword) $12345678
(dword) main::long_ptr ← (dword) $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main
@ -27,8 +27,7 @@ SYMBOL TABLE SSA
(label) @end
(void()) main()
(label) main::@return
(dword) main::long_ptr
(dword) main::long_ptr#0
(dword) main::long_ptr loadstore
(const byte) main::long_ptr_zp = <&(dword) main::long_ptr
Adding NOP phi() at start of @begin
@ -58,7 +57,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (dword) main::long_ptr#0 ← (dword) $12345678
[4] (dword) main::long_ptr ← (dword) $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main
@ -68,13 +67,13 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(dword) main::long_ptr
(dword) main::long_ptr#0 20.0
(dword) main::long_ptr loadstore 20.0
Initial phi equivalence classes
Added variable main::long_ptr to live range equivalence class [ main::long_ptr ]
Complete equivalence classes
[ main::long_ptr#0 ]
Allocated zp[4]:2 [ main::long_ptr#0 ]
[ main::long_ptr ]
Allocated zp[4]:2 [ main::long_ptr ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -103,7 +102,7 @@ __bend:
main: {
.const long_ptr_zp = <long_ptr
.label long_ptr = 2
// [4] (dword) main::long_ptr#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::long_ptr ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678
@ -125,15 +124,15 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (dword) main::long_ptr#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (dword) main::long_ptr ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement asm { nop lda(long_ptr_zp),y sta$ff } always clobbers reg byte a
Potential registers zp[4]:2 [ main::long_ptr#0 ] : zp[4]:2 ,
Potential registers zp[4]:2 [ main::long_ptr ] : zp[4]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[4]:2 [ main::long_ptr#0 ]
Uplift Scope [main] 20: zp[4]:2 [ main::long_ptr ]
Uplift Scope []
Uplifting [main] best 51 combination zp[4]:2 [ main::long_ptr#0 ]
Uplifting [main] best 51 combination zp[4]:2 [ main::long_ptr ]
Uplifting [] best 51 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -162,7 +161,7 @@ __bend:
main: {
.const long_ptr_zp = <long_ptr
.label long_ptr = 2
// [4] (dword) main::long_ptr#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::long_ptr ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678
@ -208,11 +207,10 @@ FINAL SYMBOL TABLE
(label) @end
(void()) main()
(label) main::@return
(dword) main::long_ptr
(dword) main::long_ptr#0 long_ptr zp[4]:2 20.0
(dword) main::long_ptr loadstore zp[4]:2 20.0
(const byte) main::long_ptr_zp = <&(dword) main::long_ptr
zp[4]:2 [ main::long_ptr#0 ]
zp[4]:2 [ main::long_ptr ]
FINAL ASSEMBLER
@ -236,7 +234,7 @@ main: {
.const long_ptr_zp = <long_ptr
.label long_ptr = 2
// long_ptr = 0x12345678
// [4] (dword) main::long_ptr#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::long_ptr ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678

@ -3,8 +3,7 @@
(label) @end
(void()) main()
(label) main::@return
(dword) main::long_ptr
(dword) main::long_ptr#0 long_ptr zp[4]:2 20.0
(dword) main::long_ptr loadstore zp[4]:2 20.0
(const byte) main::long_ptr_zp = <&(dword) main::long_ptr
zp[4]:2 [ main::long_ptr#0 ]
zp[4]:2 [ main::long_ptr ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (dword) main::long_ptr#0 ← (dword) $12345678
[4] (dword) main::long_ptr ← (dword) $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main

@ -7,7 +7,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(dword) main::long_ptr#0 ← (dword) $12345678
(dword) main::long_ptr ← (dword) $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main
@ -27,8 +27,7 @@ SYMBOL TABLE SSA
(label) @end
(void()) main()
(label) main::@return
(dword) main::long_ptr
(dword) main::long_ptr#0
(dword) main::long_ptr loadstore
(const byte) main::long_ptr_zp = (byte)&(dword) main::long_ptr
Adding NOP phi() at start of @begin
@ -58,7 +57,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (dword) main::long_ptr#0 ← (dword) $12345678
[4] (dword) main::long_ptr ← (dword) $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main
@ -68,13 +67,13 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(dword) main::long_ptr
(dword) main::long_ptr#0 20.0
(dword) main::long_ptr loadstore 20.0
Initial phi equivalence classes
Added variable main::long_ptr to live range equivalence class [ main::long_ptr ]
Complete equivalence classes
[ main::long_ptr#0 ]
Allocated zp[4]:2 [ main::long_ptr#0 ]
[ main::long_ptr ]
Allocated zp[4]:2 [ main::long_ptr ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -103,7 +102,7 @@ __bend:
main: {
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// [4] (dword) main::long_ptr#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::long_ptr ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678
@ -125,15 +124,15 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (dword) main::long_ptr#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (dword) main::long_ptr ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement asm { nop lda(long_ptr_zp),y sta$ff } always clobbers reg byte a
Potential registers zp[4]:2 [ main::long_ptr#0 ] : zp[4]:2 ,
Potential registers zp[4]:2 [ main::long_ptr ] : zp[4]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[4]:2 [ main::long_ptr#0 ]
Uplift Scope [main] 20: zp[4]:2 [ main::long_ptr ]
Uplift Scope []
Uplifting [main] best 51 combination zp[4]:2 [ main::long_ptr#0 ]
Uplifting [main] best 51 combination zp[4]:2 [ main::long_ptr ]
Uplifting [] best 51 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -162,7 +161,7 @@ __bend:
main: {
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// [4] (dword) main::long_ptr#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::long_ptr ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678
@ -208,11 +207,10 @@ FINAL SYMBOL TABLE
(label) @end
(void()) main()
(label) main::@return
(dword) main::long_ptr
(dword) main::long_ptr#0 long_ptr zp[4]:2 20.0
(dword) main::long_ptr loadstore zp[4]:2 20.0
(const byte) main::long_ptr_zp = (byte)&(dword) main::long_ptr
zp[4]:2 [ main::long_ptr#0 ]
zp[4]:2 [ main::long_ptr ]
FINAL ASSEMBLER
@ -236,7 +234,7 @@ main: {
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// long_ptr = 0x12345678
// [4] (dword) main::long_ptr#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::long_ptr ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678

@ -3,8 +3,7 @@
(label) @end
(void()) main()
(label) main::@return
(dword) main::long_ptr
(dword) main::long_ptr#0 long_ptr zp[4]:2 20.0
(dword) main::long_ptr loadstore zp[4]:2 20.0
(const byte) main::long_ptr_zp = (byte)&(dword) main::long_ptr
zp[4]:2 [ main::long_ptr#0 ]
zp[4]:2 [ main::long_ptr ]

@ -2,14 +2,14 @@
:BasicUpstart(__b1)
.pc = $80d "Program"
.const OFFSET_STRUCT_NODE_VALUE = 2
.label print_line_cursor = 4
.label print_char_cursor = 6
.label last_time = $a
.label rand_seed = $c
.label print_line_cursor = 4
.label print_char_cursor = 6
.label Ticks = $10
.label Ticks_1 = $e
.label free_ = 8
.label root = 2
.label Ticks_1 = $e
__b1:
lda #<0
sta.z last_time

@ -2,10 +2,10 @@
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (word) last_time#0 ← (word) 0
[1] (word) last_time ← (word) 0
to:@2
@2: scope:[] from @1
[2] (word) rand_seed#20 ← (word) 0
[2] (word) rand_seed ← (word) 0
to:@3
@3: scope:[] from @2
[3] phi()
@ -59,13 +59,13 @@ main::@return: scope:[main] from main::@4
(void()) end()
end: scope:[end] from main::@4
[26] (word) Ticks#1 ← (word) last_time#0
[26] (word) Ticks#1 ← (word) last_time
[27] call start
to:end::@1
end::@1: scope:[end] from end
[28] (word) last_time#1 ← (word) last_time#0 - (word) Ticks#1
[29] (word) Ticks#2 ← (word) last_time#1
[30] (word) print_word::w#0 ← (word) Ticks#2
[28] (word) last_time ← (word) last_time - (word) Ticks#1
[29] (word) Ticks#12 ← (word) last_time
[30] (word) print_word::w#0 ← (word) Ticks#12
[31] call print_word
to:end::@2
end::@2: scope:[end] from end::@1
@ -73,119 +73,118 @@ end::@2: scope:[end] from end::@1
[33] call print_ln
to:end::@return
end::@return: scope:[end] from end::@2
[34] (word) last_time#2 ← (word) last_time#1
[35] return
[34] return
to:@return
(void()) print_ln()
print_ln: scope:[print_ln] from end::@2
[36] phi()
[35] phi()
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[37] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
[38] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
[39] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
[36] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
[37] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
[38] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[40] return
[39] return
to:@return
(void()) print_word((word) print_word::w)
print_word: scope:[print_word] from end::@1
[41] (byte) print_byte::b#0 ← > (word) print_word::w#0
[42] call print_byte
[40] (byte) print_byte::b#0 ← > (word) print_word::w#0
[41] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[43] (byte) print_byte::b#1 ← < (word) print_word::w#0
[44] call print_byte
[42] (byte) print_byte::b#1 ← < (word) print_word::w#0
[43] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[45] return
[44] return
to:@return
(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte] from print_word print_word::@1
[46] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[47] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[48] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
[49] call print_char
[45] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[46] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[47] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
[48] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[50] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[51] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
[52] call print_char
[49] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[50] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
[51] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[53] return
[52] return
to:@return
(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char] from main::@6 print_byte print_byte::@1
[54] (byte*) print_char_cursor#26 ← phi( main::@6/(byte*) print_char_cursor#49 print_byte/(byte*) print_char_cursor#10 print_byte::@1/(byte*) print_char_cursor#10 )
[54] (byte) print_char::ch#3 ← phi( main::@6/(byte) print_char::ch#2 print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[55] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3
[56] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#26
[53] (byte*) print_char_cursor#26 ← phi( main::@6/(byte*) print_char_cursor#49 print_byte/(byte*) print_char_cursor#10 print_byte::@1/(byte*) print_char_cursor#10 )
[53] (byte) print_char::ch#3 ← phi( main::@6/(byte) print_char::ch#2 print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[54] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3
[55] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#26
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[57] return
[56] return
to:@return
(void()) start()
start: scope:[start] from end main
asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
[59] (word) rand_seed#0 ← (word) $194a
[58] (word) rand_seed ← (word) $194a
to:start::@return
start::@return: scope:[start] from start
[60] return
[59] return
to:@return
(word()) sum()
sum: scope:[sum] from main::@3
[61] (struct node*) sum::current#1 ← (struct node*) root#11
[60] (struct node*) sum::current#1 ← (struct node*) root#11
to:sum::@1
sum::@1: scope:[sum] from sum sum::@2
[62] (word) sum::s#3 ← phi( sum/(byte) 0 sum::@2/(word) sum::s#2 )
[62] (struct node*) sum::current#3 ← phi( sum/(struct node*) sum::current#1 sum::@2/(struct node*) sum::current#2 )
[63] if((struct node*)(word) 0!=(struct node*) sum::current#3) goto sum::@2
[61] (word) sum::s#3 ← phi( sum/(byte) 0 sum::@2/(word) sum::s#2 )
[61] (struct node*) sum::current#3 ← phi( sum/(struct node*) sum::current#1 sum::@2/(struct node*) sum::current#2 )
[62] if((struct node*)(word) 0!=(struct node*) sum::current#3) goto sum::@2
to:sum::@return
sum::@return: scope:[sum] from sum::@1
[64] return
[63] return
to:@return
sum::@2: scope:[sum] from sum::@1
[65] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_VALUE)
[66] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3)
[64] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_VALUE)
[65] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3)
to:sum::@1
(void()) prepend((word) prepend::x)
prepend: scope:[prepend] from main::@2
[67] phi()
[68] call alloc
[69] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0
[66] phi()
[67] call alloc
[68] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0
to:prepend::@1
prepend::@1: scope:[prepend] from prepend
[70] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2
[71] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20
[72] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) prepend::x#0
[73] (struct node*) root#11 ← (struct node*) prepend::new#1
[69] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2
[70] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20
[71] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) prepend::x#0
[72] (struct node*) root#11 ← (struct node*) prepend::new#1
to:prepend::@return
prepend::@return: scope:[prepend] from prepend::@1
[74] return
[73] return
to:@return
(struct node*()) alloc()
alloc: scope:[alloc] from prepend
[75] (word~) alloc::$1 ← (word) free_#22 << (byte) 2
[76] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1
[77] (word) free_#13 ← ++ (word) free_#22
[74] (word~) alloc::$1 ← (word) free_#22 << (byte) 2
[75] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1
[76] (word) free_#13 ← ++ (word) free_#22
to:alloc::@return
alloc::@return: scope:[alloc] from alloc
[78] return
[77] return
to:@return
(void()) init()
init: scope:[init] from main::@1
[79] phi()
[78] phi()
to:init::@return
init::@return: scope:[init] from init
[80] return
[79] return
to:@return

File diff suppressed because it is too large Load Diff

@ -10,7 +10,7 @@
(const byte) RADIX::OCTAL = (number) 8
(word) Ticks
(word) Ticks#1 Ticks zp[2]:16 2.0
(word) Ticks#2 Ticks_1 zp[2]:14 4.0
(word) Ticks#12 Ticks_1 zp[2]:14 4.0
(struct node*()) alloc()
(word~) alloc::$1 zp[2]:16 4.0
(label) alloc::@return
@ -28,10 +28,7 @@
(const struct node*) heap[(number) $fa0] = { fill( $fa0, 0) }
(void()) init()
(label) init::@return
(word) last_time
(word) last_time#0 last_time zp[2]:10 0.2608695652173913
(word) last_time#1 last_time zp[2]:10 1.0
(word) last_time#2 last_time zp[2]:10 20.0
(word) last_time loadstore zp[2]:10 0.4545454545454546
(void()) main()
(word~) main::$5 zp[2]:8 11.0
(label) main::@1
@ -90,9 +87,7 @@
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0 w zp[2]:14 2.0
(word) rand_seed
(word) rand_seed#0 rand_seed zp[2]:12 20.0
(word) rand_seed#20 rand_seed zp[2]:12 20.0
(word) rand_seed loadstore zp[2]:12 40.0
(struct node*) root
(struct node*) root#11 root zp[2]:2 17.499999999999996
(struct node*) root#20 root zp[2]:2 17.166666666666664
@ -120,9 +115,9 @@ reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp[2]:6 [ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ]
zp[2]:8 [ sum::s#3 sum::s#2 sum::return#2 main::$5 free_#22 free_#13 ]
zp[2]:10 [ last_time#0 last_time#1 last_time#2 ]
zp[2]:12 [ rand_seed#0 rand_seed#20 ]
zp[2]:14 [ Ticks#2 print_word::w#0 ]
zp[2]:10 [ last_time ]
zp[2]:12 [ rand_seed ]
zp[2]:14 [ Ticks#12 print_word::w#0 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]
zp[2]:16 [ alloc::return#2 prepend::new#1 alloc::return#0 alloc::$1 Ticks#1 ]

@ -9,10 +9,10 @@
.label CHARSET = $e800
.const PAGE1 = SCREEN1>>6&$f0|CHARSET>>$a&$e
.const PAGE2 = SCREEN2>>6&$f0|CHARSET>>$a&$e
.label print_line_cursor = 4
.label print_char_cursor = 6
.label last_time = $a
.label rand_seed = $c
.label print_line_cursor = 4
.label print_char_cursor = 6
.label Ticks = $10
.label Ticks_1 = $13
__b1:

@ -2,10 +2,10 @@
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (word) last_time#0 ← (word) 0
[1] (word) last_time ← (word) 0
to:@2
@2: scope:[] from @1
[2] (word) rand_seed#23 ← (word) 0
[2] (word) rand_seed ← (word) 0
to:@3
@3: scope:[] from @2
[3] phi()
@ -16,7 +16,7 @@
(signed word()) main()
main: scope:[main] from @3
[6] (word) rand_seed#21 ← (word) $194a
[6] (word) rand_seed ← (word) $194a
[7] call makechar
to:main::@4
main::@4: scope:[main] from main
@ -108,13 +108,13 @@ doplasma::@2: scope:[doplasma] from doplasma::@1
(void()) end()
end: scope:[end] from main::@3
[51] (word) Ticks#1 ← (word) last_time#0
[51] (word) Ticks#1 ← (word) last_time
[52] call start
to:end::@1
end::@1: scope:[end] from end
[53] (word) last_time#1 ← (word) last_time#0 - (word) Ticks#1
[54] (word) Ticks#2 ← (word) last_time#1
[55] (word) print_word::w#0 ← (word) Ticks#2
[53] (word) last_time ← (word) last_time - (word) Ticks#1
[54] (word) Ticks#12 ← (word) last_time
[55] (word) print_word::w#0 ← (word) Ticks#12
[56] call print_word
to:end::@2
end::@2: scope:[end] from end::@1
@ -122,130 +122,129 @@ end::@2: scope:[end] from end::@1
[58] call print_ln
to:end::@return
end::@return: scope:[end] from end::@2
[59] (word) last_time#2 ← (word) last_time#1
[60] return
[59] return
to:@return
(void()) print_ln()
print_ln: scope:[print_ln] from end::@2
[61] phi()
[60] phi()
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[62] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
[63] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
[64] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
[61] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
[62] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
[63] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[65] return
[64] return
to:@return
(void()) print_word((word) print_word::w)
print_word: scope:[print_word] from end::@1
[66] (byte) print_byte::b#0 ← > (word) print_word::w#0
[67] call print_byte
[65] (byte) print_byte::b#0 ← > (word) print_word::w#0
[66] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[68] (byte) print_byte::b#1 ← < (word) print_word::w#0
[69] call print_byte
[67] (byte) print_byte::b#1 ← < (word) print_word::w#0
[68] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[70] return
[69] return
to:@return
(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte] from print_word print_word::@1
[71] (byte*) print_char_cursor#35 ← phi( print_word/(byte*) 1024 print_word::@1/(byte*) print_char_cursor#10 )
[71] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[72] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[73] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
[74] call print_char
[70] (byte*) print_char_cursor#35 ← phi( print_word/(byte*) 1024 print_word::@1/(byte*) print_char_cursor#10 )
[70] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[71] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[72] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
[73] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[75] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[76] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
[77] call print_char
[74] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[75] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
[76] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[78] return
[77] return
to:@return
(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char] from print_byte print_byte::@1
[79] (byte*) print_char_cursor#25 ← phi( print_byte/(byte*) print_char_cursor#35 print_byte::@1/(byte*) print_char_cursor#10 )
[79] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[80] *((byte*) print_char_cursor#25) ← (byte) print_char::ch#2
[81] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#25
[78] (byte*) print_char_cursor#25 ← phi( print_byte/(byte*) print_char_cursor#35 print_byte::@1/(byte*) print_char_cursor#10 )
[78] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[79] *((byte*) print_char_cursor#25) ← (byte) print_char::ch#2
[80] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#25
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[82] return
[81] return
to:@return
(void()) start()
start: scope:[start] from end main::@4
asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
[84] (word) rand_seed#0 ← (word) $194a
[83] (word) rand_seed ← (word) $194a
to:start::@return
start::@return: scope:[start] from start
[85] return
[84] return
to:@return
(void()) makechar()
makechar: scope:[makechar] from main
[86] phi()
[85] phi()
to:makechar::@1
makechar::@1: scope:[makechar] from makechar makechar::@4
[87] (word) makechar::c#3 ← phi( makechar/(byte) 0 makechar::@4/(word) makechar::c#2 )
[88] if((word) makechar::c#3<(word) $100) goto makechar::@2
[86] (word) makechar::c#3 ← phi( makechar/(byte) 0 makechar::@4/(word) makechar::c#2 )
[87] if((word) makechar::c#3<(word) $100) goto makechar::@2
to:makechar::@return
makechar::@return: scope:[makechar] from makechar::@1
[89] return
[88] return
to:@return
makechar::@2: scope:[makechar] from makechar::@1
[90] (byte~) makechar::$1 ← (byte)(word) makechar::c#3
[91] (byte) makechar::s#1 ← *((const byte*) sinustable + (byte~) makechar::$1)
[89] (byte~) makechar::$1 ← (byte)(word) makechar::c#3
[90] (byte) makechar::s#1 ← *((const byte*) sinustable + (byte~) makechar::$1)
to:makechar::@3
makechar::@3: scope:[makechar] from makechar::@2 makechar::@7
[92] (byte) makechar::i#3 ← phi( makechar::@2/(byte) 0 makechar::@7/(byte) makechar::i#2 )
[93] if((byte) makechar::i#3<(byte) 8) goto makechar::@5
[91] (byte) makechar::i#3 ← phi( makechar::@2/(byte) 0 makechar::@7/(byte) makechar::i#2 )
[92] if((byte) makechar::i#3<(byte) 8) goto makechar::@5
to:makechar::@4
makechar::@4: scope:[makechar] from makechar::@3
[94] (word) makechar::c#2 ← ++ (word) makechar::c#3
[93] (word) makechar::c#2 ← ++ (word) makechar::c#3
to:makechar::@1
makechar::@5: scope:[makechar] from makechar::@3 makechar::@8
[95] (byte) makechar::b#3 ← phi( makechar::@8/(byte) makechar::b#7 makechar::@3/(byte) 0 )
[95] (byte) makechar::ii#3 ← phi( makechar::@8/(byte) makechar::ii#2 makechar::@3/(byte) 0 )
[96] if((byte) makechar::ii#3<(byte) 8) goto makechar::@6
[94] (byte) makechar::b#3 ← phi( makechar::@8/(byte) makechar::b#7 makechar::@3/(byte) 0 )
[94] (byte) makechar::ii#3 ← phi( makechar::@8/(byte) makechar::ii#2 makechar::@3/(byte) 0 )
[95] if((byte) makechar::ii#3<(byte) 8) goto makechar::@6
to:makechar::@7
makechar::@7: scope:[makechar] from makechar::@5
[97] (word~) makechar::$8 ← (word) makechar::c#3 << (byte) 3
[98] (word~) makechar::$9 ← (word~) makechar::$8 + (byte) makechar::i#3
[99] (byte*~) makechar::$10 ← (const byte*) CHARSET + (word~) makechar::$9
[100] *((byte*~) makechar::$10) ← (byte) makechar::b#3
[101] (byte) makechar::i#2 ← ++ (byte) makechar::i#3
[96] (word~) makechar::$8 ← (word) makechar::c#3 << (byte) 3
[97] (word~) makechar::$9 ← (word~) makechar::$8 + (byte) makechar::i#3
[98] (byte*~) makechar::$10 ← (const byte*) CHARSET + (word~) makechar::$9
[99] *((byte*~) makechar::$10) ← (byte) makechar::b#3
[100] (byte) makechar::i#2 ← ++ (byte) makechar::i#3
to:makechar::@3
makechar::@6: scope:[makechar] from makechar::@5
[102] phi()
[103] call rand
[104] (byte) rand::return#2 ← (byte) rand::return#0
[101] phi()
[102] call rand
[103] (byte) rand::return#2 ← (byte) rand::return#0
to:makechar::@10
makechar::@10: scope:[makechar] from makechar::@6
[105] (byte~) makechar::$4 ← (byte) rand::return#2
[106] (byte~) makechar::$5 ← (byte~) makechar::$4 & (byte) $ff
[107] if((byte~) makechar::$5<=(byte) makechar::s#1) goto makechar::@8
[104] (byte~) makechar::$4 ← (byte) rand::return#2
[105] (byte~) makechar::$5 ← (byte~) makechar::$4 & (byte) $ff
[106] if((byte~) makechar::$5<=(byte) makechar::s#1) goto makechar::@8
to:makechar::@9
makechar::@9: scope:[makechar] from makechar::@10
[108] (byte) makechar::b#2 ← (byte) makechar::b#3 | *((const byte*) bittab + (byte) makechar::ii#3)
[107] (byte) makechar::b#2 ← (byte) makechar::b#3 | *((const byte*) bittab + (byte) makechar::ii#3)
to:makechar::@8
makechar::@8: scope:[makechar] from makechar::@10 makechar::@9
[109] (byte) makechar::b#7 ← phi( makechar::@9/(byte) makechar::b#2 makechar::@10/(byte) makechar::b#3 )
[110] (byte) makechar::ii#2 ← ++ (byte) makechar::ii#3
[108] (byte) makechar::b#7 ← phi( makechar::@9/(byte) makechar::b#2 makechar::@10/(byte) makechar::b#3 )
[109] (byte) makechar::ii#2 ← ++ (byte) makechar::ii#3
to:makechar::@5
(byte()) rand()
rand: scope:[rand] from makechar::@6
asm { ldx#8 ldaRAND_SEED+0 __rand_loop: asl rolRAND_SEED+1 bcc__no_eor eor#$2D __no_eor: dex bne__rand_loop staRAND_SEED+0 }
[112] (byte) rand::return#0 ← (byte)(word) rand_seed#21
[111] (byte) rand::return#0 ← (byte)(word) rand_seed
to:rand::@return
rand::@return: scope:[rand] from rand
[113] return
[112] return
to:@return

File diff suppressed because it is too large Load Diff

@ -15,7 +15,7 @@
(const byte*) SCREEN2 = (byte*) 58368
(word) Ticks
(word) Ticks#1 Ticks zp[2]:16 2.0
(word) Ticks#2 Ticks_1 zp[2]:19 4.0
(word) Ticks#12 Ticks_1 zp[2]:19 4.0
(const byte*) VIC_MEMORY = (byte*) 53272
(const byte*) bittab[] = { (byte) 1, (byte) 2, (byte) 4, (byte) 8, (byte) $10, (byte) $20, (byte) $40, (byte) $80 }
(void()) doplasma((byte*) doplasma::scrn)
@ -69,10 +69,7 @@
(label) end::@1
(label) end::@2
(label) end::@return
(word) last_time
(word) last_time#0 last_time zp[2]:10 0.2608695652173913
(word) last_time#1 last_time zp[2]:10 1.0
(word) last_time#2 last_time zp[2]:10 20.0
(word) last_time loadstore zp[2]:10 0.4545454545454546
(signed word()) main()
(label) main::@1
(label) main::@2
@ -163,10 +160,7 @@
(byte) rand::return
(byte) rand::return#0 reg byte a 334.33333333333337
(byte) rand::return#2 reg byte a 2002.0
(word) rand_seed
(word) rand_seed#0 rand_seed zp[2]:12 20.0
(word) rand_seed#21 rand_seed zp[2]:12 0.07142857142857142
(word) rand_seed#23 rand_seed zp[2]:12 20.0
(word) rand_seed loadstore zp[2]:12 0.21428571428571427
(const byte*) sinustable[(number) $100] = { (byte) $80, (byte) $7d, (byte) $7a, (byte) $77, (byte) $74, (byte) $70, (byte) $6d, (byte) $6a, (byte) $67, (byte) $64, (byte) $61, (byte) $5e, (byte) $5b, (byte) $58, (byte) $55, (byte) $52, (byte) $4f, (byte) $4d, (byte) $4a, (byte) $47, (byte) $44, (byte) $41, (byte) $3f, (byte) $3c, (byte) $39, (byte) $37, (byte) $34, (byte) $32, (byte) $2f, (byte) $2d, (byte) $2b, (byte) $28, (byte) $26, (byte) $24, (byte) $22, (byte) $20, (byte) $1e, (byte) $1c, (byte) $1a, (byte) $18, (byte) $16, (byte) $15, (byte) $13, (byte) $11, (byte) $10, (byte) $f, (byte) $d, (byte) $c, (byte) $b, (byte) $a, (byte) 8, (byte) 7, (byte) 6, (byte) 6, (byte) 5, (byte) 4, (byte) 3, (byte) 3, (byte) 2, (byte) 2, (byte) 2, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 2, (byte) 2, (byte) 3, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 6, (byte) 7, (byte) 8, (byte) $a, (byte) $b, (byte) $c, (byte) $d, (byte) $f, (byte) $10, (byte) $11, (byte) $13, (byte) $15, (byte) $16, (byte) $18, (byte) $1a, (byte) $1c, (byte) $1e, (byte) $20, (byte) $22, (byte) $24, (byte) $26, (byte) $28, (byte) $2b, (byte) $2d, (byte) $2f, (byte) $32, (byte) $34, (byte) $37, (byte) $39, (byte) $3c, (byte) $3f, (byte) $41, (byte) $44, (byte) $47, (byte) $4a, (byte) $4d, (byte) $4f, (byte) $52, (byte) $55, (byte) $58, (byte) $5b, (byte) $5e, (byte) $61, (byte) $64, (byte) $67, (byte) $6a, (byte) $6d, (byte) $70, (byte) $74, (byte) $77, (byte) $7a, (byte) $7d, (byte) $80, (byte) $83, (byte) $86, (byte) $89, (byte) $8c, (byte) $90, (byte) $93, (byte) $96, (byte) $99, (byte) $9c, (byte) $9f, (byte) $a2, (byte) $a5, (byte) $a8, (byte) $ab, (byte) $ae, (byte) $b1, (byte) $b3, (byte) $b6, (byte) $b9, (byte) $bc, (byte) $bf, (byte) $c1, (byte) $c4, (byte) $c7, (byte) $c9, (byte) $cc, (byte) $ce, (byte) $d1, (byte) $d3, (byte) $d5, (byte) $d8, (byte) $da, (byte) $dc, (byte) $de, (byte) $e0, (byte) $e2, (byte) $e4, (byte) $e6, (byte) $e8, (byte) $ea, (byte) $eb, (byte) $ed, (byte) $ef, (byte) $f0, (byte) $f1, (byte) $f3, (byte) $f4, (byte) $f5, (byte) $f6, (byte) $f8, (byte) $f9, (byte) $fa, (byte) $fa, (byte) $fb, (byte) $fc, (byte) $fd, (byte) $fd, (byte) $fe, (byte) $fe, (byte) $fe, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $ff, (byte) $fe, (byte) $fe, (byte) $fe, (byte) $fd, (byte) $fd, (byte) $fc, (byte) $fb, (byte) $fa, (byte) $fa, (byte) $f9, (byte) $f8, (byte) $f6, (byte) $f5, (byte) $f4, (byte) $f3, (byte) $f1, (byte) $f0, (byte) $ef, (byte) $ed, (byte) $eb, (byte) $ea, (byte) $e8, (byte) $e6, (byte) $e4, (byte) $e2, (byte) $e0, (byte) $de, (byte) $dc, (byte) $da, (byte) $d8, (byte) $d5, (byte) $d3, (byte) $d1, (byte) $ce, (byte) $cc, (byte) $c9, (byte) $c7, (byte) $c4, (byte) $c1, (byte) $bf, (byte) $bc, (byte) $b9, (byte) $b6, (byte) $b3, (byte) $b1, (byte) $ae, (byte) $ab, (byte) $a8, (byte) $a5, (byte) $a2, (byte) $9f, (byte) $9c, (byte) $99, (byte) $96, (byte) $93, (byte) $90, (byte) $8c, (byte) $89, (byte) $86, (byte) $83 }
(void()) start()
(label) start::@return
@ -185,8 +179,8 @@ zp[2]:6 [ print_char_cursor#25 print_char_cursor#35 print_char_cursor#10 doplasm
zp[1]:8 [ makechar::i#3 makechar::i#2 doplasma::ii#3 doplasma::ii#2 ]
reg byte y [ makechar::ii#3 makechar::ii#2 ]
zp[1]:9 [ makechar::b#3 makechar::b#7 makechar::b#2 doplasma::c1a#3 doplasma::c1a#2 ]
zp[2]:10 [ last_time#0 last_time#1 last_time#2 ]
zp[2]:12 [ rand_seed#0 rand_seed#21 rand_seed#23 ]
zp[2]:10 [ last_time ]
zp[2]:12 [ rand_seed ]
zp[1]:14 [ main::block#1 ]
reg byte a [ main::tmp#1 ]
zp[1]:15 [ main::v#1 ]
@ -198,7 +192,7 @@ reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]
reg byte a [ makechar::$1 ]
zp[1]:18 [ makechar::s#1 doplasma::c1b#3 doplasma::c1b#2 ]
zp[2]:19 [ makechar::$8 makechar::$9 makechar::$10 Ticks#2 print_word::w#0 ]
zp[2]:19 [ makechar::$8 makechar::$9 makechar::$10 Ticks#12 print_word::w#0 ]
reg byte a [ rand::return#2 ]
reg byte a [ makechar::$4 ]
zp[1]:21 [ makechar::$5 doplasma::i#3 doplasma::i#2 ]

@ -2,10 +2,10 @@
:BasicUpstart(__b1)
.pc = $80d "Program"
.label rom = $e000
.label print_char_cursor = 9
.label print_line_cursor = 2
.label last_time = $b
.label rand_seed = $d
.label print_char_cursor = 9
.label print_line_cursor = 2
.label Ticks = $f
.label Ticks_1 = $11
__b1:

@ -2,10 +2,10 @@
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (word) last_time#0 ← (word) 0
[1] (word) last_time ← (word) 0
to:@2
@2: scope:[] from @1
[2] (word) rand_seed#20 ← (word) 0
[2] (word) rand_seed ← (word) 0
to:@3
@3: scope:[] from @2
[3] phi()
@ -188,13 +188,13 @@ sum::@3: scope:[sum] from sum::@2
(void()) end()
end: scope:[end] from main::@3
[78] (word) Ticks#1 ← (word) last_time#0
[78] (word) Ticks#1 ← (word) last_time
[79] call start
to:end::@1
end::@1: scope:[end] from end
[80] (word) last_time#1 ← (word) last_time#0 - (word) Ticks#1
[81] (word) Ticks#2 ← (word) last_time#1
[82] (word) print_word::w#0 ← (word) Ticks#2
[80] (word) last_time ← (word) last_time - (word) Ticks#1
[81] (word) Ticks#12 ← (word) last_time
[82] (word) print_word::w#0 ← (word) Ticks#12
[83] call print_word
to:end::@2
end::@2: scope:[end] from end::@1
@ -202,56 +202,55 @@ end::@2: scope:[end] from end::@1
[85] call print_ln
to:end::@return
end::@return: scope:[end] from end::@2
[86] (word) last_time#2 ← (word) last_time#1
[87] return
[86] return
to:@return
(void()) print_word((word) print_word::w)
print_word: scope:[print_word] from end::@1
[88] (byte) print_byte::b#0 ← > (word) print_word::w#0
[89] call print_byte
[87] (byte) print_byte::b#0 ← > (word) print_word::w#0
[88] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[90] (byte) print_byte::b#1 ← < (word) print_word::w#0
[91] call print_byte
[89] (byte) print_byte::b#1 ← < (word) print_word::w#0
[90] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[92] return
[91] return
to:@return
(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte] from print_word print_word::@1
[93] (byte*) print_char_cursor#49 ← phi( print_word/(byte*) print_char_cursor#51 print_word::@1/(byte*) print_char_cursor#13 )
[93] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[94] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[95] (byte) print_char::ch#0 ← *((const byte*) DIGITS + (byte~) print_byte::$0)
[96] call print_char
[92] (byte*) print_char_cursor#49 ← phi( print_word/(byte*) print_char_cursor#51 print_word::@1/(byte*) print_char_cursor#13 )
[92] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[93] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[94] (byte) print_char::ch#0 ← *((const byte*) DIGITS + (byte~) print_byte::$0)
[95] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[97] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[98] (byte) print_char::ch#1 ← *((const byte*) DIGITS + (byte~) print_byte::$2)
[99] call print_char
[96] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[97] (byte) print_char::ch#1 ← *((const byte*) DIGITS + (byte~) print_byte::$2)
[98] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[100] return
[99] return
to:@return
(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char] from print_byte print_byte::@1
[101] (byte*) print_char_cursor#35 ← phi( print_byte/(byte*) print_char_cursor#49 print_byte::@1/(byte*) print_char_cursor#13 )
[101] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[102] *((byte*) print_char_cursor#35) ← (byte) print_char::ch#2
[103] (byte*) print_char_cursor#13 ← ++ (byte*) print_char_cursor#35
[100] (byte*) print_char_cursor#35 ← phi( print_byte/(byte*) print_char_cursor#49 print_byte::@1/(byte*) print_char_cursor#13 )
[100] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[101] *((byte*) print_char_cursor#35) ← (byte) print_char::ch#2
[102] (byte*) print_char_cursor#13 ← ++ (byte*) print_char_cursor#35
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[104] return
[103] return
to:@return
(void()) start()
start: scope:[start] from end main
asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
[106] (word) rand_seed#0 ← (word) $194a
[105] (word) rand_seed ← (word) $194a
to:start::@return
start::@return: scope:[start] from start
[107] return
[106] return
to:@return

File diff suppressed because it is too large Load Diff

@ -11,16 +11,13 @@
(const word*) RADIX_DECIMAL_VALUES[] = { (word) $2710, (word) $3e8, (word) $64, (word) $a }
(word) Ticks
(word) Ticks#1 Ticks zp[2]:15 2.0
(word) Ticks#2 Ticks_1 zp[2]:17 4.0
(word) Ticks#12 Ticks_1 zp[2]:17 4.0
(const byte*) decimal_digits[(number) 6] = { fill( 6, 0) }
(void()) end()
(label) end::@1
(label) end::@2
(label) end::@return
(word) last_time
(word) last_time#0 last_time zp[2]:11 0.3157894736842105
(word) last_time#1 last_time zp[2]:11 1.0
(word) last_time#2 last_time zp[2]:11 20.0
(word) last_time loadstore zp[2]:11 0.5555555555555556
(signed word()) main()
(label) main::@1
(label) main::@2
@ -82,9 +79,7 @@
(label) print_word_decimal::@return
(word) print_word_decimal::w
(word) print_word_decimal::w#0 w zp[2]:5 13.0
(word) rand_seed
(word) rand_seed#0 rand_seed zp[2]:13 20.0
(word) rand_seed#20 rand_seed zp[2]:13 20.0
(word) rand_seed loadstore zp[2]:13 40.0
(const byte*) rom = (byte*) 57344
(void()) start()
(label) start::@return
@ -174,12 +169,12 @@ reg byte y [ sum::i#3 sum::i#2 ]
reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp[2]:9 [ print_char_cursor#35 print_char_cursor#49 print_char_cursor#46 print_char_cursor#13 print_char_cursor#2 print_char_cursor#51 print_char_cursor#71 print_char_cursor#1 ]
zp[2]:11 [ last_time#0 last_time#1 last_time#2 ]
zp[2]:13 [ rand_seed#0 rand_seed#20 ]
zp[2]:11 [ last_time ]
zp[2]:13 [ rand_seed ]
reg byte a [ utoa::$4 ]
reg byte a [ utoa::$11 ]
reg byte a [ sum::tmp#1 ]
zp[2]:15 [ Ticks#1 main::i#3 main::i#2 ]
zp[2]:17 [ Ticks#2 print_word::w#0 utoa::digit_value#0 utoa_append::sub#0 ]
zp[2]:17 [ Ticks#12 print_word::w#0 utoa::digit_value#0 utoa_append::sub#0 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]

@ -3,10 +3,10 @@
.pc = $80d "Program"
.const COUNT = $4000
.const SQRT_COUNT = $80
.label print_line_cursor = 2
.label print_char_cursor = 4
.label last_time = 6
.label rand_seed = 8
.label print_line_cursor = 2
.label print_char_cursor = 4
.label Ticks = $a
.label Ticks_1 = $c
__b1:

@ -2,10 +2,10 @@
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (word) last_time#0 ← (word) 0
[1] (word) last_time ← (word) 0
to:@2
@2: scope:[] from @1
[2] (word) rand_seed#20 ← (word) 0
[2] (word) rand_seed ← (word) 0
to:@3
@3: scope:[] from @2
[3] phi()
@ -69,13 +69,13 @@ main::@return: scope:[main] from main::@11
(void()) end()
end: scope:[end] from main::@11
[31] (word) Ticks#1 ← (word) last_time#0
[31] (word) Ticks#1 ← (word) last_time
[32] call start
to:end::@1
end::@1: scope:[end] from end
[33] (word) last_time#1 ← (word) last_time#0 - (word) Ticks#1
[34] (word) Ticks#2 ← (word) last_time#1
[35] (word) print_word::w#0 ← (word) Ticks#2
[33] (word) last_time ← (word) last_time - (word) Ticks#1
[34] (word) Ticks#12 ← (word) last_time
[35] (word) print_word::w#0 ← (word) Ticks#12
[36] call print_word
to:end::@2
end::@2: scope:[end] from end::@1
@ -83,107 +83,106 @@ end::@2: scope:[end] from end::@1
[38] call print_ln
to:end::@return
end::@return: scope:[end] from end::@2
[39] (word) last_time#2 ← (word) last_time#1
[40] return
[39] return
to:@return
(void()) print_ln()
print_ln: scope:[print_ln] from end::@2
[41] phi()
[40] phi()
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[42] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
[43] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
[44] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
[41] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
[42] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
[43] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[45] return
[44] return
to:@return
(void()) print_word((word) print_word::w)
print_word: scope:[print_word] from end::@1
[46] (byte) print_byte::b#0 ← > (word) print_word::w#0
[47] call print_byte
[45] (byte) print_byte::b#0 ← > (word) print_word::w#0
[46] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[48] (byte) print_byte::b#1 ← < (word) print_word::w#0
[49] call print_byte
[47] (byte) print_byte::b#1 ← < (word) print_word::w#0
[48] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[50] return
[49] return
to:@return
(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte] from print_word print_word::@1
[51] (byte*) print_char_cursor#35 ← phi( print_word/(byte*) 1024 print_word::@1/(byte*) print_char_cursor#10 )
[51] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[52] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[53] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
[54] call print_char
[50] (byte*) print_char_cursor#35 ← phi( print_word/(byte*) 1024 print_word::@1/(byte*) print_char_cursor#10 )
[50] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[52] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
[53] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[55] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[56] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
[57] call print_char
[54] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[55] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
[56] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[58] return
[57] return
to:@return
(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char] from print_byte print_byte::@1
[59] (byte*) print_char_cursor#25 ← phi( print_byte/(byte*) print_char_cursor#35 print_byte::@1/(byte*) print_char_cursor#10 )
[59] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[60] *((byte*) print_char_cursor#25) ← (byte) print_char::ch#2
[61] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#25
[58] (byte*) print_char_cursor#25 ← phi( print_byte/(byte*) print_char_cursor#35 print_byte::@1/(byte*) print_char_cursor#10 )
[58] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[59] *((byte*) print_char_cursor#25) ← (byte) print_char::ch#2
[60] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#25
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[62] return
[61] return
to:@return
(void()) start()
start: scope:[start] from end main
asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
[64] (word) rand_seed#0 ← (word) $194a
[63] (word) rand_seed ← (word) $194a
to:start::@return
start::@return: scope:[start] from start
[65] return
[64] return
to:@return
(void()) round()
round: scope:[round] from main::@1 main::@10 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9
[66] phi()
[65] phi()
to:round::@1
round::@1: scope:[round] from round round::@2
[67] (byte*) round::p#2 ← phi( round/(const byte*) Sieve round::@2/(byte*) round::p#1 )
[68] if((byte*) round::p#2<(const byte*) Sieve+(const word) COUNT) goto round::@2
[66] (byte*) round::p#2 ← phi( round/(const byte*) Sieve round::@2/(byte*) round::p#1 )
[67] if((byte*) round::p#2<(const byte*) Sieve+(const word) COUNT) goto round::@2
to:round::@3
round::@3: scope:[round] from round::@1 round::@5
[69] (byte) round::I#3 ← phi( round::@5/(byte) round::I#2 round::@1/(byte) 2 )
[70] if((byte) round::I#3<(const byte) SQRT_COUNT) goto round::@4
[68] (byte) round::I#3 ← phi( round::@5/(byte) round::I#2 round::@1/(byte) 2 )
[69] if((byte) round::I#3<(const byte) SQRT_COUNT) goto round::@4
to:round::@return
round::@return: scope:[round] from round::@3
[71] return
[70] return
to:@return
round::@4: scope:[round] from round::@3
[72] if(*((const byte*) Sieve + (byte) round::I#3)!=(byte) 0) goto round::@5
[71] if(*((const byte*) Sieve + (byte) round::I#3)!=(byte) 0) goto round::@5
to:round::@8
round::@8: scope:[round] from round::@4
[73] (byte~) round::$4 ← (byte) round::I#3 << (byte) 1
[74] (byte*) round::S#1 ← (const byte*) Sieve + (byte~) round::$4
[72] (byte~) round::$4 ← (byte) round::I#3 << (byte) 1
[73] (byte*) round::S#1 ← (const byte*) Sieve + (byte~) round::$4
to:round::@6
round::@6: scope:[round] from round::@7 round::@8
[75] (byte*) round::S#3 ← phi( round::@7/(byte*) round::S#2 round::@8/(byte*) round::S#1 )
[76] if((byte*) round::S#3<(const byte*) Sieve+(const word) COUNT) goto round::@7
[74] (byte*) round::S#3 ← phi( round::@7/(byte*) round::S#2 round::@8/(byte*) round::S#1 )
[75] if((byte*) round::S#3<(const byte*) Sieve+(const word) COUNT) goto round::@7
to:round::@5
round::@5: scope:[round] from round::@4 round::@6
[77] (byte) round::I#2 ← ++ (byte) round::I#3
[76] (byte) round::I#2 ← ++ (byte) round::I#3
to:round::@3
round::@7: scope:[round] from round::@6
[78] *((byte*) round::S#3) ← (byte) 1
[79] (byte*) round::S#2 ← (byte*) round::S#3 + (byte) round::I#3
[77] *((byte*) round::S#3) ← (byte) 1
[78] (byte*) round::S#2 ← (byte*) round::S#3 + (byte) round::I#3
to:round::@6
round::@2: scope:[round] from round::@1
[80] *((byte*) round::p#2) ← (byte) 0
[81] (byte*) round::p#1 ← ++ (byte*) round::p#2
[79] *((byte*) round::p#2) ← (byte) 0
[80] (byte*) round::p#1 ← ++ (byte*) round::p#2
to:round::@1

File diff suppressed because it is too large Load Diff

@ -12,15 +12,12 @@
(const byte*) Sieve[(const word) COUNT] = { fill( COUNT, 0) }
(word) Ticks
(word) Ticks#1 Ticks zp[2]:10 2.0
(word) Ticks#2 Ticks_1 zp[2]:12 4.0
(word) Ticks#12 Ticks_1 zp[2]:12 4.0
(void()) end()
(label) end::@1
(label) end::@2
(label) end::@return
(word) last_time
(word) last_time#0 last_time zp[2]:6 0.21428571428571427
(word) last_time#1 last_time zp[2]:6 1.0
(word) last_time#2 last_time zp[2]:6 20.0
(word) last_time loadstore zp[2]:6 0.37037037037037035
(signed word()) main()
(label) main::@1
(label) main::@10
@ -67,9 +64,7 @@
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0 w zp[2]:12 2.0
(word) rand_seed
(word) rand_seed#0 rand_seed zp[2]:8 20.0
(word) rand_seed#20 rand_seed zp[2]:8 20.0
(word) rand_seed loadstore zp[2]:8 40.0
(void()) round()
(byte~) round::$4 reg byte a 22.0
(label) round::@1
@ -100,10 +95,10 @@ reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp[2]:2 [ round::p#2 round::p#1 print_line_cursor#8 print_line_cursor#1 ]
reg byte x [ round::I#3 round::I#2 ]
zp[2]:4 [ round::S#3 round::S#2 round::S#1 print_char_cursor#25 print_char_cursor#35 print_char_cursor#10 ]
zp[2]:6 [ last_time#0 last_time#1 last_time#2 ]
zp[2]:8 [ rand_seed#0 rand_seed#20 ]
zp[2]:6 [ last_time ]
zp[2]:8 [ rand_seed ]
zp[2]:10 [ Ticks#1 ]
zp[2]:12 [ Ticks#2 print_word::w#0 ]
zp[2]:12 [ Ticks#12 print_word::w#0 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]
reg byte a [ round::$4 ]

@ -6,10 +6,10 @@
.const SIZEOF_SIGNED_WORD = 2
main: {
.label SCREEN = $400
.label __0 = 2
.label __1 = 2
.label y1 = 4
.label y2 = 6
.label __0 = 2
.label __1 = 2
lda #<$1234
sta.z y1
lda #>$1234

@ -10,8 +10,8 @@
(void()) main()
main: scope:[main] from @1
[4] (signed word) main::y1#0 ← (signed word) $1234
[5] (signed word) main::y2#0 ← (signed word) $1234
[4] (signed word) main::y1 ← (signed word) $1234
[5] (signed word) main::y2 ← (signed word) $1234
[6] call foo
[7] (signed word) foo::return#2 ← (signed word) foo::return#0
to:main::@1
@ -31,7 +31,7 @@ main::@return: scope:[main] from main::@2
(signed word()) foo((byte) foo::x , (signed word*) foo::y)
foo: scope:[foo] from main main::@1
[15] (signed word*) foo::y#2 ← phi( main/&(signed word) main::y1#0 main::@1/&(signed word) main::y2#0 )
[15] (signed word*) foo::y#2 ← phi( main/&(signed word) main::y1 main::@1/&(signed word) main::y2 )
[15] (byte) foo::x#2 ← phi( main/(byte) 1 main::@1/(byte) 2 )
[16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1
[17] (signed word) foo::return#0 ← *((const signed word*) wow + (byte~) foo::$1) + *((signed word*) foo::y#2)

@ -27,22 +27,21 @@ foo::@return: scope:[foo] from foo
(void()) main()
main: scope:[main] from @2
(signed word*) main::SCREEN#0 ← (signed word*)(number) $400
(signed word) main::y1#0 ← (signed word) $1234
(signed word) main::y2#0 ← (signed word) $1234
(signed word) main::y1 ← (signed word) $1234
(signed word) main::y2 ← (signed word) $1234
(byte) foo::x#0 ← (number) 1
(signed word*) foo::y#0 ← &(signed word) main::y1#0
(signed word*) foo::y#0 ← &(signed word) main::y1
call foo
(signed word) foo::return#2 ← (signed word) foo::return#1
to:main::@1
main::@1: scope:[main] from main
(signed word) main::y2#1 ← phi( main/(signed word) main::y2#0 )
(signed word*) main::SCREEN#3 ← phi( main/(signed word*) main::SCREEN#0 )
(signed word) foo::return#5 ← phi( main/(signed word) foo::return#2 )
(signed word~) main::$0 ← (signed word) foo::return#5
*((signed word*) main::SCREEN#3) ← (signed word~) main::$0
(signed word*) main::SCREEN#1 ← (signed word*) main::SCREEN#3 + (const byte) SIZEOF_SIGNED_WORD
(byte) foo::x#1 ← (number) 2
(signed word*) foo::y#1 ← &(signed word) main::y2#1
(signed word*) foo::y#1 ← &(signed word) main::y2
call foo
(signed word) foo::return#3 ← (signed word) foo::return#1
to:main::@2
@ -101,11 +100,8 @@ SYMBOL TABLE SSA
(signed word*) main::SCREEN#2
(signed word*) main::SCREEN#3
(signed word*) main::SCREEN#4
(signed word) main::y1
(signed word) main::y1#0
(signed word) main::y2
(signed word) main::y2#0
(signed word) main::y2#1
(signed word) main::y1 loadstore
(signed word) main::y2 loadstore
(const signed word*) wow[(number) 4] = { (signed word)(number) $cafe, (signed word)(number) $babe, (signed word) $1234, (signed word) $5678 }
Adding number conversion cast (unumber) 1 in (byte) foo::x#0 ← (number) 1
@ -126,15 +122,14 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (signed word) foo::return#0 = (signed word~) foo::$0 (signed word) foo::return#4 (signed word) foo::return#1
Alias (signed word) foo::return#2 = (signed word) foo::return#5
Alias (signed word*) main::SCREEN#0 = (signed word*) main::SCREEN#3
Alias (signed word) main::y2#0 = (signed word) main::y2#1
Alias (signed word) foo::return#3 = (signed word) foo::return#6
Alias (signed word*) main::SCREEN#1 = (signed word*) main::SCREEN#4
Successful SSA optimization Pass2AliasElimination
Constant (const signed word*) main::SCREEN#0 = (signed word*) 1024
Constant (const byte) foo::x#0 = 1
Constant (const signed word*) foo::y#0 = &main::y1#0
Constant (const signed word*) foo::y#0 = &main::y1
Constant (const byte) foo::x#1 = 2
Constant (const signed word*) foo::y#1 = &main::y2#0
Constant (const signed word*) foo::y#1 = &main::y2
Successful SSA optimization Pass2ConstantIdentification
Converting *(pointer+n) to pointer[n] [24] *((signed word*) main::SCREEN#1) ← (signed word~) main::$1 -- *(main::SCREEN#0 + SIZEOF_SIGNED_WORD)
Successful SSA optimization Pass2InlineDerefIdx
@ -148,9 +143,9 @@ Inlining constant with var siblings (const byte) foo::x#0
Inlining constant with var siblings (const signed word*) foo::y#0
Inlining constant with var siblings (const byte) foo::x#1
Inlining constant with var siblings (const signed word*) foo::y#1
Constant inlined foo::y#0 = &(signed word) main::y1#0
Constant inlined foo::y#0 = &(signed word) main::y1
Constant inlined foo::x#1 = (byte) 2
Constant inlined foo::y#1 = &(signed word) main::y2#0
Constant inlined foo::y#1 = &(signed word) main::y2
Constant inlined foo::x#0 = (byte) 1
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN#0+SIZEOF_SIGNED_WORD)
@ -184,8 +179,8 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (signed word) main::y1#0 ← (signed word) $1234
[5] (signed word) main::y2#0 ← (signed word) $1234
[4] (signed word) main::y1 ← (signed word) $1234
[5] (signed word) main::y2 ← (signed word) $1234
[6] call foo
[7] (signed word) foo::return#2 ← (signed word) foo::return#0
to:main::@1
@ -205,7 +200,7 @@ main::@return: scope:[main] from main::@2
(signed word()) foo((byte) foo::x , (signed word*) foo::y)
foo: scope:[foo] from main main::@1
[15] (signed word*) foo::y#2 ← phi( main/&(signed word) main::y1#0 main::@1/&(signed word) main::y2#0 )
[15] (signed word*) foo::y#2 ← phi( main/&(signed word) main::y1 main::@1/&(signed word) main::y2 )
[15] (byte) foo::x#2 ← phi( main/(byte) 1 main::@1/(byte) 2 )
[16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1
[17] (signed word) foo::return#0 ← *((const signed word*) wow + (byte~) foo::$1) + *((signed word*) foo::y#2)
@ -230,14 +225,14 @@ VARIABLE REGISTER WEIGHTS
(signed word~) main::$0 4.0
(signed word~) main::$1 4.0
(signed word*) main::SCREEN
(signed word) main::y1
(signed word) main::y1#0 20.0
(signed word) main::y2
(signed word) main::y2#0 20.0
(signed word) main::y1 loadstore 20.0
(signed word) main::y2 loadstore 20.0
Initial phi equivalence classes
[ foo::x#2 ]
[ foo::y#2 ]
Added variable main::y1 to live range equivalence class [ main::y1 ]
Added variable main::y2 to live range equivalence class [ main::y2 ]
Added variable foo::return#2 to live range equivalence class [ foo::return#2 ]
Added variable main::$0 to live range equivalence class [ main::$0 ]
Added variable foo::return#3 to live range equivalence class [ foo::return#3 ]
@ -247,8 +242,8 @@ Added variable foo::return#0 to live range equivalence class [ foo::return#0 ]
Complete equivalence classes
[ foo::x#2 ]
[ foo::y#2 ]
[ main::y1#0 ]
[ main::y2#0 ]
[ main::y1 ]
[ main::y2 ]
[ foo::return#2 ]
[ main::$0 ]
[ foo::return#3 ]
@ -257,8 +252,8 @@ Complete equivalence classes
[ foo::return#0 ]
Allocated zp[1]:2 [ foo::x#2 ]
Allocated zp[2]:3 [ foo::y#2 ]
Allocated zp[2]:5 [ main::y1#0 ]
Allocated zp[2]:7 [ main::y2#0 ]
Allocated zp[2]:5 [ main::y1 ]
Allocated zp[2]:7 [ main::y2 ]
Allocated zp[2]:9 [ foo::return#2 ]
Allocated zp[2]:11 [ main::$0 ]
Allocated zp[2]:13 [ foo::return#3 ]
@ -294,16 +289,16 @@ __bend:
// main
main: {
.label SCREEN = $400
.label __0 = $b
.label __1 = $f
.label y1 = 5
.label y2 = 7
// [4] (signed word) main::y1#0 ← (signed word) $1234 -- vwsz1=vwsc1
.label __0 = $b
.label __1 = $f
// [4] (signed word) main::y1 ← (signed word) $1234 -- vwsz1=vwsc1
lda #<$1234
sta.z y1
lda #>$1234
sta.z y1+1
// [5] (signed word) main::y2#0 ← (signed word) $1234 -- vwsz1=vwsc1
// [5] (signed word) main::y2 ← (signed word) $1234 -- vwsz1=vwsc1
lda #<$1234
sta.z y2
lda #>$1234
@ -311,7 +306,7 @@ main: {
// [6] call foo
// [15] phi from main to foo [phi:main->foo]
foo_from_main:
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y1#0 [phi:main->foo#0] -- pwsz1=pwsc1
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y1 [phi:main->foo#0] -- pwsz1=pwsc1
lda #<y1
sta.z foo.y
lda #>y1
@ -341,7 +336,7 @@ main: {
// [10] call foo
// [15] phi from main::@1 to foo [phi:main::@1->foo]
foo_from___b1:
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y2#0 [phi:main::@1->foo#0] -- pwsz1=pwsc1
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y2 [phi:main::@1->foo#0] -- pwsz1=pwsc1
lda #<y2
sta.z foo.y
lda #>y2
@ -408,8 +403,8 @@ foo: {
wow: .word $cafe, $babe, $1234, $5678
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (signed word) main::y1#0 ← (signed word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (signed word) main::y2#0 ← (signed word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (signed word) main::y1 ← (signed word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (signed word) main::y2 ← (signed word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] (signed word) foo::return#2 ← (signed word) foo::return#0 [ foo::return#2 ] ( main:2 [ foo::return#2 ] ) always clobbers reg byte a
Statement [8] (signed word~) main::$0 ← (signed word) foo::return#2 [ main::$0 ] ( main:2 [ main::$0 ] ) always clobbers reg byte a
Statement [9] *((const signed word*) main::SCREEN#0) ← (signed word~) main::$0 [ ] ( main:2 [ ] ) always clobbers reg byte a
@ -420,8 +415,8 @@ Statement [16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1 [ foo::y#2 foo::$
Statement [17] (signed word) foo::return#0 ← *((const signed word*) wow + (byte~) foo::$1) + *((signed word*) foo::y#2) [ foo::return#0 ] ( main:2::foo:6 [ foo::return#0 ] main:2::foo:10 [ foo::return#0 ] ) always clobbers reg byte a reg byte y
Potential registers zp[1]:2 [ foo::x#2 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:3 [ foo::y#2 ] : zp[2]:3 ,
Potential registers zp[2]:5 [ main::y1#0 ] : zp[2]:5 ,
Potential registers zp[2]:7 [ main::y2#0 ] : zp[2]:7 ,
Potential registers zp[2]:5 [ main::y1 ] : zp[2]:5 ,
Potential registers zp[2]:7 [ main::y2 ] : zp[2]:7 ,
Potential registers zp[2]:9 [ foo::return#2 ] : zp[2]:9 ,
Potential registers zp[2]:11 [ main::$0 ] : zp[2]:11 ,
Potential registers zp[2]:13 [ foo::return#3 ] : zp[2]:13 ,
@ -430,11 +425,11 @@ Potential registers zp[1]:17 [ foo::$1 ] : zp[1]:17 , reg byte a , reg byte x ,
Potential registers zp[2]:18 [ foo::return#0 ] : zp[2]:18 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:5 [ main::y1#0 ] 20: zp[2]:7 [ main::y2#0 ] 4: zp[2]:11 [ main::$0 ] 4: zp[2]:15 [ main::$1 ]
Uplift Scope [main] 20: zp[2]:5 [ main::y1 ] 20: zp[2]:7 [ main::y2 ] 4: zp[2]:11 [ main::$0 ] 4: zp[2]:15 [ main::$1 ]
Uplift Scope [foo] 4: zp[2]:9 [ foo::return#2 ] 4: zp[2]:13 [ foo::return#3 ] 4: zp[1]:17 [ foo::$1 ] 2: zp[1]:2 [ foo::x#2 ] 1.5: zp[2]:18 [ foo::return#0 ] 1: zp[2]:3 [ foo::y#2 ]
Uplift Scope []
Uplifting [main] best 217 combination zp[2]:5 [ main::y1#0 ] zp[2]:7 [ main::y2#0 ] zp[2]:11 [ main::$0 ] zp[2]:15 [ main::$1 ]
Uplifting [main] best 217 combination zp[2]:5 [ main::y1 ] zp[2]:7 [ main::y2 ] zp[2]:11 [ main::$0 ] zp[2]:15 [ main::$1 ]
Uplifting [foo] best 206 combination zp[2]:9 [ foo::return#2 ] zp[2]:13 [ foo::return#3 ] reg byte a [ foo::$1 ] reg byte x [ foo::x#2 ] zp[2]:18 [ foo::return#0 ] zp[2]:3 [ foo::y#2 ]
Uplifting [] best 206 combination
Coalescing zero page register [ zp[2]:3 [ foo::y#2 ] ] with [ zp[2]:18 [ foo::return#0 ] ] - score: 1
@ -443,8 +438,8 @@ Coalescing zero page register [ zp[2]:13 [ foo::return#3 ] ] with [ zp[2]:15 [ m
Coalescing zero page register [ zp[2]:3 [ foo::y#2 foo::return#0 ] ] with [ zp[2]:9 [ foo::return#2 main::$0 ] ] - score: 1
Coalescing zero page register [ zp[2]:3 [ foo::y#2 foo::return#0 foo::return#2 main::$0 ] ] with [ zp[2]:13 [ foo::return#3 main::$1 ] ] - score: 1
Allocated (was zp[2]:3) zp[2]:2 [ foo::y#2 foo::return#0 foo::return#2 main::$0 foo::return#3 main::$1 ]
Allocated (was zp[2]:5) zp[2]:4 [ main::y1#0 ]
Allocated (was zp[2]:7) zp[2]:6 [ main::y2#0 ]
Allocated (was zp[2]:5) zp[2]:4 [ main::y1 ]
Allocated (was zp[2]:7) zp[2]:6 [ main::y2 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -473,16 +468,16 @@ __bend:
// main
main: {
.label SCREEN = $400
.label __0 = 2
.label __1 = 2
.label y1 = 4
.label y2 = 6
// [4] (signed word) main::y1#0 ← (signed word) $1234 -- vwsz1=vwsc1
.label __0 = 2
.label __1 = 2
// [4] (signed word) main::y1 ← (signed word) $1234 -- vwsz1=vwsc1
lda #<$1234
sta.z y1
lda #>$1234
sta.z y1+1
// [5] (signed word) main::y2#0 ← (signed word) $1234 -- vwsz1=vwsc1
// [5] (signed word) main::y2 ← (signed word) $1234 -- vwsz1=vwsc1
lda #<$1234
sta.z y2
lda #>$1234
@ -490,7 +485,7 @@ main: {
// [6] call foo
// [15] phi from main to foo [phi:main->foo]
foo_from_main:
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y1#0 [phi:main->foo#0] -- pwsz1=pwsc1
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y1 [phi:main->foo#0] -- pwsz1=pwsc1
lda #<y1
sta.z foo.y
lda #>y1
@ -511,7 +506,7 @@ main: {
// [10] call foo
// [15] phi from main::@1 to foo [phi:main::@1->foo]
foo_from___b1:
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y2#0 [phi:main::@1->foo#0] -- pwsz1=pwsc1
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y2 [phi:main::@1->foo#0] -- pwsz1=pwsc1
lda #<y2
sta.z foo.y
lda #>y2
@ -616,16 +611,14 @@ FINAL SYMBOL TABLE
(label) main::@return
(signed word*) main::SCREEN
(const signed word*) main::SCREEN#0 SCREEN = (signed word*) 1024
(signed word) main::y1
(signed word) main::y1#0 y1 zp[2]:4 20.0
(signed word) main::y2
(signed word) main::y2#0 y2 zp[2]:6 20.0
(signed word) main::y1 loadstore zp[2]:4 20.0
(signed word) main::y2 loadstore zp[2]:6 20.0
(const signed word*) wow[(number) 4] = { (signed word) $cafe, (signed word) $babe, (signed word) $1234, (signed word) $5678 }
reg byte x [ foo::x#2 ]
zp[2]:2 [ foo::y#2 foo::return#0 foo::return#2 main::$0 foo::return#3 main::$1 ]
zp[2]:4 [ main::y1#0 ]
zp[2]:6 [ main::y2#0 ]
zp[2]:4 [ main::y1 ]
zp[2]:6 [ main::y2 ]
reg byte a [ foo::$1 ]
@ -650,18 +643,18 @@ Score: 141
// main
main: {
.label SCREEN = $400
.label __0 = 2
.label __1 = 2
.label y1 = 4
.label y2 = 6
.label __0 = 2
.label __1 = 2
// y1 = 0x1234
// [4] (signed word) main::y1#0 ← (signed word) $1234 -- vwsz1=vwsc1
// [4] (signed word) main::y1 ← (signed word) $1234 -- vwsz1=vwsc1
lda #<$1234
sta.z y1
lda #>$1234
sta.z y1+1
// y2 = 0x1234
// [5] (signed word) main::y2#0 ← (signed word) $1234 -- vwsz1=vwsc1
// [5] (signed word) main::y2 ← (signed word) $1234 -- vwsz1=vwsc1
lda #<$1234
sta.z y2
lda #>$1234
@ -669,7 +662,7 @@ main: {
// foo(1, &y1)
// [6] call foo
// [15] phi from main to foo [phi:main->foo]
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y1#0 [phi:main->foo#0] -- pwsz1=pwsc1
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y1 [phi:main->foo#0] -- pwsz1=pwsc1
lda #<y1
sta.z foo.y
lda #>y1
@ -690,7 +683,7 @@ main: {
// foo(2, &y2)
// [10] call foo
// [15] phi from main::@1 to foo [phi:main::@1->foo]
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y2#0 [phi:main::@1->foo#0] -- pwsz1=pwsc1
// [15] phi (signed word*) foo::y#2 = &(signed word) main::y2 [phi:main::@1->foo#0] -- pwsz1=pwsc1
lda #<y2
sta.z foo.y
lda #>y2

@ -21,14 +21,12 @@
(label) main::@return
(signed word*) main::SCREEN
(const signed word*) main::SCREEN#0 SCREEN = (signed word*) 1024
(signed word) main::y1
(signed word) main::y1#0 y1 zp[2]:4 20.0
(signed word) main::y2
(signed word) main::y2#0 y2 zp[2]:6 20.0
(signed word) main::y1 loadstore zp[2]:4 20.0
(signed word) main::y2 loadstore zp[2]:6 20.0
(const signed word*) wow[(number) 4] = { (signed word) $cafe, (signed word) $babe, (signed word) $1234, (signed word) $5678 }
reg byte x [ foo::x#2 ]
zp[2]:2 [ foo::y#2 foo::return#0 foo::return#2 main::$0 foo::return#3 main::$1 ]
zp[2]:4 [ main::y1#0 ]
zp[2]:6 [ main::y2#0 ]
zp[2]:4 [ main::y1 ]
zp[2]:6 [ main::y2 ]
reg byte a [ foo::$1 ]

@ -10,12 +10,12 @@
(void()) main()
main: scope:[main] from @1
[4] (byte) main::ub#0 ← (byte) $ff
[4] (byte) main::ub ← (byte) $ff
[5] *((const signed byte*) main::sb_ptr) ← (signed byte) 1
[6] *((const byte*) main::ub_screen) ← (byte) main::ub#0
[7] (signed byte) main::sb#0 ← (signed byte) $7f
[6] *((const byte*) main::ub_screen) ← (byte) main::ub
[7] (signed byte) main::sb ← (signed byte) $7f
[8] *((const byte*) main::ub_ptr) ← (byte) 1
[9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb#0
[9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb
to:main::@return
main::@return: scope:[main] from main
[10] return

@ -9,12 +9,12 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte) main::ub#0 ← (byte) $ff
(byte) main::ub ← (byte) $ff
*((const signed byte*) main::sb_ptr) ← (number) 1
*((const byte*) main::ub_screen) ← (byte) main::ub#0
(signed byte) main::sb#0 ← (signed byte)(number) $7f
*((const byte*) main::ub_screen) ← (byte) main::ub
(signed byte) main::sb ← (signed byte)(number) $7f
*((const byte*) main::ub_ptr) ← (number) 1
*((const signed byte*) main::sb_screen) ← (signed byte) main::sb#0
*((const signed byte*) main::sb_screen) ← (signed byte) main::sb
to:main::@return
main::@return: scope:[main] from main
return
@ -33,12 +33,10 @@ SYMBOL TABLE SSA
(label) @end
(void()) main()
(label) main::@return
(signed byte) main::sb
(signed byte) main::sb#0
(signed byte) main::sb loadstore
(const signed byte*) main::sb_ptr = (signed byte*)&(byte) main::ub
(const signed byte*) main::sb_screen = (signed byte*)(number) $428
(byte) main::ub
(byte) main::ub#0
(byte) main::ub loadstore
(const byte*) main::ub_ptr = (byte*)&(signed byte) main::sb
(const byte*) main::ub_screen = (byte*)(number) $400
@ -84,12 +82,12 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte) main::ub#0 ← (byte) $ff
[4] (byte) main::ub ← (byte) $ff
[5] *((const signed byte*) main::sb_ptr) ← (signed byte) 1
[6] *((const byte*) main::ub_screen) ← (byte) main::ub#0
[7] (signed byte) main::sb#0 ← (signed byte) $7f
[6] *((const byte*) main::ub_screen) ← (byte) main::ub
[7] (signed byte) main::sb ← (signed byte) $7f
[8] *((const byte*) main::ub_ptr) ← (byte) 1
[9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb#0
[9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb
to:main::@return
main::@return: scope:[main] from main
[10] return
@ -98,17 +96,17 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(signed byte) main::sb
(signed byte) main::sb#0 2.0
(byte) main::ub
(byte) main::ub#0 2.0
(signed byte) main::sb loadstore 2.0
(byte) main::ub loadstore 2.0
Initial phi equivalence classes
Added variable main::ub to live range equivalence class [ main::ub ]
Added variable main::sb to live range equivalence class [ main::sb ]
Complete equivalence classes
[ main::ub#0 ]
[ main::sb#0 ]
Allocated zp[1]:2 [ main::ub#0 ]
Allocated zp[1]:3 [ main::sb#0 ]
[ main::ub ]
[ main::sb ]
Allocated zp[1]:2 [ main::ub ]
Allocated zp[1]:3 [ main::sb ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -141,22 +139,22 @@ main: {
.label ub_ptr = sb
.label ub = 2
.label sb = 3
// [4] (byte) main::ub#0 ← (byte) $ff -- vbuz1=vbuc1
// [4] (byte) main::ub ← (byte) $ff -- vbuz1=vbuc1
lda #$ff
sta.z ub
// [5] *((const signed byte*) main::sb_ptr) ← (signed byte) 1 -- _deref_pbsc1=vbsc2
lda #1
sta.z sb_ptr
// [6] *((const byte*) main::ub_screen) ← (byte) main::ub#0 -- _deref_pbuc1=vbuz1
// [6] *((const byte*) main::ub_screen) ← (byte) main::ub -- _deref_pbuc1=vbuz1
lda.z ub
sta ub_screen
// [7] (signed byte) main::sb#0 ← (signed byte) $7f -- vbsz1=vbsc1
// [7] (signed byte) main::sb ← (signed byte) $7f -- vbsz1=vbsc1
lda #$7f
sta.z sb
// [8] *((const byte*) main::ub_ptr) ← (byte) 1 -- _deref_pbuc1=vbuc2
lda #1
sta.z ub_ptr
// [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb#0 -- _deref_pbsc1=vbsz1
// [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb -- _deref_pbsc1=vbsz1
lda.z sb
sta sb_screen
jmp __breturn
@ -168,25 +166,25 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte) main::ub#0 ← (byte) $ff [ main::ub#0 ] ( main:2 [ main::ub#0 ] ) always clobbers reg byte a
Statement [5] *((const signed byte*) main::sb_ptr) ← (signed byte) 1 [ main::ub#0 ] ( main:2 [ main::ub#0 ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::ub_screen) ← (byte) main::ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] (signed byte) main::sb#0 ← (signed byte) $7f [ main::sb#0 ] ( main:2 [ main::sb#0 ] ) always clobbers reg byte a
Statement [8] *((const byte*) main::ub_ptr) ← (byte) 1 [ main::sb#0 ] ( main:2 [ main::sb#0 ] ) always clobbers reg byte a
Statement [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::ub#0 ] : zp[1]:2 ,
Potential registers zp[1]:3 [ main::sb#0 ] : zp[1]:3 ,
Statement [4] (byte) main::ub ← (byte) $ff [ main::ub ] ( main:2 [ main::ub ] ) always clobbers reg byte a
Statement [5] *((const signed byte*) main::sb_ptr) ← (signed byte) 1 [ main::ub ] ( main:2 [ main::ub ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::ub_screen) ← (byte) main::ub [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] (signed byte) main::sb ← (signed byte) $7f [ main::sb ] ( main:2 [ main::sb ] ) always clobbers reg byte a
Statement [8] *((const byte*) main::ub_ptr) ← (byte) 1 [ main::sb ] ( main:2 [ main::sb ] ) always clobbers reg byte a
Statement [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::ub ] : zp[1]:2 ,
Potential registers zp[1]:3 [ main::sb ] : zp[1]:3 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 2: zp[1]:2 [ main::ub#0 ] 2: zp[1]:3 [ main::sb#0 ]
Uplift Scope [main] 2: zp[1]:2 [ main::ub ] 2: zp[1]:3 [ main::sb ]
Uplift Scope []
Uplifting [main] best 55 combination zp[1]:2 [ main::ub#0 ] zp[1]:3 [ main::sb#0 ]
Uplifting [main] best 55 combination zp[1]:2 [ main::ub ] zp[1]:3 [ main::sb ]
Uplifting [] best 55 combination
Attempting to uplift remaining variables inzp[1]:2 [ main::ub#0 ]
Uplifting [main] best 55 combination zp[1]:2 [ main::ub#0 ]
Attempting to uplift remaining variables inzp[1]:3 [ main::sb#0 ]
Uplifting [main] best 55 combination zp[1]:3 [ main::sb#0 ]
Attempting to uplift remaining variables inzp[1]:2 [ main::ub ]
Uplifting [main] best 55 combination zp[1]:2 [ main::ub ]
Attempting to uplift remaining variables inzp[1]:3 [ main::sb ]
Uplifting [main] best 55 combination zp[1]:3 [ main::sb ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -218,22 +216,22 @@ main: {
.label ub_ptr = sb
.label ub = 2
.label sb = 3
// [4] (byte) main::ub#0 ← (byte) $ff -- vbuz1=vbuc1
// [4] (byte) main::ub ← (byte) $ff -- vbuz1=vbuc1
lda #$ff
sta.z ub
// [5] *((const signed byte*) main::sb_ptr) ← (signed byte) 1 -- _deref_pbsc1=vbsc2
lda #1
sta.z sb_ptr
// [6] *((const byte*) main::ub_screen) ← (byte) main::ub#0 -- _deref_pbuc1=vbuz1
// [6] *((const byte*) main::ub_screen) ← (byte) main::ub -- _deref_pbuc1=vbuz1
lda.z ub
sta ub_screen
// [7] (signed byte) main::sb#0 ← (signed byte) $7f -- vbsz1=vbsc1
// [7] (signed byte) main::sb ← (signed byte) $7f -- vbsz1=vbsc1
lda #$7f
sta.z sb
// [8] *((const byte*) main::ub_ptr) ← (byte) 1 -- _deref_pbuc1=vbuc2
lda #1
sta.z ub_ptr
// [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb#0 -- _deref_pbsc1=vbsz1
// [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb -- _deref_pbsc1=vbsz1
lda.z sb
sta sb_screen
jmp __breturn
@ -269,17 +267,15 @@ FINAL SYMBOL TABLE
(label) @end
(void()) main()
(label) main::@return
(signed byte) main::sb
(signed byte) main::sb#0 sb zp[1]:3 2.0
(signed byte) main::sb loadstore zp[1]:3 2.0
(const signed byte*) main::sb_ptr = (signed byte*)&(byte) main::ub
(const signed byte*) main::sb_screen = (signed byte*) 1064
(byte) main::ub
(byte) main::ub#0 ub zp[1]:2 2.0
(byte) main::ub loadstore zp[1]:2 2.0
(const byte*) main::ub_ptr = (byte*)&(signed byte) main::sb
(const byte*) main::ub_screen = (byte*) 1024
zp[1]:2 [ main::ub#0 ]
zp[1]:3 [ main::sb#0 ]
zp[1]:2 [ main::ub ]
zp[1]:3 [ main::sb ]
FINAL ASSEMBLER
@ -307,7 +303,7 @@ main: {
.label ub = 2
.label sb = 3
// ub = 0xff
// [4] (byte) main::ub#0 ← (byte) $ff -- vbuz1=vbuc1
// [4] (byte) main::ub ← (byte) $ff -- vbuz1=vbuc1
lda #$ff
sta.z ub
// *sb_ptr = 1
@ -315,11 +311,11 @@ main: {
lda #1
sta.z sb_ptr
// *ub_screen = ub
// [6] *((const byte*) main::ub_screen) ← (byte) main::ub#0 -- _deref_pbuc1=vbuz1
// [6] *((const byte*) main::ub_screen) ← (byte) main::ub -- _deref_pbuc1=vbuz1
lda.z ub
sta ub_screen
// sb = (signed byte)0x7f
// [7] (signed byte) main::sb#0 ← (signed byte) $7f -- vbsz1=vbsc1
// [7] (signed byte) main::sb ← (signed byte) $7f -- vbsz1=vbsc1
lda #$7f
sta.z sb
// *ub_ptr = 1
@ -327,7 +323,7 @@ main: {
lda #1
sta.z ub_ptr
// *sb_screen = sb
// [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb#0 -- _deref_pbsc1=vbsz1
// [9] *((const signed byte*) main::sb_screen) ← (signed byte) main::sb -- _deref_pbsc1=vbsz1
lda.z sb
sta sb_screen
// main::@return

@ -3,14 +3,12 @@
(label) @end
(void()) main()
(label) main::@return
(signed byte) main::sb
(signed byte) main::sb#0 sb zp[1]:3 2.0
(signed byte) main::sb loadstore zp[1]:3 2.0
(const signed byte*) main::sb_ptr = (signed byte*)&(byte) main::ub
(const signed byte*) main::sb_screen = (signed byte*) 1064
(byte) main::ub
(byte) main::ub#0 ub zp[1]:2 2.0
(byte) main::ub loadstore zp[1]:2 2.0
(const byte*) main::ub_ptr = (byte*)&(signed byte) main::sb
(const byte*) main::ub_screen = (byte*) 1024
zp[1]:2 [ main::ub#0 ]
zp[1]:3 [ main::sb#0 ]
zp[1]:2 [ main::ub ]
zp[1]:3 [ main::sb ]

@ -10,8 +10,8 @@
(void()) main()
main: scope:[main] from @1
[4] (byte) main::b#0 ← (byte) 'a'
[5] (byte*) main::pb#0 ← &(byte) main::b#0
[4] (byte) main::b ← (byte) 'a'
[5] (byte*) main::pb ← &(byte) main::b
[6] *((const byte*) main::SCREEN) ← *(*((const byte**) main::ppb))
to:main::@return
main::@return: scope:[main] from main

@ -8,8 +8,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte) main::b#0 ← (byte) 'a'
(byte*) main::pb#0 ← &(byte) main::b#0
(byte) main::b ← (byte) 'a'
(byte*) main::pb ← &(byte) main::b
*((const byte*) main::SCREEN) ← *(*((const byte**) main::ppb))
to:main::@return
main::@return: scope:[main] from main
@ -30,10 +30,8 @@ SYMBOL TABLE SSA
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(byte) main::b
(byte) main::b#0
(byte*) main::pb
(byte*) main::pb#0
(byte) main::b loadstore
(byte*) main::pb loadstore
(const byte**) main::ppb = &(byte*) main::pb
Simplifying constant pointer cast (byte*) 1024
@ -65,8 +63,8 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte) main::b#0 ← (byte) 'a'
[5] (byte*) main::pb#0 ← &(byte) main::b#0
[4] (byte) main::b ← (byte) 'a'
[5] (byte*) main::pb ← &(byte) main::b
[6] *((const byte*) main::SCREEN) ← *(*((const byte**) main::ppb))
to:main::@return
main::@return: scope:[main] from main
@ -76,17 +74,17 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::b
(byte) main::b#0 2.0
(byte*) main::pb
(byte*) main::pb#0 20.0
(byte) main::b loadstore 2.0
(byte*) main::pb loadstore 20.0
Initial phi equivalence classes
Added variable main::b to live range equivalence class [ main::b ]
Added variable main::pb to live range equivalence class [ main::pb ]
Complete equivalence classes
[ main::b#0 ]
[ main::pb#0 ]
Allocated zp[1]:2 [ main::b#0 ]
Allocated zp[2]:3 [ main::pb#0 ]
[ main::b ]
[ main::pb ]
Allocated zp[1]:2 [ main::b ]
Allocated zp[2]:3 [ main::pb ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -117,10 +115,10 @@ main: {
.label ppb = pb
.label b = 2
.label pb = 3
// [4] (byte) main::b#0 ← (byte) 'a' -- vbuz1=vbuc1
// [4] (byte) main::b ← (byte) 'a' -- vbuz1=vbuc1
lda #'a'
sta.z b
// [5] (byte*) main::pb#0 ← &(byte) main::b#0 -- pbuz1=pbuc1
// [5] (byte*) main::pb ← &(byte) main::b -- pbuz1=pbuc1
lda #<b
sta.z pb
lda #>b
@ -142,20 +140,20 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte) main::b#0 ← (byte) 'a' [ main::b#0 ] ( main:2 [ main::b#0 ] ) always clobbers reg byte a
Statement [5] (byte*) main::pb#0 ← &(byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (byte) main::b ← (byte) 'a' [ main::b ] ( main:2 [ main::b ] ) always clobbers reg byte a
Statement [5] (byte*) main::pb ← &(byte) main::b [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::SCREEN) ← *(*((const byte**) main::ppb)) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Potential registers zp[1]:2 [ main::b#0 ] : zp[1]:2 ,
Potential registers zp[2]:3 [ main::pb#0 ] : zp[2]:3 ,
Potential registers zp[1]:2 [ main::b ] : zp[1]:2 ,
Potential registers zp[2]:3 [ main::pb ] : zp[2]:3 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:3 [ main::pb#0 ] 2: zp[1]:2 [ main::b#0 ]
Uplift Scope [main] 20: zp[2]:3 [ main::pb ] 2: zp[1]:2 [ main::b ]
Uplift Scope []
Uplifting [main] best 59 combination zp[2]:3 [ main::pb#0 ] zp[1]:2 [ main::b#0 ]
Uplifting [main] best 59 combination zp[2]:3 [ main::pb ] zp[1]:2 [ main::b ]
Uplifting [] best 59 combination
Attempting to uplift remaining variables inzp[1]:2 [ main::b#0 ]
Uplifting [main] best 59 combination zp[1]:2 [ main::b#0 ]
Attempting to uplift remaining variables inzp[1]:2 [ main::b ]
Uplifting [main] best 59 combination zp[1]:2 [ main::b ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -185,10 +183,10 @@ main: {
.label ppb = pb
.label b = 2
.label pb = 3
// [4] (byte) main::b#0 ← (byte) 'a' -- vbuz1=vbuc1
// [4] (byte) main::b ← (byte) 'a' -- vbuz1=vbuc1
lda #'a'
sta.z b
// [5] (byte*) main::pb#0 ← &(byte) main::b#0 -- pbuz1=pbuc1
// [5] (byte*) main::pb ← &(byte) main::b -- pbuz1=pbuc1
lda #<b
sta.z pb
lda #>b
@ -235,14 +233,12 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::b
(byte) main::b#0 b zp[1]:2 2.0
(byte*) main::pb
(byte*) main::pb#0 pb zp[2]:3 20.0
(byte) main::b loadstore zp[1]:2 2.0
(byte*) main::pb loadstore zp[2]:3 20.0
(const byte**) main::ppb = &(byte*) main::pb
zp[1]:2 [ main::b#0 ]
zp[2]:3 [ main::pb#0 ]
zp[1]:2 [ main::b ]
zp[2]:3 [ main::pb ]
FINAL ASSEMBLER
@ -268,11 +264,11 @@ main: {
.label b = 2
.label pb = 3
// b = 'a'
// [4] (byte) main::b#0 ← (byte) 'a' -- vbuz1=vbuc1
// [4] (byte) main::b ← (byte) 'a' -- vbuz1=vbuc1
lda #'a'
sta.z b
// pb = &b
// [5] (byte*) main::pb#0 ← &(byte) main::b#0 -- pbuz1=pbuc1
// [5] (byte*) main::pb ← &(byte) main::b -- pbuz1=pbuc1
lda #<b
sta.z pb
lda #>b

@ -4,11 +4,9 @@
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::b
(byte) main::b#0 b zp[1]:2 2.0
(byte*) main::pb
(byte*) main::pb#0 pb zp[2]:3 20.0
(byte) main::b loadstore zp[1]:2 2.0
(byte*) main::pb loadstore zp[2]:3 20.0
(const byte**) main::ppb = &(byte*) main::pb
zp[1]:2 [ main::b#0 ]
zp[2]:3 [ main::pb#0 ]
zp[1]:2 [ main::b ]
zp[2]:3 [ main::pb ]

@ -2,10 +2,10 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label textid = 4
.label textid = 2
main: {
.label text = 2
.label screen = 5
.label text = 5
.label screen = 3
lda #<0
sta.z text
sta.z text+1

@ -10,19 +10,17 @@
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::text#0 ← (byte*) 0
[4] (byte*) main::text ← (byte*) 0
to:main::@1
main::@1: scope:[main] from main main::@4
[5] (byte) main::i#5 ← phi( main/(byte) 0 main::@4/(byte) main::i#1 )
[5] (byte*) main::screen#4 ← phi( main/(byte*) 1024 main::@4/(byte*) main::screen#2 )
[5] (byte) textid#11 ← phi( main/(byte) 0 main::@4/(byte) textid#13 )
[5] (byte*) main::text#2 ← phi( main/(byte*) main::text#0 main::@4/(byte*) main::text#3 )
[6] call nexttext
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[7] (byte*) main::screen#2 ← phi( main::@3/(byte*) main::screen#1 main::@1/(byte*) main::screen#4 )
[7] (byte*) main::text#3 ← phi( main::@3/(byte*) main::text#1 main::@1/(byte*) main::text#2 )
[8] if((byte) 0!=*((byte*) main::text#3)) goto main::@3
[8] if((byte) 0!=*((byte*) main::text)) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@2
[9] (byte) main::i#1 ← ++ (byte) main::i#5
@ -32,9 +30,9 @@ main::@return: scope:[main] from main::@4
[11] return
to:@return
main::@3: scope:[main] from main::@2
[12] *((byte*) main::screen#2) ← *((byte*) main::text#3)
[12] *((byte*) main::screen#2) ← *((byte*) main::text)
[13] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[14] (byte*) main::text#1 ← ++ (byte*) main::text#3
[14] (byte*) main::text ← ++ (byte*) main::text
to:main::@2
(void()) nexttext((byte**) nexttext::textp)

@ -15,21 +15,19 @@ CONTROL FLOW GRAPH SSA
main: scope:[main] from @2
(byte) textid#16 ← phi( @2/(byte) textid#15 )
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*) main::text#0 ← (byte*) 0
(byte*) main::text ← (byte*) 0
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@4
(byte) main::i#6 ← phi( main/(byte) main::i#0 main::@4/(byte) main::i#1 )
(byte*) main::screen#5 ← phi( main/(byte*) main::screen#0 main::@4/(byte*) main::screen#6 )
(byte) textid#11 ← phi( main/(byte) textid#16 main::@4/(byte) textid#12 )
(byte*) main::text#2 ← phi( main/(byte*) main::text#0 main::@4/(byte*) main::text#5 )
(byte**) nexttext::textp#0 ← &(byte*) main::text#2
(byte**) nexttext::textp#0 ← &(byte*) main::text
call nexttext
to:main::@9
main::@9: scope:[main] from main::@1
(byte) main::i#5 ← phi( main::@1/(byte) main::i#6 )
(byte*) main::screen#4 ← phi( main::@1/(byte*) main::screen#5 )
(byte*) main::text#6 ← phi( main::@1/(byte*) main::text#2 )
(byte) textid#6 ← phi( main::@1/(byte) textid#4 )
(byte) textid#0 ← (byte) textid#6
to:main::@2
@ -37,23 +35,20 @@ main::@2: scope:[main] from main::@3 main::@9
(byte) textid#17 ← phi( main::@3/(byte) textid#18 main::@9/(byte) textid#0 )
(byte) main::i#3 ← phi( main::@3/(byte) main::i#4 main::@9/(byte) main::i#5 )
(byte*) main::screen#3 ← phi( main::@3/(byte*) main::screen#1 main::@9/(byte*) main::screen#4 )
(byte*) main::text#3 ← phi( main::@3/(byte*) main::text#1 main::@9/(byte*) main::text#6 )
(bool~) main::$2 ← (number) 0 != *((byte*) main::text#3)
(bool~) main::$2 ← (number) 0 != *((byte*) main::text)
if((bool~) main::$2) goto main::@3
to:main::@4
main::@3: scope:[main] from main::@2
(byte) textid#18 ← phi( main::@2/(byte) textid#17 )
(byte) main::i#4 ← phi( main::@2/(byte) main::i#3 )
(byte*) main::screen#2 ← phi( main::@2/(byte*) main::screen#3 )
(byte*) main::text#4 ← phi( main::@2/(byte*) main::text#3 )
*((byte*) main::screen#2) ← *((byte*) main::text#4)
*((byte*) main::screen#2) ← *((byte*) main::text)
(byte*) main::screen#1 ← ++ (byte*) main::screen#2
(byte*) main::text#1 ← ++ (byte*) main::text#4
(byte*) main::text ← ++ (byte*) main::text
to:main::@2
main::@4: scope:[main] from main::@2
(byte*) main::screen#6 ← phi( main::@2/(byte*) main::screen#3 )
(byte) textid#12 ← phi( main::@2/(byte) textid#17 )
(byte*) main::text#5 ← phi( main::@2/(byte*) main::text#3 )
(byte) main::i#2 ← phi( main::@2/(byte) main::i#3 )
(byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$14)
(bool~) main::$1 ← (byte) main::i#1 != rangelast(0,$14)
@ -133,14 +128,7 @@ SYMBOL TABLE SSA
(byte*) main::screen#4
(byte*) main::screen#5
(byte*) main::screen#6
(byte*) main::text
(byte*) main::text#0
(byte*) main::text#1
(byte*) main::text#2
(byte*) main::text#3
(byte*) main::text#4
(byte*) main::text#5
(byte*) main::text#6
(byte*) main::text loadstore
(void()) nexttext((byte**) nexttext::textp)
(number~) nexttext::$0
(bool~) nexttext::$1
@ -175,7 +163,7 @@ SYMBOL TABLE SSA
(byte) textid#8
(byte) textid#9
Adding number conversion cast (unumber) 0 in (bool~) main::$2 ← (number) 0 != *((byte*) main::text#3)
Adding number conversion cast (unumber) 0 in (bool~) main::$2 ← (number) 0 != *((byte*) main::text)
Adding number conversion cast (unumber) 1 in (number~) nexttext::$0 ← (byte) textid#8 & (number) 1
Adding number conversion cast (unumber) nexttext::$0 in (number~) nexttext::$0 ← (byte) textid#8 & (unumber)(number) 1
Adding number conversion cast (unumber) 0 in (bool~) nexttext::$1 ← (unumber~) nexttext::$0 == (number) 0
@ -190,11 +178,9 @@ Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) nexttext::$0 ← (byte) textid#8 & (byte) 1
Alias (byte*) main::text#2 = (byte*) main::text#6
Alias (byte*) main::screen#4 = (byte*) main::screen#5
Alias (byte) main::i#5 = (byte) main::i#6
Alias (byte) textid#0 = (byte) textid#6
Alias (byte*) main::text#3 = (byte*) main::text#4 (byte*) main::text#5
Alias (byte*) main::screen#2 = (byte*) main::screen#3 (byte*) main::screen#6
Alias (byte) main::i#2 = (byte) main::i#4 (byte) main::i#3
Alias (byte) textid#1 = (byte) textid#18 (byte) textid#17 (byte) textid#12 (byte) textid#7
@ -214,13 +200,13 @@ Identical Phi Values (byte) textid#8 (byte) textid#11
Identical Phi Values (byte**) nexttext::textp#1 (byte**) nexttext::textp#0
Identical Phi Values (byte) textid#10 (byte) textid#1
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$2 [11] if((byte) 0!=*((byte*) main::text#3)) goto main::@3
Simple Condition (bool~) main::$2 [11] if((byte) 0!=*((byte*) main::text)) goto main::@3
Simple Condition (bool~) main::$1 [19] if((byte) main::i#1!=rangelast(0,$14)) goto main::@1
Simple Condition (bool~) nexttext::$1 [28] if((byte~) nexttext::$0==(byte) 0) goto nexttext::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::screen#0 = (byte*) 1024
Constant (const byte) main::i#0 = 0
Constant (const byte**) nexttext::textp#0 = &main::text#2
Constant (const byte**) nexttext::textp#0 = &main::text
Constant (const byte) textid#15 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [17] main::i#1 ← ++ main::i#5 to ++
@ -246,19 +232,15 @@ Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:3
Calls in [main] to nexttext:9
Calls in [main] to nexttext:8
Created 6 initial phi equivalence classes
Coalesced [7] main::text#7 ← main::text#0
Coalesced [10] main::text#10 ← main::text#2
Coalesced [11] main::screen#9 ← main::screen#4
Coalesced (already) [17] main::text#8 ← main::text#3
Coalesced [18] textid#19 ← textid#13
Coalesced (already) [19] main::screen#7 ← main::screen#2
Coalesced [20] main::i#7 ← main::i#1
Coalesced [24] main::text#9 ← main::text#1
Coalesced [25] main::screen#8 ← main::screen#1
Coalesced down to 4 phi equivalence classes
Created 4 initial phi equivalence classes
Coalesced [9] main::screen#9 ← main::screen#4
Coalesced [15] textid#19 ← textid#13
Coalesced (already) [16] main::screen#7 ← main::screen#2
Coalesced [17] main::i#7 ← main::i#1
Coalesced [21] main::screen#8 ← main::screen#1
Coalesced down to 3 phi equivalence classes
Culled Empty Block (label) @1
Culled Empty Block (label) @3
Culled Empty Block (label) main::@9
@ -282,19 +264,17 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::text#0 ← (byte*) 0
[4] (byte*) main::text ← (byte*) 0
to:main::@1
main::@1: scope:[main] from main main::@4
[5] (byte) main::i#5 ← phi( main/(byte) 0 main::@4/(byte) main::i#1 )
[5] (byte*) main::screen#4 ← phi( main/(byte*) 1024 main::@4/(byte*) main::screen#2 )
[5] (byte) textid#11 ← phi( main/(byte) 0 main::@4/(byte) textid#13 )
[5] (byte*) main::text#2 ← phi( main/(byte*) main::text#0 main::@4/(byte*) main::text#3 )
[6] call nexttext
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[7] (byte*) main::screen#2 ← phi( main::@3/(byte*) main::screen#1 main::@1/(byte*) main::screen#4 )
[7] (byte*) main::text#3 ← phi( main::@3/(byte*) main::text#1 main::@1/(byte*) main::text#2 )
[8] if((byte) 0!=*((byte*) main::text#3)) goto main::@3
[8] if((byte) 0!=*((byte*) main::text)) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@2
[9] (byte) main::i#1 ← ++ (byte) main::i#5
@ -304,9 +284,9 @@ main::@return: scope:[main] from main::@4
[11] return
to:@return
main::@3: scope:[main] from main::@2
[12] *((byte*) main::screen#2) ← *((byte*) main::text#3)
[12] *((byte*) main::screen#2) ← *((byte*) main::text)
[13] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[14] (byte*) main::text#1 ← ++ (byte*) main::text#3
[14] (byte*) main::text ← ++ (byte*) main::text
to:main::@2
(void()) nexttext((byte**) nexttext::textp)
@ -335,11 +315,7 @@ VARIABLE REGISTER WEIGHTS
(byte*) main::screen#1 101.0
(byte*) main::screen#2 65.0
(byte*) main::screen#4 11.0
(byte*) main::text
(byte*) main::text#0 4.0
(byte*) main::text#1 202.0
(byte*) main::text#2 12.0
(byte*) main::text#3 70.99999999999999
(byte*) main::text loadstore 50.75
(void()) nexttext((byte**) nexttext::textp)
(byte~) nexttext::$0 2.0
(byte**) nexttext::textp
@ -348,21 +324,21 @@ VARIABLE REGISTER WEIGHTS
(byte) textid#13 1.0
Initial phi equivalence classes
[ main::text#2 main::text#0 main::text#3 main::text#1 ]
[ textid#11 textid#13 ]
[ main::screen#4 main::screen#2 main::screen#1 ]
[ main::i#5 main::i#1 ]
Added variable main::text to live range equivalence class [ main::text ]
Added variable nexttext::$0 to live range equivalence class [ nexttext::$0 ]
Complete equivalence classes
[ main::text#2 main::text#0 main::text#3 main::text#1 ]
[ textid#11 textid#13 ]
[ main::screen#4 main::screen#2 main::screen#1 ]
[ main::i#5 main::i#1 ]
[ main::text ]
[ nexttext::$0 ]
Allocated zp[2]:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ]
Allocated zp[1]:4 [ textid#11 textid#13 ]
Allocated zp[2]:5 [ main::screen#4 main::screen#2 main::screen#1 ]
Allocated zp[1]:7 [ main::i#5 main::i#1 ]
Allocated zp[1]:2 [ textid#11 textid#13 ]
Allocated zp[2]:3 [ main::screen#4 main::screen#2 main::screen#1 ]
Allocated zp[1]:5 [ main::i#5 main::i#1 ]
Allocated zp[2]:6 [ main::text ]
Allocated zp[1]:8 [ nexttext::$0 ]
INITIAL ASM
@ -374,7 +350,7 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label textid = 4
.label textid = 2
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -391,10 +367,10 @@ __bend_from___b1:
__bend:
// main
main: {
.label text = 2
.label screen = 5
.label i = 7
// [4] (byte*) main::text#0 ← (byte*) 0 -- pbuz1=pbuc1
.label text = 6
.label screen = 3
.label i = 5
// [4] (byte*) main::text ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta.z text
lda #>0
@ -412,14 +388,12 @@ main: {
// [5] phi (byte) textid#11 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #0
sta.z textid
// [5] phi (byte*) main::text#2 = (byte*) main::text#0 [phi:main->main::@1#3] -- register_copy
jmp __b1
// [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
__b1_from___b4:
// [5] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@4->main::@1#0] -- register_copy
// [5] phi (byte*) main::screen#4 = (byte*) main::screen#2 [phi:main::@4->main::@1#1] -- register_copy
// [5] phi (byte) textid#11 = (byte) textid#13 [phi:main::@4->main::@1#2] -- register_copy
// [5] phi (byte*) main::text#2 = (byte*) main::text#3 [phi:main::@4->main::@1#3] -- register_copy
jmp __b1
// main::@1
__b1:
@ -429,11 +403,10 @@ main: {
__b2_from___b1:
__b2_from___b3:
// [7] phi (byte*) main::screen#2 = (byte*) main::screen#4 [phi:main::@1/main::@3->main::@2#0] -- register_copy
// [7] phi (byte*) main::text#3 = (byte*) main::text#2 [phi:main::@1/main::@3->main::@2#1] -- register_copy
jmp __b2
// main::@2
__b2:
// [8] if((byte) 0!=*((byte*) main::text#3)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1
// [8] if((byte) 0!=*((byte*) main::text)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1
ldy #0
lda (text),y
cmp #0
@ -454,7 +427,7 @@ main: {
rts
// main::@3
__b3:
// [12] *((byte*) main::screen#2) ← *((byte*) main::text#3) -- _deref_pbuz1=_deref_pbuz2
// [12] *((byte*) main::screen#2) ← *((byte*) main::text) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (text),y
ldy #0
@ -464,7 +437,7 @@ main: {
bne !+
inc.z screen+1
!:
// [14] (byte*) main::text#1 ← ++ (byte*) main::text#3 -- pbuz1=_inc_pbuz1
// [14] (byte*) main::text ← ++ (byte*) main::text -- pbuz1=_inc_pbuz1
inc.z text
bne !+
inc.z text+1
@ -515,38 +488,39 @@ nexttext: {
.byte 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte*) main::text#0 ← (byte*) 0 [ main::text#0 ] ( main:2 [ main::text#0 ] ) always clobbers reg byte a
Statement [8] if((byte) 0!=*((byte*) main::text#3)) goto main::@3 [ main::i#5 main::text#3 textid#13 main::screen#2 ] ( main:2 [ main::i#5 main::text#3 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp[1]:7 [ main::i#5 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:7 [ main::i#5 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:4 [ textid#11 textid#13 ]
Removing always clobbered register reg byte y as potential for zp[1]:4 [ textid#11 textid#13 ]
Statement [12] *((byte*) main::screen#2) ← *((byte*) main::text#3) [ main::i#5 main::text#3 textid#13 main::screen#2 ] ( main:2 [ main::i#5 main::text#3 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Statement [15] (byte~) nexttext::$0 ← (byte) textid#11 & (byte) 1 [ textid#11 nexttext::$0 ] ( main:2::nexttext:6 [ main::text#2 main::screen#4 main::i#5 textid#11 nexttext::$0 ] ) always clobbers reg byte a
Statement [18] *((const byte**) nexttext::textp#0) ← (const byte*) text2 [ textid#13 ] ( main:2::nexttext:6 [ main::text#2 main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Statement [20] *((const byte**) nexttext::textp#0) ← (const byte*) text1 [ textid#13 ] ( main:2::nexttext:6 [ main::text#2 main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Statement [4] (byte*) main::text#0 ← (byte*) 0 [ main::text#0 ] ( main:2 [ main::text#0 ] ) always clobbers reg byte a
Statement [8] if((byte) 0!=*((byte*) main::text#3)) goto main::@3 [ main::i#5 main::text#3 textid#13 main::screen#2 ] ( main:2 [ main::i#5 main::text#3 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Statement [12] *((byte*) main::screen#2) ← *((byte*) main::text#3) [ main::i#5 main::text#3 textid#13 main::screen#2 ] ( main:2 [ main::i#5 main::text#3 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Statement [15] (byte~) nexttext::$0 ← (byte) textid#11 & (byte) 1 [ textid#11 nexttext::$0 ] ( main:2::nexttext:6 [ main::text#2 main::screen#4 main::i#5 textid#11 nexttext::$0 ] ) always clobbers reg byte a
Statement [18] *((const byte**) nexttext::textp#0) ← (const byte*) text2 [ textid#13 ] ( main:2::nexttext:6 [ main::text#2 main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Statement [20] *((const byte**) nexttext::textp#0) ← (const byte*) text1 [ textid#13 ] ( main:2::nexttext:6 [ main::text#2 main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ] : zp[2]:2 ,
Potential registers zp[1]:4 [ textid#11 textid#13 ] : zp[1]:4 , reg byte x ,
Potential registers zp[2]:5 [ main::screen#4 main::screen#2 main::screen#1 ] : zp[2]:5 ,
Potential registers zp[1]:7 [ main::i#5 main::i#1 ] : zp[1]:7 , reg byte x ,
Statement [4] (byte*) main::text ← (byte*) 0 [ main::text ] ( main:2 [ main::text ] ) always clobbers reg byte a
Statement [8] if((byte) 0!=*((byte*) main::text)) goto main::@3 [ main::text main::i#5 textid#13 main::screen#2 ] ( main:2 [ main::text main::i#5 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::i#5 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:5 [ main::i#5 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:2 [ textid#11 textid#13 ]
Removing always clobbered register reg byte y as potential for zp[1]:2 [ textid#11 textid#13 ]
Statement [12] *((byte*) main::screen#2) ← *((byte*) main::text) [ main::i#5 textid#13 main::screen#2 ] ( main:2 [ main::i#5 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Statement [15] (byte~) nexttext::$0 ← (byte) textid#11 & (byte) 1 [ textid#11 nexttext::$0 ] ( main:2::nexttext:6 [ main::text main::screen#4 main::i#5 textid#11 nexttext::$0 ] ) always clobbers reg byte a
Statement [18] *((const byte**) nexttext::textp#0) ← (const byte*) text2 [ textid#13 ] ( main:2::nexttext:6 [ main::text main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Statement [20] *((const byte**) nexttext::textp#0) ← (const byte*) text1 [ textid#13 ] ( main:2::nexttext:6 [ main::text main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Statement [4] (byte*) main::text ← (byte*) 0 [ main::text ] ( main:2 [ main::text ] ) always clobbers reg byte a
Statement [8] if((byte) 0!=*((byte*) main::text)) goto main::@3 [ main::text main::i#5 textid#13 main::screen#2 ] ( main:2 [ main::text main::i#5 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Statement [12] *((byte*) main::screen#2) ← *((byte*) main::text) [ main::i#5 textid#13 main::screen#2 ] ( main:2 [ main::i#5 textid#13 main::screen#2 ] ) always clobbers reg byte a reg byte y
Statement [15] (byte~) nexttext::$0 ← (byte) textid#11 & (byte) 1 [ textid#11 nexttext::$0 ] ( main:2::nexttext:6 [ main::text main::screen#4 main::i#5 textid#11 nexttext::$0 ] ) always clobbers reg byte a
Statement [18] *((const byte**) nexttext::textp#0) ← (const byte*) text2 [ textid#13 ] ( main:2::nexttext:6 [ main::text main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Statement [20] *((const byte**) nexttext::textp#0) ← (const byte*) text1 [ textid#13 ] ( main:2::nexttext:6 [ main::text main::screen#4 main::i#5 textid#13 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ textid#11 textid#13 ] : zp[1]:2 , reg byte x ,
Potential registers zp[2]:3 [ main::screen#4 main::screen#2 main::screen#1 ] : zp[2]:3 ,
Potential registers zp[1]:5 [ main::i#5 main::i#1 ] : zp[1]:5 , reg byte x ,
Potential registers zp[2]:6 [ main::text ] : zp[2]:6 ,
Potential registers zp[1]:8 [ nexttext::$0 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 289: zp[2]:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ] 177: zp[2]:5 [ main::screen#4 main::screen#2 main::screen#1 ] 19.64: zp[1]:7 [ main::i#5 main::i#1 ]
Uplift Scope [] 8.5: zp[1]:4 [ textid#11 textid#13 ]
Uplift Scope [main] 177: zp[2]:3 [ main::screen#4 main::screen#2 main::screen#1 ] 50.75: zp[2]:6 [ main::text ] 19.64: zp[1]:5 [ main::i#5 main::i#1 ]
Uplift Scope [] 8.5: zp[1]:2 [ textid#11 textid#13 ]
Uplift Scope [nexttext] 2: zp[1]:8 [ nexttext::$0 ]
Uplifting [main] best 6618 combination zp[2]:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ] zp[2]:5 [ main::screen#4 main::screen#2 main::screen#1 ] reg byte x [ main::i#5 main::i#1 ]
Uplifting [] best 6618 combination zp[1]:4 [ textid#11 textid#13 ]
Uplifting [main] best 6618 combination zp[2]:3 [ main::screen#4 main::screen#2 main::screen#1 ] zp[2]:6 [ main::text ] reg byte x [ main::i#5 main::i#1 ]
Uplifting [] best 6618 combination zp[1]:2 [ textid#11 textid#13 ]
Uplifting [nexttext] best 6612 combination reg byte a [ nexttext::$0 ]
Attempting to uplift remaining variables inzp[1]:4 [ textid#11 textid#13 ]
Uplifting [] best 6612 combination zp[1]:4 [ textid#11 textid#13 ]
Attempting to uplift remaining variables inzp[1]:2 [ textid#11 textid#13 ]
Uplifting [] best 6612 combination zp[1]:2 [ textid#11 textid#13 ]
Allocated (was zp[2]:6) zp[2]:5 [ main::text ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -556,7 +530,7 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label textid = 4
.label textid = 2
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -573,9 +547,9 @@ __bend_from___b1:
__bend:
// main
main: {
.label text = 2
.label screen = 5
// [4] (byte*) main::text#0 ← (byte*) 0 -- pbuz1=pbuc1
.label text = 5
.label screen = 3
// [4] (byte*) main::text ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta.z text
lda #>0
@ -592,14 +566,12 @@ main: {
// [5] phi (byte) textid#11 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #0
sta.z textid
// [5] phi (byte*) main::text#2 = (byte*) main::text#0 [phi:main->main::@1#3] -- register_copy
jmp __b1
// [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
__b1_from___b4:
// [5] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@4->main::@1#0] -- register_copy
// [5] phi (byte*) main::screen#4 = (byte*) main::screen#2 [phi:main::@4->main::@1#1] -- register_copy
// [5] phi (byte) textid#11 = (byte) textid#13 [phi:main::@4->main::@1#2] -- register_copy
// [5] phi (byte*) main::text#2 = (byte*) main::text#3 [phi:main::@4->main::@1#3] -- register_copy
jmp __b1
// main::@1
__b1:
@ -609,11 +581,10 @@ main: {
__b2_from___b1:
__b2_from___b3:
// [7] phi (byte*) main::screen#2 = (byte*) main::screen#4 [phi:main::@1/main::@3->main::@2#0] -- register_copy
// [7] phi (byte*) main::text#3 = (byte*) main::text#2 [phi:main::@1/main::@3->main::@2#1] -- register_copy
jmp __b2
// main::@2
__b2:
// [8] if((byte) 0!=*((byte*) main::text#3)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1
// [8] if((byte) 0!=*((byte*) main::text)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1
ldy #0
lda (text),y
cmp #0
@ -633,7 +604,7 @@ main: {
rts
// main::@3
__b3:
// [12] *((byte*) main::screen#2) ← *((byte*) main::text#3) -- _deref_pbuz1=_deref_pbuz2
// [12] *((byte*) main::screen#2) ← *((byte*) main::text) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (text),y
ldy #0
@ -643,7 +614,7 @@ main: {
bne !+
inc.z screen+1
!:
// [14] (byte*) main::text#1 ← ++ (byte*) main::text#3 -- pbuz1=_inc_pbuz1
// [14] (byte*) main::text ← ++ (byte*) main::text -- pbuz1=_inc_pbuz1
inc.z text
bne !+
inc.z text+1
@ -746,31 +717,27 @@ FINAL SYMBOL TABLE
(byte) main::i#1 reg byte x 16.5
(byte) main::i#5 reg byte x 3.142857142857143
(byte*) main::screen
(byte*) main::screen#1 screen zp[2]:5 101.0
(byte*) main::screen#2 screen zp[2]:5 65.0
(byte*) main::screen#4 screen zp[2]:5 11.0
(byte*) main::text
(byte*) main::text#0 text zp[2]:2 4.0
(byte*) main::text#1 text zp[2]:2 202.0
(byte*) main::text#2 text zp[2]:2 12.0
(byte*) main::text#3 text zp[2]:2 70.99999999999999
(byte*) main::screen#1 screen zp[2]:3 101.0
(byte*) main::screen#2 screen zp[2]:3 65.0
(byte*) main::screen#4 screen zp[2]:3 11.0
(byte*) main::text loadstore zp[2]:5 50.75
(void()) nexttext((byte**) nexttext::textp)
(byte~) nexttext::$0 reg byte a 2.0
(label) nexttext::@1
(label) nexttext::@2
(label) nexttext::@return
(byte**) nexttext::textp
(const byte**) nexttext::textp#0 textp = &(byte*) main::text#2
(const byte**) nexttext::textp#0 textp = &(byte*) main::text
(const byte*) text1[] = (string) "camelot "
(const byte*) text2[] = (string) "rex "
(byte) textid
(byte) textid#11 textid zp[1]:4 7.5
(byte) textid#13 textid zp[1]:4 1.0
(byte) textid#11 textid zp[1]:2 7.5
(byte) textid#13 textid zp[1]:2 1.0
zp[2]:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ]
zp[1]:4 [ textid#11 textid#13 ]
zp[2]:5 [ main::screen#4 main::screen#2 main::screen#1 ]
zp[1]:2 [ textid#11 textid#13 ]
zp[2]:3 [ main::screen#4 main::screen#2 main::screen#1 ]
reg byte x [ main::i#5 main::i#1 ]
zp[2]:5 [ main::text ]
reg byte a [ nexttext::$0 ]
@ -784,7 +751,7 @@ Score: 5705
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label textid = 4
.label textid = 2
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -793,10 +760,10 @@ Score: 5705
// @end
// main
main: {
.label text = 2
.label screen = 5
.label text = 5
.label screen = 3
// text
// [4] (byte*) main::text#0 ← (byte*) 0 -- pbuz1=pbuc1
// [4] (byte*) main::text ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta.z text
sta.z text+1
@ -811,12 +778,10 @@ main: {
// [5] phi (byte) textid#11 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
txa
sta.z textid
// [5] phi (byte*) main::text#2 = (byte*) main::text#0 [phi:main->main::@1#3] -- register_copy
// [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
// [5] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@4->main::@1#0] -- register_copy
// [5] phi (byte*) main::screen#4 = (byte*) main::screen#2 [phi:main::@4->main::@1#1] -- register_copy
// [5] phi (byte) textid#11 = (byte) textid#13 [phi:main::@4->main::@1#2] -- register_copy
// [5] phi (byte*) main::text#2 = (byte*) main::text#3 [phi:main::@4->main::@1#3] -- register_copy
// main::@1
__b1:
// nexttext(&text)
@ -824,11 +789,10 @@ main: {
jsr nexttext
// [7] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
// [7] phi (byte*) main::screen#2 = (byte*) main::screen#4 [phi:main::@1/main::@3->main::@2#0] -- register_copy
// [7] phi (byte*) main::text#3 = (byte*) main::text#2 [phi:main::@1/main::@3->main::@2#1] -- register_copy
// main::@2
__b2:
// while(*text)
// [8] if((byte) 0!=*((byte*) main::text#3)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1
// [8] if((byte) 0!=*((byte*) main::text)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1
ldy #0
lda (text),y
cmp #0
@ -847,7 +811,7 @@ main: {
// main::@3
__b3:
// *screen++ = *text++
// [12] *((byte*) main::screen#2) ← *((byte*) main::text#3) -- _deref_pbuz1=_deref_pbuz2
// [12] *((byte*) main::screen#2) ← *((byte*) main::text) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (text),y
sta (screen),y
@ -857,7 +821,7 @@ main: {
bne !+
inc.z screen+1
!:
// [14] (byte*) main::text#1 ← ++ (byte*) main::text#3 -- pbuz1=_inc_pbuz1
// [14] (byte*) main::text ← ++ (byte*) main::text -- pbuz1=_inc_pbuz1
inc.z text
bne !+
inc.z text+1

@ -11,29 +11,25 @@
(byte) main::i#1 reg byte x 16.5
(byte) main::i#5 reg byte x 3.142857142857143
(byte*) main::screen
(byte*) main::screen#1 screen zp[2]:5 101.0
(byte*) main::screen#2 screen zp[2]:5 65.0
(byte*) main::screen#4 screen zp[2]:5 11.0
(byte*) main::text
(byte*) main::text#0 text zp[2]:2 4.0
(byte*) main::text#1 text zp[2]:2 202.0
(byte*) main::text#2 text zp[2]:2 12.0
(byte*) main::text#3 text zp[2]:2 70.99999999999999
(byte*) main::screen#1 screen zp[2]:3 101.0
(byte*) main::screen#2 screen zp[2]:3 65.0
(byte*) main::screen#4 screen zp[2]:3 11.0
(byte*) main::text loadstore zp[2]:5 50.75
(void()) nexttext((byte**) nexttext::textp)
(byte~) nexttext::$0 reg byte a 2.0
(label) nexttext::@1
(label) nexttext::@2
(label) nexttext::@return
(byte**) nexttext::textp
(const byte**) nexttext::textp#0 textp = &(byte*) main::text#2
(const byte**) nexttext::textp#0 textp = &(byte*) main::text
(const byte*) text1[] = (string) "camelot "
(const byte*) text2[] = (string) "rex "
(byte) textid
(byte) textid#11 textid zp[1]:4 7.5
(byte) textid#13 textid zp[1]:4 1.0
(byte) textid#11 textid zp[1]:2 7.5
(byte) textid#13 textid zp[1]:2 1.0
zp[2]:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ]
zp[1]:4 [ textid#11 textid#13 ]
zp[2]:5 [ main::screen#4 main::screen#2 main::screen#1 ]
zp[1]:2 [ textid#11 textid#13 ]
zp[2]:3 [ main::screen#4 main::screen#2 main::screen#1 ]
reg byte x [ main::i#5 main::i#1 ]
zp[2]:5 [ main::text ]
reg byte a [ nexttext::$0 ]

@ -1,5 +1,5 @@
@begin: scope:[] from
[0] (byte*) screen#0 ← (byte*) 1024
[0] (byte*) screen ← (byte*) 1024
to:@1
@1: scope:[] from @begin
[1] phi()
@ -14,11 +14,11 @@ main: scope:[main] from @1
[5] call setscreen
to:main::@1
main::@1: scope:[main] from main
[6] *((byte*) screen#0) ← (byte) 'a'
[6] *((byte*) screen) ← (byte) 'a'
[7] call setscreen
to:main::@2
main::@2: scope:[main] from main::@1
[8] *((byte*) screen#0) ← (byte) 'a'
[8] *((byte*) screen) ← (byte) 'a'
to:main::@return
main::@return: scope:[main] from main::@2
[9] return
@ -27,7 +27,7 @@ main::@return: scope:[main] from main::@2
(void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val)
setscreen: scope:[setscreen] from main main::@1
[10] (byte*) setscreen::val#2 ← phi( main/(const byte*) screen1 main::@1/(const byte*) screen2 )
[11] *(&(byte*) screen#0) ← (byte*) setscreen::val#2
[11] *(&(byte*) screen) ← (byte*) setscreen::val#2
to:setscreen::@return
setscreen::@return: scope:[setscreen] from setscreen
[12] return

@ -6,26 +6,23 @@ Culled Empty Block (label) @1
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) screen#0 ← (byte*)(number) $400
(byte*) screen ← (byte*)(number) $400
to:@2
(void()) main()
main: scope:[main] from @2
(byte*) screen#1 ← phi( @2/(byte*) screen#4 )
(byte**) setscreen::screen#0 ← &(byte*) screen#1
(byte**) setscreen::screen#0 ← &(byte*) screen
(byte*) setscreen::val#0 ← (const byte*) screen1
call setscreen
to:main::@1
main::@1: scope:[main] from main
(byte*) screen#2 ← phi( main/(byte*) screen#1 )
*((byte*) screen#2 + (number) 0) ← (byte) 'a'
(byte**) setscreen::screen#1 ← &(byte*) screen#2
*((byte*) screen + (number) 0) ← (byte) 'a'
(byte**) setscreen::screen#1 ← &(byte*) screen
(byte*) setscreen::val#1 ← (const byte*) screen2
call setscreen
to:main::@2
main::@2: scope:[main] from main::@1
(byte*) screen#3 ← phi( main::@1/(byte*) screen#2 )
*((byte*) screen#3 + (number) 0) ← (byte) 'a'
*((byte*) screen + (number) 0) ← (byte) 'a'
to:main::@return
main::@return: scope:[main] from main::@2
return
@ -41,7 +38,6 @@ setscreen::@return: scope:[setscreen] from setscreen
return
to:@return
@2: scope:[] from @begin
(byte*) screen#4 ← phi( @begin/(byte*) screen#0 )
call main
to:@3
@3: scope:[] from @2
@ -57,12 +53,7 @@ SYMBOL TABLE SSA
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) screen
(byte*) screen#0
(byte*) screen#1
(byte*) screen#2
(byte*) screen#3
(byte*) screen#4
(byte*) screen loadstore
(const byte*) screen1 = (byte*)(number) $400
(const byte*) screen2 = (byte*)(number) $400+(number) $28
(void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val)
@ -76,8 +67,8 @@ SYMBOL TABLE SSA
(byte*) setscreen::val#1
(byte*) setscreen::val#2
Adding number conversion cast (unumber) 0 in *((byte*) screen#2 + (number) 0) ← (byte) 'a'
Adding number conversion cast (unumber) 0 in *((byte*) screen#3 + (number) 0) ← (byte) 'a'
Adding number conversion cast (unumber) 0 in *((byte*) screen + (number) 0) ← (byte) 'a'
Adding number conversion cast (unumber) 0 in *((byte*) screen + (number) 0) ← (byte) 'a'
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 1024
@ -87,29 +78,24 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) screen#1 = (byte*) screen#2 (byte*) screen#3
Alias (byte*) screen#0 = (byte*) screen#4
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) screen#1 (byte*) screen#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant (const byte**) setscreen::screen#0 = &screen#0
Constant (const byte**) setscreen::screen#0 = &screen
Constant (const byte*) setscreen::val#0 = screen1
Constant (const byte**) setscreen::screen#1 = &screen#0
Constant (const byte**) setscreen::screen#1 = &screen
Constant (const byte*) setscreen::val#1 = screen2
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero screen#0 in [6] *((byte*) screen#0 + (byte) 0) ← (byte) 'a'
Simplifying expression containing zero screen#0 in [11] *((byte*) screen#0 + (byte) 0) ← (byte) 'a'
Simplifying expression containing zero screen in [4] *((byte*) screen + (byte) 0) ← (byte) 'a'
Simplifying expression containing zero screen in [8] *((byte*) screen + (byte) 0) ← (byte) 'a'
Successful SSA optimization PassNSimplifyExpressionWithZero
Inlining constant with var siblings (const byte**) setscreen::screen#0
Inlining constant with var siblings (const byte*) setscreen::val#0
Inlining constant with var siblings (const byte**) setscreen::screen#1
Inlining constant with var siblings (const byte*) setscreen::val#1
Constant inlined setscreen::screen#0 = &(byte*) screen#0
Constant inlined setscreen::screen#0 = &(byte*) screen
Constant inlined setscreen::val#1 = (const byte*) screen2
Constant inlined setscreen::screen#1 = &(byte*) screen#0
Constant inlined setscreen::screen#1 = &(byte*) screen
Constant inlined setscreen::val#0 = (const byte*) screen1
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (byte**) setscreen::screen#2 &(byte*) screen#0
Identical Phi Values (byte**) setscreen::screen#2 &(byte*) screen
Successful SSA optimization Pass2IdenticalPhiElimination
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
@ -129,7 +115,7 @@ Adding NOP phi() at start of main
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] (byte*) screen#0 ← (byte*) 1024
[0] (byte*) screen ← (byte*) 1024
to:@1
@1: scope:[] from @begin
[1] phi()
@ -144,11 +130,11 @@ main: scope:[main] from @1
[5] call setscreen
to:main::@1
main::@1: scope:[main] from main
[6] *((byte*) screen#0) ← (byte) 'a'
[6] *((byte*) screen) ← (byte) 'a'
[7] call setscreen
to:main::@2
main::@2: scope:[main] from main::@1
[8] *((byte*) screen#0) ← (byte) 'a'
[8] *((byte*) screen) ← (byte) 'a'
to:main::@return
main::@return: scope:[main] from main::@2
[9] return
@ -157,7 +143,7 @@ main::@return: scope:[main] from main::@2
(void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val)
setscreen: scope:[setscreen] from main main::@1
[10] (byte*) setscreen::val#2 ← phi( main/(const byte*) screen1 main::@1/(const byte*) screen2 )
[11] *(&(byte*) screen#0) ← (byte*) setscreen::val#2
[11] *(&(byte*) screen) ← (byte*) setscreen::val#2
to:setscreen::@return
setscreen::@return: scope:[setscreen] from setscreen
[12] return
@ -166,8 +152,7 @@ setscreen::@return: scope:[setscreen] from setscreen
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) screen
(byte*) screen#0 0.6666666666666666
(byte*) screen loadstore 0.6666666666666666
(void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val)
(byte**) setscreen::screen
(byte*) setscreen::val
@ -175,11 +160,12 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ setscreen::val#2 ]
Added variable screen to live range equivalence class [ screen ]
Complete equivalence classes
[ setscreen::val#2 ]
[ screen#0 ]
[ screen ]
Allocated zp[2]:2 [ setscreen::val#2 ]
Allocated zp[2]:4 [ screen#0 ]
Allocated zp[2]:4 [ screen ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -195,7 +181,7 @@ Target platform is c64basic / MOS6502X
.label screen = 4
// @begin
__bbegin:
// [0] (byte*) screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [0] (byte*) screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -228,7 +214,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] *((byte*) screen#0) ← (byte) 'a' -- _deref_pbuz1=vbuc1
// [6] *((byte*) screen) ← (byte) 'a' -- _deref_pbuz1=vbuc1
lda #'a'
ldy #0
sta (screen),y
@ -244,7 +230,7 @@ main: {
jmp __b2
// main::@2
__b2:
// [8] *((byte*) screen#0) ← (byte) 'a' -- _deref_pbuz1=vbuc1
// [8] *((byte*) screen) ← (byte) 'a' -- _deref_pbuz1=vbuc1
lda #'a'
ldy #0
sta (screen),y
@ -258,7 +244,7 @@ main: {
// setscreen(byte* zp(2) val)
setscreen: {
.label val = 2
// [11] *(&(byte*) screen#0) ← (byte*) setscreen::val#2 -- _deref_pptc1=pbuz1
// [11] *(&(byte*) screen) ← (byte*) setscreen::val#2 -- _deref_pptc1=pbuz1
lda.z val
sta.z screen
lda.z val+1
@ -272,20 +258,20 @@ setscreen: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] (byte*) screen#0 ← (byte*) 1024 [ screen#0 ] ( [ screen#0 ] ) always clobbers reg byte a
Statement [6] *((byte*) screen#0) ← (byte) 'a' [ screen#0 ] ( main:2 [ screen#0 ] ) always clobbers reg byte a reg byte y
Statement [8] *((byte*) screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [11] *(&(byte*) screen#0) ← (byte*) setscreen::val#2 [ screen#0 ] ( main:2::setscreen:5 [ screen#0 ] main:2::setscreen:7 [ screen#0 ] ) always clobbers reg byte a
Statement [0] (byte*) screen ← (byte*) 1024 [ screen ] ( [ screen ] ) always clobbers reg byte a
Statement [6] *((byte*) screen) ← (byte) 'a' [ screen ] ( main:2 [ screen ] ) always clobbers reg byte a reg byte y
Statement [8] *((byte*) screen) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [11] *(&(byte*) screen) ← (byte*) setscreen::val#2 [ screen ] ( main:2::setscreen:5 [ screen ] main:2::setscreen:7 [ screen ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ setscreen::val#2 ] : zp[2]:2 ,
Potential registers zp[2]:4 [ screen#0 ] : zp[2]:4 ,
Potential registers zp[2]:4 [ screen ] : zp[2]:4 ,
REGISTER UPLIFT SCOPES
Uplift Scope [setscreen] 2: zp[2]:2 [ setscreen::val#2 ]
Uplift Scope [] 0.67: zp[2]:4 [ screen#0 ]
Uplift Scope [] 0.67: zp[2]:4 [ screen ]
Uplift Scope [main]
Uplifting [setscreen] best 110 combination zp[2]:2 [ setscreen::val#2 ]
Uplifting [] best 110 combination zp[2]:4 [ screen#0 ]
Uplifting [] best 110 combination zp[2]:4 [ screen ]
Uplifting [main] best 110 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -301,7 +287,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label screen = 4
// @begin
__bbegin:
// [0] (byte*) screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [0] (byte*) screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -334,7 +320,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] *((byte*) screen#0) ← (byte) 'a' -- _deref_pbuz1=vbuc1
// [6] *((byte*) screen) ← (byte) 'a' -- _deref_pbuz1=vbuc1
lda #'a'
ldy #0
sta (screen),y
@ -350,7 +336,7 @@ main: {
jmp __b2
// main::@2
__b2:
// [8] *((byte*) screen#0) ← (byte) 'a' -- _deref_pbuz1=vbuc1
// [8] *((byte*) screen) ← (byte) 'a' -- _deref_pbuz1=vbuc1
lda #'a'
ldy #0
sta (screen),y
@ -364,7 +350,7 @@ main: {
// setscreen(byte* zp(2) val)
setscreen: {
.label val = 2
// [11] *(&(byte*) screen#0) ← (byte*) setscreen::val#2 -- _deref_pptc1=pbuz1
// [11] *(&(byte*) screen) ← (byte*) setscreen::val#2 -- _deref_pptc1=pbuz1
lda.z val
sta.z screen
lda.z val+1
@ -409,8 +395,7 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) screen
(byte*) screen#0 screen zp[2]:4 0.6666666666666666
(byte*) screen loadstore zp[2]:4 0.6666666666666666
(const byte*) screen1 = (byte*) 1024
(const byte*) screen2 = (byte*)(number) $400+(number) $28
(void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val)
@ -420,7 +405,7 @@ FINAL SYMBOL TABLE
(byte*) setscreen::val#2 val zp[2]:2 2.0
zp[2]:2 [ setscreen::val#2 ]
zp[2]:4 [ screen#0 ]
zp[2]:4 [ screen ]
FINAL ASSEMBLER
@ -439,7 +424,7 @@ Score: 98
// @begin
__bbegin:
// screen = $400
// [0] (byte*) screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [0] (byte*) screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -465,7 +450,7 @@ main: {
jsr setscreen
// main::@1
// screen[0] = 'a'
// [6] *((byte*) screen#0) ← (byte) 'a' -- _deref_pbuz1=vbuc1
// [6] *((byte*) screen) ← (byte) 'a' -- _deref_pbuz1=vbuc1
lda #'a'
ldy #0
sta (screen),y
@ -480,7 +465,7 @@ main: {
jsr setscreen
// main::@2
// screen[0] = 'a'
// [8] *((byte*) screen#0) ← (byte) 'a' -- _deref_pbuz1=vbuc1
// [8] *((byte*) screen) ← (byte) 'a' -- _deref_pbuz1=vbuc1
lda #'a'
ldy #0
sta (screen),y
@ -494,7 +479,7 @@ main: {
setscreen: {
.label val = 2
// *screen = val
// [11] *(&(byte*) screen#0) ← (byte*) setscreen::val#2 -- _deref_pptc1=pbuz1
// [11] *(&(byte*) screen) ← (byte*) setscreen::val#2 -- _deref_pptc1=pbuz1
lda.z val
sta.z screen
lda.z val+1

@ -5,8 +5,7 @@
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) screen
(byte*) screen#0 screen zp[2]:4 0.6666666666666666
(byte*) screen loadstore zp[2]:4 0.6666666666666666
(const byte*) screen1 = (byte*) 1024
(const byte*) screen2 = (byte*)(number) $400+(number) $28
(void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val)
@ -16,4 +15,4 @@
(byte*) setscreen::val#2 val zp[2]:2 2.0
zp[2]:2 [ setscreen::val#2 ]
zp[2]:4 [ screen#0 ]
zp[2]:4 [ screen ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (word) main::w#0 ← (word) $4d2
[4] (word) main::w ← (word) $4d2
[5] *((const byte*) main::SCREEN) ← *((const byte*) main::bp#0)
to:main::@return
main::@return: scope:[main] from main

@ -7,7 +7,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(word) main::w#0 ← (word) $4d2
(word) main::w ← (word) $4d2
(void*) main::vp#0 ← ((void*)) (const word*) main::wp
(byte*) main::bp#0 ← ((byte*)) (void*) main::vp#0
*((const byte*) main::SCREEN) ← *((byte*) main::bp#0)
@ -34,8 +34,7 @@ SYMBOL TABLE SSA
(byte*) main::bp#0
(void*) main::vp
(void*) main::vp#0
(word) main::w
(word) main::w#0
(word) main::w loadstore
(const word*) main::wp = &(word) main::w
Inlining cast (void*) main::vp#0 ← (void*)(const word*) main::wp
@ -76,7 +75,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (word) main::w#0 ← (word) $4d2
[4] (word) main::w ← (word) $4d2
[5] *((const byte*) main::SCREEN) ← *((const byte*) main::bp#0)
to:main::@return
main::@return: scope:[main] from main
@ -88,13 +87,13 @@ VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::bp
(void*) main::vp
(word) main::w
(word) main::w#0 20.0
(word) main::w loadstore 20.0
Initial phi equivalence classes
Added variable main::w to live range equivalence class [ main::w ]
Complete equivalence classes
[ main::w#0 ]
Allocated zp[2]:2 [ main::w#0 ]
[ main::w ]
Allocated zp[2]:2 [ main::w ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -126,7 +125,7 @@ main: {
.label vp = wp
.label bp = vp
.label w = 2
// [4] (word) main::w#0 ← (word) $4d2 -- vwuz1=vwuc1
// [4] (word) main::w ← (word) $4d2 -- vwuz1=vwuc1
lda #<$4d2
sta.z w
lda #>$4d2
@ -143,15 +142,15 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (word) main::w#0 ← (word) $4d2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (word) main::w ← (word) $4d2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) main::SCREEN) ← *((const byte*) main::bp#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ main::w#0 ] : zp[2]:2 ,
Potential registers zp[2]:2 [ main::w ] : zp[2]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:2 [ main::w#0 ]
Uplift Scope [main] 20: zp[2]:2 [ main::w ]
Uplift Scope []
Uplifting [main] best 38 combination zp[2]:2 [ main::w#0 ]
Uplifting [main] best 38 combination zp[2]:2 [ main::w ]
Uplifting [] best 38 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -183,7 +182,7 @@ main: {
.label vp = wp
.label bp = vp
.label w = 2
// [4] (word) main::w#0 ← (word) $4d2 -- vwuz1=vwuc1
// [4] (word) main::w ← (word) $4d2 -- vwuz1=vwuc1
lda #<$4d2
sta.z w
lda #>$4d2
@ -229,11 +228,10 @@ FINAL SYMBOL TABLE
(const byte*) main::bp#0 bp = (byte*)(const void*) main::vp#0
(void*) main::vp
(const void*) main::vp#0 vp = (void*)(const word*) main::wp
(word) main::w
(word) main::w#0 w zp[2]:2 20.0
(word) main::w loadstore zp[2]:2 20.0
(const word*) main::wp = &(word) main::w
zp[2]:2 [ main::w#0 ]
zp[2]:2 [ main::w ]
FINAL ASSEMBLER
@ -260,7 +258,7 @@ main: {
.label bp = vp
.label w = 2
// w = 1234
// [4] (word) main::w#0 ← (word) $4d2 -- vwuz1=vwuc1
// [4] (word) main::w ← (word) $4d2 -- vwuz1=vwuc1
lda #<$4d2
sta.z w
lda #>$4d2

@ -8,8 +8,7 @@
(const byte*) main::bp#0 bp = (byte*)(const void*) main::vp#0
(void*) main::vp
(const void*) main::vp#0 vp = (void*)(const word*) main::wp
(word) main::w
(word) main::w#0 w zp[2]:2 20.0
(word) main::w loadstore zp[2]:2 20.0
(const word*) main::wp = &(word) main::w
zp[2]:2 [ main::w#0 ]
zp[2]:2 [ main::w ]

@ -10,9 +10,9 @@
(void()) main()
main: scope:[main] from @1
[4] (dword) main::d#0 ← (dword) $12345678
[5] (word) main::w#0 ← (word) $1234
[6] (byte) main::b#0 ← (byte) $12
[4] (dword) main::d ← (dword) $12345678
[5] (word) main::w ← (word) $1234
[6] (byte) main::b ← (byte) $12
[7] call print
to:main::@1
main::@1: scope:[main] from main

@ -12,9 +12,9 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte) idx#15 ← phi( @2/(byte) idx#16 )
(dword) main::d#0 ← (dword) $12345678
(word) main::w#0 ← (word) $1234
(byte) main::b#0 ← (byte) $12
(dword) main::d ← (dword) $12345678
(word) main::w ← (word) $1234
(byte) main::b ← (byte) $12
(void*) print::ptr#0 ← (const void*) main::vb
call print
to:main::@1
@ -96,15 +96,12 @@ SYMBOL TABLE SSA
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::b
(byte) main::b#0
(dword) main::d
(dword) main::d#0
(byte) main::b loadstore
(dword) main::d loadstore
(const void*) main::vb = (void*)&(byte) main::b
(const void*) main::vd = (void*)&(dword) main::d
(const void*) main::vw = (void*)&(word) main::w
(word) main::w
(word) main::w#0
(word) main::w loadstore
(void()) print((void*) print::ptr)
(byte*~) print::$0
(label) print::@return
@ -184,9 +181,9 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (dword) main::d#0 ← (dword) $12345678
[5] (word) main::w#0 ← (word) $1234
[6] (byte) main::b#0 ← (byte) $12
[4] (dword) main::d ← (dword) $12345678
[5] (word) main::w ← (word) $1234
[6] (byte) main::b ← (byte) $12
[7] call print
to:main::@1
main::@1: scope:[main] from main
@ -218,12 +215,9 @@ VARIABLE REGISTER WEIGHTS
(byte) idx#12 4.0
(byte) idx#13 1.0
(void()) main()
(byte) main::b
(byte) main::b#0 20.0
(dword) main::d
(dword) main::d#0 20.0
(word) main::w
(word) main::w#0 20.0
(byte) main::b loadstore 20.0
(dword) main::d loadstore 20.0
(word) main::w loadstore 20.0
(void()) print((void*) print::ptr)
(void*) print::ptr
(void*) print::ptr#3
@ -231,17 +225,20 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ print::ptr#3 ]
[ idx#12 idx#13 ]
Added variable main::d to live range equivalence class [ main::d ]
Added variable main::w to live range equivalence class [ main::w ]
Added variable main::b to live range equivalence class [ main::b ]
Complete equivalence classes
[ print::ptr#3 ]
[ idx#12 idx#13 ]
[ main::d#0 ]
[ main::w#0 ]
[ main::b#0 ]
[ main::d ]
[ main::w ]
[ main::b ]
Allocated zp[2]:2 [ print::ptr#3 ]
Allocated zp[1]:4 [ idx#12 idx#13 ]
Allocated zp[4]:5 [ main::d#0 ]
Allocated zp[2]:9 [ main::w#0 ]
Allocated zp[1]:11 [ main::b#0 ]
Allocated zp[4]:5 [ main::d ]
Allocated zp[2]:9 [ main::w ]
Allocated zp[1]:11 [ main::b ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -276,7 +273,7 @@ main: {
.label d = 5
.label w = 9
.label b = $b
// [4] (dword) main::d#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::d ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z d
lda #>$12345678
@ -285,12 +282,12 @@ main: {
sta.z d+2
lda #>$12345678>>$10
sta.z d+3
// [5] (word) main::w#0 ← (word) $1234 -- vwuz1=vwuc1
// [5] (word) main::w ← (word) $1234 -- vwuz1=vwuc1
lda #<$1234
sta.z w
lda #>$1234
sta.z w+1
// [6] (byte) main::b#0 ← (byte) $12 -- vbuz1=vbuc1
// [6] (byte) main::b ← (byte) $12 -- vbuz1=vbuc1
lda #$12
sta.z b
// [7] call print
@ -361,35 +358,35 @@ print: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (dword) main::d#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w#0 ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b#0 ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (dword) main::d ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) SCREEN + (byte) idx#12) ← *((byte*)(void*) print::ptr#3) [ idx#12 ] ( main:2::print:7 [ idx#12 ] main:2::print:9 [ idx#12 ] main:2::print:11 [ idx#12 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp[1]:4 [ idx#12 idx#13 ]
Removing always clobbered register reg byte y as potential for zp[1]:4 [ idx#12 idx#13 ]
Statement [4] (dword) main::d#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w#0 ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b#0 ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (dword) main::d ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) SCREEN + (byte) idx#12) ← *((byte*)(void*) print::ptr#3) [ idx#12 ] ( main:2::print:7 [ idx#12 ] main:2::print:9 [ idx#12 ] main:2::print:11 [ idx#12 ] ) always clobbers reg byte a reg byte y
Potential registers zp[2]:2 [ print::ptr#3 ] : zp[2]:2 ,
Potential registers zp[1]:4 [ idx#12 idx#13 ] : zp[1]:4 , reg byte x ,
Potential registers zp[4]:5 [ main::d#0 ] : zp[4]:5 ,
Potential registers zp[2]:9 [ main::w#0 ] : zp[2]:9 ,
Potential registers zp[1]:11 [ main::b#0 ] : zp[1]:11 ,
Potential registers zp[4]:5 [ main::d ] : zp[4]:5 ,
Potential registers zp[2]:9 [ main::w ] : zp[2]:9 ,
Potential registers zp[1]:11 [ main::b ] : zp[1]:11 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[4]:5 [ main::d#0 ] 20: zp[2]:9 [ main::w#0 ] 20: zp[1]:11 [ main::b#0 ]
Uplift Scope [main] 20: zp[4]:5 [ main::d ] 20: zp[2]:9 [ main::w ] 20: zp[1]:11 [ main::b ]
Uplift Scope [] 5: zp[1]:4 [ idx#12 idx#13 ]
Uplift Scope [print] 0: zp[2]:2 [ print::ptr#3 ]
Uplifting [main] best 144 combination zp[4]:5 [ main::d#0 ] zp[2]:9 [ main::w#0 ] zp[1]:11 [ main::b#0 ]
Uplifting [main] best 144 combination zp[4]:5 [ main::d ] zp[2]:9 [ main::w ] zp[1]:11 [ main::b ]
Uplifting [] best 135 combination reg byte x [ idx#12 idx#13 ]
Uplifting [print] best 135 combination zp[2]:2 [ print::ptr#3 ]
Attempting to uplift remaining variables inzp[1]:11 [ main::b#0 ]
Uplifting [main] best 135 combination zp[1]:11 [ main::b#0 ]
Allocated (was zp[4]:5) zp[4]:4 [ main::d#0 ]
Allocated (was zp[2]:9) zp[2]:8 [ main::w#0 ]
Allocated (was zp[1]:11) zp[1]:10 [ main::b#0 ]
Attempting to uplift remaining variables inzp[1]:11 [ main::b ]
Uplifting [main] best 135 combination zp[1]:11 [ main::b ]
Allocated (was zp[4]:5) zp[4]:4 [ main::d ]
Allocated (was zp[2]:9) zp[2]:8 [ main::w ]
Allocated (was zp[1]:11) zp[1]:10 [ main::b ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -422,7 +419,7 @@ main: {
.label d = 4
.label w = 8
.label b = $a
// [4] (dword) main::d#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::d ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z d
lda #>$12345678
@ -431,12 +428,12 @@ main: {
sta.z d+2
lda #>$12345678>>$10
sta.z d+3
// [5] (word) main::w#0 ← (word) $1234 -- vwuz1=vwuc1
// [5] (word) main::w ← (word) $1234 -- vwuz1=vwuc1
lda #<$1234
sta.z w
lda #>$1234
sta.z w+1
// [6] (byte) main::b#0 ← (byte) $12 -- vbuz1=vbuc1
// [6] (byte) main::b ← (byte) $12 -- vbuz1=vbuc1
lda #$12
sta.z b
// [7] call print
@ -546,15 +543,12 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::b
(byte) main::b#0 b zp[1]:10 20.0
(dword) main::d
(dword) main::d#0 d zp[4]:4 20.0
(byte) main::b loadstore zp[1]:10 20.0
(dword) main::d loadstore zp[4]:4 20.0
(const void*) main::vb = (void*)&(byte) main::b
(const void*) main::vd = (void*)&(dword) main::d
(const void*) main::vw = (void*)&(word) main::w
(word) main::w
(word) main::w#0 w zp[2]:8 20.0
(word) main::w loadstore zp[2]:8 20.0
(void()) print((void*) print::ptr)
(label) print::@return
(void*) print::ptr
@ -562,9 +556,9 @@ FINAL SYMBOL TABLE
zp[2]:2 [ print::ptr#3 ]
reg byte x [ idx#12 idx#13 ]
zp[4]:4 [ main::d#0 ]
zp[2]:8 [ main::w#0 ]
zp[1]:10 [ main::b#0 ]
zp[4]:4 [ main::d ]
zp[2]:8 [ main::w ]
zp[1]:10 [ main::b ]
FINAL ASSEMBLER
@ -593,7 +587,7 @@ main: {
.label w = 8
.label b = $a
// d = 0x12345678
// [4] (dword) main::d#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::d ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z d
lda #>$12345678
@ -603,13 +597,13 @@ main: {
lda #>$12345678>>$10
sta.z d+3
// w = 0x1234
// [5] (word) main::w#0 ← (word) $1234 -- vwuz1=vwuc1
// [5] (word) main::w ← (word) $1234 -- vwuz1=vwuc1
lda #<$1234
sta.z w
lda #>$1234
sta.z w+1
// b = 0x12
// [6] (byte) main::b#0 ← (byte) $12 -- vbuz1=vbuc1
// [6] (byte) main::b ← (byte) $12 -- vbuz1=vbuc1
lda #$12
sta.z b
// print(vb)

@ -9,15 +9,12 @@
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::b
(byte) main::b#0 b zp[1]:10 20.0
(dword) main::d
(dword) main::d#0 d zp[4]:4 20.0
(byte) main::b loadstore zp[1]:10 20.0
(dword) main::d loadstore zp[4]:4 20.0
(const void*) main::vb = (void*)&(byte) main::b
(const void*) main::vd = (void*)&(dword) main::d
(const void*) main::vw = (void*)&(word) main::w
(word) main::w
(word) main::w#0 w zp[2]:8 20.0
(word) main::w loadstore zp[2]:8 20.0
(void()) print((void*) print::ptr)
(label) print::@return
(void*) print::ptr
@ -25,6 +22,6 @@
zp[2]:2 [ print::ptr#3 ]
reg byte x [ idx#12 idx#13 ]
zp[4]:4 [ main::d#0 ]
zp[2]:8 [ main::w#0 ]
zp[1]:10 [ main::b#0 ]
zp[4]:4 [ main::d ]
zp[2]:8 [ main::w ]
zp[1]:10 [ main::b ]

@ -10,9 +10,9 @@
(void()) main()
main: scope:[main] from @1
[4] (dword) main::d#0 ← (dword) $12345678
[5] (word) main::w#0 ← (word) $1234
[6] (byte) main::b#0 ← (byte) $12
[4] (dword) main::d ← (dword) $12345678
[5] (word) main::w ← (word) $1234
[6] (byte) main::b ← (byte) $12
[7] call print
to:main::@1
main::@1: scope:[main] from main
@ -30,7 +30,7 @@ main::@return: scope:[main] from main::@2
(void()) print((void*) print::ptr)
print: scope:[print] from main main::@1 main::@2
[13] (byte) idx#12 ← phi( main/(byte) 0 main::@1/(byte) idx#13 main::@2/(byte) idx#13 )
[13] (void*) print::ptr#3 ← phi( main/(void*)&(byte) main::b#0 main::@1/(void*)&(word) main::w#0 main::@2/(void*)&(dword) main::d#0 )
[13] (void*) print::ptr#3 ← phi( main/(void*)&(byte) main::b main::@1/(void*)&(word) main::w main::@2/(void*)&(dword) main::d )
[14] *((const byte*) SCREEN + (byte) idx#12) ← *((byte*)(void*) print::ptr#3)
[15] (byte) idx#13 ← ++ (byte) idx#12
to:print::@return

@ -9,25 +9,22 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte) idx#15 ← phi( @2/(byte) idx#16 )
(dword) main::d#0 ← (dword) $12345678
(word) main::w#0 ← (word) $1234
(byte) main::b#0 ← (byte) $12
(void*) print::ptr#0 ← (void*)&(byte) main::b#0
(dword) main::d ← (dword) $12345678
(word) main::w ← (word) $1234
(byte) main::b ← (byte) $12
(void*) print::ptr#0 ← (void*)&(byte) main::b
call print
to:main::@1
main::@1: scope:[main] from main
(dword) main::d#2 ← phi( main/(dword) main::d#0 )
(word) main::w#1 ← phi( main/(word) main::w#0 )
(byte) idx#8 ← phi( main/(byte) idx#6 )
(byte) idx#0 ← (byte) idx#8
(void*) print::ptr#1 ← (void*)&(word) main::w#1
(void*) print::ptr#1 ← (void*)&(word) main::w
call print
to:main::@2
main::@2: scope:[main] from main::@1
(dword) main::d#1 ← phi( main::@1/(dword) main::d#2 )
(byte) idx#9 ← phi( main::@1/(byte) idx#6 )
(byte) idx#1 ← (byte) idx#9
(void*) print::ptr#2 ← (void*)&(dword) main::d#1
(void*) print::ptr#2 ← (void*)&(dword) main::d
call print
to:main::@3
main::@3: scope:[main] from main::@2
@ -96,15 +93,9 @@ SYMBOL TABLE SSA
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::b
(byte) main::b#0
(dword) main::d
(dword) main::d#0
(dword) main::d#1
(dword) main::d#2
(word) main::w
(word) main::w#0
(word) main::w#1
(byte) main::b loadstore
(dword) main::d loadstore
(word) main::w loadstore
(void()) print((void*) print::ptr)
(byte*~) print::$0
(label) print::@return
@ -118,8 +109,6 @@ Inlining cast (byte*~) print::$0 ← (byte*)(void*) print::ptr#3
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Alias (word) main::w#0 = (word) main::w#1
Alias (dword) main::d#0 = (dword) main::d#2 (dword) main::d#1
Alias (byte) idx#0 = (byte) idx#8
Alias (byte) idx#1 = (byte) idx#9
Alias (byte) idx#10 = (byte) idx#2 (byte) idx#11 (byte) idx#3
@ -133,9 +122,9 @@ Identical Phi Values (byte) idx#1 (byte) idx#13
Identical Phi Values (byte) idx#10 (byte) idx#13
Identical Phi Values (byte) idx#14 (byte) idx#10
Successful SSA optimization Pass2IdenticalPhiElimination
Constant (const void*) print::ptr#0 = (void*)&main::b#0
Constant (const void*) print::ptr#1 = (void*)&main::w#0
Constant (const void*) print::ptr#2 = (void*)&main::d#0
Constant (const void*) print::ptr#0 = (void*)&main::b
Constant (const void*) print::ptr#1 = (void*)&main::w
Constant (const void*) print::ptr#2 = (void*)&main::d
Constant (const byte) idx#16 = 0
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [8] (byte*~) print::$0 ← (byte*)(void*) print::ptr#3 keeping print::ptr#3
@ -144,9 +133,9 @@ Inlining constant with var siblings (const void*) print::ptr#0
Inlining constant with var siblings (const void*) print::ptr#1
Inlining constant with var siblings (const void*) print::ptr#2
Inlining constant with var siblings (const byte) idx#16
Constant inlined print::ptr#2 = (void*)&(dword) main::d#0
Constant inlined print::ptr#0 = (void*)&(byte) main::b#0
Constant inlined print::ptr#1 = (void*)&(word) main::w#0
Constant inlined print::ptr#2 = (void*)&(dword) main::d
Constant inlined print::ptr#0 = (void*)&(byte) main::b
Constant inlined print::ptr#1 = (void*)&(word) main::w
Constant inlined idx#16 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @begin
@ -186,9 +175,9 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (dword) main::d#0 ← (dword) $12345678
[5] (word) main::w#0 ← (word) $1234
[6] (byte) main::b#0 ← (byte) $12
[4] (dword) main::d ← (dword) $12345678
[5] (word) main::w ← (word) $1234
[6] (byte) main::b ← (byte) $12
[7] call print
to:main::@1
main::@1: scope:[main] from main
@ -206,7 +195,7 @@ main::@return: scope:[main] from main::@2
(void()) print((void*) print::ptr)
print: scope:[print] from main main::@1 main::@2
[13] (byte) idx#12 ← phi( main/(byte) 0 main::@1/(byte) idx#13 main::@2/(byte) idx#13 )
[13] (void*) print::ptr#3 ← phi( main/(void*)&(byte) main::b#0 main::@1/(void*)&(word) main::w#0 main::@2/(void*)&(dword) main::d#0 )
[13] (void*) print::ptr#3 ← phi( main/(void*)&(byte) main::b main::@1/(void*)&(word) main::w main::@2/(void*)&(dword) main::d )
[14] *((const byte*) SCREEN + (byte) idx#12) ← *((byte*)(void*) print::ptr#3)
[15] (byte) idx#13 ← ++ (byte) idx#12
to:print::@return
@ -220,12 +209,9 @@ VARIABLE REGISTER WEIGHTS
(byte) idx#12 4.0
(byte) idx#13 1.0
(void()) main()
(byte) main::b
(byte) main::b#0 20.0
(dword) main::d
(dword) main::d#0 20.0
(word) main::w
(word) main::w#0 20.0
(byte) main::b loadstore 20.0
(dword) main::d loadstore 20.0
(word) main::w loadstore 20.0
(void()) print((void*) print::ptr)
(void*) print::ptr
(void*) print::ptr#3
@ -233,17 +219,20 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ print::ptr#3 ]
[ idx#12 idx#13 ]
Added variable main::d to live range equivalence class [ main::d ]
Added variable main::w to live range equivalence class [ main::w ]
Added variable main::b to live range equivalence class [ main::b ]
Complete equivalence classes
[ print::ptr#3 ]
[ idx#12 idx#13 ]
[ main::d#0 ]
[ main::w#0 ]
[ main::b#0 ]
[ main::d ]
[ main::w ]
[ main::b ]
Allocated zp[2]:2 [ print::ptr#3 ]
Allocated zp[1]:4 [ idx#12 idx#13 ]
Allocated zp[4]:5 [ main::d#0 ]
Allocated zp[2]:9 [ main::w#0 ]
Allocated zp[1]:11 [ main::b#0 ]
Allocated zp[4]:5 [ main::d ]
Allocated zp[2]:9 [ main::w ]
Allocated zp[1]:11 [ main::b ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -275,7 +264,7 @@ main: {
.label d = 5
.label w = 9
.label b = $b
// [4] (dword) main::d#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::d ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z d
lda #>$12345678
@ -284,12 +273,12 @@ main: {
sta.z d+2
lda #>$12345678>>$10
sta.z d+3
// [5] (word) main::w#0 ← (word) $1234 -- vwuz1=vwuc1
// [5] (word) main::w ← (word) $1234 -- vwuz1=vwuc1
lda #<$1234
sta.z w
lda #>$1234
sta.z w+1
// [6] (byte) main::b#0 ← (byte) $12 -- vbuz1=vbuc1
// [6] (byte) main::b ← (byte) $12 -- vbuz1=vbuc1
lda #$12
sta.z b
// [7] call print
@ -298,7 +287,7 @@ main: {
// [13] phi (byte) idx#12 = (byte) 0 [phi:main->print#0] -- vbuz1=vbuc1
lda #0
sta.z idx
// [13] phi (void*) print::ptr#3 = (void*)&(byte) main::b#0 [phi:main->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(byte) main::b [phi:main->print#1] -- pvoz1=pvoc1
lda #<b
sta.z print.ptr
lda #>b
@ -313,7 +302,7 @@ main: {
// [13] phi from main::@1 to print [phi:main::@1->print]
print_from___b1:
// [13] phi (byte) idx#12 = (byte) idx#13 [phi:main::@1->print#0] -- register_copy
// [13] phi (void*) print::ptr#3 = (void*)&(word) main::w#0 [phi:main::@1->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(word) main::w [phi:main::@1->print#1] -- pvoz1=pvoc1
lda #<w
sta.z print.ptr
lda #>w
@ -328,7 +317,7 @@ main: {
// [13] phi from main::@2 to print [phi:main::@2->print]
print_from___b2:
// [13] phi (byte) idx#12 = (byte) idx#13 [phi:main::@2->print#0] -- register_copy
// [13] phi (void*) print::ptr#3 = (void*)&(dword) main::d#0 [phi:main::@2->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(dword) main::d [phi:main::@2->print#1] -- pvoz1=pvoc1
lda #<d
sta.z print.ptr
lda #>d
@ -360,35 +349,35 @@ print: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (dword) main::d#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w#0 ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b#0 ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (dword) main::d ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) SCREEN + (byte) idx#12) ← *((byte*)(void*) print::ptr#3) [ idx#12 ] ( main:2::print:7 [ idx#12 ] main:2::print:9 [ idx#12 ] main:2::print:11 [ idx#12 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp[1]:4 [ idx#12 idx#13 ]
Removing always clobbered register reg byte y as potential for zp[1]:4 [ idx#12 idx#13 ]
Statement [4] (dword) main::d#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w#0 ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b#0 ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (dword) main::d ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] (word) main::w ← (word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte) main::b ← (byte) $12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) SCREEN + (byte) idx#12) ← *((byte*)(void*) print::ptr#3) [ idx#12 ] ( main:2::print:7 [ idx#12 ] main:2::print:9 [ idx#12 ] main:2::print:11 [ idx#12 ] ) always clobbers reg byte a reg byte y
Potential registers zp[2]:2 [ print::ptr#3 ] : zp[2]:2 ,
Potential registers zp[1]:4 [ idx#12 idx#13 ] : zp[1]:4 , reg byte x ,
Potential registers zp[4]:5 [ main::d#0 ] : zp[4]:5 ,
Potential registers zp[2]:9 [ main::w#0 ] : zp[2]:9 ,
Potential registers zp[1]:11 [ main::b#0 ] : zp[1]:11 ,
Potential registers zp[4]:5 [ main::d ] : zp[4]:5 ,
Potential registers zp[2]:9 [ main::w ] : zp[2]:9 ,
Potential registers zp[1]:11 [ main::b ] : zp[1]:11 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[4]:5 [ main::d#0 ] 20: zp[2]:9 [ main::w#0 ] 20: zp[1]:11 [ main::b#0 ]
Uplift Scope [main] 20: zp[4]:5 [ main::d ] 20: zp[2]:9 [ main::w ] 20: zp[1]:11 [ main::b ]
Uplift Scope [] 5: zp[1]:4 [ idx#12 idx#13 ]
Uplift Scope [print] 0: zp[2]:2 [ print::ptr#3 ]
Uplifting [main] best 144 combination zp[4]:5 [ main::d#0 ] zp[2]:9 [ main::w#0 ] zp[1]:11 [ main::b#0 ]
Uplifting [main] best 144 combination zp[4]:5 [ main::d ] zp[2]:9 [ main::w ] zp[1]:11 [ main::b ]
Uplifting [] best 135 combination reg byte x [ idx#12 idx#13 ]
Uplifting [print] best 135 combination zp[2]:2 [ print::ptr#3 ]
Attempting to uplift remaining variables inzp[1]:11 [ main::b#0 ]
Uplifting [main] best 135 combination zp[1]:11 [ main::b#0 ]
Allocated (was zp[4]:5) zp[4]:4 [ main::d#0 ]
Allocated (was zp[2]:9) zp[2]:8 [ main::w#0 ]
Allocated (was zp[1]:11) zp[1]:10 [ main::b#0 ]
Attempting to uplift remaining variables inzp[1]:11 [ main::b ]
Uplifting [main] best 135 combination zp[1]:11 [ main::b ]
Allocated (was zp[4]:5) zp[4]:4 [ main::d ]
Allocated (was zp[2]:9) zp[2]:8 [ main::w ]
Allocated (was zp[1]:11) zp[1]:10 [ main::b ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -418,7 +407,7 @@ main: {
.label d = 4
.label w = 8
.label b = $a
// [4] (dword) main::d#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::d ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z d
lda #>$12345678
@ -427,12 +416,12 @@ main: {
sta.z d+2
lda #>$12345678>>$10
sta.z d+3
// [5] (word) main::w#0 ← (word) $1234 -- vwuz1=vwuc1
// [5] (word) main::w ← (word) $1234 -- vwuz1=vwuc1
lda #<$1234
sta.z w
lda #>$1234
sta.z w+1
// [6] (byte) main::b#0 ← (byte) $12 -- vbuz1=vbuc1
// [6] (byte) main::b ← (byte) $12 -- vbuz1=vbuc1
lda #$12
sta.z b
// [7] call print
@ -440,7 +429,7 @@ main: {
print_from_main:
// [13] phi (byte) idx#12 = (byte) 0 [phi:main->print#0] -- vbuxx=vbuc1
ldx #0
// [13] phi (void*) print::ptr#3 = (void*)&(byte) main::b#0 [phi:main->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(byte) main::b [phi:main->print#1] -- pvoz1=pvoc1
lda #<b
sta.z print.ptr
lda #>b
@ -455,7 +444,7 @@ main: {
// [13] phi from main::@1 to print [phi:main::@1->print]
print_from___b1:
// [13] phi (byte) idx#12 = (byte) idx#13 [phi:main::@1->print#0] -- register_copy
// [13] phi (void*) print::ptr#3 = (void*)&(word) main::w#0 [phi:main::@1->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(word) main::w [phi:main::@1->print#1] -- pvoz1=pvoc1
lda #<w
sta.z print.ptr
lda #>w
@ -470,7 +459,7 @@ main: {
// [13] phi from main::@2 to print [phi:main::@2->print]
print_from___b2:
// [13] phi (byte) idx#12 = (byte) idx#13 [phi:main::@2->print#0] -- register_copy
// [13] phi (void*) print::ptr#3 = (void*)&(dword) main::d#0 [phi:main::@2->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(dword) main::d [phi:main::@2->print#1] -- pvoz1=pvoc1
lda #<d
sta.z print.ptr
lda #>d
@ -542,12 +531,9 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::b
(byte) main::b#0 b zp[1]:10 20.0
(dword) main::d
(dword) main::d#0 d zp[4]:4 20.0
(word) main::w
(word) main::w#0 w zp[2]:8 20.0
(byte) main::b loadstore zp[1]:10 20.0
(dword) main::d loadstore zp[4]:4 20.0
(word) main::w loadstore zp[2]:8 20.0
(void()) print((void*) print::ptr)
(label) print::@return
(void*) print::ptr
@ -555,9 +541,9 @@ FINAL SYMBOL TABLE
zp[2]:2 [ print::ptr#3 ]
reg byte x [ idx#12 idx#13 ]
zp[4]:4 [ main::d#0 ]
zp[2]:8 [ main::w#0 ]
zp[1]:10 [ main::b#0 ]
zp[4]:4 [ main::d ]
zp[2]:8 [ main::w ]
zp[1]:10 [ main::b ]
FINAL ASSEMBLER
@ -583,7 +569,7 @@ main: {
.label w = 8
.label b = $a
// d = 0x12345678
// [4] (dword) main::d#0 ← (dword) $12345678 -- vduz1=vduc1
// [4] (dword) main::d ← (dword) $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z d
lda #>$12345678
@ -593,13 +579,13 @@ main: {
lda #>$12345678>>$10
sta.z d+3
// w = 0x1234
// [5] (word) main::w#0 ← (word) $1234 -- vwuz1=vwuc1
// [5] (word) main::w ← (word) $1234 -- vwuz1=vwuc1
lda #<$1234
sta.z w
lda #>$1234
sta.z w+1
// b = 0x12
// [6] (byte) main::b#0 ← (byte) $12 -- vbuz1=vbuc1
// [6] (byte) main::b ← (byte) $12 -- vbuz1=vbuc1
lda #$12
sta.z b
// print(&b)
@ -607,7 +593,7 @@ main: {
// [13] phi from main to print [phi:main->print]
// [13] phi (byte) idx#12 = (byte) 0 [phi:main->print#0] -- vbuxx=vbuc1
ldx #0
// [13] phi (void*) print::ptr#3 = (void*)&(byte) main::b#0 [phi:main->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(byte) main::b [phi:main->print#1] -- pvoz1=pvoc1
lda #<b
sta.z print.ptr
lda #>b
@ -619,7 +605,7 @@ main: {
// [9] call print
// [13] phi from main::@1 to print [phi:main::@1->print]
// [13] phi (byte) idx#12 = (byte) idx#13 [phi:main::@1->print#0] -- register_copy
// [13] phi (void*) print::ptr#3 = (void*)&(word) main::w#0 [phi:main::@1->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(word) main::w [phi:main::@1->print#1] -- pvoz1=pvoc1
lda #<w
sta.z print.ptr
lda #>w
@ -631,7 +617,7 @@ main: {
// [11] call print
// [13] phi from main::@2 to print [phi:main::@2->print]
// [13] phi (byte) idx#12 = (byte) idx#13 [phi:main::@2->print#0] -- register_copy
// [13] phi (void*) print::ptr#3 = (void*)&(dword) main::d#0 [phi:main::@2->print#1] -- pvoz1=pvoc1
// [13] phi (void*) print::ptr#3 = (void*)&(dword) main::d [phi:main::@2->print#1] -- pvoz1=pvoc1
lda #<d
sta.z print.ptr
lda #>d

@ -9,12 +9,9 @@
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::b
(byte) main::b#0 b zp[1]:10 20.0
(dword) main::d
(dword) main::d#0 d zp[4]:4 20.0
(word) main::w
(word) main::w#0 w zp[2]:8 20.0
(byte) main::b loadstore zp[1]:10 20.0
(dword) main::d loadstore zp[4]:4 20.0
(word) main::w loadstore zp[2]:8 20.0
(void()) print((void*) print::ptr)
(label) print::@return
(void*) print::ptr
@ -22,6 +19,6 @@
zp[2]:2 [ print::ptr#3 ]
reg byte x [ idx#12 idx#13 ]
zp[4]:4 [ main::d#0 ]
zp[2]:8 [ main::w#0 ]
zp[1]:10 [ main::b#0 ]
zp[4]:4 [ main::d ]
zp[2]:8 [ main::w ]
zp[1]:10 [ main::b ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::screen#0 ← (byte*) 1024
[4] (byte*) main::screen ← (byte*) 1024
[5] *(*((const byte**) main::pscreen)) ← (byte) 'a'
[6] *((const byte**) main::pscreen) ← ++ *((const byte**) main::pscreen)
[7] *(*((const byte**) main::pscreen)) ← (byte) 'b'

@ -7,7 +7,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*) main::screen ← (byte*)(number) $400
*(*((const byte**) main::pscreen)) ← (byte) 'a'
*((const byte**) main::pscreen) ← ++ *((const byte**) main::pscreen)
*(*((const byte**) main::pscreen)) ← (byte) 'b'
@ -30,8 +30,7 @@ SYMBOL TABLE SSA
(void()) main()
(label) main::@return
(const byte**) main::pscreen = &(byte*) main::screen
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen loadstore
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
@ -62,7 +61,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::screen#0 ← (byte*) 1024
[4] (byte*) main::screen ← (byte*) 1024
[5] *(*((const byte**) main::pscreen)) ← (byte) 'a'
[6] *((const byte**) main::pscreen) ← ++ *((const byte**) main::pscreen)
[7] *(*((const byte**) main::pscreen)) ← (byte) 'b'
@ -74,13 +73,13 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::screen
(byte*) main::screen#0 20.0
(byte*) main::screen loadstore 20.0
Initial phi equivalence classes
Added variable main::screen to live range equivalence class [ main::screen ]
Complete equivalence classes
[ main::screen#0 ]
Allocated zp[2]:2 [ main::screen#0 ]
[ main::screen ]
Allocated zp[2]:2 [ main::screen ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -109,7 +108,7 @@ __bend:
main: {
.label pscreen = screen
.label screen = 2
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -144,16 +143,16 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte*) main::screen#0 ← (byte*) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (byte*) main::screen ← (byte*) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *(*((const byte**) main::pscreen)) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [7] *(*((const byte**) main::pscreen)) ← (byte) 'b' [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Potential registers zp[2]:2 [ main::screen#0 ] : zp[2]:2 ,
Potential registers zp[2]:2 [ main::screen ] : zp[2]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:2 [ main::screen#0 ]
Uplift Scope [main] 20: zp[2]:2 [ main::screen ]
Uplift Scope []
Uplifting [main] best 87 combination zp[2]:2 [ main::screen#0 ]
Uplifting [main] best 87 combination zp[2]:2 [ main::screen ]
Uplifting [] best 87 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -182,7 +181,7 @@ __bend:
main: {
.label pscreen = screen
.label screen = 2
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -242,10 +241,9 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const byte**) main::pscreen = &(byte*) main::screen
(byte*) main::screen
(byte*) main::screen#0 screen zp[2]:2 20.0
(byte*) main::screen loadstore zp[2]:2 20.0
zp[2]:2 [ main::screen#0 ]
zp[2]:2 [ main::screen ]
FINAL ASSEMBLER
@ -269,7 +267,7 @@ main: {
.label pscreen = screen
.label screen = 2
// screen = 0x400
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400

@ -4,7 +4,6 @@
(void()) main()
(label) main::@return
(const byte**) main::pscreen = &(byte*) main::screen
(byte*) main::screen
(byte*) main::screen#0 screen zp[2]:2 20.0
(byte*) main::screen loadstore zp[2]:2 20.0
zp[2]:2 [ main::screen#0 ]
zp[2]:2 [ main::screen ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::screen#0 ← (byte*) 1024
[4] (byte*) main::screen ← (byte*) 1024
[5] call sub
to:main::@1
main::@1: scope:[main] from main

@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*) main::screen ← (byte*)(number) $400
(byte) sub::ch#0 ← (byte) 'a'
(byte**) sub::dst#0 ← (const byte**) main::pscreen
call sub
@ -51,8 +51,7 @@ SYMBOL TABLE SSA
(label) main::@2
(label) main::@return
(const byte**) main::pscreen = &(byte*) main::screen
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen loadstore
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(label) sub::@return
(byte) sub::ch
@ -115,7 +114,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::screen#0 ← (byte*) 1024
[4] (byte*) main::screen ← (byte*) 1024
[5] call sub
to:main::@1
main::@1: scope:[main] from main
@ -139,8 +138,7 @@ sub::@return: scope:[sub] from sub
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::screen
(byte*) main::screen#0 20.0
(byte*) main::screen loadstore 20.0
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(byte) sub::ch
(byte) sub::ch#2 2.0
@ -148,11 +146,12 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ sub::ch#2 ]
Added variable main::screen to live range equivalence class [ main::screen ]
Complete equivalence classes
[ sub::ch#2 ]
[ main::screen#0 ]
[ main::screen ]
Allocated zp[1]:2 [ sub::ch#2 ]
Allocated zp[2]:3 [ main::screen#0 ]
Allocated zp[2]:3 [ main::screen ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -181,7 +180,7 @@ __bend:
main: {
.label pscreen = screen
.label screen = 3
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -237,20 +236,20 @@ sub: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte*) main::screen#0 ← (byte*) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] (byte*) main::screen ← (byte*) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *(*((const byte**) main::pscreen)) ← (byte) sub::ch#2 [ ] ( main:2::sub:5 [ ] main:2::sub:7 [ ] ) always clobbers reg byte y
Potential registers zp[1]:2 [ sub::ch#2 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:3 [ main::screen#0 ] : zp[2]:3 ,
Potential registers zp[2]:3 [ main::screen ] : zp[2]:3 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:3 [ main::screen#0 ]
Uplift Scope [main] 20: zp[2]:3 [ main::screen ]
Uplift Scope [sub] 2: zp[1]:2 [ sub::ch#2 ]
Uplift Scope []
Uplifting [main] best 100 combination zp[2]:3 [ main::screen#0 ]
Uplifting [main] best 100 combination zp[2]:3 [ main::screen ]
Uplifting [sub] best 91 combination reg byte a [ sub::ch#2 ]
Uplifting [] best 91 combination
Allocated (was zp[2]:3) zp[2]:2 [ main::screen#0 ]
Allocated (was zp[2]:3) zp[2]:2 [ main::screen ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -278,7 +277,7 @@ __bend:
main: {
.label pscreen = screen
.label screen = 2
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -363,8 +362,7 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@return
(const byte**) main::pscreen = &(byte*) main::screen
(byte*) main::screen
(byte*) main::screen#0 screen zp[2]:2 20.0
(byte*) main::screen loadstore zp[2]:2 20.0
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(label) sub::@return
(byte) sub::ch
@ -372,7 +370,7 @@ FINAL SYMBOL TABLE
(byte**) sub::dst
reg byte a [ sub::ch#2 ]
zp[2]:2 [ main::screen#0 ]
zp[2]:2 [ main::screen ]
FINAL ASSEMBLER
@ -396,7 +394,7 @@ main: {
.label pscreen = screen
.label screen = 2
// screen = 0x400
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400

@ -5,8 +5,7 @@
(label) main::@1
(label) main::@return
(const byte**) main::pscreen = &(byte*) main::screen
(byte*) main::screen
(byte*) main::screen#0 screen zp[2]:2 20.0
(byte*) main::screen loadstore zp[2]:2 20.0
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(label) sub::@return
(byte) sub::ch
@ -14,4 +13,4 @@
(byte**) sub::dst
reg byte a [ sub::ch#2 ]
zp[2]:2 [ main::screen#0 ]
zp[2]:2 [ main::screen ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::screen#0 ← (byte*) 1024
[4] (byte*) main::screen ← (byte*) 1024
[5] call sub
to:main::@1
main::@1: scope:[main] from main
@ -24,8 +24,8 @@ main::@return: scope:[main] from main::@1
(void()) sub((byte) sub::ch , (byte**) sub::dst)
sub: scope:[sub] from main main::@1
[9] (byte) sub::ch#2 ← phi( main/(byte) 'a' main::@1/(byte) 'b' )
[10] *(*(&(byte*) main::screen#0)) ← (byte) sub::ch#2
[11] *(&(byte*) main::screen#0) ← ++ *(&(byte*) main::screen#0)
[10] *(*(&(byte*) main::screen)) ← (byte) sub::ch#2
[11] *(&(byte*) main::screen) ← ++ *(&(byte*) main::screen)
to:sub::@return
sub::@return: scope:[sub] from sub
[12] return

@ -8,15 +8,14 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*) main::screen ← (byte*)(number) $400
(byte) sub::ch#0 ← (byte) 'a'
(byte**) sub::dst#0 ← &(byte*) main::screen#0
(byte**) sub::dst#0 ← &(byte*) main::screen
call sub
to:main::@1
main::@1: scope:[main] from main
(byte*) main::screen#1 ← phi( main/(byte*) main::screen#0 )
(byte) sub::ch#1 ← (byte) 'b'
(byte**) sub::dst#1 ← &(byte*) main::screen#1
(byte**) sub::dst#1 ← &(byte*) main::screen
call sub
to:main::@2
main::@2: scope:[main] from main::@1
@ -51,9 +50,7 @@ SYMBOL TABLE SSA
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen#1
(byte*) main::screen loadstore
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(label) sub::@return
(byte) sub::ch
@ -67,12 +64,10 @@ SYMBOL TABLE SSA
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Alias (byte*) main::screen#0 = (byte*) main::screen#1
Successful SSA optimization Pass2AliasElimination
Constant (const byte) sub::ch#0 = 'a'
Constant (const byte**) sub::dst#0 = &main::screen#0
Constant (const byte**) sub::dst#0 = &main::screen
Constant (const byte) sub::ch#1 = 'b'
Constant (const byte**) sub::dst#1 = &main::screen#0
Constant (const byte**) sub::dst#1 = &main::screen
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) sub::ch#0
Inlining constant with var siblings (const byte**) sub::dst#0
@ -80,10 +75,10 @@ Inlining constant with var siblings (const byte) sub::ch#1
Inlining constant with var siblings (const byte**) sub::dst#1
Constant inlined sub::ch#1 = (byte) 'b'
Constant inlined sub::ch#0 = (byte) 'a'
Constant inlined sub::dst#1 = &(byte*) main::screen#0
Constant inlined sub::dst#0 = &(byte*) main::screen#0
Constant inlined sub::dst#1 = &(byte*) main::screen
Constant inlined sub::dst#0 = &(byte*) main::screen
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (byte**) sub::dst#2 &(byte*) main::screen#0
Identical Phi Values (byte**) sub::dst#2 &(byte*) main::screen
Successful SSA optimization Pass2IdenticalPhiElimination
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
@ -118,7 +113,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (byte*) main::screen#0 ← (byte*) 1024
[4] (byte*) main::screen ← (byte*) 1024
[5] call sub
to:main::@1
main::@1: scope:[main] from main
@ -132,8 +127,8 @@ main::@return: scope:[main] from main::@1
(void()) sub((byte) sub::ch , (byte**) sub::dst)
sub: scope:[sub] from main main::@1
[9] (byte) sub::ch#2 ← phi( main/(byte) 'a' main::@1/(byte) 'b' )
[10] *(*(&(byte*) main::screen#0)) ← (byte) sub::ch#2
[11] *(&(byte*) main::screen#0) ← ++ *(&(byte*) main::screen#0)
[10] *(*(&(byte*) main::screen)) ← (byte) sub::ch#2
[11] *(&(byte*) main::screen) ← ++ *(&(byte*) main::screen)
to:sub::@return
sub::@return: scope:[sub] from sub
[12] return
@ -142,8 +137,7 @@ sub::@return: scope:[sub] from sub
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::screen
(byte*) main::screen#0 0.2857142857142857
(byte*) main::screen loadstore 0.2857142857142857
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(byte) sub::ch
(byte) sub::ch#2 2.0
@ -151,11 +145,12 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ sub::ch#2 ]
Added variable main::screen to live range equivalence class [ main::screen ]
Complete equivalence classes
[ sub::ch#2 ]
[ main::screen#0 ]
[ main::screen ]
Allocated zp[1]:2 [ sub::ch#2 ]
Allocated zp[2]:3 [ main::screen#0 ]
Allocated zp[2]:3 [ main::screen ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -184,7 +179,7 @@ __bend:
// main
main: {
.label screen = 3
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -218,7 +213,7 @@ main: {
// sub(byte zp(2) ch)
sub: {
.label ch = 2
// [10] *(*(&(byte*) main::screen#0)) ← (byte) sub::ch#2 -- _deref_(_deref_pptc1)=vbuz1
// [10] *(*(&(byte*) main::screen)) ← (byte) sub::ch#2 -- _deref_(_deref_pptc1)=vbuz1
lda.z ch
ldy.z main.screen
sty.z $fe
@ -226,7 +221,7 @@ sub: {
sty.z $ff
ldy #0
sta ($fe),y
// [11] *(&(byte*) main::screen#0) ← ++ *(&(byte*) main::screen#0) -- _deref_pptc1=_inc__deref_pptc1
// [11] *(&(byte*) main::screen) ← ++ *(&(byte*) main::screen) -- _deref_pptc1=_inc__deref_pptc1
inc.z main.screen
bne !+
inc.z main.screen+1
@ -240,20 +235,20 @@ sub: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte*) main::screen#0 ← (byte*) 1024 [ main::screen#0 ] ( main:2 [ main::screen#0 ] ) always clobbers reg byte a
Statement [10] *(*(&(byte*) main::screen#0)) ← (byte) sub::ch#2 [ main::screen#0 ] ( main:2::sub:5 [ main::screen#0 ] main:2::sub:7 [ main::screen#0 ] ) always clobbers reg byte y
Statement [4] (byte*) main::screen ← (byte*) 1024 [ main::screen ] ( main:2 [ main::screen ] ) always clobbers reg byte a
Statement [10] *(*(&(byte*) main::screen)) ← (byte) sub::ch#2 [ main::screen ] ( main:2::sub:5 [ main::screen ] main:2::sub:7 [ main::screen ] ) always clobbers reg byte y
Potential registers zp[1]:2 [ sub::ch#2 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:3 [ main::screen#0 ] : zp[2]:3 ,
Potential registers zp[2]:3 [ main::screen ] : zp[2]:3 ,
REGISTER UPLIFT SCOPES
Uplift Scope [sub] 2: zp[1]:2 [ sub::ch#2 ]
Uplift Scope [main] 0.29: zp[2]:3 [ main::screen#0 ]
Uplift Scope [main] 0.29: zp[2]:3 [ main::screen ]
Uplift Scope []
Uplifting [sub] best 91 combination reg byte a [ sub::ch#2 ]
Uplifting [main] best 91 combination zp[2]:3 [ main::screen#0 ]
Uplifting [main] best 91 combination zp[2]:3 [ main::screen ]
Uplifting [] best 91 combination
Allocated (was zp[2]:3) zp[2]:2 [ main::screen#0 ]
Allocated (was zp[2]:3) zp[2]:2 [ main::screen ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -281,7 +276,7 @@ __bend:
// main
main: {
.label screen = 2
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -312,14 +307,14 @@ main: {
// sub
// sub(byte register(A) ch)
sub: {
// [10] *(*(&(byte*) main::screen#0)) ← (byte) sub::ch#2 -- _deref_(_deref_pptc1)=vbuaa
// [10] *(*(&(byte*) main::screen)) ← (byte) sub::ch#2 -- _deref_(_deref_pptc1)=vbuaa
ldy.z main.screen
sty.z $fe
ldy.z main.screen+1
sty.z $ff
ldy #0
sta ($fe),y
// [11] *(&(byte*) main::screen#0) ← ++ *(&(byte*) main::screen#0) -- _deref_pptc1=_inc__deref_pptc1
// [11] *(&(byte*) main::screen) ← ++ *(&(byte*) main::screen) -- _deref_pptc1=_inc__deref_pptc1
inc.z main.screen
bne !+
inc.z main.screen+1
@ -365,8 +360,7 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@1
(label) main::@return
(byte*) main::screen
(byte*) main::screen#0 screen zp[2]:2 0.2857142857142857
(byte*) main::screen loadstore zp[2]:2 0.2857142857142857
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(label) sub::@return
(byte) sub::ch
@ -374,7 +368,7 @@ FINAL SYMBOL TABLE
(byte**) sub::dst
reg byte a [ sub::ch#2 ]
zp[2]:2 [ main::screen#0 ]
zp[2]:2 [ main::screen ]
FINAL ASSEMBLER
@ -398,7 +392,7 @@ Score: 70
main: {
.label screen = 2
// screen = 0x400
// [4] (byte*) main::screen#0 ← (byte*) 1024 -- pbuz1=pbuc1
// [4] (byte*) main::screen ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta.z screen
lda #>$400
@ -426,7 +420,7 @@ main: {
// sub(byte register(A) ch)
sub: {
// *(*dst)++ = ch
// [10] *(*(&(byte*) main::screen#0)) ← (byte) sub::ch#2 -- _deref_(_deref_pptc1)=vbuaa
// [10] *(*(&(byte*) main::screen)) ← (byte) sub::ch#2 -- _deref_(_deref_pptc1)=vbuaa
ldy.z main.screen
sty.z $fe
ldy.z main.screen+1
@ -434,7 +428,7 @@ sub: {
ldy #0
sta ($fe),y
// *(*dst)++ = ch;
// [11] *(&(byte*) main::screen#0) ← ++ *(&(byte*) main::screen#0) -- _deref_pptc1=_inc__deref_pptc1
// [11] *(&(byte*) main::screen) ← ++ *(&(byte*) main::screen) -- _deref_pptc1=_inc__deref_pptc1
inc.z main.screen
bne !+
inc.z main.screen+1

@ -4,8 +4,7 @@
(void()) main()
(label) main::@1
(label) main::@return
(byte*) main::screen
(byte*) main::screen#0 screen zp[2]:2 0.2857142857142857
(byte*) main::screen loadstore zp[2]:2 0.2857142857142857
(void()) sub((byte) sub::ch , (byte**) sub::dst)
(label) sub::@return
(byte) sub::ch
@ -13,4 +12,4 @@
(byte**) sub::dst
reg byte a [ sub::ch#2 ]
zp[2]:2 [ main::screen#0 ]
zp[2]:2 [ main::screen ]

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] (word) main::p#0 ← (byte) 2*(word) $100+(byte) 3
[4] (word) main::p ← (byte) 2*(word) $100+(byte) 3
[5] (byte~) main::$0 ← < *((const word*) main::q)
[6] *((const byte*) main::SCREEN) ← (byte~) main::$0
[7] (byte~) main::$1 ← > *((const word*) main::q)

@ -7,7 +7,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(word) main::p#0 ← (byte) 2*(word) $100+(byte) 3
(word) main::p ← (byte) 2*(word) $100+(byte) 3
(byte~) main::$0 ← < *((const word*) main::q)
*((const byte*) main::SCREEN + (number) 0) ← (byte~) main::$0
(byte~) main::$1 ← > *((const word*) main::q)
@ -33,8 +33,7 @@ SYMBOL TABLE SSA
(byte~) main::$1
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(word) main::p
(word) main::p#0
(word) main::p loadstore
(const word*) main::q = &(word) main::p
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← (byte~) main::$0
@ -78,7 +77,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] (word) main::p#0 ← (byte) 2*(word) $100+(byte) 3
[4] (word) main::p ← (byte) 2*(word) $100+(byte) 3
[5] (byte~) main::$0 ← < *((const word*) main::q)
[6] *((const byte*) main::SCREEN) ← (byte~) main::$0
[7] (byte~) main::$1 ← > *((const word*) main::q)
@ -93,17 +92,17 @@ VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$0 4.0
(byte~) main::$1 4.0
(word) main::p
(word) main::p#0 20.0
(word) main::p loadstore 20.0
Initial phi equivalence classes
Added variable main::p to live range equivalence class [ main::p ]
Added variable main::$0 to live range equivalence class [ main::$0 ]
Added variable main::$1 to live range equivalence class [ main::$1 ]
Complete equivalence classes
[ main::p#0 ]
[ main::p ]
[ main::$0 ]
[ main::$1 ]
Allocated zp[2]:2 [ main::p#0 ]
Allocated zp[2]:2 [ main::p ]
Allocated zp[1]:4 [ main::$0 ]
Allocated zp[1]:5 [ main::$1 ]
@ -134,10 +133,10 @@ __bend:
main: {
.label SCREEN = $400
.label q = p
.label p = 2
.label __0 = 4
.label __1 = 5
.label p = 2
// [4] (word) main::p#0 ← (byte) 2*(word) $100+(byte) 3 -- vwuz1=vwuc1
// [4] (word) main::p ← (byte) 2*(word) $100+(byte) 3 -- vwuz1=vwuc1
lda #<2*$100+3
sta.z p
lda #>2*$100+3
@ -163,16 +162,16 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (word) main::p#0 ← (byte) 2*(word) $100+(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ main::p#0 ] : zp[2]:2 ,
Statement [4] (word) main::p ← (byte) 2*(word) $100+(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ main::p ] : zp[2]:2 ,
Potential registers zp[1]:4 [ main::$0 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ main::$1 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:2 [ main::p#0 ] 4: zp[1]:4 [ main::$0 ] 4: zp[1]:5 [ main::$1 ]
Uplift Scope [main] 20: zp[2]:2 [ main::p ] 4: zp[1]:4 [ main::$0 ] 4: zp[1]:5 [ main::$1 ]
Uplift Scope []
Uplifting [main] best 45 combination zp[2]:2 [ main::p#0 ] reg byte a [ main::$0 ] reg byte a [ main::$1 ]
Uplifting [main] best 45 combination zp[2]:2 [ main::p ] reg byte a [ main::$0 ] reg byte a [ main::$1 ]
Uplifting [] best 45 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -202,7 +201,7 @@ main: {
.label SCREEN = $400
.label q = p
.label p = 2
// [4] (word) main::p#0 ← (byte) 2*(word) $100+(byte) 3 -- vwuz1=vwuc1
// [4] (word) main::p ← (byte) 2*(word) $100+(byte) 3 -- vwuz1=vwuc1
lda #<2*$100+3
sta.z p
lda #>2*$100+3
@ -251,11 +250,10 @@ FINAL SYMBOL TABLE
(byte~) main::$1 reg byte a 4.0
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(word) main::p
(word) main::p#0 p zp[2]:2 20.0
(word) main::p loadstore zp[2]:2 20.0
(const word*) main::q = &(word) main::p
zp[2]:2 [ main::p#0 ]
zp[2]:2 [ main::p ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]
@ -282,7 +280,7 @@ main: {
.label q = p
.label p = 2
// p = { 2, 3 }
// [4] (word) main::p#0 ← (byte) 2*(word) $100+(byte) 3 -- vwuz1=vwuc1
// [4] (word) main::p ← (byte) 2*(word) $100+(byte) 3 -- vwuz1=vwuc1
lda #<2*$100+3
sta.z p
lda #>2*$100+3

@ -6,10 +6,9 @@
(byte~) main::$1 reg byte a 4.0
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(word) main::p
(word) main::p#0 p zp[2]:2 20.0
(word) main::p loadstore zp[2]:2 20.0
(const word*) main::q = &(word) main::p
zp[2]:2 [ main::p#0 ]
zp[2]:2 [ main::p ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]

@ -1,5 +1,5 @@
@begin: scope:[] from
[0] (byte*) ptr#0 ← (byte*) 4096
[0] (byte*) ptr ← (byte*) 4096
to:@1
@1: scope:[] from @begin
[1] phi()
@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr#0+(byte) $32
[4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr+(byte) $32
to:main::@return
main::@return: scope:[main] from main
[5] return

@ -2,13 +2,12 @@ Setting inferred volatile on symbol affected by address-of (word) main::w ← (w
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) ptr#0 ← (byte*)(number) $1000
(byte*) ptr ← (byte*)(number) $1000
to:@1
(void()) main()
main: scope:[main] from @1
(byte*) ptr#1 ← phi( @1/(byte*) ptr#2 )
(word) main::w#0 ← (word)&(byte*) ptr#1
(word) main::w#0 ← (word)&(byte*) ptr
(word) main::w#1 ← (word) main::w#0 + (number) $32
(byte~) main::$0 ← < (word) main::w#1
*((const byte*) SCREEN + (number) 0) ← (byte~) main::$0
@ -17,7 +16,6 @@ main::@return: scope:[main] from main
return
to:@return
@1: scope:[] from @begin
(byte*) ptr#2 ← phi( @begin/(byte*) ptr#0 )
call main
to:@2
@2: scope:[] from @1
@ -36,10 +34,7 @@ SYMBOL TABLE SSA
(word) main::w
(word) main::w#0
(word) main::w#1
(byte*) ptr
(byte*) ptr#0
(byte*) ptr#1
(byte*) ptr#2
(byte*) ptr loadstore
Adding number conversion cast (unumber) $32 in (word) main::w#1 ← (word) main::w#0 + (number) $32
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← (byte~) main::$0
@ -52,13 +47,9 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $32
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) ptr#0 = (byte*) ptr#2
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) ptr#1 (byte*) ptr#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant (const word) main::w#0 = (word)&ptr#0
Constant (const word) main::w#0 = (word)&ptr
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN in [5] *((const byte*) SCREEN + (byte) 0) ← (byte~) main::$0
Simplifying expression containing zero SCREEN in [4] *((const byte*) SCREEN + (byte) 0) ← (byte~) main::$0
Successful SSA optimization PassNSimplifyExpressionWithZero
Constant right-side identified [1] (word) main::w#1 ← (const word) main::w#0 + (byte) $32
Successful SSA optimization Pass2ConstantRValueConsolidation
@ -70,9 +61,9 @@ Constant (const byte) main::$0 = <main::w#1
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const word) main::w#0
Inlining constant with different constant siblings (const word) main::w#1
Constant inlined main::w#0 = (word)&(byte*) ptr#0
Constant inlined main::w#1 = (word)&(byte*) ptr#0+(byte) $32
Constant inlined main::$0 = <(word)&(byte*) ptr#0+(byte) $32
Constant inlined main::w#0 = (word)&(byte*) ptr
Constant inlined main::w#1 = (word)&(byte*) ptr+(byte) $32
Constant inlined main::$0 = <(word)&(byte*) ptr+(byte) $32
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
@ -88,7 +79,7 @@ Adding NOP phi() at start of @end
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] (byte*) ptr#0 ← (byte*) 4096
[0] (byte*) ptr ← (byte*) 4096
to:@1
@1: scope:[] from @begin
[1] phi()
@ -99,7 +90,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr#0+(byte) $32
[4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr+(byte) $32
to:main::@return
main::@return: scope:[main] from main
[5] return
@ -109,13 +100,13 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(word) main::w
(byte*) ptr
(byte*) ptr#0 1.0
(byte*) ptr loadstore 1.0
Initial phi equivalence classes
Added variable ptr to live range equivalence class [ ptr ]
Complete equivalence classes
[ ptr#0 ]
Allocated zp[2]:2 [ ptr#0 ]
[ ptr ]
Allocated zp[2]:2 [ ptr ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -129,7 +120,7 @@ Target platform is c64basic / MOS6502X
.label ptr = 2
// @begin
__bbegin:
// [0] (byte*) ptr#0 ← (byte*) 4096 -- pbuz1=pbuc1
// [0] (byte*) ptr ← (byte*) 4096 -- pbuz1=pbuc1
lda #<$1000
sta.z ptr
lda #>$1000
@ -148,7 +139,7 @@ __bend_from___b1:
__bend:
// main
main: {
// [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr#0+(byte) $32 -- _deref_pbuc1=vbuc2
// [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr+(byte) $32 -- _deref_pbuc1=vbuc2
lda #<ptr+$32
sta SCREEN
jmp __breturn
@ -160,15 +151,15 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] (byte*) ptr#0 ← (byte*) 4096 [ ptr#0 ] ( [ ptr#0 ] ) always clobbers reg byte a
Statement [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr#0+(byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ ptr#0 ] : zp[2]:2 ,
Statement [0] (byte*) ptr ← (byte*) 4096 [ ptr ] ( [ ptr ] ) always clobbers reg byte a
Statement [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr+(byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ ptr ] : zp[2]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 1: zp[2]:2 [ ptr#0 ]
Uplift Scope [] 1: zp[2]:2 [ ptr ]
Uplift Scope [main]
Uplifting [] best 37 combination zp[2]:2 [ ptr#0 ]
Uplifting [] best 37 combination zp[2]:2 [ ptr ]
Uplifting [main] best 37 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -182,7 +173,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label ptr = 2
// @begin
__bbegin:
// [0] (byte*) ptr#0 ← (byte*) 4096 -- pbuz1=pbuc1
// [0] (byte*) ptr ← (byte*) 4096 -- pbuz1=pbuc1
lda #<$1000
sta.z ptr
lda #>$1000
@ -201,7 +192,7 @@ __bend_from___b1:
__bend:
// main
main: {
// [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr#0+(byte) $32 -- _deref_pbuc1=vbuc2
// [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr+(byte) $32 -- _deref_pbuc1=vbuc2
lda #<ptr+$32
sta SCREEN
jmp __breturn
@ -235,10 +226,9 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(word) main::w
(byte*) ptr
(byte*) ptr#0 ptr zp[2]:2 1.0
(byte*) ptr loadstore zp[2]:2 1.0
zp[2]:2 [ ptr#0 ]
zp[2]:2 [ ptr ]
FINAL ASSEMBLER
@ -255,7 +245,7 @@ Score: 34
// @begin
__bbegin:
// ptr = 0x1000
// [0] (byte*) ptr#0 ← (byte*) 4096 -- pbuz1=pbuc1
// [0] (byte*) ptr ← (byte*) 4096 -- pbuz1=pbuc1
lda #<$1000
sta.z ptr
lda #>$1000
@ -270,7 +260,7 @@ __bbegin:
// main
main: {
// SCREEN[0] = <w
// [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr#0+(byte) $32 -- _deref_pbuc1=vbuc2
// [4] *((const byte*) SCREEN) ← <(word)&(byte*) ptr+(byte) $32 -- _deref_pbuc1=vbuc2
lda #<ptr+$32
sta SCREEN
// main::@return

Some files were not shown because too many files have changed in this diff Show More