mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-06-03 07:29:37 +00:00
Fine-tuned the verbose of the text and the weight of the equivalence classes allocation.
This commit is contained in:
parent
a4bbf1fd4f
commit
53a918025a
|
@ -185,15 +185,15 @@ public class Pass4RegistersFinalize extends Pass2Base {
|
|||
int sizeBytes = variable.getType().getSizeBytes();
|
||||
if(overflowToMainMem) {
|
||||
if (zp + sizeBytes > 0x100) {
|
||||
// Zero-page exhausted - move to main memory instead (TODO: prioritize!)
|
||||
// Zero-page exhausted - move to main memory instead (TODO: prioritize!) SVEN: I AGREE
|
||||
register = new Registers.RegisterMainMem(variableRef, variable.getType().getSizeBytes(), null, false);
|
||||
getLog().append("Zero-page exhausted. Moving allocation to main memory " + variable.toString());
|
||||
//getLog().append("Zero-page exhausted. Moving allocation to main memory " + variable.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
equivalenceClass.setRegister(register);
|
||||
if(before == null || !before.equals(register.toString())) {
|
||||
getLog().append("Allocated " + (before == null ? "" : ("(was " + before + ") ")) + equivalenceClass.toString());
|
||||
getLog().append((before == null ? "Allocated" : "Re-allocated " + before) + " to " + equivalenceClass.toString() + " // " + registerWeights.getTotalWeight(equivalenceClass));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
24
src/test/kc/compile/coalesce/ptr.c
Normal file
24
src/test/kc/compile/coalesce/ptr.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma zp_reserve(0..1, 4..255)
|
||||
|
||||
__export char p = *((char*)0x400);
|
||||
__export char a = *((char*)0x401);
|
||||
__export char b = *((char*)0x402);
|
||||
__export char r;
|
||||
__export char* ptr = ((char*)p);
|
||||
|
||||
void main() {
|
||||
ptr = (char*)calc_ptr(ptr, a);
|
||||
r = r + calc(ptr, b, p);
|
||||
}
|
||||
|
||||
char calc(char* ptr, char v, char p) {
|
||||
char x, y;
|
||||
for(char i=0; i<=200; i++) {
|
||||
x += i + v;
|
||||
}
|
||||
return x+v+p;
|
||||
}
|
||||
|
||||
char* calc_ptr(char* ptr, char i) {
|
||||
return ptr+i*2;
|
||||
}
|
Loading…
Reference in New Issue
Block a user