1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-04 15:29:46 +00:00

Fixed void* pointer problem properly. Closes #205

This commit is contained in:
jespergravgaard 2019-06-24 23:22:20 +02:00
parent 908ccb19ce
commit 28c1f71d5e
51 changed files with 4506 additions and 3277 deletions

View File

@ -25,7 +25,9 @@ public class Pass2NopCastInlining extends Pass2SsaOptimization {
}
/** We can either inline intermediate vars or expressions - not both at once */
enum Mode { VARS, EXPR }
enum Mode {
VARS, EXPR
}
/**
* Inline cast assignments that has no effect (byte to/from signed byte, word to/from signed word)
@ -45,7 +47,7 @@ public class Pass2NopCastInlining extends Pass2SsaOptimization {
if(stmt instanceof StatementAssignment) {
StatementAssignment assignment = (StatementAssignment) stmt;
// TODO: Handle constant values?
if(assignment.getOperator()==null && assignment.getrValue2() instanceof CastValue) {
if(assignment.getOperator() == null && assignment.getrValue2() instanceof CastValue) {
CastValue castValue = (CastValue) assignment.getrValue2();
SymbolType subValType = SymbolTypeInference.inferType(getScope(), castValue.getValue());
boolean isNopCast = false;
@ -65,9 +67,13 @@ public class Pass2NopCastInlining extends Pass2SsaOptimization {
isNopCast = true;
}
if(isNopCast && assignment.getlValue() instanceof VariableRef) {
boolean handled = false;
if(castValue.getValue() instanceof VariableRef && ((VariableRef)castValue.getValue()).isIntermediate()) {
if(mode==null || mode==Mode.VARS ) {
boolean isIntermediateVar = false;
if(castValue.getValue() instanceof VariableRef && ((VariableRef) castValue.getValue()).isIntermediate()) {
isIntermediateVar = true;
}
if(isIntermediateVar) {
if(mode == null || mode == Mode.VARS) {
mode = Mode.VARS;
Collection<Integer> varUseStatements = getProgram().getVariableReferenceInfos().getVarUseStatements((VariableRef) castValue.getValue());
if(varUseStatements.size() == 1 && assignment.getIndex().equals(varUseStatements.iterator().next())) {
@ -85,13 +91,9 @@ public class Pass2NopCastInlining extends Pass2SsaOptimization {
assignmentVar.setType(castVar.getType());
// Remove the assignment
stmtIt.remove();
handled = true;
}
}
}
if(!handled) {
} else if(mode == null || mode == Mode.EXPR) {
boolean modifyExpr = false;
if(castValue.getValue() instanceof VariableRef) {
VariableRef castVarRef = (VariableRef) castValue.getValue();
@ -100,11 +102,11 @@ public class Pass2NopCastInlining extends Pass2SsaOptimization {
// Same scope - optimize away
modifyExpr = true;
}
} else {
} else {
modifyExpr = true;
}
if(modifyExpr && (mode==null || mode==Mode.EXPR)) {
if(modifyExpr) {
mode = Mode.EXPR;
getLog().append("Inlining Noop Cast " + assignment.toString(getProgram(), false) + " keeping " + castValue.getValue());
// 1. Inline the cast
@ -121,7 +123,7 @@ public class Pass2NopCastInlining extends Pass2SsaOptimization {
}
}
if(replace1.size()>0) {
if(replace1.size() > 0) {
// 1. Perform first replace
replaceVariables(replace1);
// 2. Perform second replace

View File

@ -12,7 +12,7 @@ word* SQUARES;
// Initialize squares table
// Uses iterative formula (x+1)^2 = x^2 + 2*x + 1
void init_squares() {
SQUARES = (word*)malloc(NUM_SQUARES*sizeof(word));
SQUARES = malloc(NUM_SQUARES*sizeof(word));
word* squares = SQUARES;
word sqr = 0;
for( byte i: 0..NUM_SQUARES-1) {

View File

@ -8,7 +8,7 @@ unsigned char* heap_head = HEAP_START;
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
unsigned char* malloc(unsigned int size) {
void* malloc(unsigned int size) {
unsigned char* mem = heap_head;
heap_head+= size;
return mem;
@ -16,7 +16,7 @@ unsigned char* malloc(unsigned int size) {
// A block of memory previously allocated by a call to malloc is deallocated, making it available again for further allocations.
// If ptr is a null pointer, the function does nothing.
void free(unsigned char* ptr) {
void free(void* ptr) {
}
// Searches an array of nitems unsigned words, the initial member of which is pointed to by base, for a member that matches the value key.

View File

@ -35,6 +35,11 @@ public class TestPrograms {
public TestPrograms() {
}
@Test
public void testDefaultFont() throws IOException, URISyntaxException {
compileAndCompare("default-font");
}
@Test
public void testUnsignedVoidError() throws IOException, URISyntaxException {
assertError("unsigned-void-error", "Unknown type unsigned void");

View File

@ -0,0 +1,17 @@
// Show default font on screen
import "string"
byte* SCREEN = 0x0400;
void main() {
memset(SCREEN, ' ', 1000);
byte* screen = SCREEN + 40+1;
byte ch = 0;
for( byte x: 0..15) {
for( byte y: 0..15) {
*screen++ = ch++;
}
screen += (40-16);
}
}

View File

@ -121,11 +121,10 @@ bitmap_plot: {
.label _1 = $11
.label plotter = $f
.label x = 2
.label _3 = $f
lda bitmap_plot_yhi,x
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,x
sta _3
sta plotter
lda x
and #<$fff8
sta _1

View File

@ -65,9 +65,9 @@ main::@4: scope:[main] from main::@12 main::@6
[27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0)
to:main::@1
bitmap_plot: scope:[bitmap_plot] from main::@2
[28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[28] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8
[30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1
[30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1
[31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0
[32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2)
to:bitmap_plot::@return

View File

@ -1321,7 +1321,8 @@ Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [1] (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 keeping memset::str#2
Inlining Noop Cast [3] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 keeping memset::str#2
Inlining Noop Cast [33] (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 keeping bitmap_plot::$3
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [33] (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 keeping bitmap_plot::plotter#0
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const word) memset::num#0
Inlining constant with var siblings (const byte) memset::c#1
@ -1533,9 +1534,9 @@ main::@4: scope:[main] from main::@12 main::@6
[27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0)
to:main::@1
bitmap_plot: scope:[bitmap_plot] from main::@2
[28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[28] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8
[30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1
[30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1
[31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0
[32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2)
to:bitmap_plot::@return
@ -1692,8 +1693,8 @@ VARIABLE REGISTER WEIGHTS
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 4.0
(byte~) bitmap_plot::$2 4.0
(word~) bitmap_plot::$3 1.0
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 1.0
(byte*) bitmap_plot::plotter#1 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 3.0
@ -1768,7 +1769,7 @@ Initial phi equivalence classes
[ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
Added variable bitmap_plot::x#0 to zero page equivalence class [ bitmap_plot::x#0 ]
Added variable bitmap_plot::y#0 to zero page equivalence class [ bitmap_plot::y#0 ]
Added variable bitmap_plot::$3 to zero page equivalence class [ bitmap_plot::$3 ]
Added variable bitmap_plot::plotter#0 to zero page equivalence class [ bitmap_plot::plotter#0 ]
Added variable bitmap_plot::$1 to zero page equivalence class [ bitmap_plot::$1 ]
Added variable bitmap_plot::plotter#1 to zero page equivalence class [ bitmap_plot::plotter#1 ]
Added variable bitmap_plot::$2 to zero page equivalence class [ bitmap_plot::$2 ]
@ -1793,7 +1794,7 @@ Complete equivalence classes
[ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
[ bitmap_plot::x#0 ]
[ bitmap_plot::y#0 ]
[ bitmap_plot::$3 ]
[ bitmap_plot::plotter#0 ]
[ bitmap_plot::$1 ]
[ bitmap_plot::plotter#1 ]
[ bitmap_plot::$2 ]
@ -1817,7 +1818,7 @@ Allocated zp ZP_WORD:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init:
Allocated zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
Allocated zp ZP_WORD:21 [ bitmap_plot::x#0 ]
Allocated zp ZP_BYTE:23 [ bitmap_plot::y#0 ]
Allocated zp ZP_WORD:24 [ bitmap_plot::$3 ]
Allocated zp ZP_WORD:24 [ bitmap_plot::plotter#0 ]
Allocated zp ZP_WORD:26 [ bitmap_plot::$1 ]
Allocated zp ZP_WORD:28 [ bitmap_plot::plotter#1 ]
Allocated zp ZP_BYTE:30 [ bitmap_plot::$2 ]
@ -2060,16 +2061,16 @@ main: {
bitmap_plot: {
.label _1 = $1a
.label _2 = $1e
.label plotter = $1c
.label plotter = $18
.label plotter_1 = $1c
.label x = $15
.label y = $17
.label _3 = $18
//SEG62 [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2
//SEG62 [28] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2
ldy y
lda bitmap_plot_yhi,y
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,y
sta _3
sta plotter
//SEG63 [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1
lda x
and #<$fff8
@ -2077,24 +2078,24 @@ bitmap_plot: {
lda x+1
and #>$fff8
sta _1+1
//SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz2_plus_vwuz3
lda _3
//SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz2_plus_vwuz3
lda plotter
clc
adc _1
sta plotter
lda _3+1
sta plotter_1
lda plotter+1
adc _1+1
sta plotter+1
sta plotter_1+1
//SEG65 [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuz1=_lo_vwuz2
lda x
sta _2
//SEG66 [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) -- _deref_pbuz1=_deref_pbuz1_bor_pbuc1_derefidx_vbuz2
ldy #0
lda (plotter),y
lda (plotter_1),y
ldy _2
ora bitmap_plot_bit,y
ldy #0
sta (plotter),y
sta (plotter_1),y
jmp breturn
//SEG67 bitmap_plot::@return
breturn:
@ -2448,9 +2449,9 @@ Statement [25] (byte) main::vy#1 ← - (byte) main::vy#2 [ frame_cnt#0 main::x#1
Statement [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ( main:3 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ) always clobbers reg byte x
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::y#2 main::y#1 ]
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ]
Statement [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::$3 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 ] ) always clobbers reg byte a
Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [28] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::plotter#0 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 ] ) always clobbers reg byte a
Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a
Statement [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::y#2 main::y#1 ]
@ -2488,9 +2489,9 @@ Statement [23] if((byte) main::y#1==(byte) $c7) goto main::@6 [ frame_cnt#0 main
Statement [24] if((byte) main::y#1!=(byte) 0) goto main::@4 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#6 ] ( main:3 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#6 ] ) always clobbers reg byte a
Statement [25] (byte) main::vy#1 ← - (byte) main::vy#2 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#1 ] ( main:3 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#1 ] ) always clobbers reg byte a
Statement [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ( main:3 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ) always clobbers reg byte x
Statement [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::$3 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 ] ) always clobbers reg byte a
Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [28] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::plotter#0 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 ] ) always clobbers reg byte a
Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a
Statement [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 ] ) always clobbers reg byte a reg byte y
Statement [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a
@ -2526,7 +2527,7 @@ Potential registers zp ZP_WORD:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bi
Potential registers zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] : zp ZP_BYTE:20 ,
Potential registers zp ZP_WORD:21 [ bitmap_plot::x#0 ] : zp ZP_WORD:21 ,
Potential registers zp ZP_BYTE:23 [ bitmap_plot::y#0 ] : zp ZP_BYTE:23 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:24 [ bitmap_plot::$3 ] : zp ZP_WORD:24 ,
Potential registers zp ZP_WORD:24 [ bitmap_plot::plotter#0 ] : zp ZP_WORD:24 ,
Potential registers zp ZP_WORD:26 [ bitmap_plot::$1 ] : zp ZP_WORD:26 ,
Potential registers zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] : zp ZP_WORD:28 ,
Potential registers zp ZP_BYTE:30 [ bitmap_plot::$2 ] : zp ZP_BYTE:30 , reg byte a , reg byte x , reg byte y ,
@ -2541,7 +2542,7 @@ Uplift Scope [bitmap_init] 39.88: zp ZP_WORD:18 [ bitmap_init::yoffs#2 bitmap_in
Uplift Scope [main] 42.17: zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] 33: zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] 12.25: zp ZP_WORD:2 [ main::x#2 main::x#1 ] 11: zp ZP_BYTE:4 [ main::y#2 main::y#1 ]
Uplift Scope [] 45.11: zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
Uplift Scope [memset] 38: zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:31 [ memset::end#0 ] 2: zp ZP_WORD:10 [ memset::num#2 ] 1.57: zp ZP_BYTE:12 [ memset::c#3 ] 0: zp ZP_WORD:8 [ memset::str#2 ]
Uplift Scope [bitmap_plot] 15: zp ZP_BYTE:23 [ bitmap_plot::y#0 ] 4: zp ZP_WORD:26 [ bitmap_plot::$1 ] 4: zp ZP_BYTE:30 [ bitmap_plot::$2 ] 3: zp ZP_WORD:21 [ bitmap_plot::x#0 ] 3: zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] 1: zp ZP_WORD:24 [ bitmap_plot::$3 ]
Uplift Scope [bitmap_plot] 15: zp ZP_BYTE:23 [ bitmap_plot::y#0 ] 4: zp ZP_WORD:26 [ bitmap_plot::$1 ] 4: zp ZP_BYTE:30 [ bitmap_plot::$2 ] 3: zp ZP_WORD:21 [ bitmap_plot::x#0 ] 3: zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] 1: zp ZP_WORD:24 [ bitmap_plot::plotter#0 ]
Uplift Scope [bitmap_clear]
Uplift Scope [init_irq]
Uplift Scope [irq]
@ -2551,7 +2552,7 @@ Limited combination testing to 100 combinations of 15360 possible.
Uplifting [main] best 4327 combination zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] zp ZP_WORD:2 [ main::x#2 main::x#1 ] zp ZP_BYTE:4 [ main::y#2 main::y#1 ]
Uplifting [] best 4327 combination zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
Uplifting [memset] best 4311 combination zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:31 [ memset::end#0 ] zp ZP_WORD:10 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:8 [ memset::str#2 ]
Uplifting [bitmap_plot] best 4274 combination reg byte x [ bitmap_plot::y#0 ] zp ZP_WORD:26 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:21 [ bitmap_plot::x#0 ] zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] zp ZP_WORD:24 [ bitmap_plot::$3 ]
Uplifting [bitmap_plot] best 4274 combination reg byte x [ bitmap_plot::y#0 ] zp ZP_WORD:26 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:21 [ bitmap_plot::x#0 ] zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] zp ZP_WORD:24 [ bitmap_plot::plotter#0 ]
Uplifting [bitmap_clear] best 4274 combination
Uplifting [init_irq] best 4274 combination
Uplifting [irq] best 4274 combination
@ -2570,10 +2571,10 @@ Uplifting [bitmap_init] best 4154 combination zp ZP_BYTE:33 [ bitmap_init::$7 ]
Coalescing zero page register with common assignment [ zp ZP_WORD:2 [ main::x#2 main::x#1 ] ] with [ zp ZP_WORD:21 [ bitmap_plot::x#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ memset::str#2 ] ] with [ zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:10 [ memset::num#2 ] ] with [ zp ZP_WORD:31 [ memset::end#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:24 [ bitmap_plot::$3 ] ] with [ zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:24 [ bitmap_plot::plotter#0 ] ] with [ zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] ] - score: 1
Allocated (was zp ZP_WORD:18) zp ZP_WORD:12 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
Allocated (was zp ZP_BYTE:20) zp ZP_BYTE:14 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
Allocated (was zp ZP_WORD:24) zp ZP_WORD:15 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
Allocated (was zp ZP_WORD:24) zp ZP_WORD:15 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ]
Allocated (was zp ZP_WORD:26) zp ZP_WORD:17 [ bitmap_plot::$1 ]
Allocated (was zp ZP_BYTE:33) zp ZP_BYTE:19 [ bitmap_init::$7 ]
Interrupt procedure irq clobbers ACNZ
@ -2813,12 +2814,11 @@ bitmap_plot: {
.label _1 = $11
.label plotter = $f
.label x = 2
.label _3 = $f
//SEG62 [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
//SEG62 [28] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
lda bitmap_plot_yhi,x
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,x
sta _3
sta plotter
//SEG63 [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1
lda x
and #<$fff8
@ -2826,7 +2826,7 @@ bitmap_plot: {
lda x+1
and #>$fff8
sta _1+1
//SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
//SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
lda plotter
clc
adc _1
@ -3340,9 +3340,9 @@ FINAL SYMBOL TABLE
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 $1 zp ZP_WORD:17 4.0
(byte~) bitmap_plot::$2 reg byte a 4.0
(word~) bitmap_plot::$3 $3 zp ZP_WORD:15 1.0
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 plotter zp ZP_WORD:15 1.0
(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:15 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 x zp ZP_WORD:2 3.0
@ -3438,7 +3438,7 @@ reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ]
zp ZP_WORD:12 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
zp ZP_BYTE:14 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
reg byte x [ bitmap_plot::y#0 ]
zp ZP_WORD:15 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
zp ZP_WORD:15 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ]
zp ZP_WORD:17 [ bitmap_plot::$1 ]
reg byte a [ bitmap_plot::$2 ]
zp ZP_BYTE:19 [ bitmap_init::$7 ]
@ -3635,12 +3635,11 @@ bitmap_plot: {
.label _1 = $11
.label plotter = $f
.label x = 2
.label _3 = $f
//SEG62 [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
//SEG62 [28] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
lda bitmap_plot_yhi,x
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,x
sta _3
sta plotter
//SEG63 [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1
lda x
and #<$fff8
@ -3648,7 +3647,7 @@ bitmap_plot: {
lda x+1
and #>$fff8
sta _1+1
//SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
//SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
lda plotter
clc
adc _1

View File

@ -85,9 +85,9 @@
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 $1 zp ZP_WORD:17 4.0
(byte~) bitmap_plot::$2 reg byte a 4.0
(word~) bitmap_plot::$3 $3 zp ZP_WORD:15 1.0
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 plotter zp ZP_WORD:15 1.0
(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:15 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 x zp ZP_WORD:2 3.0
@ -183,7 +183,7 @@ reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ]
zp ZP_WORD:12 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
zp ZP_BYTE:14 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
reg byte x [ bitmap_plot::y#0 ]
zp ZP_WORD:15 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
zp ZP_WORD:15 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ]
zp ZP_WORD:17 [ bitmap_plot::$1 ]
reg byte a [ bitmap_plot::$2 ]
zp ZP_BYTE:19 [ bitmap_init::$7 ]

View File

@ -219,11 +219,10 @@ bitmap_plot: {
.label _1 = $3a
.label plotter = $38
.label x = $34
.label _3 = $38
lda bitmap_plot_yhi,x
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,x
sta _3
sta plotter
lda x
and #<$fff8
sta _1
@ -498,7 +497,7 @@ sin16s_gen2: {
.const max = $1001
.const ampl = max-min
.label _5 = $a
.label _6 = $45
.label _8 = $45
.label step = $41
.label sintab = $22
.label x = $1e
@ -533,14 +532,14 @@ sin16s_gen2: {
sta mul16s.b+1
jsr mul16s
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
sta _8+1
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
lda #SIZEOF_SIGNED_WORD
clc

View File

@ -85,9 +85,9 @@ main::@4: scope:[main] from main::@13 main::@3
[47] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0)
to:main::@1
bitmap_plot: scope:[bitmap_plot] from main::@10
[48] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8
[50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1
[50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1
[51] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0
[52] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2)
to:bitmap_plot::@return
@ -256,8 +256,8 @@ sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2::@1
to:sin16s_gen2::@4
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@3
[138] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[139] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5
[140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6
[139] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5
[140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8
[141] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[142] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[143] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2

View File

@ -2729,12 +2729,13 @@ Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [47] (word~) mul16s::$10 ← (word)(signed word) mul16s::b#3 keeping mul16s::b#3
Inlining Noop Cast [53] (word~) mul16s::$14 ← (word)(signed word) mul16s::a#3 keeping mul16s::a#3
Inlining Noop Cast [69] (signed word~) sin16s_gen2::$8 ← (signed word)(word~) sin16s_gen2::$6 keeping sin16s_gen2::$6
Inlining Noop Cast [110] (signed word) sin16s::sinx#0 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1
Inlining Noop Cast [114] (signed word~) sin16s::$19 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1
Inlining Noop Cast [127] (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 keeping memset::str#2
Inlining Noop Cast [129] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 keeping memset::str#2
Inlining Noop Cast [159] (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 keeping bitmap_plot::$3
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [69] (signed word~) sin16s_gen2::$8 ← (signed word)(word~) sin16s_gen2::$6 keeping sin16s_gen2::$8
Inlining Noop Cast [159] (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 keeping bitmap_plot::plotter#0
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [172] (word~) main::$24 ← (word) main::idx_x#3 * (const byte) SIZEOF_SIGNED_WORD
Rewriting multiplication to use shift [182] (word~) main::$25 ← (word) main::idx_y#3 * (const byte) SIZEOF_SIGNED_WORD
@ -3118,9 +3119,9 @@ main::@4: scope:[main] from main::@13 main::@3
[47] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0)
to:main::@1
bitmap_plot: scope:[bitmap_plot] from main::@10
[48] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8
[50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1
[50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1
[51] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0
[52] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2)
to:bitmap_plot::@return
@ -3289,8 +3290,8 @@ sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2::@1
to:sin16s_gen2::@4
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@3
[138] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[139] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5
[140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6
[139] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5
[140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8
[141] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[142] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[143] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
@ -3515,8 +3516,8 @@ VARIABLE REGISTER WEIGHTS
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 4.0
(byte~) bitmap_plot::$2 4.0
(word~) bitmap_plot::$3 1.0
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 1.0
(byte*) bitmap_plot::plotter#1 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 3.75
@ -3734,7 +3735,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(word) sin16s::x5_128#0 4.0
(void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max)
(signed dword~) sin16s_gen2::$5 22.0
(word~) sin16s_gen2::$6 11.0
(word~) sin16s_gen2::$8 11.0
(signed word) sin16s_gen2::ampl
(word) sin16s_gen2::i
(word) sin16s_gen2::i#1 16.5
@ -3805,7 +3806,7 @@ Added variable main::$15 to zero page equivalence class [ main::$15 ]
Added variable main::y#0 to zero page equivalence class [ main::y#0 ]
Added variable bitmap_plot::y#0 to zero page equivalence class [ bitmap_plot::y#0 ]
Added variable bitmap_plot::x#0 to zero page equivalence class [ bitmap_plot::x#0 ]
Added variable bitmap_plot::$3 to zero page equivalence class [ bitmap_plot::$3 ]
Added variable bitmap_plot::plotter#0 to zero page equivalence class [ bitmap_plot::plotter#0 ]
Added variable bitmap_plot::$1 to zero page equivalence class [ bitmap_plot::$1 ]
Added variable bitmap_plot::plotter#1 to zero page equivalence class [ bitmap_plot::plotter#1 ]
Added variable bitmap_plot::$2 to zero page equivalence class [ bitmap_plot::$2 ]
@ -3826,7 +3827,7 @@ Added variable sin16s_gen2::step#0 to zero page equivalence class [ sin16s_gen2:
Added variable sin16s::return#0 to zero page equivalence class [ sin16s::return#0 ]
Added variable mul16s::return#2 to zero page equivalence class [ mul16s::return#2 ]
Added variable sin16s_gen2::$5 to zero page equivalence class [ sin16s_gen2::$5 ]
Added variable sin16s_gen2::$6 to zero page equivalence class [ sin16s_gen2::$6 ]
Added variable sin16s_gen2::$8 to zero page equivalence class [ sin16s_gen2::$8 ]
Added variable sin16s::$4 to zero page equivalence class [ sin16s::$4 ]
Added variable sin16s::x1#0 to zero page equivalence class [ sin16s::x1#0 ]
Added variable mulu16_sel::return#0 to zero page equivalence class [ mulu16_sel::return#0 ]
@ -3905,7 +3906,7 @@ Complete equivalence classes
[ main::y#0 ]
[ bitmap_plot::y#0 ]
[ bitmap_plot::x#0 ]
[ bitmap_plot::$3 ]
[ bitmap_plot::plotter#0 ]
[ bitmap_plot::$1 ]
[ bitmap_plot::plotter#1 ]
[ bitmap_plot::$2 ]
@ -3926,7 +3927,7 @@ Complete equivalence classes
[ sin16s::return#0 ]
[ mul16s::return#2 ]
[ sin16s_gen2::$5 ]
[ sin16s_gen2::$6 ]
[ sin16s_gen2::$8 ]
[ sin16s::$4 ]
[ sin16s::x1#0 ]
[ mulu16_sel::return#0 ]
@ -4004,7 +4005,7 @@ Allocated zp ZP_WORD:108 [ main::$15 ]
Allocated zp ZP_WORD:110 [ main::y#0 ]
Allocated zp ZP_BYTE:112 [ bitmap_plot::y#0 ]
Allocated zp ZP_WORD:113 [ bitmap_plot::x#0 ]
Allocated zp ZP_WORD:115 [ bitmap_plot::$3 ]
Allocated zp ZP_WORD:115 [ bitmap_plot::plotter#0 ]
Allocated zp ZP_WORD:117 [ bitmap_plot::$1 ]
Allocated zp ZP_WORD:119 [ bitmap_plot::plotter#1 ]
Allocated zp ZP_BYTE:121 [ bitmap_plot::$2 ]
@ -4025,7 +4026,7 @@ Allocated zp ZP_DWORD:149 [ sin16s_gen2::step#0 ]
Allocated zp ZP_WORD:153 [ sin16s::return#0 ]
Allocated zp ZP_DWORD:155 [ mul16s::return#2 ]
Allocated zp ZP_DWORD:159 [ sin16s_gen2::$5 ]
Allocated zp ZP_WORD:163 [ sin16s_gen2::$6 ]
Allocated zp ZP_WORD:163 [ sin16s_gen2::$8 ]
Allocated zp ZP_DWORD:165 [ sin16s::$4 ]
Allocated zp ZP_WORD:169 [ sin16s::x1#0 ]
Allocated zp ZP_WORD:171 [ mulu16_sel::return#0 ]
@ -4488,16 +4489,16 @@ main: {
bitmap_plot: {
.label _1 = $75
.label _2 = $79
.label plotter = $77
.label plotter = $73
.label plotter_1 = $77
.label x = $71
.label y = $70
.label _3 = $73
//SEG90 [48] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2
//SEG90 [48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2
ldy y
lda bitmap_plot_yhi,y
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,y
sta _3
sta plotter
//SEG91 [49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1
lda x
and #<$fff8
@ -4505,24 +4506,24 @@ bitmap_plot: {
lda x+1
and #>$fff8
sta _1+1
//SEG92 [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz2_plus_vwuz3
lda _3
//SEG92 [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz2_plus_vwuz3
lda plotter
clc
adc _1
sta plotter
lda _3+1
sta plotter_1
lda plotter+1
adc _1+1
sta plotter+1
sta plotter_1+1
//SEG93 [51] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuz1=_lo_vwuz2
lda x
sta _2
//SEG94 [52] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) -- _deref_pbuz1=_deref_pbuz1_bor_pbuc1_derefidx_vbuz2
ldy #0
lda (plotter),y
lda (plotter_1),y
ldy _2
ora bitmap_plot_bit,y
ldy #0
sta (plotter),y
sta (plotter_1),y
jmp breturn
//SEG95 bitmap_plot::@return
breturn:
@ -5040,7 +5041,7 @@ sin16s_gen2: {
.const max = $1001
.const ampl = max-min
.label _5 = $9f
.label _6 = $a3
.label _8 = $a3
.label step = $95
.label sintab = $2c
.label x = $28
@ -5154,17 +5155,17 @@ sin16s_gen2: {
sta _5+2
lda mul16s.return_2+3
sta _5+3
//SEG257 [139] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
//SEG257 [139] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
//SEG258 [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 -- _deref_pwsz1=vwsz2
sta _8+1
//SEG258 [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 -- _deref_pwsz1=vwsz2
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
//SEG259 [141] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
@ -5943,9 +5944,9 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:112 [
Statement [40] if((word) main::idx_x#1!=(word) $200) goto main::@12 [ frame_cnt#0 main::idx_y#3 main::idx_x#1 ] ( main:3 [ frame_cnt#0 main::idx_y#3 main::idx_x#1 ] ) always clobbers reg byte a
Statement [44] if((word) main::idx_y#1!=(word) $200) goto main::@13 [ frame_cnt#0 main::idx_x#10 main::idx_y#1 ] ( main:3 [ frame_cnt#0 main::idx_x#10 main::idx_y#1 ] ) always clobbers reg byte a
Statement [47] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) [ frame_cnt#0 main::idx_x#10 main::idx_y#10 ] ( main:3 [ frame_cnt#0 main::idx_x#10 main::idx_y#10 ] ) always clobbers reg byte x
Statement [48] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::$3 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::$3 ] ) always clobbers reg byte a
Statement [49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::plotter#0 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#0 ] ) always clobbers reg byte a
Statement [49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [51] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a
Statement [52] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 ] ) always clobbers reg byte a reg byte y
Statement [55] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3 [ mul16s::a#3 mul16s::b#3 mul16u::a#1 ] ( main:3::mul16s:20 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 mul16s::a#3 mul16s::b#3 mul16u::a#1 ] main:3::mul16s:30 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 main::x#0 mul16s::a#3 mul16s::b#3 mul16u::a#1 ] main:3::sin16s_gen2:6::mul16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::a#3 mul16s::b#3 mul16u::a#1 ] ) always clobbers reg byte a
@ -5988,8 +5989,8 @@ Statement [134] (signed word) sin16s::return#0 ← (signed word) sin16s::return#
Statement [135] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0 [ mul16s::a#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 mul16s::a#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a
Statement [137] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ) always clobbers reg byte a
Statement [138] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ) always clobbers reg byte a
Statement [139] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ) always clobbers reg byte a
Statement [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [139] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ) always clobbers reg byte a
Statement [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [141] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [142] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [144] if((word) sin16s_gen2::i#1<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@1 [ sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ) always clobbers reg byte a
@ -6071,9 +6072,9 @@ Statement [37] (word) bitmap_plot::x#0 ← (word) main::x#0 [ frame_cnt#0 main::
Statement [40] if((word) main::idx_x#1!=(word) $200) goto main::@12 [ frame_cnt#0 main::idx_y#3 main::idx_x#1 ] ( main:3 [ frame_cnt#0 main::idx_y#3 main::idx_x#1 ] ) always clobbers reg byte a
Statement [44] if((word) main::idx_y#1!=(word) $200) goto main::@13 [ frame_cnt#0 main::idx_x#10 main::idx_y#1 ] ( main:3 [ frame_cnt#0 main::idx_x#10 main::idx_y#1 ] ) always clobbers reg byte a
Statement [47] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) [ frame_cnt#0 main::idx_x#10 main::idx_y#10 ] ( main:3 [ frame_cnt#0 main::idx_x#10 main::idx_y#10 ] ) always clobbers reg byte x
Statement [48] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::$3 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::$3 ] ) always clobbers reg byte a
Statement [49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::plotter#0 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#0 ] ) always clobbers reg byte a
Statement [49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a
Statement [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a
Statement [51] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a
Statement [52] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:38 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 ] ) always clobbers reg byte a reg byte y
Statement [55] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3 [ mul16s::a#3 mul16s::b#3 mul16u::a#1 ] ( main:3::mul16s:20 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 mul16s::a#3 mul16s::b#3 mul16u::a#1 ] main:3::mul16s:30 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 main::x#0 mul16s::a#3 mul16s::b#3 mul16u::a#1 ] main:3::sin16s_gen2:6::mul16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::a#3 mul16s::b#3 mul16u::a#1 ] ) always clobbers reg byte a
@ -6112,8 +6113,8 @@ Statement [134] (signed word) sin16s::return#0 ← (signed word) sin16s::return#
Statement [135] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0 [ mul16s::a#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 mul16s::a#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a
Statement [137] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ) always clobbers reg byte a
Statement [138] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ) always clobbers reg byte a
Statement [139] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ) always clobbers reg byte a
Statement [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [139] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ) always clobbers reg byte a
Statement [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [141] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [142] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [144] if((word) sin16s_gen2::i#1<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@1 [ sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ( main:3::sin16s_gen2:6 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ) always clobbers reg byte a
@ -6219,7 +6220,7 @@ Potential registers zp ZP_WORD:108 [ main::$15 ] : zp ZP_WORD:108 , reg byte alu
Potential registers zp ZP_WORD:110 [ main::y#0 ] : zp ZP_WORD:110 ,
Potential registers zp ZP_BYTE:112 [ bitmap_plot::y#0 ] : zp ZP_BYTE:112 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:113 [ bitmap_plot::x#0 ] : zp ZP_WORD:113 ,
Potential registers zp ZP_WORD:115 [ bitmap_plot::$3 ] : zp ZP_WORD:115 ,
Potential registers zp ZP_WORD:115 [ bitmap_plot::plotter#0 ] : zp ZP_WORD:115 ,
Potential registers zp ZP_WORD:117 [ bitmap_plot::$1 ] : zp ZP_WORD:117 ,
Potential registers zp ZP_WORD:119 [ bitmap_plot::plotter#1 ] : zp ZP_WORD:119 ,
Potential registers zp ZP_BYTE:121 [ bitmap_plot::$2 ] : zp ZP_BYTE:121 , reg byte a , reg byte x , reg byte y ,
@ -6240,7 +6241,7 @@ Potential registers zp ZP_DWORD:149 [ sin16s_gen2::step#0 ] : zp ZP_DWORD:149 ,
Potential registers zp ZP_WORD:153 [ sin16s::return#0 ] : zp ZP_WORD:153 ,
Potential registers zp ZP_DWORD:155 [ mul16s::return#2 ] : zp ZP_DWORD:155 ,
Potential registers zp ZP_DWORD:159 [ sin16s_gen2::$5 ] : zp ZP_DWORD:159 ,
Potential registers zp ZP_WORD:163 [ sin16s_gen2::$6 ] : zp ZP_WORD:163 ,
Potential registers zp ZP_WORD:163 [ sin16s_gen2::$8 ] : zp ZP_WORD:163 ,
Potential registers zp ZP_DWORD:165 [ sin16s::$4 ] : zp ZP_DWORD:165 ,
Potential registers zp ZP_WORD:169 [ sin16s::x1#0 ] : zp ZP_WORD:169 ,
Potential registers zp ZP_WORD:171 [ mulu16_sel::return#0 ] : zp ZP_WORD:171 ,
@ -6277,10 +6278,10 @@ Uplift Scope [bitmap_init] 39.88: zp ZP_WORD:38 [ bitmap_init::yoffs#2 bitmap_in
Uplift Scope [mul16s] 46.18: zp ZP_WORD:8 [ mul16s::b#3 mul16s::b#2 mul16s::b#1 ] 23: zp ZP_WORD:6 [ mul16s::a#3 mul16s::a#0 ] 22: zp ZP_DWORD:74 [ mul16s::return#3 ] 22: zp ZP_DWORD:96 [ mul16s::return#4 ] 22: zp ZP_DWORD:155 [ mul16s::return#2 ] 16.5: zp ZP_DWORD:10 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 ] 7: zp ZP_DWORD:134 [ mul16s::return#0 ] 4: zp ZP_WORD:126 [ mul16s::$9 ] 4: zp ZP_WORD:128 [ mul16s::$16 ] 4: zp ZP_WORD:130 [ mul16s::$13 ] 4: zp ZP_WORD:132 [ mul16s::$17 ]
Uplift Scope [sin16s] 27.5: zp ZP_DWORD:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] 22: zp ZP_WORD:153 [ sin16s::return#0 ] 13: zp ZP_WORD:53 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] 4: zp ZP_DWORD:165 [ sin16s::$4 ] 4: zp ZP_WORD:173 [ sin16s::x2#0 ] 4: zp ZP_WORD:181 [ sin16s::x3_6#0 ] 4: zp ZP_WORD:187 [ sin16s::x4#0 ] 4: zp ZP_WORD:191 [ sin16s::x5#0 ] 4: zp ZP_WORD:193 [ sin16s::x5_128#0 ] 1: zp ZP_WORD:177 [ sin16s::x3#0 ] 1: zp ZP_WORD:195 [ sin16s::usinx#1 ] 0.64: zp ZP_WORD:169 [ sin16s::x1#0 ] 0.33: zp ZP_WORD:183 [ sin16s::usinx#0 ] 0.06: zp ZP_BYTE:48 [ sin16s::isUpper#2 ]
Uplift Scope [mulu16_sel] 24: zp ZP_WORD:55 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] 21: zp ZP_WORD:57 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] 4: zp ZP_WORD:171 [ mulu16_sel::return#0 ] 4: zp ZP_WORD:175 [ mulu16_sel::return#1 ] 4: zp ZP_WORD:179 [ mulu16_sel::return#2 ] 4: zp ZP_WORD:185 [ mulu16_sel::return#10 ] 4: zp ZP_WORD:189 [ mulu16_sel::return#11 ] 4: zp ZP_DWORD:201 [ mulu16_sel::$0 ] 4: zp ZP_DWORD:205 [ mulu16_sel::$1 ] 1.71: zp ZP_WORD:209 [ mulu16_sel::return#12 ] 0.33: zp ZP_BYTE:59 [ mulu16_sel::select#5 ]
Uplift Scope [sin16s_gen2] 22: zp ZP_DWORD:159 [ sin16s_gen2::$5 ] 18.33: zp ZP_WORD:46 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] 11: zp ZP_WORD:163 [ sin16s_gen2::$6 ] 10.33: zp ZP_DWORD:40 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] 8.8: zp ZP_WORD:44 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] 0.87: zp ZP_DWORD:149 [ sin16s_gen2::step#0 ]
Uplift Scope [sin16s_gen2] 22: zp ZP_DWORD:159 [ sin16s_gen2::$5 ] 18.33: zp ZP_WORD:46 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] 11: zp ZP_WORD:163 [ sin16s_gen2::$8 ] 10.33: zp ZP_DWORD:40 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] 8.8: zp ZP_WORD:44 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] 0.87: zp ZP_DWORD:149 [ sin16s_gen2::step#0 ]
Uplift Scope [] 44.64: zp ZP_BYTE:67 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] 0.8: zp ZP_WORD:225 [ rem16u#1 ]
Uplift Scope [memset] 38: zp ZP_WORD:33 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:139 [ memset::end#0 ] 2: zp ZP_WORD:30 [ memset::num#2 ] 1.57: zp ZP_BYTE:32 [ memset::c#3 ] 0: zp ZP_WORD:28 [ memset::str#2 ]
Uplift Scope [bitmap_plot] 7.5: zp ZP_BYTE:112 [ bitmap_plot::y#0 ] 4: zp ZP_WORD:117 [ bitmap_plot::$1 ] 4: zp ZP_BYTE:121 [ bitmap_plot::$2 ] 3.75: zp ZP_WORD:113 [ bitmap_plot::x#0 ] 3: zp ZP_WORD:119 [ bitmap_plot::plotter#1 ] 1: zp ZP_WORD:115 [ bitmap_plot::$3 ]
Uplift Scope [bitmap_plot] 7.5: zp ZP_BYTE:112 [ bitmap_plot::y#0 ] 4: zp ZP_WORD:117 [ bitmap_plot::$1 ] 4: zp ZP_BYTE:121 [ bitmap_plot::$2 ] 3.75: zp ZP_WORD:113 [ bitmap_plot::x#0 ] 3: zp ZP_WORD:119 [ bitmap_plot::plotter#1 ] 1: zp ZP_WORD:115 [ bitmap_plot::plotter#0 ]
Uplift Scope [div32u16u] 4: zp ZP_DWORD:145 [ div32u16u::return#2 ] 4: zp ZP_WORD:217 [ div32u16u::quotient_lo#0 ] 1.33: zp ZP_DWORD:219 [ div32u16u::return#0 ] 0.8: zp ZP_WORD:213 [ div32u16u::quotient_hi#0 ]
Uplift Scope [bitmap_clear]
Uplift Scope [init_irq]
@ -6294,10 +6295,10 @@ Limited combination testing to 100 combinations of 15360 possible.
Uplifting [mul16s] best 26195 combination zp ZP_WORD:8 [ mul16s::b#3 mul16s::b#2 mul16s::b#1 ] zp ZP_WORD:6 [ mul16s::a#3 mul16s::a#0 ] zp ZP_DWORD:74 [ mul16s::return#3 ] zp ZP_DWORD:96 [ mul16s::return#4 ] zp ZP_DWORD:155 [ mul16s::return#2 ] zp ZP_DWORD:10 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 ] zp ZP_DWORD:134 [ mul16s::return#0 ] zp ZP_WORD:126 [ mul16s::$9 ] zp ZP_WORD:128 [ mul16s::$16 ] zp ZP_WORD:130 [ mul16s::$13 ] zp ZP_WORD:132 [ mul16s::$17 ]
Uplifting [sin16s] best 26195 combination zp ZP_DWORD:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:153 [ sin16s::return#0 ] zp ZP_WORD:53 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:165 [ sin16s::$4 ] zp ZP_WORD:173 [ sin16s::x2#0 ] zp ZP_WORD:181 [ sin16s::x3_6#0 ] zp ZP_WORD:187 [ sin16s::x4#0 ] zp ZP_WORD:191 [ sin16s::x5#0 ] zp ZP_WORD:193 [ sin16s::x5_128#0 ] zp ZP_WORD:177 [ sin16s::x3#0 ] zp ZP_WORD:195 [ sin16s::usinx#1 ] zp ZP_WORD:169 [ sin16s::x1#0 ] zp ZP_WORD:183 [ sin16s::usinx#0 ] zp ZP_BYTE:48 [ sin16s::isUpper#2 ]
Uplifting [mulu16_sel] best 26179 combination zp ZP_WORD:55 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:57 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:171 [ mulu16_sel::return#0 ] zp ZP_WORD:175 [ mulu16_sel::return#1 ] zp ZP_WORD:179 [ mulu16_sel::return#2 ] zp ZP_WORD:185 [ mulu16_sel::return#10 ] zp ZP_WORD:189 [ mulu16_sel::return#11 ] zp ZP_DWORD:201 [ mulu16_sel::$0 ] zp ZP_DWORD:205 [ mulu16_sel::$1 ] zp ZP_WORD:209 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ]
Uplifting [sin16s_gen2] best 26179 combination zp ZP_DWORD:159 [ sin16s_gen2::$5 ] zp ZP_WORD:46 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:163 [ sin16s_gen2::$6 ] zp ZP_DWORD:40 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:44 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:149 [ sin16s_gen2::step#0 ]
Uplifting [sin16s_gen2] best 26179 combination zp ZP_DWORD:159 [ sin16s_gen2::$5 ] zp ZP_WORD:46 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:163 [ sin16s_gen2::$8 ] zp ZP_DWORD:40 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:44 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:149 [ sin16s_gen2::step#0 ]
Uplifting [] best 26179 combination zp ZP_BYTE:67 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] zp ZP_WORD:225 [ rem16u#1 ]
Uplifting [memset] best 26163 combination zp ZP_WORD:33 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:139 [ memset::end#0 ] zp ZP_WORD:30 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:28 [ memset::str#2 ]
Uplifting [bitmap_plot] best 26146 combination reg byte x [ bitmap_plot::y#0 ] zp ZP_WORD:117 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:113 [ bitmap_plot::x#0 ] zp ZP_WORD:119 [ bitmap_plot::plotter#1 ] zp ZP_WORD:115 [ bitmap_plot::$3 ]
Uplifting [bitmap_plot] best 26146 combination reg byte x [ bitmap_plot::y#0 ] zp ZP_WORD:117 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:113 [ bitmap_plot::x#0 ] zp ZP_WORD:119 [ bitmap_plot::plotter#1 ] zp ZP_WORD:115 [ bitmap_plot::plotter#0 ]
Uplifting [div32u16u] best 26146 combination zp ZP_DWORD:145 [ div32u16u::return#2 ] zp ZP_WORD:217 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:219 [ div32u16u::return#0 ] zp ZP_WORD:213 [ div32u16u::quotient_hi#0 ]
Uplifting [bitmap_clear] best 26146 combination
Uplifting [init_irq] best 26146 combination
@ -6335,7 +6336,7 @@ Coalescing zero page register with common assignment [ zp ZP_DWORD:74 [ mul16s::
Coalescing zero page register with common assignment [ zp ZP_WORD:88 [ main::x#0 ] ] with [ zp ZP_WORD:113 [ bitmap_plot::x#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:90 [ main::$25 ] ] with [ zp ZP_WORD:92 [ main::$27 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:96 [ mul16s::return#4 ] ] with [ zp ZP_DWORD:100 [ main::ypos#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:115 [ bitmap_plot::$3 ] ] with [ zp ZP_WORD:119 [ bitmap_plot::plotter#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:115 [ bitmap_plot::plotter#0 ] ] with [ zp ZP_WORD:119 [ bitmap_plot::plotter#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:126 [ mul16s::$9 ] ] with [ zp ZP_WORD:128 [ mul16s::$16 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:145 [ div32u16u::return#2 ] ] with [ zp ZP_DWORD:149 [ sin16s_gen2::step#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:145 [ div32u16u::return#2 sin16s_gen2::step#0 ] ] with [ zp ZP_DWORD:219 [ div32u16u::return#0 ] ] - score: 1
@ -6377,13 +6378,13 @@ Allocated (was zp ZP_WORD:64) zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::retur
Allocated (was zp ZP_BYTE:67) zp ZP_BYTE:51 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
Allocated (was zp ZP_WORD:88) zp ZP_WORD:52 [ main::x#0 bitmap_plot::x#0 ]
Allocated (was zp ZP_WORD:110) zp ZP_WORD:54 [ main::y#0 ]
Allocated (was zp ZP_WORD:115) zp ZP_WORD:56 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
Allocated (was zp ZP_WORD:115) zp ZP_WORD:56 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ]
Allocated (was zp ZP_WORD:117) zp ZP_WORD:58 [ bitmap_plot::$1 ]
Allocated (was zp ZP_WORD:126) zp ZP_WORD:60 [ mul16s::$9 mul16s::$16 ]
Allocated (was zp ZP_WORD:130) zp ZP_WORD:62 [ mul16s::$13 ]
Allocated (was zp ZP_BYTE:141) zp ZP_BYTE:64 [ bitmap_init::$7 ]
Allocated (was zp ZP_DWORD:145) zp ZP_DWORD:65 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ]
Allocated (was zp ZP_WORD:163) zp ZP_WORD:69 [ sin16s_gen2::$6 ]
Allocated (was zp ZP_WORD:163) zp ZP_WORD:69 [ sin16s_gen2::$8 ]
Allocated (was zp ZP_WORD:169) zp ZP_WORD:71 [ sin16s::x1#0 ]
Allocated (was zp ZP_WORD:171) zp ZP_WORD:73 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 sin16s::x5_128#0 ]
Allocated (was zp ZP_WORD:213) zp ZP_WORD:75 [ div32u16u::quotient_hi#0 ]
@ -6762,12 +6763,11 @@ bitmap_plot: {
.label _1 = $3a
.label plotter = $38
.label x = $34
.label _3 = $38
//SEG90 [48] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
//SEG90 [48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
lda bitmap_plot_yhi,x
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,x
sta _3
sta plotter
//SEG91 [49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1
lda x
and #<$fff8
@ -6775,7 +6775,7 @@ bitmap_plot: {
lda x+1
and #>$fff8
sta _1+1
//SEG92 [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
//SEG92 [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
lda plotter
clc
adc _1
@ -7247,7 +7247,7 @@ sin16s_gen2: {
.const max = $1001
.const ampl = max-min
.label _5 = $a
.label _6 = $45
.label _8 = $45
.label step = $41
.label sintab = $22
.label x = $1e
@ -7321,17 +7321,17 @@ sin16s_gen2: {
//SEG255 sin16s_gen2::@4
b4:
//SEG256 [138] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
//SEG257 [139] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
//SEG257 [139] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
//SEG258 [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 -- _deref_pwsz1=vwsz2
sta _8+1
//SEG258 [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 -- _deref_pwsz1=vwsz2
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
//SEG259 [141] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
@ -8293,9 +8293,9 @@ FINAL SYMBOL TABLE
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 $1 zp ZP_WORD:58 4.0
(byte~) bitmap_plot::$2 reg byte a 4.0
(word~) bitmap_plot::$3 $3 zp ZP_WORD:56 1.0
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 plotter zp ZP_WORD:56 1.0
(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:56 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 x zp ZP_WORD:52 3.75
@ -8574,7 +8574,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(word) sin16s::x5_128#0 x5_128 zp ZP_WORD:73 4.0
(void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max)
(signed dword~) sin16s_gen2::$5 $5 zp ZP_DWORD:10 22.0
(word~) sin16s_gen2::$6 $6 zp ZP_WORD:69 11.0
(word~) sin16s_gen2::$8 $8 zp ZP_WORD:69 11.0
(label) sin16s_gen2::@1
(label) sin16s_gen2::@2
(label) sin16s_gen2::@3
@ -8634,7 +8634,7 @@ zp ZP_WORD:52 [ main::x#0 bitmap_plot::x#0 ]
reg byte alu [ main::$15 ]
zp ZP_WORD:54 [ main::y#0 ]
reg byte x [ bitmap_plot::y#0 ]
zp ZP_WORD:56 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
zp ZP_WORD:56 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ]
zp ZP_WORD:58 [ bitmap_plot::$1 ]
reg byte a [ bitmap_plot::$2 ]
zp ZP_WORD:60 [ mul16s::$9 mul16s::$16 ]
@ -8645,7 +8645,7 @@ reg byte a [ bitmap_init::$4 ]
reg byte a [ bitmap_init::$5 ]
reg byte a [ bitmap_init::$6 ]
zp ZP_DWORD:65 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ]
zp ZP_WORD:69 [ sin16s_gen2::$6 ]
zp ZP_WORD:69 [ sin16s_gen2::$8 ]
zp ZP_WORD:71 [ sin16s::x1#0 ]
zp ZP_WORD:73 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 sin16s::x5_128#0 ]
zp ZP_WORD:75 [ div32u16u::quotient_hi#0 ]
@ -8967,12 +8967,11 @@ bitmap_plot: {
.label _1 = $3a
.label plotter = $38
.label x = $34
.label _3 = $38
//SEG90 [48] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
//SEG90 [48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx
lda bitmap_plot_yhi,x
sta _3+1
sta plotter+1
lda bitmap_plot_ylo,x
sta _3
sta plotter
//SEG91 [49] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1
lda x
and #<$fff8
@ -8980,7 +8979,7 @@ bitmap_plot: {
lda x+1
and #>$fff8
sta _1+1
//SEG92 [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
//SEG92 [50] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2
lda plotter
clc
adc _1
@ -9387,7 +9386,7 @@ sin16s_gen2: {
.const max = $1001
.const ampl = max-min
.label _5 = $a
.label _6 = $45
.label _8 = $45
.label step = $41
.label sintab = $22
.label x = $1e
@ -9447,17 +9446,17 @@ sin16s_gen2: {
//SEG254 [137] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
//SEG255 sin16s_gen2::@4
//SEG256 [138] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
//SEG257 [139] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
//SEG257 [139] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
//SEG258 [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 -- _deref_pwsz1=vwsz2
sta _8+1
//SEG258 [140] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 -- _deref_pwsz1=vwsz2
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
//SEG259 [141] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD

View File

@ -94,9 +94,9 @@
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 $1 zp ZP_WORD:58 4.0
(byte~) bitmap_plot::$2 reg byte a 4.0
(word~) bitmap_plot::$3 $3 zp ZP_WORD:56 1.0
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 plotter zp ZP_WORD:56 1.0
(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:56 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 x zp ZP_WORD:52 3.75
@ -375,7 +375,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(word) sin16s::x5_128#0 x5_128 zp ZP_WORD:73 4.0
(void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max)
(signed dword~) sin16s_gen2::$5 $5 zp ZP_DWORD:10 22.0
(word~) sin16s_gen2::$6 $6 zp ZP_WORD:69 11.0
(word~) sin16s_gen2::$8 $8 zp ZP_WORD:69 11.0
(label) sin16s_gen2::@1
(label) sin16s_gen2::@2
(label) sin16s_gen2::@3
@ -435,7 +435,7 @@ zp ZP_WORD:52 [ main::x#0 bitmap_plot::x#0 ]
reg byte alu [ main::$15 ]
zp ZP_WORD:54 [ main::y#0 ]
reg byte x [ bitmap_plot::y#0 ]
zp ZP_WORD:56 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
zp ZP_WORD:56 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ]
zp ZP_WORD:58 [ bitmap_plot::$1 ]
reg byte a [ bitmap_plot::$2 ]
zp ZP_WORD:60 [ mul16s::$9 mul16s::$16 ]
@ -446,7 +446,7 @@ reg byte a [ bitmap_init::$4 ]
reg byte a [ bitmap_init::$5 ]
reg byte a [ bitmap_init::$6 ]
zp ZP_DWORD:65 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ]
zp ZP_WORD:69 [ sin16s_gen2::$6 ]
zp ZP_WORD:69 [ sin16s_gen2::$8 ]
zp ZP_WORD:71 [ sin16s::x1#0 ]
zp ZP_WORD:73 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 sin16s::x5_128#0 ]
zp ZP_WORD:75 [ div32u16u::quotient_hi#0 ]

View File

@ -54,17 +54,18 @@ bbegin:
rts
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f
.label _9 = $35
.label _10 = $35
.label _11 = $35
.label _15 = $37
.label _16 = $37
.label _17 = $37
.label _18 = $37
.label _32 = 9
.label _33 = 9
.label cos_x = 9
.label xpos = $b
.label x = $35
.label sin_y = 9
.label ypos = $b
.label y = $37
.label idx_x = 2
.label idx_y = 6
.label r = 4
@ -112,9 +113,9 @@ main: {
sta cos_x+1
jsr mul16s
lda xpos+2
sta _9
sta _10
lda xpos+3
sta _9+1
sta _10+1
lda _11+1
cmp #$80
ror _11+1
@ -124,12 +125,12 @@ main: {
ror _11+1
ror _11
clc
lda bitmap_plot.x
lda x
adc #<$a0
sta bitmap_plot.x
lda bitmap_plot.x+1
sta x
lda x+1
adc #>$a0
sta bitmap_plot.x+1
sta x+1
lda idx_y
asl
sta _33
@ -152,9 +153,9 @@ main: {
sta sin_y+1
jsr mul16s
lda ypos+2
sta _15
sta _16
lda ypos+3
sta _15+1
sta _16+1
lda _17+1
cmp #$80
ror _17+1
@ -171,13 +172,14 @@ main: {
!:
sta $ff
clc
lda _18
lda y
adc $fe
sta _18
lda _18+1
sta y
lda y+1
adc $ff
sta _18+1
lda _18
sta y+1
lda y
tax
jsr bitmap_plot
ldx frame_cnt
inc plots_per_frame,x
@ -249,17 +251,15 @@ main: {
jmp b7
}
// Plot a single dot in the bitmap
// bitmap_plot(signed word zeropage($35) x, byte register(A) y)
// bitmap_plot(word zeropage($35) x, byte register(X) y)
bitmap_plot: {
.label _1 = $3b
.label plotter = $39
.label x = $35
.label _3 = $39
tay
lda bitmap_plot_yhi,y
sta _3+1
lda bitmap_plot_ylo,y
sta _3
lda bitmap_plot_yhi,x
sta plotter+1
lda bitmap_plot_ylo,x
sta plotter
lda x
and #<$fff8
sta _1
@ -534,7 +534,7 @@ sin16s_gen2: {
.const max = $1001
.const ampl = max-min
.label _5 = $b
.label _6 = $46
.label _8 = $46
.label step = $42
.label sintab = $23
.label x = $1f
@ -569,14 +569,14 @@ sin16s_gen2: {
sta mul16s.b+1
jsr mul16s
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
sta _8+1
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
lda #SIZEOF_SIGNED_WORD
clc

View File

@ -49,9 +49,9 @@ main::@2: scope:[main] from main::@1
to:main::@12
main::@12: scope:[main] from main::@2
[23] (signed dword) main::xpos#0 ← (signed dword) mul16s::return#3
[24] (word~) main::$9 ← > (signed dword) main::xpos#0
[25] (signed word~) main::$11 ← (signed word)(word~) main::$9 >> (signed byte) 2
[26] (signed word) bitmap_plot::x#0 ← (signed word) $a0 + (signed word~) main::$11
[24] (word~) main::$10 ← > (signed dword) main::xpos#0
[25] (signed word~) main::$11 ← (signed word)(word~) main::$10 >> (signed byte) 2
[26] (signed word) main::x#0 ← (signed word) $a0 + (signed word~) main::$11
[27] (word~) main::$33 ← (word) main::idx_y#3 << (byte) 1
[28] (signed word*~) main::$35 ← (const signed word[$200]) SINUS#0 + (word~) main::$33
[29] (signed word) main::sin_y#0 ← *((signed word*~) main::$35)
@ -62,383 +62,384 @@ main::@12: scope:[main] from main::@2
to:main::@13
main::@13: scope:[main] from main::@12
[34] (signed dword) main::ypos#0 ← (signed dword) mul16s::return#4
[35] (word~) main::$15 ← > (signed dword) main::ypos#0
[36] (signed word~) main::$17 ← (signed word)(word~) main::$15 >> (signed byte) 2
[37] (signed word~) main::$18 ← (signed byte) $64 + (signed word~) main::$17
[38] (byte) bitmap_plot::y#0 ← (byte)(word)(signed word~) main::$18
[39] call bitmap_plot
[35] (word~) main::$16 ← > (signed dword) main::ypos#0
[36] (signed word~) main::$17 ← (signed word)(word~) main::$16 >> (signed byte) 2
[37] (signed word) main::y#0 ← (signed byte) $64 + (signed word~) main::$17
[38] (byte) bitmap_plot::y#0 ← (byte)(word)(signed word) main::y#0
[39] (word) bitmap_plot::x#0 ← (word)(signed word) main::x#0
[40] call bitmap_plot
to:main::@14
main::@14: scope:[main] from main::@13
[40] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0)
[41] (word) main::idx_x#1 ← (word) main::idx_x#11 + (byte) main::r_add#10
[42] if((word) main::idx_x#1<(word) $200) goto main::@16
[41] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0)
[42] (word) main::idx_x#1 ← (word) main::idx_x#11 + (byte) main::r_add#10
[43] if((word) main::idx_x#1<(word) $200) goto main::@16
to:main::@3
main::@16: scope:[main] from main::@14
[43] phi()
[44] phi()
to:main::@3
main::@3: scope:[main] from main::@14 main::@16
[44] (word) main::idx_x#10 ← phi( main::@14/(byte) 0 main::@16/(word) main::idx_x#1 )
[45] (word) main::idx_y#1 ← (word) main::idx_y#3 + (byte) main::r_add#10
[46] if((word) main::idx_y#1<(word) $200) goto main::@17
[45] (word) main::idx_x#10 ← phi( main::@14/(byte) 0 main::@16/(word) main::idx_x#1 )
[46] (word) main::idx_y#1 ← (word) main::idx_y#3 + (byte) main::r_add#10
[47] if((word) main::idx_y#1<(word) $200) goto main::@17
to:main::@4
main::@17: scope:[main] from main::@3
[47] phi()
[48] phi()
to:main::@4
main::@4: scope:[main] from main::@17 main::@3
[48] (word) main::idx_y#10 ← phi( main::@3/(byte) 0 main::@17/(word) main::idx_y#1 )
[49] (signed word) main::r#1 ← (signed word) main::r#10 + (byte) main::r_add#10
[50] if((word) main::idx_x#10!=(byte) 0) goto main::@5
[49] (word) main::idx_y#10 ← phi( main::@3/(byte) 0 main::@17/(word) main::idx_y#1 )
[50] (signed word) main::r#1 ← (signed word) main::r#10 + (byte) main::r_add#10
[51] if((word) main::idx_x#10!=(byte) 0) goto main::@5
to:main::@15
main::@15: scope:[main] from main::@4
[51] if((byte) main::r_add#10==(byte) 1) goto main::@5
[52] if((byte) main::r_add#10==(byte) 1) goto main::@5
to:main::@6
main::@6: scope:[main] from main::@15
[52] (byte) main::r_add#1 ← (byte) main::r_add#10 >> (byte) 1
[53] (byte) main::r_add#1 ← (byte) main::r_add#10 >> (byte) 1
to:main::@5
main::@5: scope:[main] from main::@15 main::@4 main::@6
[53] (byte) main::r_add#12 ← phi( main::@6/(byte) main::r_add#1 main::@4/(byte) main::r_add#10 )
[54] if((signed word) main::r#1>=(signed word)(number) $200*(number) $c+(number) $100) goto main::@7
[54] (byte) main::r_add#12 ← phi( main::@6/(byte) main::r_add#1 main::@4/(byte) main::r_add#10 )
[55] if((signed word) main::r#1>=(signed word)(number) $200*(number) $c+(number) $100) goto main::@7
to:main::@1
main::@7: scope:[main] from main::@5 main::@7
[55] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0)
[56] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0)
to:main::@7
bitmap_plot: scope:[bitmap_plot] from main::@13
[56] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[57] (word~) bitmap_plot::$1 ← (word)(signed word) bitmap_plot::x#0 & (word) $fff8
[58] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1
[59] (byte~) bitmap_plot::$2 ← < (word)(signed word) bitmap_plot::x#0
[60] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2)
[57] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0)
[58] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8
[59] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1
[60] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0
[61] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2)
to:bitmap_plot::@return
bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot
[61] return
[62] return
to:@return
mul16s: scope:[mul16s] from main::@12 main::@2 sin16s_gen2::@3
[62] (signed word) mul16s::b#3 ← phi( main::@2/(signed word) mul16s::b#1 main::@12/(signed word) mul16s::b#2 sin16s_gen2::@3/(const signed word) sin16s_gen2::ampl#0 )
[62] (signed word) mul16s::a#3 ← phi( main::@2/(signed word) mul16s::a#1 main::@12/(signed word) mul16s::a#2 sin16s_gen2::@3/(signed word) mul16s::a#0 )
[63] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3
[64] (word) mul16u::b#0 ← (word)(signed word) mul16s::b#3
[65] call mul16u
[66] (dword) mul16u::return#2 ← (dword) mul16u::res#2
[63] (signed word) mul16s::b#3 ← phi( main::@2/(signed word) mul16s::b#1 main::@12/(signed word) mul16s::b#2 sin16s_gen2::@3/(const signed word) sin16s_gen2::ampl#0 )
[63] (signed word) mul16s::a#3 ← phi( main::@2/(signed word) mul16s::a#1 main::@12/(signed word) mul16s::a#2 sin16s_gen2::@3/(signed word) mul16s::a#0 )
[64] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3
[65] (word) mul16u::b#0 ← (word)(signed word) mul16s::b#3
[66] call mul16u
[67] (dword) mul16u::return#2 ← (dword) mul16u::res#2
to:mul16s::@5
mul16s::@5: scope:[mul16s] from mul16s
[67] (dword) mul16s::m#0 ← (dword) mul16u::return#2
[68] if((signed word) mul16s::a#3>=(signed byte) 0) goto mul16s::@1
[68] (dword) mul16s::m#0 ← (dword) mul16u::return#2
[69] if((signed word) mul16s::a#3>=(signed byte) 0) goto mul16s::@1
to:mul16s::@3
mul16s::@3: scope:[mul16s] from mul16s::@5
[69] (word~) mul16s::$9 ← > (dword) mul16s::m#0
[70] (word~) mul16s::$16 ← (word~) mul16s::$9 - (word)(signed word) mul16s::b#3
[71] (dword) mul16s::m#1 ← (dword) mul16s::m#0 hi= (word~) mul16s::$16
[70] (word~) mul16s::$9 ← > (dword) mul16s::m#0
[71] (word~) mul16s::$16 ← (word~) mul16s::$9 - (word)(signed word) mul16s::b#3
[72] (dword) mul16s::m#1 ← (dword) mul16s::m#0 hi= (word~) mul16s::$16
to:mul16s::@1
mul16s::@1: scope:[mul16s] from mul16s::@3 mul16s::@5
[72] (dword) mul16s::m#5 ← phi( mul16s::@3/(dword) mul16s::m#1 mul16s::@5/(dword) mul16s::m#0 )
[73] if((signed word) mul16s::b#3>=(signed byte) 0) goto mul16s::@2
[73] (dword) mul16s::m#5 ← phi( mul16s::@3/(dword) mul16s::m#1 mul16s::@5/(dword) mul16s::m#0 )
[74] if((signed word) mul16s::b#3>=(signed byte) 0) goto mul16s::@2
to:mul16s::@4
mul16s::@4: scope:[mul16s] from mul16s::@1
[74] (word~) mul16s::$13 ← > (dword) mul16s::m#5
[75] (word~) mul16s::$17 ← (word~) mul16s::$13 - (word)(signed word) mul16s::a#3
[76] (dword) mul16s::m#2 ← (dword) mul16s::m#5 hi= (word~) mul16s::$17
[75] (word~) mul16s::$13 ← > (dword) mul16s::m#5
[76] (word~) mul16s::$17 ← (word~) mul16s::$13 - (word)(signed word) mul16s::a#3
[77] (dword) mul16s::m#2 ← (dword) mul16s::m#5 hi= (word~) mul16s::$17
to:mul16s::@2
mul16s::@2: scope:[mul16s] from mul16s::@1 mul16s::@4
[77] (dword) mul16s::m#4 ← phi( mul16s::@1/(dword) mul16s::m#5 mul16s::@4/(dword) mul16s::m#2 )
[78] (signed dword) mul16s::return#0 ← (signed dword)(dword) mul16s::m#4
[78] (dword) mul16s::m#4 ← phi( mul16s::@1/(dword) mul16s::m#5 mul16s::@4/(dword) mul16s::m#2 )
[79] (signed dword) mul16s::return#0 ← (signed dword)(dword) mul16s::m#4
to:mul16s::@return
mul16s::@return: scope:[mul16s] from mul16s::@2
[79] return
[80] return
to:@return
mul16u: scope:[mul16u] from mul16s mulu16_sel
[80] (word) mul16u::a#6 ← phi( mul16s/(word) mul16u::a#1 mulu16_sel/(word) mul16u::a#2 )
[80] (dword) mul16u::mb#0 ← phi( mul16s/(word) mul16u::b#0 mulu16_sel/(word) mul16u::b#1 )
[81] (word) mul16u::a#6 ← phi( mul16s/(word) mul16u::a#1 mulu16_sel/(word) mul16u::a#2 )
[81] (dword) mul16u::mb#0 ← phi( mul16s/(word) mul16u::b#0 mulu16_sel/(word) mul16u::b#1 )
to:mul16u::@1
mul16u::@1: scope:[mul16u] from mul16u mul16u::@3
[81] (dword) mul16u::mb#2 ← phi( mul16u/(dword) mul16u::mb#0 mul16u::@3/(dword) mul16u::mb#1 )
[81] (dword) mul16u::res#2 ← phi( mul16u/(byte) 0 mul16u::@3/(dword) mul16u::res#6 )
[81] (word) mul16u::a#3 ← phi( mul16u/(word) mul16u::a#6 mul16u::@3/(word) mul16u::a#0 )
[82] if((word) mul16u::a#3!=(byte) 0) goto mul16u::@2
[82] (dword) mul16u::mb#2 ← phi( mul16u/(dword) mul16u::mb#0 mul16u::@3/(dword) mul16u::mb#1 )
[82] (dword) mul16u::res#2 ← phi( mul16u/(byte) 0 mul16u::@3/(dword) mul16u::res#6 )
[82] (word) mul16u::a#3 ← phi( mul16u/(word) mul16u::a#6 mul16u::@3/(word) mul16u::a#0 )
[83] if((word) mul16u::a#3!=(byte) 0) goto mul16u::@2
to:mul16u::@return
mul16u::@return: scope:[mul16u] from mul16u::@1
[83] return
[84] return
to:@return
mul16u::@2: scope:[mul16u] from mul16u::@1
[84] (byte~) mul16u::$1 ← (word) mul16u::a#3 & (byte) 1
[85] if((byte~) mul16u::$1==(byte) 0) goto mul16u::@3
[85] (byte~) mul16u::$1 ← (word) mul16u::a#3 & (byte) 1
[86] if((byte~) mul16u::$1==(byte) 0) goto mul16u::@3
to:mul16u::@4
mul16u::@4: scope:[mul16u] from mul16u::@2
[86] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2
[87] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2
to:mul16u::@3
mul16u::@3: scope:[mul16u] from mul16u::@2 mul16u::@4
[87] (dword) mul16u::res#6 ← phi( mul16u::@2/(dword) mul16u::res#2 mul16u::@4/(dword) mul16u::res#1 )
[88] (word) mul16u::a#0 ← (word) mul16u::a#3 >> (byte) 1
[89] (dword) mul16u::mb#1 ← (dword) mul16u::mb#2 << (byte) 1
[88] (dword) mul16u::res#6 ← phi( mul16u::@2/(dword) mul16u::res#2 mul16u::@4/(dword) mul16u::res#1 )
[89] (word) mul16u::a#0 ← (word) mul16u::a#3 >> (byte) 1
[90] (dword) mul16u::mb#1 ← (dword) mul16u::mb#2 << (byte) 1
to:mul16u::@1
init_irq: scope:[init_irq] from main::@8
asm { sei }
[91] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0
[92] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
[93] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0
[94] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80
[95] *((const byte*) RASTER#0) ← (byte) 0
[96] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0
[97] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq()
[92] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0
[93] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
[94] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0
[95] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80
[96] *((const byte*) RASTER#0) ← (byte) 0
[97] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0
[98] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq()
asm { cli }
to:init_irq::@return
init_irq::@return: scope:[init_irq] from init_irq
[99] return
[100] return
to:@return
bitmap_clear: scope:[bitmap_clear] from main::@10
[100] phi()
[101] call memset
[101] phi()
[102] call memset
to:bitmap_clear::@1
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
[102] phi()
[103] call memset
[103] phi()
[104] call memset
to:bitmap_clear::@return
bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1
[104] return
[105] return
to:@return
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
[105] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
[105] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 )
[105] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[106] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[107] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[106] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
[106] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 )
[106] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[107] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[108] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[108] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[109] *((byte*) memset::dst#2) ← (byte) memset::c#3
[110] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[111] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
[109] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[110] *((byte*) memset::dst#2) ← (byte) memset::c#3
[111] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[112] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[112] return
[113] return
to:@return
bitmap_init: scope:[bitmap_init] from main::@9
[113] phi()
[114] phi()
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[114] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[114] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[115] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[116] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[117] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6
[115] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[115] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[116] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[117] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[118] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6
to:bitmap_init::@2
bitmap_init::@6: scope:[bitmap_init] from bitmap_init::@1
[118] phi()
[119] phi()
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6
[119] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[120] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[121] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1
[120] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[121] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[122] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1
to:bitmap_init::@3
bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4
[122] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[122] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[123] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[124] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[125] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[126] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[127] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[128] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[129] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4
[123] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[123] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[124] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[125] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[126] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[127] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[128] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[129] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[130] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4
to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@3
[130] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
[131] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
to:bitmap_init::@4
bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@3 bitmap_init::@5
[131] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[132] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[133] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3
[132] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[133] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[134] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3
to:bitmap_init::@return
bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4
[134] return
[135] return
to:@return
sin16s_gen2: scope:[sin16s_gen2] from main
[135] phi()
[136] call div32u16u
[137] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
[136] phi()
[137] call div32u16u
[138] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
to:sin16s_gen2::@2
sin16s_gen2::@2: scope:[sin16s_gen2] from sin16s_gen2
[138] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2
[139] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2
to:sin16s_gen2::@1
sin16s_gen2::@1: scope:[sin16s_gen2] from sin16s_gen2::@2 sin16s_gen2::@4
[139] (word) sin16s_gen2::i#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(word) sin16s_gen2::i#1 )
[139] (signed word*) sin16s_gen2::sintab#2 ← phi( sin16s_gen2::@2/(const signed word[$200]) SINUS#0 sin16s_gen2::@4/(signed word*) sin16s_gen2::sintab#0 )
[139] (dword) sin16s_gen2::x#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(dword) sin16s_gen2::x#1 )
[140] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#2
[141] call sin16s
[142] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
[140] (word) sin16s_gen2::i#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(word) sin16s_gen2::i#1 )
[140] (signed word*) sin16s_gen2::sintab#2 ← phi( sin16s_gen2::@2/(const signed word[$200]) SINUS#0 sin16s_gen2::@4/(signed word*) sin16s_gen2::sintab#0 )
[140] (dword) sin16s_gen2::x#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(dword) sin16s_gen2::x#1 )
[141] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#2
[142] call sin16s
[143] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
to:sin16s_gen2::@3
sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2::@1
[143] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
[144] call mul16s
[145] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
[144] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
[145] call mul16s
[146] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
to:sin16s_gen2::@4
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@3
[146] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[147] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5
[148] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6
[149] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[150] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[151] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
[152] if((word) sin16s_gen2::i#1<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@1
[147] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[148] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5
[149] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8
[150] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[151] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[152] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
[153] if((word) sin16s_gen2::i#1<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@1
to:sin16s_gen2::@return
sin16s_gen2::@return: scope:[sin16s_gen2] from sin16s_gen2::@4
[153] return
[154] return
to:@return
sin16s: scope:[sin16s] from sin16s_gen2::@1
[154] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
[155] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
to:sin16s::@4
sin16s::@4: scope:[sin16s] from sin16s
[155] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
[156] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
to:sin16s::@1
sin16s::@1: scope:[sin16s] from sin16s sin16s::@4
[156] (byte) sin16s::isUpper#2 ← phi( sin16s/(byte) 0 sin16s::@4/(byte) 1 )
[156] (dword) sin16s::x#4 ← phi( sin16s/(dword) sin16s::x#0 sin16s::@4/(dword) sin16s::x#1 )
[157] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28#0) goto sin16s::@2
[157] (byte) sin16s::isUpper#2 ← phi( sin16s/(byte) 0 sin16s::@4/(byte) 1 )
[157] (dword) sin16s::x#4 ← phi( sin16s/(dword) sin16s::x#0 sin16s::@4/(dword) sin16s::x#1 )
[158] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28#0) goto sin16s::@2
to:sin16s::@5
sin16s::@5: scope:[sin16s] from sin16s::@1
[158] (dword) sin16s::x#2 ← (const dword) PI_u4f28#0 - (dword) sin16s::x#4
[159] (dword) sin16s::x#2 ← (const dword) PI_u4f28#0 - (dword) sin16s::x#4
to:sin16s::@2
sin16s::@2: scope:[sin16s] from sin16s::@1 sin16s::@5
[159] (dword) sin16s::x#6 ← phi( sin16s::@1/(dword) sin16s::x#4 sin16s::@5/(dword) sin16s::x#2 )
[160] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3
[161] (word) sin16s::x1#0 ← > (dword~) sin16s::$4
[162] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0
[163] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0
[164] call mulu16_sel
[165] (word) mulu16_sel::return#0 ← (word) mulu16_sel::return#12
[160] (dword) sin16s::x#6 ← phi( sin16s::@1/(dword) sin16s::x#4 sin16s::@5/(dword) sin16s::x#2 )
[161] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3
[162] (word) sin16s::x1#0 ← > (dword~) sin16s::$4
[163] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0
[164] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0
[165] call mulu16_sel
[166] (word) mulu16_sel::return#0 ← (word) mulu16_sel::return#12
to:sin16s::@7
sin16s::@7: scope:[sin16s] from sin16s::@2
[166] (word) sin16s::x2#0 ← (word) mulu16_sel::return#0
[167] (word) mulu16_sel::v1#1 ← (word) sin16s::x2#0
[168] (word) mulu16_sel::v2#1 ← (word) sin16s::x1#0
[169] call mulu16_sel
[170] (word) mulu16_sel::return#1 ← (word) mulu16_sel::return#12
[167] (word) sin16s::x2#0 ← (word) mulu16_sel::return#0
[168] (word) mulu16_sel::v1#1 ← (word) sin16s::x2#0
[169] (word) mulu16_sel::v2#1 ← (word) sin16s::x1#0
[170] call mulu16_sel
[171] (word) mulu16_sel::return#1 ← (word) mulu16_sel::return#12
to:sin16s::@8
sin16s::@8: scope:[sin16s] from sin16s::@7
[171] (word) sin16s::x3#0 ← (word) mulu16_sel::return#1
[172] (word) mulu16_sel::v1#2 ← (word) sin16s::x3#0
[173] call mulu16_sel
[174] (word) mulu16_sel::return#2 ← (word) mulu16_sel::return#12
[172] (word) sin16s::x3#0 ← (word) mulu16_sel::return#1
[173] (word) mulu16_sel::v1#2 ← (word) sin16s::x3#0
[174] call mulu16_sel
[175] (word) mulu16_sel::return#2 ← (word) mulu16_sel::return#12
to:sin16s::@9
sin16s::@9: scope:[sin16s] from sin16s::@8
[175] (word) sin16s::x3_6#0 ← (word) mulu16_sel::return#2
[176] (word) sin16s::usinx#0 ← (word) sin16s::x1#0 - (word) sin16s::x3_6#0
[177] (word) mulu16_sel::v1#3 ← (word) sin16s::x3#0
[178] (word) mulu16_sel::v2#3 ← (word) sin16s::x1#0
[179] call mulu16_sel
[180] (word) mulu16_sel::return#10 ← (word) mulu16_sel::return#12
[176] (word) sin16s::x3_6#0 ← (word) mulu16_sel::return#2
[177] (word) sin16s::usinx#0 ← (word) sin16s::x1#0 - (word) sin16s::x3_6#0
[178] (word) mulu16_sel::v1#3 ← (word) sin16s::x3#0
[179] (word) mulu16_sel::v2#3 ← (word) sin16s::x1#0
[180] call mulu16_sel
[181] (word) mulu16_sel::return#10 ← (word) mulu16_sel::return#12
to:sin16s::@10
sin16s::@10: scope:[sin16s] from sin16s::@9
[181] (word) sin16s::x4#0 ← (word) mulu16_sel::return#10
[182] (word) mulu16_sel::v1#4 ← (word) sin16s::x4#0
[183] (word) mulu16_sel::v2#4 ← (word) sin16s::x1#0
[184] call mulu16_sel
[185] (word) mulu16_sel::return#11 ← (word) mulu16_sel::return#12
[182] (word) sin16s::x4#0 ← (word) mulu16_sel::return#10
[183] (word) mulu16_sel::v1#4 ← (word) sin16s::x4#0
[184] (word) mulu16_sel::v2#4 ← (word) sin16s::x1#0
[185] call mulu16_sel
[186] (word) mulu16_sel::return#11 ← (word) mulu16_sel::return#12
to:sin16s::@11
sin16s::@11: scope:[sin16s] from sin16s::@10
[186] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
[187] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4
[188] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0
[189] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12
[187] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
[188] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4
[189] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0
[190] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12
to:sin16s::@6
sin16s::@6: scope:[sin16s] from sin16s::@11
[190] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
[191] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
to:sin16s::@3
sin16s::@3: scope:[sin16s] from sin16s::@12 sin16s::@6
[191] (signed word) sin16s::return#1 ← phi( sin16s::@12/(signed word~) sin16s::return#5 sin16s::@6/(signed word) sin16s::sinx#1 )
[192] (signed word) sin16s::return#1 ← phi( sin16s::@12/(signed word~) sin16s::return#5 sin16s::@6/(signed word) sin16s::sinx#1 )
to:sin16s::@return
sin16s::@return: scope:[sin16s] from sin16s::@3
[192] return
[193] return
to:@return
sin16s::@12: scope:[sin16s] from sin16s::@11
[193] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1
[194] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1
to:sin16s::@3
mulu16_sel: scope:[mulu16_sel] from sin16s::@10 sin16s::@2 sin16s::@7 sin16s::@8 sin16s::@9
[194] (byte) mulu16_sel::select#5 ← phi( sin16s::@9/(byte) 0 sin16s::@10/(byte) 0 sin16s::@2/(byte) 0 sin16s::@7/(byte) 1 sin16s::@8/(byte) 1 )
[194] (word) mulu16_sel::v2#5 ← phi( sin16s::@9/(word) mulu16_sel::v2#3 sin16s::@10/(word) mulu16_sel::v2#4 sin16s::@2/(word) mulu16_sel::v2#0 sin16s::@7/(word) mulu16_sel::v2#1 sin16s::@8/(word)(number) $10000/(number) 6 )
[194] (word) mulu16_sel::v1#5 ← phi( sin16s::@9/(word) mulu16_sel::v1#3 sin16s::@10/(word) mulu16_sel::v1#4 sin16s::@2/(word) mulu16_sel::v1#0 sin16s::@7/(word) mulu16_sel::v1#1 sin16s::@8/(word) mulu16_sel::v1#2 )
[195] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5
[196] (word) mul16u::b#1 ← (word) mulu16_sel::v2#5
[197] call mul16u
[198] (dword) mul16u::return#3 ← (dword) mul16u::res#2
[195] (byte) mulu16_sel::select#5 ← phi( sin16s::@9/(byte) 0 sin16s::@10/(byte) 0 sin16s::@2/(byte) 0 sin16s::@7/(byte) 1 sin16s::@8/(byte) 1 )
[195] (word) mulu16_sel::v2#5 ← phi( sin16s::@9/(word) mulu16_sel::v2#3 sin16s::@10/(word) mulu16_sel::v2#4 sin16s::@2/(word) mulu16_sel::v2#0 sin16s::@7/(word) mulu16_sel::v2#1 sin16s::@8/(word)(number) $10000/(number) 6 )
[195] (word) mulu16_sel::v1#5 ← phi( sin16s::@9/(word) mulu16_sel::v1#3 sin16s::@10/(word) mulu16_sel::v1#4 sin16s::@2/(word) mulu16_sel::v1#0 sin16s::@7/(word) mulu16_sel::v1#1 sin16s::@8/(word) mulu16_sel::v1#2 )
[196] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5
[197] (word) mul16u::b#1 ← (word) mulu16_sel::v2#5
[198] call mul16u
[199] (dword) mul16u::return#3 ← (dword) mul16u::res#2
to:mulu16_sel::@1
mulu16_sel::@1: scope:[mulu16_sel] from mulu16_sel
[199] (dword~) mulu16_sel::$0 ← (dword) mul16u::return#3
[200] (dword~) mulu16_sel::$1 ← (dword~) mulu16_sel::$0 << (byte) mulu16_sel::select#5
[201] (word) mulu16_sel::return#12 ← > (dword~) mulu16_sel::$1
[200] (dword~) mulu16_sel::$0 ← (dword) mul16u::return#3
[201] (dword~) mulu16_sel::$1 ← (dword~) mulu16_sel::$0 << (byte) mulu16_sel::select#5
[202] (word) mulu16_sel::return#12 ← > (dword~) mulu16_sel::$1
to:mulu16_sel::@return
mulu16_sel::@return: scope:[mulu16_sel] from mulu16_sel::@1
[202] return
[203] return
to:@return
div32u16u: scope:[div32u16u] from sin16s_gen2
[203] phi()
[204] call divr16u
[205] (word) divr16u::return#2 ← (word) divr16u::return#0
[204] phi()
[205] call divr16u
[206] (word) divr16u::return#2 ← (word) divr16u::return#0
to:div32u16u::@1
div32u16u::@1: scope:[div32u16u] from div32u16u
[206] (word) div32u16u::quotient_hi#0 ← (word) divr16u::return#2
[207] (word) divr16u::rem#4 ← (word) rem16u#1
[208] call divr16u
[209] (word) divr16u::return#3 ← (word) divr16u::return#0
[207] (word) div32u16u::quotient_hi#0 ← (word) divr16u::return#2
[208] (word) divr16u::rem#4 ← (word) rem16u#1
[209] call divr16u
[210] (word) divr16u::return#3 ← (word) divr16u::return#0
to:div32u16u::@2
div32u16u::@2: scope:[div32u16u] from div32u16u::@1
[210] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#3
[211] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0
[211] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#3
[212] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0
to:div32u16u::@return
div32u16u::@return: scope:[div32u16u] from div32u16u::@2
[212] return
[213] return
to:@return
divr16u: scope:[divr16u] from div32u16u div32u16u::@1
[213] (word) divr16u::dividend#5 ← phi( div32u16u/>(const dword) PI2_u4f28#0 div32u16u::@1/<(const dword) PI2_u4f28#0 )
[213] (word) divr16u::rem#10 ← phi( div32u16u/(byte) 0 div32u16u::@1/(word) divr16u::rem#4 )
[214] (word) divr16u::dividend#5 ← phi( div32u16u/>(const dword) PI2_u4f28#0 div32u16u::@1/<(const dword) PI2_u4f28#0 )
[214] (word) divr16u::rem#10 ← phi( div32u16u/(byte) 0 div32u16u::@1/(word) divr16u::rem#4 )
to:divr16u::@1
divr16u::@1: scope:[divr16u] from divr16u divr16u::@3
[214] (byte) divr16u::i#2 ← phi( divr16u/(byte) 0 divr16u::@3/(byte) divr16u::i#1 )
[214] (word) divr16u::quotient#3 ← phi( divr16u/(byte) 0 divr16u::@3/(word) divr16u::return#0 )
[214] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#0 )
[214] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 )
[215] (word) divr16u::rem#0 ← (word) divr16u::rem#5 << (byte) 1
[216] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3
[217] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte) $80
[218] if((byte~) divr16u::$2==(byte) 0) goto divr16u::@2
[215] (byte) divr16u::i#2 ← phi( divr16u/(byte) 0 divr16u::@3/(byte) divr16u::i#1 )
[215] (word) divr16u::quotient#3 ← phi( divr16u/(byte) 0 divr16u::@3/(word) divr16u::return#0 )
[215] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#0 )
[215] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 )
[216] (word) divr16u::rem#0 ← (word) divr16u::rem#5 << (byte) 1
[217] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3
[218] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte) $80
[219] if((byte~) divr16u::$2==(byte) 0) goto divr16u::@2
to:divr16u::@4
divr16u::@4: scope:[divr16u] from divr16u::@1
[219] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1
[220] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1
to:divr16u::@2
divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4
[220] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[221] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1
[222] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1
[223] if((word) divr16u::rem#6<(const word) sin16s_gen2::wavelength#0) goto divr16u::@3
[221] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[222] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1
[223] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1
[224] if((word) divr16u::rem#6<(const word) sin16s_gen2::wavelength#0) goto divr16u::@3
to:divr16u::@5
divr16u::@5: scope:[divr16u] from divr16u::@2
[224] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[225] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) sin16s_gen2::wavelength#0
[225] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[226] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) sin16s_gen2::wavelength#0
to:divr16u::@3
divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5
[226] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[226] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#2 )
[227] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[228] if((byte) divr16u::i#1!=(byte) $10) goto divr16u::@1
[227] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[227] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#2 )
[228] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[229] if((byte) divr16u::i#1!=(byte) $10) goto divr16u::@1
to:divr16u::@6
divr16u::@6: scope:[divr16u] from divr16u::@3
[229] (word) rem16u#1 ← (word) divr16u::rem#11
[230] (word) rem16u#1 ← (word) divr16u::rem#11
to:divr16u::@return
divr16u::@return: scope:[divr16u] from divr16u::@6
[230] return
[231] return
to:@return
irq: scope:[irq] from
[231] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[232] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
[232] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[233] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
to:irq::@2
irq::@2: scope:[irq] from irq
[233] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
[234] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
to:irq::@1
irq::@1: scope:[irq] from irq irq::@2
[234] (byte) frame_cnt#2 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 )
[235] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
[236] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
[235] (byte) frame_cnt#2 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 )
[236] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
[237] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
to:irq::@return
irq::@return: scope:[irq] from irq::@1
[237] return
[238] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -96,14 +96,14 @@
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 $1 zp ZP_WORD:59 4.0
(byte~) bitmap_plot::$2 reg byte a 4.0
(word~) bitmap_plot::$3 $3 zp ZP_WORD:57 1.0
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 plotter zp ZP_WORD:57 1.0
(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:57 3.0
(word) bitmap_plot::x
(signed word) bitmap_plot::x#0 x zp ZP_WORD:53 0.6875
(word) bitmap_plot::x#0 x zp ZP_WORD:53 3.75
(byte) bitmap_plot::y
(byte) bitmap_plot::y#0 reg byte a 15.0
(byte) bitmap_plot::y#0 reg byte x 7.5
(byte[$100]) bitmap_plot_bit
(const byte[$100]) bitmap_plot_bit#0 bitmap_plot_bit = { fill( $100, 0) }
(byte[$100]) bitmap_plot_yhi
@ -161,7 +161,7 @@
(word) divr16u::return#2 return zp ZP_WORD:50 4.0
(word) divr16u::return#3 return zp ZP_WORD:50 4.0
(byte) frame_cnt
(byte) frame_cnt#0 frame_cnt zp ZP_BYTE:52 0.5555555555555556
(byte) frame_cnt#0 frame_cnt zp ZP_BYTE:52 0.5454545454545455
(byte) frame_cnt#1 frame_cnt zp ZP_BYTE:52 4.0
(byte) frame_cnt#2 frame_cnt zp ZP_BYTE:52 40.0
(void()) init_irq()
@ -171,15 +171,14 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(label) irq::@2
(label) irq::@return
(void()) main()
(word~) main::$10 $10 zp ZP_WORD:53 11.0
(signed word~) main::$11 $11 zp ZP_WORD:53 22.0
(word~) main::$15 $15 zp ZP_WORD:55 11.0
(word~) main::$16 $16 zp ZP_WORD:55 11.0
(signed word~) main::$17 $17 zp ZP_WORD:55 22.0
(signed word~) main::$18 $18 zp ZP_WORD:55 11.0
(word~) main::$32 $32 zp ZP_WORD:9 22.0
(word~) main::$33 $33 zp ZP_WORD:9 22.0
(signed word*~) main::$34 $34 zp ZP_WORD:9 22.0
(signed word*~) main::$35 $35 zp ZP_WORD:9 22.0
(word~) main::$9 $9 zp ZP_WORD:53 11.0
(label) main::@1
(label) main::@10
(label) main::@11
@ -202,17 +201,17 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(word) main::idx_x
(word) main::idx_x#1 idx_x zp ZP_WORD:2 11.0
(word) main::idx_x#10 idx_x zp ZP_WORD:2 3.0
(word) main::idx_x#11 idx_x zp ZP_WORD:2 1.2692307692307692
(word) main::idx_x#11 idx_x zp ZP_WORD:2 1.222222222222222
(word) main::idx_y
(word) main::idx_y#1 idx_y zp ZP_WORD:6 11.0
(word) main::idx_y#10 idx_y zp ZP_WORD:6 3.142857142857143
(word) main::idx_y#3 idx_y zp ZP_WORD:6 1.0999999999999999
(word) main::idx_y#3 idx_y zp ZP_WORD:6 1.064516129032258
(signed word) main::r
(signed word) main::r#1 r zp ZP_WORD:4 5.5
(signed word) main::r#10 r zp ZP_WORD:4 1.2941176470588236
(signed word) main::r#10 r zp ZP_WORD:4 1.2571428571428571
(byte) main::r_add
(byte) main::r_add#1 r_add zp ZP_BYTE:8 22.0
(byte) main::r_add#10 r_add zp ZP_BYTE:8 2.081081081081081
(byte) main::r_add#10 r_add zp ZP_BYTE:8 2.026315789473684
(byte) main::r_add#12 r_add zp ZP_BYTE:8 16.5
(signed word) main::sin_y
(signed word) main::sin_y#0 sin_y zp ZP_WORD:9 11.0
@ -231,9 +230,11 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f
(byte*) main::toD0181_screen
(word) main::x
(signed word) main::x#0 x zp ZP_WORD:53 0.8461538461538461
(signed dword) main::xpos
(signed dword) main::xpos#0 xpos zp ZP_DWORD:11 22.0
(word) main::y
(signed word) main::y#0 y zp ZP_WORD:55 11.0
(signed dword) main::ypos
(signed dword) main::ypos#0 ypos zp ZP_DWORD:11 22.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
@ -389,7 +390,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(word) sin16s::x5_128#0 x5_128 zp ZP_WORD:74 4.0
(void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max)
(signed dword~) sin16s_gen2::$5 $5 zp ZP_DWORD:11 22.0
(word~) sin16s_gen2::$6 $6 zp ZP_WORD:70 11.0
(word~) sin16s_gen2::$8 $8 zp ZP_WORD:70 11.0
(label) sin16s_gen2::@1
(label) sin16s_gen2::@2
(label) sin16s_gen2::@3
@ -445,10 +446,10 @@ zp ZP_WORD:48 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
zp ZP_WORD:50 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ]
reg byte x [ divr16u::i#2 divr16u::i#1 ]
zp ZP_BYTE:52 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ]
zp ZP_WORD:53 [ main::$9 main::$11 bitmap_plot::x#0 ]
zp ZP_WORD:55 [ main::$15 main::$17 main::$18 ]
reg byte a [ bitmap_plot::y#0 ]
zp ZP_WORD:57 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
zp ZP_WORD:53 [ main::$10 main::$11 main::x#0 bitmap_plot::x#0 ]
zp ZP_WORD:55 [ main::$16 main::$17 main::y#0 ]
reg byte x [ bitmap_plot::y#0 ]
zp ZP_WORD:57 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ]
zp ZP_WORD:59 [ bitmap_plot::$1 ]
reg byte a [ bitmap_plot::$2 ]
zp ZP_WORD:61 [ mul16s::$9 mul16s::$16 ]
@ -459,7 +460,7 @@ reg byte a [ bitmap_init::$4 ]
reg byte a [ bitmap_init::$5 ]
reg byte a [ bitmap_init::$6 ]
zp ZP_DWORD:66 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ]
zp ZP_WORD:70 [ sin16s_gen2::$6 ]
zp ZP_WORD:70 [ sin16s_gen2::$8 ]
zp ZP_WORD:72 [ sin16s::x1#0 ]
zp ZP_WORD:74 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 sin16s::x5_128#0 ]
zp ZP_WORD:76 [ div32u16u::quotient_hi#0 ]

View File

@ -0,0 +1,72 @@
// Show default font on screen
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label SCREEN = $400
main: {
.label screen = 4
.label ch = 3
.label x = 2
jsr memset
lda #0
sta x
lda #<SCREEN+$28+1
sta screen
lda #>SCREEN+$28+1
sta screen+1
lda #0
sta ch
b1:
ldx #0
b2:
lda ch
ldy #0
sta (screen),y
inc screen
bne !+
inc screen+1
!:
inc ch
inx
cpx #$10
bne b2
lda #$28-$10
clc
adc screen
sta screen
bcc !+
inc screen+1
!:
inc x
lda #$10
cmp x
bne b1
rts
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
.const c = ' '
.const num = $3e8
.label str = SCREEN
.label end = str+num
.label dst = 6
lda #<str
sta dst
lda #>str
sta dst+1
b1:
lda #c
ldy #0
sta (dst),y
inc dst
bne !+
inc dst+1
!:
lda dst+1
cmp #>end
bne b1
lda dst
cmp #<end
bne b1
rts
}

View File

@ -0,0 +1,48 @@
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call memset
to:main::@1
main::@1: scope:[main] from main main::@3
[6] (byte) main::x#4 ← phi( main::@3/(byte) main::x#1 main/(byte) 0 )
[6] (byte*) main::screen#5 ← phi( main::@3/(byte*) main::screen#2 main/(const byte*) SCREEN#0+(byte) $28+(byte) 1 )
[6] (byte) main::ch#3 ← phi( main::@3/(byte) main::ch#1 main/(byte) 0 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[7] (byte) main::y#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::y#1 )
[7] (byte*) main::screen#3 ← phi( main::@1/(byte*) main::screen#5 main::@2/(byte*) main::screen#1 )
[7] (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#3 main::@2/(byte) main::ch#1 )
[8] *((byte*) main::screen#3) ← (byte) main::ch#2
[9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3
[10] (byte) main::ch#1 ← ++ (byte) main::ch#2
[11] (byte) main::y#1 ← ++ (byte) main::y#2
[12] if((byte) main::y#1!=(byte) $10) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10
[14] (byte) main::x#1 ← ++ (byte) main::x#4
[15] if((byte) main::x#1!=(byte) $10) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[16] return
to:@return
memset: scope:[memset] from main
[17] phi()
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[18] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@1/(byte*) memset::dst#1 )
[19] *((byte*) memset::dst#2) ← (const byte) memset::c#0
[20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[22] return
to:@return

View File

@ -0,0 +1,985 @@
Adding pointer type conversion cast to void pointer (byte*) memcpy::source in (byte*) memcpy::src ← (void*) memcpy::source
Adding pointer type conversion cast to void pointer (byte*) memcpy::destination in (byte*) memcpy::dst ← (void*) memcpy::destination
Adding pointer type conversion cast to void pointer (byte*) memset::str in (byte*) memset::dst ← (void*) memset::str
Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400
Adding void pointer type conversion cast (void*) SCREEN in (void*~) main::$0 ← call memset (byte*) SCREEN (byte) ' ' (number) $3e8
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Identified constant variable (byte*) SCREEN
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) memset::@3
Culled Empty Block (label) @3
Culled Empty Block (label) main::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
memset: scope:[memset] from main
(byte) memset::c#2 ← phi( main/(byte) memset::c#0 )
(word) memset::num#1 ← phi( main/(word) memset::num#0 )
(void*) memset::str#1 ← phi( main/(void*) memset::str#0 )
(byte*~) memset::$0 ← ((byte*)) (void*) memset::str#1
(byte*~) memset::$1 ← (byte*~) memset::$0 + (word) memset::num#1
(byte*) memset::end#0 ← (byte*~) memset::$1
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#1
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
(void*) memset::str#3 ← phi( memset/(void*) memset::str#1 memset::@1/(void*) memset::str#3 )
(byte*) memset::end#1 ← phi( memset/(byte*) memset::end#0 memset::@1/(byte*) memset::end#1 )
(byte*) memset::dst#2 ← phi( memset/(byte*) memset::dst#0 memset::@1/(byte*) memset::dst#1 )
(byte) memset::c#1 ← phi( memset/(byte) memset::c#2 memset::@1/(byte) memset::c#1 )
*((byte*) memset::dst#2) ← (byte) memset::c#1
(byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
(bool~) memset::$2 ← (byte*) memset::dst#1 != (byte*) memset::end#1
if((bool~) memset::$2) goto memset::@1
to:memset::@2
memset::@2: scope:[memset] from memset::@1
(void*) memset::str#2 ← phi( memset::@1/(void*) memset::str#3 )
(void*) memset::return#0 ← (void*) memset::str#2
to:memset::@return
memset::@return: scope:[memset] from memset::@2
(void*) memset::return#3 ← phi( memset::@2/(void*) memset::return#0 )
(void*) memset::return#1 ← (void*) memset::return#3
return
to:@return
@4: scope:[] from @begin
(byte*) SCREEN#0 ← ((byte*)) (number) $400
to:@5
main: scope:[main] from @5
(void*) memset::str#0 ← (void*)(byte*) SCREEN#0
(byte) memset::c#0 ← (byte) ' '
(word) memset::num#0 ← (number) $3e8
call memset
(void*) memset::return#2 ← (void*) memset::return#1
to:main::@5
main::@5: scope:[main] from main
(byte*~) main::$1 ← (byte*) SCREEN#0 + (number) $28
(byte*~) main::$2 ← (byte*~) main::$1 + (number) 1
(byte*) main::screen#0 ← (byte*~) main::$2
(byte) main::ch#0 ← (number) 0
(byte) main::x#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main::@3 main::@5
(byte) main::x#4 ← phi( main::@3/(byte) main::x#1 main::@5/(byte) main::x#0 )
(byte*) main::screen#5 ← phi( main::@3/(byte*) main::screen#2 main::@5/(byte*) main::screen#0 )
(byte) main::ch#3 ← phi( main::@3/(byte) main::ch#4 main::@5/(byte) main::ch#0 )
(byte) main::y#0 ← (byte) 0
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
(byte) main::x#3 ← phi( main::@1/(byte) main::x#4 main::@2/(byte) main::x#3 )
(byte) main::y#2 ← phi( main::@1/(byte) main::y#0 main::@2/(byte) main::y#1 )
(byte*) main::screen#3 ← phi( main::@1/(byte*) main::screen#5 main::@2/(byte*) main::screen#1 )
(byte) main::ch#2 ← phi( main::@1/(byte) main::ch#3 main::@2/(byte) main::ch#1 )
*((byte*) main::screen#3) ← (byte) main::ch#2
(byte*) main::screen#1 ← ++ (byte*) main::screen#3
(byte) main::ch#1 ← ++ (byte) main::ch#2
(byte) main::y#1 ← (byte) main::y#2 + rangenext(0,$f)
(bool~) main::$3 ← (byte) main::y#1 != rangelast(0,$f)
if((bool~) main::$3) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
(byte) main::ch#4 ← phi( main::@2/(byte) main::ch#1 )
(byte) main::x#2 ← phi( main::@2/(byte) main::x#3 )
(byte*) main::screen#4 ← phi( main::@2/(byte*) main::screen#1 )
(byte*) main::screen#2 ← (byte*) main::screen#4 + (number) $28-(number) $10
(byte) main::x#1 ← (byte) main::x#2 + rangenext(0,$f)
(bool~) main::$4 ← (byte) main::x#1 != rangelast(0,$f)
if((bool~) main::$4) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
return
to:@return
@5: scope:[] from @4
call main
to:@6
@6: scope:[] from @5
to:@end
@end: scope:[] from @6
SYMBOL TABLE SSA
(label) @4
(label) @5
(label) @6
(label) @begin
(label) @end
(byte*) SCREEN
(byte*) SCREEN#0
(void()) main()
(byte*~) main::$1
(byte*~) main::$2
(bool~) main::$3
(bool~) main::$4
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@return
(byte) main::ch
(byte) main::ch#0
(byte) main::ch#1
(byte) main::ch#2
(byte) main::ch#3
(byte) main::ch#4
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen#1
(byte*) main::screen#2
(byte*) main::screen#3
(byte*) main::screen#4
(byte*) main::screen#5
(byte) main::x
(byte) main::x#0
(byte) main::x#1
(byte) main::x#2
(byte) main::x#3
(byte) main::x#4
(byte) main::y
(byte) main::y#0
(byte) main::y#1
(byte) main::y#2
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte*~) memset::$0
(byte*~) memset::$1
(bool~) memset::$2
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
(byte*) memset::dst#2
(byte*) memset::end
(byte*) memset::end#0
(byte*) memset::end#1
(word) memset::num
(word) memset::num#0
(word) memset::num#1
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
(void*) memset::return#2
(void*) memset::return#3
(void*) memset::str
(void*) memset::str#0
(void*) memset::str#1
(void*) memset::str#2
(void*) memset::str#3
Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8
Adding number conversion cast (unumber) $28 in (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) $28
Adding number conversion cast (unumber) 1 in (byte*~) main::$2 ← (byte*~) main::$1 + (number) 1
Adding number conversion cast (unumber) 0 in (byte) main::ch#0 ← (number) 0
Adding number conversion cast (unumber) $28-$10 in (byte*) main::screen#2 ← (byte*) main::screen#4 + (number) $28-(number) $10
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#1
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#1
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (byte) main::ch#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $3e8
Simplifying constant integer cast $28
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $3e8
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) memset::end#0 = (byte*~) memset::$1
Alias (void*) memset::return#0 = (void*) memset::str#2 (void*) memset::str#3 (void*) memset::return#3 (void*) memset::return#1
Alias (byte*) main::screen#0 = (byte*~) main::$2
Alias (byte*) main::screen#1 = (byte*) main::screen#4
Alias (byte) main::x#2 = (byte) main::x#3
Alias (byte) main::ch#1 = (byte) main::ch#4
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) memset::c#1
Self Phi Eliminated (byte*) memset::end#1
Self Phi Eliminated (void*) memset::return#0
Self Phi Eliminated (byte) main::x#2
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (void*) memset::str#1 (void*) memset::str#0
Identical Phi Values (word) memset::num#1 (word) memset::num#0
Identical Phi Values (byte) memset::c#2 (byte) memset::c#0
Identical Phi Values (byte) memset::c#1 (byte) memset::c#2
Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0
Identical Phi Values (void*) memset::return#0 (void*) memset::str#1
Identical Phi Values (byte) main::x#2 (byte) main::x#4
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$2 [9] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
Simple Condition (bool~) main::$3 [34] if((byte) main::y#1!=rangelast(0,$f)) goto main::@2
Simple Condition (bool~) main::$4 [39] if((byte) main::x#1!=rangelast(0,$f)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const byte) memset::c#0 = ' '
Constant (const word) memset::num#0 = $3e8
Constant (const byte) main::ch#0 = 0
Constant (const byte) main::x#0 = 0
Constant (const byte) main::y#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (void*)SCREEN#0 in [16] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [32] main::y#1 ← ++ main::y#2 to ++
Resolved ranged comparison value [34] if(main::y#1!=rangelast(0,$f)) goto main::@2 to (number) $10
Resolved ranged next value [37] main::x#1 ← ++ main::x#4 to ++
Resolved ranged comparison value [39] if(main::x#1!=rangelast(0,$f)) goto main::@1 to (number) $10
Eliminating unused variable (void*) memset::return#2 and assignment [10] (void*) memset::return#2 ← (void*) memset::str#0
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) $10 in if((byte) main::y#1!=(number) $10) goto main::@2
Adding number conversion cast (unumber) $10 in if((byte) main::x#1!=(number) $10) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $10
Simplifying constant integer cast $10
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) $10
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [10] (byte*~) main::$1 ← (const byte*) SCREEN#0 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const void*) memset::str#0 = (void*)SCREEN#0
Constant (const byte*) main::$1 = SCREEN#0+$28
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (byte*)memset::str#0 in [0] (byte*~) memset::$0 ← (byte*)(const void*) memset::str#0
Constant value identified (byte*)memset::str#0 in [2] (byte*) memset::dst#0 ← (byte*)(const void*) memset::str#0
Successful SSA optimization Pass2ConstantValues
Constant right-side identified [9] (byte*) main::screen#0 ← (const byte*) main::$1 + (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) memset::$0 = (byte*)memset::str#0
Constant (const byte*) memset::dst#0 = (byte*)memset::str#0
Constant (const byte*) main::screen#0 = main::$1+1
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memset::$0 + (const word) memset::num#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) memset::end#0 = memset::$0+memset::num#0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte*) memset::dst#0
Inlining constant with var siblings (const byte) main::ch#0
Inlining constant with var siblings (const byte) main::x#0
Inlining constant with var siblings (const byte) main::y#0
Inlining constant with var siblings (const byte*) main::screen#0
Constant inlined memset::$0 = (byte*)(const void*) memset::str#0
Constant inlined main::screen#0 = (const byte*) SCREEN#0+(byte) $28+(byte) 1
Constant inlined main::$1 = (const byte*) SCREEN#0+(byte) $28
Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0
Constant inlined main::x#0 = (byte) 0
Constant inlined main::y#0 = (byte) 0
Constant inlined main::ch#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting memset::@4(between memset::@1 and memset::@1)
Added new block during phi lifting main::@6(between main::@3 and main::@1)
Added new block during phi lifting main::@7(between main::@2 and main::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @5
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of memset
Adding NOP phi() at start of memset::@2
CALL GRAPH
Calls in [] to main:3
Calls in [main] to memset:7
Created 7 initial phi equivalence classes
Coalesced [10] main::ch#6 ← main::ch#3
Coalesced [11] main::screen#7 ← main::screen#5
Coalesced [22] main::ch#5 ← main::ch#1
Coalesced [23] main::screen#6 ← main::screen#2
Coalesced [24] main::x#5 ← main::x#1
Coalesced (already) [25] main::ch#7 ← main::ch#1
Coalesced [26] main::screen#8 ← main::screen#1
Coalesced [27] main::y#3 ← main::y#1
Coalesced [35] memset::dst#3 ← memset::dst#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) @6
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@7
Culled Empty Block (label) memset::@2
Culled Empty Block (label) memset::@4
Renumbering block @5 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 main
Adding NOP phi() at start of memset
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call memset
to:main::@1
main::@1: scope:[main] from main main::@3
[6] (byte) main::x#4 ← phi( main::@3/(byte) main::x#1 main/(byte) 0 )
[6] (byte*) main::screen#5 ← phi( main::@3/(byte*) main::screen#2 main/(const byte*) SCREEN#0+(byte) $28+(byte) 1 )
[6] (byte) main::ch#3 ← phi( main::@3/(byte) main::ch#1 main/(byte) 0 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[7] (byte) main::y#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::y#1 )
[7] (byte*) main::screen#3 ← phi( main::@1/(byte*) main::screen#5 main::@2/(byte*) main::screen#1 )
[7] (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#3 main::@2/(byte) main::ch#1 )
[8] *((byte*) main::screen#3) ← (byte) main::ch#2
[9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3
[10] (byte) main::ch#1 ← ++ (byte) main::ch#2
[11] (byte) main::y#1 ← ++ (byte) main::y#2
[12] if((byte) main::y#1!=(byte) $10) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10
[14] (byte) main::x#1 ← ++ (byte) main::x#4
[15] if((byte) main::x#1!=(byte) $10) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[16] return
to:@return
memset: scope:[memset] from main
[17] phi()
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[18] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@1/(byte*) memset::dst#1 )
[19] *((byte*) memset::dst#2) ← (const byte) memset::c#0
[20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[22] return
to:@return
VARIABLE REGISTER WEIGHTS
(byte*) SCREEN
(void()) main()
(byte) main::ch
(byte) main::ch#1 35.5
(byte) main::ch#2 104.66666666666666
(byte) main::ch#3 22.0
(byte*) main::screen
(byte*) main::screen#1 53.25
(byte*) main::screen#2 7.333333333333333
(byte*) main::screen#3 157.0
(byte*) main::screen#5 22.0
(byte) main::x
(byte) main::x#1 16.5
(byte) main::x#4 2.75
(byte) main::y
(byte) main::y#1 151.5
(byte) main::y#2 50.5
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte) memset::c
(byte*) memset::dst
(byte*) memset::dst#1 16.5
(byte*) memset::dst#2 16.5
(byte*) memset::end
(word) memset::num
(void*) memset::return
(void*) memset::str
Initial phi equivalence classes
[ main::x#4 main::x#1 ]
[ main::ch#2 main::ch#3 main::ch#1 ]
[ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
[ main::y#2 main::y#1 ]
[ memset::dst#2 memset::dst#1 ]
Complete equivalence classes
[ main::x#4 main::x#1 ]
[ main::ch#2 main::ch#3 main::ch#1 ]
[ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
[ main::y#2 main::y#1 ]
[ memset::dst#2 memset::dst#1 ]
Allocated zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Allocated zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
Allocated zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
Allocated zp ZP_BYTE:6 [ main::y#2 main::y#1 ]
Allocated zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ]
INITIAL ASM
//SEG0 File Comments
// Show default font on screen
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label SCREEN = $400
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//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]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
.label screen = 4
.label ch = 3
.label y = 6
.label x = 2
//SEG11 [5] call memset
//SEG12 [17] phi from main to memset [phi:main->memset]
memset_from_main:
jsr memset
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG14 [6] phi (byte) main::x#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta x
//SEG15 [6] phi (byte*) main::screen#5 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<SCREEN+$28+1
sta screen
lda #>SCREEN+$28+1
sta screen+1
//SEG16 [6] phi (byte) main::ch#3 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #0
sta ch
jmp b1
//SEG17 [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
b1_from_b3:
//SEG18 [6] phi (byte) main::x#4 = (byte) main::x#1 [phi:main::@3->main::@1#0] -- register_copy
//SEG19 [6] phi (byte*) main::screen#5 = (byte*) main::screen#2 [phi:main::@3->main::@1#1] -- register_copy
//SEG20 [6] phi (byte) main::ch#3 = (byte) main::ch#1 [phi:main::@3->main::@1#2] -- register_copy
jmp b1
//SEG21 main::@1
b1:
//SEG22 [7] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG23 [7] phi (byte) main::y#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1
lda #0
sta y
//SEG24 [7] phi (byte*) main::screen#3 = (byte*) main::screen#5 [phi:main::@1->main::@2#1] -- register_copy
//SEG25 [7] phi (byte) main::ch#2 = (byte) main::ch#3 [phi:main::@1->main::@2#2] -- register_copy
jmp b2
//SEG26 [7] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
b2_from_b2:
//SEG27 [7] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@2->main::@2#0] -- register_copy
//SEG28 [7] phi (byte*) main::screen#3 = (byte*) main::screen#1 [phi:main::@2->main::@2#1] -- register_copy
//SEG29 [7] phi (byte) main::ch#2 = (byte) main::ch#1 [phi:main::@2->main::@2#2] -- register_copy
jmp b2
//SEG30 main::@2
b2:
//SEG31 [8] *((byte*) main::screen#3) ← (byte) main::ch#2 -- _deref_pbuz1=vbuz2
lda ch
ldy #0
sta (screen),y
//SEG32 [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 -- pbuz1=_inc_pbuz1
inc screen
bne !+
inc screen+1
!:
//SEG33 [10] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuz1=_inc_vbuz1
inc ch
//SEG34 [11] (byte) main::y#1 ← ++ (byte) main::y#2 -- vbuz1=_inc_vbuz1
inc y
//SEG35 [12] if((byte) main::y#1!=(byte) $10) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp y
bne b2_from_b2
jmp b3
//SEG36 main::@3
b3:
//SEG37 [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 -- pbuz1=pbuz1_plus_vbuc1
lda #$28-$10
clc
adc screen
sta screen
bcc !+
inc screen+1
!:
//SEG38 [14] (byte) main::x#1 ← ++ (byte) main::x#4 -- vbuz1=_inc_vbuz1
inc x
//SEG39 [15] if((byte) main::x#1!=(byte) $10) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp x
bne b1_from_b3
jmp breturn
//SEG40 main::@return
breturn:
//SEG41 [16] return
rts
}
//SEG42 memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
.const c = ' '
.const num = $3e8
.label str = SCREEN
.label end = str+num
.label dst = 7
//SEG43 [18] phi from memset to memset::@1 [phi:memset->memset::@1]
b1_from_memset:
//SEG44 [18] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
lda #<str
sta dst
lda #>str
sta dst+1
jmp b1
//SEG45 [18] phi from memset::@1 to memset::@1 [phi:memset::@1->memset::@1]
b1_from_b1:
//SEG46 [18] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@1->memset::@1#0] -- register_copy
jmp b1
//SEG47 memset::@1
b1:
//SEG48 [19] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
lda #c
ldy #0
sta (dst),y
//SEG49 [20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc dst
bne !+
inc dst+1
!:
//SEG50 [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuc1_then_la1
lda dst+1
cmp #>end
bne b1_from_b1
lda dst
cmp #<end
bne b1_from_b1
jmp breturn
//SEG51 memset::@return
breturn:
//SEG52 [22] return
rts
}
//SEG53 File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [8] *((byte*) main::screen#3) ← (byte) main::ch#2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ( main:2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ main::y#2 main::y#1 ]
Statement [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 [ main::x#4 main::ch#1 main::screen#2 ] ( main:2 [ main::x#4 main::ch#1 main::screen#2 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
Statement [19] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 [ memset::dst#1 ] ( main:2::memset:5 [ memset::dst#1 ] ) always clobbers reg byte a
Statement [8] *((byte*) main::screen#3) ← (byte) main::ch#2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ( main:2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::y#2 main::y#1 ]
Statement [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 [ main::x#4 main::ch#1 main::screen#2 ] ( main:2 [ main::x#4 main::ch#1 main::screen#2 ] ) always clobbers reg byte a
Statement [19] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 [ memset::dst#1 ] ( main:2::memset:5 [ memset::dst#1 ] ) always clobbers reg byte a
Statement [8] *((byte*) main::screen#3) ← (byte) main::ch#2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ( main:2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ) always clobbers reg byte a reg byte y
Statement [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 [ main::x#4 main::ch#1 main::screen#2 ] ( main:2 [ main::x#4 main::ch#1 main::screen#2 ] ) always clobbers reg byte a
Statement [19] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 [ memset::dst#1 ] ( main:2::memset:5 [ memset::dst#1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::x#4 main::x#1 ] : zp ZP_BYTE:2 , reg byte x ,
Potential registers zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] : zp ZP_BYTE:3 , reg byte x ,
Potential registers zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_BYTE:6 [ main::y#2 main::y#1 ] : zp ZP_BYTE:6 , reg byte x ,
Potential registers zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ] : zp ZP_WORD:7 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 239.58: zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] 202: zp ZP_BYTE:6 [ main::y#2 main::y#1 ] 162.17: zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] 19.25: zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplift Scope [memset] 33: zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ]
Uplift Scope []
Uplifting [main] best 5785 combination zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] reg byte x [ main::y#2 main::y#1 ] zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplifting [memset] best 5785 combination zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ]
Uplifting [] best 5785 combination
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
Uplifting [main] best 5785 combination zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplifting [main] best 5785 combination zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Allocated (was zp ZP_WORD:7) zp ZP_WORD:6 [ memset::dst#2 memset::dst#1 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
// Show default font on screen
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label SCREEN = $400
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//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]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
.label screen = 4
.label ch = 3
.label x = 2
//SEG11 [5] call memset
//SEG12 [17] phi from main to memset [phi:main->memset]
memset_from_main:
jsr memset
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG14 [6] phi (byte) main::x#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta x
//SEG15 [6] phi (byte*) main::screen#5 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<SCREEN+$28+1
sta screen
lda #>SCREEN+$28+1
sta screen+1
//SEG16 [6] phi (byte) main::ch#3 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #0
sta ch
jmp b1
//SEG17 [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
b1_from_b3:
//SEG18 [6] phi (byte) main::x#4 = (byte) main::x#1 [phi:main::@3->main::@1#0] -- register_copy
//SEG19 [6] phi (byte*) main::screen#5 = (byte*) main::screen#2 [phi:main::@3->main::@1#1] -- register_copy
//SEG20 [6] phi (byte) main::ch#3 = (byte) main::ch#1 [phi:main::@3->main::@1#2] -- register_copy
jmp b1
//SEG21 main::@1
b1:
//SEG22 [7] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG23 [7] phi (byte) main::y#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG24 [7] phi (byte*) main::screen#3 = (byte*) main::screen#5 [phi:main::@1->main::@2#1] -- register_copy
//SEG25 [7] phi (byte) main::ch#2 = (byte) main::ch#3 [phi:main::@1->main::@2#2] -- register_copy
jmp b2
//SEG26 [7] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
b2_from_b2:
//SEG27 [7] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@2->main::@2#0] -- register_copy
//SEG28 [7] phi (byte*) main::screen#3 = (byte*) main::screen#1 [phi:main::@2->main::@2#1] -- register_copy
//SEG29 [7] phi (byte) main::ch#2 = (byte) main::ch#1 [phi:main::@2->main::@2#2] -- register_copy
jmp b2
//SEG30 main::@2
b2:
//SEG31 [8] *((byte*) main::screen#3) ← (byte) main::ch#2 -- _deref_pbuz1=vbuz2
lda ch
ldy #0
sta (screen),y
//SEG32 [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 -- pbuz1=_inc_pbuz1
inc screen
bne !+
inc screen+1
!:
//SEG33 [10] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuz1=_inc_vbuz1
inc ch
//SEG34 [11] (byte) main::y#1 ← ++ (byte) main::y#2 -- vbuxx=_inc_vbuxx
inx
//SEG35 [12] if((byte) main::y#1!=(byte) $10) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
cpx #$10
bne b2_from_b2
jmp b3
//SEG36 main::@3
b3:
//SEG37 [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 -- pbuz1=pbuz1_plus_vbuc1
lda #$28-$10
clc
adc screen
sta screen
bcc !+
inc screen+1
!:
//SEG38 [14] (byte) main::x#1 ← ++ (byte) main::x#4 -- vbuz1=_inc_vbuz1
inc x
//SEG39 [15] if((byte) main::x#1!=(byte) $10) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp x
bne b1_from_b3
jmp breturn
//SEG40 main::@return
breturn:
//SEG41 [16] return
rts
}
//SEG42 memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
.const c = ' '
.const num = $3e8
.label str = SCREEN
.label end = str+num
.label dst = 6
//SEG43 [18] phi from memset to memset::@1 [phi:memset->memset::@1]
b1_from_memset:
//SEG44 [18] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
lda #<str
sta dst
lda #>str
sta dst+1
jmp b1
//SEG45 [18] phi from memset::@1 to memset::@1 [phi:memset::@1->memset::@1]
b1_from_b1:
//SEG46 [18] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@1->memset::@1#0] -- register_copy
jmp b1
//SEG47 memset::@1
b1:
//SEG48 [19] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
lda #c
ldy #0
sta (dst),y
//SEG49 [20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc dst
bne !+
inc dst+1
!:
//SEG50 [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuc1_then_la1
lda dst+1
cmp #>end
bne b1_from_b1
lda dst
cmp #<end
bne b1_from_b1
jmp breturn
//SEG51 memset::@return
breturn:
//SEG52 [22] return
rts
}
//SEG53 File Data
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b1_from_b1 with b1
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_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction memset_from_main:
Removing instruction b1_from_main:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_memset:
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
Removing instruction jmp b2
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::ch
(byte) main::ch#1 ch zp ZP_BYTE:3 35.5
(byte) main::ch#2 ch zp ZP_BYTE:3 104.66666666666666
(byte) main::ch#3 ch zp ZP_BYTE:3 22.0
(byte*) main::screen
(byte*) main::screen#1 screen zp ZP_WORD:4 53.25
(byte*) main::screen#2 screen zp ZP_WORD:4 7.333333333333333
(byte*) main::screen#3 screen zp ZP_WORD:4 157.0
(byte*) main::screen#5 screen zp ZP_WORD:4 22.0
(byte) main::x
(byte) main::x#1 x zp ZP_BYTE:2 16.5
(byte) main::x#4 x zp ZP_BYTE:2 2.75
(byte) main::y
(byte) main::y#1 reg byte x 151.5
(byte) main::y#2 reg byte x 50.5
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@return
(byte) memset::c
(const byte) memset::c#0 c = (byte) ' '
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:6 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:6 16.5
(byte*) memset::end
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
(word) memset::num
(const word) memset::num#0 num = (word) $3e8
(void*) memset::return
(void*) memset::str
(const void*) memset::str#0 str = (void*)(const byte*) SCREEN#0
zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
reg byte x [ main::y#2 main::y#1 ]
zp ZP_WORD:6 [ memset::dst#2 memset::dst#1 ]
FINAL ASSEMBLER
Score: 4693
//SEG0 File Comments
// Show default font on screen
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label SCREEN = $400
//SEG3 @begin
//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
main: {
.label screen = 4
.label ch = 3
.label x = 2
//SEG11 [5] call memset
//SEG12 [17] phi from main to memset [phi:main->memset]
jsr memset
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
//SEG14 [6] phi (byte) main::x#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta x
//SEG15 [6] phi (byte*) main::screen#5 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<SCREEN+$28+1
sta screen
lda #>SCREEN+$28+1
sta screen+1
//SEG16 [6] phi (byte) main::ch#3 = (byte) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #0
sta ch
//SEG17 [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
//SEG18 [6] phi (byte) main::x#4 = (byte) main::x#1 [phi:main::@3->main::@1#0] -- register_copy
//SEG19 [6] phi (byte*) main::screen#5 = (byte*) main::screen#2 [phi:main::@3->main::@1#1] -- register_copy
//SEG20 [6] phi (byte) main::ch#3 = (byte) main::ch#1 [phi:main::@3->main::@1#2] -- register_copy
//SEG21 main::@1
b1:
//SEG22 [7] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG23 [7] phi (byte) main::y#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG24 [7] phi (byte*) main::screen#3 = (byte*) main::screen#5 [phi:main::@1->main::@2#1] -- register_copy
//SEG25 [7] phi (byte) main::ch#2 = (byte) main::ch#3 [phi:main::@1->main::@2#2] -- register_copy
//SEG26 [7] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
//SEG27 [7] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@2->main::@2#0] -- register_copy
//SEG28 [7] phi (byte*) main::screen#3 = (byte*) main::screen#1 [phi:main::@2->main::@2#1] -- register_copy
//SEG29 [7] phi (byte) main::ch#2 = (byte) main::ch#1 [phi:main::@2->main::@2#2] -- register_copy
//SEG30 main::@2
b2:
//SEG31 [8] *((byte*) main::screen#3) ← (byte) main::ch#2 -- _deref_pbuz1=vbuz2
lda ch
ldy #0
sta (screen),y
//SEG32 [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 -- pbuz1=_inc_pbuz1
inc screen
bne !+
inc screen+1
!:
//SEG33 [10] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuz1=_inc_vbuz1
inc ch
//SEG34 [11] (byte) main::y#1 ← ++ (byte) main::y#2 -- vbuxx=_inc_vbuxx
inx
//SEG35 [12] if((byte) main::y#1!=(byte) $10) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
cpx #$10
bne b2
//SEG36 main::@3
//SEG37 [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 -- pbuz1=pbuz1_plus_vbuc1
lda #$28-$10
clc
adc screen
sta screen
bcc !+
inc screen+1
!:
//SEG38 [14] (byte) main::x#1 ← ++ (byte) main::x#4 -- vbuz1=_inc_vbuz1
inc x
//SEG39 [15] if((byte) main::x#1!=(byte) $10) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp x
bne b1
//SEG40 main::@return
//SEG41 [16] return
rts
}
//SEG42 memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
.const c = ' '
.const num = $3e8
.label str = SCREEN
.label end = str+num
.label dst = 6
//SEG43 [18] phi from memset to memset::@1 [phi:memset->memset::@1]
//SEG44 [18] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
lda #<str
sta dst
lda #>str
sta dst+1
//SEG45 [18] phi from memset::@1 to memset::@1 [phi:memset::@1->memset::@1]
//SEG46 [18] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@1->memset::@1#0] -- register_copy
//SEG47 memset::@1
b1:
//SEG48 [19] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
lda #c
ldy #0
sta (dst),y
//SEG49 [20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc dst
bne !+
inc dst+1
!:
//SEG50 [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuc1_then_la1
lda dst+1
cmp #>end
bne b1
lda dst
cmp #<end
bne b1
//SEG51 memset::@return
//SEG52 [22] return
rts
}
//SEG53 File Data

View File

@ -0,0 +1,46 @@
(label) @1
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::ch
(byte) main::ch#1 ch zp ZP_BYTE:3 35.5
(byte) main::ch#2 ch zp ZP_BYTE:3 104.66666666666666
(byte) main::ch#3 ch zp ZP_BYTE:3 22.0
(byte*) main::screen
(byte*) main::screen#1 screen zp ZP_WORD:4 53.25
(byte*) main::screen#2 screen zp ZP_WORD:4 7.333333333333333
(byte*) main::screen#3 screen zp ZP_WORD:4 157.0
(byte*) main::screen#5 screen zp ZP_WORD:4 22.0
(byte) main::x
(byte) main::x#1 x zp ZP_BYTE:2 16.5
(byte) main::x#4 x zp ZP_BYTE:2 2.75
(byte) main::y
(byte) main::y#1 reg byte x 151.5
(byte) main::y#2 reg byte x 50.5
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@return
(byte) memset::c
(const byte) memset::c#0 c = (byte) ' '
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:6 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:6 16.5
(byte*) memset::end
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
(word) memset::num
(const word) memset::num#0 num = (word) $3e8
(void*) memset::return
(void*) memset::str
(const void*) memset::str#0 str = (void*)(const byte*) SCREEN#0
zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
reg byte x [ main::y#2 main::y#1 ]
zp ZP_WORD:6 [ memset::dst#2 memset::dst#1 ]

View File

@ -20,8 +20,8 @@ main::@1: scope:[main] from main main::@1
[11] (byte~) main::$7 ← (byte) main::i#2 >> (byte) 3
[12] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← (byte~) main::$7
[13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2
[14] (signed byte~) main::$11 ← (signed byte) main::sb#0 >> (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$11
[14] (signed byte~) main::$12 ← (signed byte) main::sb#0 >> (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$12
[16] (byte) main::i#1 ← ++ (byte) main::i#2
[17] if((byte) main::i#1!=(byte) $b) goto main::@1
to:main::@return

View File

@ -143,13 +143,14 @@ Constant (const byte*) main::$6 = main::SCREEN#0+(byte)$28*3
Constant (const byte*) main::$10 = main::SCREEN#0+(byte)$28*5
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [9] (signed byte~) main::$8 ← (signed byte)(byte) main::i#2 keeping main::i#2
Inlining Noop Cast [12] (byte~) main::$12 ← (byte)(signed byte~) main::$11 keeping main::$11
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [12] (byte~) main::$12 ← (byte)(signed byte~) main::$11 keeping main::$12
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to remove identity multiply/divide [1] (byte~) main::$1 ← (byte) main::i#2 / (byte) 1
Rewriting division to use shift [3] (byte~) main::$3 ← (byte) main::i#2 / (byte) 2
Rewriting division to use shift [5] (byte~) main::$5 ← (byte) main::i#2 / (byte) 4
Rewriting division to use shift [7] (byte~) main::$7 ← (byte) main::i#2 / (byte) 8
Rewriting division to use shift [11] (signed byte~) main::$11 ← (signed byte) main::sb#0 / (signed byte) 2
Rewriting division to use shift [11] (signed byte~) main::$12 ← (signed byte) main::sb#0 / (signed byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte) 0
@ -203,8 +204,8 @@ main::@1: scope:[main] from main main::@1
[11] (byte~) main::$7 ← (byte) main::i#2 >> (byte) 3
[12] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← (byte~) main::$7
[13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2
[14] (signed byte~) main::$11 ← (signed byte) main::sb#0 >> (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$11
[14] (signed byte~) main::$12 ← (signed byte) main::sb#0 >> (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$12
[16] (byte) main::i#1 ← ++ (byte) main::i#2
[17] if((byte) main::i#1!=(byte) $b) goto main::@1
to:main::@return
@ -215,7 +216,7 @@ main::@return: scope:[main] from main::@1
VARIABLE REGISTER WEIGHTS
(void()) main()
(signed byte~) main::$11 11.0
(signed byte~) main::$12 11.0
(byte~) main::$3 22.0
(byte~) main::$5 22.0
(byte~) main::$7 22.0
@ -232,20 +233,20 @@ Added variable main::$3 to zero page equivalence class [ main::$3 ]
Added variable main::$5 to zero page equivalence class [ main::$5 ]
Added variable main::$7 to zero page equivalence class [ main::$7 ]
Added variable main::sb#0 to zero page equivalence class [ main::sb#0 ]
Added variable main::$11 to zero page equivalence class [ main::$11 ]
Added variable main::$12 to zero page equivalence class [ main::$12 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::$3 ]
[ main::$5 ]
[ main::$7 ]
[ main::sb#0 ]
[ main::$11 ]
[ main::$12 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::$3 ]
Allocated zp ZP_BYTE:4 [ main::$5 ]
Allocated zp ZP_BYTE:5 [ main::$7 ]
Allocated zp ZP_BYTE:6 [ main::sb#0 ]
Allocated zp ZP_BYTE:7 [ main::$11 ]
Allocated zp ZP_BYTE:7 [ main::$12 ]
INITIAL ASM
//SEG0 File Comments
@ -277,7 +278,7 @@ main: {
.label _3 = 3
.label _5 = 4
.label _7 = 5
.label _11 = 7
.label _12 = 7
.label sb = 6
.label i = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
@ -329,13 +330,13 @@ main: {
clc
adc #1
sta sb
//SEG24 [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 >> (byte) 1 -- vbsz1=vbsz2_ror_1
//SEG24 [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 >> (byte) 1 -- vbsz1=vbsz2_ror_1
lda sb
cmp #$80
ror
sta _11
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$11 -- pbuc1_derefidx_vbuz1=vbuz2
lda _11
sta _12
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$12 -- pbuc1_derefidx_vbuz1=vbuz2
lda _12
ldy i
sta SCREEN+$28*5,y
//SEG26 [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
@ -358,31 +359,31 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ ma
Statement [9] (byte~) main::$5 ← (byte) main::i#2 >> (byte) 2 [ main::i#2 main::$5 ] ( main:2 [ main::i#2 main::$5 ] ) always clobbers reg byte a
Statement [11] (byte~) main::$7 ← (byte) main::i#2 >> (byte) 3 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a
Statement [13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2 [ main::i#2 main::sb#0 ] ( main:2 [ main::i#2 main::sb#0 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 >> (byte) 1 [ main::i#2 main::$11 ] ( main:2 [ main::i#2 main::$11 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 >> (byte) 1 [ main::i#2 main::$12 ] ( main:2 [ main::i#2 main::$12 ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$3 ← (byte) main::i#2 >> (byte) 1 [ main::i#2 main::$3 ] ( main:2 [ main::i#2 main::$3 ] ) always clobbers reg byte a
Statement [9] (byte~) main::$5 ← (byte) main::i#2 >> (byte) 2 [ main::i#2 main::$5 ] ( main:2 [ main::i#2 main::$5 ] ) always clobbers reg byte a
Statement [11] (byte~) main::$7 ← (byte) main::i#2 >> (byte) 3 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a
Statement [13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2 [ main::i#2 main::sb#0 ] ( main:2 [ main::i#2 main::sb#0 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 >> (byte) 1 [ main::i#2 main::$11 ] ( main:2 [ main::i#2 main::$11 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 >> (byte) 1 [ main::i#2 main::$12 ] ( main:2 [ main::i#2 main::$12 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::$3 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 [ main::$5 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:5 [ main::$7 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 [ main::sb#0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ main::$11 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ main::$12 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:3 [ main::$3 ] 22: zp ZP_BYTE:4 [ main::$5 ] 22: zp ZP_BYTE:5 [ main::$7 ] 22: zp ZP_BYTE:6 [ main::sb#0 ] 11: zp ZP_BYTE:7 [ main::$11 ]
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:3 [ main::$3 ] 22: zp ZP_BYTE:4 [ main::$5 ] 22: zp ZP_BYTE:5 [ main::$7 ] 22: zp ZP_BYTE:6 [ main::sb#0 ] 11: zp ZP_BYTE:7 [ main::$12 ]
Uplift Scope []
Uplifting [main] best 883 combination reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$3 ] reg byte a [ main::$5 ] reg byte a [ main::$7 ] zp ZP_BYTE:6 [ main::sb#0 ] zp ZP_BYTE:7 [ main::$11 ]
Uplifting [main] best 883 combination reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$3 ] reg byte a [ main::$5 ] reg byte a [ main::$7 ] zp ZP_BYTE:6 [ main::sb#0 ] zp ZP_BYTE:7 [ main::$12 ]
Limited combination testing to 100 combinations of 3072 possible.
Uplifting [] best 883 combination
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ main::sb#0 ]
Uplifting [main] best 823 combination reg byte a [ main::sb#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::$11 ]
Uplifting [main] best 763 combination reg byte a [ main::$11 ]
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::$12 ]
Uplifting [main] best 763 combination reg byte a [ main::$12 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
@ -448,10 +449,10 @@ main: {
eor #$ff
clc
adc #1
//SEG24 [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 >> (byte) 1 -- vbsaa=vbsaa_ror_1
//SEG24 [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 >> (byte) 1 -- vbsaa=vbsaa_ror_1
cmp #$80
ror
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$11 -- pbuc1_derefidx_vbuxx=vbuaa
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$12 -- pbuc1_derefidx_vbuxx=vbuaa
sta SCREEN+$28*5,x
//SEG26 [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
@ -496,7 +497,7 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(void()) main()
(signed byte~) main::$11 reg byte a 11.0
(signed byte~) main::$12 reg byte a 11.0
(byte~) main::$3 reg byte a 22.0
(byte~) main::$5 reg byte a 22.0
(byte~) main::$7 reg byte a 22.0
@ -515,7 +516,7 @@ reg byte a [ main::$3 ]
reg byte a [ main::$5 ]
reg byte a [ main::$7 ]
reg byte a [ main::sb#0 ]
reg byte a [ main::$11 ]
reg byte a [ main::$12 ]
FINAL ASSEMBLER
@ -571,10 +572,10 @@ main: {
eor #$ff
clc
adc #1
//SEG24 [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 >> (byte) 1 -- vbsaa=vbsaa_ror_1
//SEG24 [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 >> (byte) 1 -- vbsaa=vbsaa_ror_1
cmp #$80
ror
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$11 -- pbuc1_derefidx_vbuxx=vbuaa
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 5 + (byte) main::i#2) ← (byte)(signed byte~) main::$12 -- pbuc1_derefidx_vbuxx=vbuaa
sta SCREEN+$28*5,x
//SEG26 [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx

View File

@ -2,7 +2,7 @@
(label) @begin
(label) @end
(void()) main()
(signed byte~) main::$11 reg byte a 11.0
(signed byte~) main::$12 reg byte a 11.0
(byte~) main::$3 reg byte a 22.0
(byte~) main::$5 reg byte a 22.0
(byte~) main::$7 reg byte a 22.0
@ -21,4 +21,4 @@ reg byte a [ main::$3 ]
reg byte a [ main::$5 ]
reg byte a [ main::$7 ]
reg byte a [ main::sb#0 ]
reg byte a [ main::$11 ]
reg byte a [ main::$12 ]

View File

@ -1437,7 +1437,6 @@ Inlining Noop Cast [48] (signed word) mulf8s_prepared::return#0 ← (signed word
Inlining Noop Cast [50] (byte~) mulf8s_prepared::$13 ← (byte)*((const signed byte*) mulf8s_prepared::memA#0) keeping *(mulf8s_prepared::memA#0)
Inlining Noop Cast [70] (signed byte) anim::cos_a#0 ← (signed byte)*((const byte*) COS#0 + (byte) anim::angle#6) keeping *(COS#0 + anim::angle#6)
Inlining Noop Cast [71] (signed byte) anim::sin_a#0 ← (signed byte)*((const byte*) SIN#0 + (byte) anim::angle#6) keeping *(SIN#0 + anim::angle#6)
Inlining Noop Cast [102] (signed byte~) anim::$14 ← (signed byte)(byte~) anim::$13 keeping anim::$13
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [75] (byte) mulf8u_prepare::a#0 ← (byte)(signed byte)*((const byte*) COS#0 + (byte) anim::angle#6) keeping (signed byte)*(COS#0 + anim::angle#6)
Inlining Noop Cast [79] (signed word) mulf8s_prepared::return#2 ← (signed word)(word) mulf8s_prepared::m#4 keeping mulf8s_prepared::m#4
@ -1446,6 +1445,8 @@ Inlining Noop Cast [87] (byte) mulf8u_prepare::a#1 ← (byte)(signed byte)*((con
Inlining Noop Cast [91] (signed word) mulf8s_prepared::return#4 ← (signed word)(word) mulf8s_prepared::m#4 keeping mulf8s_prepared::m#4
Inlining Noop Cast [97] (signed word) mulf8s_prepared::return#10 ← (signed word)(word) mulf8s_prepared::m#4 keeping mulf8s_prepared::m#4
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [102] (signed byte~) anim::$14 ← (signed byte)(byte~) anim::$13 keeping anim::$14
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [81] (signed word) anim::xr#0 ← (signed word~) anim::$4 * (signed byte) 2
Rewriting multiplication to use shift [86] (signed word) anim::yr#0 ← (signed word~) anim::$6 * (signed byte) 2
Rewriting multiplication to use shift [93] (signed word~) anim::$10 ← (signed word~) anim::$9 * (signed byte) 2
@ -1495,7 +1496,7 @@ Consolidated constant in assignment anim::ypos#0
Successful SSA optimization Pass2ConstantAdditionElimination
Alias (byte~) anim::$22 = (byte~) anim::$21
Successful SSA optimization Pass2AliasElimination
Inlining Noop Cast [91] (signed byte~) anim::$15 ← (signed byte)(byte~) anim::$13 keeping anim::$15
Inlining Noop Cast [91] (signed byte~) anim::$15 ← (signed byte)(byte~) anim::$14 keeping anim::$15
Successful SSA optimization Pass2NopCastInlining
Added new block during phi lifting mulf_init::@9(between mulf_init::@2 and mulf_init::@1)
Added new block during phi lifting mulf_init::@10(between mulf_init::@1 and mulf_init::@2)

View File

@ -255,7 +255,7 @@ sin16s_gen2: {
.const max = $140
.label ampl = max-min
.label _5 = $e
.label _6 = $34
.label _8 = $34
.label step = $30
.label sintab = $a
.label x = 6
@ -286,14 +286,14 @@ sin16s_gen2: {
jsr sin16s
jsr mul16s
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
sta _8+1
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
lda #SIZEOF_SIGNED_WORD
clc

View File

@ -149,8 +149,8 @@ render_logo::@4: scope:[render_logo] from render_logo::@7_5
[70] (byte) render_logo::screen_idx#3 ← ++ (byte) render_logo::screen_idx#18
to:render_logo::@2
render_logo::@1: scope:[render_logo] from render_logo
[71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0
[72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte~) render_logo::$17
[71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0
[72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte) render_logo::logo_idx#1
to:render_logo::@8
render_logo::@8: scope:[render_logo] from render_logo::@1 render_logo::@10
[73] (byte) render_logo::screen_idx#21 ← phi( render_logo::@1/(byte) 0 render_logo::@10/(byte) render_logo::screen_idx#5 )
@ -232,8 +232,8 @@ sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2::@1
to:sin16s_gen2::@4
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@3
[108] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[109] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5
[110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6
[109] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5
[110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8
[111] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[112] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[113] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2

View File

@ -2933,13 +2933,14 @@ Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) render_logo::$84 = SCREEN#0+render_logo::$83
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [37] (byte) render_logo::logo_start#0 ← (byte)(signed byte) render_logo::x_char#0 keeping render_logo::x_char#0
Inlining Noop Cast [64] (byte) render_logo::logo_idx#1 ← (byte)(signed byte~) render_logo::$17 keeping render_logo::$17
Inlining Noop Cast [101] (signed word~) sin16s_gen2::$8 ← (signed word)(word~) sin16s_gen2::$6 keeping sin16s_gen2::$6
Inlining Noop Cast [164] (signed word) sin16s::sinx#0 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1
Inlining Noop Cast [166] (signed word~) sin16s::$19 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1
Inlining Noop Cast [207] (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 keeping memset::str#2
Inlining Noop Cast [209] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 keeping memset::str#2
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [64] (byte) render_logo::logo_idx#1 ← (byte)(signed byte~) render_logo::$17 keeping render_logo::logo_idx#1
Inlining Noop Cast [101] (signed word~) sin16s_gen2::$8 ← (signed word)(word~) sin16s_gen2::$6 keeping sin16s_gen2::$8
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [21] (word~) loop::$5 ← (word) xsin_idx#11 * (const byte) SIZEOF_SIGNED_WORD
Rewriting division to use shift [34] (signed word~) render_logo::$3 ← (signed word) render_logo::xpos#0 / (signed byte) 8
Successful SSA optimization Pass2MultiplyToShiftRewriting
@ -3487,8 +3488,8 @@ render_logo::@4: scope:[render_logo] from render_logo::@7_5
[70] (byte) render_logo::screen_idx#3 ← ++ (byte) render_logo::screen_idx#18
to:render_logo::@2
render_logo::@1: scope:[render_logo] from render_logo
[71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0
[72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte~) render_logo::$17
[71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0
[72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte) render_logo::logo_idx#1
to:render_logo::@8
render_logo::@8: scope:[render_logo] from render_logo::@1 render_logo::@10
[73] (byte) render_logo::screen_idx#21 ← phi( render_logo::@1/(byte) 0 render_logo::@10/(byte) render_logo::screen_idx#5 )
@ -3570,8 +3571,8 @@ sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2::@1
to:sin16s_gen2::@4
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@3
[108] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[109] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5
[110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6
[109] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5
[110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8
[111] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[112] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[113] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
@ -3944,7 +3945,6 @@ VARIABLE REGISTER WEIGHTS
(void()) render_logo((signed word) render_logo::xpos)
(byte~) render_logo::$0 4.0
(byte~) render_logo::$1 4.0
(signed byte~) render_logo::$17 2.0
(byte~) render_logo::$2 4.0
(signed word~) render_logo::$3 2.0
(byte~) render_logo::$33 202.0
@ -3959,6 +3959,7 @@ VARIABLE REGISTER WEIGHTS
(byte~) render_logo::$85 202.0
(byte) render_logo::line
(byte) render_logo::logo_idx
(signed byte) render_logo::logo_idx#1 2.0
(byte) render_logo::logo_idx#10 57.714285714285715
(byte) render_logo::logo_idx#11 65.07142857142857
(byte~) render_logo::logo_idx#14 4.0
@ -4013,7 +4014,7 @@ VARIABLE REGISTER WEIGHTS
(word) sin16s::x5_128#0 4.0
(void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max)
(signed dword~) sin16s_gen2::$5 22.0
(word~) sin16s_gen2::$6 11.0
(word~) sin16s_gen2::$8 11.0
(signed word) sin16s_gen2::ampl
(word) sin16s_gen2::i
(word) sin16s_gen2::i#1 16.5
@ -4079,7 +4080,7 @@ Added variable render_logo::$36 to zero page equivalence class [ render_logo::$3
Added variable render_logo::$39 to zero page equivalence class [ render_logo::$39 ]
Added variable render_logo::$42 to zero page equivalence class [ render_logo::$42 ]
Added variable render_logo::$45 to zero page equivalence class [ render_logo::$45 ]
Added variable render_logo::$17 to zero page equivalence class [ render_logo::$17 ]
Added variable render_logo::logo_idx#1 to zero page equivalence class [ render_logo::logo_idx#1 ]
Added variable render_logo::$73 to zero page equivalence class [ render_logo::$73 ]
Added variable render_logo::$76 to zero page equivalence class [ render_logo::$76 ]
Added variable render_logo::$79 to zero page equivalence class [ render_logo::$79 ]
@ -4091,7 +4092,7 @@ Added variable sin16s::return#0 to zero page equivalence class [ sin16s::return#
Added variable mul16s::a#0 to zero page equivalence class [ mul16s::a#0 ]
Added variable mul16s::return#2 to zero page equivalence class [ mul16s::return#2 ]
Added variable sin16s_gen2::$5 to zero page equivalence class [ sin16s_gen2::$5 ]
Added variable sin16s_gen2::$6 to zero page equivalence class [ sin16s_gen2::$6 ]
Added variable sin16s_gen2::$8 to zero page equivalence class [ sin16s_gen2::$8 ]
Added variable mul16u::return#2 to zero page equivalence class [ mul16u::return#2 ]
Added variable mul16s::$9 to zero page equivalence class [ mul16s::$9 ]
Added variable mul16s::$16 to zero page equivalence class [ mul16s::$16 ]
@ -4167,7 +4168,7 @@ Complete equivalence classes
[ render_logo::$39 ]
[ render_logo::$42 ]
[ render_logo::$45 ]
[ render_logo::$17 ]
[ render_logo::logo_idx#1 ]
[ render_logo::$73 ]
[ render_logo::$76 ]
[ render_logo::$79 ]
@ -4179,7 +4180,7 @@ Complete equivalence classes
[ mul16s::a#0 ]
[ mul16s::return#2 ]
[ sin16s_gen2::$5 ]
[ sin16s_gen2::$6 ]
[ sin16s_gen2::$8 ]
[ mul16u::return#2 ]
[ mul16s::$9 ]
[ mul16s::$16 ]
@ -4254,7 +4255,7 @@ Allocated zp ZP_BYTE:72 [ render_logo::$36 ]
Allocated zp ZP_BYTE:73 [ render_logo::$39 ]
Allocated zp ZP_BYTE:74 [ render_logo::$42 ]
Allocated zp ZP_BYTE:75 [ render_logo::$45 ]
Allocated zp ZP_BYTE:76 [ render_logo::$17 ]
Allocated zp ZP_BYTE:76 [ render_logo::logo_idx#1 ]
Allocated zp ZP_BYTE:77 [ render_logo::$73 ]
Allocated zp ZP_BYTE:78 [ render_logo::$76 ]
Allocated zp ZP_BYTE:79 [ render_logo::$79 ]
@ -4266,7 +4267,7 @@ Allocated zp ZP_WORD:90 [ sin16s::return#0 ]
Allocated zp ZP_WORD:92 [ mul16s::a#0 ]
Allocated zp ZP_DWORD:94 [ mul16s::return#2 ]
Allocated zp ZP_DWORD:98 [ sin16s_gen2::$5 ]
Allocated zp ZP_WORD:102 [ sin16s_gen2::$6 ]
Allocated zp ZP_WORD:102 [ sin16s_gen2::$8 ]
Allocated zp ZP_DWORD:104 [ mul16u::return#2 ]
Allocated zp ZP_WORD:108 [ mul16s::$9 ]
Allocated zp ZP_WORD:110 [ mul16s::$16 ]
@ -4564,15 +4565,16 @@ render_logo: {
.label _1 = $42
.label _2 = $43
.label _3 = $44
.label _17 = $4c
.label xpos = $3f
.label x_char = $46
.label logo_idx = $4c
.label screen_idx = 5
.label logo_idx = 6
.label logo_idx_3 = 6
.label screen_idx_5 = 8
.label logo_idx_4 = 7
.label screen_idx_6 = 8
.label screen_idx_15 = 8
.label logo_idx_10 = 6
.label logo_idx_11 = 7
.label screen_idx_21 = 8
.label _33 = $47
@ -4638,7 +4640,7 @@ render_logo: {
b5_from_b2:
//SEG89 [48] phi (byte) render_logo::logo_idx#10 = (byte) 0 [phi:render_logo::@2->render_logo::@5#0] -- vbuz1=vbuc1
lda #0
sta logo_idx
sta logo_idx_10
//SEG90 [48] phi (byte) render_logo::screen_idx#10 = (byte) render_logo::screen_idx#18 [phi:render_logo::@2->render_logo::@5#1] -- register_copy
jmp b5
//SEG91 render_logo::@5
@ -4655,14 +4657,14 @@ render_logo: {
//SEG95 render_logo::@6
b6:
//SEG96 [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 -- pbuc1_derefidx_vbuz1=vbuz2
lda logo_idx
lda logo_idx_10
ldy screen_idx
sta SCREEN,y
jmp b15_1
//SEG97 render_logo::@15_1
b15_1:
//SEG98 [52] (byte~) render_logo::$33 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 1 -- vbuz1=vbuz2_plus_vbuc1
lax logo_idx
lax logo_idx_10
axs #-[$28*1]
stx _33
//SEG99 [53] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 -- pbuc1_derefidx_vbuz1=vbuz2
@ -4673,7 +4675,7 @@ render_logo: {
//SEG100 render_logo::@15_2
b15_2:
//SEG101 [54] (byte~) render_logo::$36 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 2 -- vbuz1=vbuz2_plus_vbuc1
lax logo_idx
lax logo_idx_10
axs #-[$28*2]
stx _36
//SEG102 [55] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 -- pbuc1_derefidx_vbuz1=vbuz2
@ -4684,7 +4686,7 @@ render_logo: {
//SEG103 render_logo::@15_3
b15_3:
//SEG104 [56] (byte~) render_logo::$39 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 3 -- vbuz1=vbuz2_plus_vbuc1
lax logo_idx
lax logo_idx_10
axs #-[$28*3]
stx _39
//SEG105 [57] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 -- pbuc1_derefidx_vbuz1=vbuz2
@ -4695,7 +4697,7 @@ render_logo: {
//SEG106 render_logo::@15_4
b15_4:
//SEG107 [58] (byte~) render_logo::$42 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 4 -- vbuz1=vbuz2_plus_vbuc1
lax logo_idx
lax logo_idx_10
axs #-[$28*4]
stx _42
//SEG108 [59] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 -- pbuc1_derefidx_vbuz1=vbuz2
@ -4706,7 +4708,7 @@ render_logo: {
//SEG109 render_logo::@15_5
b15_5:
//SEG110 [60] (byte~) render_logo::$45 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 5 -- vbuz1=vbuz2_plus_vbuc1
lax logo_idx
lax logo_idx_10
axs #-[$28*5]
stx _45
//SEG111 [61] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 -- pbuc1_derefidx_vbuz1=vbuz2
@ -4719,7 +4721,7 @@ render_logo: {
//SEG113 [62] (byte) render_logo::screen_idx#4 ← ++ (byte) render_logo::screen_idx#10 -- vbuz1=_inc_vbuz1
inc screen_idx
//SEG114 [63] (byte) render_logo::logo_idx#3 ← ++ (byte) render_logo::logo_idx#10 -- vbuz1=_inc_vbuz1
inc logo_idx
inc logo_idx_3
//SEG115 [48] phi from render_logo::@7 to render_logo::@5 [phi:render_logo::@7->render_logo::@5]
b5_from_b7:
//SEG116 [48] phi (byte) render_logo::logo_idx#10 = (byte) render_logo::logo_idx#3 [phi:render_logo::@7->render_logo::@5#0] -- register_copy
@ -4777,14 +4779,14 @@ render_logo: {
jmp b2
//SEG134 render_logo::@1
b1:
//SEG135 [71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0 -- vbsz1=_neg_vbsz2
//SEG135 [71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0 -- vbsz1=_neg_vbsz2
lda x_char
eor #$ff
clc
adc #1
sta _17
//SEG136 [72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte~) render_logo::$17 -- vbuz1=vbuz2
lda _17
sta logo_idx
//SEG136 [72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte) render_logo::logo_idx#1 -- vbuz1=vbuz2
lda logo_idx
sta logo_idx_14
//SEG137 [73] phi from render_logo::@1 to render_logo::@8 [phi:render_logo::@1->render_logo::@8]
b8_from_b1:
@ -4942,7 +4944,7 @@ sin16s_gen2: {
.const max = $140
.label ampl = max-min
.label _5 = $62
.label _6 = $66
.label _8 = $66
.label step = $56
.label sintab = $d
.label x = 9
@ -5048,17 +5050,17 @@ sin16s_gen2: {
sta _5+2
lda mul16s.return_2+3
sta _5+3
//SEG207 [109] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
//SEG207 [109] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
//SEG208 [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 -- _deref_pwsz1=vwsz2
sta _8+1
//SEG208 [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 -- _deref_pwsz1=vwsz2
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
//SEG209 [111] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
@ -6025,7 +6027,7 @@ Statement [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo
Statement [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a
Statement [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a
Statement [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a
Statement [71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0 [ render_logo::$17 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::$17 ] ) always clobbers reg byte a
Statement [71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0 [ render_logo::logo_idx#1 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::logo_idx#1 ] ) always clobbers reg byte a
Statement [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ]
Statement [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a
@ -6040,8 +6042,8 @@ Statement [104] (signed word) sin16s::return#0 ← (signed word) sin16s::return#
Statement [105] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::a#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::a#0 ] ) always clobbers reg byte a
Statement [107] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ) always clobbers reg byte a
Statement [108] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ) always clobbers reg byte a
Statement [109] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ) always clobbers reg byte a
Statement [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [109] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ) always clobbers reg byte a
Statement [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [111] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [112] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [114] if((word) sin16s_gen2::i#1<(const word) XSIN_SIZE#0) goto sin16s_gen2::@1 [ sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ) always clobbers reg byte a
@ -6136,7 +6138,7 @@ Statement [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo
Statement [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a
Statement [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a
Statement [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a
Statement [71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0 [ render_logo::$17 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::$17 ] ) always clobbers reg byte a
Statement [71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0 [ render_logo::logo_idx#1 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::logo_idx#1 ] ) always clobbers reg byte a
Statement [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a
Statement [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a
Statement [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a
@ -6150,8 +6152,8 @@ Statement [104] (signed word) sin16s::return#0 ← (signed word) sin16s::return#
Statement [105] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::a#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::a#0 ] ) always clobbers reg byte a
Statement [107] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 mul16s::return#2 ] ) always clobbers reg byte a
Statement [108] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$5 ] ) always clobbers reg byte a
Statement [109] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$6 ] ) always clobbers reg byte a
Statement [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [109] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 sin16s_gen2::$8 ] ) always clobbers reg byte a
Statement [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s_gen2::i#2 ] ) always clobbers reg byte a reg byte y
Statement [111] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#2 sin16s_gen2::i#2 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [112] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#1 sin16s_gen2::sintab#0 ] ) always clobbers reg byte a
Statement [114] if((word) sin16s_gen2::i#1<(const word) XSIN_SIZE#0) goto sin16s_gen2::@1 [ sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::x#1 sin16s_gen2::sintab#0 sin16s_gen2::i#1 ] ) always clobbers reg byte a
@ -6258,7 +6260,7 @@ Potential registers zp ZP_BYTE:72 [ render_logo::$36 ] : zp ZP_BYTE:72 , reg byt
Potential registers zp ZP_BYTE:73 [ render_logo::$39 ] : zp ZP_BYTE:73 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:74 [ render_logo::$42 ] : zp ZP_BYTE:74 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:75 [ render_logo::$45 ] : zp ZP_BYTE:75 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:76 [ render_logo::$17 ] : zp ZP_BYTE:76 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:76 [ render_logo::logo_idx#1 ] : zp ZP_BYTE:76 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:77 [ render_logo::$73 ] : zp ZP_BYTE:77 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:78 [ render_logo::$76 ] : zp ZP_BYTE:78 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:79 [ render_logo::$79 ] : zp ZP_BYTE:79 , reg byte a , reg byte x , reg byte y ,
@ -6270,7 +6272,7 @@ Potential registers zp ZP_WORD:90 [ sin16s::return#0 ] : zp ZP_WORD:90 ,
Potential registers zp ZP_WORD:92 [ mul16s::a#0 ] : zp ZP_WORD:92 ,
Potential registers zp ZP_DWORD:94 [ mul16s::return#2 ] : zp ZP_DWORD:94 ,
Potential registers zp ZP_DWORD:98 [ sin16s_gen2::$5 ] : zp ZP_DWORD:98 ,
Potential registers zp ZP_WORD:102 [ sin16s_gen2::$6 ] : zp ZP_WORD:102 ,
Potential registers zp ZP_WORD:102 [ sin16s_gen2::$8 ] : zp ZP_WORD:102 ,
Potential registers zp ZP_DWORD:104 [ mul16u::return#2 ] : zp ZP_DWORD:104 ,
Potential registers zp ZP_WORD:108 [ mul16s::$9 ] : zp ZP_WORD:108 ,
Potential registers zp ZP_WORD:110 [ mul16s::$16 ] : zp ZP_WORD:110 ,
@ -6306,12 +6308,12 @@ Potential registers zp ZP_WORD:177 [ rem16u#1 ] : zp ZP_WORD:177 ,
Potential registers zp ZP_WORD:179 [ memset::end#0 ] : zp ZP_WORD:179 ,
REGISTER UPLIFT SCOPES
Uplift Scope [render_logo] 506.94: zp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] 499.17: zp ZP_BYTE:8 [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] 271.07: zp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] 259.71: zp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] 202: zp ZP_BYTE:71 [ render_logo::$33 ] 202: zp ZP_BYTE:72 [ render_logo::$36 ] 202: zp ZP_BYTE:73 [ render_logo::$39 ] 202: zp ZP_BYTE:74 [ render_logo::$42 ] 202: zp ZP_BYTE:75 [ render_logo::$45 ] 202: zp ZP_BYTE:77 [ render_logo::$73 ] 202: zp ZP_BYTE:78 [ render_logo::$76 ] 202: zp ZP_BYTE:79 [ render_logo::$79 ] 202: zp ZP_BYTE:80 [ render_logo::$82 ] 202: zp ZP_BYTE:81 [ render_logo::$85 ] 4: zp ZP_BYTE:65 [ render_logo::$0 ] 4: zp ZP_BYTE:66 [ render_logo::$1 ] 4: zp ZP_BYTE:67 [ render_logo::$2 ] 2.14: zp ZP_WORD:63 [ render_logo::xpos#0 ] 2: zp ZP_WORD:68 [ render_logo::$3 ] 2: zp ZP_BYTE:76 [ render_logo::$17 ] 0.36: zp ZP_BYTE:70 [ render_logo::x_char#0 ]
Uplift Scope [render_logo] 506.94: zp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] 499.17: zp ZP_BYTE:8 [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] 271.07: zp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] 259.71: zp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] 202: zp ZP_BYTE:71 [ render_logo::$33 ] 202: zp ZP_BYTE:72 [ render_logo::$36 ] 202: zp ZP_BYTE:73 [ render_logo::$39 ] 202: zp ZP_BYTE:74 [ render_logo::$42 ] 202: zp ZP_BYTE:75 [ render_logo::$45 ] 202: zp ZP_BYTE:77 [ render_logo::$73 ] 202: zp ZP_BYTE:78 [ render_logo::$76 ] 202: zp ZP_BYTE:79 [ render_logo::$79 ] 202: zp ZP_BYTE:80 [ render_logo::$82 ] 202: zp ZP_BYTE:81 [ render_logo::$85 ] 4: zp ZP_BYTE:65 [ render_logo::$0 ] 4: zp ZP_BYTE:66 [ render_logo::$1 ] 4: zp ZP_BYTE:67 [ render_logo::$2 ] 2.14: zp ZP_WORD:63 [ render_logo::xpos#0 ] 2: zp ZP_WORD:68 [ render_logo::$3 ] 2: zp ZP_BYTE:76 [ render_logo::logo_idx#1 ] 0.36: zp ZP_BYTE:70 [ render_logo::x_char#0 ]
Uplift Scope [mul16u] 346.86: zp ZP_DWORD:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] 249.57: zp ZP_DWORD:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] 202: zp ZP_BYTE:116 [ mul16u::$1 ] 180.67: zp ZP_WORD:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] 4: zp ZP_WORD:21 [ mul16u::b#1 ] 4: zp ZP_DWORD:104 [ mul16u::return#2 ] 4: zp ZP_DWORD:149 [ mul16u::return#3 ]
Uplift Scope [divr16u] 106.92: zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] 35.54: zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] 22: zp ZP_BYTE:175 [ divr16u::$1 ] 22: zp ZP_BYTE:176 [ divr16u::$2 ] 18.19: zp ZP_BYTE:51 [ divr16u::i#2 divr16u::i#1 ] 9.75: zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] 4: zp ZP_WORD:163 [ divr16u::return#2 ] 4: zp ZP_WORD:167 [ divr16u::return#3 ]
Uplift Scope [sin16s] 27.5: zp ZP_DWORD:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] 22: zp ZP_WORD:90 [ sin16s::return#0 ] 13: zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] 4: zp ZP_DWORD:117 [ sin16s::$4 ] 4: zp ZP_WORD:125 [ sin16s::x2#0 ] 4: zp ZP_WORD:133 [ sin16s::x3_6#0 ] 4: zp ZP_WORD:139 [ sin16s::x4#0 ] 4: zp ZP_WORD:143 [ sin16s::x5#0 ] 4: zp ZP_WORD:145 [ sin16s::x5_128#0 ] 1: zp ZP_WORD:129 [ sin16s::x3#0 ] 1: zp ZP_WORD:147 [ sin16s::usinx#1 ] 0.64: zp ZP_WORD:121 [ sin16s::x1#0 ] 0.33: zp ZP_WORD:135 [ sin16s::usinx#0 ] 0.06: zp ZP_BYTE:33 [ sin16s::isUpper#2 ]
Uplift Scope [mulu16_sel] 24: zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] 21: zp ZP_WORD:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] 4: zp ZP_WORD:123 [ mulu16_sel::return#0 ] 4: zp ZP_WORD:127 [ mulu16_sel::return#1 ] 4: zp ZP_WORD:131 [ mulu16_sel::return#2 ] 4: zp ZP_WORD:137 [ mulu16_sel::return#10 ] 4: zp ZP_WORD:141 [ mulu16_sel::return#11 ] 4: zp ZP_DWORD:153 [ mulu16_sel::$0 ] 4: zp ZP_DWORD:157 [ mulu16_sel::$1 ] 1.71: zp ZP_WORD:161 [ mulu16_sel::return#12 ] 0.33: zp ZP_BYTE:44 [ mulu16_sel::select#5 ]
Uplift Scope [sin16s_gen2] 22: zp ZP_DWORD:98 [ sin16s_gen2::$5 ] 18.33: zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] 11: zp ZP_WORD:102 [ sin16s_gen2::$6 ] 10.33: zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] 8.8: zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] 0.87: zp ZP_DWORD:86 [ sin16s_gen2::step#0 ]
Uplift Scope [sin16s_gen2] 22: zp ZP_DWORD:98 [ sin16s_gen2::$5 ] 18.33: zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] 11: zp ZP_WORD:102 [ sin16s_gen2::$8 ] 10.33: zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] 8.8: zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] 0.87: zp ZP_DWORD:86 [ sin16s_gen2::step#0 ]
Uplift Scope [loop] 22: zp ZP_WORD:57 [ loop::$5 ] 22: zp ZP_WORD:59 [ loop::$1 ] 22: zp ZP_WORD:61 [ loop::xpos#0 ]
Uplift Scope [mul16s] 22: zp ZP_DWORD:94 [ mul16s::return#2 ] 10: zp ZP_DWORD:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] 4.33: zp ZP_DWORD:112 [ mul16s::return#0 ] 4: zp ZP_WORD:108 [ mul16s::$9 ] 4: zp ZP_WORD:110 [ mul16s::$16 ] 2.6: zp ZP_WORD:92 [ mul16s::a#0 ]
Uplift Scope [memset] 38: zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:179 [ memset::end#0 ] 1.57: zp ZP_BYTE:54 [ memset::c#3 ] 0: zp ZP_WORD:52 [ memset::str#2 ]
@ -6323,7 +6325,7 @@ Uplifting [mul16u] best 74992 combination zp ZP_DWORD:25 [ mul16u::res#2 mul16u:
Uplifting [divr16u] best 74782 combination zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:163 [ divr16u::return#2 ] zp ZP_WORD:167 [ divr16u::return#3 ]
Uplifting [sin16s] best 74782 combination zp ZP_DWORD:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:90 [ sin16s::return#0 ] zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:117 [ sin16s::$4 ] zp ZP_WORD:125 [ sin16s::x2#0 ] zp ZP_WORD:133 [ sin16s::x3_6#0 ] zp ZP_WORD:139 [ sin16s::x4#0 ] zp ZP_WORD:143 [ sin16s::x5#0 ] zp ZP_WORD:145 [ sin16s::x5_128#0 ] zp ZP_WORD:129 [ sin16s::x3#0 ] zp ZP_WORD:147 [ sin16s::usinx#1 ] zp ZP_WORD:121 [ sin16s::x1#0 ] zp ZP_WORD:135 [ sin16s::usinx#0 ] zp ZP_BYTE:33 [ sin16s::isUpper#2 ]
Uplifting [mulu16_sel] best 74766 combination zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:123 [ mulu16_sel::return#0 ] zp ZP_WORD:127 [ mulu16_sel::return#1 ] zp ZP_WORD:131 [ mulu16_sel::return#2 ] zp ZP_WORD:137 [ mulu16_sel::return#10 ] zp ZP_WORD:141 [ mulu16_sel::return#11 ] zp ZP_DWORD:153 [ mulu16_sel::$0 ] zp ZP_DWORD:157 [ mulu16_sel::$1 ] zp ZP_WORD:161 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ]
Uplifting [sin16s_gen2] best 74766 combination zp ZP_DWORD:98 [ sin16s_gen2::$5 ] zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:102 [ sin16s_gen2::$6 ] zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:86 [ sin16s_gen2::step#0 ]
Uplifting [sin16s_gen2] best 74766 combination zp ZP_DWORD:98 [ sin16s_gen2::$5 ] zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:102 [ sin16s_gen2::$8 ] zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:86 [ sin16s_gen2::step#0 ]
Uplifting [loop] best 74766 combination zp ZP_WORD:57 [ loop::$5 ] zp ZP_WORD:59 [ loop::$1 ] zp ZP_WORD:61 [ loop::xpos#0 ]
Uplifting [mul16s] best 74766 combination zp ZP_DWORD:94 [ mul16s::return#2 ] zp ZP_DWORD:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp ZP_DWORD:112 [ mul16s::return#0 ] zp ZP_WORD:108 [ mul16s::$9 ] zp ZP_WORD:110 [ mul16s::$16 ] zp ZP_WORD:92 [ mul16s::a#0 ]
Uplifting [memset] best 74750 combination zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:179 [ memset::end#0 ] reg byte x [ memset::c#3 ] zp ZP_WORD:52 [ memset::str#2 ]
@ -6364,8 +6366,8 @@ Attempting to uplift remaining variables inzp ZP_BYTE:66 [ render_logo::$1 ]
Uplifting [render_logo] best 60718 combination reg byte a [ render_logo::$1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:67 [ render_logo::$2 ]
Uplifting [render_logo] best 60712 combination reg byte a [ render_logo::$2 ]
Attempting to uplift remaining variables inzp ZP_BYTE:76 [ render_logo::$17 ]
Uplifting [render_logo] best 60706 combination reg byte a [ render_logo::$17 ]
Attempting to uplift remaining variables inzp ZP_BYTE:76 [ render_logo::logo_idx#1 ]
Uplifting [render_logo] best 60706 combination reg byte a [ render_logo::logo_idx#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:70 [ render_logo::x_char#0 ]
Uplifting [render_logo] best 60706 combination zp ZP_BYTE:70 [ render_logo::x_char#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:33 [ sin16s::isUpper#2 ]
@ -6428,7 +6430,7 @@ Allocated (was zp ZP_WORD:57) zp ZP_WORD:43 [ loop::$5 loop::$1 loop::xpos#0 ren
Allocated (was zp ZP_WORD:68) zp ZP_WORD:45 [ render_logo::$3 ]
Allocated (was zp ZP_BYTE:70) zp ZP_BYTE:47 [ render_logo::x_char#0 ]
Allocated (was zp ZP_DWORD:82) zp ZP_DWORD:48 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ]
Allocated (was zp ZP_WORD:102) zp ZP_WORD:52 [ sin16s_gen2::$6 ]
Allocated (was zp ZP_WORD:102) zp ZP_WORD:52 [ sin16s_gen2::$8 ]
Allocated (was zp ZP_WORD:108) zp ZP_WORD:54 [ mul16s::$9 mul16s::$16 ]
Allocated (was zp ZP_WORD:121) zp ZP_WORD:56 [ sin16s::x1#0 ]
Allocated (was zp ZP_WORD:123) zp ZP_WORD:58 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 sin16s::x5_128#0 ]
@ -6857,12 +6859,12 @@ render_logo: {
jmp b2
//SEG134 render_logo::@1
b1:
//SEG135 [71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0 -- vbsaa=_neg_vbsz1
//SEG135 [71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0 -- vbsaa=_neg_vbsz1
lda x_char
eor #$ff
clc
adc #1
//SEG136 [72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte~) render_logo::$17 -- vbuz1=vbuaa
//SEG136 [72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte) render_logo::logo_idx#1 -- vbuz1=vbuaa
sta logo_idx_14
//SEG137 [73] phi from render_logo::@1 to render_logo::@8 [phi:render_logo::@1->render_logo::@8]
b8_from_b1:
@ -7001,7 +7003,7 @@ sin16s_gen2: {
.const max = $140
.label ampl = max-min
.label _5 = $e
.label _6 = $34
.label _8 = $34
.label step = $30
.label sintab = $a
.label x = 6
@ -7067,17 +7069,17 @@ sin16s_gen2: {
//SEG205 sin16s_gen2::@4
b4:
//SEG206 [108] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
//SEG207 [109] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
//SEG207 [109] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
//SEG208 [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 -- _deref_pwsz1=vwsz2
sta _8+1
//SEG208 [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 -- _deref_pwsz1=vwsz2
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
//SEG209 [111] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
@ -8340,7 +8342,6 @@ FINAL SYMBOL TABLE
(void()) render_logo((signed word) render_logo::xpos)
(byte~) render_logo::$0 reg byte a 4.0
(byte~) render_logo::$1 reg byte a 4.0
(signed byte~) render_logo::$17 reg byte a 2.0
(byte~) render_logo::$2 reg byte a 4.0
(signed word~) render_logo::$3 $3 zp ZP_WORD:45 2.0
(byte~) render_logo::$33 reg byte a 202.0
@ -8389,6 +8390,7 @@ FINAL SYMBOL TABLE
(label) render_logo::@return
(byte) render_logo::line
(byte) render_logo::logo_idx
(signed byte) render_logo::logo_idx#1 reg byte a 2.0
(byte) render_logo::logo_idx#10 logo_idx zp ZP_BYTE:4 57.714285714285715
(byte) render_logo::logo_idx#11 logo_idx#11 zp ZP_BYTE:5 65.07142857142857
(byte~) render_logo::logo_idx#14 logo_idx#14 zp ZP_BYTE:5 4.0
@ -8456,7 +8458,7 @@ FINAL SYMBOL TABLE
(word) sin16s::x5_128#0 x5_128 zp ZP_WORD:58 4.0
(void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max)
(signed dword~) sin16s_gen2::$5 $5 zp ZP_DWORD:14 22.0
(word~) sin16s_gen2::$6 $6 zp ZP_WORD:52 11.0
(word~) sin16s_gen2::$8 $8 zp ZP_WORD:52 11.0
(label) sin16s_gen2::@1
(label) sin16s_gen2::@2
(label) sin16s_gen2::@3
@ -8523,14 +8525,14 @@ reg byte a [ render_logo::$36 ]
reg byte a [ render_logo::$39 ]
reg byte a [ render_logo::$42 ]
reg byte a [ render_logo::$45 ]
reg byte a [ render_logo::$17 ]
reg byte a [ render_logo::logo_idx#1 ]
reg byte a [ render_logo::$73 ]
reg byte a [ render_logo::$76 ]
reg byte a [ render_logo::$79 ]
reg byte a [ render_logo::$82 ]
reg byte a [ render_logo::$85 ]
zp ZP_DWORD:48 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ]
zp ZP_WORD:52 [ sin16s_gen2::$6 ]
zp ZP_WORD:52 [ sin16s_gen2::$8 ]
zp ZP_WORD:54 [ mul16s::$9 mul16s::$16 ]
reg byte a [ mul16u::$1 ]
zp ZP_WORD:56 [ sin16s::x1#0 ]
@ -8876,12 +8878,12 @@ render_logo: {
jmp b2
//SEG134 render_logo::@1
b1:
//SEG135 [71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0 -- vbsaa=_neg_vbsz1
//SEG135 [71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0 -- vbsaa=_neg_vbsz1
lda x_char
eor #$ff
clc
adc #1
//SEG136 [72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte~) render_logo::$17 -- vbuz1=vbuaa
//SEG136 [72] (byte~) render_logo::logo_idx#14 ← (byte)(signed byte) render_logo::logo_idx#1 -- vbuz1=vbuaa
sta logo_idx_14
//SEG137 [73] phi from render_logo::@1 to render_logo::@8 [phi:render_logo::@1->render_logo::@8]
//SEG138 [73] phi (byte) render_logo::screen_idx#21 = (byte) 0 [phi:render_logo::@1->render_logo::@8#0] -- vbuyy=vbuc1
@ -8985,7 +8987,7 @@ sin16s_gen2: {
.const max = $140
.label ampl = max-min
.label _5 = $e
.label _6 = $34
.label _8 = $34
.label step = $30
.label sintab = $a
.label x = 6
@ -9038,17 +9040,17 @@ sin16s_gen2: {
//SEG204 [107] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
//SEG205 sin16s_gen2::@4
//SEG206 [108] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
//SEG207 [109] (word~) sin16s_gen2::$6 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
//SEG207 [109] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5 -- vwuz1=_hi_vdsz2
lda _5+2
sta _6
sta _8
lda _5+3
sta _6+1
//SEG208 [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$6 -- _deref_pwsz1=vwsz2
sta _8+1
//SEG208 [110] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8 -- _deref_pwsz1=vwsz2
ldy #0
lda _6
lda _8
sta (sintab),y
iny
lda _6+1
lda _8+1
sta (sintab),y
//SEG209 [111] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD

View File

@ -214,7 +214,6 @@
(void()) render_logo((signed word) render_logo::xpos)
(byte~) render_logo::$0 reg byte a 4.0
(byte~) render_logo::$1 reg byte a 4.0
(signed byte~) render_logo::$17 reg byte a 2.0
(byte~) render_logo::$2 reg byte a 4.0
(signed word~) render_logo::$3 $3 zp ZP_WORD:45 2.0
(byte~) render_logo::$33 reg byte a 202.0
@ -263,6 +262,7 @@
(label) render_logo::@return
(byte) render_logo::line
(byte) render_logo::logo_idx
(signed byte) render_logo::logo_idx#1 reg byte a 2.0
(byte) render_logo::logo_idx#10 logo_idx zp ZP_BYTE:4 57.714285714285715
(byte) render_logo::logo_idx#11 logo_idx#11 zp ZP_BYTE:5 65.07142857142857
(byte~) render_logo::logo_idx#14 logo_idx#14 zp ZP_BYTE:5 4.0
@ -330,7 +330,7 @@
(word) sin16s::x5_128#0 x5_128 zp ZP_WORD:58 4.0
(void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max)
(signed dword~) sin16s_gen2::$5 $5 zp ZP_DWORD:14 22.0
(word~) sin16s_gen2::$6 $6 zp ZP_WORD:52 11.0
(word~) sin16s_gen2::$8 $8 zp ZP_WORD:52 11.0
(label) sin16s_gen2::@1
(label) sin16s_gen2::@2
(label) sin16s_gen2::@3
@ -397,14 +397,14 @@ reg byte a [ render_logo::$36 ]
reg byte a [ render_logo::$39 ]
reg byte a [ render_logo::$42 ]
reg byte a [ render_logo::$45 ]
reg byte a [ render_logo::$17 ]
reg byte a [ render_logo::logo_idx#1 ]
reg byte a [ render_logo::$73 ]
reg byte a [ render_logo::$76 ]
reg byte a [ render_logo::$79 ]
reg byte a [ render_logo::$82 ]
reg byte a [ render_logo::$85 ]
zp ZP_DWORD:48 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ]
zp ZP_WORD:52 [ sin16s_gen2::$6 ]
zp ZP_WORD:52 [ sin16s_gen2::$8 ]
zp ZP_WORD:54 [ mul16s::$9 mul16s::$16 ]
reg byte a [ mul16u::$1 ]
zp ZP_WORD:56 [ sin16s::x1#0 ]

View File

@ -4,6 +4,7 @@
.pc = $80d "Program"
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label BYTES = malloc.return
bbegin:
jsr malloc
jsr main
@ -12,7 +13,7 @@ main: {
ldx #0
b1:
txa
sta HEAP_START,x
sta BYTES,x
inx
cpx #0
bne b1
@ -21,5 +22,6 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
rts
}

View File

@ -16,7 +16,7 @@ main: scope:[main] from @2
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[8] *((const byte*) HEAP_START#0 + (byte) main::i#2) ← (byte) main::i#2
[8] *((const byte*) BYTES#0 + (byte) main::i#2) ← (byte) main::i#2
[9] (byte) main::i#1 ← ++ (byte) main::i#2
[10] if((byte) main::i#1!=(byte) 0) goto main::@1
to:main::@return

View File

@ -1,4 +1,6 @@
Adding pointer type conversion cast (byte*) HEAP_START in (byte*) HEAP_START ← (number) $c000
Adding void pointer type conversion cast (void*) malloc::mem in (void*) malloc::return ← (byte*) malloc::mem
Adding pointer type conversion cast to void pointer (byte*) $0 in (byte*) BYTES ← (void*~) $0
Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items + (byte~) bsearch16u::$6
Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot + (number) 1
Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1
@ -18,12 +20,12 @@ malloc: scope:[malloc] from @3
(byte*) heap_head#4 ← phi( @3/(byte*) heap_head#7 )
(byte*) malloc::mem#0 ← (byte*) heap_head#4
(byte*) heap_head#1 ← (byte*) heap_head#4 + (word) malloc::size#1
(byte*) malloc::return#0 ← (byte*) malloc::mem#0
(void*) malloc::return#0 ← ((void*)) (byte*) malloc::mem#0
to:malloc::@return
malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#5 ← phi( malloc/(byte*) heap_head#1 )
(byte*) malloc::return#3 ← phi( malloc/(byte*) malloc::return#0 )
(byte*) malloc::return#1 ← (byte*) malloc::return#3
(void*) malloc::return#3 ← phi( malloc/(void*) malloc::return#0 )
(void*) malloc::return#1 ← (void*) malloc::return#3
(byte*) heap_head#2 ← (byte*) heap_head#5
return
to:@return
@ -31,14 +33,14 @@ malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#7 ← phi( @begin/(byte*) heap_head#0 )
(word) malloc::size#0 ← (number) $100
call malloc
(byte*) malloc::return#2 ← (byte*) malloc::return#1
(void*) malloc::return#2 ← (void*) malloc::return#1
to:@5
@5: scope:[] from @3
(byte*) heap_head#6 ← phi( @3/(byte*) heap_head#2 )
(byte*) malloc::return#4 ← phi( @3/(byte*) malloc::return#2 )
(byte*~) $0 ← (byte*) malloc::return#4
(void*) malloc::return#4 ← phi( @3/(void*) malloc::return#2 )
(void*~) $0 ← (void*) malloc::return#4
(byte*) heap_head#3 ← (byte*) heap_head#6
(byte*) BYTES#0 ← (byte*~) $0
(byte*) BYTES#0 ← ((byte*)) (void*~) $0
to:@4
main: scope:[main] from @4
(byte*) BYTES#2 ← phi( @4/(byte*) BYTES#3 )
@ -64,7 +66,7 @@ main::@return: scope:[main] from main::@1
@end: scope:[] from @6
SYMBOL TABLE SSA
(byte*~) $0
(void*~) $0
(label) @3
(label) @4
(label) @5
@ -95,16 +97,16 @@ SYMBOL TABLE SSA
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::mem#0
(byte*) malloc::return
(byte*) malloc::return#0
(byte*) malloc::return#1
(byte*) malloc::return#2
(byte*) malloc::return#3
(byte*) malloc::return#4
(void*) malloc::return
(void*) malloc::return#0
(void*) malloc::return#1
(void*) malloc::return#2
(void*) malloc::return#3
(void*) malloc::return#4
(word) malloc::size
(word) malloc::size#0
(word) malloc::size#1
@ -112,7 +114,9 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) $100 in (word) malloc::size#0 ← (number) $100
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) HEAP_START#0 ← (byte*)(number) $c000
Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0
Inlining cast (word) malloc::size#0 ← (unumber)(number) $100
Inlining cast (byte*) BYTES#0 ← (byte*)(void*~) $0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 49152
Simplifying constant integer cast $100
@ -120,11 +124,11 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $100
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) HEAP_START#0 = (byte*) heap_head#0 (byte*) heap_head#7
Alias (byte*) malloc::return#0 = (byte*) malloc::mem#0 (byte*) malloc::return#3 (byte*) malloc::return#1
Alias (void*) malloc::return#0 = (void*) malloc::return#3 (void*) malloc::return#1
Alias (byte*) heap_head#1 = (byte*) heap_head#5 (byte*) heap_head#2
Alias (byte*) malloc::return#2 = (byte*) malloc::return#4
Alias (void*) malloc::return#2 = (void*) malloc::return#4
Alias (byte*) heap_head#3 = (byte*) heap_head#6
Alias (byte*) BYTES#0 = (byte*~) $0 (byte*) BYTES#3
Alias (byte*) BYTES#0 = (byte*) BYTES#3
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) BYTES#1
Successful SSA optimization Pass2SelfPhiElimination
@ -140,12 +144,10 @@ Constant (const byte*) HEAP_START#0 = (byte*) 49152
Constant (const word) malloc::size#0 = $100
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) malloc::return#0 = HEAP_START#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) malloc::return#2 = malloc::return#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) BYTES#0 = malloc::return#2
Constant (const byte*) malloc::mem#0 = HEAP_START#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (void*)malloc::mem#0 in [5] (void*) malloc::return#0 ← (void*)(const byte*) malloc::mem#0
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [22] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [24] if(main::i#1!=rangelast(0,$ff)) goto main::@1 to (number) 0
Eliminating unused variable (byte*) heap_head#1 and assignment [0] (byte*) heap_head#1 ← (const byte*) HEAP_START#0 + (const word) malloc::size#0
@ -158,11 +160,22 @@ Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant (const void*) malloc::return#0 = (void*)malloc::mem#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const void*) malloc::return#2 = malloc::return#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const void*) $0 = malloc::return#2
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (byte*)$0 in [5] (byte*) BYTES#0 ← (byte*)(const void*) $0
Successful SSA optimization Pass2ConstantValues
Constant (const byte*) BYTES#0 = (byte*)$0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const void*) malloc::return#2
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte) 0
Constant inlined malloc::return#2 = (const byte*) HEAP_START#0
Constant inlined BYTES#0 = (const byte*) HEAP_START#0
Constant inlined malloc::return#0 = (const byte*) HEAP_START#0
Constant inlined malloc::return#2 = (const void*) malloc::return#0
Constant inlined malloc::mem#0 = (const byte*) HEAP_START#0
Constant inlined $0 = (const void*) malloc::return#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
@ -210,7 +223,7 @@ main: scope:[main] from @2
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[8] *((const byte*) HEAP_START#0 + (byte) main::i#2) ← (byte) main::i#2
[8] *((const byte*) BYTES#0 + (byte) main::i#2) ← (byte) main::i#2
[9] (byte) main::i#1 ← ++ (byte) main::i#2
[10] if((byte) main::i#1!=(byte) 0) goto main::@1
to:main::@return
@ -233,9 +246,9 @@ VARIABLE REGISTER WEIGHTS
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 22.0
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(word) malloc::size
Initial phi equivalence classes
@ -254,6 +267,7 @@ INITIAL ASM
//SEG2 Global Constants & labels
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label BYTES = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -294,10 +308,10 @@ main: {
jmp b1
//SEG19 main::@1
b1:
//SEG20 [8] *((const byte*) HEAP_START#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1
//SEG20 [8] *((const byte*) BYTES#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1
ldy i
tya
sta HEAP_START,y
sta BYTES,y
//SEG21 [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG22 [10] if((byte) main::i#1!=(byte) 0) goto main::@1 -- vbuz1_neq_0_then_la1
@ -314,6 +328,7 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
jmp breturn
//SEG26 malloc::@return
breturn:
@ -344,6 +359,7 @@ ASSEMBLER BEFORE OPTIMIZATION
//SEG2 Global Constants & labels
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label BYTES = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -382,9 +398,9 @@ main: {
jmp b1
//SEG19 main::@1
b1:
//SEG20 [8] *((const byte*) HEAP_START#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx
//SEG20 [8] *((const byte*) BYTES#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx
txa
sta HEAP_START,x
sta BYTES,x
//SEG21 [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG22 [10] if((byte) main::i#1!=(byte) 0) goto main::@1 -- vbuxx_neq_0_then_la1
@ -400,6 +416,7 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
jmp breturn
//SEG26 malloc::@return
breturn:
@ -442,6 +459,7 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) BYTES
(const byte*) BYTES#0 BYTES = (byte*)(const void*) malloc::return#0
(byte*) HEAP_START
(const byte*) HEAP_START#0 HEAP_START = (byte*) 49152
(byte*) heap_head
@ -451,10 +469,11 @@ FINAL SYMBOL TABLE
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 22.0
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(const void*) malloc::return#0 return = (void*)(const byte*) HEAP_START#0
(word) malloc::size
reg byte x [ main::i#2 main::i#1 ]
@ -472,6 +491,7 @@ Score: 185
//SEG2 Global Constants & labels
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label BYTES = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -496,9 +516,9 @@ main: {
//SEG18 [7] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG19 main::@1
b1:
//SEG20 [8] *((const byte*) HEAP_START#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx
//SEG20 [8] *((const byte*) BYTES#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx
txa
sta HEAP_START,x
sta BYTES,x
//SEG21 [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG22 [10] if((byte) main::i#1!=(byte) 0) goto main::@1 -- vbuxx_neq_0_then_la1
@ -512,6 +532,7 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
//SEG26 malloc::@return
//SEG27 [13] return
rts

View File

@ -3,6 +3,7 @@
(label) @begin
(label) @end
(byte*) BYTES
(const byte*) BYTES#0 BYTES = (byte*)(const void*) malloc::return#0
(byte*) HEAP_START
(const byte*) HEAP_START#0 HEAP_START = (byte*) 49152
(byte*) heap_head
@ -12,10 +13,11 @@
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 22.0
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(const void*) malloc::return#0 return = (void*)(const byte*) HEAP_START#0
(word) malloc::size
reg byte x [ main::i#2 main::i#1 ]

View File

@ -5,15 +5,16 @@
.const SIZEOF_WORD = 2
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label WORDS = malloc.return
bbegin:
jsr malloc
jsr main
rts
main: {
.label w = 2
lda #<HEAP_START
lda #<WORDS
sta w
lda #>HEAP_START
lda #>WORDS
sta w+1
ldx #0
b1:
@ -38,5 +39,6 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
rts
}

View File

@ -15,7 +15,7 @@ main: scope:[main] from @2
[6] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (word*) main::w#2 ← phi( main/(const byte*) HEAP_START#0 main::@1/(word*) main::w#1 )
[7] (word*) main::w#2 ← phi( main/(const word*) WORDS#0 main::@1/(word*) main::w#1 )
[7] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[8] *((word*) main::w#2) ← (byte) main::i#2
[9] (word*) main::w#1 ← (word*) main::w#2 + (const byte) SIZEOF_WORD

View File

@ -1,4 +1,6 @@
Adding pointer type conversion cast (byte*) HEAP_START in (byte*) HEAP_START ← (number) $c000
Adding void pointer type conversion cast (void*) malloc::mem in (void*) malloc::return ← (byte*) malloc::mem
Adding pointer type conversion cast to void pointer (word*) $0 in (word*) WORDS ← (void*~) $0
Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items + (byte~) bsearch16u::$6
Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot + (number) 1
Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1
@ -19,12 +21,12 @@ malloc: scope:[malloc] from @3
(byte*) heap_head#4 ← phi( @3/(byte*) heap_head#7 )
(byte*) malloc::mem#0 ← (byte*) heap_head#4
(byte*) heap_head#1 ← (byte*) heap_head#4 + (word) malloc::size#1
(byte*) malloc::return#0 ← (byte*) malloc::mem#0
(void*) malloc::return#0 ← ((void*)) (byte*) malloc::mem#0
to:malloc::@return
malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#5 ← phi( malloc/(byte*) heap_head#1 )
(byte*) malloc::return#3 ← phi( malloc/(byte*) malloc::return#0 )
(byte*) malloc::return#1 ← (byte*) malloc::return#3
(void*) malloc::return#3 ← phi( malloc/(void*) malloc::return#0 )
(void*) malloc::return#1 ← (void*) malloc::return#3
(byte*) heap_head#2 ← (byte*) heap_head#5
return
to:@return
@ -32,14 +34,14 @@ malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#7 ← phi( @begin/(byte*) heap_head#0 )
(word) malloc::size#0 ← (number) $200
call malloc
(byte*) malloc::return#2 ← (byte*) malloc::return#1
(void*) malloc::return#2 ← (void*) malloc::return#1
to:@5
@5: scope:[] from @3
(byte*) heap_head#6 ← phi( @3/(byte*) heap_head#2 )
(byte*) malloc::return#4 ← phi( @3/(byte*) malloc::return#2 )
(byte*~) $0 ← (byte*) malloc::return#4
(void*) malloc::return#4 ← phi( @3/(void*) malloc::return#2 )
(void*~) $0 ← (void*) malloc::return#4
(byte*) heap_head#3 ← (byte*) heap_head#6
(word*) WORDS#0 ← (byte*~) $0
(word*) WORDS#0 ← ((word*)) (void*~) $0
to:@4
main: scope:[main] from @4
(word*) WORDS#1 ← phi( @4/(word*) WORDS#2 )
@ -67,7 +69,7 @@ main::@return: scope:[main] from main::@1
@end: scope:[] from @6
SYMBOL TABLE SSA
(byte*~) $0
(void*~) $0
(label) @3
(label) @4
(label) @5
@ -102,16 +104,16 @@ SYMBOL TABLE SSA
(word*) main::w#0
(word*) main::w#1
(word*) main::w#2
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::mem#0
(byte*) malloc::return
(byte*) malloc::return#0
(byte*) malloc::return#1
(byte*) malloc::return#2
(byte*) malloc::return#3
(byte*) malloc::return#4
(void*) malloc::return
(void*) malloc::return#0
(void*) malloc::return#1
(void*) malloc::return#2
(void*) malloc::return#3
(void*) malloc::return#4
(word) malloc::size
(word) malloc::size#0
(word) malloc::size#1
@ -119,7 +121,9 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) $200 in (word) malloc::size#0 ← (number) $200
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) HEAP_START#0 ← (byte*)(number) $c000
Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0
Inlining cast (word) malloc::size#0 ← (unumber)(number) $200
Inlining cast (word*) WORDS#0 ← (word*)(void*~) $0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 49152
Simplifying constant integer cast $200
@ -127,11 +131,11 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $200
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) HEAP_START#0 = (byte*) heap_head#0 (byte*) heap_head#7
Alias (byte*) malloc::return#0 = (byte*) malloc::mem#0 (byte*) malloc::return#3 (byte*) malloc::return#1
Alias (void*) malloc::return#0 = (void*) malloc::return#3 (void*) malloc::return#1
Alias (byte*) heap_head#1 = (byte*) heap_head#5 (byte*) heap_head#2
Alias (byte*) malloc::return#2 = (byte*) malloc::return#4
Alias (void*) malloc::return#2 = (void*) malloc::return#4
Alias (byte*) heap_head#3 = (byte*) heap_head#6
Alias (word*) WORDS#0 = (byte*~) $0 (word*) WORDS#2
Alias (word*) WORDS#0 = (word*) WORDS#2
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) heap_head#4 (byte*) HEAP_START#0
Identical Phi Values (word) malloc::size#1 (word) malloc::size#0
@ -144,14 +148,10 @@ Constant (const byte*) HEAP_START#0 = (byte*) 49152
Constant (const word) malloc::size#0 = $200
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) malloc::return#0 = HEAP_START#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) malloc::return#2 = malloc::return#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const word*) WORDS#0 = malloc::return#2
Successful SSA optimization Pass2ConstantIdentification
Constant (const word*) main::w#0 = WORDS#0
Constant (const byte*) malloc::mem#0 = HEAP_START#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (void*)malloc::mem#0 in [5] (void*) malloc::return#0 ← (void*)(const byte*) malloc::mem#0
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [24] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [26] if(main::i#1!=rangelast(0,$ff)) goto main::@1 to (number) 0
Eliminating unused variable (byte*) heap_head#1 and assignment [0] (byte*) heap_head#1 ← (const byte*) HEAP_START#0 + (const word) malloc::size#0
@ -164,13 +164,26 @@ Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant (const void*) malloc::return#0 = (void*)malloc::mem#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const void*) malloc::return#2 = malloc::return#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const void*) $0 = malloc::return#2
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word*)$0 in [5] (word*) WORDS#0 ← (word*)(const void*) $0
Successful SSA optimization Pass2ConstantValues
Constant (const word*) WORDS#0 = (word*)$0
Successful SSA optimization Pass2ConstantIdentification
Constant (const word*) main::w#0 = WORDS#0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const void*) malloc::return#2
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const word*) main::w#0
Constant inlined main::i#0 = (byte) 0
Constant inlined malloc::return#2 = (const byte*) HEAP_START#0
Constant inlined malloc::return#0 = (const byte*) HEAP_START#0
Constant inlined main::w#0 = (const byte*) HEAP_START#0
Constant inlined WORDS#0 = (const byte*) HEAP_START#0
Constant inlined malloc::return#2 = (const void*) malloc::return#0
Constant inlined malloc::mem#0 = (const byte*) HEAP_START#0
Constant inlined $0 = (const void*) malloc::return#0
Constant inlined main::w#0 = (const word*) WORDS#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
@ -218,7 +231,7 @@ main: scope:[main] from @2
[6] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (word*) main::w#2 ← phi( main/(const byte*) HEAP_START#0 main::@1/(word*) main::w#1 )
[7] (word*) main::w#2 ← phi( main/(const word*) WORDS#0 main::@1/(word*) main::w#1 )
[7] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[8] *((word*) main::w#2) ← (byte) main::i#2
[9] (word*) main::w#1 ← (word*) main::w#2 + (const byte) SIZEOF_WORD
@ -247,9 +260,9 @@ VARIABLE REGISTER WEIGHTS
(word*) main::w
(word*) main::w#1 7.333333333333333
(word*) main::w#2 16.5
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(word) malloc::size
Initial phi equivalence classes
@ -272,6 +285,7 @@ INITIAL ASM
.const SIZEOF_WORD = 2
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label WORDS = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -303,10 +317,10 @@ main: {
.label i = 2
//SEG15 [7] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG16 [7] phi (word*) main::w#2 = (const byte*) HEAP_START#0 [phi:main->main::@1#0] -- pwuz1=pbuc1
lda #<HEAP_START
//SEG16 [7] phi (word*) main::w#2 = (const word*) WORDS#0 [phi:main->main::@1#0] -- pwuz1=pwuc1
lda #<WORDS
sta w
lda #>HEAP_START
lda #>WORDS
sta w+1
//SEG17 [7] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #0
@ -350,6 +364,7 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
jmp breturn
//SEG29 malloc::@return
breturn:
@ -389,6 +404,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.const SIZEOF_WORD = 2
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label WORDS = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -419,10 +435,10 @@ main: {
.label w = 2
//SEG15 [7] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG16 [7] phi (word*) main::w#2 = (const byte*) HEAP_START#0 [phi:main->main::@1#0] -- pwuz1=pbuc1
lda #<HEAP_START
//SEG16 [7] phi (word*) main::w#2 = (const word*) WORDS#0 [phi:main->main::@1#0] -- pwuz1=pwuc1
lda #<WORDS
sta w
lda #>HEAP_START
lda #>WORDS
sta w+1
//SEG17 [7] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #0
@ -464,6 +480,7 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
jmp breturn
//SEG29 malloc::@return
breturn:
@ -509,6 +526,7 @@ FINAL SYMBOL TABLE
(const byte*) HEAP_START#0 HEAP_START = (byte*) 49152
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2
(word*) WORDS
(const word*) WORDS#0 WORDS = (word*)(const void*) malloc::return#0
(byte*) heap_head
(void()) main()
(label) main::@1
@ -519,10 +537,11 @@ FINAL SYMBOL TABLE
(word*) main::w
(word*) main::w#1 w zp ZP_WORD:2 7.333333333333333
(word*) main::w#2 w zp ZP_WORD:2 16.5
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(const void*) malloc::return#0 return = (void*)(const byte*) HEAP_START#0
(word) malloc::size
reg byte x [ main::i#2 main::i#1 ]
@ -542,6 +561,7 @@ Score: 590
.const SIZEOF_WORD = 2
// Start of the heap used by malloc()
.label HEAP_START = $c000
.label WORDS = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -561,10 +581,10 @@ bbegin:
main: {
.label w = 2
//SEG15 [7] phi from main to main::@1 [phi:main->main::@1]
//SEG16 [7] phi (word*) main::w#2 = (const byte*) HEAP_START#0 [phi:main->main::@1#0] -- pwuz1=pbuc1
lda #<HEAP_START
//SEG16 [7] phi (word*) main::w#2 = (const word*) WORDS#0 [phi:main->main::@1#0] -- pwuz1=pwuc1
lda #<WORDS
sta w
lda #>HEAP_START
lda #>WORDS
sta w+1
//SEG17 [7] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #0
@ -601,6 +621,7 @@ main: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
//SEG29 malloc::@return
//SEG30 [14] return
rts

View File

@ -6,6 +6,7 @@
(const byte*) HEAP_START#0 HEAP_START = (byte*) 49152
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2
(word*) WORDS
(const word*) WORDS#0 WORDS = (word*)(const void*) malloc::return#0
(byte*) heap_head
(void()) main()
(label) main::@1
@ -16,10 +17,11 @@
(word*) main::w
(word*) main::w#1 w zp ZP_WORD:2 7.333333333333333
(word*) main::w#2 w zp ZP_WORD:2 16.5
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(const void*) malloc::return#0 return = (void*)(const byte*) HEAP_START#0
(word) malloc::size
reg byte x [ main::i#2 main::i#1 ]

View File

@ -14,10 +14,10 @@ main: {
lda #>HEAP_START
sta heap_head+1
jsr malloc
lda malloc.return
sta malloc.return_2
lda malloc.return+1
sta malloc.return_2+1
lda malloc.mem
sta buf1
lda malloc.mem+1
sta buf1+1
jsr malloc
ldy #0
b1:
@ -48,12 +48,11 @@ free: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = 6
.label return_2 = 4
.label mem = 6
lda heap_head
sta return
sta mem
lda heap_head+1
sta return+1
sta mem+1
lda #$64
clc
adc heap_head

View File

@ -10,50 +10,48 @@
main: scope:[main] from @1
[4] phi()
[5] call malloc
[6] (byte*) malloc::return#2 ← (byte*) malloc::return#0
to:main::@3
main::@3: scope:[main] from main
[7] (byte*) main::buf1#0 ← (byte*) malloc::return#2
[8] call malloc
[9] (byte*) malloc::return#3 ← (byte*) malloc::return#0
[6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0
[7] call malloc
to:main::@4
main::@4: scope:[main] from main::@3
[10] (byte*) main::buf2#0 ← (byte*) malloc::return#3
[8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0
to:main::@1
main::@1: scope:[main] from main::@1 main::@4
[11] (byte) main::i#2 ← phi( main::@1/(byte) main::i#1 main::@4/(byte) 0 )
[12] *((byte*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2
[13] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2
[14] *((byte*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4
[15] (byte) main::i#1 ← ++ (byte) main::i#2
[16] if((byte) main::i#1!=(byte) $64) goto main::@1
[9] (byte) main::i#2 ← phi( main::@1/(byte) main::i#1 main::@4/(byte) 0 )
[10] *((byte*)(void*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2
[11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2
[12] *((byte*)(void*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4
[13] (byte) main::i#1 ← ++ (byte) main::i#2
[14] if((byte) main::i#1!=(byte) $64) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[17] phi()
[18] call free
[15] phi()
[16] call free
to:main::@5
main::@5: scope:[main] from main::@2
[19] phi()
[20] call free
[17] phi()
[18] call free
to:main::@6
main::@6: scope:[main] from main::@5
[21] *((const byte*) main::screen#0) ← *((byte*) main::buf1#0)
[22] *((const byte*) main::screen#0+(byte) 1) ← *((byte*) main::buf2#0)
[19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0)
[20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0)
to:main::@return
main::@return: scope:[main] from main::@6
[23] return
[21] return
to:@return
free: scope:[free] from main::@2 main::@5
[24] phi()
[22] phi()
to:free::@return
free::@return: scope:[free] from free
[25] return
[23] return
to:@return
malloc: scope:[malloc] from main main::@3
[26] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_START#0 main::@3/(byte*) heap_head#1 )
[27] (byte*) malloc::return#0 ← (byte*) heap_head#7
[28] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64
[24] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_START#0 main::@3/(byte*) heap_head#1 )
[25] (byte*) malloc::mem#0 ← (byte*) heap_head#7
[26] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64
to:malloc::@return
malloc::@return: scope:[malloc] from malloc
[29] return
[27] return
to:@return

View File

@ -1,4 +1,9 @@
Adding pointer type conversion cast (byte*) HEAP_START in (byte*) HEAP_START ← (number) $c000
Adding void pointer type conversion cast (void*) malloc::mem in (void*) malloc::return ← (byte*) malloc::mem
Adding pointer type conversion cast to void pointer (byte*) main::$0 in (byte*) main::buf1 ← (void*~) main::$0
Adding pointer type conversion cast to void pointer (byte*) main::$1 in (byte*) main::buf2 ← (void*~) main::$1
Adding void pointer type conversion cast (void*) main::buf1 in (void~) main::$2 ← call free (byte*) main::buf1
Adding void pointer type conversion cast (void*) main::buf2 in (void~) main::$3 ← call free (byte*) main::buf2
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items + (byte~) bsearch16u::$6
Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot + (number) 1
@ -20,12 +25,12 @@ malloc: scope:[malloc] from main main::@3
(byte*) heap_head#7 ← phi( main/(byte*) heap_head#13 main::@3/(byte*) heap_head#3 )
(byte*) malloc::mem#0 ← (byte*) heap_head#7
(byte*) heap_head#1 ← (byte*) heap_head#7 + (word) malloc::size#2
(byte*) malloc::return#0 ← (byte*) malloc::mem#0
(void*) malloc::return#0 ← ((void*)) (byte*) malloc::mem#0
to:malloc::@return
malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#8 ← phi( malloc/(byte*) heap_head#1 )
(byte*) malloc::return#4 ← phi( malloc/(byte*) malloc::return#0 )
(byte*) malloc::return#1 ← (byte*) malloc::return#4
(void*) malloc::return#4 ← phi( malloc/(void*) malloc::return#0 )
(void*) malloc::return#1 ← (void*) malloc::return#4
(byte*) heap_head#2 ← (byte*) heap_head#8
return
to:@return
@ -38,25 +43,25 @@ main: scope:[main] from @4
(byte*) heap_head#13 ← phi( @4/(byte*) heap_head#15 )
(word) malloc::size#0 ← (number) $64
call malloc
(byte*) malloc::return#2 ← (byte*) malloc::return#1
(void*) malloc::return#2 ← (void*) malloc::return#1
to:main::@3
main::@3: scope:[main] from main
(byte*) heap_head#9 ← phi( main/(byte*) heap_head#2 )
(byte*) malloc::return#5 ← phi( main/(byte*) malloc::return#2 )
(byte*~) main::$0 ← (byte*) malloc::return#5
(void*) malloc::return#5 ← phi( main/(void*) malloc::return#2 )
(void*~) main::$0 ← (void*) malloc::return#5
(byte*) heap_head#3 ← (byte*) heap_head#9
(byte*) main::buf1#0 ← (byte*~) main::$0
(byte*) main::buf1#0 ← ((byte*)) (void*~) main::$0
(word) malloc::size#1 ← (number) $64
call malloc
(byte*) malloc::return#3 ← (byte*) malloc::return#1
(void*) malloc::return#3 ← (void*) malloc::return#1
to:main::@4
main::@4: scope:[main] from main::@3
(byte*) main::buf1#4 ← phi( main::@3/(byte*) main::buf1#0 )
(byte*) heap_head#10 ← phi( main::@3/(byte*) heap_head#2 )
(byte*) malloc::return#6 ← phi( main::@3/(byte*) malloc::return#3 )
(byte*~) main::$1 ← (byte*) malloc::return#6
(void*) malloc::return#6 ← phi( main::@3/(void*) malloc::return#3 )
(void*~) main::$1 ← (void*) malloc::return#6
(byte*) heap_head#4 ← (byte*) heap_head#10
(byte*) main::buf2#0 ← (byte*~) main::$1
(byte*) main::buf2#0 ← ((byte*)) (void*~) main::$1
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main::@1 main::@4
@ -75,14 +80,14 @@ main::@2: scope:[main] from main::@1
(byte*) heap_head#17 ← phi( main::@1/(byte*) heap_head#18 )
(byte*) main::buf2#4 ← phi( main::@1/(byte*) main::buf2#1 )
(byte*) main::buf1#2 ← phi( main::@1/(byte*) main::buf1#1 )
(byte*) free::ptr#0 ← (byte*) main::buf1#2
(void*) free::ptr#0 ← (void*)(byte*) main::buf1#2
call free
to:main::@5
main::@5: scope:[main] from main::@2
(byte*) heap_head#16 ← phi( main::@2/(byte*) heap_head#17 )
(byte*) main::buf1#5 ← phi( main::@2/(byte*) main::buf1#2 )
(byte*) main::buf2#2 ← phi( main::@2/(byte*) main::buf2#4 )
(byte*) free::ptr#1 ← (byte*) main::buf2#2
(void*) free::ptr#1 ← (void*)(byte*) main::buf2#2
call free
to:main::@6
main::@6: scope:[main] from main::@5
@ -115,11 +120,11 @@ SYMBOL TABLE SSA
(label) @end
(byte*) HEAP_START
(byte*) HEAP_START#0
(void()) free((byte*) free::ptr)
(void()) free((void*) free::ptr)
(label) free::@return
(byte*) free::ptr
(byte*) free::ptr#0
(byte*) free::ptr#1
(void*) free::ptr
(void*) free::ptr#0
(void*) free::ptr#1
(byte*) heap_head
(byte*) heap_head#0
(byte*) heap_head#1
@ -141,8 +146,8 @@ SYMBOL TABLE SSA
(byte*) heap_head#8
(byte*) heap_head#9
(void()) main()
(byte*~) main::$0
(byte*~) main::$1
(void*~) main::$0
(void*~) main::$1
(number~) main::$4
(bool~) main::$5
(label) main::@1
@ -171,18 +176,18 @@ SYMBOL TABLE SSA
(byte) main::i#2
(byte*) main::screen
(byte*) main::screen#0
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::mem#0
(byte*) malloc::return
(byte*) malloc::return#0
(byte*) malloc::return#1
(byte*) malloc::return#2
(byte*) malloc::return#3
(byte*) malloc::return#4
(byte*) malloc::return#5
(byte*) malloc::return#6
(void*) malloc::return
(void*) malloc::return#0
(void*) malloc::return#1
(void*) malloc::return#2
(void*) malloc::return#3
(void*) malloc::return#4
(void*) malloc::return#5
(void*) malloc::return#6
(word) malloc::size
(word) malloc::size#0
(word) malloc::size#1
@ -196,8 +201,11 @@ Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number)
Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← *((byte*) main::buf2#3)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) HEAP_START#0 ← (byte*)(number) $c000
Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0
Inlining cast (word) malloc::size#0 ← (unumber)(number) $64
Inlining cast (byte*) main::buf1#0 ← (byte*)(void*~) main::$0
Inlining cast (word) malloc::size#1 ← (unumber)(number) $64
Inlining cast (byte*) main::buf2#0 ← (byte*)(void*~) main::$1
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 49152
@ -216,14 +224,13 @@ Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$4 ← (byte) $ff - (byte) main::i#2
Alias (byte*) HEAP_START#0 = (byte*) heap_head#0 (byte*) heap_head#15
Alias (byte*) malloc::return#0 = (byte*) malloc::mem#0 (byte*) malloc::return#4 (byte*) malloc::return#1
Alias (void*) malloc::return#0 = (void*) malloc::return#4 (void*) malloc::return#1
Alias (byte*) heap_head#1 = (byte*) heap_head#8 (byte*) heap_head#2
Alias (byte*) malloc::return#2 = (byte*) malloc::return#5
Alias (void*) malloc::return#2 = (void*) malloc::return#5
Alias (byte*) heap_head#3 = (byte*) heap_head#9
Alias (byte*) main::buf1#0 = (byte*~) main::$0 (byte*) main::buf1#4
Alias (byte*) malloc::return#3 = (byte*) malloc::return#6
Alias (void*) malloc::return#3 = (void*) malloc::return#6
Alias (byte*) main::buf1#0 = (byte*) main::buf1#4
Alias (byte*) heap_head#10 = (byte*) heap_head#4
Alias (byte*) main::buf2#0 = (byte*~) main::$1
Alias (byte*) main::buf1#1 = (byte*) main::buf1#2 (byte*) main::buf1#5 (byte*) main::buf1#3
Alias (byte*) main::buf2#1 = (byte*) main::buf2#4 (byte*) main::buf2#2 (byte*) main::buf2#3
Alias (byte*) heap_head#11 = (byte*) heap_head#17 (byte*) heap_head#18 (byte*) heap_head#16 (byte*) heap_head#14 (byte*) heap_head#5
@ -253,8 +260,8 @@ Resolved ranged next value [31] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [33] if(main::i#1!=rangelast(0,$63)) goto main::@1 to (number) $64
Simplifying expression containing zero main::screen#0 in [42] *((const byte*) main::screen#0 + (byte) 0) ← *((byte*) main::buf1#0)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte*) free::ptr#0 and assignment [17] (byte*) free::ptr#0 ← (byte*) main::buf1#0
Eliminating unused variable (byte*) free::ptr#1 and assignment [19] (byte*) free::ptr#1 ← (byte*) main::buf2#0
Eliminating unused variable (void*) free::ptr#0 and assignment [20] (void*) free::ptr#0 ← (void*)(byte*) main::buf1#0
Eliminating unused variable (void*) free::ptr#1 and assignment [22] (void*) free::ptr#1 ← (void*)(byte*) main::buf2#0
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) $64 in if((byte) main::i#1!=(number) $64) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
@ -262,6 +269,14 @@ Simplifying constant integer cast $64
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $64
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining Noop Cast [3] (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 keeping malloc::mem#0
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [7] (void*) malloc::return#2 ← (void*)(byte*) malloc::mem#0 keeping malloc::mem#0
Inlining Noop Cast [11] (void*) malloc::return#3 ← (void*)(byte*) malloc::mem#0 keeping malloc::mem#0
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [9] (byte*) main::buf1#0 ← (byte*)(void*~) main::$0 keeping main::buf1#0
Inlining Noop Cast [13] (byte*) main::buf2#0 ← (byte*)(void*~) main::$1 keeping main::buf2#0
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const word) malloc::size#0
Inlining constant with var siblings (const word) malloc::size#1
Inlining constant with var siblings (const byte) main::i#0
@ -284,11 +299,11 @@ Adding NOP phi() at start of main::@5
Adding NOP phi() at start of free
CALL GRAPH
Calls in [] to main:2
Calls in [main] to malloc:6 malloc:10 free:20 free:22
Calls in [main] to malloc:6 malloc:9 free:18 free:20
Created 2 initial phi equivalence classes
Coalesced [9] heap_head#19 ← heap_head#1
Coalesced [26] main::i#3 ← main::i#1
Coalesced [8] heap_head#19 ← heap_head#1
Coalesced [24] main::i#3 ← main::i#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) main::@7
@ -314,106 +329,96 @@ FINAL CONTROL FLOW GRAPH
main: scope:[main] from @1
[4] phi()
[5] call malloc
[6] (byte*) malloc::return#2 ← (byte*) malloc::return#0
to:main::@3
main::@3: scope:[main] from main
[7] (byte*) main::buf1#0 ← (byte*) malloc::return#2
[8] call malloc
[9] (byte*) malloc::return#3 ← (byte*) malloc::return#0
[6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0
[7] call malloc
to:main::@4
main::@4: scope:[main] from main::@3
[10] (byte*) main::buf2#0 ← (byte*) malloc::return#3
[8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0
to:main::@1
main::@1: scope:[main] from main::@1 main::@4
[11] (byte) main::i#2 ← phi( main::@1/(byte) main::i#1 main::@4/(byte) 0 )
[12] *((byte*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2
[13] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2
[14] *((byte*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4
[15] (byte) main::i#1 ← ++ (byte) main::i#2
[16] if((byte) main::i#1!=(byte) $64) goto main::@1
[9] (byte) main::i#2 ← phi( main::@1/(byte) main::i#1 main::@4/(byte) 0 )
[10] *((byte*)(void*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2
[11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2
[12] *((byte*)(void*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4
[13] (byte) main::i#1 ← ++ (byte) main::i#2
[14] if((byte) main::i#1!=(byte) $64) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[17] phi()
[18] call free
[15] phi()
[16] call free
to:main::@5
main::@5: scope:[main] from main::@2
[19] phi()
[20] call free
[17] phi()
[18] call free
to:main::@6
main::@6: scope:[main] from main::@5
[21] *((const byte*) main::screen#0) ← *((byte*) main::buf1#0)
[22] *((const byte*) main::screen#0+(byte) 1) ← *((byte*) main::buf2#0)
[19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0)
[20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0)
to:main::@return
main::@return: scope:[main] from main::@6
[23] return
[21] return
to:@return
free: scope:[free] from main::@2 main::@5
[24] phi()
[22] phi()
to:free::@return
free::@return: scope:[free] from free
[25] return
[23] return
to:@return
malloc: scope:[malloc] from main main::@3
[26] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_START#0 main::@3/(byte*) heap_head#1 )
[27] (byte*) malloc::return#0 ← (byte*) heap_head#7
[28] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64
[24] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_START#0 main::@3/(byte*) heap_head#1 )
[25] (byte*) malloc::mem#0 ← (byte*) heap_head#7
[26] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64
to:malloc::@return
malloc::@return: scope:[malloc] from malloc
[29] return
[27] return
to:@return
VARIABLE REGISTER WEIGHTS
(byte*) HEAP_START
(void()) free((byte*) free::ptr)
(byte*) free::ptr
(void()) free((void*) free::ptr)
(void*) free::ptr
(byte*) heap_head
(byte*) heap_head#1 0.8
(byte*) heap_head#1 1.0
(byte*) heap_head#7 3.0
(void()) main()
(byte~) main::$4 22.0
(byte*) main::buf1
(byte*) main::buf1#0 1.0714285714285714
(void*) main::buf1#0 0.15384615384615385
(byte*) main::buf2
(byte*) main::buf2#0 1.25
(void*) main::buf2#0 0.16666666666666666
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 16.5
(byte*) main::screen
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(byte*) malloc::mem
(byte*) malloc::return
(byte*) malloc::return#0 1.2000000000000002
(byte*) malloc::return#2 4.0
(byte*) malloc::return#3 4.0
(byte*) malloc::mem#0 0.4
(void*) malloc::return
(word) malloc::size
Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ heap_head#7 heap_head#1 ]
Added variable malloc::return#2 to zero page equivalence class [ malloc::return#2 ]
Added variable main::buf1#0 to zero page equivalence class [ main::buf1#0 ]
Added variable malloc::return#3 to zero page equivalence class [ malloc::return#3 ]
Added variable main::buf2#0 to zero page equivalence class [ main::buf2#0 ]
Added variable main::$4 to zero page equivalence class [ main::$4 ]
Added variable malloc::return#0 to zero page equivalence class [ malloc::return#0 ]
Added variable malloc::mem#0 to zero page equivalence class [ malloc::mem#0 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ heap_head#7 heap_head#1 ]
[ malloc::return#2 ]
[ main::buf1#0 ]
[ malloc::return#3 ]
[ main::buf2#0 ]
[ main::$4 ]
[ malloc::return#0 ]
[ malloc::mem#0 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_WORD:3 [ heap_head#7 heap_head#1 ]
Allocated zp ZP_WORD:5 [ malloc::return#2 ]
Allocated zp ZP_WORD:7 [ main::buf1#0 ]
Allocated zp ZP_WORD:9 [ malloc::return#3 ]
Allocated zp ZP_WORD:11 [ main::buf2#0 ]
Allocated zp ZP_BYTE:13 [ main::$4 ]
Allocated zp ZP_WORD:14 [ malloc::return#0 ]
Allocated zp ZP_WORD:5 [ main::buf1#0 ]
Allocated zp ZP_WORD:7 [ main::buf2#0 ]
Allocated zp ZP_BYTE:9 [ main::$4 ]
Allocated zp ZP_WORD:10 [ malloc::mem#0 ]
INITIAL ASM
//SEG0 File Comments
@ -445,139 +450,127 @@ bend:
//SEG10 main
main: {
.label screen = $400
.label _4 = $d
.label buf1 = 7
.label buf2 = $b
.label _4 = 9
.label buf1 = 5
.label buf2 = 7
.label i = 2
//SEG11 [5] call malloc
//SEG12 [26] phi from main to malloc [phi:main->malloc]
//SEG12 [24] phi from main to malloc [phi:main->malloc]
malloc_from_main:
//SEG13 [26] phi (byte*) heap_head#7 = (const byte*) HEAP_START#0 [phi:main->malloc#0] -- pbuz1=pbuc1
//SEG13 [24] phi (byte*) heap_head#7 = (const byte*) HEAP_START#0 [phi:main->malloc#0] -- pbuz1=pbuc1
lda #<HEAP_START
sta heap_head
lda #>HEAP_START
sta heap_head+1
jsr malloc
//SEG14 [6] (byte*) malloc::return#2 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
lda malloc.return
sta malloc.return_2
lda malloc.return+1
sta malloc.return_2+1
jmp b3
//SEG15 main::@3
//SEG14 main::@3
b3:
//SEG16 [7] (byte*) main::buf1#0 ← (byte*) malloc::return#2 -- pbuz1=pbuz2
lda malloc.return_2
//SEG15 [6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0 -- pvoz1=pvoz2
lda malloc.mem
sta buf1
lda malloc.return_2+1
lda malloc.mem+1
sta buf1+1
//SEG17 [8] call malloc
//SEG18 [26] phi from main::@3 to malloc [phi:main::@3->malloc]
//SEG16 [7] call malloc
//SEG17 [24] phi from main::@3 to malloc [phi:main::@3->malloc]
malloc_from_b3:
//SEG19 [26] phi (byte*) heap_head#7 = (byte*) heap_head#1 [phi:main::@3->malloc#0] -- register_copy
//SEG18 [24] phi (byte*) heap_head#7 = (byte*) heap_head#1 [phi:main::@3->malloc#0] -- register_copy
jsr malloc
//SEG20 [9] (byte*) malloc::return#3 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
lda malloc.return
sta malloc.return_3
lda malloc.return+1
sta malloc.return_3+1
jmp b4
//SEG21 main::@4
//SEG19 main::@4
b4:
//SEG22 [10] (byte*) main::buf2#0 ← (byte*) malloc::return#3 -- pbuz1=pbuz2
lda malloc.return_3
//SEG20 [8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0 -- pvoz1=pvoz2
lda malloc.mem
sta buf2
lda malloc.return_3+1
lda malloc.mem+1
sta buf2+1
//SEG23 [11] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
//SEG21 [9] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
b1_from_b4:
//SEG24 [11] phi (byte) main::i#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuz1=vbuc1
//SEG22 [9] phi (byte) main::i#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuz1=vbuc1
lda #0
sta i
jmp b1
//SEG25 [11] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG23 [9] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
b1_from_b1:
//SEG26 [11] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG24 [9] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
jmp b1
//SEG27 main::@1
//SEG25 main::@1
b1:
//SEG28 [12] *((byte*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuz1_derefidx_vbuz2=vbuz2
//SEG26 [10] *((byte*)(void*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuz1_derefidx_vbuz2=vbuz2
lda i
tay
sta (buf1),y
//SEG29 [13] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 -- vbuz1=vbuc1_minus_vbuz2
//SEG27 [11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 -- vbuz1=vbuc1_minus_vbuz2
lda #$ff
sec
sbc i
sta _4
//SEG30 [14] *((byte*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4 -- pbuz1_derefidx_vbuz2=vbuz3
//SEG28 [12] *((byte*)(void*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4 -- pbuz1_derefidx_vbuz2=vbuz3
lda _4
ldy i
sta (buf2),y
//SEG31 [15] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
//SEG29 [13] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG32 [16] if((byte) main::i#1!=(byte) $64) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG30 [14] if((byte) main::i#1!=(byte) $64) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$64
cmp i
bne b1_from_b1
//SEG33 [17] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG31 [15] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
jmp b2
//SEG34 main::@2
//SEG32 main::@2
b2:
//SEG35 [18] call free
//SEG36 [24] phi from main::@2 to free [phi:main::@2->free]
//SEG33 [16] call free
//SEG34 [22] phi from main::@2 to free [phi:main::@2->free]
free_from_b2:
jsr free
//SEG37 [19] phi from main::@2 to main::@5 [phi:main::@2->main::@5]
//SEG35 [17] phi from main::@2 to main::@5 [phi:main::@2->main::@5]
b5_from_b2:
jmp b5
//SEG38 main::@5
//SEG36 main::@5
b5:
//SEG39 [20] call free
//SEG40 [24] phi from main::@5 to free [phi:main::@5->free]
//SEG37 [18] call free
//SEG38 [22] phi from main::@5 to free [phi:main::@5->free]
free_from_b5:
jsr free
jmp b6
//SEG41 main::@6
//SEG39 main::@6
b6:
//SEG42 [21] *((const byte*) main::screen#0) ← *((byte*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1
//SEG40 [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1
ldy #0
lda (buf1),y
sta screen
//SEG43 [22] *((const byte*) main::screen#0+(byte) 1) ← *((byte*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1
//SEG41 [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1
ldy #0
lda (buf2),y
sta screen+1
jmp breturn
//SEG44 main::@return
//SEG42 main::@return
breturn:
//SEG45 [23] return
//SEG43 [21] return
rts
}
//SEG46 free
//SEG44 free
// A block of memory previously allocated by a call to malloc is deallocated, making it available again for further allocations.
// If ptr is a null pointer, the function does nothing.
free: {
jmp breturn
//SEG47 free::@return
//SEG45 free::@return
breturn:
//SEG48 [25] return
//SEG46 [23] return
rts
}
//SEG49 malloc
//SEG47 malloc
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = $e
.label return_2 = 5
.label return_3 = 9
//SEG50 [27] (byte*) malloc::return#0 ← (byte*) heap_head#7 -- pbuz1=pbuz2
.label mem = $a
//SEG48 [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 -- pbuz1=pbuz2
lda heap_head
sta return
sta mem
lda heap_head+1
sta return+1
//SEG51 [28] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 -- pbuz1=pbuz1_plus_vbuc1
sta mem+1
//SEG49 [26] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 -- pbuz1=pbuz1_plus_vbuc1
lda #$64
clc
adc heap_head
@ -586,59 +579,51 @@ malloc: {
inc heap_head+1
!:
jmp breturn
//SEG52 malloc::@return
//SEG50 malloc::@return
breturn:
//SEG53 [29] return
//SEG51 [27] return
rts
}
//SEG54 File Data
//SEG52 File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte*) malloc::return#2 ← (byte*) malloc::return#0 [ malloc::return#2 heap_head#1 ] ( main:2 [ malloc::return#2 heap_head#1 ] ) always clobbers reg byte a
Statement [7] (byte*) main::buf1#0 ← (byte*) malloc::return#2 [ main::buf1#0 heap_head#1 ] ( main:2 [ main::buf1#0 heap_head#1 ] ) always clobbers reg byte a
Statement [9] (byte*) malloc::return#3 ← (byte*) malloc::return#0 [ main::buf1#0 malloc::return#3 ] ( main:2 [ main::buf1#0 malloc::return#3 ] ) always clobbers reg byte a
Statement [10] (byte*) main::buf2#0 ← (byte*) malloc::return#3 [ main::buf1#0 main::buf2#0 ] ( main:2 [ main::buf1#0 main::buf2#0 ] ) always clobbers reg byte a
Statement [13] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ) always clobbers reg byte a
Statement [6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1#0 heap_head#1 ] ( main:2 [ main::buf1#0 heap_head#1 ] ) always clobbers reg byte a
Statement [8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1#0 main::buf2#0 ] ( main:2 [ main::buf1#0 main::buf2#0 ] ) always clobbers reg byte a
Statement [11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Statement [21] *((const byte*) main::screen#0) ← *((byte*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y
Statement [22] *((const byte*) main::screen#0+(byte) 1) ← *((byte*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [27] (byte*) malloc::return#0 ← (byte*) heap_head#7 [ malloc::return#0 heap_head#7 ] ( main:2::malloc:5 [ malloc::return#0 heap_head#7 ] main:2::malloc:8 [ main::buf1#0 malloc::return#0 heap_head#7 ] ) always clobbers reg byte a
Statement [28] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 [ malloc::return#0 heap_head#1 ] ( main:2::malloc:5 [ malloc::return#0 heap_head#1 ] main:2::malloc:8 [ main::buf1#0 malloc::return#0 heap_head#1 ] ) always clobbers reg byte a
Statement [6] (byte*) malloc::return#2 ← (byte*) malloc::return#0 [ malloc::return#2 heap_head#1 ] ( main:2 [ malloc::return#2 heap_head#1 ] ) always clobbers reg byte a
Statement [7] (byte*) main::buf1#0 ← (byte*) malloc::return#2 [ main::buf1#0 heap_head#1 ] ( main:2 [ main::buf1#0 heap_head#1 ] ) always clobbers reg byte a
Statement [9] (byte*) malloc::return#3 ← (byte*) malloc::return#0 [ main::buf1#0 malloc::return#3 ] ( main:2 [ main::buf1#0 malloc::return#3 ] ) always clobbers reg byte a
Statement [10] (byte*) main::buf2#0 ← (byte*) malloc::return#3 [ main::buf1#0 main::buf2#0 ] ( main:2 [ main::buf1#0 main::buf2#0 ] ) always clobbers reg byte a
Statement [12] *((byte*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 ] ) always clobbers reg byte a
Statement [13] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ) always clobbers reg byte a
Statement [21] *((const byte*) main::screen#0) ← *((byte*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y
Statement [22] *((const byte*) main::screen#0+(byte) 1) ← *((byte*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [27] (byte*) malloc::return#0 ← (byte*) heap_head#7 [ malloc::return#0 heap_head#7 ] ( main:2::malloc:5 [ malloc::return#0 heap_head#7 ] main:2::malloc:8 [ main::buf1#0 malloc::return#0 heap_head#7 ] ) always clobbers reg byte a
Statement [28] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 [ malloc::return#0 heap_head#1 ] ( main:2::malloc:5 [ malloc::return#0 heap_head#1 ] main:2::malloc:8 [ main::buf1#0 malloc::return#0 heap_head#1 ] ) always clobbers reg byte a
Statement [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y
Statement [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 [ malloc::mem#0 heap_head#7 ] ( main:2::malloc:5 [ malloc::mem#0 heap_head#7 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 heap_head#7 ] ) always clobbers reg byte a
Statement [26] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 [ malloc::mem#0 heap_head#1 ] ( main:2::malloc:5 [ malloc::mem#0 heap_head#1 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 heap_head#1 ] ) always clobbers reg byte a
Statement [6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1#0 heap_head#1 ] ( main:2 [ main::buf1#0 heap_head#1 ] ) always clobbers reg byte a
Statement [8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1#0 main::buf2#0 ] ( main:2 [ main::buf1#0 main::buf2#0 ] ) always clobbers reg byte a
Statement [10] *((byte*)(void*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 ] ) always clobbers reg byte a
Statement [11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ) always clobbers reg byte a
Statement [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y
Statement [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 [ malloc::mem#0 heap_head#7 ] ( main:2::malloc:5 [ malloc::mem#0 heap_head#7 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 heap_head#7 ] ) always clobbers reg byte a
Statement [26] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 [ malloc::mem#0 heap_head#1 ] ( main:2::malloc:5 [ malloc::mem#0 heap_head#1 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 heap_head#1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:3 [ heap_head#7 heap_head#1 ] : zp ZP_WORD:3 ,
Potential registers zp ZP_WORD:5 [ malloc::return#2 ] : zp ZP_WORD:5 ,
Potential registers zp ZP_WORD:7 [ main::buf1#0 ] : zp ZP_WORD:7 ,
Potential registers zp ZP_WORD:9 [ malloc::return#3 ] : zp ZP_WORD:9 ,
Potential registers zp ZP_WORD:11 [ main::buf2#0 ] : zp ZP_WORD:11 ,
Potential registers zp ZP_BYTE:13 [ main::$4 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:14 [ malloc::return#0 ] : zp ZP_WORD:14 ,
Potential registers zp ZP_WORD:5 [ main::buf1#0 ] : zp ZP_WORD:5 ,
Potential registers zp ZP_WORD:7 [ main::buf2#0 ] : zp ZP_WORD:7 ,
Potential registers zp ZP_BYTE:9 [ main::$4 ] : zp ZP_BYTE:9 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:10 [ malloc::mem#0 ] : zp ZP_WORD:10 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 33: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:13 [ main::$4 ] 1.25: zp ZP_WORD:11 [ main::buf2#0 ] 1.07: zp ZP_WORD:7 [ main::buf1#0 ]
Uplift Scope [malloc] 4: zp ZP_WORD:5 [ malloc::return#2 ] 4: zp ZP_WORD:9 [ malloc::return#3 ] 1.2: zp ZP_WORD:14 [ malloc::return#0 ]
Uplift Scope [] 3.8: zp ZP_WORD:3 [ heap_head#7 heap_head#1 ]
Uplift Scope [main] 33: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:9 [ main::$4 ] 0.17: zp ZP_WORD:7 [ main::buf2#0 ] 0.15: zp ZP_WORD:5 [ main::buf1#0 ]
Uplift Scope [] 4: zp ZP_WORD:3 [ heap_head#7 heap_head#1 ]
Uplift Scope [malloc] 0.4: zp ZP_WORD:10 [ malloc::mem#0 ]
Uplift Scope [free]
Uplifting [main] best 579 combination reg byte y [ main::i#2 main::i#1 ] reg byte a [ main::$4 ] zp ZP_WORD:11 [ main::buf2#0 ] zp ZP_WORD:7 [ main::buf1#0 ]
Uplifting [malloc] best 579 combination zp ZP_WORD:5 [ malloc::return#2 ] zp ZP_WORD:9 [ malloc::return#3 ] zp ZP_WORD:14 [ malloc::return#0 ]
Uplifting [] best 579 combination zp ZP_WORD:3 [ heap_head#7 heap_head#1 ]
Uplifting [free] best 579 combination
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ malloc::return#2 ] ] with [ zp ZP_WORD:7 [ main::buf1#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:9 [ malloc::return#3 ] ] with [ zp ZP_WORD:11 [ main::buf2#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:9 [ malloc::return#3 main::buf2#0 ] ] with [ zp ZP_WORD:14 [ malloc::return#0 ] ] - score: 1
Uplifting [main] best 555 combination reg byte y [ main::i#2 main::i#1 ] reg byte a [ main::$4 ] zp ZP_WORD:7 [ main::buf2#0 ] zp ZP_WORD:5 [ main::buf1#0 ]
Uplifting [] best 555 combination zp ZP_WORD:3 [ heap_head#7 heap_head#1 ]
Uplifting [malloc] best 555 combination zp ZP_WORD:10 [ malloc::mem#0 ]
Uplifting [free] best 555 combination
Coalescing zero page register with common assignment [ zp ZP_WORD:7 [ main::buf2#0 ] ] with [ zp ZP_WORD:10 [ malloc::mem#0 ] ] - score: 1
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ heap_head#7 heap_head#1 ]
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ malloc::return#2 main::buf1#0 ]
Allocated (was zp ZP_WORD:9) zp ZP_WORD:6 [ malloc::return#3 main::buf2#0 malloc::return#0 ]
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ main::buf1#0 ]
Allocated (was zp ZP_WORD:7) zp ZP_WORD:6 [ main::buf2#0 malloc::mem#0 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
@ -673,116 +658,113 @@ main: {
.label buf1 = 4
.label buf2 = 6
//SEG11 [5] call malloc
//SEG12 [26] phi from main to malloc [phi:main->malloc]
//SEG12 [24] phi from main to malloc [phi:main->malloc]
malloc_from_main:
//SEG13 [26] phi (byte*) heap_head#7 = (const byte*) HEAP_START#0 [phi:main->malloc#0] -- pbuz1=pbuc1
//SEG13 [24] phi (byte*) heap_head#7 = (const byte*) HEAP_START#0 [phi:main->malloc#0] -- pbuz1=pbuc1
lda #<HEAP_START
sta heap_head
lda #>HEAP_START
sta heap_head+1
jsr malloc
//SEG14 [6] (byte*) malloc::return#2 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
lda malloc.return
sta malloc.return_2
lda malloc.return+1
sta malloc.return_2+1
jmp b3
//SEG15 main::@3
//SEG14 main::@3
b3:
//SEG16 [7] (byte*) main::buf1#0 ← (byte*) malloc::return#2
//SEG17 [8] call malloc
//SEG18 [26] phi from main::@3 to malloc [phi:main::@3->malloc]
//SEG15 [6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0 -- pvoz1=pvoz2
lda malloc.mem
sta buf1
lda malloc.mem+1
sta buf1+1
//SEG16 [7] call malloc
//SEG17 [24] phi from main::@3 to malloc [phi:main::@3->malloc]
malloc_from_b3:
//SEG19 [26] phi (byte*) heap_head#7 = (byte*) heap_head#1 [phi:main::@3->malloc#0] -- register_copy
//SEG18 [24] phi (byte*) heap_head#7 = (byte*) heap_head#1 [phi:main::@3->malloc#0] -- register_copy
jsr malloc
//SEG20 [9] (byte*) malloc::return#3 ← (byte*) malloc::return#0
jmp b4
//SEG21 main::@4
//SEG19 main::@4
b4:
//SEG22 [10] (byte*) main::buf2#0 ← (byte*) malloc::return#3
//SEG23 [11] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
//SEG20 [8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0
//SEG21 [9] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
b1_from_b4:
//SEG24 [11] phi (byte) main::i#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuyy=vbuc1
//SEG22 [9] phi (byte) main::i#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuyy=vbuc1
ldy #0
jmp b1
//SEG25 [11] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG23 [9] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
b1_from_b1:
//SEG26 [11] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG24 [9] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
jmp b1
//SEG27 main::@1
//SEG25 main::@1
b1:
//SEG28 [12] *((byte*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuz1_derefidx_vbuyy=vbuyy
//SEG26 [10] *((byte*)(void*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuz1_derefidx_vbuyy=vbuyy
tya
sta (buf1),y
//SEG29 [13] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 -- vbuaa=vbuc1_minus_vbuyy
//SEG27 [11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 -- vbuaa=vbuc1_minus_vbuyy
tya
eor #$ff
clc
adc #$ff+1
//SEG30 [14] *((byte*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4 -- pbuz1_derefidx_vbuyy=vbuaa
//SEG28 [12] *((byte*)(void*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4 -- pbuz1_derefidx_vbuyy=vbuaa
sta (buf2),y
//SEG31 [15] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy
//SEG29 [13] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy
iny
//SEG32 [16] if((byte) main::i#1!=(byte) $64) goto main::@1 -- vbuyy_neq_vbuc1_then_la1
//SEG30 [14] if((byte) main::i#1!=(byte) $64) goto main::@1 -- vbuyy_neq_vbuc1_then_la1
cpy #$64
bne b1_from_b1
//SEG33 [17] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG31 [15] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
jmp b2
//SEG34 main::@2
//SEG32 main::@2
b2:
//SEG35 [18] call free
//SEG36 [24] phi from main::@2 to free [phi:main::@2->free]
//SEG33 [16] call free
//SEG34 [22] phi from main::@2 to free [phi:main::@2->free]
free_from_b2:
jsr free
//SEG37 [19] phi from main::@2 to main::@5 [phi:main::@2->main::@5]
//SEG35 [17] phi from main::@2 to main::@5 [phi:main::@2->main::@5]
b5_from_b2:
jmp b5
//SEG38 main::@5
//SEG36 main::@5
b5:
//SEG39 [20] call free
//SEG40 [24] phi from main::@5 to free [phi:main::@5->free]
//SEG37 [18] call free
//SEG38 [22] phi from main::@5 to free [phi:main::@5->free]
free_from_b5:
jsr free
jmp b6
//SEG41 main::@6
//SEG39 main::@6
b6:
//SEG42 [21] *((const byte*) main::screen#0) ← *((byte*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1
//SEG40 [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1
ldy #0
lda (buf1),y
sta screen
//SEG43 [22] *((const byte*) main::screen#0+(byte) 1) ← *((byte*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1
//SEG41 [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1
ldy #0
lda (buf2),y
sta screen+1
jmp breturn
//SEG44 main::@return
//SEG42 main::@return
breturn:
//SEG45 [23] return
//SEG43 [21] return
rts
}
//SEG46 free
//SEG44 free
// A block of memory previously allocated by a call to malloc is deallocated, making it available again for further allocations.
// If ptr is a null pointer, the function does nothing.
free: {
jmp breturn
//SEG47 free::@return
//SEG45 free::@return
breturn:
//SEG48 [25] return
//SEG46 [23] return
rts
}
//SEG49 malloc
//SEG47 malloc
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = 6
.label return_2 = 4
//SEG50 [27] (byte*) malloc::return#0 ← (byte*) heap_head#7 -- pbuz1=pbuz2
.label mem = 6
//SEG48 [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 -- pbuz1=pbuz2
lda heap_head
sta return
sta mem
lda heap_head+1
sta return+1
//SEG51 [28] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 -- pbuz1=pbuz1_plus_vbuc1
sta mem+1
//SEG49 [26] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 -- pbuz1=pbuz1_plus_vbuc1
lda #$64
clc
adc heap_head
@ -791,12 +773,12 @@ malloc: {
inc heap_head+1
!:
jmp breturn
//SEG52 malloc::@return
//SEG50 malloc::@return
breturn:
//SEG53 [29] return
//SEG51 [27] return
rts
}
//SEG54 File Data
//SEG52 File Data
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
@ -818,7 +800,6 @@ Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction malloc_from_b3:
Removing instruction b1_from_b4:
Removing instruction b1_from_b1:
Removing instruction b2_from_b1:
@ -829,6 +810,7 @@ Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction malloc_from_main:
Removing instruction b3:
Removing instruction malloc_from_b3:
Removing instruction b4:
Removing instruction b2:
Removing instruction b5:
@ -851,11 +833,11 @@ FINAL SYMBOL TABLE
(label) @end
(byte*) HEAP_START
(const byte*) HEAP_START#0 HEAP_START = (byte*) 49152
(void()) free((byte*) free::ptr)
(void()) free((void*) free::ptr)
(label) free::@return
(byte*) free::ptr
(void*) free::ptr
(byte*) heap_head
(byte*) heap_head#1 heap_head zp ZP_WORD:2 0.8
(byte*) heap_head#1 heap_head zp ZP_WORD:2 1.0
(byte*) heap_head#7 heap_head zp ZP_WORD:2 3.0
(void()) main()
(byte~) main::$4 reg byte a 22.0
@ -867,27 +849,25 @@ FINAL SYMBOL TABLE
(label) main::@6
(label) main::@return
(byte*) main::buf1
(byte*) main::buf1#0 buf1 zp ZP_WORD:4 1.0714285714285714
(void*) main::buf1#0 buf1 zp ZP_WORD:4 0.15384615384615385
(byte*) main::buf2
(byte*) main::buf2#0 buf2 zp ZP_WORD:6 1.25
(void*) main::buf2#0 buf2 zp ZP_WORD:6 0.16666666666666666
(byte) main::i
(byte) main::i#1 reg byte y 16.5
(byte) main::i#2 reg byte y 16.5
(byte*) main::screen
(const byte*) main::screen#0 screen = (byte*) 1024
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(byte*) malloc::return#0 return zp ZP_WORD:6 1.2000000000000002
(byte*) malloc::return#2 return#2 zp ZP_WORD:4 4.0
(byte*) malloc::return#3 return zp ZP_WORD:6 4.0
(byte*) malloc::mem#0 mem zp ZP_WORD:6 0.4
(void*) malloc::return
(word) malloc::size
reg byte y [ main::i#2 main::i#1 ]
zp ZP_WORD:2 [ heap_head#7 heap_head#1 ]
zp ZP_WORD:4 [ malloc::return#2 main::buf1#0 ]
zp ZP_WORD:6 [ malloc::return#3 main::buf2#0 malloc::return#0 ]
zp ZP_WORD:4 [ main::buf1#0 ]
zp ZP_WORD:6 [ main::buf2#0 malloc::mem#0 ]
reg byte a [ main::$4 ]
@ -917,91 +897,88 @@ main: {
.label buf1 = 4
.label buf2 = 6
//SEG11 [5] call malloc
//SEG12 [26] phi from main to malloc [phi:main->malloc]
//SEG13 [26] phi (byte*) heap_head#7 = (const byte*) HEAP_START#0 [phi:main->malloc#0] -- pbuz1=pbuc1
//SEG12 [24] phi from main to malloc [phi:main->malloc]
//SEG13 [24] phi (byte*) heap_head#7 = (const byte*) HEAP_START#0 [phi:main->malloc#0] -- pbuz1=pbuc1
lda #<HEAP_START
sta heap_head
lda #>HEAP_START
sta heap_head+1
jsr malloc
//SEG14 [6] (byte*) malloc::return#2 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
lda malloc.return
sta malloc.return_2
lda malloc.return+1
sta malloc.return_2+1
//SEG15 main::@3
//SEG16 [7] (byte*) main::buf1#0 ← (byte*) malloc::return#2
//SEG17 [8] call malloc
//SEG18 [26] phi from main::@3 to malloc [phi:main::@3->malloc]
//SEG19 [26] phi (byte*) heap_head#7 = (byte*) heap_head#1 [phi:main::@3->malloc#0] -- register_copy
//SEG14 main::@3
//SEG15 [6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0 -- pvoz1=pvoz2
lda malloc.mem
sta buf1
lda malloc.mem+1
sta buf1+1
//SEG16 [7] call malloc
//SEG17 [24] phi from main::@3 to malloc [phi:main::@3->malloc]
//SEG18 [24] phi (byte*) heap_head#7 = (byte*) heap_head#1 [phi:main::@3->malloc#0] -- register_copy
jsr malloc
//SEG20 [9] (byte*) malloc::return#3 ← (byte*) malloc::return#0
//SEG21 main::@4
//SEG22 [10] (byte*) main::buf2#0 ← (byte*) malloc::return#3
//SEG23 [11] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
//SEG24 [11] phi (byte) main::i#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuyy=vbuc1
//SEG19 main::@4
//SEG20 [8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0
//SEG21 [9] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
//SEG22 [9] phi (byte) main::i#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuyy=vbuc1
ldy #0
//SEG25 [11] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG26 [11] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG27 main::@1
//SEG23 [9] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG24 [9] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG25 main::@1
b1:
//SEG28 [12] *((byte*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuz1_derefidx_vbuyy=vbuyy
//SEG26 [10] *((byte*)(void*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuz1_derefidx_vbuyy=vbuyy
tya
sta (buf1),y
//SEG29 [13] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 -- vbuaa=vbuc1_minus_vbuyy
//SEG27 [11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 -- vbuaa=vbuc1_minus_vbuyy
tya
eor #$ff
clc
adc #$ff+1
//SEG30 [14] *((byte*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4 -- pbuz1_derefidx_vbuyy=vbuaa
//SEG28 [12] *((byte*)(void*) main::buf2#0 + (byte) main::i#2) ← (byte~) main::$4 -- pbuz1_derefidx_vbuyy=vbuaa
sta (buf2),y
//SEG31 [15] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy
//SEG29 [13] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy
iny
//SEG32 [16] if((byte) main::i#1!=(byte) $64) goto main::@1 -- vbuyy_neq_vbuc1_then_la1
//SEG30 [14] if((byte) main::i#1!=(byte) $64) goto main::@1 -- vbuyy_neq_vbuc1_then_la1
cpy #$64
bne b1
//SEG33 [17] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG34 main::@2
//SEG35 [18] call free
//SEG36 [24] phi from main::@2 to free [phi:main::@2->free]
//SEG31 [15] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG32 main::@2
//SEG33 [16] call free
//SEG34 [22] phi from main::@2 to free [phi:main::@2->free]
jsr free
//SEG37 [19] phi from main::@2 to main::@5 [phi:main::@2->main::@5]
//SEG38 main::@5
//SEG39 [20] call free
//SEG40 [24] phi from main::@5 to free [phi:main::@5->free]
//SEG35 [17] phi from main::@2 to main::@5 [phi:main::@2->main::@5]
//SEG36 main::@5
//SEG37 [18] call free
//SEG38 [22] phi from main::@5 to free [phi:main::@5->free]
jsr free
//SEG41 main::@6
//SEG42 [21] *((const byte*) main::screen#0) ← *((byte*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1
//SEG39 main::@6
//SEG40 [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1
ldy #0
lda (buf1),y
sta screen
//SEG43 [22] *((const byte*) main::screen#0+(byte) 1) ← *((byte*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1
//SEG41 [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1
lda (buf2),y
sta screen+1
//SEG44 main::@return
//SEG45 [23] return
//SEG42 main::@return
//SEG43 [21] return
rts
}
//SEG46 free
//SEG44 free
// A block of memory previously allocated by a call to malloc is deallocated, making it available again for further allocations.
// If ptr is a null pointer, the function does nothing.
free: {
//SEG47 free::@return
//SEG48 [25] return
//SEG45 free::@return
//SEG46 [23] return
rts
}
//SEG49 malloc
//SEG47 malloc
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = 6
.label return_2 = 4
//SEG50 [27] (byte*) malloc::return#0 ← (byte*) heap_head#7 -- pbuz1=pbuz2
.label mem = 6
//SEG48 [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 -- pbuz1=pbuz2
lda heap_head
sta return
sta mem
lda heap_head+1
sta return+1
//SEG51 [28] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 -- pbuz1=pbuz1_plus_vbuc1
sta mem+1
//SEG49 [26] (byte*) heap_head#1 ← (byte*) heap_head#7 + (byte) $64 -- pbuz1=pbuz1_plus_vbuc1
lda #$64
clc
adc heap_head
@ -1009,9 +986,9 @@ malloc: {
bcc !+
inc heap_head+1
!:
//SEG52 malloc::@return
//SEG53 [29] return
//SEG50 malloc::@return
//SEG51 [27] return
rts
}
//SEG54 File Data
//SEG52 File Data

View File

@ -3,11 +3,11 @@
(label) @end
(byte*) HEAP_START
(const byte*) HEAP_START#0 HEAP_START = (byte*) 49152
(void()) free((byte*) free::ptr)
(void()) free((void*) free::ptr)
(label) free::@return
(byte*) free::ptr
(void*) free::ptr
(byte*) heap_head
(byte*) heap_head#1 heap_head zp ZP_WORD:2 0.8
(byte*) heap_head#1 heap_head zp ZP_WORD:2 1.0
(byte*) heap_head#7 heap_head zp ZP_WORD:2 3.0
(void()) main()
(byte~) main::$4 reg byte a 22.0
@ -19,25 +19,23 @@
(label) main::@6
(label) main::@return
(byte*) main::buf1
(byte*) main::buf1#0 buf1 zp ZP_WORD:4 1.0714285714285714
(void*) main::buf1#0 buf1 zp ZP_WORD:4 0.15384615384615385
(byte*) main::buf2
(byte*) main::buf2#0 buf2 zp ZP_WORD:6 1.25
(void*) main::buf2#0 buf2 zp ZP_WORD:6 0.16666666666666666
(byte) main::i
(byte) main::i#1 reg byte y 16.5
(byte) main::i#2 reg byte y 16.5
(byte*) main::screen
(const byte*) main::screen#0 screen = (byte*) 1024
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(byte*) malloc::return#0 return zp ZP_WORD:6 1.2000000000000002
(byte*) malloc::return#2 return#2 zp ZP_WORD:4 4.0
(byte*) malloc::return#3 return zp ZP_WORD:6 4.0
(byte*) malloc::mem#0 mem zp ZP_WORD:6 0.4
(void*) malloc::return
(word) malloc::size
reg byte y [ main::i#2 main::i#1 ]
zp ZP_WORD:2 [ heap_head#7 heap_head#1 ]
zp ZP_WORD:4 [ malloc::return#2 main::buf1#0 ]
zp ZP_WORD:6 [ malloc::return#3 main::buf2#0 malloc::return#0 ]
zp ZP_WORD:4 [ main::buf1#0 ]
zp ZP_WORD:6 [ main::buf2#0 malloc::mem#0 ]
reg byte a [ main::$4 ]

View File

@ -20,8 +20,8 @@ main::@1: scope:[main] from main main::@1
[11] (byte~) main::$7 ← (byte) main::i#2 << (byte) 3
[12] *((const byte*) main::SCREEN#0+(byte)(number) 3*(number) $28 + (byte) main::i#2) ← (byte~) main::$7
[13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2
[14] (signed byte~) main::$11 ← (signed byte) main::sb#0 << (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$11
[14] (signed byte~) main::$12 ← (signed byte) main::sb#0 << (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$12
[16] (byte) main::i#1 ← ++ (byte) main::i#2
[17] if((byte) main::i#1!=(byte) $b) goto main::@1
to:main::@return

View File

@ -143,13 +143,14 @@ Constant (const byte*) main::$6 = main::SCREEN#0+(byte)3*$28
Constant (const byte*) main::$10 = main::SCREEN#0+(byte)5*$28
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [9] (signed byte~) main::$8 ← (signed byte)(byte) main::i#2 keeping main::i#2
Inlining Noop Cast [12] (byte~) main::$12 ← (byte)(signed byte~) main::$11 keeping main::$11
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [12] (byte~) main::$12 ← (byte)(signed byte~) main::$11 keeping main::$12
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to remove identity multiply/divide [1] (byte~) main::$1 ← (byte) main::i#2 * (byte) 1
Rewriting multiplication to use shift [3] (byte~) main::$3 ← (byte) main::i#2 * (byte) 2
Rewriting multiplication to use shift [5] (byte~) main::$5 ← (byte) main::i#2 * (byte) 4
Rewriting multiplication to use shift [7] (byte~) main::$7 ← (byte) main::i#2 * (byte) 8
Rewriting multiplication to use shift [11] (signed byte~) main::$11 ← (signed byte) main::sb#0 * (signed byte) 2
Rewriting multiplication to use shift [11] (signed byte~) main::$12 ← (signed byte) main::sb#0 * (signed byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte) 0
@ -203,8 +204,8 @@ main::@1: scope:[main] from main main::@1
[11] (byte~) main::$7 ← (byte) main::i#2 << (byte) 3
[12] *((const byte*) main::SCREEN#0+(byte)(number) 3*(number) $28 + (byte) main::i#2) ← (byte~) main::$7
[13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2
[14] (signed byte~) main::$11 ← (signed byte) main::sb#0 << (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$11
[14] (signed byte~) main::$12 ← (signed byte) main::sb#0 << (byte) 1
[15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$12
[16] (byte) main::i#1 ← ++ (byte) main::i#2
[17] if((byte) main::i#1!=(byte) $b) goto main::@1
to:main::@return
@ -215,7 +216,7 @@ main::@return: scope:[main] from main::@1
VARIABLE REGISTER WEIGHTS
(void()) main()
(signed byte~) main::$11 11.0
(signed byte~) main::$12 11.0
(byte~) main::$3 22.0
(byte~) main::$5 22.0
(byte~) main::$7 22.0
@ -232,20 +233,20 @@ Added variable main::$3 to zero page equivalence class [ main::$3 ]
Added variable main::$5 to zero page equivalence class [ main::$5 ]
Added variable main::$7 to zero page equivalence class [ main::$7 ]
Added variable main::sb#0 to zero page equivalence class [ main::sb#0 ]
Added variable main::$11 to zero page equivalence class [ main::$11 ]
Added variable main::$12 to zero page equivalence class [ main::$12 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::$3 ]
[ main::$5 ]
[ main::$7 ]
[ main::sb#0 ]
[ main::$11 ]
[ main::$12 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::$3 ]
Allocated zp ZP_BYTE:4 [ main::$5 ]
Allocated zp ZP_BYTE:5 [ main::$7 ]
Allocated zp ZP_BYTE:6 [ main::sb#0 ]
Allocated zp ZP_BYTE:7 [ main::$11 ]
Allocated zp ZP_BYTE:7 [ main::$12 ]
INITIAL ASM
//SEG0 File Comments
@ -277,7 +278,7 @@ main: {
.label _3 = 3
.label _5 = 4
.label _7 = 5
.label _11 = 7
.label _12 = 7
.label sb = 6
.label i = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
@ -329,12 +330,12 @@ main: {
clc
adc #1
sta sb
//SEG24 [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 << (byte) 1 -- vbsz1=vbsz2_rol_1
//SEG24 [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 << (byte) 1 -- vbsz1=vbsz2_rol_1
lda sb
asl
sta _11
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$11 -- pbuc1_derefidx_vbuz1=vbuz2
lda _11
sta _12
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$12 -- pbuc1_derefidx_vbuz1=vbuz2
lda _12
ldy i
sta SCREEN+5*$28,y
//SEG26 [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
@ -357,31 +358,31 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ ma
Statement [9] (byte~) main::$5 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::$5 ] ( main:2 [ main::i#2 main::$5 ] ) always clobbers reg byte a
Statement [11] (byte~) main::$7 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a
Statement [13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2 [ main::i#2 main::sb#0 ] ( main:2 [ main::i#2 main::sb#0 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 << (byte) 1 [ main::i#2 main::$11 ] ( main:2 [ main::i#2 main::$11 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 << (byte) 1 [ main::i#2 main::$12 ] ( main:2 [ main::i#2 main::$12 ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$3 ] ( main:2 [ main::i#2 main::$3 ] ) always clobbers reg byte a
Statement [9] (byte~) main::$5 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::$5 ] ( main:2 [ main::i#2 main::$5 ] ) always clobbers reg byte a
Statement [11] (byte~) main::$7 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a
Statement [13] (signed byte) main::sb#0 ← - (signed byte)(byte) main::i#2 [ main::i#2 main::sb#0 ] ( main:2 [ main::i#2 main::sb#0 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 << (byte) 1 [ main::i#2 main::$11 ] ( main:2 [ main::i#2 main::$11 ] ) always clobbers reg byte a
Statement [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 << (byte) 1 [ main::i#2 main::$12 ] ( main:2 [ main::i#2 main::$12 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::$3 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 [ main::$5 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:5 [ main::$7 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 [ main::sb#0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ main::$11 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ main::$12 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:3 [ main::$3 ] 22: zp ZP_BYTE:4 [ main::$5 ] 22: zp ZP_BYTE:5 [ main::$7 ] 22: zp ZP_BYTE:6 [ main::sb#0 ] 11: zp ZP_BYTE:7 [ main::$11 ]
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:3 [ main::$3 ] 22: zp ZP_BYTE:4 [ main::$5 ] 22: zp ZP_BYTE:5 [ main::$7 ] 22: zp ZP_BYTE:6 [ main::sb#0 ] 11: zp ZP_BYTE:7 [ main::$12 ]
Uplift Scope []
Uplifting [main] best 863 combination reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$3 ] reg byte a [ main::$5 ] reg byte a [ main::$7 ] zp ZP_BYTE:6 [ main::sb#0 ] zp ZP_BYTE:7 [ main::$11 ]
Uplifting [main] best 863 combination reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$3 ] reg byte a [ main::$5 ] reg byte a [ main::$7 ] zp ZP_BYTE:6 [ main::sb#0 ] zp ZP_BYTE:7 [ main::$12 ]
Limited combination testing to 100 combinations of 3072 possible.
Uplifting [] best 863 combination
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ main::sb#0 ]
Uplifting [main] best 803 combination reg byte a [ main::sb#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::$11 ]
Uplifting [main] best 743 combination reg byte a [ main::$11 ]
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::$12 ]
Uplifting [main] best 743 combination reg byte a [ main::$12 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
@ -447,9 +448,9 @@ main: {
eor #$ff
clc
adc #1
//SEG24 [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 << (byte) 1 -- vbsaa=vbsaa_rol_1
//SEG24 [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 << (byte) 1 -- vbsaa=vbsaa_rol_1
asl
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$11 -- pbuc1_derefidx_vbuxx=vbuaa
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$12 -- pbuc1_derefidx_vbuxx=vbuaa
sta SCREEN+5*$28,x
//SEG26 [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
@ -494,7 +495,7 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(void()) main()
(signed byte~) main::$11 reg byte a 11.0
(signed byte~) main::$12 reg byte a 11.0
(byte~) main::$3 reg byte a 22.0
(byte~) main::$5 reg byte a 22.0
(byte~) main::$7 reg byte a 22.0
@ -513,7 +514,7 @@ reg byte a [ main::$3 ]
reg byte a [ main::$5 ]
reg byte a [ main::$7 ]
reg byte a [ main::sb#0 ]
reg byte a [ main::$11 ]
reg byte a [ main::$12 ]
FINAL ASSEMBLER
@ -569,9 +570,9 @@ main: {
eor #$ff
clc
adc #1
//SEG24 [14] (signed byte~) main::$11 ← (signed byte) main::sb#0 << (byte) 1 -- vbsaa=vbsaa_rol_1
//SEG24 [14] (signed byte~) main::$12 ← (signed byte) main::sb#0 << (byte) 1 -- vbsaa=vbsaa_rol_1
asl
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$11 -- pbuc1_derefidx_vbuxx=vbuaa
//SEG25 [15] *((const byte*) main::SCREEN#0+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte)(signed byte~) main::$12 -- pbuc1_derefidx_vbuxx=vbuaa
sta SCREEN+5*$28,x
//SEG26 [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx

View File

@ -2,7 +2,7 @@
(label) @begin
(label) @end
(void()) main()
(signed byte~) main::$11 reg byte a 11.0
(signed byte~) main::$12 reg byte a 11.0
(byte~) main::$3 reg byte a 22.0
(byte~) main::$5 reg byte a 22.0
(byte~) main::$7 reg byte a 22.0
@ -21,4 +21,4 @@ reg byte a [ main::$3 ]
reg byte a [ main::$5 ]
reg byte a [ main::$7 ]
reg byte a [ main::sb#0 ]
reg byte a [ main::$11 ]
reg byte a [ main::$12 ]

View File

@ -9,7 +9,7 @@
.label CHARSET = $2000
.label SCREEN = $2800
.const NUM_SQUARES = $30
.label SQUARES = HEAP_START
.label SQUARES = malloc.return
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.label yds = $16
@ -256,6 +256,7 @@ init_squares: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
rts
}
// Make charset from proto chars

View File

@ -153,9 +153,9 @@ init_squares::@1: scope:[init_squares] from init_squares init_squares::@1
[74] (word) init_squares::sqr#2 ← phi( init_squares::@1/(word) init_squares::sqr#1 init_squares/(byte) 0 )
[75] *((word*) init_squares::squares#2) ← (word) init_squares::sqr#2
[76] (word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD
[77] (byte~) init_squares::$4 ← (byte) init_squares::i#2 << (byte) 1
[78] (byte~) init_squares::$5 ← (byte~) init_squares::$4 + (byte) 1
[79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$5
[77] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1
[78] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1
[79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4
[80] (byte) init_squares::i#1 ← ++ (byte) init_squares::i#2
[81] if((byte) init_squares::i#1!=(const byte) NUM_SQUARES#1-(byte) 1+(byte) 1) goto init_squares::@1
to:init_squares::@return

View File

@ -1,6 +1,8 @@
Resolved forward reference FONT_HEX_PROTO to (byte[]) FONT_HEX_PROTO
Resolved forward reference FONT_HEX_PROTO to (byte[]) FONT_HEX_PROTO
Adding pointer type conversion cast (byte*) HEAP_START in (byte*) HEAP_START ← (number) $c000
Adding void pointer type conversion cast (void*) malloc::mem in (void*) malloc::return ← (byte*) malloc::mem
Adding pointer type conversion cast to void pointer (word*) init_squares::$1 in (word*) SQUARES ← (void*~) init_squares::$1
Adding pointer type conversion cast (byte*) PROCPORT_DDR in (byte*) PROCPORT_DDR ← (number) 0
Adding pointer type conversion cast (byte*) PROCPORT in (byte*) PROCPORT ← (number) 1
Adding pointer type conversion cast (byte*) CHARGEN in (byte*) CHARGEN ← (number) $d000
@ -93,12 +95,12 @@ malloc: scope:[malloc] from init_squares
(byte*) heap_head#8 ← phi( init_squares/(byte*) heap_head#15 )
(byte*) malloc::mem#0 ← (byte*) heap_head#8
(byte*) heap_head#1 ← (byte*) heap_head#8 + (word) malloc::size#1
(byte*) malloc::return#0 ← (byte*) malloc::mem#0
(void*) malloc::return#0 ← ((void*)) (byte*) malloc::mem#0
to:malloc::@return
malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#9 ← phi( malloc/(byte*) heap_head#1 )
(byte*) malloc::return#3 ← phi( malloc/(byte*) malloc::return#0 )
(byte*) malloc::return#1 ← (byte*) malloc::return#3
(void*) malloc::return#3 ← phi( malloc/(void*) malloc::return#0 )
(void*) malloc::return#1 ← (void*) malloc::return#3
(byte*) heap_head#2 ← (byte*) heap_head#9
return
to:@return
@ -195,19 +197,18 @@ init_squares: scope:[init_squares] from main::@15
(byte~) init_squares::$0 ← (byte) NUM_SQUARES#4 * (const byte) SIZEOF_WORD
(word) malloc::size#0 ← (byte~) init_squares::$0
call malloc
(byte*) malloc::return#2 ← (byte*) malloc::return#1
(void*) malloc::return#2 ← (void*) malloc::return#1
to:init_squares::@3
init_squares::@3: scope:[init_squares] from init_squares
(byte) NUM_SQUARES#5 ← phi( init_squares/(byte) NUM_SQUARES#4 )
(byte*) heap_head#10 ← phi( init_squares/(byte*) heap_head#2 )
(byte*) malloc::return#4 ← phi( init_squares/(byte*) malloc::return#2 )
(byte*~) init_squares::$1 ← (byte*) malloc::return#4
(void*) malloc::return#4 ← phi( init_squares/(void*) malloc::return#2 )
(void*~) init_squares::$1 ← (void*) malloc::return#4
(byte*) heap_head#3 ← (byte*) heap_head#10
(word*~) init_squares::$2 ← ((word*)) (byte*~) init_squares::$1
(word*) SQUARES#1 ← (word*~) init_squares::$2
(word*) SQUARES#1 ← ((word*)) (void*~) init_squares::$1
(word*) init_squares::squares#0 ← (word*) SQUARES#1
(word) init_squares::sqr#0 ← (number) 0
(number~) init_squares::$3 ← (byte) NUM_SQUARES#5 - (number) 1
(number~) init_squares::$2 ← (byte) NUM_SQUARES#5 - (number) 1
(byte) init_squares::i#0 ← (byte) 0
to:init_squares::@1
init_squares::@1: scope:[init_squares] from init_squares::@1 init_squares::@3
@ -218,12 +219,12 @@ init_squares::@1: scope:[init_squares] from init_squares::@1 init_squares::@3
(word) init_squares::sqr#2 ← phi( init_squares::@1/(word) init_squares::sqr#1 init_squares::@3/(word) init_squares::sqr#0 )
*((word*) init_squares::squares#2) ← (word) init_squares::sqr#2
(word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD
(number~) init_squares::$4 ← (byte) init_squares::i#2 * (number) 2
(number~) init_squares::$5 ← (number~) init_squares::$4 + (number) 1
(word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (number~) init_squares::$5
(byte) init_squares::i#1 ← (byte) init_squares::i#2 + rangenext(0,init_squares::$3)
(bool~) init_squares::$6 ← (byte) init_squares::i#1 != rangelast(0,init_squares::$3)
if((bool~) init_squares::$6) goto init_squares::@1
(number~) init_squares::$3 ← (byte) init_squares::i#2 * (number) 2
(number~) init_squares::$4 ← (number~) init_squares::$3 + (number) 1
(word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (number~) init_squares::$4
(byte) init_squares::i#1 ← (byte) init_squares::i#2 + rangenext(0,init_squares::$2)
(bool~) init_squares::$5 ← (byte) init_squares::i#1 != rangelast(0,init_squares::$2)
if((bool~) init_squares::$5) goto init_squares::@1
to:init_squares::@return
init_squares::@return: scope:[init_squares] from init_squares::@1
(word*) SQUARES#6 ← phi( init_squares::@1/(word*) SQUARES#13 )
@ -837,12 +838,11 @@ SYMBOL TABLE SSA
(byte*) init_font_hex::proto_lo#4
(void()) init_squares()
(byte~) init_squares::$0
(byte*~) init_squares::$1
(word*~) init_squares::$2
(void*~) init_squares::$1
(number~) init_squares::$2
(number~) init_squares::$3
(number~) init_squares::$4
(number~) init_squares::$5
(bool~) init_squares::$6
(bool~) init_squares::$5
(label) init_squares::@1
(label) init_squares::@3
(label) init_squares::@return
@ -992,16 +992,16 @@ SYMBOL TABLE SSA
(word) main::yds#4
(word) main::yds#5
(word) main::yds#6
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::mem#0
(byte*) malloc::return
(byte*) malloc::return#0
(byte*) malloc::return#1
(byte*) malloc::return#2
(byte*) malloc::return#3
(byte*) malloc::return#4
(void*) malloc::return
(void*) malloc::return#0
(void*) malloc::return#1
(void*) malloc::return#2
(void*) malloc::return#3
(void*) malloc::return#4
(word) malloc::size
(word) malloc::size#0
(word) malloc::size#1
@ -1052,12 +1052,12 @@ Adding number conversion cast (unumber) 1 in (number~) bsearch16u::$18 ← (numb
Adding number conversion cast (unumber) bsearch16u::$18 in (number~) bsearch16u::$18 ← (unumber)(number) 1 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) $ff in (byte) NUM_SQUARES#0 ← (number) $ff
Adding number conversion cast (unumber) 0 in (word) init_squares::sqr#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (number~) init_squares::$3 ← (byte) NUM_SQUARES#5 - (number) 1
Adding number conversion cast (unumber) init_squares::$3 in (number~) init_squares::$3 ← (byte) NUM_SQUARES#5 - (unumber)(number) 1
Adding number conversion cast (unumber) 2 in (number~) init_squares::$4 ← (byte) init_squares::i#2 * (number) 2
Adding number conversion cast (unumber) init_squares::$4 in (number~) init_squares::$4 ← (byte) init_squares::i#2 * (unumber)(number) 2
Adding number conversion cast (unumber) 1 in (number~) init_squares::$5 ← (unumber~) init_squares::$4 + (number) 1
Adding number conversion cast (unumber) init_squares::$5 in (number~) init_squares::$5 ← (unumber~) init_squares::$4 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (number~) init_squares::$2 ← (byte) NUM_SQUARES#5 - (number) 1
Adding number conversion cast (unumber) init_squares::$2 in (number~) init_squares::$2 ← (byte) NUM_SQUARES#5 - (unumber)(number) 1
Adding number conversion cast (unumber) 2 in (number~) init_squares::$3 ← (byte) init_squares::i#2 * (number) 2
Adding number conversion cast (unumber) init_squares::$3 in (number~) init_squares::$3 ← (byte) init_squares::i#2 * (unumber)(number) 2
Adding number conversion cast (unumber) 1 in (number~) init_squares::$4 ← (unumber~) init_squares::$3 + (number) 1
Adding number conversion cast (unumber) init_squares::$4 in (number~) init_squares::$4 ← (unumber~) init_squares::$3 + (unumber)(number) 1
Adding number conversion cast (unumber) 0 in (byte) init_font_hex::idx#0 ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#0) ← (number) 0
Adding number conversion cast (unumber) 4 in (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#2 + (byte) init_font_hex::i#2) << (number) 4
@ -1114,10 +1114,11 @@ Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (byte) to elements in (byte[]) FONT_HEX_PROTO#0 ← { (byte)(number) 2, (byte)(number) 5, (byte)(number) 5, (byte)(number) 5, (byte)(number) 2, (byte)(number) 6, (byte)(number) 2, (byte)(number) 2, (byte)(number) 2, (byte)(number) 7, (byte)(number) 6, (byte)(number) 1, (byte)(number) 2, (byte)(number) 4, (byte)(number) 7, (byte)(number) 6, (byte)(number) 1, (byte)(number) 2, (byte)(number) 1, (byte)(number) 6, (byte)(number) 5, (byte)(number) 5, (byte)(number) 7, (byte)(number) 1, (byte)(number) 1, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 1, (byte)(number) 6, (byte)(number) 3, (byte)(number) 4, (byte)(number) 6, (byte)(number) 5, (byte)(number) 2, (byte)(number) 7, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 2, (byte)(number) 5, (byte)(number) 2, (byte)(number) 5, (byte)(number) 2, (byte)(number) 2, (byte)(number) 5, (byte)(number) 3, (byte)(number) 1, (byte)(number) 1, (byte)(number) 2, (byte)(number) 5, (byte)(number) 7, (byte)(number) 5, (byte)(number) 5, (byte)(number) 6, (byte)(number) 5, (byte)(number) 6, (byte)(number) 5, (byte)(number) 6, (byte)(number) 2, (byte)(number) 5, (byte)(number) 4, (byte)(number) 5, (byte)(number) 2, (byte)(number) 6, (byte)(number) 5, (byte)(number) 5, (byte)(number) 5, (byte)(number) 6, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 4, (byte)(number) 7, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 4, (byte)(number) 4 }
Successful SSA optimization PassNAddArrayNumberTypeConversions
Inlining cast (byte*) HEAP_START#0 ← (byte*)(number) $c000
Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0
Inlining cast (signed word~) bsearch16u::$8 ← (signed word)(word) bsearch16u::key#1
Inlining cast (signed word~) bsearch16u::$9 ← (signed word)*((word*) bsearch16u::pivot#0)
Inlining cast (byte) NUM_SQUARES#0 ← (unumber)(number) $ff
Inlining cast (word*~) init_squares::$2 ← (word*)(byte*~) init_squares::$1
Inlining cast (word*) SQUARES#1 ← (word*)(void*~) init_squares::$1
Inlining cast (word) init_squares::sqr#0 ← (unumber)(number) 0
Inlining cast (byte~) sqrt::$2 ← (byte)(word~) sqrt::$1
Inlining cast (byte*) D018#0 ← (byte*)(number) $d018
@ -1287,9 +1288,9 @@ Finalized unsigned number type (byte) $27
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) bsearch16u::$17 ← (byte) 1 * (const byte) SIZEOF_WORD
Inferred type updated to byte in (unumber~) bsearch16u::$18 ← (byte) 1 * (const byte) SIZEOF_WORD
Inferred type updated to byte in (unumber~) init_squares::$3 ← (byte) NUM_SQUARES#5 - (byte) 1
Inferred type updated to byte in (unumber~) init_squares::$4 ← (byte) init_squares::i#2 * (byte) 2
Inferred type updated to byte in (unumber~) init_squares::$5 ← (byte~) init_squares::$4 + (byte) 1
Inferred type updated to byte in (unumber~) init_squares::$2 ← (byte) NUM_SQUARES#5 - (byte) 1
Inferred type updated to byte in (unumber~) init_squares::$3 ← (byte) init_squares::i#2 * (byte) 2
Inferred type updated to byte in (unumber~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1
Inferred type updated to word in (unumber~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0181_$2#0 ← (word~) main::toD0181_$1#0 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$3#0 ← > (word~) main::toD0181_$2#0
@ -1312,7 +1313,7 @@ Inversing boolean not [24] (bool~) bsearch16u::$12 ← (signed word) bsearch16u:
Inversing boolean not [31] (bool~) bsearch16u::$14 ← (signed word) bsearch16u::result#1 <= (signed byte) 0 from [30] (bool~) bsearch16u::$13 ← (signed word) bsearch16u::result#1 > (signed byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) HEAP_START#0 = (byte*) heap_head#0 (byte*) heap_head#26 (byte*) heap_head#23 (byte*) heap_head#22 (byte*) heap_head#19
Alias (byte*) malloc::return#0 = (byte*) malloc::mem#0 (byte*) malloc::return#3 (byte*) malloc::return#1
Alias (void*) malloc::return#0 = (void*) malloc::return#3 (void*) malloc::return#1
Alias (byte*) heap_head#1 = (byte*) heap_head#9 (byte*) heap_head#2
Alias (byte) bsearch16u::num#3 = (byte) bsearch16u::num#4 (byte) bsearch16u::num#8 (byte) bsearch16u::num#6
Alias (word*) bsearch16u::items#2 = (word*) bsearch16u::items#6 (word*) bsearch16u::items#3 (word*) bsearch16u::items#9 (word*) bsearch16u::items#4 (word*~) bsearch16u::$3 (word*) bsearch16u::items#5
@ -1324,10 +1325,9 @@ Alias (word*) bsearch16u::items#0 = (word*~) bsearch16u::$15
Alias (word*~) bsearch16u::$2 = (word*~) bsearch16u::$1
Alias (word*) bsearch16u::return#2 = (word*~) bsearch16u::$4
Alias (word) malloc::size#0 = (byte~) init_squares::$0
Alias (byte*) malloc::return#2 = (byte*) malloc::return#4
Alias (void*) malloc::return#2 = (void*) malloc::return#4
Alias (byte) NUM_SQUARES#4 = (byte) NUM_SQUARES#5
Alias (byte*) heap_head#10 = (byte*) heap_head#3
Alias (word*) SQUARES#1 = (word*~) init_squares::$2
Alias (byte*) heap_head#11 = (byte*) heap_head#16 (byte*) heap_head#4
Alias (word*) SQUARES#13 = (word*) SQUARES#6 (word*) SQUARES#2
Alias (word) sqr::return#0 = (word) sqr::return#4 (word) sqr::return#1
@ -1463,18 +1463,18 @@ Simple Condition (bool~) bsearch16u::$5 [13] if((byte) bsearch16u::num#3>(byte)
Simple Condition (bool~) bsearch16u::$12 [25] if((signed word) bsearch16u::result#0!=(signed byte) 0) goto bsearch16u::@9
Simple Condition (bool~) bsearch16u::$0 [28] if(*((word*) bsearch16u::items#2)<=(word) bsearch16u::key#0) goto bsearch16u::@1
Simple Condition (bool~) bsearch16u::$14 [32] if((signed word) bsearch16u::result#0<=(signed byte) 0) goto bsearch16u::@10
Simple Condition (bool~) init_squares::$6 [78] if((byte) init_squares::i#1!=rangelast(0,init_squares::$3)) goto init_squares::@1
Simple Condition (bool~) init_font_hex::$3 [127] if((byte) init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3
Simple Condition (bool~) init_font_hex::$4 [137] if((byte) init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2
Simple Condition (bool~) init_font_hex::$5 [142] if((byte) init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1
Simple Condition (bool~) main::$4 [181] if((byte) main::y2#0>=(byte) $18) goto main::@2
Simple Condition (bool~) main::$12 [201] if((byte) main::x2#0>=(byte) $27) goto main::@6
Simple Condition (bool~) main::$21 [228] if((byte) main::x#1!=rangelast(0,$27)) goto main::@5
Simple Condition (bool~) main::$22 [232] if((byte) main::y#1!=rangelast(0,$18)) goto main::@1
Simple Condition (bool~) init_squares::$5 [77] if((byte) init_squares::i#1!=rangelast(0,init_squares::$2)) goto init_squares::@1
Simple Condition (bool~) init_font_hex::$3 [126] if((byte) init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3
Simple Condition (bool~) init_font_hex::$4 [136] if((byte) init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2
Simple Condition (bool~) init_font_hex::$5 [141] if((byte) init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1
Simple Condition (bool~) main::$4 [180] if((byte) main::y2#0>=(byte) $18) goto main::@2
Simple Condition (bool~) main::$12 [200] if((byte) main::x2#0>=(byte) $27) goto main::@6
Simple Condition (bool~) main::$21 [227] if((byte) main::x#1!=rangelast(0,$27)) goto main::@5
Simple Condition (bool~) main::$22 [231] if((byte) main::y#1!=rangelast(0,$18)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [41] (byte~) bsearch16u::$17 ← (byte) 1 * (const byte) SIZEOF_WORD
Constant right-side identified [48] (byte~) bsearch16u::$18 ← (byte) 1 * (const byte) SIZEOF_WORD
Constant right-side identified [145] (byte[]) FONT_HEX_PROTO#0 ← { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 }
Constant right-side identified [144] (byte[]) FONT_HEX_PROTO#0 ← { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) HEAP_START#0 = (byte*) 49152
Constant (const byte) bsearch16u::$17 = 1*SIZEOF_WORD
@ -1495,7 +1495,7 @@ Constant (const byte) NUM_SQUARES#1 = $30
Constant (const byte) main::y#0 = 0
Constant (const byte) main::x#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) malloc::return#0 = HEAP_START#0
Constant (const byte*) malloc::mem#0 = HEAP_START#0
Constant (const byte*) init_font_hex::proto_hi#0 = FONT_HEX_PROTO#0
Constant (const byte*) init_font_hex::proto_lo#0 = FONT_HEX_PROTO#0
Constant (const byte*) init_font_hex::charset#1 = CHARSET#0
@ -1503,34 +1503,30 @@ Constant (const byte*) main::toD0181_screen#0 = SCREEN#0
Constant (const byte*) main::toD0181_gfx#0 = CHARSET#0
Constant (const byte*) main::screen#0 = SCREEN#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) malloc::return#2 = malloc::return#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) init_squares::$1 = malloc::return#2
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word*)init_squares::$1 in [64] (word*) SQUARES#1 ← (word*)(const byte*) init_squares::$1
Constant value identified (word)main::toD0181_screen#0 in [155] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [159] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (void*)malloc::mem#0 in [5] (void*) malloc::return#0 ← (void*)(const byte*) malloc::mem#0
Constant value identified (word)main::toD0181_screen#0 in [154] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [158] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [125] init_font_hex::i#1 ← ++ init_font_hex::i#2 to ++
Resolved ranged comparison value [127] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 to (number) 5
Resolved ranged next value [135] init_font_hex::c1#1 ← ++ init_font_hex::c1#4 to ++
Resolved ranged comparison value [137] if(init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2 to (number) $10
Resolved ranged next value [140] init_font_hex::c#1 ← ++ init_font_hex::c#5 to ++
Resolved ranged comparison value [142] if(init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1 to (number) $10
Resolved ranged next value [226] main::x#1 ← ++ main::x#2 to ++
Resolved ranged comparison value [228] if(main::x#1!=rangelast(0,$27)) goto main::@5 to (number) $28
Resolved ranged next value [230] main::y#1 ← ++ main::y#10 to ++
Resolved ranged comparison value [232] if(main::y#1!=rangelast(0,$18)) goto main::@1 to (number) $19
Simplifying expression containing zero init_font_hex::charset#2 in [116] *((byte*) init_font_hex::charset#2 + (const byte) init_font_hex::idx#0) ← (byte) 0
Resolved ranged next value [124] init_font_hex::i#1 ← ++ init_font_hex::i#2 to ++
Resolved ranged comparison value [126] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 to (number) 5
Resolved ranged next value [134] init_font_hex::c1#1 ← ++ init_font_hex::c1#4 to ++
Resolved ranged comparison value [136] if(init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2 to (number) $10
Resolved ranged next value [139] init_font_hex::c#1 ← ++ init_font_hex::c#5 to ++
Resolved ranged comparison value [141] if(init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1 to (number) $10
Resolved ranged next value [225] main::x#1 ← ++ main::x#2 to ++
Resolved ranged comparison value [227] if(main::x#1!=rangelast(0,$27)) goto main::@5 to (number) $28
Resolved ranged next value [229] main::y#1 ← ++ main::y#10 to ++
Resolved ranged comparison value [231] if(main::y#1!=rangelast(0,$18)) goto main::@1 to (number) $19
Simplifying expression containing zero init_font_hex::charset#2 in [115] *((byte*) init_font_hex::charset#2 + (const byte) init_font_hex::idx#0) ← (byte) 0
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) init_font_hex::idx#4 and assignment [64] (byte) init_font_hex::idx#4 ← ++ (byte) init_font_hex::idx#3
Eliminating unused variable (byte) init_font_hex::idx#4 and assignment [67] (byte) init_font_hex::idx#4 ← ++ (byte) init_font_hex::idx#3
Eliminating unused variable - keeping the phi block (byte*) heap_head#33
Eliminating unused constant (const byte) NUM_SQUARES#0
Eliminating unused constant (const word*) SQUARES#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused variable (byte*) heap_head#1 and assignment [0] (byte*) heap_head#1 ← (const byte*) HEAP_START#0 + (word) malloc::size#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused variable (word) malloc::size#0 and assignment [20] (word) malloc::size#0 ← (const byte) NUM_SQUARES#1 * (const byte) SIZEOF_WORD
Eliminating unused variable (word) malloc::size#0 and assignment [21] (word) malloc::size#0 ← (const byte) NUM_SQUARES#1 * (const byte) SIZEOF_WORD
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) 5 in if((byte) init_font_hex::i#1!=(number) 5) goto init_font_hex::@3
Adding number conversion cast (unumber) $10 in if((byte) init_font_hex::c1#1!=(number) $10) goto init_font_hex::@2
@ -1560,35 +1556,42 @@ Identical Phi Values (byte) init_font_hex::c#5 (byte) init_font_hex::c#6
Identical Phi Values (word*) SQUARES#14 (word*) SQUARES#1
Identical Phi Values (byte) NUM_SQUARES#19 (const byte) NUM_SQUARES#1
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [23] (byte~) init_squares::$3 ← (const byte) NUM_SQUARES#1 - (byte) 1
Constant right-side identified [50] (byte) init_font_hex::idx#1 ← ++ (const byte) init_font_hex::idx#0
Constant right-side identified [26] (byte~) init_squares::$2 ← (const byte) NUM_SQUARES#1 - (byte) 1
Constant right-side identified [53] (byte) init_font_hex::idx#1 ← ++ (const byte) init_font_hex::idx#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word*) SQUARES#1 = (word*)init_squares::$1
Constant (const byte) init_squares::$3 = NUM_SQUARES#1-1
Constant (const void*) malloc::return#0 = (void*)malloc::mem#0
Constant (const byte) init_squares::$2 = NUM_SQUARES#1-1
Constant (const byte) bsearch16u::num#2 = NUM_SQUARES#1
Constant (const byte) init_font_hex::idx#1 = ++init_font_hex::idx#0
Constant (const word) main::toD0181_$0#0 = (word)main::toD0181_screen#0
Constant (const word) main::toD0181_$4#0 = (word)main::toD0181_gfx#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const word*) init_squares::squares#0 = SQUARES#1
Constant (const word*) bsearch16u::items#1 = SQUARES#1
Constant (const void*) malloc::return#2 = malloc::return#0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [30] init_squares::i#1 ← ++ init_squares::i#2 to ++
Resolved ranged comparison value [31] if(init_squares::i#1!=rangelast(0,init_squares::$3)) goto init_squares::@1 to (const byte) init_squares::$3+(number) 1
Adding number conversion cast (unumber) init_squares::$3+1 in if((byte) init_squares::i#1!=(const byte) init_squares::$3+(number) 1) goto init_squares::@1
Adding number conversion cast (unumber) 1 in if((byte) init_squares::i#1!=(unumber)(const byte) init_squares::$3+(number) 1) goto init_squares::@1
Constant (const void*) init_squares::$1 = malloc::return#2
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word*)init_squares::$1 in [24] (word*) SQUARES#1 ← (word*)(const void*) init_squares::$1
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [33] init_squares::i#1 ← ++ init_squares::i#2 to ++
Resolved ranged comparison value [34] if(init_squares::i#1!=rangelast(0,init_squares::$2)) goto init_squares::@1 to (const byte) init_squares::$2+(number) 1
Adding number conversion cast (unumber) init_squares::$2+1 in if((byte) init_squares::i#1!=(const byte) init_squares::$2+(number) 1) goto init_squares::@1
Adding number conversion cast (unumber) 1 in if((byte) init_squares::i#1!=(unumber)(const byte) init_squares::$2+(number) 1) goto init_squares::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte) init_squares::$3+(unumber)(number) 1
Simplifying constant integer cast (const byte) init_squares::$2+(unumber)(number) 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [65] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [68] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Constant right-side identified [68] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [71] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word*) SQUARES#1 = (word*)init_squares::$1
Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff
Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const word*) init_squares::squares#0 = SQUARES#1
Constant (const word*) bsearch16u::items#1 = SQUARES#1
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [65] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [67] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
@ -1609,12 +1612,13 @@ Inlining Noop Cast [6] (signed word~) bsearch16u::$8 ← (signed word)(word) bse
Inlining Noop Cast [7] (signed word~) bsearch16u::$9 ← (signed word)*((word*) bsearch16u::pivot#0) keeping *(bsearch16u::pivot#0)
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [4] (byte~) bsearch16u::$16 ← (byte~) bsearch16u::$6 * (const byte) SIZEOF_WORD
Rewriting multiplication to use shift [24] (byte~) init_squares::$4 ← (byte) init_squares::i#2 * (byte) 2
Rewriting multiplication to use shift [24] (byte~) init_squares::$3 ← (byte) init_squares::i#2 * (byte) 2
Rewriting multiplication to use shift [31] (byte~) sqr::$0 ← (byte) sqr::val#2 * (const byte) SIZEOF_WORD
Rewriting division to use shift [39] (word~) sqrt::$1 ← (word~) sqrt::$3 / (const byte) SIZEOF_WORD
Rewriting multiplication to use shift [68] (byte) main::y2#0 ← (byte) main::y#10 * (byte) 2
Rewriting multiplication to use shift [78] (byte) main::x2#0 ← (byte) main::x#2 * (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with different constant siblings (const void*) malloc::return#2
Inlining constant with var siblings (const byte) bsearch16u::num#2
Inlining constant with var siblings (const word*) bsearch16u::items#1
Inlining constant with var siblings (const word) init_squares::sqr#0
@ -1639,8 +1643,7 @@ Constant inlined init_squares::squares#0 = (const word*) SQUARES#1
Constant inlined init_font_hex::proto_hi#0 = (const byte[]) FONT_HEX_PROTO#0
Constant inlined init_font_hex::charset#1 = (const byte*) CHARSET#0
Constant inlined init_font_hex::c1#0 = (byte) 0
Constant inlined malloc::return#2 = (const byte*) HEAP_START#0
Constant inlined malloc::return#0 = (const byte*) HEAP_START#0
Constant inlined malloc::return#2 = (const void*) malloc::return#0
Constant inlined bsearch16u::num#2 = (const byte) NUM_SQUARES#1
Constant inlined main::toD0181_$0#0 = (word)(const byte*) SCREEN#0
Constant inlined main::x#0 = (byte) 0
@ -1659,9 +1662,10 @@ Constant inlined main::toD0181_$3#0 = >(word)(const byte*) SCREEN#0&(word) $3fff
Constant inlined main::toD0181_$4#0 = (word)(const byte*) CHARSET#0
Constant inlined main::toD0181_$5#0 = >(word)(const byte*) CHARSET#0
Constant inlined init_font_hex::proto_lo#0 = (const byte[]) FONT_HEX_PROTO#0
Constant inlined init_squares::$3 = (const byte) NUM_SQUARES#1-(byte) 1
Constant inlined malloc::mem#0 = (const byte*) HEAP_START#0
Constant inlined init_font_hex::c#0 = (byte) 0
Constant inlined init_squares::$1 = (const byte*) HEAP_START#0
Constant inlined init_squares::$1 = (const void*) malloc::return#0
Constant inlined init_squares::$2 = (const byte) NUM_SQUARES#1-(byte) 1
Constant inlined bsearch16u::items#1 = (const word*) SQUARES#1
Successful SSA optimization Pass2ConstantInlining
Simplifying constant integer increment ++0
@ -1929,9 +1933,9 @@ init_squares::@1: scope:[init_squares] from init_squares init_squares::@1
[74] (word) init_squares::sqr#2 ← phi( init_squares::@1/(word) init_squares::sqr#1 init_squares/(byte) 0 )
[75] *((word*) init_squares::squares#2) ← (word) init_squares::sqr#2
[76] (word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD
[77] (byte~) init_squares::$4 ← (byte) init_squares::i#2 << (byte) 1
[78] (byte~) init_squares::$5 ← (byte~) init_squares::$4 + (byte) 1
[79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$5
[77] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1
[78] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1
[79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4
[80] (byte) init_squares::i#1 ← ++ (byte) init_squares::i#2
[81] if((byte) init_squares::i#1!=(const byte) NUM_SQUARES#1-(byte) 1+(byte) 1) goto init_squares::@1
to:init_squares::@return
@ -2049,8 +2053,8 @@ VARIABLE REGISTER WEIGHTS
(byte*) init_font_hex::proto_lo#1 50.5
(byte*) init_font_hex::proto_lo#4 92.53846153846155
(void()) init_squares()
(byte~) init_squares::$3 22.0
(byte~) init_squares::$4 22.0
(byte~) init_squares::$5 22.0
(byte) init_squares::i
(byte) init_squares::i#1 16.5
(byte) init_squares::i#2 5.5
@ -2103,9 +2107,9 @@ VARIABLE REGISTER WEIGHTS
(byte) main::yd#0 33.0
(word) main::yds
(word) main::yds#0 5.6
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(word) malloc::size
(word()) sqr((byte) sqr::val)
(byte~) sqr::$0 4.0
@ -2170,8 +2174,8 @@ Added variable bsearch16u::pivot#0 to zero page equivalence class [ bsearch16u::
Added variable bsearch16u::result#0 to zero page equivalence class [ bsearch16u::result#0 ]
Added variable sqr::$0 to zero page equivalence class [ sqr::$0 ]
Added variable sqr::return#0 to zero page equivalence class [ sqr::return#0 ]
Added variable init_squares::$3 to zero page equivalence class [ init_squares::$3 ]
Added variable init_squares::$4 to zero page equivalence class [ init_squares::$4 ]
Added variable init_squares::$5 to zero page equivalence class [ init_squares::$5 ]
Added variable init_font_hex::$0 to zero page equivalence class [ init_font_hex::$0 ]
Added variable init_font_hex::$1 to zero page equivalence class [ init_font_hex::$1 ]
Added variable init_font_hex::$2 to zero page equivalence class [ init_font_hex::$2 ]
@ -2217,8 +2221,8 @@ Complete equivalence classes
[ bsearch16u::result#0 ]
[ sqr::$0 ]
[ sqr::return#0 ]
[ init_squares::$3 ]
[ init_squares::$4 ]
[ init_squares::$5 ]
[ init_font_hex::$0 ]
[ init_font_hex::$1 ]
[ init_font_hex::$2 ]
@ -2263,8 +2267,8 @@ Allocated zp ZP_WORD:57 [ bsearch16u::pivot#0 ]
Allocated zp ZP_WORD:59 [ bsearch16u::result#0 ]
Allocated zp ZP_BYTE:61 [ sqr::$0 ]
Allocated zp ZP_WORD:62 [ sqr::return#0 ]
Allocated zp ZP_BYTE:64 [ init_squares::$4 ]
Allocated zp ZP_BYTE:65 [ init_squares::$5 ]
Allocated zp ZP_BYTE:64 [ init_squares::$3 ]
Allocated zp ZP_BYTE:65 [ init_squares::$4 ]
Allocated zp ZP_BYTE:66 [ init_font_hex::$0 ]
Allocated zp ZP_BYTE:67 [ init_font_hex::$1 ]
Allocated zp ZP_BYTE:68 [ init_font_hex::$2 ]
@ -2285,7 +2289,7 @@ INITIAL ASM
.label CHARSET = $2000
.label SCREEN = $2800
.const NUM_SQUARES = $30
.label SQUARES = HEAP_START
.label SQUARES = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -2770,8 +2774,8 @@ sqr: {
// Initialize squares table
// Uses iterative formula (x+1)^2 = x^2 + 2*x + 1
init_squares: {
.label _4 = $40
.label _5 = $41
.label _3 = $40
.label _4 = $41
.label squares = $f
.label sqr = $d
.label i = $11
@ -2818,16 +2822,16 @@ init_squares: {
bcc !+
inc squares+1
!:
//SEG149 [77] (byte~) init_squares::$4 ← (byte) init_squares::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
//SEG149 [77] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda i
asl
sta _4
//SEG150 [78] (byte~) init_squares::$5 ← (byte~) init_squares::$4 + (byte) 1 -- vbuz1=vbuz2_plus_1
ldy _4
sta _3
//SEG150 [78] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1 -- vbuz1=vbuz2_plus_1
ldy _3
iny
sty _5
//SEG151 [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$5 -- vwuz1=vwuz1_plus_vbuz2
lda _5
sty _4
//SEG151 [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4 -- vwuz1=vwuz1_plus_vbuz2
lda _4
clc
adc sqr
sta sqr
@ -2850,6 +2854,7 @@ init_squares: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
jmp breturn
//SEG157 malloc::@return
breturn:
@ -3069,8 +3074,8 @@ Statement [75] *((word*) init_squares::squares#2) ← (word) init_squares::sqr#2
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:17 [ init_squares::i#2 init_squares::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:17 [ init_squares::i#2 init_squares::i#1 ]
Statement [76] (word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 ] ( main:2::init_squares:8 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 ] ) always clobbers reg byte a
Statement [77] (byte~) init_squares::$4 ← (byte) init_squares::i#2 << (byte) 1 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$4 ] ( main:2::init_squares:8 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$4 ] ) always clobbers reg byte a
Statement [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$5 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ( main:2::init_squares:8 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ) always clobbers reg byte a
Statement [77] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$3 ] ( main:2::init_squares:8 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$3 ] ) always clobbers reg byte a
Statement [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ( main:2::init_squares:8 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ) always clobbers reg byte a
Statement [88] *((byte*) init_font_hex::charset#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:20 [ init_font_hex::c#6 init_font_hex::c#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:20 [ init_font_hex::c#6 init_font_hex::c#1 ]
@ -3118,8 +3123,8 @@ Statement [69] (byte~) sqr::$0 ← (byte) sqr::val#2 << (byte) 1 [ sqr::$0 ] ( m
Statement [70] (word) sqr::return#0 ← *((const word*) SQUARES#1 + (byte~) sqr::$0) [ sqr::return#0 ] ( main:2::sqr:15 [ main::y#10 main::screen#10 sqr::return#0 ] main:2::sqr:24 [ main::y#10 main::yds#0 main::x#2 main::screen#2 sqr::return#0 ] ) always clobbers reg byte a
Statement [75] *((word*) init_squares::squares#2) ← (word) init_squares::sqr#2 [ init_squares::sqr#2 init_squares::squares#2 init_squares::i#2 ] ( main:2::init_squares:8 [ init_squares::sqr#2 init_squares::squares#2 init_squares::i#2 ] ) always clobbers reg byte a reg byte y
Statement [76] (word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 ] ( main:2::init_squares:8 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 ] ) always clobbers reg byte a
Statement [77] (byte~) init_squares::$4 ← (byte) init_squares::i#2 << (byte) 1 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$4 ] ( main:2::init_squares:8 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$4 ] ) always clobbers reg byte a
Statement [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$5 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ( main:2::init_squares:8 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ) always clobbers reg byte a
Statement [77] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$3 ] ( main:2::init_squares:8 [ init_squares::sqr#2 init_squares::i#2 init_squares::squares#1 init_squares::$3 ] ) always clobbers reg byte a
Statement [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ( main:2::init_squares:8 [ init_squares::i#2 init_squares::sqr#1 init_squares::squares#1 ] ) always clobbers reg byte a
Statement [88] *((byte*) init_font_hex::charset#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a reg byte y
Statement [90] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ) always clobbers reg byte a
Statement [91] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ) always clobbers reg byte a
@ -3168,8 +3173,8 @@ Potential registers zp ZP_WORD:57 [ bsearch16u::pivot#0 ] : zp ZP_WORD:57 ,
Potential registers zp ZP_WORD:59 [ bsearch16u::result#0 ] : zp ZP_WORD:59 ,
Potential registers zp ZP_BYTE:61 [ sqr::$0 ] : zp ZP_BYTE:61 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:62 [ sqr::return#0 ] : zp ZP_WORD:62 ,
Potential registers zp ZP_BYTE:64 [ init_squares::$4 ] : zp ZP_BYTE:64 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:65 [ init_squares::$5 ] : zp ZP_BYTE:65 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:64 [ init_squares::$3 ] : zp ZP_BYTE:64 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:65 [ init_squares::$4 ] : zp ZP_BYTE:65 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:66 [ init_font_hex::$0 ] : zp ZP_BYTE:66 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:67 [ init_font_hex::$1 ] : zp ZP_BYTE:67 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:68 [ init_font_hex::$2 ] : zp ZP_BYTE:68 , reg byte a , reg byte x , reg byte y ,
@ -3181,7 +3186,7 @@ Uplift Scope [init_font_hex] 2,168.83: zp ZP_BYTE:26 [ init_font_hex::i#2 init_f
Uplift Scope [main] 707: zp ZP_BYTE:7 [ main::xd#0 main::$16 main::$14 ] 202: zp ZP_BYTE:33 [ main::x2#0 ] 202: zp ZP_WORD:36 [ main::xds#0 ] 202: zp ZP_WORD:38 [ main::ds#0 ] 202: zp ZP_BYTE:43 [ main::d#0 ] 169.32: zp ZP_BYTE:4 [ main::x#2 main::x#1 ] 77: zp ZP_BYTE:3 [ main::yd#0 main::$8 main::$6 ] 64.42: zp ZP_WORD:5 [ main::screen#2 main::screen#10 main::screen#1 ] 22: zp ZP_BYTE:28 [ main::y2#0 ] 17.64: zp ZP_BYTE:2 [ main::y#10 main::y#1 ] 5.6: zp ZP_WORD:31 [ main::yds#0 ]
Uplift Scope [sqr] 338: zp ZP_BYTE:12 [ sqr::val#2 sqr::val#0 sqr::val#1 ] 202: zp ZP_WORD:34 [ sqr::return#3 ] 28.5: zp ZP_WORD:62 [ sqr::return#0 ] 22: zp ZP_WORD:29 [ sqr::return#2 ] 4: zp ZP_BYTE:61 [ sqr::$0 ]
Uplift Scope [sqrt] 202: zp ZP_BYTE:42 [ sqrt::return#2 ] 103: zp ZP_WORD:40 [ sqrt::val#0 ] 34.33: zp ZP_BYTE:54 [ sqrt::return#0 ] 4: zp ZP_WORD:48 [ sqrt::found#0 ] 4: zp ZP_WORD:50 [ sqrt::$3 ] 2: zp ZP_WORD:52 [ sqrt::$1 ]
Uplift Scope [init_squares] 22: zp ZP_BYTE:17 [ init_squares::i#2 init_squares::i#1 ] 22: zp ZP_BYTE:64 [ init_squares::$4 ] 22: zp ZP_BYTE:65 [ init_squares::$5 ] 20.17: zp ZP_WORD:15 [ init_squares::squares#2 init_squares::squares#1 ] 13.93: zp ZP_WORD:13 [ init_squares::sqr#2 init_squares::sqr#1 ]
Uplift Scope [init_squares] 22: zp ZP_BYTE:17 [ init_squares::i#2 init_squares::i#1 ] 22: zp ZP_BYTE:64 [ init_squares::$3 ] 22: zp ZP_BYTE:65 [ init_squares::$4 ] 20.17: zp ZP_WORD:15 [ init_squares::squares#2 init_squares::squares#1 ] 13.93: zp ZP_WORD:13 [ init_squares::sqr#2 init_squares::sqr#1 ]
Uplift Scope [malloc]
Uplift Scope []
@ -3192,7 +3197,7 @@ Uplifting [main] best 237505 combination reg byte a [ main::xd#0 main::$16 main:
Limited combination testing to 100 combinations of 4096 possible.
Uplifting [sqr] best 237168 combination reg byte a [ sqr::val#2 sqr::val#0 sqr::val#1 ] zp ZP_WORD:34 [ sqr::return#3 ] zp ZP_WORD:62 [ sqr::return#0 ] zp ZP_WORD:29 [ sqr::return#2 ] reg byte a [ sqr::$0 ]
Uplifting [sqrt] best 236265 combination reg byte a [ sqrt::return#2 ] zp ZP_WORD:40 [ sqrt::val#0 ] reg byte a [ sqrt::return#0 ] zp ZP_WORD:48 [ sqrt::found#0 ] zp ZP_WORD:50 [ sqrt::$3 ] zp ZP_WORD:52 [ sqrt::$1 ]
Uplifting [init_squares] best 236065 combination reg byte x [ init_squares::i#2 init_squares::i#1 ] reg byte a [ init_squares::$4 ] reg byte a [ init_squares::$5 ] zp ZP_WORD:15 [ init_squares::squares#2 init_squares::squares#1 ] zp ZP_WORD:13 [ init_squares::sqr#2 init_squares::sqr#1 ]
Uplifting [init_squares] best 236065 combination reg byte x [ init_squares::i#2 init_squares::i#1 ] reg byte a [ init_squares::$3 ] reg byte a [ init_squares::$4 ] zp ZP_WORD:15 [ init_squares::squares#2 init_squares::squares#1 ] zp ZP_WORD:13 [ init_squares::sqr#2 init_squares::sqr#1 ]
Uplifting [malloc] best 236065 combination
Uplifting [] best 236065 combination
Attempting to uplift remaining variables inzp ZP_BYTE:27 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
@ -3255,7 +3260,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label CHARSET = $2000
.label SCREEN = $2800
.const NUM_SQUARES = $30
.label SQUARES = HEAP_START
.label SQUARES = malloc.return
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -3711,13 +3716,13 @@ init_squares: {
bcc !+
inc squares+1
!:
//SEG149 [77] (byte~) init_squares::$4 ← (byte) init_squares::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
//SEG149 [77] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG150 [78] (byte~) init_squares::$5 ← (byte~) init_squares::$4 + (byte) 1 -- vbuaa=vbuaa_plus_1
//SEG150 [78] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1 -- vbuaa=vbuaa_plus_1
clc
adc #1
//SEG151 [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$5 -- vwuz1=vwuz1_plus_vbuaa
//SEG151 [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4 -- vwuz1=vwuz1_plus_vbuaa
clc
adc sqr
sta sqr
@ -3739,6 +3744,7 @@ init_squares: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
jmp breturn
//SEG157 malloc::@return
breturn:
@ -4057,7 +4063,7 @@ FINAL SYMBOL TABLE
(const byte*) SCREEN#0 SCREEN = (byte*) 10240
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2
(word*) SQUARES
(const word*) SQUARES#1 SQUARES = (word*)(const byte*) HEAP_START#0
(const word*) SQUARES#1 SQUARES = (word*)(const void*) malloc::return#0
(word*()) bsearch16u((word) bsearch16u::key , (word*) bsearch16u::items , (byte) bsearch16u::num)
(byte~) bsearch16u::$16 reg byte a 2002.0
(word*~) bsearch16u::$2 $2 zp ZP_WORD:6 4.0
@ -4127,8 +4133,8 @@ FINAL SYMBOL TABLE
(byte*) init_font_hex::proto_lo#1 proto_lo zp ZP_WORD:18 50.5
(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:18 92.53846153846155
(void()) init_squares()
(byte~) init_squares::$3 reg byte a 22.0
(byte~) init_squares::$4 reg byte a 22.0
(byte~) init_squares::$5 reg byte a 22.0
(label) init_squares::@1
(label) init_squares::@return
(byte) init_squares::i
@ -4199,10 +4205,11 @@ FINAL SYMBOL TABLE
(byte) main::yd#0 reg byte a 33.0
(word) main::yds
(word) main::yds#0 yds zp ZP_WORD:22 5.6
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(const void*) malloc::return#0 return = (void*)(const byte*) HEAP_START#0
(word) malloc::size
(word()) sqr((byte) sqr::val)
(byte~) sqr::$0 reg byte a 4.0
@ -4259,8 +4266,8 @@ reg byte a [ bsearch16u::$16 ]
zp ZP_WORD:26 [ bsearch16u::pivot#0 ]
zp ZP_WORD:28 [ bsearch16u::result#0 ]
reg byte a [ sqr::$0 ]
reg byte a [ init_squares::$3 ]
reg byte a [ init_squares::$4 ]
reg byte a [ init_squares::$5 ]
zp ZP_BYTE:30 [ init_font_hex::$0 ]
reg byte a [ init_font_hex::$1 ]
reg byte a [ init_font_hex::$2 ]
@ -4284,7 +4291,7 @@ Score: 200563
.label CHARSET = $2000
.label SCREEN = $2800
.const NUM_SQUARES = $30
.label SQUARES = HEAP_START
.label SQUARES = malloc.return
//SEG3 @begin
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
@ -4659,13 +4666,13 @@ init_squares: {
bcc !+
inc squares+1
!:
//SEG149 [77] (byte~) init_squares::$4 ← (byte) init_squares::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
//SEG149 [77] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG150 [78] (byte~) init_squares::$5 ← (byte~) init_squares::$4 + (byte) 1 -- vbuaa=vbuaa_plus_1
//SEG150 [78] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1 -- vbuaa=vbuaa_plus_1
clc
adc #1
//SEG151 [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$5 -- vwuz1=vwuz1_plus_vbuaa
//SEG151 [79] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4 -- vwuz1=vwuz1_plus_vbuaa
clc
adc sqr
sta sqr
@ -4685,6 +4692,7 @@ init_squares: {
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
malloc: {
.label return = HEAP_START
//SEG157 malloc::@return
//SEG158 [84] return
rts

View File

@ -15,7 +15,7 @@
(const byte*) SCREEN#0 SCREEN = (byte*) 10240
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2
(word*) SQUARES
(const word*) SQUARES#1 SQUARES = (word*)(const byte*) HEAP_START#0
(const word*) SQUARES#1 SQUARES = (word*)(const void*) malloc::return#0
(word*()) bsearch16u((word) bsearch16u::key , (word*) bsearch16u::items , (byte) bsearch16u::num)
(byte~) bsearch16u::$16 reg byte a 2002.0
(word*~) bsearch16u::$2 $2 zp ZP_WORD:6 4.0
@ -85,8 +85,8 @@
(byte*) init_font_hex::proto_lo#1 proto_lo zp ZP_WORD:18 50.5
(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:18 92.53846153846155
(void()) init_squares()
(byte~) init_squares::$3 reg byte a 22.0
(byte~) init_squares::$4 reg byte a 22.0
(byte~) init_squares::$5 reg byte a 22.0
(label) init_squares::@1
(label) init_squares::@return
(byte) init_squares::i
@ -157,10 +157,11 @@
(byte) main::yd#0 reg byte a 33.0
(word) main::yds
(word) main::yds#0 yds zp ZP_WORD:22 5.6
(byte*()) malloc((word) malloc::size)
(void*()) malloc((word) malloc::size)
(label) malloc::@return
(byte*) malloc::mem
(byte*) malloc::return
(void*) malloc::return
(const void*) malloc::return#0 return = (void*)(const byte*) HEAP_START#0
(word) malloc::size
(word()) sqr((byte) sqr::val)
(byte~) sqr::$0 reg byte a 4.0
@ -217,8 +218,8 @@ reg byte a [ bsearch16u::$16 ]
zp ZP_WORD:26 [ bsearch16u::pivot#0 ]
zp ZP_WORD:28 [ bsearch16u::result#0 ]
reg byte a [ sqr::$0 ]
reg byte a [ init_squares::$3 ]
reg byte a [ init_squares::$4 ]
reg byte a [ init_squares::$5 ]
zp ZP_BYTE:30 [ init_font_hex::$0 ]
reg byte a [ init_font_hex::$1 ]
reg byte a [ init_font_hex::$2 ]

View File

@ -27,8 +27,8 @@ main::@1: scope:[main] from main::@3 main::@5
[13] (word~) main::$11 ← (word~) main::$3 << (byte) 1
[14] (signed word*~) main::$4 ← (const signed word[$c0]) main::sintabw#0 + (word~) main::$11
[15] (signed word) main::sw#0 ← *((signed word*~) main::$4)
[16] (byte~) main::$5 ← > (signed word) main::sw#0
[17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5
[16] (byte~) main::$6 ← > (signed word) main::sw#0
[17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6
[18] (signed byte) print_sbyte::b#1 ← (signed byte) main::sd#0
[19] call print_sbyte
to:main::@4

View File

@ -2374,7 +2374,8 @@ Inlining Noop Cast [111] (signed word) sin16s::sinx#0 ← (signed word)(word) si
Inlining Noop Cast [115] (signed word~) sin16s::$19 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1
Inlining Noop Cast [155] (signed byte) sin8s::sinx#0 ← (signed byte)(byte) sin8s::usinx#4 keeping sin8s::usinx#4
Inlining Noop Cast [159] (signed byte~) sin8s::$21 ← (signed byte)(byte) sin8s::usinx#4 keeping sin8s::usinx#4
Inlining Noop Cast [220] (signed byte~) main::$6 ← (signed byte)(byte~) main::$5 keeping main::$5
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [220] (signed byte~) main::$6 ← (signed byte)(byte~) main::$5 keeping main::$6
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [216] (word~) main::$11 ← (word~) main::$3 * (const byte) SIZEOF_SIGNED_WORD
Successful SSA optimization Pass2MultiplyToShiftRewriting
@ -2706,8 +2707,8 @@ main::@1: scope:[main] from main::@3 main::@5
[13] (word~) main::$11 ← (word~) main::$3 << (byte) 1
[14] (signed word*~) main::$4 ← (const signed word[$c0]) main::sintabw#0 + (word~) main::$11
[15] (signed word) main::sw#0 ← *((signed word*~) main::$4)
[16] (byte~) main::$5 ← > (signed word) main::sw#0
[17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5
[16] (byte~) main::$6 ← > (signed word) main::sw#0
[17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6
[18] (signed byte) print_sbyte::b#1 ← (signed byte) main::sd#0
[19] call print_sbyte
to:main::@4
@ -3202,7 +3203,7 @@ VARIABLE REGISTER WEIGHTS
(word~) main::$11 22.0
(word~) main::$3 22.0
(signed word*~) main::$4 22.0
(byte~) main::$5 11.0
(byte~) main::$6 11.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 2.75
@ -3476,7 +3477,7 @@ Added variable main::$3 to zero page equivalence class [ main::$3 ]
Added variable main::$11 to zero page equivalence class [ main::$11 ]
Added variable main::$4 to zero page equivalence class [ main::$4 ]
Added variable main::sw#0 to zero page equivalence class [ main::sw#0 ]
Added variable main::$5 to zero page equivalence class [ main::$5 ]
Added variable main::$6 to zero page equivalence class [ main::$6 ]
Added variable main::sd#0 to zero page equivalence class [ main::sd#0 ]
Added variable print_byte::b#0 to zero page equivalence class [ print_byte::b#0 ]
Added variable print_byte::$0 to zero page equivalence class [ print_byte::$0 ]
@ -3581,7 +3582,7 @@ Complete equivalence classes
[ main::$11 ]
[ main::$4 ]
[ main::sw#0 ]
[ main::$5 ]
[ main::$6 ]
[ main::sd#0 ]
[ print_byte::b#0 ]
[ print_byte::$0 ]
@ -3685,7 +3686,7 @@ Allocated zp ZP_WORD:71 [ main::$3 ]
Allocated zp ZP_WORD:73 [ main::$11 ]
Allocated zp ZP_WORD:75 [ main::$4 ]
Allocated zp ZP_WORD:77 [ main::sw#0 ]
Allocated zp ZP_BYTE:79 [ main::$5 ]
Allocated zp ZP_BYTE:79 [ main::$6 ]
Allocated zp ZP_BYTE:80 [ main::sd#0 ]
Allocated zp ZP_BYTE:81 [ print_byte::b#0 ]
Allocated zp ZP_BYTE:82 [ print_byte::$0 ]
@ -3792,7 +3793,7 @@ main: {
.label wavelength = $c0
.label _3 = $47
.label _4 = $4b
.label _5 = $4f
.label _6 = $4f
.label _11 = $49
.label sb = $46
.label sw = $4d
@ -3869,13 +3870,13 @@ main: {
iny
lda (_4),y
sta sw+1
//SEG33 [16] (byte~) main::$5 ← > (signed word) main::sw#0 -- vbuz1=_hi_vwsz2
//SEG33 [16] (byte~) main::$6 ← > (signed word) main::sw#0 -- vbuz1=_hi_vwsz2
lda sw+1
sta _5
//SEG34 [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5 -- vbsz1=vbsz2_minus_vbsz3
sta _6
//SEG34 [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6 -- vbsz1=vbsz2_minus_vbsz3
lda sb
sec
sbc _5
sbc _6
sta sd
//SEG35 [18] (signed byte) print_sbyte::b#1 ← (signed byte) main::sd#0 -- vbsz1=vbsz2
lda sd
@ -5583,8 +5584,8 @@ Statement [14] (signed word*~) main::$4 ← (const signed word[$c0]) main::sinta
Statement [15] (signed word) main::sw#0 ← *((signed word*~) main::$4) [ main::i#2 print_char_cursor#42 main::sb#0 main::sw#0 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::sw#0 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:70 [ main::sb#0 ]
Statement [16] (byte~) main::$5 ← > (signed word) main::sw#0 [ main::i#2 print_char_cursor#42 main::sb#0 main::$5 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::$5 ] ) always clobbers reg byte a
Statement [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5 [ main::i#2 print_char_cursor#42 main::sd#0 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sd#0 ] ) always clobbers reg byte a
Statement [16] (byte~) main::$6 ← > (signed word) main::sw#0 [ main::i#2 print_char_cursor#42 main::sb#0 main::$6 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::$6 ] ) always clobbers reg byte a
Statement [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6 [ main::i#2 print_char_cursor#42 main::sd#0 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sd#0 ] ) always clobbers reg byte a
Statement [27] if(*((byte*) print_str::str#2)!=(byte) '@') goto print_str::@2 [ print_char_cursor#19 print_str::str#2 ] ( main:2::print_str:21 [ main::i#2 print_char_cursor#19 print_str::str#2 ] ) always clobbers reg byte a reg byte y
Statement [29] *((byte*) print_char_cursor#19) ← *((byte*) print_str::str#2) [ print_char_cursor#19 print_str::str#2 ] ( main:2::print_str:21 [ main::i#2 print_char_cursor#19 print_str::str#2 ] ) always clobbers reg byte a reg byte y
Statement [41] (signed byte) print_sbyte::b#0 ← - (signed byte) print_sbyte::b#1 [ print_char_cursor#10 print_sbyte::b#0 ] ( main:2::print_sbyte:19 [ main::i#2 print_char_cursor#10 print_sbyte::b#0 ] ) always clobbers reg byte a
@ -5692,8 +5693,8 @@ Statement [12] (word~) main::$3 ← (word)(byte) main::i#2 [ main::i#2 print_cha
Statement [13] (word~) main::$11 ← (word~) main::$3 << (byte) 1 [ main::i#2 print_char_cursor#42 main::sb#0 main::$11 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::$11 ] ) always clobbers reg byte a
Statement [14] (signed word*~) main::$4 ← (const signed word[$c0]) main::sintabw#0 + (word~) main::$11 [ main::i#2 print_char_cursor#42 main::sb#0 main::$4 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::$4 ] ) always clobbers reg byte a
Statement [15] (signed word) main::sw#0 ← *((signed word*~) main::$4) [ main::i#2 print_char_cursor#42 main::sb#0 main::sw#0 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::sw#0 ] ) always clobbers reg byte a reg byte y
Statement [16] (byte~) main::$5 ← > (signed word) main::sw#0 [ main::i#2 print_char_cursor#42 main::sb#0 main::$5 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::$5 ] ) always clobbers reg byte a
Statement [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5 [ main::i#2 print_char_cursor#42 main::sd#0 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sd#0 ] ) always clobbers reg byte a
Statement [16] (byte~) main::$6 ← > (signed word) main::sw#0 [ main::i#2 print_char_cursor#42 main::sb#0 main::$6 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sb#0 main::$6 ] ) always clobbers reg byte a
Statement [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6 [ main::i#2 print_char_cursor#42 main::sd#0 ] ( main:2 [ main::i#2 print_char_cursor#42 main::sd#0 ] ) always clobbers reg byte a
Statement [27] if(*((byte*) print_str::str#2)!=(byte) '@') goto print_str::@2 [ print_char_cursor#19 print_str::str#2 ] ( main:2::print_str:21 [ main::i#2 print_char_cursor#19 print_str::str#2 ] ) always clobbers reg byte a reg byte y
Statement [29] *((byte*) print_char_cursor#19) ← *((byte*) print_str::str#2) [ print_char_cursor#19 print_str::str#2 ] ( main:2::print_str:21 [ main::i#2 print_char_cursor#19 print_str::str#2 ] ) always clobbers reg byte a reg byte y
Statement [41] (signed byte) print_sbyte::b#0 ← - (signed byte) print_sbyte::b#1 [ print_char_cursor#10 print_sbyte::b#0 ] ( main:2::print_sbyte:19 [ main::i#2 print_char_cursor#10 print_sbyte::b#0 ] ) always clobbers reg byte a
@ -5827,7 +5828,7 @@ Potential registers zp ZP_WORD:71 [ main::$3 ] : zp ZP_WORD:71 ,
Potential registers zp ZP_WORD:73 [ main::$11 ] : zp ZP_WORD:73 ,
Potential registers zp ZP_WORD:75 [ main::$4 ] : zp ZP_WORD:75 ,
Potential registers zp ZP_WORD:77 [ main::sw#0 ] : zp ZP_WORD:77 ,
Potential registers zp ZP_BYTE:79 [ main::$5 ] : zp ZP_BYTE:79 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:79 [ main::$6 ] : zp ZP_BYTE:79 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:80 [ main::sd#0 ] : zp ZP_BYTE:80 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:81 [ print_byte::b#0 ] : zp ZP_BYTE:81 , reg byte x ,
Potential registers zp ZP_BYTE:82 [ print_byte::$0 ] : zp ZP_BYTE:82 , reg byte a , reg byte x , reg byte y ,
@ -5896,7 +5897,7 @@ Uplift Scope [mul16u] 353.83: zp ZP_DWORD:33 [ mul16u::res#2 mul16u::res#6 mul16
Uplift Scope [print_str] 303: zp ZP_WORD:3 [ print_str::str#2 print_str::str#0 ]
Uplift Scope [divr16u] 106.92: zp ZP_WORD:43 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] 35.12: zp ZP_WORD:47 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] 22: zp ZP_BYTE:155 [ divr16u::$1 ] 22: zp ZP_BYTE:156 [ divr16u::$2 ] 18.19: zp ZP_BYTE:49 [ divr16u::i#2 divr16u::i#1 ] 9.75: zp ZP_WORD:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 ] 4: zp ZP_WORD:143 [ divr16u::return#3 ] 4: zp ZP_WORD:147 [ divr16u::return#4 ] 4: zp ZP_WORD:188 [ divr16u::return#2 ]
Uplift Scope [] 153.81: zp ZP_WORD:7 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] 0.8: zp ZP_WORD:157 [ rem16u#1 ]
Uplift Scope [main] 22: zp ZP_WORD:71 [ main::$3 ] 22: zp ZP_WORD:73 [ main::$11 ] 22: zp ZP_WORD:75 [ main::$4 ] 22: zp ZP_WORD:77 [ main::sw#0 ] 22: zp ZP_BYTE:80 [ main::sd#0 ] 19.25: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 11: zp ZP_BYTE:79 [ main::$5 ] 3.67: zp ZP_BYTE:70 [ main::sb#0 ]
Uplift Scope [main] 22: zp ZP_WORD:71 [ main::$3 ] 22: zp ZP_WORD:73 [ main::$11 ] 22: zp ZP_WORD:75 [ main::$4 ] 22: zp ZP_WORD:77 [ main::sw#0 ] 22: zp ZP_BYTE:80 [ main::sd#0 ] 19.25: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 11: zp ZP_BYTE:79 [ main::$6 ] 3.67: zp ZP_BYTE:70 [ main::sb#0 ]
Uplift Scope [sin8s] 27.5: zp ZP_WORD:57 [ sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 ] 22: zp ZP_BYTE:163 [ sin8s::return#0 ] 13: zp ZP_BYTE:60 [ sin8s::return#1 sin8s::return#5 sin8s::sinx#1 ] 10: zp ZP_BYTE:59 [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] 4: zp ZP_WORD:165 [ sin8s::$4 ] 4: zp ZP_BYTE:169 [ sin8s::x2#0 ] 4: zp ZP_BYTE:173 [ sin8s::x3_6#0 ] 4: zp ZP_BYTE:176 [ sin8s::x4#0 ] 4: zp ZP_BYTE:178 [ sin8s::x5#0 ] 4: zp ZP_BYTE:179 [ sin8s::x5_128#0 ] 1: zp ZP_BYTE:171 [ sin8s::x3#0 ] 0.64: zp ZP_BYTE:167 [ sin8s::x1#0 ] 0.33: zp ZP_BYTE:174 [ sin8s::usinx#0 ] 0.06: zp ZP_BYTE:56 [ sin8s::isUpper#10 ]
Uplift Scope [sin16s] 27.5: zp ZP_DWORD:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] 22: zp ZP_WORD:92 [ sin16s::return#0 ] 13: zp ZP_WORD:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] 4: zp ZP_DWORD:96 [ sin16s::$4 ] 4: zp ZP_WORD:104 [ sin16s::x2#0 ] 4: zp ZP_WORD:112 [ sin16s::x3_6#0 ] 4: zp ZP_WORD:118 [ sin16s::x4#0 ] 4: zp ZP_WORD:122 [ sin16s::x5#0 ] 4: zp ZP_WORD:124 [ sin16s::x5_128#0 ] 1: zp ZP_WORD:108 [ sin16s::x3#0 ] 1: zp ZP_WORD:126 [ sin16s::usinx#1 ] 0.64: zp ZP_WORD:100 [ sin16s::x1#0 ] 0.33: zp ZP_WORD:114 [ sin16s::usinx#0 ] 0.06: zp ZP_BYTE:19 [ sin16s::isUpper#2 ]
Uplift Scope [mulu16_sel] 24: zp ZP_WORD:26 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] 21: zp ZP_WORD:28 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] 4: zp ZP_WORD:102 [ mulu16_sel::return#0 ] 4: zp ZP_WORD:106 [ mulu16_sel::return#1 ] 4: zp ZP_WORD:110 [ mulu16_sel::return#2 ] 4: zp ZP_WORD:116 [ mulu16_sel::return#10 ] 4: zp ZP_WORD:120 [ mulu16_sel::return#11 ] 4: zp ZP_DWORD:132 [ mulu16_sel::$0 ] 4: zp ZP_DWORD:136 [ mulu16_sel::$1 ] 1.71: zp ZP_WORD:140 [ mulu16_sel::return#12 ] 0.33: zp ZP_BYTE:30 [ mulu16_sel::select#5 ]
@ -5915,7 +5916,7 @@ Uplifting [mul16u] best 38396 combination zp ZP_DWORD:33 [ mul16u::res#2 mul16u:
Uplifting [print_str] best 38396 combination zp ZP_WORD:3 [ print_str::str#2 print_str::str#0 ]
Uplifting [divr16u] best 38186 combination zp ZP_WORD:43 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:47 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 ] zp ZP_WORD:143 [ divr16u::return#3 ] zp ZP_WORD:147 [ divr16u::return#4 ] zp ZP_WORD:188 [ divr16u::return#2 ]
Uplifting [] best 38186 combination zp ZP_WORD:7 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] zp ZP_WORD:157 [ rem16u#1 ]
Uplifting [main] best 37956 combination zp ZP_WORD:71 [ main::$3 ] zp ZP_WORD:73 [ main::$11 ] zp ZP_WORD:75 [ main::$4 ] zp ZP_WORD:77 [ main::sw#0 ] reg byte a [ main::sd#0 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$5 ] zp ZP_BYTE:70 [ main::sb#0 ]
Uplifting [main] best 37956 combination zp ZP_WORD:71 [ main::$3 ] zp ZP_WORD:73 [ main::$11 ] zp ZP_WORD:75 [ main::$4 ] zp ZP_WORD:77 [ main::sw#0 ] reg byte a [ main::sd#0 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$6 ] zp ZP_BYTE:70 [ main::sb#0 ]
Uplifting [sin8s] best 37851 combination zp ZP_WORD:57 [ sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 ] reg byte a [ sin8s::return#0 ] reg byte a [ sin8s::return#1 sin8s::return#5 sin8s::sinx#1 ] reg byte x [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] zp ZP_WORD:165 [ sin8s::$4 ] zp ZP_BYTE:169 [ sin8s::x2#0 ] zp ZP_BYTE:173 [ sin8s::x3_6#0 ] zp ZP_BYTE:176 [ sin8s::x4#0 ] zp ZP_BYTE:178 [ sin8s::x5#0 ] zp ZP_BYTE:179 [ sin8s::x5_128#0 ] zp ZP_BYTE:171 [ sin8s::x3#0 ] zp ZP_BYTE:167 [ sin8s::x1#0 ] zp ZP_BYTE:174 [ sin8s::usinx#0 ] zp ZP_BYTE:56 [ sin8s::isUpper#10 ]
Limited combination testing to 100 combinations of 5308416 possible.
Uplifting [sin16s] best 37851 combination zp ZP_DWORD:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:92 [ sin16s::return#0 ] zp ZP_WORD:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:96 [ sin16s::$4 ] zp ZP_WORD:104 [ sin16s::x2#0 ] zp ZP_WORD:112 [ sin16s::x3_6#0 ] zp ZP_WORD:118 [ sin16s::x4#0 ] zp ZP_WORD:122 [ sin16s::x5#0 ] zp ZP_WORD:124 [ sin16s::x5_128#0 ] zp ZP_WORD:108 [ sin16s::x3#0 ] zp ZP_WORD:126 [ sin16s::usinx#1 ] zp ZP_WORD:100 [ sin16s::x1#0 ] zp ZP_WORD:114 [ sin16s::usinx#0 ] zp ZP_BYTE:19 [ sin16s::isUpper#2 ]
@ -6152,9 +6153,9 @@ main: {
iny
lda (_4),y
sta sw+1
//SEG33 [16] (byte~) main::$5 ← > (signed word) main::sw#0 -- vbuaa=_hi_vwsz1
//SEG33 [16] (byte~) main::$6 ← > (signed word) main::sw#0 -- vbuaa=_hi_vwsz1
lda sw+1
//SEG34 [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5 -- vbsaa=vbsz1_minus_vbsaa
//SEG34 [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6 -- vbsaa=vbsz1_minus_vbsaa
eor #$ff
sec
adc sb
@ -7932,7 +7933,7 @@ FINAL SYMBOL TABLE
(word~) main::$11 $11 zp ZP_WORD:59 22.0
(word~) main::$3 $3 zp ZP_WORD:59 22.0
(signed word*~) main::$4 $4 zp ZP_WORD:59 22.0
(byte~) main::$5 reg byte a 11.0
(byte~) main::$6 reg byte a 11.0
(label) main::@1
(label) main::@2
(label) main::@3
@ -8276,7 +8277,7 @@ reg byte a [ mul8u::b#0 ]
zp ZP_BYTE:58 [ main::sb#0 ]
zp ZP_WORD:59 [ main::$3 main::$11 main::$4 ]
zp ZP_WORD:61 [ main::sw#0 ]
reg byte a [ main::$5 ]
reg byte a [ main::$6 ]
reg byte a [ main::sd#0 ]
reg byte a [ print_byte::$0 ]
reg byte a [ print_byte::$2 ]
@ -8398,8 +8399,8 @@ main: {
iny
lda (_4),y
sta sw+1
//SEG33 [16] (byte~) main::$5 ← > (signed word) main::sw#0 -- vbuaa=_hi_vwsz1
//SEG34 [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5 -- vbsaa=vbsz1_minus_vbsaa
//SEG33 [16] (byte~) main::$6 ← > (signed word) main::sw#0 -- vbuaa=_hi_vwsz1
//SEG34 [17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6 -- vbsaa=vbsz1_minus_vbsaa
eor #$ff
sec
adc sb

View File

@ -76,7 +76,7 @@
(word~) main::$11 $11 zp ZP_WORD:59 22.0
(word~) main::$3 $3 zp ZP_WORD:59 22.0
(signed word*~) main::$4 $4 zp ZP_WORD:59 22.0
(byte~) main::$5 reg byte a 11.0
(byte~) main::$6 reg byte a 11.0
(label) main::@1
(label) main::@2
(label) main::@3
@ -420,7 +420,7 @@ reg byte a [ mul8u::b#0 ]
zp ZP_BYTE:58 [ main::sb#0 ]
zp ZP_WORD:59 [ main::$3 main::$11 main::$4 ]
zp ZP_WORD:61 [ main::sw#0 ]
reg byte a [ main::$5 ]
reg byte a [ main::$6 ]
reg byte a [ main::sd#0 ]
reg byte a [ print_byte::$0 ]
reg byte a [ print_byte::$2 ]