1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-20 02:32:36 +00:00

Any variable affected by address-of is now marked as infered volatile. Closes #200

This commit is contained in:
jespergravgaard 2019-06-16 23:49:22 +02:00
parent 3725bf6821
commit 40df42067b
52 changed files with 7781 additions and 7625 deletions

View File

@ -175,6 +175,8 @@ public class Compiler {
getLog().append(program.getScope().toString(program, null));
}
new Pass1AddressOfVolatile(program).execute();
new Pass1FixLValuesLoHi(program).execute();
new Pass1AssertNoLValueIntermediate(program).execute();
new Pass1PointerSizeofFix(program).execute(); // After this point in the code all pointer math is byte-based
@ -184,6 +186,8 @@ public class Compiler {
new PassNAddBooleanCasts(program).execute();
new PassNAddTypeConversionAssignment(program).execute();
new Pass1EarlyConstantIdentification(program).execute();
new Pass1ProcedureInline(program).execute();
new PassNStatementIndices(program).step();

View File

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

View File

@ -38,6 +38,9 @@ public abstract class SymbolVariable implements Symbol {
/** Specifies that the variable must always live in memory to be available for any multi-threaded accees (eg. in interrupts). */
private boolean declaredVolatile;
/** Specifies that the variable must always live in memory to be available for any multi-threaded accees (eg. in interrupts). */
private boolean inferedVolatile;
/** Comments preceding the procedure in the source code. */
private List<Comment> comments;
@ -156,6 +159,18 @@ public abstract class SymbolVariable implements Symbol {
this.declaredVolatile = declaredVolatile;
}
public void setInferedVolatile(boolean inferedVolatile) {
this.inferedVolatile = inferedVolatile;
}
public boolean isInferedVolatile() {
return inferedVolatile;
}
public boolean isVolatile() {
return declaredVolatile || inferedVolatile;
}
public List<Comment> getComments() {
return comments;
}

View File

@ -12,6 +12,7 @@ public class VariableVersion extends Variable {
this.setDeclaredAlignment(versionOf.getDeclaredAlignment());
this.setDeclaredRegister(versionOf.getDeclaredRegister());
this.setDeclaredVolatile(versionOf.isDeclaredVolatile());
this.setInferedVolatile(versionOf.isInferedVolatile());
this.setInferredType(versionOf.isInferredType());
this.versionOfName = versionOf.getLocalName();
this.setComments(versionOf.getComments());

View File

@ -0,0 +1,45 @@
package dk.camelot64.kickc.passes;
import dk.camelot64.kickc.model.ControlFlowBlock;
import dk.camelot64.kickc.model.Program;
import dk.camelot64.kickc.model.operators.Operators;
import dk.camelot64.kickc.model.statements.Statement;
import dk.camelot64.kickc.model.statements.StatementAssignment;
import dk.camelot64.kickc.model.symbols.Symbol;
import dk.camelot64.kickc.model.symbols.SymbolVariable;
import dk.camelot64.kickc.model.values.RValue;
import dk.camelot64.kickc.model.values.SymbolVariableRef;
/**
* Add infered volatile to all variables, where address-of is used
*/
public class Pass1AddressOfVolatile extends Pass2SsaOptimization {
public Pass1AddressOfVolatile(Program program) {
super(program);
}
@Override
public boolean step() {
for(ControlFlowBlock block : getProgram().getGraph().getAllBlocks()) {
for(Statement statement : block.getStatements()) {
if(statement instanceof StatementAssignment) {
StatementAssignment assignment = (StatementAssignment) statement;
if(Operators.ADDRESS_OF.equals(assignment.getOperator()) ) {
RValue rValue = assignment.getrValue2();
if(rValue instanceof SymbolVariableRef) {
Symbol toSymbol = getScope().getSymbol((SymbolVariableRef) rValue);
if(toSymbol instanceof SymbolVariable) {
((SymbolVariable) toSymbol).setInferedVolatile(true);
getLog().append("Setting inferred volatile on symbol affected by address-of "+statement.toString(getProgram(), false));
}
}
}
}
}
}
return false;
}
}

View File

@ -28,7 +28,7 @@ public class Pass1EarlyConstantIdentification extends Pass1Base {
Collection<VariableRef> earlyConstants = new ArrayList<>();
for(Variable variable : getProgram().getScope().getAllVariables(true)) {
VariableRef variableRef = variable.getRef();
if(!variable.isDeclaredConstant() && !variable.isDeclaredVolatile() && !variableRef.isIntermediate()) {
if(!variable.isDeclaredConstant() && !variable.isVolatile() && !variableRef.isIntermediate()) {
if(!isParameter(variableRef)) {
Collection<StatementLValue> assignments = getAssignments(variable);
if(assignments.size() == 1) {

View File

@ -301,6 +301,7 @@ public class Pass1ProcedureInline extends Pass1Base {
inlineVar.setDeclaredConstant(procVar.isDeclaredConstant());
inlineVar.setDeclaredRegister(procVar.getDeclaredRegister());
inlineVar.setDeclaredVolatile(procVar.isDeclaredVolatile());
inlineVar.setInferedVolatile(procVar.isInferedVolatile());
} else if(procSymbol instanceof Label) {
String inlineLabelName = getInlineSymbolName(procedure, procSymbol, serial);
callScope.addLabel(inlineLabelName);

View File

@ -73,6 +73,7 @@ public class Pass1UnwindBlockScopes extends Pass1Base {
unwound.setDeclaredAlignment(((VariableUnversioned) symbol).getDeclaredAlignment());
unwound.setDeclaredConstant(((VariableUnversioned) symbol).isDeclaredConstant());
unwound.setDeclaredVolatile(((VariableUnversioned) symbol).isDeclaredVolatile());
unwound.setInferedVolatile(((VariableUnversioned) symbol).isInferedVolatile());
unwound.setDeclaredRegister((((VariableUnversioned) symbol).getDeclaredRegister()));
unwoundSymbols.put(symbol.getRef(), unwound.getRef());
} else if(symbol instanceof VariableIntermediate) {

View File

@ -244,6 +244,7 @@ public class Pass1UnwindStructValues extends Pass1Base {
memberVariable = scope.addVariable(variable.getLocalName() + "_" + member.getLocalName(), member.getType());
}
memberVariable.setDeclaredVolatile(variable.isDeclaredVolatile());
memberVariable.setInferedVolatile(variable.isInferedVolatile());
memberVariable.setDeclaredConstant(variable.isDeclaredConstant());
variableUnwinding.setMemberUnwinding(member.getLocalName(), memberVariable.getRef());
getLog().append("Created struct value member variable " + memberVariable.toString(getProgram()));

View File

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

View File

@ -182,7 +182,7 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization {
if(getConstant(phiRValue.getrValue()) != null) {
VariableRef variable = phiVariable.getVariable();
Variable var = getScope().getVariable(variable);
if(var.isDeclaredVolatile()) {
if(var.isVolatile()) {
// Volatile variables cannot be constant
continue;
}
@ -198,7 +198,7 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization {
if(lValue instanceof VariableRef) {
VariableRef variable = (VariableRef) lValue;
Variable var = getScope().getVariable(variable);
if(var.isDeclaredVolatile()) {
if(var.isVolatile()) {
// Volatile variables cannot be constant
return;
}

View File

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

View File

@ -314,6 +314,7 @@ public class Pass2LoopUnroll extends Pass2SsaOptimization {
newVar.setType(definedVar.getType());
newVar.setDeclaredRegister(definedVar.getDeclaredRegister());
newVar.setDeclaredVolatile(definedVar.isDeclaredVolatile());
newVar.setInferedVolatile(definedVar.isInferedVolatile());
newVar.setDeclaredAlignment(definedVar.getDeclaredAlignment());
newVar.setInferredType(definedVar.isInferredType());
} else if(definedVarRef.isVersion()) {

View File

@ -32,7 +32,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.isVersioned() && variable.isDeclaredVolatile()) {
if(variable.isVersioned() && variable.isVolatile()) {
// Found a volatile non-versioned variable
for(Variable otherVariable : variable.getScope().getAllVariables(false)) {
if(otherVariable.isVersioned()) {

View File

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

View File

@ -46,10 +46,10 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
if(variable == null) {
// Already deleted
eliminate = true;
} else if(!variable.isDeclaredVolatile()) {
} else if(!variable.isVolatile()) {
// Not volatile
eliminate = true;
} else if(variable.isDeclaredVolatile() && variable.getType() instanceof SymbolTypeStruct) {
} else if(variable.isVolatile() && variable.getType() instanceof SymbolTypeStruct) {
// If an unwound volatile struct - eliminate it
StructUnwinding.VariableUnwinding variableUnwinding = getProgram().getStructUnwinding().getVariableUnwinding(variable.getRef());
if(variableUnwinding != null) {

View File

@ -8,10 +8,10 @@
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[4] (byte) main::b#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 )
[5] (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 )
[6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1
[7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0
[8] (byte) main::b#1 ← ++ (byte) main::b#2

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (byte*~) main::$0 ← & (byte) main::b
Adding pointer type conversion cast (byte*) main::SCREEN in (byte*) main::SCREEN ← (number) $400
Identified constant variable (byte*) main::SCREEN
Culled Empty Block (label) main::@2
@ -71,7 +72,6 @@ Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [3] (byte*) main::bp#0 ← & (byte) main::b#2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Constant (const byte) main::b#0 = 0
Constant (const byte*) main::bp#0 = &main::b#2
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [8] main::b#1 ← ++ main::b#2 to ++
@ -82,27 +82,23 @@ Simplifying constant integer cast $b
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $b
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte) main::b#0
Constant inlined main::b#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced [12] main::b#3 ← main::b#1
Coalesced [6] main::b#3 ← main::b#0
Coalesced [13] main::b#4 ← main::b#1
Coalesced down to 1 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
Adding NOP phi() at start of main
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
@ -115,10 +111,10 @@ FINAL CONTROL FLOW GRAPH
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[4] (byte) main::b#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 )
[5] (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 )
[6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1
[7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0
[8] (byte) main::b#1 ← ++ (byte) main::b#2
@ -133,19 +129,20 @@ VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::SCREEN
(byte) main::b
(byte) main::b#0 4.0
(byte) main::b#1 16.5
(byte) main::b#2 11.0
(byte) main::b#2 11.666666666666666
(byte*) main::bp
(byte) main::c
(byte) main::c#0 22.0
Initial phi equivalence classes
[ main::b#2 main::b#1 ]
[ main::b#2 main::b#0 main::b#1 ]
Added variable main::c#0 to zero page equivalence class [ main::c#0 ]
Complete equivalence classes
[ main::b#2 main::b#1 ]
[ main::b#2 main::b#0 main::b#1 ]
[ main::c#0 ]
Allocated zp ZP_BYTE:2 [ main::b#2 main::b#1 ]
Allocated zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ]
Allocated zp ZP_BYTE:3 [ main::c#0 ]
INITIAL ASM
@ -164,67 +161,64 @@ b1_from_bbegin:
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
//SEG8 @end
bend:
//SEG10 main
//SEG9 main
main: {
.label SCREEN = $400
.label bp = b
.label c = 3
.label b = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::b#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
.label c = 3
//SEG10 [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta b
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG11 [5] phi from main main::@1 to main::@1 [phi:main/main::@1->main::@1]
b1_from_main:
b1_from_b1:
//SEG14 [5] phi (byte) main::b#2 = (byte) main::b#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG12 [5] phi (byte) main::b#2 = (byte) main::b#0 [phi:main/main::@1->main::@1#0] -- register_copy
jmp b1
//SEG15 main::@1
//SEG13 main::@1
b1:
//SEG16 [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 -- vbuz1=_deref_pbuc1_plus_1
//SEG14 [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 -- vbuz1=_deref_pbuc1_plus_1
ldy bp
iny
sty c
//SEG17 [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuz2
//SEG15 [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuz2
lda c
ldy b
sta SCREEN,y
//SEG18 [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
//SEG16 [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
inc b
//SEG19 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG17 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$b
cmp b
bne b1_from_b1
jmp breturn
//SEG20 main::@return
//SEG18 main::@return
breturn:
//SEG21 [10] return
//SEG19 [10] return
rts
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte) main::b#0 ← (byte) 0 [ main::b#0 ] ( main:2 [ main::b#0 ] ) always clobbers reg byte a
Statement [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 [ main::b#2 ] ( main:2 [ main::b#2 ] ) always clobbers reg byte y
Statement [9] if((byte) main::b#1!=(byte) $b) goto main::@1 [ main::b#1 ] ( main:2 [ main::b#1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::b#2 main::b#1 ] : zp ZP_BYTE:2 ,
Potential registers zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ] : zp ZP_BYTE:2 ,
Potential registers zp ZP_BYTE:3 [ main::c#0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::b#2 main::b#1 ] 22: zp ZP_BYTE:3 [ main::c#0 ]
Uplift Scope [main] 32.17: zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ] 22: zp ZP_BYTE:3 [ main::c#0 ]
Uplift Scope []
Uplifting [main] best 443 combination zp ZP_BYTE:2 [ main::b#2 main::b#1 ] reg byte a [ main::c#0 ]
Uplifting [] best 443 combination
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::b#2 main::b#1 ]
Uplifting [main] best 443 combination zp ZP_BYTE:2 [ main::b#2 main::b#1 ]
Uplifting [main] best 368 combination zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ] reg byte a [ main::c#0 ]
Uplifting [] best 368 combination
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ]
Uplifting [main] best 368 combination zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
@ -242,48 +236,44 @@ b1_from_bbegin:
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
//SEG8 @end
bend:
//SEG10 main
//SEG9 main
main: {
.label SCREEN = $400
.label bp = b
.label b = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::b#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG10 [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta b
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG11 [5] phi from main main::@1 to main::@1 [phi:main/main::@1->main::@1]
b1_from_main:
b1_from_b1:
//SEG14 [5] phi (byte) main::b#2 = (byte) main::b#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG12 [5] phi (byte) main::b#2 = (byte) main::b#0 [phi:main/main::@1->main::@1#0] -- register_copy
jmp b1
//SEG15 main::@1
//SEG13 main::@1
b1:
//SEG16 [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
//SEG14 [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
lda bp
clc
adc #1
//SEG17 [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
//SEG15 [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
ldy b
sta SCREEN,y
//SEG18 [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
//SEG16 [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
inc b
//SEG19 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG17 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$b
cmp b
bne b1_from_b1
jmp breturn
//SEG20 main::@return
//SEG18 main::@return
breturn:
//SEG21 [10] return
//SEG19 [10] return
rts
}
@ -296,19 +286,16 @@ Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b1 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_main:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
@ -322,19 +309,20 @@ FINAL SYMBOL TABLE
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
(byte) main::b
(byte) main::b#0 b zp ZP_BYTE:2 4.0
(byte) main::b#1 b zp ZP_BYTE:2 16.5
(byte) main::b#2 b zp ZP_BYTE:2 11.0
(byte) main::b#2 b zp ZP_BYTE:2 11.666666666666666
(byte*) main::bp
(const byte*) main::bp#0 bp = &(byte) main::b#2
(byte) main::c
(byte) main::c#0 reg byte a 22.0
zp ZP_BYTE:2 [ main::b#2 main::b#1 ]
zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ]
reg byte a [ main::c#0 ]
FINAL ASSEMBLER
Score: 341
Score: 296
//SEG0 File Comments
// Test address-of - use the pointer to get the value
@ -347,37 +335,35 @@ Score: 341
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG9 @end
//SEG10 main
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
//SEG8 @end
//SEG9 main
main: {
.label SCREEN = $400
.label bp = b
.label b = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::b#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG10 [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta b
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG14 [5] phi (byte) main::b#2 = (byte) main::b#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG15 main::@1
//SEG11 [5] phi from main main::@1 to main::@1 [phi:main/main::@1->main::@1]
//SEG12 [5] phi (byte) main::b#2 = (byte) main::b#0 [phi:main/main::@1->main::@1#0] -- register_copy
//SEG13 main::@1
b1:
//SEG16 [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
//SEG14 [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 -- vbuaa=_deref_pbuc1_plus_1
lda bp
clc
adc #1
//SEG17 [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
//SEG15 [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa
ldy b
sta SCREEN,y
//SEG18 [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
//SEG16 [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
inc b
//SEG19 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG17 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$b
cmp b
bne b1
//SEG20 main::@return
//SEG21 [10] return
//SEG18 main::@return
//SEG19 [10] return
rts
}

View File

@ -7,12 +7,13 @@
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
(byte) main::b
(byte) main::b#0 b zp ZP_BYTE:2 4.0
(byte) main::b#1 b zp ZP_BYTE:2 16.5
(byte) main::b#2 b zp ZP_BYTE:2 11.0
(byte) main::b#2 b zp ZP_BYTE:2 11.666666666666666
(byte*) main::bp
(const byte*) main::bp#0 bp = &(byte) main::b#2
(byte) main::c
(byte) main::c#0 reg byte a 22.0
zp ZP_BYTE:2 [ main::b#2 main::b#1 ]
zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ]
reg byte a [ main::c#0 ]

View File

@ -1,3 +1,6 @@
Setting inferred volatile on symbol affected by address-of (byte*~) main::$0 ← & (byte) main::b1
Setting inferred volatile on symbol affected by address-of (byte*~) main::$2 ← & (byte) main::b2
Setting inferred volatile on symbol affected by address-of (byte*~) main::$4 ← & (byte) main::b3
Adding pointer type conversion cast (byte*) main::SCREEN in (byte*) main::SCREEN ← (number) $400
Identified constant variable (byte*) main::SCREEN
Culled Empty Block (label) @1
@ -246,9 +249,6 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ setByte::b#3 ]
[ setByte::ptr#3 ]
Added variable main::b1#0 to zero page equivalence class [ main::b1#0 ]
Added variable main::b2#0 to zero page equivalence class [ main::b2#0 ]
Added variable main::b3#0 to zero page equivalence class [ main::b3#0 ]
Complete equivalence classes
[ setByte::b#3 ]
[ setByte::ptr#3 ]

View File

@ -1,13 +1,18 @@
// Test address-of by assigning the affected variable in multiple ways
.pc = $801 "Basic"
:BasicUpstart(main)
:BasicUpstart(bbegin)
.pc = $80d "Program"
.label val = 2
bbegin:
lda #0
sta val
jsr main
rts
main: {
.label SCREEN1 = $400
.label ptr = val
.label SCREEN2 = SCREEN1+$28
lda #0
lda val
sta SCREEN1
lda #'.'
sta SCREEN2
@ -17,24 +22,26 @@ main: {
sta SCREEN1+1
lda #'.'
sta SCREEN2+1
// Set value directly
lda #2
sta val
sta SCREEN1+2
lda ptr
sta SCREEN2+2
// Set value through pointer
lda #3
sta ptr
lda #2
lda val
sta SCREEN1+3
lda ptr
sta SCREEN2+3
jsr setv
lda #setv.v
lda val
sta SCREEN1+4
lda ptr
sta SCREEN2+4
jsr setp
lda #setv.v
lda val
sta SCREEN1+5
lda ptr
sta SCREEN2+5
@ -47,6 +54,8 @@ setp: {
rts
}
setv: {
.label v = 4
.const v = 4
lda #v
sta val
rts
}

View File

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

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (byte*~) main::$1 ← & (byte) val
Adding pointer type conversion cast (byte*) main::SCREEN1 in (byte*) main::SCREEN1 ← (number) $400
Culled Empty Block (label) @1
Culled Empty Block (label) @2
@ -198,41 +199,38 @@ Identical Phi Values (byte) val#13 (byte) val#10
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [13] (byte*) main::ptr#0 ← & (byte) val#1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) val#0 = 0
Constant (const byte*) main::SCREEN1#0 = (byte*) 1024
Constant (const byte) main::idx#0 = 0
Constant (const byte*) main::ptr#0 = &val#1
Constant (const byte) val#2 = 2
Constant (const byte) setv::v#0 = 4
Constant (const byte) setp::v#0 = 5
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) setp::p#0 = main::ptr#0
Constant (const byte) val#12 = setv::v#0
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::SCREEN1#0 in [6] *((const byte*) main::SCREEN1#0 + (const byte) main::idx#0) ← (const byte) val#0
Simplifying expression containing zero main::SCREEN1#0 in [6] *((const byte*) main::SCREEN1#0 + (const byte) main::idx#0) ← (byte) val#0
Simplifying expression containing zero main::SCREEN2#0 in [7] *((byte*) main::SCREEN2#0 + (const byte) main::idx#0) ← (byte) '.'
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) main::idx#6 and assignment [22] (byte) main::idx#6 ← ++ (byte) main::idx#5
Eliminating unused variable (byte) main::idx#6 and assignment [24] (byte) main::idx#6 ← ++ (byte) main::idx#5
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [0] (byte*) main::SCREEN2#0 ← (const byte*) main::SCREEN1#0 + (byte) $28
Constant right-side identified [3] (byte) main::idx#1 ← ++ (const byte) main::idx#0
Constant right-side identified [1] (byte*) main::SCREEN2#0 ← (const byte*) main::SCREEN1#0 + (byte) $28
Constant right-side identified [4] (byte) main::idx#1 ← ++ (const byte) main::idx#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::SCREEN2#0 = main::SCREEN1#0+$28
Constant (const byte) main::idx#1 = ++main::idx#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [5] (byte) main::idx#2 ← ++ (const byte) main::idx#1
Constant right-side identified [6] (byte) main::idx#2 ← ++ (const byte) main::idx#1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#2 = ++main::idx#1
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [7] (byte) main::idx#3 ← ++ (const byte) main::idx#2
Constant right-side identified [9] (byte) main::idx#3 ← ++ (const byte) main::idx#2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#3 = ++main::idx#2
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [10] (byte) main::idx#4 ← ++ (const byte) main::idx#3
Constant right-side identified [12] (byte) main::idx#4 ← ++ (const byte) main::idx#3
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#4 = ++main::idx#3
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [13] (byte) main::idx#5 ← ++ (const byte) main::idx#4
Constant right-side identified [15] (byte) main::idx#5 ← ++ (const byte) main::idx#4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#5 = ++main::idx#4
Successful SSA optimization Pass2ConstantIdentification
@ -242,19 +240,13 @@ Inlining constant with different constant siblings (const byte) main::idx#2
Inlining constant with different constant siblings (const byte) main::idx#3
Inlining constant with different constant siblings (const byte) main::idx#4
Inlining constant with different constant siblings (const byte) main::idx#5
Inlining constant with var siblings (const byte) val#0
Inlining constant with var siblings (const byte) val#2
Inlining constant with var siblings (const byte) val#12
Constant inlined main::idx#0 = (byte) 0
Constant inlined main::idx#1 = ++(byte) 0
Constant inlined val#0 = (byte) 0
Constant inlined main::idx#2 = ++++(byte) 0
Constant inlined main::idx#3 = ++++++(byte) 0
Constant inlined main::idx#4 = ++++++++(byte) 0
Constant inlined main::idx#5 = ++++++++++(byte) 0
Constant inlined val#12 = (const byte) setv::v#0
Constant inlined setp::p#0 = (const byte*) main::ptr#0
Constant inlined val#2 = (byte) 2
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN1#0+++0)
Consolidated array index constant in *(main::SCREEN2#0+++0)
@ -283,27 +275,23 @@ Simplifying constant integer increment ++2
Simplifying constant integer increment ++3
Simplifying constant integer increment ++4
Successful SSA optimization Pass2ConstantSimplification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @4
Adding NOP phi() at start of @end
Adding NOP phi() at start of setv
CALL GRAPH
Calls in [] to main:2
Calls in [main] to setv:15 setp:18
Calls in [main] to setv:16 setp:19
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @4
Renumbering block @3 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of setv
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi()
[0] (byte) val#0 ← (byte) 0
to:@1
@1: scope:[] from @begin
[1] phi()
@ -312,41 +300,42 @@ FINAL CONTROL FLOW GRAPH
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::SCREEN1#0) ← (byte) 0
[4] *((const byte*) main::SCREEN1#0) ← (byte) val#0
[5] *((const byte*) main::SCREEN2#0) ← (byte) '.'
[6] (byte) val#1 ← (byte) 1
[7] *((const byte*) main::SCREEN1#0+(byte) 1) ← (byte) val#1
[8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.'
[9] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) 2
[10] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0)
[11] *((const byte*) main::ptr#0) ← (byte) 3
[12] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) 2
[13] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0)
[14] call setv
[9] (byte) val#2 ← (byte) 2
[10] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) val#2
[11] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0)
[12] *((const byte*) main::ptr#0) ← (byte) 3
[13] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) val#2
[14] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0)
[15] call setv
to:main::@1
main::@1: scope:[main] from main
[15] *((const byte*) main::SCREEN1#0+(byte) 4) ← (const byte) setv::v#0
[16] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0)
[17] call setp
[16] *((const byte*) main::SCREEN1#0+(byte) 4) ← (byte) val#12
[17] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0)
[18] call setp
to:main::@2
main::@2: scope:[main] from main::@1
[18] *((const byte*) main::SCREEN1#0+(byte) 5) ← (const byte) setv::v#0
[19] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0)
[19] *((const byte*) main::SCREEN1#0+(byte) 5) ← (byte) val#12
[20] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0)
to:main::@return
main::@return: scope:[main] from main::@2
[20] return
[21] return
to:@return
setp: scope:[setp] from main::@1
[21] *((const byte*) main::ptr#0) ← (const byte) setp::v#0
[22] *((const byte*) main::ptr#0) ← (const byte) setp::v#0
to:setp::@return
setp::@return: scope:[setp] from setp
[22] return
[23] return
to:@return
setv: scope:[setv] from main
[23] phi()
[24] (byte) val#12 ← (const byte) setv::v#0
to:setv::@return
setv::@return: scope:[setv] from setv
[24] return
[25] return
to:@return
@ -362,13 +351,18 @@ VARIABLE REGISTER WEIGHTS
(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
Initial phi equivalence classes
Added variable val#1 to zero page equivalence class [ val#1 ]
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 ]
Complete equivalence classes
[ val#1 ]
Allocated zp ZP_BYTE:2 [ val#1 ]
[ val#0 val#1 val#2 val#12 ]
Allocated zp ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ]
INITIAL ASM
//SEG0 File Comments
@ -381,137 +375,148 @@ INITIAL ASM
.label val = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG4 [0] (byte) val#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta val
//SEG5 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
//SEG6 @1
b1:
//SEG6 [2] call main
//SEG7 [2] call main
jsr main
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG8 @end
//SEG9 @end
bend:
//SEG9 main
//SEG10 main
main: {
.label SCREEN1 = $400
.label ptr = val
.label SCREEN2 = SCREEN1+$28
//SEG10 [4] *((const byte*) main::SCREEN1#0) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
//SEG11 [4] *((const byte*) main::SCREEN1#0) ← (byte) val#0 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1
//SEG11 [5] *((const byte*) main::SCREEN2#0) ← (byte) '.' -- _deref_pbuc1=vbuc2
//SEG12 [5] *((const byte*) main::SCREEN2#0) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2
//SEG12 [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
//SEG13 [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
// Here we have not yet used address-of - so val can be versioned freely
lda #1
sta val
//SEG13 [7] *((const byte*) main::SCREEN1#0+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
//SEG14 [7] *((const byte*) main::SCREEN1#0+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+1
//SEG14 [8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
//SEG15 [8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2+1
//SEG15 [9] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) 2 -- _deref_pbuc1=vbuc2
//SEG16 [9] (byte) val#2 ← (byte) 2 -- vbuz1=vbuc1
// Set value directly
lda #2
sta val
//SEG17 [10] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) val#2 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+2
//SEG16 [10] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG18 [11] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+2
//SEG17 [11] *((const byte*) main::ptr#0) ← (byte) 3 -- _deref_pbuc1=vbuc2
//SEG19 [12] *((const byte*) main::ptr#0) ← (byte) 3 -- _deref_pbuc1=vbuc2
// Set value through pointer
lda #3
sta ptr
//SEG18 [12] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
//SEG20 [13] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) val#2 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+3
//SEG19 [13] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG21 [14] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+3
//SEG20 [14] call setv
//SEG21 [23] phi from main to setv [phi:main->setv]
setv_from_main:
//SEG22 [15] call setv
jsr setv
jmp b1
//SEG22 main::@1
//SEG23 main::@1
b1:
//SEG23 [15] *((const byte*) main::SCREEN1#0+(byte) 4) ← (const byte) setv::v#0 -- _deref_pbuc1=vbuc2
lda #setv.v
//SEG24 [16] *((const byte*) main::SCREEN1#0+(byte) 4) ← (byte) val#12 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+4
//SEG24 [16] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG25 [17] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+4
//SEG25 [17] call setp
//SEG26 [18] call setp
jsr setp
jmp b2
//SEG26 main::@2
//SEG27 main::@2
b2:
//SEG27 [18] *((const byte*) main::SCREEN1#0+(byte) 5) ← (const byte) setv::v#0 -- _deref_pbuc1=vbuc2
lda #setv.v
//SEG28 [19] *((const byte*) main::SCREEN1#0+(byte) 5) ← (byte) val#12 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+5
//SEG28 [19] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG29 [20] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+5
jmp breturn
//SEG29 main::@return
//SEG30 main::@return
breturn:
//SEG30 [20] return
//SEG31 [21] return
rts
}
//SEG31 setp
//SEG32 setp
setp: {
.const v = 5
//SEG32 [21] *((const byte*) main::ptr#0) ← (const byte) setp::v#0 -- _deref_pbuc1=vbuc2
//SEG33 [22] *((const byte*) main::ptr#0) ← (const byte) setp::v#0 -- _deref_pbuc1=vbuc2
lda #v
sta main.ptr
jmp breturn
//SEG33 setp::@return
//SEG34 setp::@return
breturn:
//SEG34 [22] return
//SEG35 [23] return
rts
}
//SEG35 setv
//SEG36 setv
setv: {
.label v = 4
.const v = 4
//SEG37 [24] (byte) val#12 ← (const byte) setv::v#0 -- vbuz1=vbuc1
lda #v
sta val
jmp breturn
//SEG36 setv::@return
//SEG38 setv::@return
breturn:
//SEG37 [24] return
//SEG39 [25] return
rts
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) main::SCREEN1#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [0] (byte) val#0 ← (byte) 0 [ val#0 ] ( ) always clobbers reg byte a
Statement [4] *((const byte*) main::SCREEN1#0) ← (byte) val#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) main::SCREEN2#0) ← (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#0+(byte) 1) ← (byte) val#1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [11] *((const byte*) main::ptr#0) ← (byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [12] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [15] *((const byte*) main::SCREEN1#0+(byte) 4) ← (const byte) setv::v#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [16] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [18] *((const byte*) main::SCREEN1#0+(byte) 5) ← (const byte) setv::v#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [19] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [21] *((const byte*) main::ptr#0) ← (const byte) setp::v#0 [ ] ( main:2::setp:17 [ ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ val#1 ] : zp ZP_BYTE:2 ,
Statement [9] (byte) val#2 ← (byte) 2 [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [10] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) val#2 [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [11] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [12] *((const byte*) main::ptr#0) ← (byte) 3 [ val#2 ] ( main:2 [ val#2 ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) val#2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [16] *((const byte*) main::SCREEN1#0+(byte) 4) ← (byte) val#12 [ val#12 ] ( main:2 [ val#12 ] ) always clobbers reg byte a
Statement [17] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) [ val#12 ] ( main:2 [ val#12 ] ) always clobbers reg byte a
Statement [19] *((const byte*) main::SCREEN1#0+(byte) 5) ← (byte) val#12 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [20] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [22] *((const byte*) main::ptr#0) ← (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 ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ] : zp ZP_BYTE:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 4: zp ZP_BYTE:2 [ val#1 ]
Uplift Scope [] 8.5: zp ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ]
Uplift Scope [main]
Uplift Scope [setv]
Uplift Scope [setp]
Uplifting [] best 182 combination zp ZP_BYTE:2 [ val#1 ]
Uplifting [main] best 182 combination
Uplifting [setv] best 182 combination
Uplifting [setp] best 182 combination
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ val#1 ]
Uplifting [] best 182 combination zp ZP_BYTE:2 [ val#1 ]
Uplifting [] best 175 combination zp ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ]
Uplifting [main] best 175 combination
Uplifting [setv] best 175 combination
Uplifting [setp] best 175 combination
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ]
Uplifting [] best 175 combination zp ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
@ -524,104 +529,112 @@ ASSEMBLER BEFORE OPTIMIZATION
.label val = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG4 [0] (byte) val#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta val
//SEG5 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
//SEG6 @1
b1:
//SEG6 [2] call main
//SEG7 [2] call main
jsr main
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG8 @end
//SEG9 @end
bend:
//SEG9 main
//SEG10 main
main: {
.label SCREEN1 = $400
.label ptr = val
.label SCREEN2 = SCREEN1+$28
//SEG10 [4] *((const byte*) main::SCREEN1#0) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
//SEG11 [4] *((const byte*) main::SCREEN1#0) ← (byte) val#0 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1
//SEG11 [5] *((const byte*) main::SCREEN2#0) ← (byte) '.' -- _deref_pbuc1=vbuc2
//SEG12 [5] *((const byte*) main::SCREEN2#0) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2
//SEG12 [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
//SEG13 [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
// Here we have not yet used address-of - so val can be versioned freely
lda #1
sta val
//SEG13 [7] *((const byte*) main::SCREEN1#0+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
//SEG14 [7] *((const byte*) main::SCREEN1#0+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+1
//SEG14 [8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
//SEG15 [8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2+1
//SEG15 [9] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) 2 -- _deref_pbuc1=vbuc2
//SEG16 [9] (byte) val#2 ← (byte) 2 -- vbuz1=vbuc1
// Set value directly
lda #2
sta val
//SEG17 [10] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) val#2 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+2
//SEG16 [10] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG18 [11] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+2
//SEG17 [11] *((const byte*) main::ptr#0) ← (byte) 3 -- _deref_pbuc1=vbuc2
//SEG19 [12] *((const byte*) main::ptr#0) ← (byte) 3 -- _deref_pbuc1=vbuc2
// Set value through pointer
lda #3
sta ptr
//SEG18 [12] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
//SEG20 [13] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) val#2 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+3
//SEG19 [13] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG21 [14] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+3
//SEG20 [14] call setv
//SEG21 [23] phi from main to setv [phi:main->setv]
setv_from_main:
//SEG22 [15] call setv
jsr setv
jmp b1
//SEG22 main::@1
//SEG23 main::@1
b1:
//SEG23 [15] *((const byte*) main::SCREEN1#0+(byte) 4) ← (const byte) setv::v#0 -- _deref_pbuc1=vbuc2
lda #setv.v
//SEG24 [16] *((const byte*) main::SCREEN1#0+(byte) 4) ← (byte) val#12 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+4
//SEG24 [16] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG25 [17] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+4
//SEG25 [17] call setp
//SEG26 [18] call setp
jsr setp
jmp b2
//SEG26 main::@2
//SEG27 main::@2
b2:
//SEG27 [18] *((const byte*) main::SCREEN1#0+(byte) 5) ← (const byte) setv::v#0 -- _deref_pbuc1=vbuc2
lda #setv.v
//SEG28 [19] *((const byte*) main::SCREEN1#0+(byte) 5) ← (byte) val#12 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+5
//SEG28 [19] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG29 [20] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+5
jmp breturn
//SEG29 main::@return
//SEG30 main::@return
breturn:
//SEG30 [20] return
//SEG31 [21] return
rts
}
//SEG31 setp
//SEG32 setp
setp: {
.const v = 5
//SEG32 [21] *((const byte*) main::ptr#0) ← (const byte) setp::v#0 -- _deref_pbuc1=vbuc2
//SEG33 [22] *((const byte*) main::ptr#0) ← (const byte) setp::v#0 -- _deref_pbuc1=vbuc2
lda #v
sta main.ptr
jmp breturn
//SEG33 setp::@return
//SEG34 setp::@return
breturn:
//SEG34 [22] return
//SEG35 [23] return
rts
}
//SEG35 setv
//SEG36 setv
setv: {
.label v = 4
.const v = 4
//SEG37 [24] (byte) val#12 ← (const byte) setv::v#0 -- vbuz1=vbuc1
lda #v
sta val
jmp breturn
//SEG36 setv::@return
//SEG38 setv::@return
breturn:
//SEG37 [24] return
//SEG39 [25] return
rts
}
@ -635,24 +648,21 @@ Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda val
Removing instruction lda val
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction bend_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b1:
Removing instruction bend:
Removing instruction setv_from_main:
Removing instruction b1:
Removing instruction b2:
Removing instruction breturn:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Adding RTS to root block
Succesful ASM optimization Pass5AddMainRts
FINAL SYMBOL TABLE
(label) @1
@ -679,102 +689,116 @@ FINAL SYMBOL TABLE
(byte) setv::v
(const byte) setv::v#0 v = (byte) 4
(byte) val
(byte) val#0 val zp ZP_BYTE:2 2.0
(byte) val#1 val zp ZP_BYTE:2 4.0
(byte) val#12 val zp ZP_BYTE:2 1.0
(byte) val#2 val zp ZP_BYTE:2 1.5
zp ZP_BYTE:2 [ val#1 ]
zp ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ]
FINAL ASSEMBLER
Score: 125
Score: 154
//SEG0 File Comments
// Test address-of by assigning the affected variable in multiple ways
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label val = 2
//SEG3 @begin
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
//SEG6 [2] call main
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
//SEG8 @end
//SEG9 main
bbegin:
//SEG4 [0] (byte) val#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta val
//SEG5 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG6 @1
//SEG7 [2] call main
jsr main
rts
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG9 @end
//SEG10 main
main: {
.label SCREEN1 = $400
.label ptr = val
.label SCREEN2 = SCREEN1+$28
//SEG10 [4] *((const byte*) main::SCREEN1#0) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
//SEG11 [4] *((const byte*) main::SCREEN1#0) ← (byte) val#0 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1
//SEG11 [5] *((const byte*) main::SCREEN2#0) ← (byte) '.' -- _deref_pbuc1=vbuc2
//SEG12 [5] *((const byte*) main::SCREEN2#0) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2
//SEG12 [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
//SEG13 [6] (byte) val#1 ← (byte) 1 -- vbuz1=vbuc1
// Here we have not yet used address-of - so val can be versioned freely
lda #1
sta val
//SEG13 [7] *((const byte*) main::SCREEN1#0+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
//SEG14 [7] *((const byte*) main::SCREEN1#0+(byte) 1) ← (byte) val#1 -- _deref_pbuc1=vbuz1
sta SCREEN1+1
//SEG14 [8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
//SEG15 [8] *((const byte*) main::SCREEN2#0+(byte) 1) ← (byte) '.' -- _deref_pbuc1=vbuc2
lda #'.'
sta SCREEN2+1
//SEG15 [9] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) 2 -- _deref_pbuc1=vbuc2
//SEG16 [9] (byte) val#2 ← (byte) 2 -- vbuz1=vbuc1
// Set value directly
lda #2
sta val
//SEG17 [10] *((const byte*) main::SCREEN1#0+(byte) 2) ← (byte) val#2 -- _deref_pbuc1=vbuz1
sta SCREEN1+2
//SEG16 [10] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG18 [11] *((const byte*) main::SCREEN2#0+(byte) 2) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+2
//SEG17 [11] *((const byte*) main::ptr#0) ← (byte) 3 -- _deref_pbuc1=vbuc2
//SEG19 [12] *((const byte*) main::ptr#0) ← (byte) 3 -- _deref_pbuc1=vbuc2
// Set value through pointer
lda #3
sta ptr
//SEG18 [12] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
//SEG20 [13] *((const byte*) main::SCREEN1#0+(byte) 3) ← (byte) val#2 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+3
//SEG19 [13] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG21 [14] *((const byte*) main::SCREEN2#0+(byte) 3) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+3
//SEG20 [14] call setv
//SEG21 [23] phi from main to setv [phi:main->setv]
//SEG22 [15] call setv
jsr setv
//SEG22 main::@1
//SEG23 [15] *((const byte*) main::SCREEN1#0+(byte) 4) ← (const byte) setv::v#0 -- _deref_pbuc1=vbuc2
lda #setv.v
//SEG23 main::@1
//SEG24 [16] *((const byte*) main::SCREEN1#0+(byte) 4) ← (byte) val#12 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+4
//SEG24 [16] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG25 [17] *((const byte*) main::SCREEN2#0+(byte) 4) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+4
//SEG25 [17] call setp
//SEG26 [18] call setp
jsr setp
//SEG26 main::@2
//SEG27 [18] *((const byte*) main::SCREEN1#0+(byte) 5) ← (const byte) setv::v#0 -- _deref_pbuc1=vbuc2
lda #setv.v
//SEG27 main::@2
//SEG28 [19] *((const byte*) main::SCREEN1#0+(byte) 5) ← (byte) val#12 -- _deref_pbuc1=vbuz1
lda val
sta SCREEN1+5
//SEG28 [19] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
//SEG29 [20] *((const byte*) main::SCREEN2#0+(byte) 5) ← *((const byte*) main::ptr#0) -- _deref_pbuc1=_deref_pbuc2
lda ptr
sta SCREEN2+5
//SEG29 main::@return
//SEG30 [20] return
//SEG30 main::@return
//SEG31 [21] return
rts
}
//SEG31 setp
//SEG32 setp
setp: {
.const v = 5
//SEG32 [21] *((const byte*) main::ptr#0) ← (const byte) setp::v#0 -- _deref_pbuc1=vbuc2
//SEG33 [22] *((const byte*) main::ptr#0) ← (const byte) setp::v#0 -- _deref_pbuc1=vbuc2
lda #v
sta main.ptr
//SEG33 setp::@return
//SEG34 [22] return
//SEG34 setp::@return
//SEG35 [23] return
rts
}
//SEG35 setv
//SEG36 setv
setv: {
.label v = 4
//SEG36 setv::@return
//SEG37 [24] return
.const v = 4
//SEG37 [24] (byte) val#12 ← (const byte) setv::v#0 -- vbuz1=vbuc1
lda #v
sta val
//SEG38 setv::@return
//SEG39 [25] return
rts
}

View File

@ -22,6 +22,9 @@
(byte) setv::v
(const byte) setv::v#0 v = (byte) 4
(byte) val
(byte) val#0 val zp ZP_BYTE:2 2.0
(byte) val#1 val zp ZP_BYTE:2 4.0
(byte) val#12 val zp ZP_BYTE:2 1.0
(byte) val#2 val zp ZP_BYTE:2 1.5
zp ZP_BYTE:2 [ val#1 ]
zp ZP_BYTE:2 [ val#0 val#1 val#2 val#12 ]

View File

@ -120,6 +120,7 @@
.const toSpritePtr1_return = PLAYFIELD_SPRITES/$40
.label keyboard_events_size = $42
.label render_screen_showing = $55
.label score_bcd = $28
.label irq_raster_next = $56
.label irq_sprite_ypos = $57
.label irq_sprite_ptr = $58
@ -139,7 +140,6 @@
.label render_screen_show = 2
.label current_movedown_counter = 4
.label lines_bcd = $26
.label score_bcd = $28
.label current_piece_17 = $1e
.label render_screen_render_33 = $e
.label current_xpos_59 = $f
@ -161,6 +161,11 @@ bbegin:
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
lda #0
sta render_screen_showing
// Current score in BCD-format
sta score_bcd
sta score_bcd+1
sta score_bcd+2
sta score_bcd+3
// Original Color Data
// The raster line of the next IRQ
lda #IRQ_RASTER_FIRST
@ -218,10 +223,6 @@ main: {
lda #0
sta level_bcd
sta level
sta score_bcd
sta score_bcd+1
sta score_bcd+2
sta score_bcd+3
sta lines_bcd
sta lines_bcd+1
sta current_movedown_counter

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1010,9 +1010,10 @@
(dword[5]) score_add_bcd
(const dword[5]) score_add_bcd#0 score_add_bcd = { fill( 5, 0) }
(dword) score_bcd
(dword) score_bcd#0 score_bcd zp ZP_DWORD:40 0.1111111111111111
(dword) score_bcd#14 score_bcd zp ZP_DWORD:40 3.135135135135135
(dword) score_bcd#16 score_bcd zp ZP_DWORD:40 1.1428571428571428
(dword) score_bcd#18 score_bcd zp ZP_DWORD:40 2.352941176470588
(dword) score_bcd#18 score_bcd zp ZP_DWORD:40 2.3921568627450975
(dword) score_bcd#26 score_bcd zp ZP_DWORD:40 6.0
(dword) score_bcd#29 score_bcd zp ZP_DWORD:40 0.8571428571428571
(byte*[PLAYFIELD_LINES#0]) screen_lines_1
@ -1117,7 +1118,7 @@ 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 ZP_BYTE:37 [ 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 ZP_WORD:38 [ lines_bcd#26 lines_bcd#19 lines_bcd#15 lines_bcd#17 lines_bcd#29 ]
zp ZP_DWORD:40 [ score_bcd#26 score_bcd#18 score_bcd#14 score_bcd#16 score_bcd#29 ]
zp ZP_DWORD:40 [ score_bcd#26 score_bcd#18 score_bcd#14 score_bcd#0 score_bcd#16 score_bcd#29 ]
zp ZP_BYTE:44 [ level#33 level#10 level#17 level#19 level#21 ]
zp ZP_BYTE:45 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#66 current_movedown_slow#10 ]
zp ZP_BYTE:46 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ]

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (byte*~) main::$0 ← & (byte) A
Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400
Identified constant variable (byte*) SCREEN
Identified constant variable (byte) main::B
@ -176,7 +177,6 @@ VARIABLE REGISTER WEIGHTS
(byte) sub::D#0 4.0
Initial phi equivalence classes
Added variable A#0 to zero page equivalence class [ A#0 ]
Added variable sub::D#0 to zero page equivalence class [ sub::D#0 ]
Complete equivalence classes
[ A#0 ]

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (word*~) main::$0 ← & (word) main::w
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Identified constant variable (byte*) main::screen
@ -140,7 +141,6 @@ VARIABLE REGISTER WEIGHTS
(word*) main::wp
Initial phi equivalence classes
Added variable main::w#0 to zero page equivalence class [ main::w#0 ]
Added variable main::$1 to zero page equivalence class [ main::$1 ]
Added variable main::$2 to zero page equivalence class [ main::$2 ]
Added variable main::$3 to zero page equivalence class [ main::$3 ]

View File

@ -53,8 +53,8 @@ main: {
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zeropage(2) value, byte* zeropage(4) dst)
utoa16w: {
.label value = 2
.label dst = 4
.label value = 2
lda value+1
lsr
lsr

View File

@ -12,30 +12,30 @@ main: scope:[main] from @1
[5] call cls
to:main::@1
main::@1: scope:[main] from main
[6] phi()
[6] (byte*) utoa16w::dst#0 ← (byte*) 1024
[7] call utoa16w
to:main::@2
main::@2: scope:[main] from main::@1
[8] phi()
[8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28
[9] call utoa16w
to:main::@3
main::@3: scope:[main] from main::@2
[10] phi()
[10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28
[11] call utoa16w
to:main::@4
main::@4: scope:[main] from main::@3
[12] phi()
[12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[13] call utoa16w
to:main::@5
main::@5: scope:[main] from main::@4
[14] phi()
[14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[15] call utoa16w
to:main::@return
main::@return: scope:[main] from main::@5
[16] return
to:@return
utoa16w: scope:[utoa16w] from main::@1 main::@2 main::@3 main::@4 main::@5
[17] (byte*) utoa16w::dst#5 ← phi( main::@1/(byte*) 1024 main::@2/(byte*) 1024+(byte) $28 main::@3/(byte*) 1024+(byte) $28+(byte) $28 main::@4/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28 main::@5/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 )
[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

View File

@ -1,3 +1,7 @@
Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$2 ← & (byte*) utoa16w::dst
Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$6 ← & (byte*) utoa16w::dst
Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$10 ← & (byte*) utoa16w::dst
Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$14 ← & (byte*) utoa16w::dst
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Adding pointer type conversion cast (byte*) cls::screen in (byte*) cls::screen ← (number) $400
Identified constant variable (byte*) cls::screen
@ -454,24 +458,21 @@ Constant (const word**) utoa16n::dst#3 = &utoa16w::dst#5
Constant (const byte) utoa16n::started#3 = 1
Constant (const byte) utoa16n::started#4 = 1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) utoa16w::dst#0 = main::screen#0
Constant (const byte) utoa16n::started#0 = utoa16w::started#0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused variable (byte) utoa16w::started#3 and assignment [38] (byte) utoa16w::started#3 ← (byte) utoa16n::return#2
Eliminating unused variable (byte) utoa16n::return#3 and assignment [42] (byte) utoa16n::return#3 ← (byte) utoa16n::return#4
Eliminating unused variable (byte) utoa16w::started#3 and assignment [39] (byte) utoa16w::started#3 ← (byte) utoa16n::return#2
Eliminating unused variable (byte) utoa16n::return#3 and assignment [43] (byte) utoa16n::return#3 ← (byte) utoa16n::return#4
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused variable (byte) utoa16n::return#2 and assignment [37] (byte) utoa16n::return#2 ← (byte) utoa16n::return#4
Eliminating unused variable (byte) utoa16n::return#2 and assignment [38] (byte) utoa16n::return#2 ← (byte) utoa16n::return#4
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [2] (byte*) main::screen#1 ← (const byte*) main::screen#0 + (byte) $28
Constant right-side identified [15] (byte*~) cls::$0 ← (const byte*) cls::screen#0 + (word) $3e7
Constant right-side identified [3] (byte*) main::screen#1 ← (const byte*) main::screen#0 + (byte) $28
Constant right-side identified [16] (byte*~) cls::$0 ← (const byte*) cls::screen#0 + (word) $3e7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#1 = main::screen#0+$28
Constant (const byte*) cls::$0 = cls::screen#0+$3e7
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) utoa16w::dst#1 = main::screen#1
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [18] cls::sc#1 ← ++ cls::sc#2 to ++
Resolved ranged comparison value [19] if(cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1 to (byte*)(const byte*) cls::$0+(number) 1
Resolved ranged next value [19] cls::sc#1 ← ++ cls::sc#2 to ++
Resolved ranged comparison value [20] if(cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1 to (byte*)(const byte*) cls::$0+(number) 1
Adding number conversion cast (unumber) 1 in if((byte*) cls::sc#1!=(byte*)(const byte*) cls::$0+(number) 1) goto cls::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte*) cls::$0+(unumber)(number) 1
@ -479,24 +480,18 @@ Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [3] (byte*) main::screen#2 ← (const byte*) main::screen#1 + (byte) $28
Constant right-side identified [5] (byte*) main::screen#2 ← (const byte*) main::screen#1 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#2 = main::screen#1+$28
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) utoa16w::dst#2 = main::screen#2
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [4] (byte*) main::screen#3 ← (const byte*) main::screen#2 + (byte) $28
Constant right-side identified [7] (byte*) main::screen#3 ← (const byte*) main::screen#2 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#3 = main::screen#2+$28
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) utoa16w::dst#3 = main::screen#3
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [5] (byte*) main::screen#4 ← (const byte*) main::screen#3 + (byte) $28
Constant right-side identified [9] (byte*) main::screen#4 ← (const byte*) main::screen#3 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#4 = main::screen#3+$28
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) utoa16w::dst#4 = main::screen#4
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const byte*) main::screen#0
Inlining constant with different constant siblings (const byte*) main::screen#1
Inlining constant with different constant siblings (const byte*) main::screen#2
@ -508,11 +503,6 @@ Inlining constant with var siblings (const word) utoa16w::value#2
Inlining constant with var siblings (const word) utoa16w::value#3
Inlining constant with var siblings (const word) utoa16w::value#4
Inlining constant with var siblings (const byte) utoa16w::started#0
Inlining constant with var siblings (const byte*) utoa16w::dst#0
Inlining constant with var siblings (const byte*) utoa16w::dst#1
Inlining constant with var siblings (const byte*) utoa16w::dst#2
Inlining constant with var siblings (const byte*) utoa16w::dst#3
Inlining constant with var siblings (const byte*) utoa16w::dst#4
Inlining constant with var siblings (const word**) utoa16n::dst#0
Inlining constant with var siblings (const word**) utoa16n::dst#1
Inlining constant with var siblings (const word**) utoa16n::dst#2
@ -529,22 +519,17 @@ Constant inlined main::screen#2 = (byte*) 1024+(byte) $28+(byte) $28
Constant inlined utoa16w::value#0 = (byte) 0
Constant inlined main::screen#3 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
Constant inlined $0 = (const byte[]) DIGITS#0
Constant inlined utoa16w::started#0 = (byte) 0
Constant inlined utoa16n::started#0 = (byte) 0
Constant inlined cls::$0 = (const byte*) cls::screen#0+(word) $3e7
Constant inlined utoa16n::dst#1 = &(byte*) utoa16w::dst#5
Constant inlined utoa16n::dst#0 = &(byte*) utoa16w::dst#5
Constant inlined utoa16w::dst#3 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
Constant inlined utoa16w::dst#4 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
Constant inlined utoa16w::dst#1 = (byte*) 1024+(byte) $28
Constant inlined utoa16w::dst#2 = (byte*) 1024+(byte) $28+(byte) $28
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::started#4 = (byte) 1
Constant inlined utoa16w::dst#0 = (byte*) 1024
Constant inlined utoa16n::dst#2 = &(byte*) utoa16w::dst#5
Constant inlined utoa16w::started#0 = (byte) 0
Constant inlined cls::$0 = (const byte*) cls::screen#0+(word) $3e7
Constant inlined utoa16w::value#4 = (word) $e608
Constant inlined utoa16w::value#3 = (word) $270f
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (word**) utoa16n::dst#4 &(byte*) utoa16w::dst#5
Successful SSA optimization Pass2IdenticalPhiElimination
@ -556,29 +541,29 @@ Adding NOP phi() at start of @4
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@6
Adding NOP phi() at start of utoa16n::@3
Adding NOP phi() at start of utoa16n::@2
Adding NOP phi() at start of cls
CALL GRAPH
Calls in [] to main:3
Calls in [main] to cls:7 utoa16w:9 utoa16w:11 utoa16w:13 utoa16w:15 utoa16w:17
Calls in [utoa16w] to utoa16n:24 utoa16n:32 utoa16n:40 utoa16n:44
Calls in [main] to cls:7 utoa16w:10 utoa16w:13 utoa16w:16 utoa16w:19 utoa16w:22
Calls in [utoa16w] to utoa16n:29 utoa16n:37 utoa16n:45 utoa16n:49
Created 6 initial phi equivalence classes
Coalesced [23] utoa16n::nybble#8 ← utoa16n::nybble#0
Coalesced [30] utoa16n::nybble#9 ← utoa16n::nybble#1
Coalesced [31] utoa16n::started#9 ← utoa16n::started#1
Coalesced [38] utoa16n::nybble#10 ← utoa16n::nybble#2
Coalesced [39] utoa16n::started#10 ← utoa16n::started#2
Coalesced [43] utoa16n::nybble#11 ← utoa16n::nybble#3
Coalesced [56] utoa16n::return#10 ← utoa16n::started#7
Coalesced [63] cls::sc#3 ← cls::sc#1
Coalesced [9] utoa16w::dst#10 ← utoa16w::dst#0
Coalesced [12] utoa16w::dst#11 ← utoa16w::dst#1
Coalesced [15] utoa16w::dst#12 ← utoa16w::dst#2
Coalesced [18] utoa16w::dst#13 ← utoa16w::dst#3
Coalesced [21] utoa16w::dst#14 ← utoa16w::dst#4
Coalesced [28] utoa16n::nybble#8 ← utoa16n::nybble#0
Coalesced [35] utoa16n::nybble#9 ← utoa16n::nybble#1
Coalesced [36] utoa16n::started#9 ← utoa16n::started#1
Coalesced [43] utoa16n::nybble#10 ← utoa16n::nybble#2
Coalesced [44] utoa16n::started#10 ← utoa16n::started#2
Coalesced [48] utoa16n::nybble#11 ← utoa16n::nybble#3
Coalesced [61] utoa16n::return#10 ← utoa16n::started#7
Coalesced [68] cls::sc#3 ← cls::sc#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) @5
@ -593,11 +578,6 @@ Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of utoa16n::@3
Adding NOP phi() at start of cls
@ -616,30 +596,30 @@ main: scope:[main] from @1
[5] call cls
to:main::@1
main::@1: scope:[main] from main
[6] phi()
[6] (byte*) utoa16w::dst#0 ← (byte*) 1024
[7] call utoa16w
to:main::@2
main::@2: scope:[main] from main::@1
[8] phi()
[8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28
[9] call utoa16w
to:main::@3
main::@3: scope:[main] from main::@2
[10] phi()
[10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28
[11] call utoa16w
to:main::@4
main::@4: scope:[main] from main::@3
[12] phi()
[12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[13] call utoa16w
to:main::@5
main::@5: scope:[main] from main::@4
[14] phi()
[14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[15] call utoa16w
to:main::@return
main::@return: scope:[main] from main::@5
[16] return
to:@return
utoa16w: scope:[utoa16w] from main::@1 main::@2 main::@3 main::@4 main::@5
[17] (byte*) utoa16w::dst#5 ← phi( main::@1/(byte*) 1024 main::@2/(byte*) 1024+(byte) $28 main::@3/(byte*) 1024+(byte) $28+(byte) $28 main::@4/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28 main::@5/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 )
[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
@ -736,7 +716,12 @@ VARIABLE REGISTER WEIGHTS
(byte~) utoa16w::$4 4.0
(byte~) utoa16w::$8 4.0
(byte*) utoa16w::dst
(byte*) utoa16w::dst#5 0.07407407407407407
(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::started
(byte) utoa16w::started#1 1.3333333333333333
(byte) utoa16w::started#2 1.3333333333333333
@ -745,7 +730,7 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ utoa16w::value#5 ]
[ utoa16w::dst#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 ]
@ -759,7 +744,7 @@ Added variable utoa16w::$8 to zero page equivalence class [ utoa16w::$8 ]
Added variable utoa16w::$12 to zero page equivalence class [ utoa16w::$12 ]
Complete equivalence classes
[ utoa16w::value#5 ]
[ utoa16w::dst#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 ]
@ -772,7 +757,7 @@ Complete equivalence classes
[ utoa16w::$8 ]
[ utoa16w::$12 ]
Allocated zp ZP_WORD:2 [ utoa16w::value#5 ]
Allocated zp ZP_WORD:4 [ utoa16w::dst#5 ]
Allocated zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
Allocated zp ZP_BYTE:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
Allocated zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Allocated zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ]
@ -815,95 +800,90 @@ main: {
//SEG12 [46] phi from main to cls [phi:main->cls]
cls_from_main:
jsr cls
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
jmp b1
//SEG14 main::@1
//SEG13 main::@1
b1:
//SEG15 [7] call utoa16w
//SEG16 [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
utoa16w_from_b1:
//SEG17 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024 [phi:main::@1->utoa16w#0] -- pbuz1=pbuc1
//SEG14 [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta utoa16w.dst
lda #>$400
sta utoa16w.dst+1
//SEG15 [7] call utoa16w
//SEG16 [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
utoa16w_from_b1:
//SEG17 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy
//SEG18 [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1
lda #0
sta utoa16w.value
lda #0
sta utoa16w.value+1
jsr utoa16w
//SEG19 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
jmp b2
//SEG20 main::@2
//SEG19 main::@2
b2:
//SEG21 [9] call utoa16w
//SEG22 [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
utoa16w_from_b2:
//SEG23 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28 [phi:main::@2->utoa16w#0] -- pbuz1=pbuc1
//SEG20 [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28
sta utoa16w.dst
lda #>$400+$28
sta utoa16w.dst+1
//SEG21 [9] call utoa16w
//SEG22 [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
utoa16w_from_b2:
//SEG23 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy
//SEG24 [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1
lda #<$4d2
sta utoa16w.value
lda #>$4d2
sta utoa16w.value+1
jsr utoa16w
//SEG25 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
b3_from_b2:
jmp b3
//SEG26 main::@3
//SEG25 main::@3
b3:
//SEG27 [11] call utoa16w
//SEG28 [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
utoa16w_from_b3:
//SEG29 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28 [phi:main::@3->utoa16w#0] -- pbuz1=pbuc1
//SEG26 [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28
sta utoa16w.dst+1
//SEG27 [11] call utoa16w
//SEG28 [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
utoa16w_from_b3:
//SEG29 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy
//SEG30 [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1
lda #<$162e
sta utoa16w.value
lda #>$162e
sta utoa16w.value+1
jsr utoa16w
//SEG31 [12] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
jmp b4
//SEG32 main::@4
//SEG31 main::@4
b4:
//SEG33 [13] call utoa16w
//SEG34 [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
utoa16w_from_b4:
//SEG35 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [phi:main::@4->utoa16w#0] -- pbuz1=pbuc1
//SEG32 [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28+$28
sta utoa16w.dst+1
//SEG33 [13] call utoa16w
//SEG34 [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
utoa16w_from_b4:
//SEG35 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy
//SEG36 [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1
lda #<$270f
sta utoa16w.value
lda #>$270f
sta utoa16w.value+1
jsr utoa16w
//SEG37 [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
b5_from_b4:
jmp b5
//SEG38 main::@5
//SEG37 main::@5
b5:
//SEG39 [15] call utoa16w
//SEG40 [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
utoa16w_from_b5:
//SEG41 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [phi:main::@5->utoa16w#0] -- pbuz1=pbuc1
//SEG38 [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28+$28+$28
sta utoa16w.dst+1
//SEG39 [15] call utoa16w
//SEG40 [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
utoa16w_from_b5:
//SEG41 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy
//SEG42 [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1
lda #<$e608
sta utoa16w.value
@ -924,10 +904,10 @@ utoa16w: {
.label _4 = $d
.label _8 = $10
.label _12 = $11
.label dst = 4
.label started = $c
.label started_2 = $f
.label value = 2
.label dst = 4
//SEG46 [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuz1=_hi_vwuz2
lda value+1
sta _0
@ -1127,6 +1107,11 @@ cls: {
DIGITS: .text "0123456789abcdef@"
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::$4 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ) always clobbers reg byte a
@ -1141,6 +1126,11 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ ut
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y
Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a
Statement [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::$4 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ) always clobbers reg byte a
@ -1152,7 +1142,7 @@ Statement [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (by
Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y
Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a
Potential registers zp ZP_WORD:2 [ utoa16w::value#5 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:4 [ utoa16w::dst#5 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_BYTE:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] : zp ZP_BYTE:7 , reg byte x ,
Potential registers zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ] : zp ZP_WORD:8 ,
@ -1166,17 +1156,17 @@ Potential registers zp ZP_BYTE:16 [ utoa16w::$8 ] : zp ZP_BYTE:16 , reg byte a ,
Potential registers zp ZP_BYTE:17 [ utoa16w::$12 ] : zp ZP_BYTE:17 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [utoa16w] 20.44: zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] 4: zp ZP_BYTE:10 [ utoa16w::$0 ] 4: zp ZP_BYTE:13 [ utoa16w::$4 ] 4: zp ZP_BYTE:16 [ utoa16w::$8 ] 4: zp ZP_BYTE:17 [ utoa16w::$12 ] 1.33: zp ZP_BYTE:12 [ utoa16w::started#1 ] 1.33: zp ZP_BYTE:15 [ utoa16w::started#2 ] 0.5: zp ZP_WORD:2 [ utoa16w::value#5 ]
Uplift Scope [utoa16n] 14.4: zp ZP_BYTE:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] 11.14: zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] 4: zp ZP_BYTE:11 [ utoa16n::return#0 ] 4: zp ZP_BYTE:14 [ utoa16n::return#1 ]
Uplift Scope [cls] 33: zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ]
Uplift Scope [utoa16w] 4: zp ZP_BYTE:10 [ utoa16w::$0 ] 4: zp ZP_BYTE:13 [ utoa16w::$4 ] 4: zp ZP_BYTE:16 [ utoa16w::$8 ] 4: zp ZP_BYTE:17 [ utoa16w::$12 ] 1.33: zp ZP_BYTE:12 [ utoa16w::started#1 ] 1.33: zp ZP_BYTE:15 [ utoa16w::started#2 ] 0.5: zp ZP_WORD:2 [ utoa16w::value#5 ] 0.07: zp ZP_WORD:4 [ utoa16w::dst#5 ]
Uplift Scope [main]
Uplift Scope []
Uplifting [utoa16n] best 929 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 929 combination zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ]
Uplifting [utoa16w] best 905 combination reg byte a [ utoa16w::$0 ] reg byte a [ utoa16w::$4 ] reg byte a [ utoa16w::$8 ] reg byte a [ utoa16w::$12 ] zp ZP_BYTE:12 [ utoa16w::started#1 ] zp ZP_BYTE:15 [ utoa16w::started#2 ] zp ZP_WORD:2 [ utoa16w::value#5 ] zp ZP_WORD:4 [ utoa16w::dst#5 ]
Uplifting [utoa16w] best 957 combination zp ZP_WORD: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::$4 ] reg byte a [ utoa16w::$8 ] reg byte a [ utoa16w::$12 ] zp ZP_BYTE:12 [ utoa16w::started#1 ] zp ZP_BYTE:15 [ utoa16w::started#2 ] zp ZP_WORD:2 [ utoa16w::value#5 ]
Limited combination testing to 100 combinations of 2304 possible.
Uplifting [utoa16n] best 905 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 905 combination zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ]
Uplifting [main] best 905 combination
Uplifting [] best 905 combination
Attempting to uplift remaining variables inzp ZP_BYTE:12 [ utoa16w::started#1 ]
@ -1215,95 +1205,90 @@ main: {
//SEG12 [46] phi from main to cls [phi:main->cls]
cls_from_main:
jsr cls
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
jmp b1
//SEG14 main::@1
//SEG13 main::@1
b1:
//SEG15 [7] call utoa16w
//SEG16 [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
utoa16w_from_b1:
//SEG17 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024 [phi:main::@1->utoa16w#0] -- pbuz1=pbuc1
//SEG14 [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta utoa16w.dst
lda #>$400
sta utoa16w.dst+1
//SEG15 [7] call utoa16w
//SEG16 [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
utoa16w_from_b1:
//SEG17 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy
//SEG18 [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1
lda #0
sta utoa16w.value
lda #0
sta utoa16w.value+1
jsr utoa16w
//SEG19 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
jmp b2
//SEG20 main::@2
//SEG19 main::@2
b2:
//SEG21 [9] call utoa16w
//SEG22 [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
utoa16w_from_b2:
//SEG23 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28 [phi:main::@2->utoa16w#0] -- pbuz1=pbuc1
//SEG20 [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28
sta utoa16w.dst
lda #>$400+$28
sta utoa16w.dst+1
//SEG21 [9] call utoa16w
//SEG22 [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
utoa16w_from_b2:
//SEG23 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy
//SEG24 [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1
lda #<$4d2
sta utoa16w.value
lda #>$4d2
sta utoa16w.value+1
jsr utoa16w
//SEG25 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
b3_from_b2:
jmp b3
//SEG26 main::@3
//SEG25 main::@3
b3:
//SEG27 [11] call utoa16w
//SEG28 [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
utoa16w_from_b3:
//SEG29 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28 [phi:main::@3->utoa16w#0] -- pbuz1=pbuc1
//SEG26 [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28
sta utoa16w.dst+1
//SEG27 [11] call utoa16w
//SEG28 [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
utoa16w_from_b3:
//SEG29 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy
//SEG30 [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1
lda #<$162e
sta utoa16w.value
lda #>$162e
sta utoa16w.value+1
jsr utoa16w
//SEG31 [12] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
jmp b4
//SEG32 main::@4
//SEG31 main::@4
b4:
//SEG33 [13] call utoa16w
//SEG34 [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
utoa16w_from_b4:
//SEG35 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [phi:main::@4->utoa16w#0] -- pbuz1=pbuc1
//SEG32 [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28+$28
sta utoa16w.dst+1
//SEG33 [13] call utoa16w
//SEG34 [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
utoa16w_from_b4:
//SEG35 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy
//SEG36 [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1
lda #<$270f
sta utoa16w.value
lda #>$270f
sta utoa16w.value+1
jsr utoa16w
//SEG37 [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
b5_from_b4:
jmp b5
//SEG38 main::@5
//SEG37 main::@5
b5:
//SEG39 [15] call utoa16w
//SEG40 [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
utoa16w_from_b5:
//SEG41 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [phi:main::@5->utoa16w#0] -- pbuz1=pbuc1
//SEG38 [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28+$28+$28
sta utoa16w.dst+1
//SEG39 [15] call utoa16w
//SEG40 [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
utoa16w_from_b5:
//SEG41 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy
//SEG42 [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1
lda #<$e608
sta utoa16w.value
@ -1320,8 +1305,8 @@ main: {
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zeropage(2) value, byte* zeropage(4) dst)
utoa16w: {
.label value = 2
.label dst = 4
.label value = 2
//SEG46 [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1
lda value+1
//SEG47 [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 -- vbuaa=vbuaa_ror_4
@ -1517,16 +1502,6 @@ Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_main:
Removing instruction utoa16w_from_b1:
Removing instruction b2_from_b1:
Removing instruction utoa16w_from_b2:
Removing instruction b3_from_b2:
Removing instruction utoa16w_from_b3:
Removing instruction b4_from_b3:
Removing instruction utoa16w_from_b4:
Removing instruction b5_from_b4:
Removing instruction utoa16w_from_b5:
Removing instruction b3_from_utoa16n:
Removing instruction b3:
Removing instruction b1_from_b3:
@ -1535,10 +1510,15 @@ Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction cls_from_main:
Removing instruction b1:
Removing instruction utoa16w_from_b1:
Removing instruction b2:
Removing instruction utoa16w_from_b2:
Removing instruction b3:
Removing instruction utoa16w_from_b3:
Removing instruction b4:
Removing instruction utoa16w_from_b4:
Removing instruction b5:
Removing instruction utoa16w_from_b5:
Removing instruction breturn:
Removing instruction utoa16n_from_utoa16w:
Removing instruction b1:
@ -1616,7 +1596,12 @@ FINAL SYMBOL TABLE
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#5 dst zp ZP_WORD:4 0.07407407407407407
(byte*) utoa16w::dst#0 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#1 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#2 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#3 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#4 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#5 dst zp ZP_WORD:4 0.4444444444444444
(byte) utoa16w::started
(byte) utoa16w::started#1 reg byte x 1.3333333333333333
(byte) utoa16w::started#2 reg byte x 1.3333333333333333
@ -1624,7 +1609,7 @@ FINAL SYMBOL TABLE
(word) utoa16w::value#5 value zp ZP_WORD:2 0.5
zp ZP_WORD:2 [ utoa16w::value#5 ]
zp ZP_WORD:4 [ utoa16w::dst#5 ]
zp ZP_WORD:4 [ 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 ZP_WORD:6 [ cls::sc#2 cls::sc#1 ]
@ -1660,74 +1645,74 @@ main: {
//SEG11 [5] call cls
//SEG12 [46] phi from main to cls [phi:main->cls]
jsr cls
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
//SEG14 main::@1
//SEG15 [7] call utoa16w
//SEG16 [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
//SEG17 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024 [phi:main::@1->utoa16w#0] -- pbuz1=pbuc1
//SEG13 main::@1
//SEG14 [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1
lda #<$400
sta utoa16w.dst
lda #>$400
sta utoa16w.dst+1
//SEG15 [7] call utoa16w
//SEG16 [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
//SEG17 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy
//SEG18 [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1
lda #0
sta utoa16w.value
sta utoa16w.value+1
jsr utoa16w
//SEG19 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG20 main::@2
//SEG21 [9] call utoa16w
//SEG22 [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
//SEG23 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28 [phi:main::@2->utoa16w#0] -- pbuz1=pbuc1
//SEG19 main::@2
//SEG20 [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28
sta utoa16w.dst
lda #>$400+$28
sta utoa16w.dst+1
//SEG21 [9] call utoa16w
//SEG22 [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
//SEG23 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy
//SEG24 [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1
lda #<$4d2
sta utoa16w.value
lda #>$4d2
sta utoa16w.value+1
jsr utoa16w
//SEG25 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
//SEG26 main::@3
//SEG27 [11] call utoa16w
//SEG28 [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
//SEG29 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28 [phi:main::@3->utoa16w#0] -- pbuz1=pbuc1
//SEG25 main::@3
//SEG26 [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28
sta utoa16w.dst+1
//SEG27 [11] call utoa16w
//SEG28 [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
//SEG29 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy
//SEG30 [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1
lda #<$162e
sta utoa16w.value
lda #>$162e
sta utoa16w.value+1
jsr utoa16w
//SEG31 [12] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
//SEG32 main::@4
//SEG33 [13] call utoa16w
//SEG34 [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
//SEG35 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [phi:main::@4->utoa16w#0] -- pbuz1=pbuc1
//SEG31 main::@4
//SEG32 [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28+$28
sta utoa16w.dst+1
//SEG33 [13] call utoa16w
//SEG34 [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
//SEG35 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy
//SEG36 [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1
lda #<$270f
sta utoa16w.value
lda #>$270f
sta utoa16w.value+1
jsr utoa16w
//SEG37 [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
//SEG38 main::@5
//SEG39 [15] call utoa16w
//SEG40 [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
//SEG41 [17] phi (byte*) utoa16w::dst#5 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [phi:main::@5->utoa16w#0] -- pbuz1=pbuc1
//SEG37 main::@5
//SEG38 [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1
lda #<$400+$28+$28+$28+$28
sta utoa16w.dst
lda #>$400+$28+$28+$28+$28
sta utoa16w.dst+1
//SEG39 [15] call utoa16w
//SEG40 [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
//SEG41 [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy
//SEG42 [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1
lda #<$e608
sta utoa16w.value
@ -1742,8 +1727,8 @@ main: {
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zeropage(2) value, byte* zeropage(4) dst)
utoa16w: {
.label value = 2
.label dst = 4
.label value = 2
//SEG46 [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1
lda value+1
//SEG47 [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 -- vbuaa=vbuaa_ror_4

View File

@ -50,7 +50,12 @@
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#5 dst zp ZP_WORD:4 0.07407407407407407
(byte*) utoa16w::dst#0 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#1 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#2 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#3 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#4 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#5 dst zp ZP_WORD:4 0.4444444444444444
(byte) utoa16w::started
(byte) utoa16w::started#1 reg byte x 1.3333333333333333
(byte) utoa16w::started#2 reg byte x 1.3333333333333333
@ -58,7 +63,7 @@
(word) utoa16w::value#5 value zp ZP_WORD:2 0.5
zp ZP_WORD:2 [ utoa16w::value#5 ]
zp ZP_WORD:4 [ utoa16w::dst#5 ]
zp ZP_WORD:4 [ 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 ZP_WORD:6 [ cls::sc#2 cls::sc#1 ]

View File

@ -176,8 +176,8 @@ utoa10w: {
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zeropage(8) value, byte* zeropage($a) dst)
utoa16w: {
.label value = 8
.label dst = $a
.label value = 8
lda value+1
lsr
lsr

View File

@ -20,145 +20,150 @@ main::@1: scope:[main] from main main::@1 main::@3
main::@2: scope:[main] from main::@1
[10] *((const byte*) bordercol#0) ← (byte) 1
[11] (byte) main::time_start#0 ← *((const byte*) raster#0)
[12] call utoa16w
[12] (byte*) utoa16w::dst#0 ← (byte*) 1024
[13] call utoa16w
to:main::@4
main::@4: scope:[main] from main::@2
[13] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[14] call utoa16w
[14] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[15] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28
[16] call utoa16w
to:main::@5
main::@5: scope:[main] from main::@4
[15] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[16] call utoa16w
[17] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[18] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28
[19] call utoa16w
to:main::@6
main::@6: scope:[main] from main::@5
[17] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[18] call utoa16w
[20] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[21] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
[22] call utoa16w
to:main::@7
main::@7: scope:[main] from main::@6
[19] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[20] call utoa16w
[23] *((const byte*) bordercol#0) ← ++ *((const byte*) bordercol#0)
[24] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
[25] call utoa16w
to:main::@8
main::@8: scope:[main] from main::@7
[21] (byte) main::time_end#0 ← *((const byte*) raster#0)
[22] *((const byte*) bordercol#0) ← (byte) 0
[23] (byte) main::time#0 ← (byte) main::time_end#0 - (byte) main::time_start#0
[24] (word) utoa10w::value#0 ← (word)(byte) main::time#0
[25] call utoa10w
[26] (byte) main::time_end#0 ← *((const byte*) raster#0)
[27] *((const byte*) bordercol#0) ← (byte) 0
[28] (byte) main::time#0 ← (byte) main::time_end#0 - (byte) main::time_start#0
[29] (word) utoa10w::value#0 ← (word)(byte) main::time#0
[30] call utoa10w
to:main::@3
main::@3: scope:[main] from main::@3 main::@8
[26] (byte) main::i#2 ← phi( main::@8/(byte) 0 main::@3/(byte) main::i#1 )
[27] *((byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28+(byte) $50+(byte) 3 + (byte) main::i#2) ← *((const byte[]) main::msg#0 + (byte) main::i#2)
[28] (byte) main::i#1 ← ++ (byte) main::i#2
[29] if(*((const byte[]) main::msg#0 + (byte) main::i#1)!=(byte) 0) goto main::@3
[31] (byte) main::i#2 ← phi( main::@8/(byte) 0 main::@3/(byte) main::i#1 )
[32] *((byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28+(byte) $50+(byte) 3 + (byte) main::i#2) ← *((const byte[]) main::msg#0 + (byte) main::i#2)
[33] (byte) main::i#1 ← ++ (byte) main::i#2
[34] if(*((const byte[]) main::msg#0 + (byte) main::i#1)!=(byte) 0) goto main::@3
to:main::@1
utoa10w: scope:[utoa10w] from main::@8
[30] phi()
[35] phi()
to:utoa10w::@1
utoa10w::@1: scope:[utoa10w] from utoa10w utoa10w::@2 utoa10w::@6
[31] (byte*) utoa10w::dst#11 ← phi( utoa10w/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28+(byte) $50 utoa10w::@6/(byte*) utoa10w::dst#4 )
[31] (byte) utoa10w::bStarted#2 ← phi( utoa10w/(byte) 0 utoa10w::@2/(byte) 1 )
[31] (byte) utoa10w::digit#3 ← phi( utoa10w/(byte) 0 utoa10w::@6/(byte) utoa10w::digit#7 utoa10w::@2/(byte) utoa10w::digit#1 )
[31] (word) utoa10w::value#10 ← phi( utoa10w/(word) utoa10w::value#0 utoa10w::@2/(word) utoa10w::value#1 )
[31] (byte) utoa10w::i#2 ← phi( utoa10w/(byte) 0 utoa10w::@6/(byte) utoa10w::i#1 )
[32] (byte~) utoa10w::$8 ← (byte) utoa10w::i#2 << (byte) 1
[33] if((word) utoa10w::value#10>=*((const word[]) UTOA10_SUB#0 + (byte~) utoa10w::$8)) goto utoa10w::@2
[36] (byte*) utoa10w::dst#11 ← phi( utoa10w/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28+(byte) $50 utoa10w::@6/(byte*) utoa10w::dst#4 )
[36] (byte) utoa10w::bStarted#2 ← phi( utoa10w/(byte) 0 utoa10w::@2/(byte) 1 )
[36] (byte) utoa10w::digit#3 ← phi( utoa10w/(byte) 0 utoa10w::@6/(byte) utoa10w::digit#7 utoa10w::@2/(byte) utoa10w::digit#1 )
[36] (word) utoa10w::value#10 ← phi( utoa10w/(word) utoa10w::value#0 utoa10w::@2/(word) utoa10w::value#1 )
[36] (byte) utoa10w::i#2 ← phi( utoa10w/(byte) 0 utoa10w::@6/(byte) utoa10w::i#1 )
[37] (byte~) utoa10w::$8 ← (byte) utoa10w::i#2 << (byte) 1
[38] if((word) utoa10w::value#10>=*((const word[]) UTOA10_SUB#0 + (byte~) utoa10w::$8)) goto utoa10w::@2
to:utoa10w::@3
utoa10w::@3: scope:[utoa10w] from utoa10w::@1
[34] (byte~) utoa10w::$2 ← (byte) utoa10w::i#2 & (byte) 1
[35] if((byte~) utoa10w::$2==(byte) 0) goto utoa10w::@6
[39] (byte~) utoa10w::$2 ← (byte) utoa10w::i#2 & (byte) 1
[40] if((byte~) utoa10w::$2==(byte) 0) goto utoa10w::@6
to:utoa10w::@4
utoa10w::@4: scope:[utoa10w] from utoa10w::@3
[36] if((byte) utoa10w::bStarted#2==(byte) 0) goto utoa10w::@7
[41] if((byte) utoa10w::bStarted#2==(byte) 0) goto utoa10w::@7
to:utoa10w::@5
utoa10w::@5: scope:[utoa10w] from utoa10w::@4
[37] *((byte*) utoa10w::dst#11) ← *((const byte[]) DIGITS#0 + (byte) utoa10w::digit#3)
[38] (byte*) utoa10w::dst#1 ← ++ (byte*) utoa10w::dst#11
[42] *((byte*) utoa10w::dst#11) ← *((const byte[]) DIGITS#0 + (byte) utoa10w::digit#3)
[43] (byte*) utoa10w::dst#1 ← ++ (byte*) utoa10w::dst#11
to:utoa10w::@7
utoa10w::@7: scope:[utoa10w] from utoa10w::@4 utoa10w::@5
[39] (byte*) utoa10w::dst#7 ← phi( utoa10w::@4/(byte*) utoa10w::dst#11 utoa10w::@5/(byte*) utoa10w::dst#1 )
[44] (byte*) utoa10w::dst#7 ← phi( utoa10w::@4/(byte*) utoa10w::dst#11 utoa10w::@5/(byte*) utoa10w::dst#1 )
to:utoa10w::@6
utoa10w::@6: scope:[utoa10w] from utoa10w::@3 utoa10w::@7
[40] (byte) utoa10w::digit#7 ← phi( utoa10w::@7/(byte) 0 utoa10w::@3/(byte) utoa10w::digit#3 )
[40] (byte*) utoa10w::dst#4 ← phi( utoa10w::@7/(byte*) utoa10w::dst#7 utoa10w::@3/(byte*) utoa10w::dst#11 )
[41] (byte) utoa10w::i#1 ← ++ (byte) utoa10w::i#2
[42] if((byte) utoa10w::i#1!=(byte) 8) goto utoa10w::@1
[45] (byte) utoa10w::digit#7 ← phi( utoa10w::@7/(byte) 0 utoa10w::@3/(byte) utoa10w::digit#3 )
[45] (byte*) utoa10w::dst#4 ← phi( utoa10w::@7/(byte*) utoa10w::dst#7 utoa10w::@3/(byte*) utoa10w::dst#11 )
[46] (byte) utoa10w::i#1 ← ++ (byte) utoa10w::i#2
[47] if((byte) utoa10w::i#1!=(byte) 8) goto utoa10w::@1
to:utoa10w::@8
utoa10w::@8: scope:[utoa10w] from utoa10w::@6
[43] (byte~) utoa10w::$0 ← (byte)(word) utoa10w::value#10
[44] *((byte*) utoa10w::dst#4) ← *((const byte[]) DIGITS#0 + (byte~) utoa10w::$0)
[45] (byte*) utoa10w::dst#2 ← ++ (byte*) utoa10w::dst#4
[46] *((byte*) utoa10w::dst#2) ← (byte) 0
[48] (byte~) utoa10w::$0 ← (byte)(word) utoa10w::value#10
[49] *((byte*) utoa10w::dst#4) ← *((const byte[]) DIGITS#0 + (byte~) utoa10w::$0)
[50] (byte*) utoa10w::dst#2 ← ++ (byte*) utoa10w::dst#4
[51] *((byte*) utoa10w::dst#2) ← (byte) 0
to:utoa10w::@return
utoa10w::@return: scope:[utoa10w] from utoa10w::@8
[47] return
[52] return
to:@return
utoa10w::@2: scope:[utoa10w] from utoa10w::@1
[48] (byte) utoa10w::digit#1 ← (byte) utoa10w::digit#3 + *((const byte[]) UTOA10_VAL#0 + (byte) utoa10w::i#2)
[49] (byte~) utoa10w::$9 ← (byte) utoa10w::i#2 << (byte) 1
[50] (word) utoa10w::value#1 ← (word) utoa10w::value#10 - *((const word[]) UTOA10_SUB#0 + (byte~) utoa10w::$9)
[53] (byte) utoa10w::digit#1 ← (byte) utoa10w::digit#3 + *((const byte[]) UTOA10_VAL#0 + (byte) utoa10w::i#2)
[54] (byte~) utoa10w::$9 ← (byte) utoa10w::i#2 << (byte) 1
[55] (word) utoa10w::value#1 ← (word) utoa10w::value#10 - *((const word[]) UTOA10_SUB#0 + (byte~) utoa10w::$9)
to:utoa10w::@1
utoa16w: scope:[utoa16w] from main::@2 main::@4 main::@5 main::@6 main::@7
[51] (byte*) utoa16w::dst#5 ← phi( main::@4/(byte*) 1024+(byte) $28 main::@5/(byte*) 1024+(byte) $28+(byte) $28 main::@6/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28 main::@7/(byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 main::@2/(byte*) 1024 )
[51] (word) utoa16w::value#5 ← phi( main::@4/(word) $4d2 main::@5/(word) $162e main::@6/(word) $270f main::@7/(word) $e608 main::@2/(byte) 0 )
[52] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5
[53] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4
[54] call utoa16n
[55] (byte) utoa16n::return#0 ← (byte) utoa16n::return#4
[56] (byte*) utoa16w::dst#5 ← phi( main::@4/(byte*) utoa16w::dst#1 main::@5/(byte*) utoa16w::dst#2 main::@6/(byte*) utoa16w::dst#3 main::@7/(byte*) utoa16w::dst#4 main::@2/(byte*) utoa16w::dst#0 )
[56] (word) utoa16w::value#5 ← phi( main::@4/(word) $4d2 main::@5/(word) $162e main::@6/(word) $270f main::@7/(word) $e608 main::@2/(byte) 0 )
[57] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5
[58] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4
[59] call utoa16n
[60] (byte) utoa16n::return#0 ← (byte) utoa16n::return#4
to:utoa16w::@1
utoa16w::@1: scope:[utoa16w] from utoa16w
[56] (byte) utoa16w::started#1 ← (byte) utoa16n::return#0
[57] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5
[58] (byte) utoa16n::nybble#1 ← (byte~) utoa16w::$4 & (byte) $f
[59] (byte) utoa16n::started#1 ← (byte) utoa16w::started#1
[60] call utoa16n
[61] (byte) utoa16n::return#1 ← (byte) utoa16n::return#4
[61] (byte) utoa16w::started#1 ← (byte) utoa16n::return#0
[62] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5
[63] (byte) utoa16n::nybble#1 ← (byte~) utoa16w::$4 & (byte) $f
[64] (byte) utoa16n::started#1 ← (byte) utoa16w::started#1
[65] call utoa16n
[66] (byte) utoa16n::return#1 ← (byte) utoa16n::return#4
to:utoa16w::@2
utoa16w::@2: scope:[utoa16w] from utoa16w::@1
[62] (byte) utoa16w::started#2 ← (byte) utoa16n::return#1
[63] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5
[64] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4
[65] (byte) utoa16n::started#2 ← (byte) utoa16w::started#2
[66] call utoa16n
[67] (byte) utoa16w::started#2 ← (byte) utoa16n::return#1
[68] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5
[69] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4
[70] (byte) utoa16n::started#2 ← (byte) utoa16w::started#2
[71] call utoa16n
to:utoa16w::@3
utoa16w::@3: scope:[utoa16w] from utoa16w::@2
[67] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5
[68] (byte) utoa16n::nybble#3 ← (byte~) utoa16w::$12 & (byte) $f
[69] call utoa16n
[72] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5
[73] (byte) utoa16n::nybble#3 ← (byte~) utoa16w::$12 & (byte) $f
[74] call utoa16n
to:utoa16w::@4
utoa16w::@4: scope:[utoa16w] from utoa16w::@3
[70] *((byte*) utoa16w::dst#5) ← (byte) 0
[75] *((byte*) utoa16w::dst#5) ← (byte) 0
to:utoa16w::@return
utoa16w::@return: scope:[utoa16w] from utoa16w::@4
[71] return
[76] return
to:@return
utoa16n: scope:[utoa16n] from utoa16w utoa16w::@1 utoa16w::@2 utoa16w::@3
[72] (byte) utoa16n::started#7 ← phi( utoa16w/(byte) 0 utoa16w::@1/(byte) utoa16n::started#1 utoa16w::@2/(byte) utoa16n::started#2 utoa16w::@3/(byte) 1 )
[72] (byte) utoa16n::nybble#4 ← phi( utoa16w/(byte) utoa16n::nybble#0 utoa16w::@1/(byte) utoa16n::nybble#1 utoa16w::@2/(byte) utoa16n::nybble#2 utoa16w::@3/(byte) utoa16n::nybble#3 )
[73] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@3
[77] (byte) utoa16n::started#7 ← phi( utoa16w/(byte) 0 utoa16w::@1/(byte) utoa16n::started#1 utoa16w::@2/(byte) utoa16n::started#2 utoa16w::@3/(byte) 1 )
[77] (byte) utoa16n::nybble#4 ← phi( utoa16w/(byte) utoa16n::nybble#0 utoa16w::@1/(byte) utoa16n::nybble#1 utoa16w::@2/(byte) utoa16n::nybble#2 utoa16w::@3/(byte) utoa16n::nybble#3 )
[78] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@3
to:utoa16n::@1
utoa16n::@3: scope:[utoa16n] from utoa16n
[74] phi()
[79] phi()
to:utoa16n::@1
utoa16n::@1: scope:[utoa16n] from utoa16n utoa16n::@3
[75] (byte) utoa16n::return#4 ← phi( utoa16n::@3/(byte) utoa16n::started#7 utoa16n/(byte) 1 )
[76] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return
[80] (byte) utoa16n::return#4 ← phi( utoa16n::@3/(byte) utoa16n::started#7 utoa16n/(byte) 1 )
[81] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return
to:utoa16n::@2
utoa16n::@2: scope:[utoa16n] from utoa16n::@1
[77] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4)
[78] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5)
[82] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4)
[83] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5)
to:utoa16n::@return
utoa16n::@return: scope:[utoa16n] from utoa16n::@1 utoa16n::@2
[79] return
[84] return
to:@return
cls: scope:[cls] from main
[80] phi()
[85] phi()
to:cls::@1
cls::@1: scope:[cls] from cls cls::@1
[81] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen#0 cls::@1/(byte*) cls::sc#1 )
[82] *((byte*) cls::sc#2) ← (byte) ' '
[83] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2
[84] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1
[86] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen#0 cls::@1/(byte*) cls::sc#1 )
[87] *((byte*) cls::sc#2) ← (byte) ' '
[88] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2
[89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1
to:cls::@return
cls::@return: scope:[cls] from cls::@1
[85] return
[90] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,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 ZP_BYTE:15 1.8333333333333333
(byte) main::time_start#0 time_start zp ZP_BYTE:15 1.2941176470588236
(byte*) raster
(const byte*) raster#0 raster = (byte*) 53266
(void()) utoa10w((word) utoa10w::value , (byte*) utoa10w::dst)
@ -110,7 +110,12 @@
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#5 dst zp ZP_WORD:10 0.07407407407407407
(byte*) utoa16w::dst#0 dst zp ZP_WORD:10 22.0
(byte*) utoa16w::dst#1 dst zp ZP_WORD:10 22.0
(byte*) utoa16w::dst#2 dst zp ZP_WORD:10 22.0
(byte*) utoa16w::dst#3 dst zp ZP_WORD:10 22.0
(byte*) utoa16w::dst#4 dst zp ZP_WORD:10 22.0
(byte*) utoa16w::dst#5 dst zp ZP_WORD:10 2.1111111111111107
(byte) utoa16w::started
(byte) utoa16w::started#1 reg byte x 1.3333333333333333
(byte) utoa16w::started#2 reg byte x 1.3333333333333333
@ -124,7 +129,7 @@ zp ZP_BYTE:4 [ utoa10w::digit#3 utoa10w::digit#7 utoa10w::digit#1 ]
zp ZP_BYTE:5 [ utoa10w::bStarted#2 ]
zp ZP_WORD:6 [ utoa10w::dst#7 utoa10w::dst#11 utoa10w::dst#4 utoa10w::dst#1 utoa10w::dst#2 ]
zp ZP_WORD:8 [ utoa16w::value#5 ]
zp ZP_WORD:10 [ utoa16w::dst#5 ]
zp ZP_WORD:10 [ 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 ZP_WORD:12 [ cls::sc#2 cls::sc#1 ]

View File

@ -1,3 +1,5 @@
Setting inferred volatile on symbol affected by address-of (byte*~) main::$0 ← & (byte) main::ub
Setting inferred volatile on symbol affected by address-of (signed byte*~) main::$3 ← & (signed byte) main::sb
Adding pointer type conversion cast (byte*) main::ub_screen in (byte*) main::ub_screen ← (number) $400
Adding pointer type conversion cast (signed byte*) main::sb_screen in (signed byte*) main::sb_screen ← (number) $428
@ -80,16 +82,18 @@ Finalized unsigned number type (byte) $ff
Finalized signed number type (signed byte) 1
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)(signed byte) main::sb#0 = (signed byte~) main::$2
Alias (signed byte*) main::sb_ptr#0 = (signed byte*~) main::$1
Alias (signed byte) main::sb#0 = (signed byte~) main::$2
Alias (byte*) main::ub_ptr#0 = (byte*~) main::$4
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)(signed byte) main::sb#0 = (signed byte~) main::$2
Constant right-side identified [2] (byte*~) main::$0 ← & (byte) main::ub#0
Constant right-side identified [10] (signed byte*~) main::$3 ← & (signed byte) main::sb#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::ub_screen#0 = (byte*) 1024
Constant (const byte*) main::$0 = &main::ub#0
Constant (const signed byte*) main::sb_screen#0 = (signed byte*) 1064
Constant (const signed byte) main::$2 = $7f
Constant (const signed byte*) main::$3 = &main::sb#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (signed byte*)main::$0 in [3] (signed byte*) main::sb_ptr#0 ← (signed byte*)(const byte*) main::$0
@ -99,6 +103,7 @@ Constant (const signed byte*) main::sb_ptr#0 = (signed byte*)main::$0
Constant (const byte*) main::ub_ptr#0 = (byte*)main::$3
Successful SSA optimization Pass2ConstantIdentification
Constant inlined main::$3 = &(signed byte) main::sb#0
Constant inlined main::$2 = (signed byte) $7f
Constant inlined main::$0 = &(byte) main::ub#0
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @begin
@ -150,8 +155,6 @@ VARIABLE REGISTER WEIGHTS
(byte*) main::ub_screen
Initial phi equivalence classes
Added variable main::ub#0 to zero page equivalence class [ main::ub#0 ]
Added variable main::sb#0 to zero page equivalence class [ main::sb#0 ]
Complete equivalence classes
[ main::ub#0 ]
[ main::sb#0 ]

View File

@ -1,3 +1,5 @@
Setting inferred volatile on symbol affected by address-of (byte*~) main::$0 ← & (byte) main::b
Setting inferred volatile on symbol affected by address-of (byte**~) main::$1 ← & (byte*) main::pb
Adding pointer type conversion cast (byte*) main::SCREEN in (byte*) main::SCREEN ← (number) $400
CONTROL FLOW GRAPH SSA
@ -44,15 +46,19 @@ Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Alias (byte*) main::pb#0 = (byte*~) main::$0
Alias candidate removed (volatile)(byte*) main::pb#0 = (byte*~) main::$0
Alias (byte**) main::ppb#0 = (byte**~) main::$1
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [2] (byte*) main::pb#0 ← & (byte) main::b#0
Alias candidate removed (volatile)(byte*) main::pb#0 = (byte*~) main::$0
Constant right-side identified [2] (byte*~) main::$0 ← & (byte) main::b#0
Constant right-side identified [4] (byte**) main::ppb#0 ← & (byte*) main::pb#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Constant (const byte*) main::$0 = &main::b#0
Constant (const byte**) main::ppb#0 = &main::pb#0
Successful SSA optimization Pass2ConstantIdentification
Constant inlined main::$0 = &(byte) main::b#0
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
@ -97,8 +103,6 @@ VARIABLE REGISTER WEIGHTS
(byte**) main::ppb
Initial phi equivalence classes
Added variable main::b#0 to zero page equivalence class [ main::b#0 ]
Added variable main::pb#0 to zero page equivalence class [ main::pb#0 ]
Complete equivalence classes
[ main::b#0 ]
[ main::pb#0 ]

View File

@ -4,17 +4,18 @@
.pc = $80d "Program"
.label textid = 4
main: {
.label screen = 5
.label text = 2
ldx #0
.label screen = 5
lda #<0
sta text
sta text+1
tax
lda #<$400
sta screen
lda #>$400
sta screen+1
txa
sta textid
sta text
sta text+1
b1:
jsr nexttext
b2:

View File

@ -8,13 +8,13 @@
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[4] (byte*) main::text#0 ← (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*) 0 main::@4/(byte*) main::text#3 )
[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

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (byte**~) main::$0 ← & (byte*) main::text
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
@ -231,7 +232,6 @@ Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [5] (byte**) nexttext::textp#0 ← & (byte*) main::text#2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#0 = (byte*) 1024
Constant (const byte*) main::text#0 = (byte*) 0
Constant (const byte) main::i#0 = 0
Constant (const byte**) nexttext::textp#0 = &main::text#2
Constant (const byte[]) text1#0 = $0
@ -247,12 +247,10 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $15
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte*) main::screen#0
Inlining constant with var siblings (const byte*) main::text#0
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) textid#15
Constant inlined main::screen#0 = (byte*) 1024
Constant inlined main::i#0 = (byte) 0
Constant inlined main::text#0 = (byte*) 0
Constant inlined textid#15 = (byte) 0
Constant inlined $0 = (const byte[]) text1#0
Constant inlined $1 = (const byte[]) text2#0
@ -263,20 +261,20 @@ Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:3
Calls in [main] to nexttext:8
Calls in [main] to nexttext:9
Created 6 initial phi equivalence classes
Coalesced [9] main::text#9 ← main::text#2
Coalesced [10] main::screen#9 ← main::screen#4
Coalesced (already) [16] main::text#7 ← main::text#3
Coalesced [17] textid#19 ← textid#13
Coalesced (already) [18] main::screen#7 ← main::screen#2
Coalesced [19] main::i#7 ← main::i#1
Coalesced [23] main::text#8 ← main::text#1
Coalesced [24] main::screen#8 ← main::screen#1
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
Culled Empty Block (label) @1
Culled Empty Block (label) @3
@ -287,7 +285,6 @@ Renumbering block nexttext::@3 to nexttext::@2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
@ -300,13 +297,13 @@ FINAL CONTROL FLOW GRAPH
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[4] (byte*) main::text#0 ← (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*) 0 main::@4/(byte*) main::text#3 )
[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
@ -352,8 +349,9 @@ VARIABLE REGISTER WEIGHTS
(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 11.0
(byte*) main::text#2 12.0
(byte*) main::text#3 70.99999999999999
(void()) nexttext((byte**) nexttext::textp)
(byte~) nexttext::$0 2.0
@ -365,18 +363,18 @@ VARIABLE REGISTER WEIGHTS
(byte) textid#13 1.0
Initial phi equivalence classes
[ main::text#2 main::text#3 main::text#1 ]
[ 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 nexttext::$0 to zero page equivalence class [ nexttext::$0 ]
Complete equivalence classes
[ main::text#2 main::text#3 main::text#1 ]
[ 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 ]
[ nexttext::$0 ]
Allocated zp ZP_WORD:2 [ main::text#2 main::text#3 main::text#1 ]
Allocated zp ZP_WORD:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ]
Allocated zp ZP_BYTE:4 [ textid#11 textid#13 ]
Allocated zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ]
Allocated zp ZP_BYTE:7 [ main::i#5 main::i#1 ]
@ -399,19 +397,22 @@ b1_from_bbegin:
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
//SEG8 @end
bend:
//SEG10 main
//SEG9 main
main: {
.label screen = 5
.label text = 2
.label screen = 5
.label i = 7
//SEG10 [4] (byte*) main::text#0 ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta text
lda #>0
sta text+1
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#5 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
@ -425,11 +426,7 @@ main: {
//SEG14 [5] phi (byte) textid#11 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #0
sta textid
//SEG15 [5] phi (byte*) main::text#2 = (byte*) 0 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<0
sta text
lda #>0
sta text+1
//SEG15 [5] phi (byte*) main::text#2 = (byte*) main::text#0 [phi:main->main::@1#3] -- register_copy
jmp b1
//SEG16 [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
b1_from_b4:
@ -529,6 +526,7 @@ nexttext: {
text2: .text "rex @"
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*) main::text#3)!=(byte) '@') 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 ZP_BYTE:7 [ main::i#5 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ main::i#5 main::i#1 ]
@ -538,27 +536,28 @@ Statement [12] *((byte*) main::screen#2) ← *((byte*) main::text#3) [ main::i#5
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#0 [ 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#0 [ 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*) main::text#3)!=(byte) '@') 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#0 [ 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#0 [ 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 ZP_WORD:2 [ main::text#2 main::text#3 main::text#1 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_BYTE:4 [ textid#11 textid#13 ] : zp ZP_BYTE:4 , reg byte x ,
Potential registers zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ] : zp ZP_WORD:5 ,
Potential registers zp ZP_BYTE:7 [ main::i#5 main::i#1 ] : zp ZP_BYTE:7 , reg byte x ,
Potential registers zp ZP_BYTE:8 [ nexttext::$0 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 284: zp ZP_WORD:2 [ main::text#2 main::text#3 main::text#1 ] 177: zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ] 19.64: zp ZP_BYTE:7 [ main::i#5 main::i#1 ]
Uplift Scope [main] 289: zp ZP_WORD:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ] 177: zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ] 19.64: zp ZP_BYTE:7 [ main::i#5 main::i#1 ]
Uplift Scope [] 8.5: zp ZP_BYTE:4 [ textid#11 textid#13 ]
Uplift Scope [nexttext] 2: zp ZP_BYTE:8 [ nexttext::$0 ]
Uplifting [main] best 6712 combination zp ZP_WORD:2 [ main::text#2 main::text#3 main::text#1 ] zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ] reg byte x [ main::i#5 main::i#1 ]
Uplifting [] best 6712 combination zp ZP_BYTE:4 [ textid#11 textid#13 ]
Uplifting [nexttext] best 6706 combination reg byte a [ nexttext::$0 ]
Uplifting [main] best 6622 combination zp ZP_WORD:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ] zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ] reg byte x [ main::i#5 main::i#1 ]
Uplifting [] best 6622 combination zp ZP_BYTE:4 [ textid#11 textid#13 ]
Uplifting [nexttext] best 6616 combination reg byte a [ nexttext::$0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:4 [ textid#11 textid#13 ]
Uplifting [] best 6706 combination zp ZP_BYTE:4 [ textid#11 textid#13 ]
Uplifting [] best 6616 combination zp ZP_BYTE:4 [ textid#11 textid#13 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
@ -577,18 +576,21 @@ b1_from_bbegin:
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
//SEG8 @end
bend:
//SEG10 main
//SEG9 main
main: {
.label screen = 5
.label text = 2
.label screen = 5
//SEG10 [4] (byte*) main::text#0 ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta text
lda #>0
sta text+1
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#5 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
@ -601,11 +603,7 @@ main: {
//SEG14 [5] phi (byte) textid#11 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #0
sta textid
//SEG15 [5] phi (byte*) main::text#2 = (byte*) 0 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<0
sta text
lda #>0
sta text+1
//SEG15 [5] phi (byte*) main::text#2 = (byte*) main::text#0 [phi:main->main::@1#3] -- register_copy
jmp b1
//SEG16 [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
b1_from_b4:
@ -710,16 +708,14 @@ Removing instruction jmp breturn
Removing instruction jmp b2
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction lda #0 with TXA
Removing instruction lda #<0
Removing instruction lda #>0
Replacing instruction lda #0 with TXA
Removing instruction ldy #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b1_from_b4 with b1
Replacing label b2_from_b3 with b2
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_b4:
Removing instruction b2_from_b1:
@ -738,6 +734,7 @@ Replacing jump to rts with rts in jmp breturn
Succesful ASM optimization Pass5DoubleJumpElimination
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction ldx #0 with TAX
Removing instruction bbegin:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
@ -760,8 +757,9 @@ FINAL SYMBOL TABLE
(byte*) main::screen#2 screen zp ZP_WORD:5 65.0
(byte*) main::screen#4 screen zp ZP_WORD:5 11.0
(byte*) main::text
(byte*) main::text#0 text zp ZP_WORD:2 4.0
(byte*) main::text#1 text zp ZP_WORD:2 202.0
(byte*) main::text#2 text zp ZP_WORD:2 11.0
(byte*) main::text#2 text zp ZP_WORD:2 12.0
(byte*) main::text#3 text zp ZP_WORD:2 70.99999999999999
(void()) nexttext((byte**) nexttext::textp)
(byte~) nexttext::$0 reg byte a 2.0
@ -778,7 +776,7 @@ FINAL SYMBOL TABLE
(byte) textid#11 textid zp ZP_BYTE:4 7.5
(byte) textid#13 textid zp ZP_BYTE:4 1.0
zp ZP_WORD:2 [ main::text#2 main::text#3 main::text#1 ]
zp ZP_WORD:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ]
zp ZP_BYTE:4 [ textid#11 textid#13 ]
zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ]
reg byte x [ main::i#5 main::i#1 ]
@ -786,7 +784,7 @@ reg byte a [ nexttext::$0 ]
FINAL ASSEMBLER
Score: 5761
Score: 5709
//SEG0 File Comments
// Tests pointer to pointer in a more complex setup
@ -800,16 +798,19 @@ Score: 5761
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG9 @end
//SEG10 main
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
//SEG8 @end
//SEG9 main
main: {
.label screen = 5
.label text = 2
.label screen = 5
//SEG10 [4] (byte*) main::text#0 ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta text
sta text+1
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::i#5 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
tax
//SEG13 [5] phi (byte*) main::screen#4 = (byte*) 1024 [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<$400
sta screen
@ -818,9 +819,7 @@ main: {
//SEG14 [5] phi (byte) textid#11 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
txa
sta textid
//SEG15 [5] phi (byte*) main::text#2 = (byte*) 0 [phi:main->main::@1#3] -- pbuz1=pbuc1
sta text
sta text+1
//SEG15 [5] phi (byte*) main::text#2 = (byte*) main::text#0 [phi:main->main::@1#3] -- register_copy
//SEG16 [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
//SEG17 [5] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@4->main::@1#0] -- register_copy
//SEG18 [5] phi (byte*) main::screen#4 = (byte*) main::screen#2 [phi:main::@4->main::@1#1] -- register_copy

View File

@ -15,8 +15,9 @@
(byte*) main::screen#2 screen zp ZP_WORD:5 65.0
(byte*) main::screen#4 screen zp ZP_WORD:5 11.0
(byte*) main::text
(byte*) main::text#0 text zp ZP_WORD:2 4.0
(byte*) main::text#1 text zp ZP_WORD:2 202.0
(byte*) main::text#2 text zp ZP_WORD:2 11.0
(byte*) main::text#2 text zp ZP_WORD:2 12.0
(byte*) main::text#3 text zp ZP_WORD:2 70.99999999999999
(void()) nexttext((byte**) nexttext::textp)
(byte~) nexttext::$0 reg byte a 2.0
@ -33,7 +34,7 @@
(byte) textid#11 textid zp ZP_BYTE:4 7.5
(byte) textid#13 textid zp ZP_BYTE:4 1.0
zp ZP_WORD:2 [ main::text#2 main::text#3 main::text#1 ]
zp ZP_WORD:2 [ main::text#2 main::text#0 main::text#3 main::text#1 ]
zp ZP_BYTE:4 [ textid#11 textid#13 ]
zp ZP_WORD:5 [ main::screen#4 main::screen#2 main::screen#1 ]
reg byte x [ main::i#5 main::i#1 ]

View File

@ -1,3 +1,5 @@
Setting inferred volatile on symbol affected by address-of (byte**~) main::$0 ← & (byte*) screen
Setting inferred volatile on symbol affected by address-of (byte**~) main::$2 ← & (byte*) screen
Adding pointer type conversion cast (byte*) screen in (byte*) screen ← (number) $400
Adding pointer type conversion cast (byte*) screen1 in (byte*) screen1 ← (number) $400
Adding pointer type conversion cast (byte*) screen2 in (byte*) screen2 ← (number~) $0
@ -207,7 +209,6 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ setscreen::val#2 ]
Added variable screen#0 to zero page equivalence class [ screen#0 ]
Complete equivalence classes
[ setscreen::val#2 ]
[ screen#0 ]

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (byte**~) main::$0 ← & (byte*) main::screen
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
CONTROL FLOW GRAPH SSA
@ -86,7 +87,6 @@ VARIABLE REGISTER WEIGHTS
(byte*) main::screen#0 20.0
Initial phi equivalence classes
Added variable main::screen#0 to zero page equivalence class [ main::screen#0 ]
Complete equivalence classes
[ main::screen#0 ]
Allocated zp ZP_WORD:2 [ main::screen#0 ]

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (byte**~) main::$0 ← & (byte*) main::screen
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Culled Empty Block (label) @1
@ -154,7 +155,6 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ sub::ch#2 ]
Added variable main::screen#0 to zero page equivalence class [ main::screen#0 ]
Complete equivalence classes
[ sub::ch#2 ]
[ main::screen#0 ]

View File

@ -1,3 +1,5 @@
Setting inferred volatile on symbol affected by address-of (byte**~) main::$0 ← & (byte*) main::screen
Setting inferred volatile on symbol affected by address-of (byte**~) main::$2 ← & (byte*) main::screen
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Culled Empty Block (label) @1
@ -153,7 +155,6 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ sub::ch#2 ]
Added variable main::screen#0 to zero page equivalence class [ main::screen#0 ]
Complete equivalence classes
[ sub::ch#2 ]
[ main::screen#0 ]

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (word*~) main::$0 ← & (word) main::w
Resolving sizeof() (byte~) main::$3 ← sizeof (byte) main::idx
Resolving sizeof() (byte~) main::$5 ← sizeof (byte) main::b
Resolving sizeof() (byte~) main::$8 ← sizeof (number~) main::$7

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (word*~) main::$0 ← & (word) main::p
Identified literal word (word) { 2, 3 } in (word) main::p ← { (number) 2, (number) 3 }
Adding pointer type conversion cast (byte*) main::SCREEN in (byte*) main::SCREEN ← (number) $400
@ -57,10 +58,11 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (word) main::p#0 = (word~) main::$3
Alias candidate removed (volatile)(word) main::p#0 = (word~) main::$3
Alias (word*) main::q#0 = (word*~) main::$0
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [0] (word) main::p#0 ← (byte) 2 w= (byte) 3
Alias candidate removed (volatile)(word) main::p#0 = (word~) main::$3
Constant right-side identified [0] (word~) main::$3 ← (byte) 2 w= (byte) 3
Constant right-side identified [2] (word*) main::q#0 ← & (word) main::p#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word*) main::q#0 = &main::p#0
@ -68,11 +70,11 @@ Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::SCREEN#0 in [6] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte~) main::$1
Successful SSA optimization PassNSimplifyExpressionWithZero
Adding number conversion cast (unumber) 2*$100+3 in (word) main::p#0 ← (byte) 2*(number) $100+(byte) 3
Adding number conversion cast (unumber) 2*$100 in (word) main::p#0 ← ((unumber)) (byte) 2*(number) $100+(byte) 3
Adding number conversion cast (unumber) $100 in (word) main::p#0 ← ((unumber)) (unumber)(byte) 2*(number) $100+(byte) 3
Adding number conversion cast (unumber) 2*$100+3 in (word~) main::$3 ← (byte) 2*(number) $100+(byte) 3
Adding number conversion cast (unumber) 2*$100 in (word~) main::$3 ← ((unumber)) (byte) 2*(number) $100+(byte) 3
Adding number conversion cast (unumber) $100 in (word~) main::$3 ← ((unumber)) (unumber)(byte) 2*(number) $100+(byte) 3
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (word) main::p#0 ← (unumber)(unumber)(byte) 2*(unumber)(number) $100+(byte) 3
Inlining cast (word~) main::$3 ← (unumber)(unumber)(byte) 2*(unumber)(number) $100+(byte) 3
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast (unumber)(byte) 2*(unumber)(number) $100+(byte) 3
Simplifying constant integer cast (byte) 2*(unumber)(number) $100
@ -80,6 +82,11 @@ Simplifying constant integer cast $100
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $100
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)(word) main::p#0 = (word~) main::$3
Constant (const word) main::$3 = 2*$100+3
Successful SSA optimization Pass2ConstantIdentification
Constant inlined main::$3 = (byte) 2*(word) $100+(byte) 3
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN#0+1)
Successful SSA optimization Pass2ConstantAdditionElimination
Adding NOP phi() at start of @begin
@ -128,7 +135,6 @@ VARIABLE REGISTER WEIGHTS
(word*) main::q
Initial phi equivalence classes
Added variable main::p#0 to zero page equivalence class [ main::p#0 ]
Added variable main::$1 to zero page equivalence class [ main::$1 ]
Added variable main::$2 to zero page equivalence class [ main::$2 ]
Complete equivalence classes

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (struct Point*~) main::$0 ← & (struct Point) main::p
Created struct value member variable (byte) main::p_x
Created struct value member variable (byte) main::p_y
Converted struct value to member variables (struct Point) main::p

View File

@ -1,3 +1,4 @@
Setting inferred volatile on symbol affected by address-of (struct Point*~) main::$0 ← & (struct Point) main::p
Created struct value member variable (byte) main::p_x
Created struct value member variable (byte) main::p_y
Converted struct value to member variables (struct Point) main::p