mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-08 14:37:40 +00:00
Aligned hardcoded address register implementation between memory registers and zp registers.
This commit is contained in:
parent
93456f0eb0
commit
71ce3d0438
@ -106,12 +106,12 @@ public class AsmFragmentTemplate {
|
||||
Variable v4 = new Variable("m4", scope, SymbolType.BYTE, null, SymbolVariable.StorageStrategy.LOAD_STORE, SymbolVariable.MemoryArea.MAIN_MEMORY);
|
||||
Variable v5 = new Variable("m5", scope, SymbolType.BYTE, null, SymbolVariable.StorageStrategy.LOAD_STORE, SymbolVariable.MemoryArea.MAIN_MEMORY);
|
||||
Variable v6 = new Variable("m6", scope, SymbolType.BYTE, null, SymbolVariable.StorageStrategy.LOAD_STORE, SymbolVariable.MemoryArea.MAIN_MEMORY);
|
||||
v1.setAllocation(new Registers.RegisterMainMem(v1.getRef(), 1));
|
||||
v2.setAllocation(new Registers.RegisterMainMem(v2.getRef(), 1));
|
||||
v3.setAllocation(new Registers.RegisterMainMem(v3.getRef(), 1));
|
||||
v4.setAllocation(new Registers.RegisterMainMem(v4.getRef(), 1));
|
||||
v5.setAllocation(new Registers.RegisterMainMem(v5.getRef(), 1));
|
||||
v6.setAllocation(new Registers.RegisterMainMem(v6.getRef(), 1));
|
||||
v1.setAllocation(new Registers.RegisterMainMem(v1.getRef(), 1, null));
|
||||
v2.setAllocation(new Registers.RegisterMainMem(v2.getRef(), 1, null));
|
||||
v3.setAllocation(new Registers.RegisterMainMem(v3.getRef(), 1, null));
|
||||
v4.setAllocation(new Registers.RegisterMainMem(v4.getRef(), 1, null));
|
||||
v5.setAllocation(new Registers.RegisterMainMem(v5.getRef(), 1, null));
|
||||
v6.setAllocation(new Registers.RegisterMainMem(v6.getRef(), 1, null));
|
||||
if(signature.contains("m1")) bindings.put("m1", v1);
|
||||
if(signature.contains("m2")) bindings.put("m2", v2);
|
||||
if(signature.contains("m3")) bindings.put("m3", v3);
|
||||
|
@ -7,6 +7,7 @@ import dk.camelot64.kickc.model.types.SymbolTypeArray;
|
||||
import dk.camelot64.kickc.model.types.SymbolTypePointer;
|
||||
import dk.camelot64.kickc.model.types.SymbolTypeStruct;
|
||||
import dk.camelot64.kickc.model.values.ScopeRef;
|
||||
import dk.camelot64.kickc.model.values.VariableRef;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -185,14 +186,11 @@ public class DirectiveParserContext {
|
||||
lValue.setMemoryArea(memoryAreaDirective.memoryArea);
|
||||
if(memoryAreaDirective.address != null) {
|
||||
if(SymbolVariable.MemoryArea.ZEROPAGE_MEMORY.equals(memoryAreaDirective.memoryArea)) {
|
||||
// Allocate to specific address
|
||||
if(memoryAreaDirective.address > 255) {
|
||||
throw new CompileError("Error! Address not on zeropage " + memoryAreaDirective.address, source);
|
||||
}
|
||||
Registers.Register register = new Registers.RegisterZpMem(memoryAreaDirective.address.intValue(), -1, true);
|
||||
lValue.setDeclaredRegister(register);
|
||||
} else {
|
||||
lValue.setDeclaredMemoryAddress(memoryAreaDirective.address);
|
||||
Registers.Register register = new Registers.RegisterMainMem((VariableRef)lValue.getRef(), -1, memoryAreaDirective.address);
|
||||
lValue.setDeclaredRegister(register);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,9 +70,13 @@ public class Registers {
|
||||
|
||||
private int bytes;
|
||||
|
||||
public RegisterMainMem(VariableRef variableRef, int bytes) {
|
||||
/** If the address is hardcoded this contains it. */
|
||||
private Long address;
|
||||
|
||||
public RegisterMainMem(VariableRef variableRef, int bytes, Long address) {
|
||||
this.variableRef = variableRef;
|
||||
this.bytes = bytes;
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public VariableRef getVariableRef() {
|
||||
@ -84,6 +88,10 @@ public class Registers {
|
||||
return RegisterType.MAIN_MEM;
|
||||
}
|
||||
|
||||
public Long getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMem() {
|
||||
return true;
|
||||
@ -96,12 +104,12 @@ public class Registers {
|
||||
|
||||
@Override
|
||||
public boolean isNonRelocatable() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "mem[" + getBytes() + "]:" + variableRef.toString();
|
||||
return "mem[" + getBytes() + "]" + ((address==null)?"":(":"+address));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -114,31 +122,33 @@ public class Registers {
|
||||
if(this == o) return true;
|
||||
if(o == null || getClass() != o.getClass()) return false;
|
||||
RegisterMainMem that = (RegisterMainMem) o;
|
||||
return Objects.equals(variableRef, that.variableRef);
|
||||
return bytes == that.bytes &&
|
||||
Objects.equals(variableRef, that.variableRef) &&
|
||||
Objects.equals(address, that.address);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(variableRef);
|
||||
return Objects.hash(variableRef, bytes, address);
|
||||
}
|
||||
}
|
||||
|
||||
/** Two zero page addresses used as a register for a single unsigned word variable. */
|
||||
public static class RegisterZpMem implements Register {
|
||||
|
||||
/** The ZP address used for the byte. */
|
||||
private int zp;
|
||||
|
||||
/** The number of bytes that the register takes up */
|
||||
private int bytes;
|
||||
|
||||
/** True if the address of the register is delcared in the code (non-relocatable) */
|
||||
private boolean isNonRelocatable;
|
||||
/** The ZP address used for the byte. */
|
||||
private int zp;
|
||||
|
||||
public RegisterZpMem(int zp, int bytes, boolean isNonRelocatable) {
|
||||
/** True if the address of the register is declared in the code (non-relocatable) */
|
||||
private boolean nonRelocatable;
|
||||
|
||||
public RegisterZpMem(int zp, int bytes, boolean nonRelocatable) {
|
||||
this.zp = zp;
|
||||
this.bytes = bytes;
|
||||
this.isNonRelocatable = isNonRelocatable;
|
||||
this.nonRelocatable = nonRelocatable;
|
||||
}
|
||||
|
||||
public RegisterZpMem(int zp, int bytes) {
|
||||
@ -164,7 +174,7 @@ public class Registers {
|
||||
}
|
||||
|
||||
public boolean isNonRelocatable() {
|
||||
return isNonRelocatable;
|
||||
return nonRelocatable;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -184,12 +194,12 @@ public class Registers {
|
||||
RegisterZpMem that = (RegisterZpMem) o;
|
||||
return zp == that.zp &&
|
||||
bytes == that.bytes &&
|
||||
isNonRelocatable == that.isNonRelocatable;
|
||||
nonRelocatable == that.nonRelocatable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(zp, bytes, isNonRelocatable);
|
||||
return Objects.hash(zp, bytes, nonRelocatable);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,9 +50,6 @@ public abstract class SymbolVariable implements Symbol {
|
||||
/** Specifies that the variable must live in memory. */
|
||||
private boolean declaredAsNotRegister;
|
||||
|
||||
/** Specifies a specific address where the variable must reside in memory. */
|
||||
private Long declaredMemoryAddress;
|
||||
|
||||
/** Strategy being used for storing and accessing the variable. The value depends on the directives memory/register/volatile/const - and on the compilers optimization decisions.
|
||||
* <ul>
|
||||
* <li>PHI variables are turned into versions and PHI-nodes are used for them throughout the entire program. They cannot be "volatile" and the "address-of" operator cannot be used on them.</li>
|
||||
@ -236,14 +233,6 @@ public abstract class SymbolVariable implements Symbol {
|
||||
this.declaredAsNotRegister = declaredAsMemory;
|
||||
}
|
||||
|
||||
public Long getDeclaredMemoryAddress() {
|
||||
return declaredMemoryAddress;
|
||||
}
|
||||
|
||||
public void setDeclaredMemoryAddress(Long declaredMemoryAddress) {
|
||||
this.declaredMemoryAddress = declaredMemoryAddress;
|
||||
}
|
||||
|
||||
public StorageStrategy getStorageStrategy() {
|
||||
return storageStrategy;
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ public class Variable extends SymbolVariable {
|
||||
this.setDeclaredAsRegister(phiMaster.isDeclaredAsRegister());
|
||||
this.setDeclaredNotRegister(phiMaster.isDeclaredAsNotRegister());
|
||||
this.setDeclaredRegister(phiMaster.getDeclaredRegister());
|
||||
this.setDeclaredMemoryAddress(phiMaster.getDeclaredMemoryAddress());
|
||||
this.setDeclaredVolatile(phiMaster.isDeclaredVolatile());
|
||||
this.setDeclaredExport(phiMaster.isDeclaredExport());
|
||||
this.setInferedVolatile(phiMaster.isInferedVolatile());
|
||||
|
@ -804,7 +804,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
try {
|
||||
ConstantInteger memoryAddress = NumberParser.parseIntegerLiteral(ctx.NUMBER().getText());
|
||||
Long address = memoryAddress.getInteger();
|
||||
SymbolVariable.MemoryArea memoryArea = (address<0x100)? SymbolVariable.MemoryArea.ZEROPAGE_MEMORY : SymbolVariable.MemoryArea.MAIN_MEMORY;
|
||||
SymbolVariable.MemoryArea memoryArea = (address < 0x100) ? SymbolVariable.MemoryArea.ZEROPAGE_MEMORY : SymbolVariable.MemoryArea.MAIN_MEMORY;
|
||||
return new Directive.MemoryArea(memoryArea, address);
|
||||
} catch(NumberFormatException e) {
|
||||
throw new CompileError(e.getMessage(), new StatementSource(ctx));
|
||||
@ -1314,7 +1314,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
CharStream stream = tokenStart.getInputStream();
|
||||
int startIndex = tokenStart.getStartIndex();
|
||||
int stopIndex = tokenStop.getStopIndex();
|
||||
if(stopIndex<startIndex)
|
||||
if(stopIndex < startIndex)
|
||||
return "";
|
||||
Interval interval = new Interval(startIndex, stopIndex);
|
||||
return stream.getText(interval);
|
||||
@ -2152,7 +2152,6 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static class PrePostModifierHandler extends KickCParserBaseVisitor<Void> {
|
||||
|
||||
private List<PrePostModifier> postMods;
|
||||
|
@ -307,7 +307,6 @@ public class Pass1ProcedureInline extends Pass1Base {
|
||||
inlineVar.setDeclaredAsRegister(procVar.isDeclaredAsRegister());
|
||||
inlineVar.setDeclaredNotRegister(procVar.isDeclaredAsNotRegister());
|
||||
inlineVar.setDeclaredRegister(procVar.getDeclaredRegister());
|
||||
inlineVar.setDeclaredMemoryAddress(procVar.getDeclaredMemoryAddress());
|
||||
inlineVar.setStorageStrategy(procVar.getStorageStrategy());
|
||||
inlineVar.setMemoryArea(procVar.getMemoryArea());
|
||||
inlineVar.setDeclaredVolatile(procVar.isDeclaredVolatile());
|
||||
|
@ -84,7 +84,6 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization {
|
||||
constantVar.setDeclaredAsRegister(variable.isDeclaredAsRegister());
|
||||
constantVar.setDeclaredRegister(variable.getDeclaredRegister());
|
||||
constantVar.setDeclaredNotRegister(variable.isDeclaredAsNotRegister());
|
||||
constantVar.setDeclaredMemoryAddress(variable.getDeclaredMemoryAddress());
|
||||
constantVar.setDeclaredExport(variable.isDeclaredExport());
|
||||
if(variable.getComments().size() > 0) {
|
||||
constantVar.setComments(variable.getComments());
|
||||
|
@ -438,13 +438,14 @@ public class Pass4CodeGeneration {
|
||||
asm.addLabelDecl(AsmFormat.asmFix(asmName), AsmFormat.getAsmNumber(registerZp.getZp()));
|
||||
added.add(asmName);
|
||||
}
|
||||
} else if(Registers.RegisterType.MAIN_MEM.equals(register.getType()) && scopeVar.getDeclaredMemoryAddress() != null) {
|
||||
} else if(Registers.RegisterType.MAIN_MEM.equals(register.getType()) && ((Registers.RegisterMainMem) register).getAddress() != null) {
|
||||
String asmName = scopeVar.getAsmName();
|
||||
if(asmName != null && !added.contains(asmName)) {
|
||||
// Add any comments
|
||||
generateComments(asm, scopeVar.getComments());
|
||||
// Add the label declaration
|
||||
asm.addLabelDecl(AsmFormat.asmFix(asmName), AsmFormat.getAsmNumber(scopeVar.getDeclaredMemoryAddress()));
|
||||
Long address = ((Registers.RegisterMainMem) register).getAddress();
|
||||
asm.addLabelDecl(AsmFormat.asmFix(asmName), AsmFormat.getAsmNumber(address));
|
||||
added.add(asmName);
|
||||
}
|
||||
}
|
||||
@ -504,17 +505,17 @@ public class Pass4CodeGeneration {
|
||||
continue;
|
||||
}
|
||||
if(variable.isStorageLoadStore() || variable.isStoragePhiVersion() || variable.isStorageIntermediate()) {
|
||||
if(variable.getDeclaredMemoryAddress() == null) {
|
||||
Registers.Register allocation = variable.getAllocation();
|
||||
if(allocation instanceof Registers.RegisterCpuByte)
|
||||
continue;
|
||||
if(!(allocation instanceof Registers.RegisterMainMem)) {
|
||||
throw new InternalError("Expected main memory allocation " + variable.toString(program));
|
||||
}
|
||||
Registers.RegisterMainMem registerMainMem = (Registers.RegisterMainMem) allocation;
|
||||
if(!registerMainMem.getVariableRef().equals(variable.getRef())) {
|
||||
continue;
|
||||
}
|
||||
Registers.Register allocation = variable.getAllocation();
|
||||
if(allocation instanceof Registers.RegisterCpuByte)
|
||||
continue;
|
||||
if(!(allocation instanceof Registers.RegisterMainMem)) {
|
||||
throw new InternalError("Expected main memory allocation " + variable.toString(program));
|
||||
}
|
||||
Registers.RegisterMainMem registerMainMem = (Registers.RegisterMainMem) allocation;
|
||||
if(!registerMainMem.getVariableRef().equals(variable.getRef())) {
|
||||
continue;
|
||||
}
|
||||
if(registerMainMem.getAddress() == null) {
|
||||
// Generate into the data segment
|
||||
// Set segment
|
||||
setCurrentSegment(variable.getDataSegment(), asm);
|
||||
@ -529,11 +530,11 @@ public class Pass4CodeGeneration {
|
||||
AsmDataChunk asmDataChunk = new AsmDataChunk();
|
||||
addChunkData(asmDataChunk, ZeroConstantValues.zeroValue(variable.getType(), getScope()), variable.getType(), scopeRef);
|
||||
asmDataChunk.addToAsm(AsmFormat.asmFix(variable.getAsmName()), asm);
|
||||
added.add(variable.getAsmName());
|
||||
}
|
||||
} else {
|
||||
throw new InternalError("Not handled variable storage " + variable.toString());
|
||||
}
|
||||
added.add(variable.getAsmName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,8 +46,9 @@ public class Pass4RegisterUpliftPotentialInitialize extends Pass2Base {
|
||||
Registers.RegisterZpMem zpRegister = new Registers.RegisterZpMem(zp, bytes, true);
|
||||
registerPotentials.setPotentialRegisters(equivalenceClass, Arrays.asList(zpRegister));
|
||||
} else if(declaredRegister instanceof Registers.RegisterMainMem) {
|
||||
VariableRef variableRef = ((Registers.RegisterMainMem) declaredRegister).getVariableRef();
|
||||
Registers.RegisterMainMem memRegister = new Registers.RegisterMainMem(variableRef, bytes);
|
||||
VariableRef varRef = ((Registers.RegisterMainMem) declaredRegister).getVariableRef();
|
||||
Long address = ((Registers.RegisterMainMem) declaredRegister).getAddress();
|
||||
Registers.RegisterMainMem memRegister = new Registers.RegisterMainMem(varRef, bytes, address);
|
||||
registerPotentials.setPotentialRegisters(equivalenceClass, Arrays.asList(memRegister));
|
||||
} else {
|
||||
registerPotentials.setPotentialRegisters(equivalenceClass, Arrays.asList(declaredRegister));
|
||||
|
@ -60,6 +60,11 @@ public class Pass4RegistersFinalize extends Pass2Base {
|
||||
int zp = ((Registers.RegisterZpMem) declaredRegister).getZp();
|
||||
int bytes = variable.getType().getSizeBytes();
|
||||
register = new Registers.RegisterZpMem(zp, bytes, true);
|
||||
} else if(declaredRegister instanceof Registers.RegisterMainMem) {
|
||||
Long address = ((Registers.RegisterMainMem) declaredRegister).getAddress();
|
||||
VariableRef varRef = ((Registers.RegisterMainMem) declaredRegister).getVariableRef();
|
||||
int bytes = variable.getType().getSizeBytes();
|
||||
register = new Registers.RegisterMainMem(varRef, bytes, address);
|
||||
} else if(equivalenceClass.getRegister()!=null && !declaredRegister.equals(equivalenceClass.getRegister())) {
|
||||
throw new CompileError("Equivalence class has variables with different declared registers \n" +
|
||||
" - equivalence class: " + equivalenceClass.toString(true) + "\n" +
|
||||
@ -167,7 +172,7 @@ public class Pass4RegistersFinalize extends Pass2Base {
|
||||
VariableRef variableRef = equivalenceClass.getVariables().get(0);
|
||||
Variable variable = getProgram().getSymbolInfos().getVariable(variableRef);
|
||||
if(variable.isMemoryAreaMain()) {
|
||||
register = new Registers.RegisterMainMem(variableRef, variable.getType().getSizeBytes());
|
||||
register = new Registers.RegisterMainMem(variableRef, variable.getType().getSizeBytes(), null);
|
||||
} else {
|
||||
register = allocateNewRegisterZp(variable);
|
||||
}
|
||||
|
@ -234,7 +234,6 @@ public class Unroller {
|
||||
newVar.setDeclaredAsRegister(definedVar.isDeclaredAsRegister());
|
||||
newVar.setDeclaredRegister(definedVar.getDeclaredRegister());
|
||||
newVar.setDeclaredNotRegister(definedVar.isDeclaredAsNotRegister());
|
||||
newVar.setDeclaredMemoryAddress(definedVar.getDeclaredMemoryAddress());
|
||||
newVar.setStorageStrategy(definedVar.getStorageStrategy());
|
||||
newVar.setMemoryArea(definedVar.getMemoryArea());
|
||||
newVar.setDeclaredVolatile(definedVar.isDeclaredVolatile());
|
||||
|
@ -122,7 +122,7 @@ Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ idx ]
|
||||
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Allocated mem[1]:idx [ idx ]
|
||||
Allocated mem[1] [ idx ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic / MOS6502X
|
||||
@ -201,16 +201,16 @@ Statement [0] (byte) idx ← (byte) 0 [ idx ] ( [ idx ] ) always clobbers reg b
|
||||
Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) idx [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) idx ← (byte) idx + (byte) main::i#2 [ idx main::i#2 ] ( main:2 [ idx main::i#2 ] ) always clobbers reg byte a
|
||||
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y ,
|
||||
Potential registers mem[1]:idx [ idx ] : mem[1]:idx ,
|
||||
Potential registers mem[1] [ idx ] : mem[1] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 31.17: zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Uplift Scope [] 5: mem[1]:idx [ idx ]
|
||||
Uplift Scope [] 5: mem[1] [ idx ]
|
||||
|
||||
Uplifting [main] best 409 combination reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 409 combination mem[1]:idx [ idx ]
|
||||
Attempting to uplift remaining variables inmem[1]:idx [ idx ]
|
||||
Uplifting [] best 409 combination mem[1]:idx [ idx ]
|
||||
Uplifting [] best 409 combination mem[1] [ idx ]
|
||||
Attempting to uplift remaining variables inmem[1] [ idx ]
|
||||
Uplifting [] best 409 combination mem[1] [ idx ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -302,7 +302,7 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte) idx notregister mem[1]:idx 5.0
|
||||
(byte) idx notregister mem[1] 5.0
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
@ -311,7 +311,7 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[1]:idx [ idx ]
|
||||
mem[1] [ idx ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
|
@ -2,7 +2,7 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte) idx notregister mem[1]:idx 5.0
|
||||
(byte) idx notregister mem[1] 5.0
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
@ -11,4 +11,4 @@
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[1]:idx [ idx ]
|
||||
mem[1] [ idx ]
|
||||
|
@ -143,7 +143,7 @@ Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ idx ]
|
||||
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Allocated mem[1]:idx [ idx ]
|
||||
Allocated mem[1] [ idx ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic / MOS6502X
|
||||
@ -224,16 +224,16 @@ Statement [0] (byte) idx ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte*) idx_p#0) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Statement [7] *((const byte*) idx_p#0) ← *((const byte*) idx_p#0) + (byte) main::i#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y ,
|
||||
Potential registers mem[1]:idx [ idx ] : mem[1]:idx ,
|
||||
Potential registers mem[1] [ idx ] : mem[1] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 31.17: zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Uplift Scope [] 20: mem[1]:idx [ idx ]
|
||||
Uplift Scope [] 20: mem[1] [ idx ]
|
||||
|
||||
Uplifting [main] best 409 combination reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 409 combination mem[1]:idx [ idx ]
|
||||
Attempting to uplift remaining variables inmem[1]:idx [ idx ]
|
||||
Uplifting [] best 409 combination mem[1]:idx [ idx ]
|
||||
Uplifting [] best 409 combination mem[1] [ idx ]
|
||||
Attempting to uplift remaining variables inmem[1] [ idx ]
|
||||
Uplifting [] best 409 combination mem[1] [ idx ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -327,7 +327,7 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte) idx notregister mem[1]:idx 20.0
|
||||
(byte) idx notregister mem[1] 20.0
|
||||
(byte*) idx_p
|
||||
(const byte*) idx_p#0 idx_p = &(byte) idx
|
||||
(void()) main()
|
||||
@ -338,7 +338,7 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[1]:idx [ idx ]
|
||||
mem[1] [ idx ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
|
@ -2,7 +2,7 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte) idx notregister mem[1]:idx 20.0
|
||||
(byte) idx notregister mem[1] 20.0
|
||||
(byte*) idx_p
|
||||
(const byte*) idx_p#0 idx_p = &(byte) idx
|
||||
(void()) main()
|
||||
@ -13,4 +13,4 @@
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[1]:idx [ idx ]
|
||||
mem[1] [ idx ]
|
||||
|
@ -128,7 +128,7 @@ Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ cursor ]
|
||||
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Allocated mem[2]:cursor [ cursor ]
|
||||
Allocated mem[2] [ cursor ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic / MOS6502X
|
||||
@ -218,14 +218,14 @@ Statement [0] (byte*) cursor ← (const byte*) SCREEN [ cursor ] ( [ cursor ] )
|
||||
Statement [6] *((byte*) cursor) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [7] (byte*) cursor ← (byte*) cursor + (byte) $29 [ cursor main::i#2 ] ( main:2 [ cursor main::i#2 ] ) always clobbers reg byte a
|
||||
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x ,
|
||||
Potential registers mem[2]:cursor [ cursor ] : mem[2]:cursor ,
|
||||
Potential registers mem[2] [ cursor ] : mem[2] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 23.83: zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Uplift Scope [] 5: mem[2]:cursor [ cursor ]
|
||||
Uplift Scope [] 5: mem[2] [ cursor ]
|
||||
|
||||
Uplifting [main] best 650 combination reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 650 combination mem[2]:cursor [ cursor ]
|
||||
Uplifting [] best 650 combination mem[2] [ cursor ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -328,7 +328,7 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte*) cursor notregister mem[2]:cursor 5.0
|
||||
(byte*) cursor notregister mem[2] 5.0
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
@ -337,7 +337,7 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::i#2 reg byte x 7.333333333333333
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[2]:cursor [ cursor ]
|
||||
mem[2] [ cursor ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
|
@ -2,7 +2,7 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte*) cursor notregister mem[2]:cursor 5.0
|
||||
(byte*) cursor notregister mem[2] 5.0
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
@ -11,4 +11,4 @@
|
||||
(byte) main::i#2 reg byte x 7.333333333333333
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[2]:cursor [ cursor ]
|
||||
mem[2] [ cursor ]
|
||||
|
@ -159,8 +159,8 @@ Added variable bar_thing2 to zero page equivalence class [ bar_thing2 ]
|
||||
Complete equivalence classes
|
||||
[ bar_thing1 ]
|
||||
[ bar_thing2 ]
|
||||
Allocated mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Allocated mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Allocated mem[1] [ bar_thing1 ]
|
||||
Allocated mem[1] [ bar_thing2 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic / MOS6502X
|
||||
@ -218,21 +218,21 @@ Statement [0] (byte) bar_thing1 ← (byte) 'a' [ ] ( [ ] ) always clobbers reg
|
||||
Statement [1] (byte) bar_thing2 ← (byte) 'b' [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((const byte*) main::SCREEN) ← *((byte*)(const struct foo*) main::barp#0) [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct foo*) main::barp#0+(const byte) OFFSET_STRUCT_FOO_THING2) [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Potential registers mem[1]:bar_thing1 [ bar_thing1 ] : mem[1]:bar_thing1 ,
|
||||
Potential registers mem[1]:bar_thing2 [ bar_thing2 ] : mem[1]:bar_thing2 ,
|
||||
Potential registers mem[1] [ bar_thing1 ] : mem[1] ,
|
||||
Potential registers mem[1] [ bar_thing2 ] : mem[1] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [] 20: mem[1]:bar_thing1 [ bar_thing1 ] 20: mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Uplift Scope [] 20: mem[1] [ bar_thing1 ] 20: mem[1] [ bar_thing2 ]
|
||||
Uplift Scope [foo]
|
||||
Uplift Scope [main]
|
||||
|
||||
Uplifting [] best 49 combination mem[1]:bar_thing1 [ bar_thing1 ] mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Uplifting [] best 49 combination mem[1] [ bar_thing1 ] mem[1] [ bar_thing2 ]
|
||||
Uplifting [foo] best 49 combination
|
||||
Uplifting [main] best 49 combination
|
||||
Attempting to uplift remaining variables inmem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Uplifting [] best 49 combination mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Attempting to uplift remaining variables inmem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Uplifting [] best 49 combination mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Attempting to uplift remaining variables inmem[1] [ bar_thing1 ]
|
||||
Uplifting [] best 49 combination mem[1] [ bar_thing1 ]
|
||||
Attempting to uplift remaining variables inmem[1] [ bar_thing2 ]
|
||||
Uplifting [] best 49 combination mem[1] [ bar_thing2 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -304,8 +304,8 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) OFFSET_STRUCT_FOO_THING2 = (byte) 1
|
||||
(byte) bar_thing1 notregister mem[1]:bar_thing1 20.0
|
||||
(byte) bar_thing2 notregister mem[1]:bar_thing2 20.0
|
||||
(byte) bar_thing1 notregister mem[1] 20.0
|
||||
(byte) bar_thing2 notregister mem[1] 20.0
|
||||
(byte) foo::thing1
|
||||
(byte) foo::thing2
|
||||
(void()) main()
|
||||
@ -315,8 +315,8 @@ FINAL SYMBOL TABLE
|
||||
(const struct foo*) main::barp#0 barp = (struct foo*)&(byte) bar_thing1
|
||||
(byte) main::i
|
||||
|
||||
mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
mem[1] [ bar_thing1 ]
|
||||
mem[1] [ bar_thing2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
|
@ -2,8 +2,8 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) OFFSET_STRUCT_FOO_THING2 = (byte) 1
|
||||
(byte) bar_thing1 notregister mem[1]:bar_thing1 20.0
|
||||
(byte) bar_thing2 notregister mem[1]:bar_thing2 20.0
|
||||
(byte) bar_thing1 notregister mem[1] 20.0
|
||||
(byte) bar_thing2 notregister mem[1] 20.0
|
||||
(byte) foo::thing1
|
||||
(byte) foo::thing2
|
||||
(void()) main()
|
||||
@ -13,5 +13,5 @@
|
||||
(const struct foo*) main::barp#0 barp = (struct foo*)&(byte) bar_thing1
|
||||
(byte) main::i
|
||||
|
||||
mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
mem[1] [ bar_thing1 ]
|
||||
mem[1] [ bar_thing2 ]
|
||||
|
@ -247,8 +247,8 @@ Complete equivalence classes
|
||||
[ bar_thing3 ]
|
||||
Allocated zp[1]:2 [ main::j#2 main::j#1 ]
|
||||
Allocated zp[1]:3 [ main::i#4 main::i#3 ]
|
||||
Allocated mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Allocated mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Allocated mem[1] [ bar_thing1 ]
|
||||
Allocated mem[1] [ bar_thing2 ]
|
||||
Allocated zp[2]:4 [ bar_thing3 ]
|
||||
|
||||
INITIAL ASM
|
||||
@ -359,22 +359,22 @@ Statement [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct
|
||||
Statement [9] *((const byte*) main::SCREEN + (byte) main::i#4) ← *((byte[$c])(const struct foo*) main::barp#0+(const byte) OFFSET_STRUCT_FOO_THING3 + (byte) main::j#2) [ main::j#2 main::i#4 ] ( main:4 [ main::j#2 main::i#4 ] ) always clobbers reg byte a
|
||||
Potential registers zp[1]:2 [ main::j#2 main::j#1 ] : zp[1]:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp[1]:3 [ main::i#4 main::i#3 ] : zp[1]:3 , reg byte x , reg byte y ,
|
||||
Potential registers mem[1]:bar_thing1 [ bar_thing1 ] : mem[1]:bar_thing1 ,
|
||||
Potential registers mem[1]:bar_thing2 [ bar_thing2 ] : mem[1]:bar_thing2 ,
|
||||
Potential registers mem[1] [ bar_thing1 ] : mem[1] ,
|
||||
Potential registers mem[1] [ bar_thing2 ] : mem[1] ,
|
||||
Potential registers zp[2]:4 [ bar_thing3 ] : zp[2]:4 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [] 20: mem[1]:bar_thing1 [ bar_thing1 ] 20: mem[1]:bar_thing2 [ bar_thing2 ] 20: zp[2]:4 [ bar_thing3 ]
|
||||
Uplift Scope [] 20: mem[1] [ bar_thing1 ] 20: mem[1] [ bar_thing2 ] 20: zp[2]:4 [ bar_thing3 ]
|
||||
Uplift Scope [main] 27.5: zp[1]:2 [ main::j#2 main::j#1 ] 23.83: zp[1]:3 [ main::i#4 main::i#3 ]
|
||||
Uplift Scope [foo]
|
||||
|
||||
Uplifting [] best 576 combination mem[1]:bar_thing1 [ bar_thing1 ] mem[1]:bar_thing2 [ bar_thing2 ] zp[2]:4 [ bar_thing3 ]
|
||||
Uplifting [] best 576 combination mem[1] [ bar_thing1 ] mem[1] [ bar_thing2 ] zp[2]:4 [ bar_thing3 ]
|
||||
Uplifting [main] best 366 combination reg byte y [ main::j#2 main::j#1 ] reg byte x [ main::i#4 main::i#3 ]
|
||||
Uplifting [foo] best 366 combination
|
||||
Attempting to uplift remaining variables inmem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Uplifting [] best 366 combination mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Attempting to uplift remaining variables inmem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Uplifting [] best 366 combination mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Attempting to uplift remaining variables inmem[1] [ bar_thing1 ]
|
||||
Uplifting [] best 366 combination mem[1] [ bar_thing1 ]
|
||||
Attempting to uplift remaining variables inmem[1] [ bar_thing2 ]
|
||||
Uplifting [] best 366 combination mem[1] [ bar_thing2 ]
|
||||
Allocated (was zp[2]:4) zp[2]:2 [ bar_thing3 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
@ -488,8 +488,8 @@ FINAL SYMBOL TABLE
|
||||
(label) @end
|
||||
(const byte) OFFSET_STRUCT_FOO_THING2 = (byte) 1
|
||||
(const byte) OFFSET_STRUCT_FOO_THING3 = (byte) 2
|
||||
(byte) bar_thing1 notregister mem[1]:bar_thing1 20.0
|
||||
(byte) bar_thing2 notregister mem[1]:bar_thing2 20.0
|
||||
(byte) bar_thing1 notregister mem[1] 20.0
|
||||
(byte) bar_thing2 notregister mem[1] 20.0
|
||||
(byte[$c]) bar_thing3 notregister zp[2]:2 20.0
|
||||
(byte) foo::thing1
|
||||
(byte) foo::thing2
|
||||
@ -509,8 +509,8 @@ FINAL SYMBOL TABLE
|
||||
|
||||
reg byte y [ main::j#2 main::j#1 ]
|
||||
reg byte x [ main::i#4 main::i#3 ]
|
||||
mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
mem[1] [ bar_thing1 ]
|
||||
mem[1] [ bar_thing2 ]
|
||||
zp[2]:2 [ bar_thing3 ]
|
||||
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
(label) @end
|
||||
(const byte) OFFSET_STRUCT_FOO_THING2 = (byte) 1
|
||||
(const byte) OFFSET_STRUCT_FOO_THING3 = (byte) 2
|
||||
(byte) bar_thing1 notregister mem[1]:bar_thing1 20.0
|
||||
(byte) bar_thing2 notregister mem[1]:bar_thing2 20.0
|
||||
(byte) bar_thing1 notregister mem[1] 20.0
|
||||
(byte) bar_thing2 notregister mem[1] 20.0
|
||||
(byte[$c]) bar_thing3 notregister zp[2]:2 20.0
|
||||
(byte) foo::thing1
|
||||
(byte) foo::thing2
|
||||
@ -25,6 +25,6 @@
|
||||
|
||||
reg byte y [ main::j#2 main::j#1 ]
|
||||
reg byte x [ main::i#4 main::i#3 ]
|
||||
mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
mem[1] [ bar_thing1 ]
|
||||
mem[1] [ bar_thing2 ]
|
||||
zp[2]:2 [ bar_thing3 ]
|
||||
|
@ -126,8 +126,8 @@ Added variable bar_thing2 to zero page equivalence class [ bar_thing2 ]
|
||||
Complete equivalence classes
|
||||
[ bar_thing1 ]
|
||||
[ bar_thing2 ]
|
||||
Allocated mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Allocated mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Allocated mem[1] [ bar_thing1 ]
|
||||
Allocated mem[1] [ bar_thing2 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic / MOS6502X
|
||||
@ -183,21 +183,21 @@ Statement [0] (byte) bar_thing1 ← (byte) 'a' [ bar_thing1 ] ( [ bar_thing1 ]
|
||||
Statement [1] (byte) bar_thing2 ← (byte) 'b' [ bar_thing1 bar_thing2 ] ( [ bar_thing1 bar_thing2 ] ) always clobbers reg byte a
|
||||
Statement [5] *((const byte*) main::SCREEN) ← (byte) bar_thing1 [ bar_thing2 ] ( main:3 [ bar_thing2 ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) main::SCREEN+(byte) 1) ← (byte) bar_thing2 [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Potential registers mem[1]:bar_thing1 [ bar_thing1 ] : mem[1]:bar_thing1 ,
|
||||
Potential registers mem[1]:bar_thing2 [ bar_thing2 ] : mem[1]:bar_thing2 ,
|
||||
Potential registers mem[1] [ bar_thing1 ] : mem[1] ,
|
||||
Potential registers mem[1] [ bar_thing2 ] : mem[1] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [] 1.33: mem[1]:bar_thing1 [ bar_thing1 ] 1.33: mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Uplift Scope [] 1.33: mem[1] [ bar_thing1 ] 1.33: mem[1] [ bar_thing2 ]
|
||||
Uplift Scope [foo]
|
||||
Uplift Scope [main]
|
||||
|
||||
Uplifting [] best 49 combination mem[1]:bar_thing1 [ bar_thing1 ] mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Uplifting [] best 49 combination mem[1] [ bar_thing1 ] mem[1] [ bar_thing2 ]
|
||||
Uplifting [foo] best 49 combination
|
||||
Uplifting [main] best 49 combination
|
||||
Attempting to uplift remaining variables inmem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Uplifting [] best 49 combination mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
Attempting to uplift remaining variables inmem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Uplifting [] best 49 combination mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
Attempting to uplift remaining variables inmem[1] [ bar_thing1 ]
|
||||
Uplifting [] best 49 combination mem[1] [ bar_thing1 ]
|
||||
Attempting to uplift remaining variables inmem[1] [ bar_thing2 ]
|
||||
Uplifting [] best 49 combination mem[1] [ bar_thing2 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -266,8 +266,8 @@ FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte) bar_thing1 notregister mem[1]:bar_thing1 1.3333333333333333
|
||||
(byte) bar_thing2 notregister mem[1]:bar_thing2 1.3333333333333333
|
||||
(byte) bar_thing1 notregister mem[1] 1.3333333333333333
|
||||
(byte) bar_thing2 notregister mem[1] 1.3333333333333333
|
||||
(byte) foo::thing1
|
||||
(byte) foo::thing2
|
||||
(void()) main()
|
||||
@ -275,8 +275,8 @@ FINAL SYMBOL TABLE
|
||||
(const byte*) main::SCREEN = (byte*) 1024
|
||||
(byte) main::i
|
||||
|
||||
mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
mem[1] [ bar_thing1 ]
|
||||
mem[1] [ bar_thing2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
|
@ -1,8 +1,8 @@
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte) bar_thing1 notregister mem[1]:bar_thing1 1.3333333333333333
|
||||
(byte) bar_thing2 notregister mem[1]:bar_thing2 1.3333333333333333
|
||||
(byte) bar_thing1 notregister mem[1] 1.3333333333333333
|
||||
(byte) bar_thing2 notregister mem[1] 1.3333333333333333
|
||||
(byte) foo::thing1
|
||||
(byte) foo::thing2
|
||||
(void()) main()
|
||||
@ -10,5 +10,5 @@
|
||||
(const byte*) main::SCREEN = (byte*) 1024
|
||||
(byte) main::i
|
||||
|
||||
mem[1]:bar_thing1 [ bar_thing1 ]
|
||||
mem[1]:bar_thing2 [ bar_thing2 ]
|
||||
mem[1] [ bar_thing1 ]
|
||||
mem[1] [ bar_thing2 ]
|
||||
|
@ -219,17 +219,17 @@ SYMBOL TABLE SSA
|
||||
(label) main::@9
|
||||
(label) main::@return
|
||||
(byte) main::default_default
|
||||
(byte) main::default_mem_abs
|
||||
(byte) main::default_mem_abs !mem[-1]:4096
|
||||
(byte) main::default_mem_flex
|
||||
(byte) main::default_zp_abs !zp[-1]:16
|
||||
(byte) main::default_zp_flex
|
||||
(byte) main::notreg_default notregister
|
||||
(byte) main::notreg_mem_abs notregister
|
||||
(byte) main::notreg_mem_abs notregister !mem[-1]:4096
|
||||
(byte) main::notreg_mem_flex notregister
|
||||
(byte) main::notreg_zp_abs notregister !zp[-1]:16
|
||||
(byte) main::notreg_zp_flex notregister
|
||||
(byte) main::reg_default
|
||||
(byte) main::reg_mem_abs
|
||||
(byte) main::reg_mem_abs !mem[-1]:4096
|
||||
(byte) main::reg_mem_flex
|
||||
(byte) main::reg_zp_abs !zp[-1]:16
|
||||
(byte) main::reg_zp_flex
|
||||
@ -491,7 +491,7 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte) i#36 16.0
|
||||
(void()) main()
|
||||
(byte) main::notreg_default notregister 0.2
|
||||
(byte) main::notreg_mem_abs notregister 0.26666666666666666
|
||||
(byte) main::notreg_mem_abs notregister !mem[-1]:4096 0.26666666666666666
|
||||
(byte) main::notreg_mem_flex notregister 0.2857142857142857
|
||||
(byte) main::notreg_zp_abs notregister !zp[-1]:16 0.3076923076923077
|
||||
(byte) main::notreg_zp_flex notregister 0.3333333333333333
|
||||
@ -523,8 +523,7 @@ Complete equivalence classes
|
||||
Allocated zp[1]:2 [ out::c#15 out::c#10 out::c#4 out::c#5 out::c#6 out::c#7 ]
|
||||
Allocated zp[1]:3 [ i#36 i#17 ]
|
||||
Allocated zp[1]:4 [ main::notreg_zp_flex ]
|
||||
Allocated mem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ]
|
||||
Allocated mem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ]
|
||||
Allocated mem[1] [ main::notreg_mem_flex ]
|
||||
Allocated zp[1]:5 [ main::notreg_default ]
|
||||
|
||||
INITIAL ASM
|
||||
@ -805,26 +804,26 @@ Potential registers zp[1]:2 [ out::c#15 out::c#10 out::c#4 out::c#5 out::c#6 out
|
||||
Potential registers zp[1]:3 [ i#36 i#17 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp[1]:4 [ main::notreg_zp_flex ] : zp[1]:4 ,
|
||||
Potential registers zp[1]:16 [ main::notreg_zp_abs ] : zp[1]:16 ,
|
||||
Potential registers mem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ] : mem[1]:main::notreg_mem_flex ,
|
||||
Potential registers mem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ] : mem[1]:main::notreg_mem_abs ,
|
||||
Potential registers mem[1] [ main::notreg_mem_flex ] : mem[1] ,
|
||||
Potential registers mem[1]:4096 [ main::notreg_mem_abs ] : mem[1]:4096 ,
|
||||
Potential registers zp[1]:5 [ main::notreg_default ] : zp[1]:5 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [out] 32: zp[1]:2 [ out::c#15 out::c#10 out::c#4 out::c#5 out::c#6 out::c#7 ]
|
||||
Uplift Scope [] 17: zp[1]:3 [ i#36 i#17 ]
|
||||
Uplift Scope [main] 0.33: zp[1]:4 [ main::notreg_zp_flex ] 0.31: zp[1]:16 [ main::notreg_zp_abs ] 0.29: mem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ] 0.27: mem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ] 0.2: zp[1]:5 [ main::notreg_default ]
|
||||
Uplift Scope [main] 0.33: zp[1]:4 [ main::notreg_zp_flex ] 0.31: zp[1]:16 [ main::notreg_zp_abs ] 0.29: mem[1] [ main::notreg_mem_flex ] 0.27: mem[1]:4096 [ main::notreg_mem_abs ] 0.2: zp[1]:5 [ main::notreg_default ]
|
||||
|
||||
Uplifting [out] best 246 combination reg byte x [ out::c#15 out::c#10 out::c#4 out::c#5 out::c#6 out::c#7 ]
|
||||
Uplifting [] best 237 combination reg byte y [ i#36 i#17 ]
|
||||
Uplifting [main] best 237 combination zp[1]:4 [ main::notreg_zp_flex ] zp[1]:16 [ main::notreg_zp_abs ] mem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ] mem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ] zp[1]:5 [ main::notreg_default ]
|
||||
Uplifting [main] best 237 combination zp[1]:4 [ main::notreg_zp_flex ] zp[1]:16 [ main::notreg_zp_abs ] mem[1] [ main::notreg_mem_flex ] mem[1]:4096 [ main::notreg_mem_abs ] zp[1]:5 [ main::notreg_default ]
|
||||
Attempting to uplift remaining variables inzp[1]:4 [ main::notreg_zp_flex ]
|
||||
Uplifting [main] best 237 combination zp[1]:4 [ main::notreg_zp_flex ]
|
||||
Attempting to uplift remaining variables inzp[1]:16 [ main::notreg_zp_abs ]
|
||||
Uplifting [main] best 237 combination zp[1]:16 [ main::notreg_zp_abs ]
|
||||
Attempting to uplift remaining variables inmem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ]
|
||||
Uplifting [main] best 237 combination mem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ]
|
||||
Attempting to uplift remaining variables inmem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ]
|
||||
Uplifting [main] best 237 combination mem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ]
|
||||
Attempting to uplift remaining variables inmem[1] [ main::notreg_mem_flex ]
|
||||
Uplifting [main] best 237 combination mem[1] [ main::notreg_mem_flex ]
|
||||
Attempting to uplift remaining variables inmem[1]:4096 [ main::notreg_mem_abs ]
|
||||
Uplifting [main] best 237 combination mem[1]:4096 [ main::notreg_mem_abs ]
|
||||
Attempting to uplift remaining variables inzp[1]:5 [ main::notreg_default ]
|
||||
Uplifting [main] best 237 combination zp[1]:5 [ main::notreg_default ]
|
||||
Allocated (was zp[1]:4) zp[1]:2 [ main::notreg_zp_flex ]
|
||||
@ -1181,17 +1180,17 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@9
|
||||
(label) main::@return
|
||||
(const byte) main::default_default = (byte) '.'
|
||||
(const byte) main::default_mem_abs = (byte) '.'
|
||||
(const byte) main::default_mem_abs !mem[-1]:4096 = (byte) '.'
|
||||
(const byte) main::default_mem_flex = (byte) '.'
|
||||
(const byte) main::default_zp_abs !zp[-1]:16 = (byte) '.'
|
||||
(const byte) main::default_zp_flex = (byte) '.'
|
||||
(byte) main::notreg_default notregister zp[1]:3 0.2
|
||||
(byte) main::notreg_mem_abs notregister mem[1]:main::notreg_mem_abs 0.26666666666666666
|
||||
(byte) main::notreg_mem_flex notregister mem[1]:main::notreg_mem_flex 0.2857142857142857
|
||||
(byte) main::notreg_mem_abs notregister !mem[-1]:4096 mem[1]:4096 0.26666666666666666
|
||||
(byte) main::notreg_mem_flex notregister mem[1] 0.2857142857142857
|
||||
(byte) main::notreg_zp_abs notregister !zp[-1]:16 zp[1]:16 0.3076923076923077
|
||||
(byte) main::notreg_zp_flex notregister zp[1]:2 0.3333333333333333
|
||||
(const byte) main::reg_default = (byte) '.'
|
||||
(const byte) main::reg_mem_abs = (byte) '.'
|
||||
(const byte) main::reg_mem_abs !mem[-1]:4096 = (byte) '.'
|
||||
(const byte) main::reg_mem_flex = (byte) '.'
|
||||
(const byte) main::reg_zp_abs !zp[-1]:16 = (byte) '.'
|
||||
(const byte) main::reg_zp_flex = (byte) '.'
|
||||
@ -1209,8 +1208,8 @@ reg byte x [ out::c#15 out::c#10 out::c#4 out::c#5 out::c#6 out::c#7 ]
|
||||
reg byte y [ i#36 i#17 ]
|
||||
zp[1]:2 [ main::notreg_zp_flex ]
|
||||
zp[1]:16 [ main::notreg_zp_abs ]
|
||||
mem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ]
|
||||
mem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ]
|
||||
mem[1] [ main::notreg_mem_flex ]
|
||||
mem[1]:4096 [ main::notreg_mem_abs ]
|
||||
zp[1]:3 [ main::notreg_default ]
|
||||
|
||||
|
||||
|
@ -22,17 +22,17 @@
|
||||
(label) main::@9
|
||||
(label) main::@return
|
||||
(const byte) main::default_default = (byte) '.'
|
||||
(const byte) main::default_mem_abs = (byte) '.'
|
||||
(const byte) main::default_mem_abs !mem[-1]:4096 = (byte) '.'
|
||||
(const byte) main::default_mem_flex = (byte) '.'
|
||||
(const byte) main::default_zp_abs !zp[-1]:16 = (byte) '.'
|
||||
(const byte) main::default_zp_flex = (byte) '.'
|
||||
(byte) main::notreg_default notregister zp[1]:3 0.2
|
||||
(byte) main::notreg_mem_abs notregister mem[1]:main::notreg_mem_abs 0.26666666666666666
|
||||
(byte) main::notreg_mem_flex notregister mem[1]:main::notreg_mem_flex 0.2857142857142857
|
||||
(byte) main::notreg_mem_abs notregister !mem[-1]:4096 mem[1]:4096 0.26666666666666666
|
||||
(byte) main::notreg_mem_flex notregister mem[1] 0.2857142857142857
|
||||
(byte) main::notreg_zp_abs notregister !zp[-1]:16 zp[1]:16 0.3076923076923077
|
||||
(byte) main::notreg_zp_flex notregister zp[1]:2 0.3333333333333333
|
||||
(const byte) main::reg_default = (byte) '.'
|
||||
(const byte) main::reg_mem_abs = (byte) '.'
|
||||
(const byte) main::reg_mem_abs !mem[-1]:4096 = (byte) '.'
|
||||
(const byte) main::reg_mem_flex = (byte) '.'
|
||||
(const byte) main::reg_zp_abs !zp[-1]:16 = (byte) '.'
|
||||
(const byte) main::reg_zp_flex = (byte) '.'
|
||||
@ -50,6 +50,6 @@ reg byte x [ out::c#15 out::c#10 out::c#4 out::c#5 out::c#6 out::c#7 ]
|
||||
reg byte y [ i#36 i#17 ]
|
||||
zp[1]:2 [ main::notreg_zp_flex ]
|
||||
zp[1]:16 [ main::notreg_zp_abs ]
|
||||
mem[1]:main::notreg_mem_flex [ main::notreg_mem_flex ]
|
||||
mem[1]:main::notreg_mem_abs [ main::notreg_mem_abs ]
|
||||
mem[1] [ main::notreg_mem_flex ]
|
||||
mem[1]:4096 [ main::notreg_mem_abs ]
|
||||
zp[1]:3 [ main::notreg_default ]
|
||||
|
@ -34,7 +34,7 @@ SYMBOL TABLE SSA
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte*) SCREEN
|
||||
(byte) idx notregister
|
||||
(byte) idx notregister !mem[-1]:4096
|
||||
(void()) main()
|
||||
(bool~) main::$0
|
||||
(label) main::@1
|
||||
@ -109,7 +109,7 @@ main::@return: scope:[main] from main::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte) idx notregister 5.0
|
||||
(byte) idx notregister !mem[-1]:4096 5.0
|
||||
(void()) main()
|
||||
(byte) main::i
|
||||
(byte) main::i#1 16.5
|
||||
@ -122,7 +122,6 @@ Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ idx ]
|
||||
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Allocated mem[1]:idx [ idx ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic / MOS6502X
|
||||
@ -202,16 +201,16 @@ Statement [0] (byte) idx ← (byte) 0 [ idx ] ( [ idx ] ) always clobbers reg b
|
||||
Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) idx [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) idx ← (byte) idx + (byte) main::i#2 [ idx main::i#2 ] ( main:2 [ idx main::i#2 ] ) always clobbers reg byte a
|
||||
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y ,
|
||||
Potential registers mem[1]:idx [ idx ] : mem[1]:idx ,
|
||||
Potential registers mem[1]:4096 [ idx ] : mem[1]:4096 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 31.17: zp[1]:2 [ main::i#2 main::i#1 ]
|
||||
Uplift Scope [] 5: mem[1]:idx [ idx ]
|
||||
Uplift Scope [] 5: mem[1]:4096 [ idx ]
|
||||
|
||||
Uplifting [main] best 409 combination reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 409 combination mem[1]:idx [ idx ]
|
||||
Attempting to uplift remaining variables inmem[1]:idx [ idx ]
|
||||
Uplifting [] best 409 combination mem[1]:idx [ idx ]
|
||||
Uplifting [] best 409 combination mem[1]:4096 [ idx ]
|
||||
Attempting to uplift remaining variables inmem[1]:4096 [ idx ]
|
||||
Uplifting [] best 409 combination mem[1]:4096 [ idx ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -304,7 +303,7 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte) idx notregister mem[1]:idx 5.0
|
||||
(byte) idx notregister !mem[-1]:4096 mem[1]:4096 5.0
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
@ -313,7 +312,7 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[1]:idx [ idx ]
|
||||
mem[1]:4096 [ idx ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
|
@ -2,7 +2,7 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(byte) idx notregister mem[1]:idx 5.0
|
||||
(byte) idx notregister !mem[-1]:4096 mem[1]:4096 5.0
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
@ -11,4 +11,4 @@
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
mem[1]:idx [ idx ]
|
||||
mem[1]:4096 [ idx ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user