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

fixed tests

This commit is contained in:
jespergravgaard 2019-07-11 06:31:29 +02:00
parent 5b7ba4e2d8
commit 9264967b3f
44 changed files with 6308 additions and 5683 deletions

View File

@ -28,10 +28,11 @@ void* memmove( void* destination, void* source, size_t num ) {
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
void *memset(void *str, char c, size_t num) {
char* end = (char*)str + num;
if(num>0)
if(num>0) {
char* end = (char*)str + num;
for(char* dst = str; dst!=end; dst++)
*dst = c;
}
return str;
}

View File

@ -180,34 +180,38 @@ init_irq: {
bitmap_clear: {
.const col = WHITE*$10
ldx #col
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
jsr memset
ldx #0
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
lda #<BITMAP
sta memset.str
lda #>BITMAP
sta memset.str+1
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
jsr memset
rts
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(8) str, byte register(X) c, word zeropage($a) num)
// memset(void* zeropage($a) str, byte register(X) c, word zeropage(8) num)
memset: {
.label end = $a
.label dst = 8
.label str = 8
.label num = $a
.label end = 8
.label dst = $a
.label num = 8
.label str = $a
lda num
beq breturn
lda num+1
beq breturn
lda end
clc
adc str
@ -215,7 +219,7 @@ memset: {
lda end+1
adc str+1
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -225,10 +229,11 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
breturn:
rts
}
// Initialize bitmap plotting tables

View File

@ -101,72 +101,75 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1
to:@return
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
[49] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
[49] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[49] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 )
[49] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[50] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[50] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[52] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[53] *((byte*) memset::dst#2) ← (byte) memset::c#3
[54] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[55] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
memset::@1: scope:[memset] from memset
[51] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[52] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[53] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[54] *((byte*) memset::dst#2) ← (byte) memset::c#3
[55] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[56] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[56] return
memset::@return: scope:[memset] from memset memset::@2
[57] return
to:@return
bitmap_init: scope:[bitmap_init] from main
[57] phi()
[58] phi()
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[58] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[58] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[59] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[60] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[61] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6
[59] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[59] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[60] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[61] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[62] 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
[62] phi()
[63] phi()
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6
[63] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[64] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[65] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1
[64] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[65] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[66] 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
[66] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[66] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[68] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[69] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[70] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[71] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[72] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[73] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4
[67] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[67] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[69] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[70] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[71] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[72] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[73] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[74] 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
[74] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
[75] (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
[75] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[76] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[77] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3
[76] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[77] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[78] 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
[78] return
[79] return
to:@return
irq: scope:[irq] from
[79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
[80] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[81] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
to:irq::@2
irq::@2: scope:[irq] from irq
[81] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
[82] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
to:irq::@1
irq::@1: scope:[irq] from irq irq::@2
[82] (byte) frame_cnt#10 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 )
[83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
[84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
[83] (byte) frame_cnt#10 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 )
[84] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
[85] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
to:irq::@return
irq::@return: scope:[irq] from irq::@1
[85] return
[86] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -153,20 +153,21 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(byte) main::y#2 y zp ZP_BYTE:4 6.6000000000000005
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:8 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:8 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:8 4.0
(byte*) memset::dst#1 dst zp ZP_WORD:10 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:10 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:10 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:10 2.1666666666666665
(byte*) memset::end#0 end zp ZP_WORD:8 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:10 2.0
(word) memset::num#2 num zp ZP_WORD:8 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:8
(void*) memset::str#3 str zp ZP_WORD:10
(byte[$100]) plots_per_frame
(const byte[$100]) plots_per_frame#0 plots_per_frame = { fill( $100, 0) }
@ -174,8 +175,8 @@ zp ZP_WORD:2 [ main::x#2 main::x#1 bitmap_plot::x#0 ]
zp ZP_BYTE:4 [ main::y#2 main::y#1 ]
zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ]
zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ]
zp ZP_WORD:8 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:10 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:8 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:10 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ]

View File

@ -392,34 +392,38 @@ init_irq: {
bitmap_clear: {
.const col = WHITE*$10
ldx #col
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
jsr memset
ldx #0
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
lda #<BITMAP
sta memset.str
lda #>BITMAP
sta memset.str+1
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
jsr memset
rts
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage($18) str, byte register(X) c, word zeropage($1a) num)
// memset(void* zeropage($1a) str, byte register(X) c, word zeropage($18) num)
memset: {
.label end = $1a
.label dst = $18
.label str = $18
.label num = $1a
.label end = $18
.label dst = $1a
.label num = $18
.label str = $1a
lda num
beq breturn
lda num+1
beq breturn
lda end
clc
adc str
@ -427,7 +431,7 @@ memset: {
lda end+1
adc str+1
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -437,10 +441,11 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
breturn:
rts
}
// Initialize bitmap plotting tables

View File

@ -179,248 +179,251 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1
to:@return
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
[97] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
[97] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[97] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 )
[97] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[98] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[99] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[98] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[100] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[101] *((byte*) memset::dst#2) ← (byte) memset::c#3
[102] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[103] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
memset::@1: scope:[memset] from memset
[99] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[100] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[101] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[102] *((byte*) memset::dst#2) ← (byte) memset::c#3
[103] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[104] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[104] return
memset::@return: scope:[memset] from memset memset::@2
[105] return
to:@return
bitmap_init: scope:[bitmap_init] from main::@6
[105] phi()
[106] phi()
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[106] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[106] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[107] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[108] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[109] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6
[107] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[107] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[108] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[109] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[110] 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
[110] phi()
[111] phi()
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6
[111] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[112] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[113] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1
[112] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[113] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[114] 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
[114] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[114] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[115] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[116] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[117] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[118] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[119] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[120] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[121] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4
[115] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[115] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[116] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[117] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[118] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[119] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[120] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[121] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[122] 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
[122] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
[123] (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
[123] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[124] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[125] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3
[124] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[125] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[126] 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
[126] return
[127] return
to:@return
sin16s_gen2: scope:[sin16s_gen2] from main
[127] phi()
[128] call div32u16u
[129] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
[128] phi()
[129] call div32u16u
[130] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
to:sin16s_gen2::@2
sin16s_gen2::@2: scope:[sin16s_gen2] from sin16s_gen2
[130] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2
[131] (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
[131] (word) sin16s_gen2::i#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(word) sin16s_gen2::i#1 )
[131] (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 )
[131] (dword) sin16s_gen2::x#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(dword) sin16s_gen2::x#1 )
[132] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#2
[133] call sin16s
[134] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
[132] (word) sin16s_gen2::i#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(word) sin16s_gen2::i#1 )
[132] (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 )
[132] (dword) sin16s_gen2::x#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(dword) sin16s_gen2::x#1 )
[133] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#2
[134] call sin16s
[135] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
to:sin16s_gen2::@3
sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2::@1
[135] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
[136] call mul16s
[137] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
[136] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
[137] call mul16s
[138] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
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::$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
[144] if((word) sin16s_gen2::i#1<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@1
[139] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[140] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5
[141] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8
[142] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[143] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[144] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
[145] 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
[145] return
[146] return
to:@return
sin16s: scope:[sin16s] from sin16s_gen2::@1
[146] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
[147] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
to:sin16s::@4
sin16s::@4: scope:[sin16s] from sin16s
[147] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
[148] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
to:sin16s::@1
sin16s::@1: scope:[sin16s] from sin16s sin16s::@4
[148] (byte) sin16s::isUpper#2 ← phi( sin16s/(byte) 0 sin16s::@4/(byte) 1 )
[148] (dword) sin16s::x#4 ← phi( sin16s/(dword) sin16s::x#0 sin16s::@4/(dword) sin16s::x#1 )
[149] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28#0) goto sin16s::@2
[149] (byte) sin16s::isUpper#2 ← phi( sin16s/(byte) 0 sin16s::@4/(byte) 1 )
[149] (dword) sin16s::x#4 ← phi( sin16s/(dword) sin16s::x#0 sin16s::@4/(dword) sin16s::x#1 )
[150] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28#0) goto sin16s::@2
to:sin16s::@5
sin16s::@5: scope:[sin16s] from sin16s::@1
[150] (dword) sin16s::x#2 ← (const dword) PI_u4f28#0 - (dword) sin16s::x#4
[151] (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
[151] (dword) sin16s::x#6 ← phi( sin16s::@1/(dword) sin16s::x#4 sin16s::@5/(dword) sin16s::x#2 )
[152] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3
[153] (word) sin16s::x1#0 ← > (dword~) sin16s::$4
[154] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0
[155] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0
[156] call mulu16_sel
[157] (word) mulu16_sel::return#0 ← (word) mulu16_sel::return#12
[152] (dword) sin16s::x#6 ← phi( sin16s::@1/(dword) sin16s::x#4 sin16s::@5/(dword) sin16s::x#2 )
[153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3
[154] (word) sin16s::x1#0 ← > (dword~) sin16s::$4
[155] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0
[156] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0
[157] call mulu16_sel
[158] (word) mulu16_sel::return#0 ← (word) mulu16_sel::return#12
to:sin16s::@7
sin16s::@7: scope:[sin16s] from sin16s::@2
[158] (word) sin16s::x2#0 ← (word) mulu16_sel::return#0
[159] (word) mulu16_sel::v1#1 ← (word) sin16s::x2#0
[160] (word) mulu16_sel::v2#1 ← (word) sin16s::x1#0
[161] call mulu16_sel
[162] (word) mulu16_sel::return#1 ← (word) mulu16_sel::return#12
[159] (word) sin16s::x2#0 ← (word) mulu16_sel::return#0
[160] (word) mulu16_sel::v1#1 ← (word) sin16s::x2#0
[161] (word) mulu16_sel::v2#1 ← (word) sin16s::x1#0
[162] call mulu16_sel
[163] (word) mulu16_sel::return#1 ← (word) mulu16_sel::return#12
to:sin16s::@8
sin16s::@8: scope:[sin16s] from sin16s::@7
[163] (word) sin16s::x3#0 ← (word) mulu16_sel::return#1
[164] (word) mulu16_sel::v1#2 ← (word) sin16s::x3#0
[165] call mulu16_sel
[166] (word) mulu16_sel::return#2 ← (word) mulu16_sel::return#12
[164] (word) sin16s::x3#0 ← (word) mulu16_sel::return#1
[165] (word) mulu16_sel::v1#2 ← (word) sin16s::x3#0
[166] call mulu16_sel
[167] (word) mulu16_sel::return#2 ← (word) mulu16_sel::return#12
to:sin16s::@9
sin16s::@9: scope:[sin16s] from sin16s::@8
[167] (word) sin16s::x3_6#0 ← (word) mulu16_sel::return#2
[168] (word) sin16s::usinx#0 ← (word) sin16s::x1#0 - (word) sin16s::x3_6#0
[169] (word) mulu16_sel::v1#3 ← (word) sin16s::x3#0
[170] (word) mulu16_sel::v2#3 ← (word) sin16s::x1#0
[171] call mulu16_sel
[172] (word) mulu16_sel::return#10 ← (word) mulu16_sel::return#12
[168] (word) sin16s::x3_6#0 ← (word) mulu16_sel::return#2
[169] (word) sin16s::usinx#0 ← (word) sin16s::x1#0 - (word) sin16s::x3_6#0
[170] (word) mulu16_sel::v1#3 ← (word) sin16s::x3#0
[171] (word) mulu16_sel::v2#3 ← (word) sin16s::x1#0
[172] call mulu16_sel
[173] (word) mulu16_sel::return#10 ← (word) mulu16_sel::return#12
to:sin16s::@10
sin16s::@10: scope:[sin16s] from sin16s::@9
[173] (word) sin16s::x4#0 ← (word) mulu16_sel::return#10
[174] (word) mulu16_sel::v1#4 ← (word) sin16s::x4#0
[175] (word) mulu16_sel::v2#4 ← (word) sin16s::x1#0
[176] call mulu16_sel
[177] (word) mulu16_sel::return#11 ← (word) mulu16_sel::return#12
[174] (word) sin16s::x4#0 ← (word) mulu16_sel::return#10
[175] (word) mulu16_sel::v1#4 ← (word) sin16s::x4#0
[176] (word) mulu16_sel::v2#4 ← (word) sin16s::x1#0
[177] call mulu16_sel
[178] (word) mulu16_sel::return#11 ← (word) mulu16_sel::return#12
to:sin16s::@11
sin16s::@11: scope:[sin16s] from sin16s::@10
[178] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
[179] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4
[180] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0
[181] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12
[179] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
[180] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4
[181] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0
[182] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12
to:sin16s::@6
sin16s::@6: scope:[sin16s] from sin16s::@11
[182] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
[183] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
to:sin16s::@3
sin16s::@3: scope:[sin16s] from sin16s::@12 sin16s::@6
[183] (signed word) sin16s::return#1 ← phi( sin16s::@12/(signed word~) sin16s::return#5 sin16s::@6/(signed word) sin16s::sinx#1 )
[184] (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
[184] return
[185] return
to:@return
sin16s::@12: scope:[sin16s] from sin16s::@11
[185] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1
[186] (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
[186] (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 )
[186] (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 )
[186] (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 )
[187] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5
[188] (word) mul16u::b#1 ← (word) mulu16_sel::v2#5
[189] call mul16u
[190] (dword) mul16u::return#3 ← (dword) mul16u::res#2
[187] (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 )
[187] (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 )
[187] (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 )
[188] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5
[189] (word) mul16u::b#1 ← (word) mulu16_sel::v2#5
[190] call mul16u
[191] (dword) mul16u::return#3 ← (dword) mul16u::res#2
to:mulu16_sel::@1
mulu16_sel::@1: scope:[mulu16_sel] from mulu16_sel
[191] (dword~) mulu16_sel::$0 ← (dword) mul16u::return#3
[192] (dword~) mulu16_sel::$1 ← (dword~) mulu16_sel::$0 << (byte) mulu16_sel::select#5
[193] (word) mulu16_sel::return#12 ← > (dword~) mulu16_sel::$1
[192] (dword~) mulu16_sel::$0 ← (dword) mul16u::return#3
[193] (dword~) mulu16_sel::$1 ← (dword~) mulu16_sel::$0 << (byte) mulu16_sel::select#5
[194] (word) mulu16_sel::return#12 ← > (dword~) mulu16_sel::$1
to:mulu16_sel::@return
mulu16_sel::@return: scope:[mulu16_sel] from mulu16_sel::@1
[194] return
[195] return
to:@return
div32u16u: scope:[div32u16u] from sin16s_gen2
[195] phi()
[196] call divr16u
[197] (word) divr16u::return#2 ← (word) divr16u::return#0
[196] phi()
[197] call divr16u
[198] (word) divr16u::return#2 ← (word) divr16u::return#0
to:div32u16u::@1
div32u16u::@1: scope:[div32u16u] from div32u16u
[198] (word) div32u16u::quotient_hi#0 ← (word) divr16u::return#2
[199] (word) divr16u::rem#4 ← (word) rem16u#1
[200] call divr16u
[201] (word) divr16u::return#3 ← (word) divr16u::return#0
[199] (word) div32u16u::quotient_hi#0 ← (word) divr16u::return#2
[200] (word) divr16u::rem#4 ← (word) rem16u#1
[201] call divr16u
[202] (word) divr16u::return#3 ← (word) divr16u::return#0
to:div32u16u::@2
div32u16u::@2: scope:[div32u16u] from div32u16u::@1
[202] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#3
[203] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0
[203] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#3
[204] (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
[204] return
[205] return
to:@return
divr16u: scope:[divr16u] from div32u16u div32u16u::@1
[205] (word) divr16u::dividend#5 ← phi( div32u16u/>(const dword) PI2_u4f28#0 div32u16u::@1/<(const dword) PI2_u4f28#0 )
[205] (word) divr16u::rem#10 ← phi( div32u16u/(byte) 0 div32u16u::@1/(word) divr16u::rem#4 )
[206] (word) divr16u::dividend#5 ← phi( div32u16u/>(const dword) PI2_u4f28#0 div32u16u::@1/<(const dword) PI2_u4f28#0 )
[206] (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
[206] (byte) divr16u::i#2 ← phi( divr16u/(byte) 0 divr16u::@3/(byte) divr16u::i#1 )
[206] (word) divr16u::quotient#3 ← phi( divr16u/(byte) 0 divr16u::@3/(word) divr16u::return#0 )
[206] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#0 )
[206] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 )
[207] (word) divr16u::rem#0 ← (word) divr16u::rem#5 << (byte) 1
[208] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3
[209] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte) $80
[210] if((byte~) divr16u::$2==(byte) 0) goto divr16u::@2
[207] (byte) divr16u::i#2 ← phi( divr16u/(byte) 0 divr16u::@3/(byte) divr16u::i#1 )
[207] (word) divr16u::quotient#3 ← phi( divr16u/(byte) 0 divr16u::@3/(word) divr16u::return#0 )
[207] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#0 )
[207] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 )
[208] (word) divr16u::rem#0 ← (word) divr16u::rem#5 << (byte) 1
[209] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3
[210] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte) $80
[211] if((byte~) divr16u::$2==(byte) 0) goto divr16u::@2
to:divr16u::@4
divr16u::@4: scope:[divr16u] from divr16u::@1
[211] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1
[212] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1
to:divr16u::@2
divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4
[212] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[213] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1
[214] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1
[215] if((word) divr16u::rem#6<(const word) sin16s_gen2::wavelength#0) goto divr16u::@3
[213] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[214] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1
[215] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1
[216] if((word) divr16u::rem#6<(const word) sin16s_gen2::wavelength#0) goto divr16u::@3
to:divr16u::@5
divr16u::@5: scope:[divr16u] from divr16u::@2
[216] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[217] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) sin16s_gen2::wavelength#0
[217] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[218] (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
[218] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[218] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#2 )
[219] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[220] if((byte) divr16u::i#1!=(byte) $10) goto divr16u::@1
[219] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[219] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#2 )
[220] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[221] if((byte) divr16u::i#1!=(byte) $10) goto divr16u::@1
to:divr16u::@6
divr16u::@6: scope:[divr16u] from divr16u::@3
[221] (word) rem16u#1 ← (word) divr16u::rem#11
[222] (word) rem16u#1 ← (word) divr16u::rem#11
to:divr16u::@return
divr16u::@return: scope:[divr16u] from divr16u::@6
[222] return
[223] return
to:@return
irq: scope:[irq] from
[223] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[224] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
[224] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[225] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
to:irq::@2
irq::@2: scope:[irq] from irq
[225] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
[226] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
to:irq::@1
irq::@1: scope:[irq] from irq irq::@2
[226] (byte) frame_cnt#10 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 )
[227] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
[228] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
[227] (byte) frame_cnt#10 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 )
[228] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
[229] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
to:irq::@return
irq::@return: scope:[irq] from irq::@1
[229] return
[230] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -226,20 +226,21 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(signed dword) main::ypos#0 ypos zp ZP_DWORD:10 22.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:24 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:24 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:24 4.0
(byte*) memset::dst#1 dst zp ZP_WORD:26 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:26 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:26 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:26 2.1666666666666665
(byte*) memset::end#0 end zp ZP_WORD:24 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:26 2.0
(word) memset::num#2 num zp ZP_WORD:24 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:24
(void*) memset::str#3 str zp ZP_WORD:26
(signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b)
(word~) mul16s::$13 $13 zp ZP_WORD:62 4.0
(word~) mul16s::$16 $16 zp ZP_WORD:60 4.0
@ -411,8 +412,8 @@ zp ZP_WORD:14 [ mul16u::b#0 ]
zp ZP_WORD:16 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ]
zp ZP_WORD:18 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ]
zp ZP_DWORD:20 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ]
zp ZP_WORD:24 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:26 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:24 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:26 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ]

View File

@ -429,34 +429,38 @@ init_irq: {
bitmap_clear: {
.const col = WHITE*$10
ldx #col
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
jsr memset
ldx #0
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
lda #<BITMAP
sta memset.str
lda #>BITMAP
sta memset.str+1
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
jsr memset
rts
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage($19) str, byte register(X) c, word zeropage($1b) num)
// memset(void* zeropage($1b) str, byte register(X) c, word zeropage($19) num)
memset: {
.label end = $1b
.label dst = $19
.label str = $19
.label num = $1b
.label end = $19
.label dst = $1b
.label num = $19
.label str = $1b
lda num
beq breturn
lda num+1
beq breturn
lda end
clc
adc str
@ -464,7 +468,7 @@ memset: {
lda end+1
adc str+1
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -474,10 +478,11 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
breturn:
rts
}
// Initialize bitmap plotting tables

View File

@ -198,248 +198,251 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1
to:@return
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
[106] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
[106] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#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
[107] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset 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
memset::@1: scope:[memset] from memset
[108] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[109] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[110] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[111] *((byte*) memset::dst#2) ← (byte) memset::c#3
[112] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[113] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[113] return
memset::@return: scope:[memset] from memset memset::@2
[114] return
to:@return
bitmap_init: scope:[bitmap_init] from main::@9
[114] phi()
[115] phi()
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[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
[116] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[116] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[117] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[118] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[119] 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
[119] phi()
[120] phi()
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6
[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
[121] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[122] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[123] 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
[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
[124] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[124] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[125] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[126] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[127] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[128] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[129] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[130] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[131] 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
[131] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
[132] (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
[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
[133] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[134] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[135] 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
[135] return
[136] return
to:@return
sin16s_gen2: scope:[sin16s_gen2] from main
[136] phi()
[137] call div32u16u
[138] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
[137] phi()
[138] call div32u16u
[139] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
to:sin16s_gen2::@2
sin16s_gen2::@2: scope:[sin16s_gen2] from sin16s_gen2
[139] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2
[140] (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
[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
[141] (word) sin16s_gen2::i#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(word) sin16s_gen2::i#1 )
[141] (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 )
[141] (dword) sin16s_gen2::x#2 ← phi( sin16s_gen2::@2/(byte) 0 sin16s_gen2::@4/(dword) sin16s_gen2::x#1 )
[142] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#2
[143] call sin16s
[144] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
to:sin16s_gen2::@3
sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2::@1
[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
[145] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
[146] call mul16s
[147] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
to:sin16s_gen2::@4
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@3
[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
[148] (signed dword~) sin16s_gen2::$5 ← (signed dword) mul16s::return#2
[149] (word~) sin16s_gen2::$8 ← > (signed dword~) sin16s_gen2::$5
[150] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$8
[151] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[152] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
[153] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
[154] 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
[154] return
[155] return
to:@return
sin16s: scope:[sin16s] from sin16s_gen2::@1
[155] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
[156] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
to:sin16s::@4
sin16s::@4: scope:[sin16s] from sin16s
[156] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
[157] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
to:sin16s::@1
sin16s::@1: scope:[sin16s] from sin16s sin16s::@4
[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
[158] (byte) sin16s::isUpper#2 ← phi( sin16s/(byte) 0 sin16s::@4/(byte) 1 )
[158] (dword) sin16s::x#4 ← phi( sin16s/(dword) sin16s::x#0 sin16s::@4/(dword) sin16s::x#1 )
[159] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28#0) goto sin16s::@2
to:sin16s::@5
sin16s::@5: scope:[sin16s] from sin16s::@1
[159] (dword) sin16s::x#2 ← (const dword) PI_u4f28#0 - (dword) sin16s::x#4
[160] (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
[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
[161] (dword) sin16s::x#6 ← phi( sin16s::@1/(dword) sin16s::x#4 sin16s::@5/(dword) sin16s::x#2 )
[162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3
[163] (word) sin16s::x1#0 ← > (dword~) sin16s::$4
[164] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0
[165] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0
[166] call mulu16_sel
[167] (word) mulu16_sel::return#0 ← (word) mulu16_sel::return#12
to:sin16s::@7
sin16s::@7: scope:[sin16s] from sin16s::@2
[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
[168] (word) sin16s::x2#0 ← (word) mulu16_sel::return#0
[169] (word) mulu16_sel::v1#1 ← (word) sin16s::x2#0
[170] (word) mulu16_sel::v2#1 ← (word) sin16s::x1#0
[171] call mulu16_sel
[172] (word) mulu16_sel::return#1 ← (word) mulu16_sel::return#12
to:sin16s::@8
sin16s::@8: scope:[sin16s] from sin16s::@7
[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
[173] (word) sin16s::x3#0 ← (word) mulu16_sel::return#1
[174] (word) mulu16_sel::v1#2 ← (word) sin16s::x3#0
[175] call mulu16_sel
[176] (word) mulu16_sel::return#2 ← (word) mulu16_sel::return#12
to:sin16s::@9
sin16s::@9: scope:[sin16s] from sin16s::@8
[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
[177] (word) sin16s::x3_6#0 ← (word) mulu16_sel::return#2
[178] (word) sin16s::usinx#0 ← (word) sin16s::x1#0 - (word) sin16s::x3_6#0
[179] (word) mulu16_sel::v1#3 ← (word) sin16s::x3#0
[180] (word) mulu16_sel::v2#3 ← (word) sin16s::x1#0
[181] call mulu16_sel
[182] (word) mulu16_sel::return#10 ← (word) mulu16_sel::return#12
to:sin16s::@10
sin16s::@10: scope:[sin16s] from sin16s::@9
[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
[183] (word) sin16s::x4#0 ← (word) mulu16_sel::return#10
[184] (word) mulu16_sel::v1#4 ← (word) sin16s::x4#0
[185] (word) mulu16_sel::v2#4 ← (word) sin16s::x1#0
[186] call mulu16_sel
[187] (word) mulu16_sel::return#11 ← (word) mulu16_sel::return#12
to:sin16s::@11
sin16s::@11: scope:[sin16s] from sin16s::@10
[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
[188] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
[189] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4
[190] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0
[191] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12
to:sin16s::@6
sin16s::@6: scope:[sin16s] from sin16s::@11
[191] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
[192] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
to:sin16s::@3
sin16s::@3: scope:[sin16s] from sin16s::@12 sin16s::@6
[192] (signed word) sin16s::return#1 ← phi( sin16s::@12/(signed word~) sin16s::return#5 sin16s::@6/(signed word) sin16s::sinx#1 )
[193] (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
[193] return
[194] return
to:@return
sin16s::@12: scope:[sin16s] from sin16s::@11
[194] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1
[195] (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
[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
[196] (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 )
[196] (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 )
[196] (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 )
[197] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5
[198] (word) mul16u::b#1 ← (word) mulu16_sel::v2#5
[199] call mul16u
[200] (dword) mul16u::return#3 ← (dword) mul16u::res#2
to:mulu16_sel::@1
mulu16_sel::@1: scope:[mulu16_sel] from mulu16_sel
[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
[201] (dword~) mulu16_sel::$0 ← (dword) mul16u::return#3
[202] (dword~) mulu16_sel::$1 ← (dword~) mulu16_sel::$0 << (byte) mulu16_sel::select#5
[203] (word) mulu16_sel::return#12 ← > (dword~) mulu16_sel::$1
to:mulu16_sel::@return
mulu16_sel::@return: scope:[mulu16_sel] from mulu16_sel::@1
[203] return
[204] return
to:@return
div32u16u: scope:[div32u16u] from sin16s_gen2
[204] phi()
[205] call divr16u
[206] (word) divr16u::return#2 ← (word) divr16u::return#0
[205] phi()
[206] call divr16u
[207] (word) divr16u::return#2 ← (word) divr16u::return#0
to:div32u16u::@1
div32u16u::@1: scope:[div32u16u] from div32u16u
[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
[208] (word) div32u16u::quotient_hi#0 ← (word) divr16u::return#2
[209] (word) divr16u::rem#4 ← (word) rem16u#1
[210] call divr16u
[211] (word) divr16u::return#3 ← (word) divr16u::return#0
to:div32u16u::@2
div32u16u::@2: scope:[div32u16u] from div32u16u::@1
[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
[212] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#3
[213] (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
[213] return
[214] return
to:@return
divr16u: scope:[divr16u] from div32u16u div32u16u::@1
[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 )
[215] (word) divr16u::dividend#5 ← phi( div32u16u/>(const dword) PI2_u4f28#0 div32u16u::@1/<(const dword) PI2_u4f28#0 )
[215] (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
[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
[216] (byte) divr16u::i#2 ← phi( divr16u/(byte) 0 divr16u::@3/(byte) divr16u::i#1 )
[216] (word) divr16u::quotient#3 ← phi( divr16u/(byte) 0 divr16u::@3/(word) divr16u::return#0 )
[216] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#0 )
[216] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 )
[217] (word) divr16u::rem#0 ← (word) divr16u::rem#5 << (byte) 1
[218] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3
[219] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte) $80
[220] if((byte~) divr16u::$2==(byte) 0) goto divr16u::@2
to:divr16u::@4
divr16u::@4: scope:[divr16u] from divr16u::@1
[220] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1
[221] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1
to:divr16u::@2
divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4
[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
[222] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[223] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1
[224] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1
[225] if((word) divr16u::rem#6<(const word) sin16s_gen2::wavelength#0) goto divr16u::@3
to:divr16u::@5
divr16u::@5: scope:[divr16u] from divr16u::@2
[225] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[226] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) sin16s_gen2::wavelength#0
[226] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[227] (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
[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
[228] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[228] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#2 )
[229] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[230] if((byte) divr16u::i#1!=(byte) $10) goto divr16u::@1
to:divr16u::@6
divr16u::@6: scope:[divr16u] from divr16u::@3
[230] (word) rem16u#1 ← (word) divr16u::rem#11
[231] (word) rem16u#1 ← (word) divr16u::rem#11
to:divr16u::@return
divr16u::@return: scope:[divr16u] from divr16u::@6
[231] return
[232] return
to:@return
irq: scope:[irq] from
[232] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[233] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
[233] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[234] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
to:irq::@2
irq::@2: scope:[irq] from irq
[234] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
[235] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0
to:irq::@1
irq::@1: scope:[irq] from irq irq::@2
[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
[236] (byte) frame_cnt#2 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 )
[237] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
[238] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
to:irq::@return
irq::@return: scope:[irq] from irq::@1
[238] return
[239] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -239,20 +239,21 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(signed dword) main::ypos#0 ypos zp ZP_DWORD:11 22.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:25 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:25 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:25 4.0
(byte*) memset::dst#1 dst zp ZP_WORD:27 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:27 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:27 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:27 2.1666666666666665
(byte*) memset::end#0 end zp ZP_WORD:25 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:27 2.0
(word) memset::num#2 num zp ZP_WORD:25 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:25
(void*) memset::str#3 str zp ZP_WORD:27
(signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b)
(word~) mul16s::$13 $13 zp ZP_WORD:63 4.0
(word~) mul16s::$16 $16 zp ZP_WORD:61 4.0
@ -427,8 +428,8 @@ zp ZP_WORD:15 [ mul16u::b#0 ]
zp ZP_WORD:17 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ]
zp ZP_WORD:19 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ]
zp ZP_DWORD:21 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ]
zp ZP_WORD:25 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:27 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:25 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:27 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ]

View File

@ -327,34 +327,38 @@ abs_u16: {
bitmap_clear: {
.const col = WHITE*$10
ldx #col
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
jsr memset
ldx #0
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
lda #<BITMAP
sta memset.str
lda #>BITMAP
sta memset.str+1
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
jsr memset
rts
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage($12) str, byte register(X) c, word zeropage($14) num)
// memset(void* zeropage($14) str, byte register(X) c, word zeropage($12) num)
memset: {
.label end = $14
.label dst = $12
.label str = $12
.label num = $14
.label end = $12
.label dst = $14
.label num = $12
.label str = $14
lda num
beq breturn
lda num+1
beq breturn
lda end
clc
adc str
@ -362,7 +366,7 @@ memset: {
lda end+1
adc str+1
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -372,10 +376,11 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
breturn:
rts
}
// Initialize bitmap plotting tables

View File

@ -181,57 +181,60 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1
to:@return
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
[95] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
[95] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[95] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 )
[95] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[96] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[98] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[99] *((byte*) memset::dst#2) ← (byte) memset::c#3
[100] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
memset::@1: scope:[memset] from memset
[97] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[98] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[99] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[100] *((byte*) memset::dst#2) ← (byte) memset::c#3
[101] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[102] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[102] return
memset::@return: scope:[memset] from memset memset::@2
[103] return
to:@return
bitmap_init: scope:[bitmap_init] from main
[103] phi()
[104] phi()
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[104] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[104] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[105] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[106] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[107] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6
[105] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[105] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[106] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[107] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[108] 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
[108] phi()
[109] phi()
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6
[109] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[110] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[111] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1
[110] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[111] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[112] 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
[112] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[112] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[114] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[115] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[116] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[117] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[118] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[119] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4
[113] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[113] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[114] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[115] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[116] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[117] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[118] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[119] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[120] 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
[120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
[121] (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
[121] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[122] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[123] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3
[122] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[123] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[124] 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
[124] return
[125] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -186,20 +186,21 @@
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:18 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:18 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:18 4.0
(byte*) memset::dst#1 dst zp ZP_WORD:20 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:20 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:20 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:20 2.1666666666666665
(byte*) memset::end#0 end zp ZP_WORD:18 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:20 2.0
(word) memset::num#2 num zp ZP_WORD:18 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:18
(void*) memset::str#3 str zp ZP_WORD:20
(word()) sgn_u16((word) sgn_u16::w)
(byte~) sgn_u16::$0 reg byte a 4.0
(byte~) sgn_u16::$1 reg byte a 4.0
@ -224,8 +225,8 @@ reg byte x [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2
zp ZP_WORD:12 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ]
zp ZP_WORD:14 [ sgn_u16::return#4 sgn_u16::return#0 sgn_u16::return#1 bitmap_line::sy#0 ]
zp ZP_WORD:16 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 abs_u16::return#0 abs_u16::return#1 bitmap_line::dy#0 ]
zp ZP_WORD:18 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:20 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:18 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:20 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ]

View File

@ -109,16 +109,21 @@ Rewriting struct pointer member access *((struct ProcessingSprite*) processChars
Rewriting struct pointer member access *((struct ProcessingSprite*) processChars::processing).y
Rewriting struct pointer member access *((struct ProcessingSprite*) processChars::processing).vy
Rewriting struct pointer member access *((struct ProcessingSprite*) processChars::processing).y
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Warning! Adding boolean cast to non-boolean condition (byte~) processChars::$11
Warning! Adding boolean cast to non-boolean sub-expression (byte) atan2_16::shift
Identified constant variable (byte*) HEAP_TOP
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) @8
Culled Empty Block (label) @9
Culled Empty Block (label) @10
Culled Empty Block (label) atan2_16::@9
Culled Empty Block (label) atan2_16::@10
Culled Empty Block (label) atan2_16::@11
@ -131,33 +136,33 @@ Culled Empty Block (label) atan2_16::@23
Culled Empty Block (label) atan2_16::@31
Culled Empty Block (label) atan2_16::@32
Culled Empty Block (label) atan2_16::@14
Culled Empty Block (label) @7
Culled Empty Block (label) @8
Culled Empty Block (label) @9
Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) @12
Culled Empty Block (label) @13
Culled Empty Block (label) @14
Culled Empty Block (label) @15
Culled Empty Block (label) @16
Culled Empty Block (label) @17
Culled Empty Block (label) @19
Culled Empty Block (label) @20
Culled Empty Block (label) @21
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@9
Culled Empty Block (label) main::@10
Culled Empty Block (label) main::@12
Culled Empty Block (label) @18
Culled Empty Block (label) @23
Culled Empty Block (label) getCharToProcess::@6
Culled Empty Block (label) getCharToProcess::@2
Culled Empty Block (label) @19
Culled Empty Block (label) @24
Culled Empty Block (label) startProcessing::@6
Culled Empty Block (label) startProcessing::@7
Culled Empty Block (label) processChars::@10
Culled Empty Block (label) processChars::@12
Culled Empty Block (label) processChars::@1
Culled Empty Block (label) @21
Culled Empty Block (label) @22
Culled Empty Block (label) @26
Culled Empty Block (label) @27
Culled Empty Block (label) init_angle_screen::@4
Culled Empty Block (label) @23
Culled Empty Block (label) @24
Culled Empty Block (label) @28
Culled Empty Block (label) @29
Culled Empty Block (label) setupRasterIrq::@4
Unwinding list assignment { (byte) main::$9_x, (byte) main::$9_y, (byte) main::$9_dist } ← { (byte) getCharToProcess::return_x, (byte) getCharToProcess::return_y, (byte) getCharToProcess::return_dist }
Unwinding list assignment { (byte) getCharToProcess::return_x#0, (byte) getCharToProcess::return_y#0, (byte) getCharToProcess::return_dist#0 } ← { (byte) getCharToProcess::return_x#2, (byte) getCharToProcess::return_y#2, (byte) getCharToProcess::return_dist#2 }
@ -166,12 +171,14 @@ Adding versioned struct unwinding for (struct ProcessingChar) getCharToProcess::
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000
(byte*) heap_head#0 ← (byte*) HEAP_TOP#0
to:@6
malloc: scope:[malloc] from @17 @28
(word) malloc::size#2 ← phi( @17/(word) malloc::size#0 @28/(word) malloc::size#1 )
(byte*) heap_head#5 ← phi( @17/(byte*) heap_head#9 @28/(byte*) heap_head#3 )
to:@11
malloc: scope:[malloc] from @22 @33
(word) malloc::size#2 ← phi( @22/(word) malloc::size#0 @33/(word) malloc::size#1 )
(byte*) heap_head#5 ← phi( @22/(byte*) heap_head#9 @33/(byte*) heap_head#3 )
(byte*~) malloc::$0 ← (byte*) heap_head#5 - (word) malloc::size#2
(byte*) malloc::mem#0 ← (byte*~) malloc::$0
(byte*) heap_head#1 ← (byte*) malloc::mem#0
@ -184,13 +191,13 @@ malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#2 ← (byte*) heap_head#6
return
to:@return
@6: scope:[] from @begin
(byte*) heap_head#11 ← phi( @begin/(byte*) heap_head#0 )
@11: scope:[] from @4
(byte*) heap_head#11 ← phi( @4/(byte*) heap_head#0 )
(byte) CORDIC_ITERATIONS_16#0 ← (number) $f
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 ← kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@13
to:@18
atan2_16: scope:[atan2_16] from init_angle_screen::@2
(signed word) atan2_16::x#9 ← phi( init_angle_screen::@2/(signed word) atan2_16::x#0 )
(signed word) atan2_16::y#1 ← phi( init_angle_screen::@2/(signed word) atan2_16::y#0 )
@ -401,8 +408,8 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(word) atan2_16::return#1 ← (word) atan2_16::return#3
return
to:@return
@13: scope:[] from @6
(byte*) heap_head#10 ← phi( @6/(byte*) heap_head#11 )
@18: scope:[] from @11
(byte*) heap_head#10 ← phi( @11/(byte*) heap_head#11 )
(byte*) PROCPORT_DDR#0 ← ((byte*)) (number) 0
(byte) PROCPORT_DDR_MEMORY_MASK#0 ← (number) 7
(byte*) PROCPORT#0 ← ((byte*)) (number) 1
@ -436,9 +443,9 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(byte) WHITE#0 ← (number) 1
(byte) BLUE#0 ← (number) 6
(byte) LIGHT_BLUE#0 ← (number) $e
to:@17
@17: scope:[] from @13
(byte*) heap_head#9 ← phi( @13/(byte*) heap_head#10 )
to:@22
@22: scope:[] from @18
(byte*) heap_head#9 ← phi( @18/(byte*) heap_head#10 )
(bool) DEBUG#0 ← false
(byte*) SCREEN#0 ← ((byte*)) (number) $400
(byte*) SPRITE_DATA#0 ← ((byte*)) (number) $2000
@ -453,31 +460,31 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(word) malloc::size#0 ← (number) $3e8
call malloc
(void*) malloc::return#2 ← (void*) malloc::return#1
to:@28
@28: scope:[] from @17
(byte*) heap_head#7 ← phi( @17/(byte*) heap_head#2 )
(void*) malloc::return#5 ← phi( @17/(void*) malloc::return#2 )
to:@33
@33: scope:[] from @22
(byte*) heap_head#7 ← phi( @22/(byte*) heap_head#2 )
(void*) malloc::return#5 ← phi( @22/(void*) malloc::return#2 )
(void*~) $0 ← (void*) malloc::return#5
(byte*) heap_head#3 ← (byte*) heap_head#7
(byte*) SCREEN_COPY#0 ← ((byte*)) (void*~) $0
(word) malloc::size#1 ← (number) $3e8
call malloc
(void*) malloc::return#3 ← (void*) malloc::return#1
to:@29
@29: scope:[] from @28
(byte*) SCREEN_COPY#25 ← phi( @28/(byte*) SCREEN_COPY#0 )
(byte*) heap_head#8 ← phi( @28/(byte*) heap_head#2 )
(void*) malloc::return#6 ← phi( @28/(void*) malloc::return#3 )
to:@34
@34: scope:[] from @33
(byte*) SCREEN_COPY#25 ← phi( @33/(byte*) SCREEN_COPY#0 )
(byte*) heap_head#8 ← phi( @33/(byte*) heap_head#2 )
(void*) malloc::return#6 ← phi( @33/(void*) malloc::return#3 )
(void*~) $1 ← (void*) malloc::return#6
(byte*) heap_head#4 ← (byte*) heap_head#8
(byte*) SCREEN_DIST#0 ← ((byte*)) (void*~) $1
(byte) NUM_PROCESSING#0 ← (number) 8
(byte) NOT_FOUND#0 ← (number) $ff
(struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0 ← { fill( NUM_PROCESSING#0, 0) }
to:@20
main: scope:[main] from @27
(byte*) SCREEN_COPY#4 ← phi( @27/(byte*) SCREEN_COPY#7 )
(byte*) SCREEN_DIST#1 ← phi( @27/(byte*) SCREEN_DIST#3 )
to:@25
main: scope:[main] from @32
(byte*) SCREEN_COPY#4 ← phi( @32/(byte*) SCREEN_COPY#7 )
(byte*) SCREEN_DIST#1 ← phi( @32/(byte*) SCREEN_DIST#3 )
(byte*) init_angle_screen::screen#0 ← (byte*) SCREEN_DIST#1
call init_angle_screen
to:main::@13
@ -860,9 +867,9 @@ startProcessing::@10: scope:[startProcessing] from startProcessing::@9
startProcessing::@return: scope:[startProcessing] from startProcessing::@10
return
to:@return
@20: scope:[] from @29
(byte*) SCREEN_COPY#23 ← phi( @29/(byte*) SCREEN_COPY#25 )
(byte*) SCREEN_DIST#13 ← phi( @29/(byte*) SCREEN_DIST#0 )
@25: scope:[] from @34
(byte*) SCREEN_COPY#23 ← phi( @34/(byte*) SCREEN_COPY#25 )
(byte*) SCREEN_DIST#13 ← phi( @34/(byte*) SCREEN_DIST#0 )
(number~) $2 ← (byte) BORDER_XPOS_LEFT#0 - (number) 8
(word~) $3 ← ((word)) (number~) $2
(word~) $4 ← (word~) $3 << (number) 4
@ -877,7 +884,7 @@ startProcessing::@return: scope:[startProcessing] from startProcessing::@10
(word~) $10 ← ((word)) (byte) BORDER_YPOS_BOTTOM#0
(word~) $11 ← (word~) $10 << (number) 4
(word) YPOS_BOTTOMMOST#0 ← (word~) $11
to:@25
to:@30
processChars: scope:[processChars] from irqBottom::@1
(byte) processChars::numActive#0 ← (number) 0
(number~) processChars::$1 ← (byte) NUM_PROCESSING#0 - (number) 1
@ -1186,11 +1193,11 @@ setupRasterIrq::@2: scope:[setupRasterIrq] from setupRasterIrq::@1 setupRasterI
setupRasterIrq::@return: scope:[setupRasterIrq] from setupRasterIrq::@2
return
to:@return
@25: scope:[] from @20
(byte*) SCREEN_COPY#20 ← phi( @20/(byte*) SCREEN_COPY#23 )
(byte*) SCREEN_DIST#10 ← phi( @20/(byte*) SCREEN_DIST#13 )
@30: scope:[] from @25
(byte*) SCREEN_COPY#20 ← phi( @25/(byte*) SCREEN_COPY#23 )
(byte*) SCREEN_DIST#10 ← phi( @25/(byte*) SCREEN_DIST#13 )
(byte) RASTER_IRQ_TOP#0 ← (number) $30
to:@26
to:@31
irqTop: scope:[irqTop] from
(bool~) irqTop::$0 ← ! (bool) DEBUG#0
if((bool~) irqTop::$0) goto irqTop::@1
@ -1228,11 +1235,11 @@ irqTop::@6: scope:[irqTop] from irqTop::@5
irqTop::@return: scope:[irqTop] from irqTop::@1
return
to:@return
@26: scope:[] from @25
(byte*) SCREEN_COPY#14 ← phi( @25/(byte*) SCREEN_COPY#20 )
(byte*) SCREEN_DIST#7 ← phi( @25/(byte*) SCREEN_DIST#10 )
@31: scope:[] from @30
(byte*) SCREEN_COPY#14 ← phi( @30/(byte*) SCREEN_COPY#20 )
(byte*) SCREEN_DIST#7 ← phi( @30/(byte*) SCREEN_DIST#10 )
(byte) RASTER_IRQ_MIDDLE#0 ← (number) $ff
to:@27
to:@32
irqBottom: scope:[irqBottom] from
(bool~) irqBottom::$0 ← ! (bool) DEBUG#0
if((bool~) irqBottom::$0) goto irqBottom::@1
@ -1270,14 +1277,14 @@ irqBottom::@4: scope:[irqBottom] from irqBottom::@7
irqBottom::@return: scope:[irqBottom] from irqBottom::@2
return
to:@return
@27: scope:[] from @26
(byte*) SCREEN_COPY#7 ← phi( @26/(byte*) SCREEN_COPY#14 )
(byte*) SCREEN_DIST#3 ← phi( @26/(byte*) SCREEN_DIST#7 )
@32: scope:[] from @31
(byte*) SCREEN_COPY#7 ← phi( @31/(byte*) SCREEN_COPY#14 )
(byte*) SCREEN_DIST#3 ← phi( @31/(byte*) SCREEN_DIST#7 )
call main
to:@30
@30: scope:[] from @27
to:@35
@35: scope:[] from @32
to:@end
@end: scope:[] from @30
@end: scope:[] from @35
SYMBOL TABLE SSA
(void*~) $0
@ -1292,16 +1299,17 @@ SYMBOL TABLE SSA
(number~) $7
(word~) $8
(word~) $9
(label) @13
(label) @17
(label) @20
(label) @11
(label) @18
(label) @22
(label) @25
(label) @26
(label) @27
(label) @28
(label) @29
(label) @30
(label) @6
(label) @31
(label) @32
(label) @33
(label) @34
(label) @35
(label) @4
(label) @begin
(label) @end
(byte*) BGCOL
@ -3685,14 +3693,15 @@ Added new block during phi lifting init_angle_screen::@7(between init_angle_scre
Added new block during phi lifting initSprites::@5(between initSprites::@1 and initSprites::@1)
Added new block during phi lifting initSprites::@6(between initSprites::@3 and initSprites::@3)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @6
Adding NOP phi() at start of @13
Adding NOP phi() at start of @17
Adding NOP phi() at start of @20
Adding NOP phi() at start of @4
Adding NOP phi() at start of @11
Adding NOP phi() at start of @18
Adding NOP phi() at start of @22
Adding NOP phi() at start of @25
Adding NOP phi() at start of @26
Adding NOP phi() at start of @27
Adding NOP phi() at start of @30
Adding NOP phi() at start of @31
Adding NOP phi() at start of @32
Adding NOP phi() at start of @35
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@4
@ -3711,103 +3720,104 @@ Adding NOP phi() at start of processChars
Adding NOP phi() at start of processChars::@15
Adding NOP phi() at start of irqTop
CALL GRAPH
Calls in [] to malloc:4 malloc:7 main:13
Calls in [main] to init_angle_screen:17 initSprites:44 setupRasterIrq:46 getCharToProcess:49 startProcessing:61
Calls in [init_angle_screen] to atan2_16:225
Calls in [irqBottom] to processChars:326
Calls in [] to malloc:5 malloc:8 main:14
Calls in [main] to init_angle_screen:18 initSprites:45 setupRasterIrq:47 getCharToProcess:50 startProcessing:62
Calls in [init_angle_screen] to atan2_16:226
Calls in [irqBottom] to processChars:327
Created 50 initial phi equivalence classes
Coalesced [6] heap_head#12 ← heap_head#1
Coalesced [19] main::dst#4 ← main::dst#0
Coalesced [63] main::i#3 ← main::i#1
Coalesced [64] main::src#3 ← main::src#1
Coalesced [65] main::dst#3 ← main::dst#1
Coalesced [75] startProcessing::freeIdx#9 ← startProcessing::i#2
Coalesced [95] startProcessing::chargenData#3 ← startProcessing::chargenData#0
Coalesced [96] startProcessing::spriteData#3 ← startProcessing::spriteData#0
Coalesced [131] startProcessing::chargenData#4 ← startProcessing::chargenData#1
Coalesced [132] startProcessing::spriteData#4 ← startProcessing::spriteData#1
Coalesced [133] startProcessing::i1#3 ← startProcessing::i1#1
Not coalescing [134] startProcessing::freeIdx#7 ← startProcessing::freeIdx#2
Not coalescing [137] startProcessing::freeIdx#8 ← startProcessing::freeIdx#6
Coalesced [138] startProcessing::i#5 ← startProcessing::i#1
Coalesced [141] getCharToProcess::screen_line#8 ← getCharToProcess::screen_line#0
Coalesced [142] getCharToProcess::dist_line#8 ← getCharToProcess::dist_line#0
Coalesced [144] getCharToProcess::closest_dist#11 ← getCharToProcess::closest_dist#8
Coalesced [145] getCharToProcess::closest_x#11 ← getCharToProcess::closest_x#9
Coalesced [146] getCharToProcess::closest_y#11 ← getCharToProcess::closest_y#9
Coalesced [151] getCharToProcess::return_dist#7 ← getCharToProcess::dist#0
Not coalescing [152] getCharToProcess::return_x#7 ← getCharToProcess::x#2
Not coalescing [153] getCharToProcess::return_y#7 ← getCharToProcess::y#7
Coalesced [170] getCharToProcess::screen_line#9 ← getCharToProcess::screen_line#1
Coalesced [171] getCharToProcess::dist_line#9 ← getCharToProcess::dist_line#1
Not coalescing [172] getCharToProcess::closest_dist#10 ← getCharToProcess::return_dist#1
Coalesced [173] getCharToProcess::y#8 ← getCharToProcess::y#1
Coalesced [174] getCharToProcess::closest_x#10 ← getCharToProcess::return_x#1
Coalesced [175] getCharToProcess::closest_y#10 ← getCharToProcess::return_y#1
Coalesced [176] getCharToProcess::x#6 ← getCharToProcess::x#1
Not coalescing [177] getCharToProcess::closest_dist#12 ← getCharToProcess::return_dist#1
Coalesced (already) [178] getCharToProcess::closest_x#12 ← getCharToProcess::return_x#1
Coalesced (already) [179] getCharToProcess::closest_y#12 ← getCharToProcess::return_y#1
Not coalescing [180] getCharToProcess::return_dist#6 ← getCharToProcess::closest_dist#2
Coalesced (already) [181] getCharToProcess::return_x#6 ← getCharToProcess::closest_x#7
Coalesced (already) [182] getCharToProcess::return_y#6 ← getCharToProcess::closest_y#7
Not coalescing [183] getCharToProcess::return_dist#5 ← getCharToProcess::closest_dist#2
Coalesced (already) [184] getCharToProcess::return_x#5 ← getCharToProcess::closest_x#7
Coalesced (already) [185] getCharToProcess::return_y#5 ← getCharToProcess::closest_y#7
Coalesced [210] initSprites::i#3 ← initSprites::i#1
Coalesced [211] initSprites::sp#3 ← initSprites::sp#1
Coalesced [214] init_angle_screen::screen_bottomline#6 ← init_angle_screen::screen_bottomline#0
Coalesced [215] init_angle_screen::screen_topline#6 ← init_angle_screen::screen_topline#0
Coalesced [245] init_angle_screen::y#6 ← init_angle_screen::y#1
Coalesced [246] init_angle_screen::screen_bottomline#7 ← init_angle_screen::screen_bottomline#1
Coalesced [247] init_angle_screen::screen_topline#7 ← init_angle_screen::screen_topline#1
Coalesced [248] init_angle_screen::x#4 ← init_angle_screen::x#1
Coalesced [249] init_angle_screen::xb#4 ← init_angle_screen::xb#1
Coalesced [252] atan2_16::yi#17 ← atan2_16::$2
Coalesced [256] atan2_16::xi#14 ← atan2_16::$7
Coalesced [258] atan2_16::yi#19 ← atan2_16::yi#0
Coalesced [259] atan2_16::xi#16 ← atan2_16::xi#0
Coalesced [262] atan2_16::angle#22 ← atan2_16::angle#12
Coalesced [267] atan2_16::angle#27 ← atan2_16::angle#4
Coalesced [271] atan2_16::return#5 ← atan2_16::angle#5
Coalesced [274] atan2_16::return#6 ← atan2_16::angle#11
Coalesced [275] atan2_16::angle#26 ← atan2_16::angle#1
Not coalescing [276] atan2_16::shift#5 ← atan2_16::i#2
Not coalescing [277] atan2_16::xd#10 ← atan2_16::xi#3
Not coalescing [278] atan2_16::yd#10 ← atan2_16::yi#3
Coalesced [284] atan2_16::yd#13 ← atan2_16::yd#2
Coalesced [285] atan2_16::xd#13 ← atan2_16::xd#2
Coalesced [292] atan2_16::yi#21 ← atan2_16::yi#2
Coalesced [293] atan2_16::angle#25 ← atan2_16::angle#3
Coalesced [294] atan2_16::xi#18 ← atan2_16::xi#2
Coalesced [298] atan2_16::yi#18 ← atan2_16::yi#8
Coalesced [299] atan2_16::xi#15 ← atan2_16::xi#8
Coalesced [300] atan2_16::i#12 ← atan2_16::i#1
Coalesced [301] atan2_16::angle#21 ← atan2_16::angle#13
Coalesced (already) [302] atan2_16::angle#23 ← atan2_16::angle#13
Coalesced [307] atan2_16::yi#20 ← atan2_16::yi#1
Coalesced [308] atan2_16::angle#24 ← atan2_16::angle#2
Coalesced [309] atan2_16::xi#17 ← atan2_16::xi#1
Coalesced [310] atan2_16::yd#12 ← atan2_16::yd#3
Coalesced [311] atan2_16::xd#12 ← atan2_16::xd#3
Coalesced [315] atan2_16::shift#6 ← atan2_16::shift#1
Coalesced [316] atan2_16::xd#11 ← atan2_16::xd#1
Coalesced [317] atan2_16::yd#11 ← atan2_16::yd#1
Not coalescing [318] atan2_16::xi#13 ← atan2_16::x#0
Not coalescing [319] atan2_16::yi#16 ← atan2_16::y#0
Not coalescing [322] heap_head#1 ← malloc::mem#0
Coalesced [375] processChars::numActive#17 ← processChars::numActive#1
Coalesced [381] processChars::i#13 ← processChars::i#1
Coalesced [382] processChars::numActive#15 ← processChars::numActive#3
Coalesced (already) [387] processChars::numActive#16 ← processChars::numActive#10
Coalesced [7] heap_head#12 ← heap_head#1
Coalesced [20] main::dst#4 ← main::dst#0
Coalesced [64] main::i#3 ← main::i#1
Coalesced [65] main::src#3 ← main::src#1
Coalesced [66] main::dst#3 ← main::dst#1
Coalesced [76] startProcessing::freeIdx#9 ← startProcessing::i#2
Coalesced [96] startProcessing::chargenData#3 ← startProcessing::chargenData#0
Coalesced [97] startProcessing::spriteData#3 ← startProcessing::spriteData#0
Coalesced [132] startProcessing::chargenData#4 ← startProcessing::chargenData#1
Coalesced [133] startProcessing::spriteData#4 ← startProcessing::spriteData#1
Coalesced [134] startProcessing::i1#3 ← startProcessing::i1#1
Not coalescing [135] startProcessing::freeIdx#7 ← startProcessing::freeIdx#2
Not coalescing [138] startProcessing::freeIdx#8 ← startProcessing::freeIdx#6
Coalesced [139] startProcessing::i#5 ← startProcessing::i#1
Coalesced [142] getCharToProcess::screen_line#8 ← getCharToProcess::screen_line#0
Coalesced [143] getCharToProcess::dist_line#8 ← getCharToProcess::dist_line#0
Coalesced [145] getCharToProcess::closest_dist#11 ← getCharToProcess::closest_dist#8
Coalesced [146] getCharToProcess::closest_x#11 ← getCharToProcess::closest_x#9
Coalesced [147] getCharToProcess::closest_y#11 ← getCharToProcess::closest_y#9
Coalesced [152] getCharToProcess::return_dist#7 ← getCharToProcess::dist#0
Not coalescing [153] getCharToProcess::return_x#7 ← getCharToProcess::x#2
Not coalescing [154] getCharToProcess::return_y#7 ← getCharToProcess::y#7
Coalesced [171] getCharToProcess::screen_line#9 ← getCharToProcess::screen_line#1
Coalesced [172] getCharToProcess::dist_line#9 ← getCharToProcess::dist_line#1
Not coalescing [173] getCharToProcess::closest_dist#10 ← getCharToProcess::return_dist#1
Coalesced [174] getCharToProcess::y#8 ← getCharToProcess::y#1
Coalesced [175] getCharToProcess::closest_x#10 ← getCharToProcess::return_x#1
Coalesced [176] getCharToProcess::closest_y#10 ← getCharToProcess::return_y#1
Coalesced [177] getCharToProcess::x#6 ← getCharToProcess::x#1
Not coalescing [178] getCharToProcess::closest_dist#12 ← getCharToProcess::return_dist#1
Coalesced (already) [179] getCharToProcess::closest_x#12 ← getCharToProcess::return_x#1
Coalesced (already) [180] getCharToProcess::closest_y#12 ← getCharToProcess::return_y#1
Not coalescing [181] getCharToProcess::return_dist#6 ← getCharToProcess::closest_dist#2
Coalesced (already) [182] getCharToProcess::return_x#6 ← getCharToProcess::closest_x#7
Coalesced (already) [183] getCharToProcess::return_y#6 ← getCharToProcess::closest_y#7
Not coalescing [184] getCharToProcess::return_dist#5 ← getCharToProcess::closest_dist#2
Coalesced (already) [185] getCharToProcess::return_x#5 ← getCharToProcess::closest_x#7
Coalesced (already) [186] getCharToProcess::return_y#5 ← getCharToProcess::closest_y#7
Coalesced [211] initSprites::i#3 ← initSprites::i#1
Coalesced [212] initSprites::sp#3 ← initSprites::sp#1
Coalesced [215] init_angle_screen::screen_bottomline#6 ← init_angle_screen::screen_bottomline#0
Coalesced [216] init_angle_screen::screen_topline#6 ← init_angle_screen::screen_topline#0
Coalesced [246] init_angle_screen::y#6 ← init_angle_screen::y#1
Coalesced [247] init_angle_screen::screen_bottomline#7 ← init_angle_screen::screen_bottomline#1
Coalesced [248] init_angle_screen::screen_topline#7 ← init_angle_screen::screen_topline#1
Coalesced [249] init_angle_screen::x#4 ← init_angle_screen::x#1
Coalesced [250] init_angle_screen::xb#4 ← init_angle_screen::xb#1
Coalesced [253] atan2_16::yi#17 ← atan2_16::$2
Coalesced [257] atan2_16::xi#14 ← atan2_16::$7
Coalesced [259] atan2_16::yi#19 ← atan2_16::yi#0
Coalesced [260] atan2_16::xi#16 ← atan2_16::xi#0
Coalesced [263] atan2_16::angle#22 ← atan2_16::angle#12
Coalesced [268] atan2_16::angle#27 ← atan2_16::angle#4
Coalesced [272] atan2_16::return#5 ← atan2_16::angle#5
Coalesced [275] atan2_16::return#6 ← atan2_16::angle#11
Coalesced [276] atan2_16::angle#26 ← atan2_16::angle#1
Not coalescing [277] atan2_16::shift#5 ← atan2_16::i#2
Not coalescing [278] atan2_16::xd#10 ← atan2_16::xi#3
Not coalescing [279] atan2_16::yd#10 ← atan2_16::yi#3
Coalesced [285] atan2_16::yd#13 ← atan2_16::yd#2
Coalesced [286] atan2_16::xd#13 ← atan2_16::xd#2
Coalesced [293] atan2_16::yi#21 ← atan2_16::yi#2
Coalesced [294] atan2_16::angle#25 ← atan2_16::angle#3
Coalesced [295] atan2_16::xi#18 ← atan2_16::xi#2
Coalesced [299] atan2_16::yi#18 ← atan2_16::yi#8
Coalesced [300] atan2_16::xi#15 ← atan2_16::xi#8
Coalesced [301] atan2_16::i#12 ← atan2_16::i#1
Coalesced [302] atan2_16::angle#21 ← atan2_16::angle#13
Coalesced (already) [303] atan2_16::angle#23 ← atan2_16::angle#13
Coalesced [308] atan2_16::yi#20 ← atan2_16::yi#1
Coalesced [309] atan2_16::angle#24 ← atan2_16::angle#2
Coalesced [310] atan2_16::xi#17 ← atan2_16::xi#1
Coalesced [311] atan2_16::yd#12 ← atan2_16::yd#3
Coalesced [312] atan2_16::xd#12 ← atan2_16::xd#3
Coalesced [316] atan2_16::shift#6 ← atan2_16::shift#1
Coalesced [317] atan2_16::xd#11 ← atan2_16::xd#1
Coalesced [318] atan2_16::yd#11 ← atan2_16::yd#1
Not coalescing [319] atan2_16::xi#13 ← atan2_16::x#0
Not coalescing [320] atan2_16::yi#16 ← atan2_16::y#0
Not coalescing [323] heap_head#1 ← malloc::mem#0
Coalesced [376] processChars::numActive#17 ← processChars::numActive#1
Coalesced [382] processChars::i#13 ← processChars::i#1
Coalesced [383] processChars::numActive#15 ← processChars::numActive#3
Coalesced (already) [388] processChars::numActive#16 ← processChars::numActive#10
Coalesced down to 37 phi equivalence classes
Culled Empty Block (label) @6
Culled Empty Block (label) @13
Culled Empty Block (label) @20
Culled Empty Block (label) @4
Culled Empty Block (label) @11
Culled Empty Block (label) @18
Culled Empty Block (label) @25
Culled Empty Block (label) @26
Culled Empty Block (label) @30
Culled Empty Block (label) @31
Culled Empty Block (label) @35
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@15
Culled Empty Block (label) main::@17
@ -3832,10 +3842,10 @@ Culled Empty Block (label) irqBottom::@7
Culled Empty Block (label) processChars::@15
Culled Empty Block (label) processChars::@20
Culled Empty Block (label) processChars::@21
Renumbering block @17 to @1
Renumbering block @27 to @2
Renumbering block @28 to @3
Renumbering block @29 to @4
Renumbering block @22 to @1
Renumbering block @32 to @2
Renumbering block @33 to @3
Renumbering block @34 to @4
Renumbering block atan2_16::@13 to atan2_16::@9
Renumbering block atan2_16::@15 to atan2_16::@10
Renumbering block atan2_16::@16 to atan2_16::@11

View File

@ -2,6 +2,7 @@ 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::@5
Culled Empty Block (label) memset::@3
Culled Empty Block (label) @3
Culled Empty Block (label) main::@4
@ -10,30 +11,38 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
memset: scope:[memset] from main
(byte) memset::c#2 ← phi( main/(byte) memset::c#0 )
(byte) memset::c#3 ← phi( main/(byte) memset::c#0 )
(void*) memset::str#3 ← phi( main/(void*) memset::str#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 )
(bool~) memset::$0 ← (word) memset::num#1 > (number) 0
(bool~) memset::$1 ← ! (bool~) memset::$0
if((bool~) memset::$1) goto memset::@1
to:memset::@2
memset::@1: scope:[memset] from memset memset::@4
(void*) memset::str#1 ← phi( memset/(void*) memset::str#3 memset::@4/(void*) memset::str#4 )
(void*) memset::return#0 ← (void*) memset::str#1
to:memset::@return
memset::@2: scope:[memset] from memset
(byte) memset::c#2 ← phi( memset/(byte) memset::c#3 )
(word) memset::num#2 ← phi( memset/(word) memset::num#1 )
(void*) memset::str#2 ← phi( memset/(void*) memset::str#3 )
(byte*~) memset::$2 ← ((byte*)) (void*) memset::str#2
(byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#2
(byte*) memset::end#0 ← (byte*~) memset::$3
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2
to:memset::@4
memset::@4: scope:[memset] from memset::@2 memset::@4
(void*) memset::str#4 ← phi( memset::@2/(void*) memset::str#2 memset::@4/(void*) memset::str#4 )
(byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@4/(byte*) memset::end#1 )
(byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@4/(byte*) memset::dst#1 )
(byte) memset::c#1 ← phi( memset::@2/(byte) memset::c#2 memset::@4/(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 )
(bool~) memset::$4 ← (byte*) memset::dst#1 != (byte*) memset::end#1
if((bool~) memset::$4) goto memset::@4
to:memset::@1
memset::@return: scope:[memset] from memset::@1
(void*) memset::return#3 ← phi( memset::@1/(void*) memset::return#0 )
(void*) memset::return#1 ← (void*) memset::return#3
return
to:@return
@ -133,16 +142,20 @@ SYMBOL TABLE SSA
(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
(bool~) memset::$0
(bool~) memset::$1
(byte*~) memset::$2
(byte*~) memset::$3
(bool~) memset::$4
(label) memset::@1
(label) memset::@2
(label) memset::@4
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte) memset::c#3
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
@ -153,6 +166,7 @@ SYMBOL TABLE SSA
(word) memset::num
(word) memset::num#0
(word) memset::num#1
(word) memset::num#2
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
@ -163,32 +177,41 @@ SYMBOL TABLE SSA
(void*) memset::str#1
(void*) memset::str#2
(void*) memset::str#3
(void*) memset::str#4
Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (number) 0
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*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
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 integer cast 0
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 (byte) 0
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
Inversing boolean not [2] (bool~) memset::$1 ← (word) memset::num#1 <= (byte) 0 from [1] (bool~) memset::$0 ← (word) memset::num#1 > (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (void*) memset::return#0 = (void*) memset::str#1 (void*) memset::return#3 (void*) memset::return#1
Alias (void*) memset::str#2 = (void*) memset::str#3
Alias (word) memset::num#1 = (word) memset::num#2
Alias (byte) memset::c#2 = (byte) memset::c#3
Alias (byte*) memset::end#0 = (byte*~) memset::$3
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
@ -196,20 +219,23 @@ 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 (void*) memset::str#4
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 (void*) memset::str#2 (void*) memset::str#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 (void*) memset::str#4 (void*) memset::str#2
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
Identical Phi Values (void*) memset::return#0 (void*) memset::str#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$1 [3] if((word) memset::num#0<=(byte) 0) goto memset::@1
Simple Condition (bool~) memset::$4 [15] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@4
Simple Condition (bool~) main::$3 [38] if((byte) main::y#1!=rangelast(0,$f)) goto main::@2
Simple Condition (bool~) main::$4 [43] 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 = ' '
@ -218,12 +244,14 @@ 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
Constant value identified (void*)SCREEN#0 in [20] (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
if() condition always false - eliminating [3] if((const word) memset::num#0<=(byte) 0) goto memset::@1
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [36] main::y#1 ← ++ main::y#2 to ++
Resolved ranged comparison value [38] if(main::y#1!=rangelast(0,$f)) goto main::@2 to (number) $10
Resolved ranged next value [41] main::x#1 ← ++ main::x#4 to ++
Resolved ranged comparison value [43] 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
@ -240,33 +268,33 @@ 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 [0] (byte*~) memset::$2 ← (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::$2 = (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
Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memset::$2 + (const word) memset::num#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) memset::end#0 = memset::$0+memset::num#0
Constant (const byte*) memset::end#0 = memset::$2+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 memset::$2 = (byte*)(const void*) memset::str#0
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 memset::@6(between memset::@4 and memset::@4)
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
@ -278,6 +306,7 @@ 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
Adding NOP phi() at start of memset::@1
CALL GRAPH
Calls in [] to main:3
Calls in [main] to memset:7
@ -291,7 +320,7 @@ 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 [36] memset::dst#3 ← memset::dst#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) @6
@ -299,8 +328,10 @@ 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
Culled Empty Block (label) memset::@1
Culled Empty Block (label) memset::@6
Renumbering block @5 to @1
Renumbering block memset::@4 to memset::@1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end

View File

@ -733,7 +733,7 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -743,10 +743,10 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
rts
}
.align $100

View File

@ -435,16 +435,18 @@ divr16u::@return: scope:[divr16u] from divr16u::@6
to:@return
memset: scope:[memset] from main::@3 main::@4
[214] (byte) memset::c#3 ← phi( main::@3/(const byte) BLACK#0 main::@4/(const byte) WHITE#0|(byte) 8 )
[214] (void*) memset::str#2 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS#0 )
[215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8
[216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[214] (void*) memset::str#3 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS#0 )
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[217] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
memset::@1: scope:[memset] from memset
[215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8
[216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[217] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[218] *((byte*) memset::dst#2) ← (byte) memset::c#3
[219] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
[220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
memset::@return: scope:[memset] from memset::@2
[221] return
to:@return

View File

@ -40,6 +40,7 @@ Culled Empty Block (label) @23
Culled Empty Block (label) @24
Culled Empty Block (label) @25
Culled Empty Block (label) @26
Culled Empty Block (label) memset::@5
Culled Empty Block (label) memset::@3
Culled Empty Block (label) @27
Culled Empty Block (label) main::toD0181_@1
@ -548,30 +549,38 @@ mulu16_sel::@return: scope:[mulu16_sel] from mulu16_sel::@2
return
to:@return
memset: scope:[memset] from main::@3 main::@4
(byte) memset::c#3 ← phi( main::@3/(byte) memset::c#0 main::@4/(byte) memset::c#1 )
(byte) memset::c#4 ← phi( main::@3/(byte) memset::c#0 main::@4/(byte) memset::c#1 )
(void*) memset::str#4 ← phi( main::@3/(void*) memset::str#0 main::@4/(void*) memset::str#1 )
(word) memset::num#2 ← phi( main::@3/(word) memset::num#0 main::@4/(word) memset::num#1 )
(void*) memset::str#2 ← phi( main::@3/(void*) memset::str#0 main::@4/(void*) memset::str#1 )
(byte*~) memset::$0 ← ((byte*)) (void*) memset::str#2
(byte*~) memset::$1 ← (byte*~) memset::$0 + (word) memset::num#2
(byte*) memset::end#0 ← (byte*~) memset::$1
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
(void*) memset::str#4 ← phi( memset/(void*) memset::str#2 memset::@1/(void*) memset::str#4 )
(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#2 ← phi( memset/(byte) memset::c#3 memset::@1/(byte) memset::c#2 )
(bool~) memset::$0 ← (word) memset::num#2 > (number) 0
(bool~) memset::$1 ← ! (bool~) memset::$0
if((bool~) memset::$1) goto memset::@1
to:memset::@2
memset::@1: scope:[memset] from memset memset::@4
(void*) memset::str#2 ← phi( memset/(void*) memset::str#4 memset::@4/(void*) memset::str#5 )
(void*) memset::return#0 ← (void*) memset::str#2
to:memset::@return
memset::@2: scope:[memset] from memset
(byte) memset::c#3 ← phi( memset/(byte) memset::c#4 )
(word) memset::num#3 ← phi( memset/(word) memset::num#2 )
(void*) memset::str#3 ← phi( memset/(void*) memset::str#4 )
(byte*~) memset::$2 ← ((byte*)) (void*) memset::str#3
(byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#3
(byte*) memset::end#0 ← (byte*~) memset::$3
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#3
to:memset::@4
memset::@4: scope:[memset] from memset::@2 memset::@4
(void*) memset::str#5 ← phi( memset::@2/(void*) memset::str#3 memset::@4/(void*) memset::str#5 )
(byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@4/(byte*) memset::end#1 )
(byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@4/(byte*) memset::dst#1 )
(byte) memset::c#2 ← phi( memset::@2/(byte) memset::c#3 memset::@4/(byte) memset::c#2 )
*((byte*) memset::dst#2) ← (byte) memset::c#2
(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#3 ← phi( memset::@1/(void*) memset::str#4 )
(void*) memset::return#0 ← (void*) memset::str#3
to:memset::@return
memset::@return: scope:[memset] from memset::@2
(void*) memset::return#4 ← phi( memset::@2/(void*) memset::return#0 )
(bool~) memset::$4 ← (byte*) memset::dst#1 != (byte*) memset::end#1
if((bool~) memset::$4) goto memset::@4
to:memset::@1
memset::@return: scope:[memset] from memset::@1
(void*) memset::return#4 ← phi( memset::@1/(void*) memset::return#0 )
(void*) memset::return#1 ← (void*) memset::return#4
return
to:@return
@ -1103,17 +1112,21 @@ SYMBOL TABLE SSA
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte*~) memset::$0
(byte*~) memset::$1
(bool~) memset::$2
(bool~) memset::$0
(bool~) memset::$1
(byte*~) memset::$2
(byte*~) memset::$3
(bool~) memset::$4
(label) memset::@1
(label) memset::@2
(label) memset::@4
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte) memset::c#3
(byte) memset::c#4
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
@ -1125,6 +1138,7 @@ SYMBOL TABLE SSA
(word) memset::num#0
(word) memset::num#1
(word) memset::num#2
(word) memset::num#3
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
@ -1137,6 +1151,7 @@ SYMBOL TABLE SSA
(void*) memset::str#2
(void*) memset::str#3
(void*) memset::str#4
(void*) memset::str#5
(signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b)
(word~) mul16s::$0
(word~) mul16s::$1
@ -1664,6 +1679,7 @@ Adding number conversion cast (unumber) 0 in (byte) mulu16_sel::select#3 ← (nu
Adding number conversion cast (unumber) 0 in (byte) mulu16_sel::select#4 ← (number) 0
Adding number conversion cast (unumber) 4 in (word~) sin16s::$12 ← (word) sin16s::x5#0 >> (number) 4
Adding number conversion cast (unumber) 0 in (bool~) sin16s::$15 ← (byte) sin16s::isUpper#2 != (number) 0
Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#2 > (number) 0
Adding number conversion cast (unumber) $200 in (word) XSIN_SIZE#0 ← (number) $200
Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0181_$1#0 in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (unumber)(number) $3fff
@ -1755,8 +1771,8 @@ Inlining cast (byte) mulu16_sel::select#3 ← (unumber)(number) 0
Inlining cast (byte) mulu16_sel::select#4 ← (unumber)(number) 0
Inlining cast (signed word~) sin16s::$14 ← (signed word)(word) sin16s::usinx#1
Inlining cast (signed word~) sin16s::$19 ← (signed word)(word) sin16s::usinx#3
Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte*) LOGO#0 ← (byte*)(number) $2000
Inlining cast (word) XSIN_SIZE#0 ← (unumber)(number) $200
@ -1830,6 +1846,7 @@ Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 4
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 8192
Simplifying constant integer cast $200
@ -1905,6 +1922,7 @@ Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $200
Finalized unsigned number type (word) $3fff
Finalized unsigned number type (byte) 4
@ -1970,7 +1988,8 @@ Inversing boolean not [117] (bool~) mul16s::$6 ← (signed word) mul16s::b#2 >=
Inversing boolean not [185] (bool~) sin16s::$1 ← (dword) sin16s::x#3 < (dword) PI_u4f28#0 from [184] (bool~) sin16s::$0 ← (dword) sin16s::x#3 >= (dword) PI_u4f28#0
Inversing boolean not [189] (bool~) sin16s::$3 ← (dword) sin16s::x#4 < (dword) PI_HALF_u4f28#0 from [188] (bool~) sin16s::$2 ← (dword) sin16s::x#4 >= (dword) PI_HALF_u4f28#0
Inversing boolean not [248] (bool~) sin16s::$16 ← (byte) sin16s::isUpper#2 == (byte) 0 from [247] (bool~) sin16s::$15 ← (byte) sin16s::isUpper#2 != (byte) 0
Inversing boolean not [373] (bool~) loop::$4 ← (word) xsin_idx#3 != (word) XSIN_SIZE#0 from [372] (bool~) loop::$3 ← (word) xsin_idx#3 == (word) XSIN_SIZE#0
Inversing boolean not [277] (bool~) memset::$1 ← (word) memset::num#2 <= (byte) 0 from [276] (bool~) memset::$0 ← (word) memset::num#2 > (byte) 0
Inversing boolean not [377] (bool~) loop::$4 ← (word) xsin_idx#3 != (word) XSIN_SIZE#0 from [376] (bool~) loop::$3 ← (word) xsin_idx#3 == (word) XSIN_SIZE#0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (word) divr16u::rem#0 = (word~) divr16u::$0 (word) divr16u::rem#7
Alias (word) divr16u::dividend#0 = (word~) divr16u::$6 (word) divr16u::dividend#8
@ -2062,8 +2081,11 @@ Alias (signed word) sin16s::sinx#1 = (signed word~) sin16s::$20
Alias (dword) mul16u::return#3 = (dword) mul16u::return#6
Alias (byte) mulu16_sel::select#5 = (byte) mulu16_sel::select#6
Alias (word) mulu16_sel::return#12 = (word) mulu16_sel::return#5 (word~) mulu16_sel::$2 (word) mulu16_sel::return#6
Alias (byte*) memset::end#0 = (byte*~) memset::$1
Alias (void*) memset::return#0 = (void*) memset::str#3 (void*) memset::str#4 (void*) memset::return#4 (void*) memset::return#1
Alias (void*) memset::return#0 = (void*) memset::str#2 (void*) memset::return#4 (void*) memset::return#1
Alias (void*) memset::str#3 = (void*) memset::str#4
Alias (word) memset::num#2 = (word) memset::num#3
Alias (byte) memset::c#3 = (byte) memset::c#4
Alias (byte*) memset::end#0 = (byte*~) memset::$3
Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1
Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1
Alias (word) rem16u#30 = (word) rem16u#36 (word) rem16u#37 (word) rem16u#35 (word) rem16u#34 (word) rem16u#33
@ -2116,7 +2138,7 @@ Self Phi Eliminated (word) sin16s_gen2::wavelength#2
Self Phi Eliminated (word) rem16u#16
Self Phi Eliminated (byte) memset::c#2
Self Phi Eliminated (byte*) memset::end#1
Self Phi Eliminated (void*) memset::return#0
Self Phi Eliminated (void*) memset::str#5
Self Phi Eliminated (word) rem16u#23
Self Phi Eliminated (word) xsin_idx#13
Self Phi Eliminated (word) xsin_idx#10
@ -2150,7 +2172,7 @@ Identical Phi Values (word) rem16u#16 (word) rem16u#15
Identical Phi Values (dword) sin16s::x#3 (dword) sin16s::x#0
Identical Phi Values (byte) memset::c#2 (byte) memset::c#3
Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0
Identical Phi Values (void*) memset::return#0 (void*) memset::str#2
Identical Phi Values (void*) memset::str#5 (void*) memset::str#3
Identical Phi Values (word) rem16u#30 (word) rem16u#0
Identical Phi Values (word) xsin_idx#21 (word) xsin_idx#16
Identical Phi Values (word) rem16u#23 (word) rem16u#30
@ -2170,8 +2192,10 @@ Identical Phi Values (byte) render_logo::screen_idx#16 (byte) render_logo::scree
Identical Phi Values (word) rem16u#10 (word) rem16u#17
Identical Phi Values (word) xsin_idx#12 (word) xsin_idx#0
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [427] (byte~) render_logo::$14 ← (byte) $28 * (byte) render_logo::line#10
Identified duplicate assignment right side [444] (byte~) render_logo::$22 ← (byte) $28 * (byte) render_logo::line#11
Identical Phi Values (void*) memset::return#0 (void*) memset::str#3
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [431] (byte~) render_logo::$14 ← (byte) $28 * (byte) render_logo::line#10
Identified duplicate assignment right side [448] (byte~) render_logo::$22 ← (byte) $28 * (byte) render_logo::line#11
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition (bool~) divr16u::$4 [23] if((byte~) divr16u::$2==(byte) 0) goto divr16u::@2
Simple Condition (bool~) divr16u::$9 [31] if((word) divr16u::rem#6<(word) divr16u::divisor#6) goto divr16u::@3
@ -2184,19 +2208,20 @@ Simple Condition (bool~) sin16s_gen2::$10 [178] if((word) sin16s_gen2::i#1<(word
Simple Condition (bool~) sin16s::$1 [186] if((dword) sin16s::x#0<(dword) PI_u4f28#0) goto sin16s::@1
Simple Condition (bool~) sin16s::$3 [190] if((dword) sin16s::x#4<(dword) PI_HALF_u4f28#0) goto sin16s::@2
Simple Condition (bool~) sin16s::$16 [249] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@3
Simple Condition (bool~) memset::$2 [284] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
Simple Condition (bool~) main::$6 [339] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1
Simple Condition (bool~) loop::$0 [362] if(*((byte*) RASTER#0)!=(byte) $ff) goto loop::@4
Simple Condition (bool~) loop::$4 [374] if((word) xsin_idx#3!=(word) XSIN_SIZE#0) goto loop::@11
Simple Condition (bool~) render_logo::$5 [393] if((signed word) render_logo::xpos#0<(signed byte) 0) goto render_logo::@1
Simple Condition (bool~) render_logo::$7 [405] if((byte) render_logo::screen_idx#18!=(byte) render_logo::logo_start#1) goto render_logo::@5
Simple Condition (bool~) render_logo::$10 [416] unroll if((byte) render_logo::line#2!=rangelast(0,5)) goto render_logo::@7
Simple Condition (bool~) render_logo::$11 [421] if((byte) render_logo::screen_idx#10!=(byte) $28) goto render_logo::@13
Simple Condition (bool~) render_logo::$16 [432] unroll if((byte) render_logo::line#4!=rangelast(0,5)) goto render_logo::@15
Simple Condition (bool~) render_logo::$19 [438] if((byte) render_logo::logo_idx#11!=(byte) $28) goto render_logo::@22
Simple Condition (bool~) render_logo::$24 [449] unroll if((byte) render_logo::line#6!=rangelast(0,5)) goto render_logo::@24
Simple Condition (bool~) render_logo::$25 [455] if((byte) render_logo::screen_idx#15!=(byte) $28) goto render_logo::@30
Simple Condition (bool~) render_logo::$28 [464] unroll if((byte) render_logo::line#8!=rangelast(0,5)) goto render_logo::@32
Simple Condition (bool~) memset::$1 [278] if((word) memset::num#2<=(byte) 0) goto memset::@1
Simple Condition (bool~) memset::$4 [290] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@4
Simple Condition (bool~) main::$6 [343] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1
Simple Condition (bool~) loop::$0 [366] if(*((byte*) RASTER#0)!=(byte) $ff) goto loop::@4
Simple Condition (bool~) loop::$4 [378] if((word) xsin_idx#3!=(word) XSIN_SIZE#0) goto loop::@11
Simple Condition (bool~) render_logo::$5 [397] if((signed word) render_logo::xpos#0<(signed byte) 0) goto render_logo::@1
Simple Condition (bool~) render_logo::$7 [409] if((byte) render_logo::screen_idx#18!=(byte) render_logo::logo_start#1) goto render_logo::@5
Simple Condition (bool~) render_logo::$10 [420] unroll if((byte) render_logo::line#2!=rangelast(0,5)) goto render_logo::@7
Simple Condition (bool~) render_logo::$11 [425] if((byte) render_logo::screen_idx#10!=(byte) $28) goto render_logo::@13
Simple Condition (bool~) render_logo::$16 [436] unroll if((byte) render_logo::line#4!=rangelast(0,5)) goto render_logo::@15
Simple Condition (bool~) render_logo::$19 [442] if((byte) render_logo::logo_idx#11!=(byte) $28) goto render_logo::@22
Simple Condition (bool~) render_logo::$24 [453] unroll if((byte) render_logo::line#6!=rangelast(0,5)) goto render_logo::@24
Simple Condition (bool~) render_logo::$25 [459] if((byte) render_logo::screen_idx#15!=(byte) $28) goto render_logo::@30
Simple Condition (bool~) render_logo::$28 [468] unroll if((byte) render_logo::line#8!=rangelast(0,5)) goto render_logo::@32
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [216] (word) mulu16_sel::v2#2 ← (unumber)(number) $10000/(number) 6
Successful SSA optimization Pass2ConstantRValueConsolidation
@ -2262,28 +2287,28 @@ Successful SSA optimization Pass2ConstantIdentification
Constant (const word) divr16u::divisor#0 = div32u16u::divisor#0
Constant (const word) divr16u::divisor#1 = div32u16u::divisor#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified { fill( XSIN_SIZE#0, 0) } in [295] (signed word[XSIN_SIZE#0]) xsin#0 ← { fill( XSIN_SIZE#0, 0) }
Constant value identified (word)main::toD0181_screen#0 in [305] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [309] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (void*)SCREEN#0 in [321] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0
Constant value identified (void*)COLS#0 in [328] (void*) memset::str#1 ← (void*)(const byte*) COLS#0
Constant value identified { fill( XSIN_SIZE#0, 0) } in [299] (signed word[XSIN_SIZE#0]) xsin#0 ← { fill( XSIN_SIZE#0, 0) }
Constant value identified (word)main::toD0181_screen#0 in [309] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [313] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (void*)SCREEN#0 in [325] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0
Constant value identified (void*)COLS#0 in [332] (void*) memset::str#1 ← (void*)(const byte*) COLS#0
Successful SSA optimization Pass2ConstantValues
if() condition always true - replacing block destination [359] if(true) goto loop::@4
if() condition always true - replacing block destination [363] if(true) goto loop::@4
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [36] divr16u::i#1 ← ++ divr16u::i#2 to ++
Resolved ranged comparison value [38] if(divr16u::i#1!=rangelast(0,$f)) goto divr16u::@1 to (number) $10
Resolved ranged next value [337] main::ch#1 ← ++ main::ch#2 to ++
Resolved ranged comparison value [339] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0
Resolved ranged next value [414] render_logo::line#2 ← ++ render_logo::line#9 to ++
Resolved ranged comparison value [416] unroll if(render_logo::line#2!=rangelast(0,5)) goto render_logo::@7 to (number) 6
Resolved ranged next value [430] render_logo::line#4 ← ++ render_logo::line#10 to ++
Resolved ranged comparison value [432] unroll if(render_logo::line#4!=rangelast(0,5)) goto render_logo::@15 to (number) 6
Resolved ranged next value [447] render_logo::line#6 ← ++ render_logo::line#11 to ++
Resolved ranged comparison value [449] unroll if(render_logo::line#6!=rangelast(0,5)) goto render_logo::@24 to (number) 6
Resolved ranged next value [462] render_logo::line#8 ← ++ render_logo::line#12 to ++
Resolved ranged comparison value [464] unroll if(render_logo::line#8!=rangelast(0,5)) goto render_logo::@32 to (number) 6
Eliminating unused variable (void*) memset::return#2 and assignment [161] (void*) memset::return#2 ← (void*) memset::str#2
Eliminating unused variable (void*) memset::return#3 and assignment [165] (void*) memset::return#3 ← (void*) memset::str#2
Resolved ranged next value [341] main::ch#1 ← ++ main::ch#2 to ++
Resolved ranged comparison value [343] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0
Resolved ranged next value [418] render_logo::line#2 ← ++ render_logo::line#9 to ++
Resolved ranged comparison value [420] unroll if(render_logo::line#2!=rangelast(0,5)) goto render_logo::@7 to (number) 6
Resolved ranged next value [434] render_logo::line#4 ← ++ render_logo::line#10 to ++
Resolved ranged comparison value [436] unroll if(render_logo::line#4!=rangelast(0,5)) goto render_logo::@15 to (number) 6
Resolved ranged next value [451] render_logo::line#6 ← ++ render_logo::line#11 to ++
Resolved ranged comparison value [453] unroll if(render_logo::line#6!=rangelast(0,5)) goto render_logo::@24 to (number) 6
Resolved ranged next value [466] render_logo::line#8 ← ++ render_logo::line#12 to ++
Resolved ranged comparison value [468] unroll if(render_logo::line#8!=rangelast(0,5)) goto render_logo::@32 to (number) 6
Eliminating unused variable (void*) memset::return#2 and assignment [162] (void*) memset::return#2 ← (void*) memset::str#3
Eliminating unused variable (void*) memset::return#3 and assignment [166] (void*) memset::return#3 ← (void*) memset::str#3
Eliminating unused constant (const byte) render_logo::logo_idx#0
Eliminating unused constant (const byte) render_logo::screen_idx#0
Eliminating unused constant (const byte) render_logo::line#0
@ -2322,7 +2347,7 @@ Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [18] (word) divr16u::dividend#1 ← > (const dword) div32u16u::dividend#0
Constant right-side identified [22] (word) divr16u::dividend#2 ← < (const dword) div32u16u::dividend#0
Constant right-side identified [58] (signed word) sin16s_gen2::ampl#0 ← (const signed word) sin16s_gen2::max#0 - (const signed word) sin16s_gen2::min#0
Constant right-side identified [161] (byte) memset::c#1 ← (const byte) WHITE#0 | (byte) 8
Constant right-side identified [162] (byte) memset::c#1 ← (const byte) WHITE#0 | (byte) 8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) divr16u::dividend#1 = >div32u16u::dividend#0
Constant (const word) divr16u::dividend#2 = <div32u16u::dividend#0
@ -2352,8 +2377,8 @@ Successful SSA optimization Pass2EliminateUnusedBlocks
Alias (dword) mul16s::m#4 = (dword) mul16s::m#5
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [51] (signed word~) sin16s_gen2::$1 ← (const signed word) sin16s_gen2::ampl#0 >> (signed byte) 1
Constant right-side identified [138] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [141] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Constant right-side identified [139] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [142] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) mul16u::b#0 = (word)mul16s::b#0
Constant (const word) mul16s::$10 = (word)mul16s::b#0
@ -2362,8 +2387,8 @@ 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 right-side identified [48] (signed word) sin16s_gen2::offs#0 ← (const signed word) sin16s_gen2::min#0 + (const signed word) sin16s_gen2::$1
Constant right-side identified [134] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [136] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Constant right-side identified [135] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [137] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const signed word) sin16s_gen2::offs#0 = sin16s_gen2::min#0+sin16s_gen2::$1
Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0*4
@ -2378,13 +2403,13 @@ Eliminating unused constant (const signed word) sin16s_gen2::offs#0
Successful SSA optimization PassNEliminateUnusedVars
Alias (signed word~) sin16s_gen2::$8 = (signed word~) sin16s_gen2::$7
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [133] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0
Constant right-side identified [134] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f
Constant right-side identified [134] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0
Constant right-side identified [135] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0
Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [132] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0
Constant right-side identified [133] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0
Successful SSA optimization Pass2ConstantIdentification
@ -2392,19 +2417,19 @@ Unrolling loop Loop head: render_logo::@7 tails: render_logo::@7 blocks: render_
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) render_logo::line#9 (const byte) render_logo::line#1
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [172] if((byte) render_logo::line#2==(byte) 6) goto render_logo::@8
Negating conditional jump and destination [173] if((byte) render_logo::line#2==(byte) 6) goto render_logo::@8
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [168] (byte~) render_logo::$8 ← (byte) $28 * (const byte) render_logo::line#1
Constant right-side identified [171] (byte) render_logo::line#2 ← ++ (const byte) render_logo::line#1
Constant right-side identified [169] (byte~) render_logo::$8 ← (byte) $28 * (const byte) render_logo::line#1
Constant right-side identified [172] (byte) render_logo::line#2 ← ++ (const byte) render_logo::line#1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) render_logo::$8 = $28*render_logo::line#1
Constant (const byte) render_logo::line#2 = ++render_logo::line#1
Successful SSA optimization Pass2ConstantIdentification
if() condition always false - eliminating [172] if((const byte) render_logo::line#2==(byte) 6) goto render_logo::@8
if() condition always false - eliminating [173] if((const byte) render_logo::line#2==(byte) 6) goto render_logo::@8
Successful SSA optimization Pass2ConstantIfs
Simplifying constant evaluating to zero (byte) $28*(const byte) render_logo::line#1 in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero SCREEN#0 in [169] (byte*~) render_logo::$9 ← (const byte*) SCREEN#0 + (const byte) render_logo::$8
Simplifying expression containing zero SCREEN#0 in [170] (byte*~) render_logo::$9 ← (const byte*) SCREEN#0 + (const byte) render_logo::$8
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) render_logo::$8
Successful SSA optimization PassNEliminateUnusedVars
@ -2883,8 +2908,8 @@ 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 [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
Inlining Noop Cast [208] (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Inlining Noop Cast [210] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 keeping memset::str#3
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
@ -3105,6 +3130,8 @@ Successful SSA optimization Pass2ConstantSimplification
Identical Phi Values (word) divr16u::divisor#6 (const word) XSIN_SIZE#0
Identical Phi Values (word) memset::num#2 (word) $3e8
Successful SSA optimization Pass2IdenticalPhiElimination
if() condition always false - eliminating [202] if((word) $3e8<=(byte) 0) goto memset::@1
Successful SSA optimization Pass2ConstantIfs
Added new block during phi lifting main::@8(between main::@1 and main::@1)
Added new block during phi lifting loop::@16(between loop::@15 and loop::@11)
Added new block during phi lifting render_logo::@37(between render_logo::@21 and render_logo::@29)
@ -3118,7 +3145,7 @@ Added new block during phi lifting sin16s::@15(between sin16s::@12 and sin16s::@
Added new block during phi lifting divr16u::@8(between divr16u::@3 and divr16u::@1)
Added new block during phi lifting divr16u::@9(between divr16u::@1 and divr16u::@2)
Added new block during phi lifting divr16u::@10(between divr16u::@2 and divr16u::@3)
Added new block during phi lifting memset::@4(between memset::@1 and memset::@1)
Added new block during phi lifting memset::@6(between memset::@4 and memset::@4)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @6
Adding NOP phi() at start of @17
@ -3143,7 +3170,7 @@ Adding NOP phi() at start of render_logo::@22
Adding NOP phi() at start of sin16s_gen2
Adding NOP phi() at start of mul16u::@3
Adding NOP phi() at start of div32u16u
Adding NOP phi() at start of memset::@2
Adding NOP phi() at start of memset::@1
CALL GRAPH
Calls in [] to main:6
Calls in [main] to memset:18 memset:20 sin16s_gen2:27 loop:29
@ -3235,8 +3262,8 @@ Culled Empty Block (label) sin16s::@13
Culled Empty Block (label) divr16u::@8
Culled Empty Block (label) divr16u::@10
Culled Empty Block (label) divr16u::@9
Culled Empty Block (label) memset::@2
Culled Empty Block (label) memset::@4
Culled Empty Block (label) memset::@1
Culled Empty Block (label) memset::@6
Renumbering block @28 to @1
Renumbering block @31 to @2
Renumbering block div32u16u::@2 to div32u16u::@1
@ -3254,6 +3281,8 @@ Renumbering block sin16s::@11 to sin16s::@10
Renumbering block sin16s::@12 to sin16s::@11
Renumbering block sin16s::@15 to sin16s::@12
Renumbering block mulu16_sel::@2 to mulu16_sel::@1
Renumbering block memset::@2 to memset::@1
Renumbering block memset::@4 to memset::@2
Renumbering block main::@6 to main::@5
Renumbering block loop::@4 to loop::@2
Renumbering block loop::@6 to loop::@3
@ -3722,17 +3751,19 @@ divr16u::@return: scope:[divr16u] from divr16u::@6
to:@return
memset: scope:[memset] from main::@3 main::@4
[214] (byte) memset::c#3 ← phi( main::@3/(const byte) BLACK#0 main::@4/(const byte) WHITE#0|(byte) 8 )
[214] (void*) memset::str#2 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS#0 )
[215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8
[216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[214] (void*) memset::str#3 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS#0 )
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[217] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
memset::@1: scope:[memset] from memset
[215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8
[216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[217] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[218] *((byte*) memset::dst#2) ← (byte) memset::c#3
[219] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
[220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
memset::@return: scope:[memset] from memset::@2
[221] return
to:@return
@ -3828,7 +3859,7 @@ VARIABLE REGISTER WEIGHTS
(word) memset::num
(void*) memset::return
(void*) memset::str
(void*) memset::str#2
(void*) memset::str#3
(signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b)
(word~) mul16s::$16 4.0
(word~) mul16s::$9 4.0
@ -4011,7 +4042,7 @@ Initial phi equivalence classes
[ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
[ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ]
[ divr16u::i#2 divr16u::i#1 ]
[ memset::str#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
Added variable loop::$5 to zero page equivalence class [ loop::$5 ]
@ -4099,7 +4130,7 @@ Complete equivalence classes
[ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
[ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ]
[ divr16u::i#2 divr16u::i#1 ]
[ memset::str#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
[ loop::$5 ]
@ -4186,7 +4217,7 @@ Allocated zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u:
Allocated zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
Allocated zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ]
Allocated zp ZP_BYTE:51 [ divr16u::i#2 divr16u::i#1 ]
Allocated zp ZP_WORD:52 [ memset::str#2 ]
Allocated zp ZP_WORD:52 [ memset::str#3 ]
Allocated zp ZP_BYTE:54 [ memset::c#3 ]
Allocated zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated zp ZP_WORD:57 [ loop::$5 ]
@ -4339,7 +4370,7 @@ main: {
// [214] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuz1=vbuc1
lda #BLACK
sta memset.c
// [214] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
// [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
lda #<SCREEN
sta memset.str
lda #>SCREEN
@ -4356,7 +4387,7 @@ main: {
// [214] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuz1=vbuc1
lda #WHITE|8
sta memset.c
// [214] phi (void*) memset::str#2 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
// [214] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
lda #<COLS
sta memset.str
lda #>COLS
@ -5896,7 +5927,10 @@ memset: {
.label dst = $37
.label str = $34
.label c = $36
// [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
jmp b1
// memset::@1
b1:
// [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
lda str
clc
adc #<$3e8
@ -5904,18 +5938,18 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
// [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 -- pbuz1=pbuz2
// [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2
lda str
sta dst
lda str+1
sta dst+1
// [217] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
b1_from_memset:
b1_from_b1:
// [217] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
jmp b1
// memset::@1
b1:
// [217] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
b2_from_b1:
b2_from_b2:
// [217] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
jmp b2
// memset::@2
b2:
// [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuz2
lda c
ldy #0
@ -5925,13 +5959,13 @@ memset: {
bne !+
inc dst+1
!:
// [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1_from_b1
bne b2_from_b2
lda dst
cmp end
bne b1_from_b1
bne b2_from_b2
jmp breturn
// memset::@return
breturn:
@ -6057,12 +6091,12 @@ Statement [202] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ div
Statement [206] if((word) divr16u::rem#6<(const word) XSIN_SIZE#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a
Statement [208] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) XSIN_SIZE#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a
Statement [212] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::return#0 rem16u#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a
Statement [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:13 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:15 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:3::memset:13 [ memset::str#3 memset::c#3 memset::end#0 ] main:3::memset:15 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:54 [ memset::c#3 ]
Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:54 [ memset::c#3 ]
Statement [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [6] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main:3 [ ] ) always clobbers reg byte a
@ -6163,10 +6197,10 @@ Statement [202] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ div
Statement [206] if((word) divr16u::rem#6<(const word) XSIN_SIZE#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a
Statement [208] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) XSIN_SIZE#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a
Statement [212] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::return#0 rem16u#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a
Statement [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:13 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:15 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:3::memset:13 [ memset::str#3 memset::c#3 memset::end#0 ] main:3::memset:15 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] : zp ZP_WORD:3 ,
Potential registers zp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] : zp ZP_BYTE:5 , reg byte x , reg byte y ,
@ -6191,7 +6225,7 @@ Potential registers zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#
Potential registers zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] : zp ZP_WORD:47 ,
Potential registers zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] : zp ZP_WORD:49 ,
Potential registers zp ZP_BYTE:51 [ divr16u::i#2 divr16u::i#1 ] : zp ZP_BYTE:51 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:52 [ memset::str#2 ] : zp ZP_WORD:52 ,
Potential registers zp ZP_WORD:52 [ memset::str#3 ] : zp ZP_WORD:52 ,
Potential registers zp ZP_BYTE:54 [ memset::c#3 ] : zp ZP_BYTE:54 , reg byte x ,
Potential registers zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] : zp ZP_WORD:55 ,
Potential registers zp ZP_WORD:57 [ loop::$5 ] : zp ZP_WORD:57 ,
@ -6264,62 +6298,62 @@ Uplift Scope [mulu16_sel] 24: zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3
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 ]
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#3 ]
Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ]
Uplift Scope [] 26.12: zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] 0.8: zp ZP_WORD:177 [ rem16u#1 ]
Uplift Scope [div32u16u] 4: zp ZP_DWORD:82 [ div32u16u::return#2 ] 4: zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] 1.33: zp ZP_DWORD:171 [ div32u16u::return#0 ] 0.8: zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ]
Uplifting [mul16u] best 74992 combination zp ZP_DWORD:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp ZP_WORD:21 [ mul16u::b#1 ] zp ZP_DWORD:104 [ mul16u::return#2 ] zp ZP_DWORD:149 [ mul16u::return#3 ]
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::$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 ]
Uplifting [main] best 74630 combination reg byte x [ main::ch#2 main::ch#1 ]
Uplifting [] best 74630 combination zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp ZP_WORD:177 [ rem16u#1 ]
Uplifting [div32u16u] best 74630 combination zp ZP_DWORD:82 [ div32u16u::return#2 ] zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:171 [ div32u16u::return#0 ] zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ]
Uplifting [mul16u] best 75022 combination zp ZP_DWORD:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp ZP_WORD:21 [ mul16u::b#1 ] zp ZP_DWORD:104 [ mul16u::return#2 ] zp ZP_DWORD:149 [ mul16u::return#3 ]
Uplifting [divr16u] best 74812 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 74812 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 74796 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 74796 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 74796 combination zp ZP_WORD:57 [ loop::$5 ] zp ZP_WORD:59 [ loop::$1 ] zp ZP_WORD:61 [ loop::xpos#0 ]
Uplifting [mul16s] best 74796 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 74780 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#3 ]
Uplifting [main] best 74660 combination reg byte x [ main::ch#2 main::ch#1 ]
Uplifting [] best 74660 combination zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp ZP_WORD:177 [ rem16u#1 ]
Uplifting [div32u16u] best 74660 combination zp ZP_DWORD:82 [ div32u16u::return#2 ] zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:171 [ div32u16u::return#0 ] zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ]
Uplifting [render_logo] best 69530 combination reg byte y [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ]
Uplifting [render_logo] best 69560 combination reg byte y [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ]
Attempting to uplift remaining variables inzp ZP_BYTE:8 [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ]
Uplifting [render_logo] best 64730 combination reg byte y [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ]
Uplifting [render_logo] best 64760 combination reg byte y [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ]
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ]
Uplifting [render_logo] best 64730 combination zp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ]
Uplifting [render_logo] best 64760 combination zp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ]
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ]
Uplifting [render_logo] best 64730 combination zp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ]
Uplifting [render_logo] best 64760 combination zp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ]
Attempting to uplift remaining variables inzp ZP_BYTE:71 [ render_logo::$33 ]
Uplifting [render_logo] best 64330 combination reg byte a [ render_logo::$33 ]
Uplifting [render_logo] best 64360 combination reg byte a [ render_logo::$33 ]
Attempting to uplift remaining variables inzp ZP_BYTE:72 [ render_logo::$36 ]
Uplifting [render_logo] best 63930 combination reg byte a [ render_logo::$36 ]
Uplifting [render_logo] best 63960 combination reg byte a [ render_logo::$36 ]
Attempting to uplift remaining variables inzp ZP_BYTE:73 [ render_logo::$39 ]
Uplifting [render_logo] best 63530 combination reg byte a [ render_logo::$39 ]
Uplifting [render_logo] best 63560 combination reg byte a [ render_logo::$39 ]
Attempting to uplift remaining variables inzp ZP_BYTE:74 [ render_logo::$42 ]
Uplifting [render_logo] best 63130 combination reg byte a [ render_logo::$42 ]
Uplifting [render_logo] best 63160 combination reg byte a [ render_logo::$42 ]
Attempting to uplift remaining variables inzp ZP_BYTE:75 [ render_logo::$45 ]
Uplifting [render_logo] best 62730 combination reg byte a [ render_logo::$45 ]
Uplifting [render_logo] best 62760 combination reg byte a [ render_logo::$45 ]
Attempting to uplift remaining variables inzp ZP_BYTE:77 [ render_logo::$73 ]
Uplifting [render_logo] best 62330 combination reg byte a [ render_logo::$73 ]
Uplifting [render_logo] best 62360 combination reg byte a [ render_logo::$73 ]
Attempting to uplift remaining variables inzp ZP_BYTE:78 [ render_logo::$76 ]
Uplifting [render_logo] best 61930 combination reg byte a [ render_logo::$76 ]
Uplifting [render_logo] best 61960 combination reg byte a [ render_logo::$76 ]
Attempting to uplift remaining variables inzp ZP_BYTE:79 [ render_logo::$79 ]
Uplifting [render_logo] best 61530 combination reg byte a [ render_logo::$79 ]
Uplifting [render_logo] best 61560 combination reg byte a [ render_logo::$79 ]
Attempting to uplift remaining variables inzp ZP_BYTE:80 [ render_logo::$82 ]
Uplifting [render_logo] best 61130 combination reg byte a [ render_logo::$82 ]
Uplifting [render_logo] best 61160 combination reg byte a [ render_logo::$82 ]
Attempting to uplift remaining variables inzp ZP_BYTE:81 [ render_logo::$85 ]
Uplifting [render_logo] best 60730 combination reg byte a [ render_logo::$85 ]
Uplifting [render_logo] best 60760 combination reg byte a [ render_logo::$85 ]
Attempting to uplift remaining variables inzp ZP_BYTE:65 [ render_logo::$0 ]
Uplifting [render_logo] best 60724 combination reg byte a [ render_logo::$0 ]
Uplifting [render_logo] best 60754 combination reg byte a [ render_logo::$0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:66 [ render_logo::$1 ]
Uplifting [render_logo] best 60718 combination reg byte a [ render_logo::$1 ]
Uplifting [render_logo] best 60748 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 ]
Uplifting [render_logo] best 60742 combination reg byte a [ render_logo::$2 ]
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 ]
Uplifting [render_logo] best 60736 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 ]
Uplifting [render_logo] best 60736 combination zp ZP_BYTE:70 [ render_logo::x_char#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:33 [ sin16s::isUpper#2 ]
Uplifting [sin16s] best 60706 combination zp ZP_BYTE:33 [ sin16s::isUpper#2 ]
Uplifting [sin16s] best 60736 combination zp ZP_BYTE:33 [ sin16s::isUpper#2 ]
Coalescing zero page register with common assignment [ zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp ZP_WORD:147 [ sin16s::usinx#1 ] ] - score: 2
Coalescing zero page register with common assignment [ 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 ] ] with [ zp ZP_WORD:129 [ sin16s::x3#0 ] ] - score: 2
Coalescing zero page register with common assignment [ 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 ] ] with [ zp ZP_WORD:177 [ rem16u#1 ] ] - score: 2
@ -6333,7 +6367,7 @@ Coalescing zero page register with common assignment [ zp ZP_WORD:40 [ mulu16_se
Coalescing zero page register with common assignment [ 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 sin16s::x3#0 sin16s::x2#0 ] ] with [ zp ZP_WORD:139 [ sin16s::x4#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] ] with [ zp ZP_WORD:163 [ divr16u::return#2 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 ] ] with [ zp ZP_WORD:167 [ divr16u::return#3 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:52 [ memset::str#2 ] ] with [ zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:52 [ memset::str#3 ] ] with [ zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:57 [ loop::$5 ] ] with [ zp ZP_WORD:59 [ loop::$1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:61 [ loop::xpos#0 ] ] with [ zp ZP_WORD:63 [ render_logo::xpos#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:82 [ div32u16u::return#2 ] ] with [ zp ZP_DWORD:86 [ sin16s_gen2::step#0 ] ] - score: 1
@ -6373,7 +6407,7 @@ Allocated (was zp ZP_WORD:40) zp ZP_WORD:33 [ mulu16_sel::v1#5 mulu16_sel::v1#3
Allocated (was zp ZP_WORD:45) zp ZP_WORD:35 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 ]
Allocated (was zp ZP_WORD:47) zp ZP_WORD:37 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
Allocated (was zp ZP_WORD:49) zp ZP_WORD:39 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ]
Allocated (was zp ZP_WORD:52) zp ZP_WORD:41 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated (was zp ZP_WORD:52) zp ZP_WORD:41 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated (was zp ZP_WORD:57) zp ZP_WORD:43 [ loop::$5 loop::$1 loop::xpos#0 render_logo::xpos#0 ]
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 ]
@ -6472,7 +6506,7 @@ main: {
memset_from_b3:
// [214] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuxx=vbuc1
ldx #BLACK
// [214] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
// [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
lda #<SCREEN
sta memset.str
lda #>SCREEN
@ -6488,7 +6522,7 @@ main: {
memset_from_b4:
// [214] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuxx=vbuc1
ldx #WHITE|8
// [214] phi (void*) memset::str#2 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
// [214] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
lda #<COLS
sta memset.str
lda #>COLS
@ -7753,7 +7787,10 @@ memset: {
.label end = $3e
.label dst = $29
.label str = $29
// [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
jmp b1
// memset::@1
b1:
// [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
lda str
clc
adc #<$3e8
@ -7761,14 +7798,14 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
// [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
// [217] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
b1_from_memset:
b1_from_b1:
// [217] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
jmp b1
// memset::@1
b1:
// [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
// [217] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
b2_from_b1:
b2_from_b2:
// [217] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
jmp b2
// memset::@2
b2:
// [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
txa
ldy #0
@ -7778,13 +7815,13 @@ memset: {
bne !+
inc dst+1
!:
// [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1_from_b1
bne b2_from_b2
lda dst
cmp end
bne b1_from_b1
bne b2_from_b2
jmp breturn
// memset::@return
breturn:
@ -7887,6 +7924,7 @@ Removing instruction jmp b3
Removing instruction jmp b6
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda BGCOL2
@ -7916,8 +7954,8 @@ Replacing label b2_from_b1 with b2
Replacing label b3_from_b2 with b3
Replacing label b3_from_b2 with b3
Replacing label b1_from_b3 with b1
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b2_from_b2 with b2
Replacing label b2_from_b2 with b2
Removing instruction b1:
Removing instruction b2_from_b1:
Removing instruction b2:
@ -7956,8 +7994,8 @@ Removing instruction b2_from_b4:
Removing instruction b3_from_b2:
Removing instruction b3_from_b5:
Removing instruction breturn:
Removing instruction b1_from_memset:
Removing instruction b1_from_b1:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b3:
@ -8039,6 +8077,7 @@ Removing instruction b1_from_divr16u:
Removing instruction b4:
Removing instruction b5:
Removing instruction b6:
Removing instruction b1:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
@ -8201,6 +8240,7 @@ FINAL SYMBOL TABLE
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
@ -8213,7 +8253,7 @@ FINAL SYMBOL TABLE
(word) memset::num
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:41
(void*) memset::str#3 str zp ZP_WORD:41
(signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b)
(word~) mul16s::$16 $16 zp ZP_WORD:54 4.0
(word~) mul16s::$9 $9 zp ZP_WORD:54 4.0
@ -8460,7 +8500,7 @@ zp ZP_WORD:35 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 di
zp ZP_WORD:37 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
zp ZP_WORD:39 [ 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_WORD:41 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:41 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
zp ZP_WORD:43 [ loop::$5 loop::$1 loop::xpos#0 render_logo::xpos#0 ]
reg byte a [ render_logo::$0 ]
@ -8572,7 +8612,7 @@ main: {
// [214] phi from main::@3 to memset [phi:main::@3->memset]
// [214] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuxx=vbuc1
ldx #BLACK
// [214] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
// [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
lda #<SCREEN
sta memset.str
lda #>SCREEN
@ -8585,7 +8625,7 @@ main: {
// [214] phi from main::@4 to memset [phi:main::@4->memset]
// [214] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuxx=vbuc1
ldx #WHITE|8
// [214] phi (void*) memset::str#2 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
// [214] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
lda #<COLS
sta memset.str
lda #>COLS
@ -9777,8 +9817,9 @@ memset: {
.label end = $3e
.label dst = $29
.label str = $29
// memset::@1
// end = (char*)str + num
// [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
// [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
lda str
clc
adc #<$3e8
@ -9786,11 +9827,11 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
// [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
// [217] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
// [217] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
// memset::@1
b1:
// [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
// [217] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
// [217] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
// memset::@2
b2:
// *dst = c
// [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
txa
@ -9802,13 +9843,13 @@ memset: {
bne !+
inc dst+1
!:
// [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
// memset::@return
// }
// [221] return

View File

@ -125,6 +125,7 @@
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
@ -137,7 +138,7 @@
(word) memset::num
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:41
(void*) memset::str#3 str zp ZP_WORD:41
(signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b)
(word~) mul16s::$16 $16 zp ZP_WORD:54 4.0
(word~) mul16s::$9 $9 zp ZP_WORD:54 4.0
@ -384,7 +385,7 @@ zp ZP_WORD:35 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 di
zp ZP_WORD:37 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
zp ZP_WORD:39 [ 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_WORD:41 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:41 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
zp ZP_WORD:43 [ loop::$5 loop::$1 loop::xpos#0 render_logo::xpos#0 ]
reg byte a [ render_logo::$0 ]

View File

@ -31,24 +31,24 @@ main: {
lda #VIC_MCM|VIC_CSEL
sta D016
ldx #BLACK
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
jsr memset
ldx #WHITE|8
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
ldx #WHITE|8
lda #<COLS
sta memset.str
lda #>COLS
sta memset.str+1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
ldx #0
b1:
@ -63,12 +63,16 @@ main: {
jmp b2
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(2) str, byte register(X) c, word zeropage(4) num)
// memset(void* zeropage(4) str, byte register(X) c, word zeropage(2) num)
memset: {
.label end = 4
.label dst = 2
.label str = 2
.label num = 4
.label end = 2
.label dst = 4
.label num = 2
.label str = 4
lda num
beq breturn
lda num+1
beq breturn
lda end
clc
adc str
@ -76,7 +80,7 @@ memset: {
lda end+1
adc str+1
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -86,10 +90,11 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
breturn:
rts
}
.pc = LOGO "LOGO"

View File

@ -45,17 +45,20 @@ main::@2: scope:[main] from main::@1 main::@2
to:main::@2
memset: scope:[memset] from main::@3 main::@4
[21] (byte) memset::c#3 ← phi( main::@4/(const byte) WHITE#0|(byte) 8 main::@3/(const byte) BLACK#0 )
[21] (void*) memset::str#3 ← phi( main::@4/(void*)(const byte*) COLS#0 main::@3/(void*)(const byte*) SCREEN#0 )
[21] (word) memset::num#2 ← phi( main::@4/(word)(number) $28*(number) $19 main::@3/(word)(number) $28*(number) $19 )
[21] (void*) memset::str#2 ← phi( main::@4/(void*)(const byte*) COLS#0 main::@3/(void*)(const byte*) SCREEN#0 )
[22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[22] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[24] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[25] *((byte*) memset::dst#2) ← (byte) memset::c#3
[26] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
memset::@1: scope:[memset] from memset
[23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[25] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[26] *((byte*) memset::dst#2) ← (byte) memset::c#3
[27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[28] return
memset::@return: scope:[memset] from memset memset::@2
[29] return
to:@return

View File

@ -9,6 +9,7 @@ Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) memset::@5
Culled Empty Block (label) memset::@3
Culled Empty Block (label) @7
Culled Empty Block (label) main::toD0181_@1
@ -34,30 +35,38 @@ CONTROL FLOW GRAPH SSA
(byte) DARK_GREY#0 ← (number) $b
to:@8
memset: scope:[memset] from main::@10 main::@9
(byte) memset::c#3 ← phi( main::@10/(byte) memset::c#1 main::@9/(byte) memset::c#0 )
(byte) memset::c#4 ← phi( main::@10/(byte) memset::c#1 main::@9/(byte) memset::c#0 )
(void*) memset::str#4 ← phi( main::@10/(void*) memset::str#1 main::@9/(void*) memset::str#0 )
(word) memset::num#2 ← phi( main::@10/(word) memset::num#1 main::@9/(word) memset::num#0 )
(void*) memset::str#2 ← phi( main::@10/(void*) memset::str#1 main::@9/(void*) memset::str#0 )
(byte*~) memset::$0 ← ((byte*)) (void*) memset::str#2
(byte*~) memset::$1 ← (byte*~) memset::$0 + (word) memset::num#2
(byte*) memset::end#0 ← (byte*~) memset::$1
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
(void*) memset::str#4 ← phi( memset/(void*) memset::str#2 memset::@1/(void*) memset::str#4 )
(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#2 ← phi( memset/(byte) memset::c#3 memset::@1/(byte) memset::c#2 )
(bool~) memset::$0 ← (word) memset::num#2 > (number) 0
(bool~) memset::$1 ← ! (bool~) memset::$0
if((bool~) memset::$1) goto memset::@1
to:memset::@2
memset::@1: scope:[memset] from memset memset::@4
(void*) memset::str#2 ← phi( memset/(void*) memset::str#4 memset::@4/(void*) memset::str#5 )
(void*) memset::return#0 ← (void*) memset::str#2
to:memset::@return
memset::@2: scope:[memset] from memset
(byte) memset::c#3 ← phi( memset/(byte) memset::c#4 )
(word) memset::num#3 ← phi( memset/(word) memset::num#2 )
(void*) memset::str#3 ← phi( memset/(void*) memset::str#4 )
(byte*~) memset::$2 ← ((byte*)) (void*) memset::str#3
(byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#3
(byte*) memset::end#0 ← (byte*~) memset::$3
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#3
to:memset::@4
memset::@4: scope:[memset] from memset::@2 memset::@4
(void*) memset::str#5 ← phi( memset::@2/(void*) memset::str#3 memset::@4/(void*) memset::str#5 )
(byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@4/(byte*) memset::end#1 )
(byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@4/(byte*) memset::dst#1 )
(byte) memset::c#2 ← phi( memset::@2/(byte) memset::c#3 memset::@4/(byte) memset::c#2 )
*((byte*) memset::dst#2) ← (byte) memset::c#2
(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#3 ← phi( memset::@1/(void*) memset::str#4 )
(void*) memset::return#0 ← (void*) memset::str#3
to:memset::@return
memset::@return: scope:[memset] from memset::@2
(void*) memset::return#4 ← phi( memset::@2/(void*) memset::return#0 )
(bool~) memset::$4 ← (byte*) memset::dst#1 != (byte*) memset::end#1
if((bool~) memset::$4) goto memset::@4
to:memset::@1
memset::@return: scope:[memset] from memset::@1
(void*) memset::return#4 ← phi( memset::@1/(void*) memset::return#0 )
(void*) memset::return#1 ← (void*) memset::return#4
return
to:@return
@ -228,17 +237,21 @@ SYMBOL TABLE SSA
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte*~) memset::$0
(byte*~) memset::$1
(bool~) memset::$2
(bool~) memset::$0
(bool~) memset::$1
(byte*~) memset::$2
(byte*~) memset::$3
(bool~) memset::$4
(label) memset::@1
(label) memset::@2
(label) memset::@4
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte) memset::c#3
(byte) memset::c#4
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
@ -250,6 +263,7 @@ SYMBOL TABLE SSA
(word) memset::num#0
(word) memset::num#1
(word) memset::num#2
(word) memset::num#3
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
@ -262,12 +276,14 @@ SYMBOL TABLE SSA
(void*) memset::str#2
(void*) memset::str#3
(void*) memset::str#4
(void*) memset::str#5
Adding number conversion cast (unumber) $10 in (byte) VIC_MCM#0 ← (number) $10
Adding number conversion cast (unumber) 8 in (byte) VIC_CSEL#0 ← (number) 8
Adding number conversion cast (unumber) 0 in (byte) BLACK#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (byte) WHITE#0 ← (number) 1
Adding number conversion cast (unumber) $b in (byte) DARK_GREY#0 ← (number) $b
Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#2 > (number) 0
Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0181_$1#0 in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (number) 4
@ -296,8 +312,8 @@ Inlining cast (byte*) COLS#0 ← (byte*)(number) $d800
Inlining cast (byte) BLACK#0 ← (unumber)(number) 0
Inlining cast (byte) WHITE#0 ← (unumber)(number) 1
Inlining cast (byte) DARK_GREY#0 ← (unumber)(number) $b
Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte*) LOGO#0 ← (byte*)(number) $2000
Inlining cast (word~) main::toD0181_$0#0 ← (word)(byte*) main::toD0181_screen#1
@ -317,6 +333,7 @@ Simplifying constant pointer cast (byte*) 55296
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast $b
Simplifying constant integer cast 0
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 8192
Simplifying constant integer cast $3fff
@ -331,6 +348,7 @@ Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $3fff
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
@ -345,8 +363,13 @@ Inferred type updated to byte in (unumber~) main::toD0181_$6#0 ← (byte~) main:
Inferred type updated to byte in (unumber~) main::toD0181_$7#0 ← (byte~) main::toD0181_$6#0 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0181_$8#0 ← (byte~) main::toD0181_$3#0 | (byte~) main::toD0181_$7#0
Inferred type updated to byte in (unumber~) main::$3 ← (byte) WHITE#0 | (byte) 8
Alias (byte*) memset::end#0 = (byte*~) memset::$1
Alias (void*) memset::return#0 = (void*) memset::str#3 (void*) memset::str#4 (void*) memset::return#4 (void*) memset::return#1
Inversing boolean not [14] (bool~) memset::$1 ← (word) memset::num#2 <= (byte) 0 from [13] (bool~) memset::$0 ← (word) memset::num#2 > (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (void*) memset::return#0 = (void*) memset::str#2 (void*) memset::return#4 (void*) memset::return#1
Alias (void*) memset::str#3 = (void*) memset::str#4
Alias (word) memset::num#2 = (word) memset::num#3
Alias (byte) memset::c#3 = (byte) memset::c#4
Alias (byte*) memset::end#0 = (byte*~) memset::$3
Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1
Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1
Alias (byte) main::toD0181_return#0 = (byte~) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0
@ -354,17 +377,20 @@ Alias (byte) memset::c#1 = (byte~) main::$3
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) memset::c#2
Self Phi Eliminated (byte*) memset::end#1
Self Phi Eliminated (void*) memset::return#0
Self Phi Eliminated (void*) memset::str#5
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte) memset::c#2 (byte) memset::c#3
Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0
Identical Phi Values (void*) memset::return#0 (void*) memset::str#2
Identical Phi Values (void*) memset::str#5 (void*) memset::str#3
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$2 [21] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
Simple Condition (bool~) main::$5 [70] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1
Identical Phi Values (void*) memset::return#0 (void*) memset::str#3
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$1 [15] if((word) memset::num#2<=(byte) 0) goto memset::@1
Simple Condition (bool~) memset::$4 [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@4
Simple Condition (bool~) main::$5 [74] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [56] (word) memset::num#0 ← (unumber)(number) $28*(number) $19
Constant right-side identified [62] (word) memset::num#1 ← (unumber)(number) $28*(number) $19
Constant right-side identified [60] (word) memset::num#0 ← (unumber)(number) $28*(number) $19
Constant right-side identified [66] (word) memset::num#1 ← (unumber)(number) $28*(number) $19
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) BORDERCOL#0 = (byte*) 53280
Constant (const byte*) BGCOL#0 = (byte*) 53281
@ -388,17 +414,17 @@ Constant (const byte*) main::toD0181_screen#0 = SCREEN#0
Constant (const byte*) main::toD0181_gfx#0 = LOGO#0
Constant (const byte) memset::c#0 = BLACK#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word)main::toD0181_screen#0 in [37] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [41] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (void*)SCREEN#0 in [54] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0
Constant value identified (void*)COLS#0 in [60] (void*) memset::str#1 ← (void*)(const byte*) COLS#0
Constant value identified (word)main::toD0181_screen#0 in [41] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [45] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (void*)SCREEN#0 in [58] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0
Constant value identified (void*)COLS#0 in [64] (void*) memset::str#1 ← (void*)(const byte*) COLS#0
Successful SSA optimization Pass2ConstantValues
if() condition always true - replacing block destination [71] if(true) goto main::@4
if() condition always true - replacing block destination [75] if(true) goto main::@4
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [68] main::ch#1 ← ++ main::ch#2 to ++
Resolved ranged comparison value [70] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0
Eliminating unused variable (void*) memset::return#2 and assignment [28] (void*) memset::return#2 ← (void*) memset::str#2
Eliminating unused variable (void*) memset::return#3 and assignment [32] (void*) memset::return#3 ← (void*) memset::str#2
Resolved ranged next value [72] main::ch#1 ← ++ main::ch#2 to ++
Resolved ranged comparison value [74] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0
Eliminating unused variable (void*) memset::return#2 and assignment [29] (void*) memset::return#2 ← (void*) memset::str#3
Eliminating unused variable (void*) memset::return#3 and assignment [33] (void*) memset::return#3 ← (void*) memset::str#3
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
@ -408,9 +434,9 @@ Simplifying constant integer cast $f0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $f0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [24] (byte~) main::$1 ← (const byte) VIC_MCM#0 | (const byte) VIC_CSEL#0
Constant right-side identified [28] (byte) memset::c#1 ← (const byte) WHITE#0 | (byte) 8
Constant right-side identified [35] (byte*~) main::$8 ← (const byte*) SCREEN#0 + (word) $3e7
Constant right-side identified [25] (byte~) main::$1 ← (const byte) VIC_MCM#0 | (const byte) VIC_CSEL#0
Constant right-side identified [29] (byte) memset::c#1 ← (const byte) WHITE#0 | (byte) 8
Constant right-side identified [36] (byte*~) main::$8 ← (const byte*) SCREEN#0 + (word) $3e7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$0#0 = (word)main::toD0181_screen#0
Constant (const word) main::toD0181_$4#0 = (word)main::toD0181_gfx#0
@ -420,30 +446,30 @@ Constant (const byte) memset::c#1 = WHITE#0|8
Constant (const void*) memset::str#1 = (void*)COLS#0
Constant (const byte*) main::$8 = SCREEN#0+$3e7
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [14] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [17] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Constant right-side identified [15] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [18] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Successful SSA optimization Pass2ConstantRValueConsolidation
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 right-side identified [14] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [16] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Constant right-side identified [15] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [17] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0*4
Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0/4
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [14] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0
Constant right-side identified [15] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f
Constant right-side identified [15] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0
Constant right-side identified [16] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0
Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [14] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0
Constant right-side identified [15] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0
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 [2] (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Inlining Noop Cast [4] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const word) memset::num#0
Inlining constant with var siblings (const word) memset::num#1
@ -472,7 +498,7 @@ Constant inlined memset::c#1 = (const byte) WHITE#0|(byte) 8
Constant inlined main::ch#0 = (byte) 0
Constant inlined main::$8 = (const byte*) SCREEN#0+(word) $3e7
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting memset::@4(between memset::@1 and memset::@1)
Added new block during phi lifting memset::@6(between memset::@4 and memset::@4)
Added new block during phi lifting main::@12(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @9
@ -483,24 +509,26 @@ Adding NOP phi() at start of main::toD0181_@return
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of main::@11
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of memset::@2
Adding NOP phi() at start of memset::@1
CALL GRAPH
Calls in [] to main:3
Calls in [main] to memset:14 memset:16
Created 5 initial phi equivalence classes
Coalesced [25] main::ch#3 ← main::ch#1
Coalesced [35] memset::dst#4 ← memset::dst#1
Coalesced [36] memset::dst#4 ← memset::dst#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @10
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@12
Culled Empty Block (label) memset::@2
Culled Empty Block (label) memset::@4
Culled Empty Block (label) memset::@1
Culled Empty Block (label) memset::@6
Renumbering block @8 to @1
Renumbering block @9 to @2
Renumbering block memset::@2 to memset::@1
Renumbering block memset::@4 to memset::@2
Renumbering block main::@4 to main::@2
Renumbering block main::@9 to main::@3
Renumbering block main::@10 to main::@4
@ -558,19 +586,22 @@ main::@2: scope:[main] from main::@1 main::@2
to:main::@2
memset: scope:[memset] from main::@3 main::@4
[21] (byte) memset::c#3 ← phi( main::@4/(const byte) WHITE#0|(byte) 8 main::@3/(const byte) BLACK#0 )
[21] (void*) memset::str#3 ← phi( main::@4/(void*)(const byte*) COLS#0 main::@3/(void*)(const byte*) SCREEN#0 )
[21] (word) memset::num#2 ← phi( main::@4/(word)(number) $28*(number) $19 main::@3/(word)(number) $28*(number) $19 )
[21] (void*) memset::str#2 ← phi( main::@4/(void*)(const byte*) COLS#0 main::@3/(void*)(const byte*) SCREEN#0 )
[22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[22] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[24] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[25] *((byte*) memset::dst#2) ← (byte) memset::c#3
[26] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
memset::@1: scope:[memset] from memset
[23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[25] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[26] *((byte*) memset::dst#2) ← (byte) memset::c#3
[27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[28] return
memset::@return: scope:[memset] from memset memset::@2
[29] return
to:@return
@ -607,7 +638,7 @@ VARIABLE REGISTER WEIGHTS
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte) memset::c
(byte) memset::c#3 1.5714285714285714
(byte) memset::c#3 1.375
(byte*) memset::dst
(byte*) memset::dst#1 16.5
(byte*) memset::dst#2 17.5
@ -618,25 +649,25 @@ VARIABLE REGISTER WEIGHTS
(word) memset::num#2 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2
(void*) memset::str#3
Initial phi equivalence classes
[ main::ch#2 main::ch#1 ]
[ memset::str#2 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
Added variable memset::end#0 to zero page equivalence class [ memset::end#0 ]
Complete equivalence classes
[ main::ch#2 main::ch#1 ]
[ memset::str#2 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
[ memset::end#0 ]
Allocated zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ]
Allocated zp ZP_WORD:3 [ memset::str#2 ]
Allocated zp ZP_WORD:5 [ memset::num#2 ]
Allocated zp ZP_WORD:3 [ memset::num#2 ]
Allocated zp ZP_WORD:5 [ memset::str#3 ]
Allocated zp ZP_BYTE:7 [ memset::c#3 ]
Allocated zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated zp ZP_WORD:10 [ memset::end#0 ]
@ -718,16 +749,16 @@ main: {
// [21] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuz1=vbuc1
lda #BLACK
sta memset.c
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#1] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
// [21] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#2] -- pvoz1=pvoc1
// [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
// [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
@ -740,16 +771,16 @@ main: {
// [21] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuz1=vbuc1
lda #WHITE|8
sta memset.c
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#1] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
// [21] phi (void*) memset::str#2 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#2] -- pvoz1=pvoc1
// [21] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
lda #<COLS
sta memset.str
lda #>COLS
sta memset.str+1
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
// [15] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
b1_from_b4:
@ -784,14 +815,22 @@ main: {
}
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(3) str, byte zeropage(7) c, word zeropage(5) num)
// memset(void* zeropage(5) str, byte zeropage(7) c, word zeropage(3) num)
memset: {
.label end = $a
.label dst = 8
.label str = 3
.label num = 5
.label num = 3
.label str = 5
.label c = 7
// [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3
// [22] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1
lda num
beq breturn
lda num+1
beq breturn
jmp b1
// memset::@1
b1:
// [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3
lda str
clc
adc num
@ -799,38 +838,38 @@ memset: {
lda str+1
adc num+1
sta end+1
// [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 -- pbuz1=pbuz2
// [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2
lda str
sta dst
lda str+1
sta dst+1
// [24] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
b1_from_memset:
b1_from_b1:
// [24] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
jmp b1
// memset::@1
b1:
// [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuz2
// [25] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
b2_from_b1:
b2_from_b2:
// [25] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
jmp b2
// memset::@2
b2:
// [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuz2
lda c
ldy #0
sta (dst),y
// [26] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
// [27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc dst
bne !+
inc dst+1
!:
// [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1_from_b1
bne b2_from_b2
lda dst
cmp end
bne b1_from_b1
bne b2_from_b2
jmp breturn
// memset::@return
breturn:
// [28] return
// [29] return
rts
}
// File Data
@ -849,41 +888,43 @@ Statement [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main:
Statement [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [22] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#3 ] ( main:3::memset:12 [ memset::num#2 memset::str#3 memset::c#3 ] main:3::memset:14 [ memset::num#2 memset::str#3 memset::c#3 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ memset::c#3 ]
Statement [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#3 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ memset::c#3 ]
Statement [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [22] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#3 ] ( main:3::memset:12 [ memset::num#2 memset::str#3 memset::c#3 ] main:3::memset:14 [ memset::num#2 memset::str#3 memset::c#3 ] ) always clobbers reg byte a
Statement [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#3 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:3 [ memset::str#2 ] : zp ZP_WORD:3 ,
Potential registers zp ZP_WORD:5 [ memset::num#2 ] : zp ZP_WORD:5 ,
Potential registers zp ZP_WORD:3 [ memset::num#2 ] : zp ZP_WORD:3 ,
Potential registers zp ZP_WORD:5 [ memset::str#3 ] : zp ZP_WORD:5 ,
Potential registers zp ZP_BYTE:7 [ memset::c#3 ] : zp ZP_BYTE:7 , reg byte x ,
Potential registers zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] : zp ZP_WORD:8 ,
Potential registers zp ZP_WORD:10 [ memset::end#0 ] : zp ZP_WORD:10 ,
REGISTER UPLIFT SCOPES
Uplift Scope [memset] 38: zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:10 [ memset::end#0 ] 2: zp ZP_WORD:5 [ memset::num#2 ] 1.57: zp ZP_BYTE:7 [ memset::c#3 ] 0: zp ZP_WORD:3 [ memset::str#2 ]
Uplift Scope [memset] 38: zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:10 [ memset::end#0 ] 2: zp ZP_WORD:3 [ memset::num#2 ] 1.38: zp ZP_BYTE:7 [ memset::c#3 ] 0: zp ZP_WORD:5 [ memset::str#3 ]
Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ]
Uplift Scope []
Uplifting [memset] best 6240 combination zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:10 [ memset::end#0 ] zp ZP_WORD:5 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:3 [ memset::str#2 ]
Uplifting [main] best 6120 combination reg byte x [ main::ch#2 main::ch#1 ]
Uplifting [] best 6120 combination
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ memset::str#2 ] ] with [ zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ memset::num#2 ] ] with [ zp ZP_WORD:10 [ memset::end#0 ] ] - score: 1
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ memset::num#2 memset::end#0 ]
Uplifting [memset] best 6254 combination zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:10 [ memset::end#0 ] zp ZP_WORD:3 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:5 [ memset::str#3 ]
Uplifting [main] best 6134 combination reg byte x [ main::ch#2 main::ch#1 ]
Uplifting [] best 6134 combination
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ memset::num#2 ] ] with [ zp ZP_WORD:10 [ memset::end#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ memset::str#3 ] ] with [ zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ memset::num#2 memset::end#0 ]
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -960,16 +1001,16 @@ main: {
memset_from_b3:
// [21] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuxx=vbuc1
ldx #BLACK
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#1] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
// [21] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#2] -- pvoz1=pvoc1
// [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
// [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
@ -981,16 +1022,16 @@ main: {
memset_from_b4:
// [21] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuxx=vbuc1
ldx #WHITE|8
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#1] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
// [21] phi (void*) memset::str#2 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#2] -- pvoz1=pvoc1
// [21] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
lda #<COLS
sta memset.str
lda #>COLS
sta memset.str+1
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
// [15] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
b1_from_b4:
@ -1022,13 +1063,21 @@ main: {
}
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(2) str, byte register(X) c, word zeropage(4) num)
// memset(void* zeropage(4) str, byte register(X) c, word zeropage(2) num)
memset: {
.label end = 4
.label dst = 2
.label str = 2
.label num = 4
// [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1
.label end = 2
.label dst = 4
.label num = 2
.label str = 4
// [22] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1
lda num
beq breturn
lda num+1
beq breturn
jmp b1
// memset::@1
b1:
// [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1
lda end
clc
adc str
@ -1036,34 +1085,34 @@ memset: {
lda end+1
adc str+1
sta end+1
// [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
// [24] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
b1_from_memset:
b1_from_b1:
// [24] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
jmp b1
// memset::@1
b1:
// [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
// [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
// [25] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
b2_from_b1:
b2_from_b2:
// [25] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
jmp b2
// memset::@2
b2:
// [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
txa
ldy #0
sta (dst),y
// [26] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
// [27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc dst
bne !+
inc dst+1
!:
// [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1_from_b1
bne b2_from_b2
lda dst
cmp end
bne b1_from_b1
bne b2_from_b2
jmp breturn
// memset::@return
breturn:
// [28] return
// [29] return
rts
}
// File Data
@ -1085,13 +1134,14 @@ Removing instruction jmp b4
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda BGCOL2
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b2_from_b2 with b2
Replacing label b2_from_b2 with b2
Removing instruction b1:
Removing instruction b2_from_b1:
Removing instruction b2:
@ -1101,15 +1151,15 @@ Removing instruction toD0181:
Removing instruction b4_from_b3:
Removing instruction memset_from_b4:
Removing instruction b1_from_b1:
Removing instruction b1_from_memset:
Removing instruction b1_from_b1:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b3:
Removing instruction memset_from_b3:
Removing instruction b4:
Removing instruction b1_from_b4:
Removing instruction breturn:
Removing instruction b1:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
@ -1176,29 +1226,30 @@ FINAL SYMBOL TABLE
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:2 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:2 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:2 4.0
(byte*) memset::dst#1 dst zp ZP_WORD:4 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:4 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:4 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:4 2.1666666666666665
(byte*) memset::end#0 end zp ZP_WORD:2 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:4 2.0
(word) memset::num#2 num zp ZP_WORD:2 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:2
(void*) memset::str#3 str zp ZP_WORD:4
reg byte x [ main::ch#2 main::ch#1 ]
zp ZP_WORD:2 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:4 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:2 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:4 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
FINAL ASSEMBLER
Score: 5876
Score: 5887
// File Comments
// Basic Upstart
@ -1265,16 +1316,16 @@ main: {
// [21] phi from main::@3 to memset [phi:main::@3->memset]
// [21] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuxx=vbuc1
ldx #BLACK
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#1] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
// [21] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#2] -- pvoz1=pvoc1
// [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
// [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
// main::@4
@ -1283,16 +1334,16 @@ main: {
// [21] phi from main::@4 to memset [phi:main::@4->memset]
// [21] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuxx=vbuc1
ldx #WHITE|8
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#1] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
// [21] phi (void*) memset::str#2 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#2] -- pvoz1=pvoc1
// [21] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1
lda #<COLS
sta memset.str
lda #>COLS
sta memset.str+1
// [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta memset.num
lda #>$28*$19
sta memset.num+1
jsr memset
// [15] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
// [15] phi (byte) main::ch#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuxx=vbuc1
@ -1323,14 +1374,21 @@ main: {
}
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(2) str, byte register(X) c, word zeropage(4) num)
// memset(void* zeropage(4) str, byte register(X) c, word zeropage(2) num)
memset: {
.label end = 4
.label dst = 2
.label str = 2
.label num = 4
.label end = 2
.label dst = 4
.label num = 2
.label str = 4
// if(num>0)
// [22] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1
lda num
beq breturn
lda num+1
beq breturn
// memset::@1
// end = (char*)str + num
// [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1
// [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1
lda end
clc
adc str
@ -1338,32 +1396,33 @@ memset: {
lda end+1
adc str+1
sta end+1
// [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
// [24] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
// [24] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
// memset::@1
b1:
// [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
// [25] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
// [25] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
// memset::@2
b2:
// *dst = c
// [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
// [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
txa
ldy #0
sta (dst),y
// for(char* dst = str; dst!=end; dst++)
// [26] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
// [27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc dst
bne !+
inc dst+1
!:
// [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
// memset::@return
breturn:
// }
// [28] return
// [29] return
rts
}
// File Data

View File

@ -54,22 +54,23 @@
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:2 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:2 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:2 4.0
(byte*) memset::dst#1 dst zp ZP_WORD:4 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:4 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:4 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:4 2.1666666666666665
(byte*) memset::end#0 end zp ZP_WORD:2 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:4 2.0
(word) memset::num#2 num zp ZP_WORD:2 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:2
(void*) memset::str#3 str zp ZP_WORD:4
reg byte x [ main::ch#2 main::ch#1 ]
zp ZP_WORD:2 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:4 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:2 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:4 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]

View File

@ -716,34 +716,38 @@ divr16u: {
bitmap_clear: {
.const col = WHITE*$10
ldx #col
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
lda #<SCREEN
sta memset.str
lda #>SCREEN
sta memset.str+1
lda #<$3e8
sta memset.num
lda #>$3e8
sta memset.num+1
jsr memset
ldx #0
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
lda #<BITMAP
sta memset.str
lda #>BITMAP
sta memset.str+1
lda #<$1f40
sta memset.num
lda #>$1f40
sta memset.num+1
jsr memset
rts
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage($2b) str, byte register(X) c, word zeropage($2d) num)
// memset(void* zeropage($2d) str, byte register(X) c, word zeropage($2b) num)
memset: {
.label end = $2d
.label dst = $2b
.label str = $2b
.label num = $2d
.label end = $2b
.label dst = $2d
.label num = $2b
.label str = $2d
lda num
beq breturn
lda num+1
beq breturn
lda end
clc
adc str
@ -751,7 +755,7 @@ memset: {
lda end+1
adc str+1
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -761,10 +765,11 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
breturn:
rts
}
// Initialize bitmap plotting tables

View File

@ -367,57 +367,60 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1
to:@return
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
[189] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
[189] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[189] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 )
[189] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 )
[190] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2
[191] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[190] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[192] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
[193] *((byte*) memset::dst#2) ← (byte) memset::c#3
[194] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[195] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
memset::@1: scope:[memset] from memset
[191] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[192] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[193] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[194] *((byte*) memset::dst#2) ← (byte) memset::c#3
[195] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[196] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[196] return
memset::@return: scope:[memset] from memset memset::@2
[197] return
to:@return
bitmap_init: scope:[bitmap_init] from main::@3
[197] phi()
[198] phi()
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[198] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[198] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[199] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[200] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[201] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6
[199] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
[199] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[200] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[201] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
[202] 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
[202] phi()
[203] phi()
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6
[203] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[204] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[205] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1
[204] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
[205] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[206] 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
[206] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[206] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[207] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[208] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[209] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[210] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[211] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[212] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[213] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4
[207] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[207] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[208] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
[209] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[210] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
[211] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[212] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[213] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[214] 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
[214] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
[215] (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
[215] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[216] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[217] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3
[216] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[217] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[218] 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
[218] return
[219] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -187,20 +187,21 @@
(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte) 3
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:43 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:43 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:43 4.0
(byte*) memset::dst#1 dst zp ZP_WORD:45 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:45 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:45 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:45 2.1666666666666665
(byte*) memset::end#0 end zp ZP_WORD:43 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:45 2.0
(word) memset::num#2 num zp ZP_WORD:43 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:43
(void*) memset::str#3 str zp ZP_WORD:45
(signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b)
(word~) mul16s::$16 $16 zp ZP_WORD:59 4.0
(word~) mul16s::$9 $9 zp ZP_WORD:59 4.0
@ -422,8 +423,8 @@ zp ZP_WORD:37 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 di
zp ZP_WORD:39 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ]
zp ZP_WORD:41 [ 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_WORD:43 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:45 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:43 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:45 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ]

View File

@ -1,20 +1,27 @@
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
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Identified constant variable (byte*) HEAP_TOP
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) main::@2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000
(byte*) heap_head#0 ← (byte*) HEAP_TOP#0
to:@3
malloc: scope:[malloc] from @3
(word) malloc::size#1 ← phi( @3/(word) malloc::size#0 )
(byte*) heap_head#4 ← phi( @3/(byte*) heap_head#7 )
to:@8
malloc: scope:[malloc] from @8
(word) malloc::size#1 ← phi( @8/(word) malloc::size#0 )
(byte*) heap_head#4 ← phi( @8/(byte*) heap_head#7 )
(byte*~) malloc::$0 ← (byte*) heap_head#4 - (word) malloc::size#1
(byte*) malloc::mem#0 ← (byte*~) malloc::$0
(byte*) heap_head#1 ← (byte*) malloc::mem#0
@ -27,21 +34,21 @@ malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#2 ← (byte*) heap_head#5
return
to:@return
@3: scope:[] from @begin
(byte*) heap_head#7 ← phi( @begin/(byte*) heap_head#0 )
@8: scope:[] from @4
(byte*) heap_head#7 ← phi( @4/(byte*) heap_head#0 )
(word) malloc::size#0 ← (number) $100
call malloc
(void*) malloc::return#2 ← (void*) malloc::return#1
to:@5
@5: scope:[] from @3
(byte*) heap_head#6 ← phi( @3/(byte*) heap_head#2 )
(void*) malloc::return#4 ← phi( @3/(void*) malloc::return#2 )
to:@10
@10: scope:[] from @8
(byte*) heap_head#6 ← phi( @8/(byte*) heap_head#2 )
(void*) malloc::return#4 ← phi( @8/(void*) malloc::return#2 )
(void*~) $0 ← (void*) malloc::return#4
(byte*) heap_head#3 ← (byte*) heap_head#6
(byte*) BYTES#0 ← ((byte*)) (void*~) $0
to:@4
main: scope:[main] from @4
(byte*) BYTES#2 ← phi( @4/(byte*) BYTES#3 )
to:@9
main: scope:[main] from @9
(byte*) BYTES#2 ← phi( @9/(byte*) BYTES#3 )
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
@ -55,20 +62,21 @@ main::@1: scope:[main] from main main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@4: scope:[] from @5
(byte*) BYTES#3 ← phi( @5/(byte*) BYTES#0 )
@9: scope:[] from @10
(byte*) BYTES#3 ← phi( @10/(byte*) BYTES#0 )
call main
to:@6
@6: scope:[] from @4
to:@11
@11: scope:[] from @9
to:@end
@end: scope:[] from @6
@end: scope:[] from @11
SYMBOL TABLE SSA
(void*~) $0
(label) @3
(label) @10
(label) @11
(label) @4
(label) @5
(label) @6
(label) @8
(label) @9
(label) @begin
(label) @end
(byte*) BYTES
@ -178,24 +186,26 @@ Constant inlined malloc::return#2 = (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
Adding NOP phi() at start of @3
Adding NOP phi() at start of @5
Adding NOP phi() at start of @4
Adding NOP phi() at start of @6
Adding NOP phi() at start of @8
Adding NOP phi() at start of @10
Adding NOP phi() at start of @9
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of malloc
CALL GRAPH
Calls in [] to malloc:2 main:5
Calls in [] to malloc:3 main:6
Created 1 initial phi equivalence classes
Coalesced [14] main::i#3 ← main::i#1
Coalesced [15] main::i#3 ← main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @4
Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) main::@3
Renumbering block @3 to @1
Renumbering block @4 to @2
Renumbering block @8 to @1
Renumbering block @9 to @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2

View File

@ -2,20 +2,27 @@ Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items +
Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot + (number) 1
Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1
Fixing pointer increment (word*) main::w ← ++ (word*) main::w
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Identified constant variable (byte*) HEAP_TOP
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) main::@2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000
(byte*) heap_head#0 ← (byte*) HEAP_TOP#0
to:@3
malloc: scope:[malloc] from @3
(word) malloc::size#1 ← phi( @3/(word) malloc::size#0 )
(byte*) heap_head#4 ← phi( @3/(byte*) heap_head#7 )
to:@8
malloc: scope:[malloc] from @8
(word) malloc::size#1 ← phi( @8/(word) malloc::size#0 )
(byte*) heap_head#4 ← phi( @8/(byte*) heap_head#7 )
(byte*~) malloc::$0 ← (byte*) heap_head#4 - (word) malloc::size#1
(byte*) malloc::mem#0 ← (byte*~) malloc::$0
(byte*) heap_head#1 ← (byte*) malloc::mem#0
@ -28,21 +35,21 @@ malloc::@return: scope:[malloc] from malloc
(byte*) heap_head#2 ← (byte*) heap_head#5
return
to:@return
@3: scope:[] from @begin
(byte*) heap_head#7 ← phi( @begin/(byte*) heap_head#0 )
@8: scope:[] from @4
(byte*) heap_head#7 ← phi( @4/(byte*) heap_head#0 )
(word) malloc::size#0 ← (number) $200
call malloc
(void*) malloc::return#2 ← (void*) malloc::return#1
to:@5
@5: scope:[] from @3
(byte*) heap_head#6 ← phi( @3/(byte*) heap_head#2 )
(void*) malloc::return#4 ← phi( @3/(void*) malloc::return#2 )
to:@10
@10: scope:[] from @8
(byte*) heap_head#6 ← phi( @8/(byte*) heap_head#2 )
(void*) malloc::return#4 ← phi( @8/(void*) malloc::return#2 )
(void*~) $0 ← (void*) malloc::return#4
(byte*) heap_head#3 ← (byte*) heap_head#6
(word*) WORDS#0 ← ((word*)) (void*~) $0
to:@4
main: scope:[main] from @4
(word*) WORDS#1 ← phi( @4/(word*) WORDS#2 )
to:@9
main: scope:[main] from @9
(word*) WORDS#1 ← phi( @9/(word*) WORDS#2 )
(word*) main::w#0 ← (word*) WORDS#1
(byte) main::i#0 ← (byte) 0
to:main::@1
@ -58,20 +65,21 @@ main::@1: scope:[main] from main main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@4: scope:[] from @5
(word*) WORDS#2 ← phi( @5/(word*) WORDS#0 )
@9: scope:[] from @10
(word*) WORDS#2 ← phi( @10/(word*) WORDS#0 )
call main
to:@6
@6: scope:[] from @4
to:@11
@11: scope:[] from @9
to:@end
@end: scope:[] from @6
@end: scope:[] from @11
SYMBOL TABLE SSA
(void*~) $0
(label) @3
(label) @10
(label) @11
(label) @4
(label) @5
(label) @6
(label) @8
(label) @9
(label) @begin
(label) @end
(byte*) HEAP_TOP
@ -186,25 +194,27 @@ 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
Adding NOP phi() at start of @3
Adding NOP phi() at start of @5
Adding NOP phi() at start of @4
Adding NOP phi() at start of @6
Adding NOP phi() at start of @8
Adding NOP phi() at start of @10
Adding NOP phi() at start of @9
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of malloc
CALL GRAPH
Calls in [] to malloc:2 main:5
Calls in [] to malloc:3 main:6
Created 2 initial phi equivalence classes
Coalesced [15] main::i#3 ← main::i#1
Coalesced [16] main::w#3 ← main::w#1
Coalesced [16] main::i#3 ← main::i#1
Coalesced [17] main::w#3 ← main::w#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @4
Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) main::@3
Renumbering block @3 to @1
Renumbering block @4 to @2
Renumbering block @8 to @1
Renumbering block @9 to @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2

View File

@ -1,18 +1,25 @@
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
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Identified constant variable (byte*) HEAP_TOP
Identified constant variable (byte*) main::screen
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) @8
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000
(byte*) heap_head#0 ← (byte*) HEAP_TOP#0
to:@4
to:@9
malloc: scope:[malloc] from main main::@3
(word) malloc::size#2 ← phi( main/(word) malloc::size#0 main::@3/(word) malloc::size#1 )
(byte*) heap_head#7 ← phi( main/(byte*) heap_head#13 main::@3/(byte*) heap_head#3 )
@ -33,8 +40,8 @@ free: scope:[free] from main::@2 main::@5
free::@return: scope:[free] from free
return
to:@return
main: scope:[main] from @4
(byte*) heap_head#13 ← phi( @4/(byte*) heap_head#15 )
main: scope:[main] from @9
(byte*) heap_head#13 ← phi( @9/(byte*) heap_head#15 )
(word) malloc::size#0 ← (number) $64
call malloc
(void*) malloc::return#2 ← (void*) malloc::return#1
@ -97,19 +104,20 @@ main::@return: scope:[main] from main::@6
(byte*) heap_head#5 ← (byte*) heap_head#11
return
to:@return
@4: scope:[] from @begin
(byte*) heap_head#15 ← phi( @begin/(byte*) heap_head#0 )
@9: scope:[] from @4
(byte*) heap_head#15 ← phi( @4/(byte*) heap_head#0 )
call main
to:@5
@5: scope:[] from @4
(byte*) heap_head#12 ← phi( @4/(byte*) heap_head#5 )
to:@10
@10: scope:[] from @9
(byte*) heap_head#12 ← phi( @9/(byte*) heap_head#5 )
(byte*) heap_head#6 ← (byte*) heap_head#12
to:@end
@end: scope:[] from @5
@end: scope:[] from @10
SYMBOL TABLE SSA
(label) @10
(label) @4
(label) @5
(label) @9
(label) @begin
(label) @end
(byte*) HEAP_TOP
@ -287,24 +295,26 @@ Successful SSA optimization Pass2IdenticalPhiElimination
Added new block during phi lifting main::@7(between main::@1 and main::@1)
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 @9
Adding NOP phi() at start of @10
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
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:9 free:18 free:20
Calls in [] to main:3
Calls in [main] to malloc:7 malloc:10 free:19 free:21
Created 2 initial phi equivalence classes
Coalesced [8] heap_head#19 ← heap_head#1
Coalesced [24] main::i#3 ← main::i#1
Not coalescing [29] heap_head#1 ← malloc::mem#0
Coalesced [9] heap_head#19 ← heap_head#1
Coalesced [25] main::i#3 ← main::i#1
Not coalescing [30] heap_head#1 ← malloc::mem#0
Coalesced down to 3 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) @4
Culled Empty Block (label) @10
Culled Empty Block (label) main::@7
Renumbering block @4 to @1
Renumbering block @9 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end

File diff suppressed because it is too large Load Diff

View File

@ -247,7 +247,7 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
b1:
b2:
txa
ldy #0
sta (dst),y
@ -257,10 +257,10 @@ memset: {
!:
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
rts
}
init_sprites: {

View File

@ -119,17 +119,19 @@ init::@return: scope:[init] from init::@1
to:@return
memset: scope:[memset] from init::@2 init::@3
[70] (byte) memset::c#3 ← phi( init::@2/(byte) 0 init::@3/(const byte) BLACK#0 )
[70] (void*) memset::str#2 ← phi( init::@2/(void*)(const byte*) screen#0 init::@3/(void*)(const byte*) colors#0 )
[71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8
[72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[70] (void*) memset::str#3 ← phi( init::@2/(void*)(const byte*) screen#0 init::@3/(void*)(const byte*) colors#0 )
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[73] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
memset::@1: scope:[memset] from memset
[71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8
[72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[73] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[74] *((byte*) memset::dst#2) ← (byte) memset::c#3
[75] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
[76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
memset::@return: scope:[memset] from memset::@2
[77] return
to:@return
init_sprites: scope:[init_sprites] from init

View File

@ -14,6 +14,7 @@ Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) @12
Culled Empty Block (label) @13
Culled Empty Block (label) memset::@5
Culled Empty Block (label) memset::@3
Culled Empty Block (label) @14
Culled Empty Block (label) @15
@ -54,30 +55,38 @@ CONTROL FLOW GRAPH SSA
(byte) YELLOW#0 ← (number) 7
to:@20
memset: scope:[memset] from init::@2 init::@3
(byte) memset::c#3 ← phi( init::@2/(byte) memset::c#0 init::@3/(byte) memset::c#1 )
(byte) memset::c#4 ← phi( init::@2/(byte) memset::c#0 init::@3/(byte) memset::c#1 )
(void*) memset::str#4 ← phi( init::@2/(void*) memset::str#0 init::@3/(void*) memset::str#1 )
(word) memset::num#2 ← phi( init::@2/(word) memset::num#0 init::@3/(word) memset::num#1 )
(void*) memset::str#2 ← phi( init::@2/(void*) memset::str#0 init::@3/(void*) memset::str#1 )
(byte*~) memset::$0 ← ((byte*)) (void*) memset::str#2
(byte*~) memset::$1 ← (byte*~) memset::$0 + (word) memset::num#2
(byte*) memset::end#0 ← (byte*~) memset::$1
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
(void*) memset::str#4 ← phi( memset/(void*) memset::str#2 memset::@1/(void*) memset::str#4 )
(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#2 ← phi( memset/(byte) memset::c#3 memset::@1/(byte) memset::c#2 )
(bool~) memset::$0 ← (word) memset::num#2 > (number) 0
(bool~) memset::$1 ← ! (bool~) memset::$0
if((bool~) memset::$1) goto memset::@1
to:memset::@2
memset::@1: scope:[memset] from memset memset::@4
(void*) memset::str#2 ← phi( memset/(void*) memset::str#4 memset::@4/(void*) memset::str#5 )
(void*) memset::return#0 ← (void*) memset::str#2
to:memset::@return
memset::@2: scope:[memset] from memset
(byte) memset::c#3 ← phi( memset/(byte) memset::c#4 )
(word) memset::num#3 ← phi( memset/(word) memset::num#2 )
(void*) memset::str#3 ← phi( memset/(void*) memset::str#4 )
(byte*~) memset::$2 ← ((byte*)) (void*) memset::str#3
(byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#3
(byte*) memset::end#0 ← (byte*~) memset::$3
(byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#3
to:memset::@4
memset::@4: scope:[memset] from memset::@2 memset::@4
(void*) memset::str#5 ← phi( memset::@2/(void*) memset::str#3 memset::@4/(void*) memset::str#5 )
(byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@4/(byte*) memset::end#1 )
(byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@4/(byte*) memset::dst#1 )
(byte) memset::c#2 ← phi( memset::@2/(byte) memset::c#3 memset::@4/(byte) memset::c#2 )
*((byte*) memset::dst#2) ← (byte) memset::c#2
(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#3 ← phi( memset::@1/(void*) memset::str#4 )
(void*) memset::return#0 ← (void*) memset::str#3
to:memset::@return
memset::@return: scope:[memset] from memset::@2
(void*) memset::return#4 ← phi( memset::@2/(void*) memset::return#0 )
(bool~) memset::$4 ← (byte*) memset::dst#1 != (byte*) memset::end#1
if((bool~) memset::$4) goto memset::@4
to:memset::@1
memset::@return: scope:[memset] from memset::@1
(void*) memset::return#4 ← phi( memset::@1/(void*) memset::return#0 )
(void*) memset::return#1 ← (void*) memset::return#4
return
to:@return
@ -441,17 +450,21 @@ SYMBOL TABLE SSA
(byte) main::z
(byte) main::z#0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte*~) memset::$0
(byte*~) memset::$1
(bool~) memset::$2
(bool~) memset::$0
(bool~) memset::$1
(byte*~) memset::$2
(byte*~) memset::$3
(bool~) memset::$4
(label) memset::@1
(label) memset::@2
(label) memset::@4
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte) memset::c#3
(byte) memset::c#4
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
@ -463,6 +476,7 @@ SYMBOL TABLE SSA
(word) memset::num#0
(word) memset::num#1
(word) memset::num#2
(word) memset::num#3
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
@ -475,6 +489,7 @@ SYMBOL TABLE SSA
(void*) memset::str#2
(void*) memset::str#3
(void*) memset::str#4
(void*) memset::str#5
(word()) mul8u((byte) mul8u::a , (byte) mul8u::b)
(bool~) mul8u::$0
(number~) mul8u::$1
@ -532,6 +547,7 @@ Adding number conversion cast (unumber) 2 in (byte) RED#0 ← (number) 2
Adding number conversion cast (unumber) 5 in (byte) GREEN#0 ← (number) 5
Adding number conversion cast (unumber) 6 in (byte) BLUE#0 ← (number) 6
Adding number conversion cast (unumber) 7 in (byte) YELLOW#0 ← (number) 7
Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#2 > (number) 0
Adding number conversion cast (unumber) 0 in (word) mul8u::res#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) mul8u::$0 ← (byte) mul8u::a#2 != (number) 0
Adding number conversion cast (unumber) 1 in (number~) mul8u::$1 ← (byte) mul8u::a#3 & (number) 1
@ -599,8 +615,8 @@ Inlining cast (byte) RED#0 ← (unumber)(number) 2
Inlining cast (byte) GREEN#0 ← (unumber)(number) 5
Inlining cast (byte) BLUE#0 ← (unumber)(number) 6
Inlining cast (byte) YELLOW#0 ← (unumber)(number) 7
Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3
Inlining cast (word) mul8u::res#0 ← (unumber)(number) 0
Inlining cast (byte*) screen#0 ← (byte*)(number) $400
Inlining cast (byte*) charset#0 ← (byte*)(number) $2000
@ -644,6 +660,7 @@ Simplifying constant integer cast 6
Simplifying constant integer cast 7
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 1
@ -691,6 +708,7 @@ Finalized unsigned number type (byte) 6
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
@ -738,10 +756,14 @@ Inferred type updated to word in (unumber~) draw_block::$7 ← (word) draw_block
Inferred type updated to word in (unumber~) draw_block::$8 ← (word) draw_block::z#1 + (byte) $28
Inferred type updated to word in (unumber~) draw_block::$9 ← (word) draw_block::z#1 + (byte) $29
Inferred type updated to word in (unumber~) draw_block::$10 ← (word) draw_block::z#1 + (byte) $29
Inversing boolean not [42] (bool~) mul8u::$3 ← (byte~) mul8u::$1 == (byte) 0 from [41] (bool~) mul8u::$2 ← (byte~) mul8u::$1 != (byte) 0
Inversing boolean not [20] (bool~) memset::$1 ← (word) memset::num#2 <= (byte) 0 from [19] (bool~) memset::$0 ← (word) memset::num#2 > (byte) 0
Inversing boolean not [46] (bool~) mul8u::$3 ← (byte~) mul8u::$1 == (byte) 0 from [45] (bool~) mul8u::$2 ← (byte~) mul8u::$1 != (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) memset::end#0 = (byte*~) memset::$1
Alias (void*) memset::return#0 = (void*) memset::str#3 (void*) memset::str#4 (void*) memset::return#4 (void*) memset::return#1
Alias (void*) memset::return#0 = (void*) memset::str#2 (void*) memset::return#4 (void*) memset::return#1
Alias (void*) memset::str#3 = (void*) memset::str#4
Alias (word) memset::num#2 = (word) memset::num#3
Alias (byte) memset::c#3 = (byte) memset::c#4
Alias (byte*) memset::end#0 = (byte*~) memset::$3
Alias (word) mul8u::mb#0 = (byte) mul8u::b#1
Alias (byte) mul8u::a#2 = (byte) mul8u::a#3 (byte) mul8u::a#6
Alias (word) mul8u::mb#3 = (word) mul8u::mb#4 (word) mul8u::mb#5
@ -767,12 +789,12 @@ Alias (word) mul8u::mb#2 = (word) mul8u::mb#3
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) memset::c#2
Self Phi Eliminated (byte*) memset::end#1
Self Phi Eliminated (void*) memset::return#0
Self Phi Eliminated (void*) memset::str#5
Self Phi Eliminated (byte) main::x#2
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte) memset::c#2 (byte) memset::c#3
Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0
Identical Phi Values (void*) memset::return#0 (void*) memset::str#2
Identical Phi Values (void*) memset::str#5 (void*) memset::str#3
Identical Phi Values (word) mul8u::mb#0 (byte) mul8u::b#0
Identical Phi Values (byte) mul8u::a#5 (byte) mul8u::a#1
Identical Phi Values (byte) main::x#2 (byte) main::x#4
@ -780,11 +802,14 @@ Identical Phi Values (byte) draw_block::tileno#2 (byte) draw_block::tileno#0
Identical Phi Values (byte) draw_block::x#1 (byte) draw_block::x#0
Identical Phi Values (byte) draw_block::y#2 (byte) draw_block::y#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$2 [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
Simple Condition (bool~) mul8u::$0 [38] if((byte) mul8u::a#2!=(byte) 0) goto mul8u::@2
Simple Condition (bool~) mul8u::$3 [43] if((byte~) mul8u::$1==(byte) 0) goto mul8u::@4
Simple Condition (bool~) main::$3 [78] if((byte) main::y#1<(byte) 9) goto main::@2
Simple Condition (bool~) main::$4 [82] if((byte) main::x#1<(byte) $10) goto main::@1
Identical Phi Values (void*) memset::return#0 (void*) memset::str#3
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$1 [21] if((word) memset::num#2<=(byte) 0) goto memset::@1
Simple Condition (bool~) memset::$4 [33] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@4
Simple Condition (bool~) mul8u::$0 [42] if((byte) mul8u::a#2!=(byte) 0) goto mul8u::@2
Simple Condition (bool~) mul8u::$3 [47] if((byte~) mul8u::$1==(byte) 0) goto mul8u::@4
Simple Condition (bool~) main::$3 [82] if((byte) main::y#1<(byte) 9) goto main::@2
Simple Condition (bool~) main::$4 [86] if((byte) main::x#1<(byte) $10) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SPRITES_XMSB#0 = (byte*) 53264
Constant (const byte*) SPRITES_ENABLE#0 = (byte*) 53269
@ -822,24 +847,24 @@ Constant (const byte) memset::c#1 = BLACK#0
Constant (const byte*) init::toD0181_screen#0 = screen#0
Constant (const byte*) init::toD0181_gfx#0 = charset#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (void*)screen#0 in [86] (void*) memset::str#0 ← (void*)(const byte*) screen#0
Constant value identified (void*)colors#0 in [91] (void*) memset::str#1 ← (void*)(const byte*) colors#0
Constant value identified (word)init::toD0181_screen#0 in [99] (word~) init::toD0181_$0#0 ← (word)(const byte*) init::toD0181_screen#0
Constant value identified (word)init::toD0181_gfx#0 in [103] (word~) init::toD0181_$4#0 ← (word)(const byte*) init::toD0181_gfx#0
Constant value identified (void*)screen#0 in [90] (void*) memset::str#0 ← (void*)(const byte*) screen#0
Constant value identified (void*)colors#0 in [95] (void*) memset::str#1 ← (void*)(const byte*) colors#0
Constant value identified (word)init::toD0181_screen#0 in [103] (word~) init::toD0181_$0#0 ← (word)(const byte*) init::toD0181_screen#0
Constant value identified (word)init::toD0181_gfx#0 in [107] (word~) init::toD0181_$4#0 ← (word)(const byte*) init::toD0181_gfx#0
Successful SSA optimization Pass2ConstantValues
if() condition always true - replacing block destination [83] if(true) goto main::@5
if() condition always true - replacing block destination [87] if(true) goto main::@5
Successful SSA optimization Pass2ConstantIfs
De-inlining pointer[w] to *(pointer+w) [145] *((const byte*) screen#0 + (word) draw_block::z#1) ← (byte) draw_block::drawtile#0
De-inlining pointer[w] to *(pointer+w) [146] *((const byte*) colors#0 + (word) draw_block::z#1) ← (const byte) YELLOW#0
De-inlining pointer[w] to *(pointer+w) [148] *((const byte*) screen#0 + (word~) draw_block::$5) ← (byte) 1
De-inlining pointer[w] to *(pointer+w) [150] *((const byte*) colors#0 + (word~) draw_block::$6) ← (const byte) YELLOW#0
De-inlining pointer[w] to *(pointer+w) [152] *((const byte*) screen#0 + (word~) draw_block::$7) ← (byte) 2
De-inlining pointer[w] to *(pointer+w) [154] *((const byte*) colors#0 + (word~) draw_block::$8) ← (const byte) YELLOW#0
De-inlining pointer[w] to *(pointer+w) [156] *((const byte*) screen#0 + (word~) draw_block::$9) ← (byte) 3
De-inlining pointer[w] to *(pointer+w) [158] *((const byte*) colors#0 + (word~) draw_block::$10) ← (const byte) YELLOW#0
De-inlining pointer[w] to *(pointer+w) [149] *((const byte*) screen#0 + (word) draw_block::z#1) ← (byte) draw_block::drawtile#0
De-inlining pointer[w] to *(pointer+w) [150] *((const byte*) colors#0 + (word) draw_block::z#1) ← (const byte) YELLOW#0
De-inlining pointer[w] to *(pointer+w) [152] *((const byte*) screen#0 + (word~) draw_block::$5) ← (byte) 1
De-inlining pointer[w] to *(pointer+w) [154] *((const byte*) colors#0 + (word~) draw_block::$6) ← (const byte) YELLOW#0
De-inlining pointer[w] to *(pointer+w) [156] *((const byte*) screen#0 + (word~) draw_block::$7) ← (byte) 2
De-inlining pointer[w] to *(pointer+w) [158] *((const byte*) colors#0 + (word~) draw_block::$8) ← (const byte) YELLOW#0
De-inlining pointer[w] to *(pointer+w) [160] *((const byte*) screen#0 + (word~) draw_block::$9) ← (byte) 3
De-inlining pointer[w] to *(pointer+w) [162] *((const byte*) colors#0 + (word~) draw_block::$10) ← (const byte) YELLOW#0
Successful SSA optimization Pass2DeInlineWordDerefIdx
Eliminating unused variable (void*) memset::return#2 and assignment [35] (void*) memset::return#2 ← (void*) memset::str#2
Eliminating unused variable (void*) memset::return#3 and assignment [38] (void*) memset::return#3 ← (void*) memset::str#2
Eliminating unused variable (void*) memset::return#2 and assignment [36] (void*) memset::return#2 ← (void*) memset::str#3
Eliminating unused variable (void*) memset::return#3 and assignment [39] (void*) memset::return#3 ← (void*) memset::str#3
Eliminating unused constant (const byte) draw_block::color#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
@ -849,30 +874,30 @@ Constant (const void*) memset::str#1 = (void*)colors#0
Constant (const word) init::toD0181_$0#0 = (word)init::toD0181_screen#0
Constant (const word) init::toD0181_$4#0 = (word)init::toD0181_gfx#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [34] (word~) init::toD0181_$1#0 ← (const word) init::toD0181_$0#0 & (word) $3fff
Constant right-side identified [37] (byte~) init::toD0181_$5#0 ← > (const word) init::toD0181_$4#0
Constant right-side identified [35] (word~) init::toD0181_$1#0 ← (const word) init::toD0181_$0#0 & (word) $3fff
Constant right-side identified [38] (byte~) init::toD0181_$5#0 ← > (const word) init::toD0181_$4#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) init::toD0181_$1#0 = init::toD0181_$0#0&$3fff
Constant (const byte) init::toD0181_$5#0 = >init::toD0181_$4#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [34] (word~) init::toD0181_$2#0 ← (const word) init::toD0181_$1#0 * (byte) 4
Constant right-side identified [36] (byte~) init::toD0181_$6#0 ← (const byte) init::toD0181_$5#0 / (byte) 4
Constant right-side identified [35] (word~) init::toD0181_$2#0 ← (const word) init::toD0181_$1#0 * (byte) 4
Constant right-side identified [37] (byte~) init::toD0181_$6#0 ← (const byte) init::toD0181_$5#0 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) init::toD0181_$2#0 = init::toD0181_$1#0*4
Constant (const byte) init::toD0181_$6#0 = init::toD0181_$5#0/4
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [34] (byte~) init::toD0181_$3#0 ← > (const word) init::toD0181_$2#0
Constant right-side identified [35] (byte~) init::toD0181_$7#0 ← (const byte) init::toD0181_$6#0 & (byte) $f
Constant right-side identified [35] (byte~) init::toD0181_$3#0 ← > (const word) init::toD0181_$2#0
Constant right-side identified [36] (byte~) init::toD0181_$7#0 ← (const byte) init::toD0181_$6#0 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) init::toD0181_$3#0 = >init::toD0181_$2#0
Constant (const byte) init::toD0181_$7#0 = init::toD0181_$6#0&$f
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [34] (byte) init::toD0181_return#0 ← (const byte) init::toD0181_$3#0 | (const byte) init::toD0181_$7#0
Constant right-side identified [35] (byte) init::toD0181_return#0 ← (const byte) init::toD0181_$3#0 | (const byte) init::toD0181_$7#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) init::toD0181_return#0 = init::toD0181_$3#0|init::toD0181_$7#0
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 [2] (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Inlining Noop Cast [4] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const byte) memset::c#0
Inlining constant with var siblings (const word) memset::num#0
@ -914,7 +939,9 @@ Alias (word) draw_block::z#1 = (word~) draw_block::$5 (word~) draw_block::$6 (wo
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (word) memset::num#2 (word) $3e8
Successful SSA optimization Pass2IdenticalPhiElimination
Added new block during phi lifting memset::@4(between memset::@1 and memset::@1)
if() condition always false - eliminating [1] if((word) $3e8<=(byte) 0) goto memset::@1
Successful SSA optimization Pass2ConstantIfs
Added new block during phi lifting memset::@6(between memset::@4 and memset::@4)
Added new block during phi lifting mul8u::@10(between mul8u::@2 and mul8u::@4)
Added new block during phi lifting main::@9(between main::@3 and main::@1)
Added new block during phi lifting main::@10(between main::@8 and main::@2)
@ -933,7 +960,7 @@ Adding NOP phi() at start of init::@3
Adding NOP phi() at start of init::@4
Adding NOP phi() at start of init::toD0181
Adding NOP phi() at start of init::toD0181_@return
Adding NOP phi() at start of memset::@2
Adding NOP phi() at start of memset::@1
CALL GRAPH
Calls in [] to main:3
Calls in [main] to init:7 draw_block:16
@ -960,9 +987,11 @@ Culled Empty Block (label) mul8u::@3
Culled Empty Block (label) mul8u::@10
Culled Empty Block (label) init::@4
Culled Empty Block (label) init::toD0181_@return
Culled Empty Block (label) memset::@2
Culled Empty Block (label) memset::@4
Culled Empty Block (label) memset::@1
Culled Empty Block (label) memset::@6
Renumbering block @24 to @1
Renumbering block memset::@2 to memset::@1
Renumbering block memset::@4 to memset::@2
Renumbering block mul8u::@4 to mul8u::@3
Renumbering block mul8u::@7 to mul8u::@4
Renumbering block main::@5 to main::@4
@ -1100,17 +1129,19 @@ init::@return: scope:[init] from init::@1
to:@return
memset: scope:[memset] from init::@2 init::@3
[70] (byte) memset::c#3 ← phi( init::@2/(byte) 0 init::@3/(const byte) BLACK#0 )
[70] (void*) memset::str#2 ← phi( init::@2/(void*)(const byte*) screen#0 init::@3/(void*)(const byte*) colors#0 )
[71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8
[72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
[70] (void*) memset::str#3 ← phi( init::@2/(void*)(const byte*) screen#0 init::@3/(void*)(const byte*) colors#0 )
to:memset::@1
memset::@1: scope:[memset] from memset memset::@1
[73] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 )
memset::@1: scope:[memset] from memset
[71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8
[72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@2
[73] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
[74] *((byte*) memset::dst#2) ← (byte) memset::c#3
[75] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1
[76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
memset::@return: scope:[memset] from memset::@2
[77] return
to:@return
init_sprites: scope:[init_sprites] from init
@ -1210,7 +1241,7 @@ VARIABLE REGISTER WEIGHTS
(word) memset::num
(void*) memset::return
(void*) memset::str
(void*) memset::str#2
(void*) memset::str#3
(word()) mul8u((byte) mul8u::a , (byte) mul8u::b)
(byte~) mul8u::$1 2002.0
(byte) mul8u::a
@ -1236,7 +1267,7 @@ Initial phi equivalence classes
[ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
[ mul8u::res#2 mul8u::res#6 mul8u::res#1 ]
[ mul8u::mb#2 mul8u::mb#1 ]
[ memset::str#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
Added variable main::z#0 to zero page equivalence class [ main::z#0 ]
@ -1267,7 +1298,7 @@ Complete equivalence classes
[ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
[ mul8u::res#2 mul8u::res#6 mul8u::res#1 ]
[ mul8u::mb#2 mul8u::mb#1 ]
[ memset::str#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
[ main::z#0 ]
@ -1297,7 +1328,7 @@ Allocated zp ZP_BYTE:3 [ main::y#2 main::y#1 ]
Allocated zp ZP_BYTE:4 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
Allocated zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ]
Allocated zp ZP_WORD:7 [ mul8u::mb#2 mul8u::mb#1 ]
Allocated zp ZP_WORD:9 [ memset::str#2 ]
Allocated zp ZP_WORD:9 [ memset::str#3 ]
Allocated zp ZP_BYTE:11 [ memset::c#3 ]
Allocated zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated zp ZP_BYTE:14 [ main::z#0 ]
@ -1712,7 +1743,7 @@ init: {
// [70] phi (byte) memset::c#3 = (byte) 0 [phi:init::@2->memset#0] -- vbuz1=vbuc1
lda #0
sta memset.c
// [70] phi (void*) memset::str#2 = (void*)(const byte*) screen#0 [phi:init::@2->memset#1] -- pvoz1=pvoc1
// [70] phi (void*) memset::str#3 = (void*)(const byte*) screen#0 [phi:init::@2->memset#1] -- pvoz1=pvoc1
lda #<screen
sta memset.str
lda #>screen
@ -1729,7 +1760,7 @@ init: {
// [70] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:init::@3->memset#0] -- vbuz1=vbuc1
lda #BLACK
sta memset.c
// [70] phi (void*) memset::str#2 = (void*)(const byte*) colors#0 [phi:init::@3->memset#1] -- pvoz1=pvoc1
// [70] phi (void*) memset::str#3 = (void*)(const byte*) colors#0 [phi:init::@3->memset#1] -- pvoz1=pvoc1
lda #<colors
sta memset.str
lda #>colors
@ -1778,7 +1809,10 @@ memset: {
.label dst = $c
.label str = 9
.label c = $b
// [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
jmp b1
// memset::@1
b1:
// [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
lda str
clc
adc #<$3e8
@ -1786,18 +1820,18 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
// [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 -- pbuz1=pbuz2
// [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2
lda str
sta dst
lda str+1
sta dst+1
// [73] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
b1_from_memset:
b1_from_b1:
// [73] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
jmp b1
// memset::@1
b1:
// [73] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
b2_from_b1:
b2_from_b2:
// [73] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
jmp b2
// memset::@2
b2:
// [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuz2
lda c
ldy #0
@ -1807,13 +1841,13 @@ memset: {
bne !+
inc dst+1
!:
// [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1_from_b1
bne b2_from_b2
lda dst
cmp end
bne b1_from_b1
bne b2_from_b2
jmp breturn
// memset::@return
breturn:
@ -1890,12 +1924,12 @@ Statement [65] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0 [ ] ( main:2::
Statement [66] *((const byte*) BGCOL2#0) ← (const byte) RED#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a
Statement [67] *((const byte*) BGCOL3#0) ← (const byte) BLUE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a
Statement [68] *((const byte*) BGCOL4#0) ← (const byte) GREEN#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a
Statement [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#3 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ memset::c#3 ]
Statement [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#2 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:11 [ memset::c#3 ]
Statement [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [78] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a
Statement [79] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a
Statement [80] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a
@ -1934,10 +1968,10 @@ Statement [65] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0 [ ] ( main:2::
Statement [66] *((const byte*) BGCOL2#0) ← (const byte) RED#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a
Statement [67] *((const byte*) BGCOL3#0) ← (const byte) BLUE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a
Statement [68] *((const byte*) BGCOL4#0) ← (const byte) GREEN#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a
Statement [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#3 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a
Statement [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a
Statement [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#2 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y
Statement [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a
Statement [78] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a
Statement [79] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a
Statement [80] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a
@ -1949,7 +1983,7 @@ Potential registers zp ZP_BYTE:3 [ main::y#2 main::y#1 ] : zp ZP_BYTE:3 , reg by
Potential registers zp ZP_BYTE:4 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] : zp ZP_BYTE:4 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] : zp ZP_WORD:5 ,
Potential registers zp ZP_WORD:7 [ mul8u::mb#2 mul8u::mb#1 ] : zp ZP_WORD:7 ,
Potential registers zp ZP_WORD:9 [ memset::str#2 ] : zp ZP_WORD:9 ,
Potential registers zp ZP_WORD:9 [ memset::str#3 ] : zp ZP_WORD:9 ,
Potential registers zp ZP_BYTE:11 [ memset::c#3 ] : zp ZP_BYTE:11 , reg byte x ,
Potential registers zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] : zp ZP_WORD:12 ,
Potential registers zp ZP_BYTE:14 [ main::z#0 ] : zp ZP_BYTE:14 , reg byte a , reg byte x , reg byte y ,
@ -1979,35 +2013,35 @@ REGISTER UPLIFT SCOPES
Uplift Scope [mul8u] 3,503.83: zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] 2,431: zp ZP_WORD:7 [ mul8u::mb#2 mul8u::mb#1 ] 2,002: zp ZP_BYTE:46 [ mul8u::$1 ] 1,670.67: zp ZP_BYTE:4 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] 4: zp ZP_WORD:23 [ mul8u::return#2 ]
Uplift Scope [main] 209.21: zp ZP_BYTE:3 [ main::y#2 main::y#1 ] 202: zp ZP_BYTE:14 [ main::z#0 ] 202: zp ZP_BYTE:15 [ main::tile#0 ] 38.9: zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplift Scope [draw_block] 34.33: zp ZP_BYTE:16 [ draw_block::tileno#0 ] 34.33: zp ZP_BYTE:17 [ draw_block::x#0 ] 34.33: zp ZP_BYTE:18 [ draw_block::y#0 ] 4: zp ZP_BYTE:22 [ draw_block::y#1 ] 4: zp ZP_WORD:25 [ draw_block::z#0 ] 4: zp ZP_WORD:30 [ draw_block::$11 ] 4: zp ZP_WORD:32 [ draw_block::$12 ] 4: zp ZP_WORD:34 [ draw_block::$13 ] 4: zp ZP_WORD:36 [ draw_block::$14 ] 4: zp ZP_WORD:38 [ draw_block::$15 ] 4: zp ZP_WORD:40 [ draw_block::$16 ] 4: zp ZP_WORD:42 [ draw_block::$17 ] 4: zp ZP_WORD:44 [ draw_block::$18 ] 2: zp ZP_BYTE:29 [ draw_block::drawtile#0 ] 1.12: zp ZP_WORD:27 [ draw_block::z#1 ] 0.67: zp ZP_WORD:20 [ draw_block::x1#0 ] 0.5: zp ZP_BYTE:19 [ draw_block::tileno#1 ]
Uplift Scope [memset] 38: zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:47 [ memset::end#0 ] 1.57: zp ZP_BYTE:11 [ memset::c#3 ] 0: zp ZP_WORD:9 [ memset::str#2 ]
Uplift Scope [memset] 38: zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:47 [ memset::end#0 ] 1.57: zp ZP_BYTE:11 [ memset::c#3 ] 0: zp ZP_WORD:9 [ memset::str#3 ]
Uplift Scope [init]
Uplift Scope [init_sprites]
Uplift Scope []
Uplifting [mul8u] best 92836 combination zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:7 [ mul8u::mb#2 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] zp ZP_WORD:23 [ mul8u::return#2 ]
Uplifting [main] best 91836 combination zp ZP_BYTE:3 [ main::y#2 main::y#1 ] reg byte a [ main::z#0 ] reg byte a [ main::tile#0 ] zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplifting [draw_block] best 90927 combination reg byte a [ draw_block::tileno#0 ] reg byte y [ draw_block::x#0 ] reg byte x [ draw_block::y#0 ] reg byte a [ draw_block::y#1 ] zp ZP_WORD:25 [ draw_block::z#0 ] zp ZP_WORD:30 [ draw_block::$11 ] zp ZP_WORD:32 [ draw_block::$12 ] zp ZP_WORD:34 [ draw_block::$13 ] zp ZP_WORD:36 [ draw_block::$14 ] zp ZP_WORD:38 [ draw_block::$15 ] zp ZP_WORD:40 [ draw_block::$16 ] zp ZP_WORD:42 [ draw_block::$17 ] zp ZP_WORD:44 [ draw_block::$18 ] zp ZP_BYTE:29 [ draw_block::drawtile#0 ] zp ZP_WORD:27 [ draw_block::z#1 ] zp ZP_WORD:20 [ draw_block::x1#0 ] zp ZP_BYTE:19 [ draw_block::tileno#1 ]
Uplifting [mul8u] best 92866 combination zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:7 [ mul8u::mb#2 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] zp ZP_WORD:23 [ mul8u::return#2 ]
Uplifting [main] best 91866 combination zp ZP_BYTE:3 [ main::y#2 main::y#1 ] reg byte a [ main::z#0 ] reg byte a [ main::tile#0 ] zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplifting [draw_block] best 90957 combination reg byte a [ draw_block::tileno#0 ] reg byte y [ draw_block::x#0 ] reg byte x [ draw_block::y#0 ] reg byte a [ draw_block::y#1 ] zp ZP_WORD:25 [ draw_block::z#0 ] zp ZP_WORD:30 [ draw_block::$11 ] zp ZP_WORD:32 [ draw_block::$12 ] zp ZP_WORD:34 [ draw_block::$13 ] zp ZP_WORD:36 [ draw_block::$14 ] zp ZP_WORD:38 [ draw_block::$15 ] zp ZP_WORD:40 [ draw_block::$16 ] zp ZP_WORD:42 [ draw_block::$17 ] zp ZP_WORD:44 [ draw_block::$18 ] zp ZP_BYTE:29 [ draw_block::drawtile#0 ] zp ZP_WORD:27 [ draw_block::z#1 ] zp ZP_WORD:20 [ draw_block::x1#0 ] zp ZP_BYTE:19 [ draw_block::tileno#1 ]
Limited combination testing to 100 combinations of 1296 possible.
Uplifting [memset] best 90911 combination zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:47 [ memset::end#0 ] reg byte x [ memset::c#3 ] zp ZP_WORD:9 [ memset::str#2 ]
Uplifting [init] best 90911 combination
Uplifting [init_sprites] best 90911 combination
Uplifting [] best 90911 combination
Uplifting [memset] best 90941 combination zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:47 [ memset::end#0 ] reg byte x [ memset::c#3 ] zp ZP_WORD:9 [ memset::str#3 ]
Uplifting [init] best 90941 combination
Uplifting [init_sprites] best 90941 combination
Uplifting [] best 90941 combination
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::y#2 main::y#1 ]
Uplifting [main] best 90911 combination zp ZP_BYTE:3 [ main::y#2 main::y#1 ]
Uplifting [main] best 90941 combination zp ZP_BYTE:3 [ main::y#2 main::y#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplifting [main] best 90911 combination zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Uplifting [main] best 90941 combination zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:29 [ draw_block::drawtile#0 ]
Uplifting [draw_block] best 90907 combination reg byte x [ draw_block::drawtile#0 ]
Uplifting [draw_block] best 90937 combination reg byte x [ draw_block::drawtile#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:19 [ draw_block::tileno#1 ]
Uplifting [draw_block] best 90907 combination zp ZP_BYTE:19 [ draw_block::tileno#1 ]
Uplifting [draw_block] best 90937 combination zp ZP_BYTE:19 [ draw_block::tileno#1 ]
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] ] with [ zp ZP_WORD:23 [ mul8u::return#2 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:9 [ memset::str#2 ] ] with [ zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:9 [ memset::str#3 ] ] with [ zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:20 [ draw_block::x1#0 ] ] with [ zp ZP_WORD:27 [ draw_block::z#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 ] ] with [ zp ZP_WORD:25 [ draw_block::z#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:20 [ draw_block::x1#0 draw_block::z#1 ] ] with [ zp ZP_WORD:44 [ draw_block::$18 ] ] - score: 1
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 draw_block::z#0 ]
Allocated (was zp ZP_WORD:7) zp ZP_WORD:6 [ mul8u::mb#2 mul8u::mb#1 ]
Allocated (was zp ZP_WORD:9) zp ZP_WORD:8 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated (was zp ZP_WORD:9) zp ZP_WORD:8 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated (was zp ZP_BYTE:19) zp ZP_BYTE:10 [ draw_block::tileno#1 ]
Allocated (was zp ZP_WORD:20) zp ZP_WORD:11 [ draw_block::x1#0 draw_block::z#1 draw_block::$18 ]
Allocated (was zp ZP_WORD:30) zp ZP_WORD:13 [ draw_block::$11 ]
@ -2379,7 +2413,7 @@ init: {
memset_from_b2:
// [70] phi (byte) memset::c#3 = (byte) 0 [phi:init::@2->memset#0] -- vbuxx=vbuc1
ldx #0
// [70] phi (void*) memset::str#2 = (void*)(const byte*) screen#0 [phi:init::@2->memset#1] -- pvoz1=pvoc1
// [70] phi (void*) memset::str#3 = (void*)(const byte*) screen#0 [phi:init::@2->memset#1] -- pvoz1=pvoc1
lda #<screen
sta memset.str
lda #>screen
@ -2395,7 +2429,7 @@ init: {
memset_from_b3:
// [70] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:init::@3->memset#0] -- vbuxx=vbuc1
ldx #BLACK
// [70] phi (void*) memset::str#2 = (void*)(const byte*) colors#0 [phi:init::@3->memset#1] -- pvoz1=pvoc1
// [70] phi (void*) memset::str#3 = (void*)(const byte*) colors#0 [phi:init::@3->memset#1] -- pvoz1=pvoc1
lda #<colors
sta memset.str
lda #>colors
@ -2443,7 +2477,10 @@ memset: {
.label end = $1b
.label dst = 8
.label str = 8
// [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
jmp b1
// memset::@1
b1:
// [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
lda str
clc
adc #<$3e8
@ -2451,14 +2488,14 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
// [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
// [73] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
b1_from_memset:
b1_from_b1:
// [73] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
jmp b1
// memset::@1
b1:
// [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
// [73] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
b2_from_b1:
b2_from_b2:
// [73] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
jmp b2
// memset::@2
b2:
// [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
txa
ldy #0
@ -2468,13 +2505,13 @@ memset: {
bne !+
inc dst+1
!:
// [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1_from_b1
bne b2_from_b2
lda dst
cmp end
bne b1_from_b1
bne b2_from_b2
jmp breturn
// memset::@return
breturn:
@ -2530,6 +2567,7 @@ Removing instruction jmp toD0181
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
@ -2549,8 +2587,8 @@ Replacing label b2_from_b5 with b2
Replacing label b1_from_b3 with b1
Replacing label b4_from_b4 with b4
Replacing label b3_from_b2 with b3
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b2_from_b2 with b2
Replacing label b2_from_b2 with b2
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
@ -2568,8 +2606,8 @@ Removing instruction b3_from_b2:
Removing instruction memset_from_b3:
Removing instruction toD0181_from_b3:
Removing instruction toD0181:
Removing instruction b1_from_memset:
Removing instruction b1_from_b1:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction init_from_main:
@ -2587,6 +2625,7 @@ Removing instruction b2:
Removing instruction b3:
Removing instruction b1:
Removing instruction breturn:
Removing instruction b1:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
@ -2711,6 +2750,7 @@ FINAL SYMBOL TABLE
(byte) main::z#0 reg byte a 202.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
@ -2723,7 +2763,7 @@ FINAL SYMBOL TABLE
(word) memset::num
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:8
(void*) memset::str#3 str zp ZP_WORD:8
(word()) mul8u((byte) mul8u::a , (byte) mul8u::b)
(byte~) mul8u::$1 reg byte a 2002.0
(label) mul8u::@1
@ -2756,7 +2796,7 @@ zp ZP_BYTE:3 [ main::y#2 main::y#1 ]
reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
zp ZP_WORD:4 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 draw_block::z#0 ]
zp ZP_WORD:6 [ mul8u::mb#2 mul8u::mb#1 ]
zp ZP_WORD:8 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:8 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
reg byte a [ main::z#0 ]
reg byte a [ main::tile#0 ]
@ -3120,7 +3160,7 @@ init: {
// [70] phi from init::@2 to memset [phi:init::@2->memset]
// [70] phi (byte) memset::c#3 = (byte) 0 [phi:init::@2->memset#0] -- vbuxx=vbuc1
ldx #0
// [70] phi (void*) memset::str#2 = (void*)(const byte*) screen#0 [phi:init::@2->memset#1] -- pvoz1=pvoc1
// [70] phi (void*) memset::str#3 = (void*)(const byte*) screen#0 [phi:init::@2->memset#1] -- pvoz1=pvoc1
lda #<screen
sta memset.str
lda #>screen
@ -3133,7 +3173,7 @@ init: {
// [70] phi from init::@3 to memset [phi:init::@3->memset]
// [70] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:init::@3->memset#0] -- vbuxx=vbuc1
ldx #BLACK
// [70] phi (void*) memset::str#2 = (void*)(const byte*) colors#0 [phi:init::@3->memset#1] -- pvoz1=pvoc1
// [70] phi (void*) memset::str#3 = (void*)(const byte*) colors#0 [phi:init::@3->memset#1] -- pvoz1=pvoc1
lda #<colors
sta memset.str
lda #>colors
@ -3181,8 +3221,9 @@ memset: {
.label end = $1b
.label dst = 8
.label str = 8
// memset::@1
// end = (char*)str + num
// [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
// [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1
lda str
clc
adc #<$3e8
@ -3190,11 +3231,11 @@ memset: {
lda str+1
adc #>$3e8
sta end+1
// [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2
// [73] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1]
// [73] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy
// memset::@1
b1:
// [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
// [73] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
// [73] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy
// memset::@2
b2:
// *dst = c
// [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx
txa
@ -3206,13 +3247,13 @@ memset: {
bne !+
inc dst+1
!:
// [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1
// [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1
lda dst+1
cmp end+1
bne b1
bne b2
lda dst
cmp end
bne b1
bne b2
// memset::@return
// }
// [77] return

View File

@ -109,6 +109,7 @@
(byte) main::z#0 reg byte a 202.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.5714285714285714
@ -121,7 +122,7 @@
(word) memset::num
(void*) memset::return
(void*) memset::str
(void*) memset::str#2 str zp ZP_WORD:8
(void*) memset::str#3 str zp ZP_WORD:8
(word()) mul8u((byte) mul8u::a , (byte) mul8u::b)
(byte~) mul8u::$1 reg byte a 2002.0
(label) mul8u::@1
@ -154,7 +155,7 @@ zp ZP_BYTE:3 [ main::y#2 main::y#1 ]
reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
zp ZP_WORD:4 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 draw_block::z#0 ]
zp ZP_WORD:6 [ mul8u::mb#2 mul8u::mb#1 ]
zp ZP_WORD:8 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ]
zp ZP_WORD:8 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]
reg byte a [ main::z#0 ]
reg byte a [ main::tile#0 ]

View File

@ -5,6 +5,7 @@ Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot +
Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1
Fixing pointer array-indexing *((word[CORDIC_ITERATIONS_16]) CORDIC_ATAN2_ANGLES_16 + (byte) atan2_16::i)
Fixing pointer array-indexing *((word[CORDIC_ITERATIONS_16]) CORDIC_ATAN2_ANGLES_16 + (byte) atan2_16::i)
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Warning! Adding boolean cast to non-boolean sub-expression (byte) atan2_16::shift
Identified constant variable (byte*) HEAP_TOP
Identified constant variable (byte*) main::BASE_SCREEN
@ -14,10 +15,15 @@ Inlined call (byte~) main::$1 ← call toD018 (byte*) SCREEN (byte*) CHARSET
Inlined call (byte~) main::$7 ← call toD018 (byte*) main::BASE_SCREEN (byte*) main::BASE_CHARSET
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) @9
Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) @12
Culled Empty Block (label) init_font_hex::@6
Culled Empty Block (label) atan2_16::@9
Culled Empty Block (label) atan2_16::@10
@ -31,13 +37,8 @@ Culled Empty Block (label) atan2_16::@23
Culled Empty Block (label) atan2_16::@31
Culled Empty Block (label) atan2_16::@32
Culled Empty Block (label) atan2_16::@14
Culled Empty Block (label) @9
Culled Empty Block (label) clock::@1
Culled Empty Block (label) @11
Culled Empty Block (label) @12
Culled Empty Block (label) @13
Culled Empty Block (label) @14
Culled Empty Block (label) @15
Culled Empty Block (label) clock::@1
Culled Empty Block (label) @16
Culled Empty Block (label) @17
Culled Empty Block (label) @18
@ -48,21 +49,26 @@ Culled Empty Block (label) @22
Culled Empty Block (label) @23
Culled Empty Block (label) @24
Culled Empty Block (label) @25
Culled Empty Block (label) @26
Culled Empty Block (label) @27
Culled Empty Block (label) @28
Culled Empty Block (label) @29
Culled Empty Block (label) @30
Culled Empty Block (label) @31
Culled Empty Block (label) @32
Culled Empty Block (label) @33
Culled Empty Block (label) @34
Culled Empty Block (label) @35
Culled Empty Block (label) @36
Culled Empty Block (label) @37
Culled Empty Block (label) main::toD0181_@1
Culled Empty Block (label) main::toD0182_@1
Culled Empty Block (label) @34
Culled Empty Block (label) @39
Culled Empty Block (label) init_angle_screen::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@3
@3: scope:[] from @begin
to:@8
@8: scope:[] from @begin
(byte*) D018#0 ← ((byte*)) (number) $d018
(dword*) CIA2_TIMER_AB#0 ← ((dword*)) (number) $dd04
(byte*) CIA2_TIMER_A_CONTROL#0 ← ((byte*)) (number) $dd0e
@ -72,7 +78,7 @@ CONTROL FLOW GRAPH SSA
(byte) CIA_TIMER_CONTROL_CONTINUOUS#0 ← (number) 0
(byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0 ← (number) 0
(byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 ← (number) $40
to:@8
to:@13
init_font_hex: scope:[init_font_hex] from main
(byte*) init_font_hex::charset#6 ← phi( main/(byte*) init_font_hex::charset#1 )
(byte*) init_font_hex::proto_hi#0 ← (byte[]) FONT_HEX_PROTO#0
@ -142,13 +148,13 @@ init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
return
to:@return
@8: scope:[] from @3
@13: scope:[] from @8
(byte[]) FONT_HEX_PROTO#0 ← { (number) 2, (number) 5, (number) 5, (number) 5, (number) 2, (number) 6, (number) 2, (number) 2, (number) 2, (number) 7, (number) 6, (number) 1, (number) 2, (number) 4, (number) 7, (number) 6, (number) 1, (number) 2, (number) 1, (number) 6, (number) 5, (number) 5, (number) 7, (number) 1, (number) 1, (number) 7, (number) 4, (number) 6, (number) 1, (number) 6, (number) 3, (number) 4, (number) 6, (number) 5, (number) 2, (number) 7, (number) 1, (number) 1, (number) 1, (number) 1, (number) 2, (number) 5, (number) 2, (number) 5, (number) 2, (number) 2, (number) 5, (number) 3, (number) 1, (number) 1, (number) 2, (number) 5, (number) 7, (number) 5, (number) 5, (number) 6, (number) 5, (number) 6, (number) 5, (number) 6, (number) 2, (number) 5, (number) 4, (number) 5, (number) 2, (number) 6, (number) 5, (number) 5, (number) 5, (number) 6, (number) 7, (number) 4, (number) 6, (number) 4, (number) 7, (number) 7, (number) 4, (number) 6, (number) 4, (number) 4 }
(byte) CORDIC_ITERATIONS_16#0 ← (number) $f
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 ← kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@10
to:@15
atan2_16: scope:[atan2_16] from init_angle_screen::@2
(signed word) atan2_16::x#9 ← phi( init_angle_screen::@2/(signed word) atan2_16::x#0 )
(signed word) atan2_16::y#1 ← phi( init_angle_screen::@2/(signed word) atan2_16::y#0 )
@ -359,9 +365,9 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(word) atan2_16::return#1 ← (word) atan2_16::return#3
return
to:@return
@10: scope:[] from @8
@15: scope:[] from @13
(dword) CLOCKS_PER_INIT#0 ← (number) $12
to:@26
to:@31
clock: scope:[clock] from main::@5
(number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0)
(dword) clock::return#0 ← (number~) clock::$0
@ -433,9 +439,9 @@ print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1
print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2
return
to:@return
@26: scope:[] from @10
@31: scope:[] from @15
(byte[]) print_hextab#0 ← (const string) $0
to:@33
to:@38
print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1
(byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 )
(byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 )
@ -466,11 +472,11 @@ print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1
print_char_at::@return: scope:[print_char_at] from print_char_at
return
to:@return
@33: scope:[] from @26
@38: scope:[] from @31
(byte*) CHARSET#0 ← ((byte*)) (number) $2000
(byte*) SCREEN#0 ← ((byte*)) (number) $2800
to:@35
main: scope:[main] from @35
to:@40
main: scope:[main] from @40
(byte*) init_font_hex::charset#1 ← (byte*) CHARSET#0
call init_font_hex
to:main::@3
@ -623,21 +629,21 @@ init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@5
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@3
return
to:@return
@35: scope:[] from @33
@40: scope:[] from @38
call main
to:@36
@36: scope:[] from @35
to:@41
@41: scope:[] from @40
to:@end
@end: scope:[] from @36
@end: scope:[] from @41
SYMBOL TABLE SSA
(const string) $0 = (string) "0123456789abcdef"
(label) @10
(label) @26
(label) @3
(label) @33
(label) @35
(label) @36
(label) @13
(label) @15
(label) @31
(label) @38
(label) @40
(label) @41
(label) @8
(label) @begin
(label) @end
@ -1917,13 +1923,13 @@ Added new block during phi lifting atan2_16::@39(between atan2_16::@7 and atan2_
Added new block during phi lifting init_angle_screen::@6(between init_angle_screen::@3 and init_angle_screen::@1)
Added new block during phi lifting init_angle_screen::@7(between init_angle_screen::@5 and init_angle_screen::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @8
Adding NOP phi() at start of @10
Adding NOP phi() at start of @26
Adding NOP phi() at start of @33
Adding NOP phi() at start of @35
Adding NOP phi() at start of @36
Adding NOP phi() at start of @13
Adding NOP phi() at start of @15
Adding NOP phi() at start of @31
Adding NOP phi() at start of @38
Adding NOP phi() at start of @40
Adding NOP phi() at start of @41
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
@ -2005,12 +2011,12 @@ Coalesced [212] init_font_hex::c1#5 ← init_font_hex::c1#1
Coalesced [213] init_font_hex::i#3 ← init_font_hex::i#1
Coalesced [214] init_font_hex::idx#7 ← init_font_hex::idx#2
Coalesced down to 28 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) @8
Culled Empty Block (label) @10
Culled Empty Block (label) @26
Culled Empty Block (label) @33
Culled Empty Block (label) @36
Culled Empty Block (label) @13
Culled Empty Block (label) @15
Culled Empty Block (label) @31
Culled Empty Block (label) @38
Culled Empty Block (label) @41
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@7
@ -2029,7 +2035,7 @@ Culled Empty Block (label) atan2_16::@37
Culled Empty Block (label) init_font_hex::@7
Culled Empty Block (label) init_font_hex::@8
Culled Empty Block (label) init_font_hex::@9
Renumbering block @35 to @1
Renumbering block @40 to @1
Renumbering block atan2_16::@13 to atan2_16::@9
Renumbering block atan2_16::@15 to atan2_16::@10
Renumbering block atan2_16::@16 to atan2_16::@11

View File

@ -6,15 +6,20 @@ Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items -
Fixing pointer increment (word*) init_squares::squares ← ++ (word*) init_squares::squares
Fixing pointer addition (word~) sqrt::$1 ← (word*) sqrt::found - (word*) SQUARES
Fixing pointer array-indexing *((word*) SQUARES + (byte) sqr::val)
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Identified constant variable (byte*) HEAP_TOP
Identified constant variable (byte*) main::BASE_SCREEN
Identified constant variable (byte*) main::BASE_CHARSET
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call (byte~) main::$1 ← call toD018 (byte*) SCREEN (byte*) CHARSET
Inlined call (byte~) main::$7 ← call toD018 (byte*) main::BASE_SCREEN (byte*) main::BASE_CHARSET
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) bsearch16u::@11
Culled Empty Block (label) bsearch16u::@12
Culled Empty Block (label) bsearch16u::@14
@ -23,21 +28,16 @@ Culled Empty Block (label) bsearch16u::@17
Culled Empty Block (label) bsearch16u::@4
Culled Empty Block (label) bsearch16u::@5
Culled Empty Block (label) init_squares::@2
Culled Empty Block (label) @4
Culled Empty Block (label) sqr::@1
Culled Empty Block (label) @5
Culled Empty Block (label) sqrt::@1
Culled Empty Block (label) @7
Culled Empty Block (label) @8
Culled Empty Block (label) @9
Culled Empty Block (label) sqr::@1
Culled Empty Block (label) @10
Culled Empty Block (label) init_font_hex::@6
Culled Empty Block (label) clock::@1
Culled Empty Block (label) sqrt::@1
Culled Empty Block (label) @12
Culled Empty Block (label) @13
Culled Empty Block (label) @14
Culled Empty Block (label) @15
Culled Empty Block (label) @16
Culled Empty Block (label) init_font_hex::@6
Culled Empty Block (label) clock::@1
Culled Empty Block (label) @17
Culled Empty Block (label) @18
Culled Empty Block (label) @19
@ -48,15 +48,20 @@ Culled Empty Block (label) @23
Culled Empty Block (label) @24
Culled Empty Block (label) @25
Culled Empty Block (label) @26
Culled Empty Block (label) @27
Culled Empty Block (label) @28
Culled Empty Block (label) @29
Culled Empty Block (label) @30
Culled Empty Block (label) @31
Culled Empty Block (label) @32
Culled Empty Block (label) @33
Culled Empty Block (label) @34
Culled Empty Block (label) @35
Culled Empty Block (label) @36
Culled Empty Block (label) @37
Culled Empty Block (label) @38
Culled Empty Block (label) main::toD0181_@1
Culled Empty Block (label) main::toD0182_@1
Culled Empty Block (label) @35
Culled Empty Block (label) @40
Culled Empty Block (label) init_dist_screen::@13
Culled Empty Block (label) init_dist_screen::@14
Culled Empty Block (label) init_dist_screen::@9
@ -65,9 +70,11 @@ Culled Empty Block (label) init_dist_screen::@12
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000
(byte*) heap_head#0 ← (byte*) HEAP_TOP#0
to:@3
to:@8
malloc: scope:[malloc] from init_squares
(word) malloc::size#1 ← phi( init_squares/(word) malloc::size#0 )
(byte*) heap_head#10 ← phi( init_squares/(byte*) heap_head#19 )
@ -165,11 +172,11 @@ bsearch16u::@3: scope:[bsearch16u] from bsearch16u::@1 bsearch16u::@2
(word*~) bsearch16u::$4 ← phi( bsearch16u::@1/(word*~) bsearch16u::$3 bsearch16u::@2/(word*~) bsearch16u::$2 )
(word*) bsearch16u::return#2 ← (word*~) bsearch16u::$4
to:bsearch16u::@return
@3: scope:[] from @begin
(byte*) heap_head#43 ← phi( @begin/(byte*) heap_head#0 )
@8: scope:[] from @4
(byte*) heap_head#43 ← phi( @4/(byte*) heap_head#0 )
(byte) NUM_SQUARES#0 ← (number) $ff
(word*) SQUARES#0 ← (word*) 0
to:@6
to:@11
init_squares: scope:[init_squares] from init_dist_screen
(byte*) heap_head#19 ← phi( init_dist_screen/(byte*) heap_head#23 )
(byte) NUM_SQUARES#6 ← phi( init_dist_screen/(byte) NUM_SQUARES#3 )
@ -249,10 +256,10 @@ sqrt::@return: scope:[sqrt] from sqrt::@2
(byte) sqrt::return#1 ← (byte) sqrt::return#3
return
to:@return
@6: scope:[] from @3
(word*) SQUARES#43 ← phi( @3/(word*) SQUARES#0 )
(byte*) heap_head#38 ← phi( @3/(byte*) heap_head#43 )
(byte) NUM_SQUARES#32 ← phi( @3/(byte) NUM_SQUARES#0 )
@11: scope:[] from @8
(word*) SQUARES#43 ← phi( @8/(word*) SQUARES#0 )
(byte*) heap_head#38 ← phi( @8/(byte*) heap_head#43 )
(byte) NUM_SQUARES#32 ← phi( @8/(byte) NUM_SQUARES#0 )
(byte*) D018#0 ← ((byte*)) (number) $d018
(dword*) CIA2_TIMER_AB#0 ← ((dword*)) (number) $dd04
(byte*) CIA2_TIMER_A_CONTROL#0 ← ((byte*)) (number) $dd0e
@ -262,7 +269,7 @@ sqrt::@return: scope:[sqrt] from sqrt::@2
(byte) CIA_TIMER_CONTROL_CONTINUOUS#0 ← (number) 0
(byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0 ← (number) 0
(byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 ← (number) $40
to:@11
to:@16
init_font_hex: scope:[init_font_hex] from main
(byte*) init_font_hex::charset#6 ← phi( main/(byte*) init_font_hex::charset#1 )
(byte*) init_font_hex::proto_hi#0 ← (byte[]) FONT_HEX_PROTO#0
@ -332,13 +339,13 @@ init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
return
to:@return
@11: scope:[] from @6
(word*) SQUARES#39 ← phi( @6/(word*) SQUARES#43 )
(byte*) heap_head#34 ← phi( @6/(byte*) heap_head#38 )
(byte) NUM_SQUARES#28 ← phi( @6/(byte) NUM_SQUARES#32 )
@16: scope:[] from @11
(word*) SQUARES#39 ← phi( @11/(word*) SQUARES#43 )
(byte*) heap_head#34 ← phi( @11/(byte*) heap_head#38 )
(byte) NUM_SQUARES#28 ← phi( @11/(byte) NUM_SQUARES#32 )
(byte[]) FONT_HEX_PROTO#0 ← { (number) 2, (number) 5, (number) 5, (number) 5, (number) 2, (number) 6, (number) 2, (number) 2, (number) 2, (number) 7, (number) 6, (number) 1, (number) 2, (number) 4, (number) 7, (number) 6, (number) 1, (number) 2, (number) 1, (number) 6, (number) 5, (number) 5, (number) 7, (number) 1, (number) 1, (number) 7, (number) 4, (number) 6, (number) 1, (number) 6, (number) 3, (number) 4, (number) 6, (number) 5, (number) 2, (number) 7, (number) 1, (number) 1, (number) 1, (number) 1, (number) 2, (number) 5, (number) 2, (number) 5, (number) 2, (number) 2, (number) 5, (number) 3, (number) 1, (number) 1, (number) 2, (number) 5, (number) 7, (number) 5, (number) 5, (number) 6, (number) 5, (number) 6, (number) 5, (number) 6, (number) 2, (number) 5, (number) 4, (number) 5, (number) 2, (number) 6, (number) 5, (number) 5, (number) 5, (number) 6, (number) 7, (number) 4, (number) 6, (number) 4, (number) 7, (number) 7, (number) 4, (number) 6, (number) 4, (number) 4 }
(dword) CLOCKS_PER_INIT#0 ← (number) $12
to:@27
to:@32
clock: scope:[clock] from main::@5
(number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0)
(dword) clock::return#0 ← (number~) clock::$0
@ -410,12 +417,12 @@ print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1
print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2
return
to:@return
@27: scope:[] from @11
(word*) SQUARES#34 ← phi( @11/(word*) SQUARES#39 )
(byte*) heap_head#30 ← phi( @11/(byte*) heap_head#34 )
(byte) NUM_SQUARES#23 ← phi( @11/(byte) NUM_SQUARES#28 )
@32: scope:[] from @16
(word*) SQUARES#34 ← phi( @16/(word*) SQUARES#39 )
(byte*) heap_head#30 ← phi( @16/(byte*) heap_head#34 )
(byte) NUM_SQUARES#23 ← phi( @16/(byte) NUM_SQUARES#28 )
(byte[]) print_hextab#0 ← (const string) $0
to:@34
to:@39
print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1
(byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 )
(byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 )
@ -446,17 +453,17 @@ print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1
print_char_at::@return: scope:[print_char_at] from print_char_at
return
to:@return
@34: scope:[] from @27
(word*) SQUARES#33 ← phi( @27/(word*) SQUARES#34 )
(byte*) heap_head#29 ← phi( @27/(byte*) heap_head#30 )
(byte) NUM_SQUARES#22 ← phi( @27/(byte) NUM_SQUARES#23 )
@39: scope:[] from @32
(word*) SQUARES#33 ← phi( @32/(word*) SQUARES#34 )
(byte*) heap_head#29 ← phi( @32/(byte*) heap_head#30 )
(byte) NUM_SQUARES#22 ← phi( @32/(byte) NUM_SQUARES#23 )
(byte*) CHARSET#0 ← ((byte*)) (number) $2000
(byte*) SCREEN#0 ← ((byte*)) (number) $2800
to:@36
main: scope:[main] from @36
(word*) SQUARES#46 ← phi( @36/(word*) SQUARES#25 )
(byte*) heap_head#44 ← phi( @36/(byte*) heap_head#25 )
(byte) NUM_SQUARES#36 ← phi( @36/(byte) NUM_SQUARES#17 )
to:@41
main: scope:[main] from @41
(word*) SQUARES#46 ← phi( @41/(word*) SQUARES#25 )
(byte*) heap_head#44 ← phi( @41/(byte*) heap_head#25 )
(byte) NUM_SQUARES#36 ← phi( @41/(byte) NUM_SQUARES#17 )
(byte*) init_font_hex::charset#1 ← (byte*) CHARSET#0
call init_font_hex
to:main::@3
@ -780,31 +787,32 @@ init_dist_screen::@return: scope:[init_dist_screen] from init_dist_screen::@11
(word*) SQUARES#6 ← (word*) SQUARES#15
return
to:@return
@36: scope:[] from @34
(word*) SQUARES#25 ← phi( @34/(word*) SQUARES#33 )
(byte*) heap_head#25 ← phi( @34/(byte*) heap_head#29 )
(byte) NUM_SQUARES#17 ← phi( @34/(byte) NUM_SQUARES#22 )
@41: scope:[] from @39
(word*) SQUARES#25 ← phi( @39/(word*) SQUARES#33 )
(byte*) heap_head#25 ← phi( @39/(byte*) heap_head#29 )
(byte) NUM_SQUARES#17 ← phi( @39/(byte) NUM_SQUARES#22 )
call main
to:@37
@37: scope:[] from @36
(word*) SQUARES#16 ← phi( @36/(word*) SQUARES#4 )
(byte*) heap_head#18 ← phi( @36/(byte*) heap_head#6 )
(byte) NUM_SQUARES#12 ← phi( @36/(byte) NUM_SQUARES#2 )
to:@42
@42: scope:[] from @41
(word*) SQUARES#16 ← phi( @41/(word*) SQUARES#4 )
(byte*) heap_head#18 ← phi( @41/(byte*) heap_head#6 )
(byte) NUM_SQUARES#12 ← phi( @41/(byte) NUM_SQUARES#2 )
(byte) NUM_SQUARES#5 ← (byte) NUM_SQUARES#12
(byte*) heap_head#9 ← (byte*) heap_head#18
(word*) SQUARES#7 ← (word*) SQUARES#16
to:@end
@end: scope:[] from @37
@end: scope:[] from @42
SYMBOL TABLE SSA
(const string) $0 = (string) "0123456789abcdef"
(label) @11
(label) @27
(label) @3
(label) @34
(label) @36
(label) @37
(label) @6
(label) @16
(label) @32
(label) @39
(label) @4
(label) @41
(label) @42
(label) @8
(label) @begin
(label) @end
(byte*) CHARSET
@ -2350,13 +2358,14 @@ Added new block during phi lifting init_font_hex::@9(between init_font_hex::@3 a
Added new block during phi lifting init_dist_screen::@19(between init_dist_screen::@11 and init_dist_screen::@1)
Added new block during phi lifting init_dist_screen::@20(between init_dist_screen::@18 and init_dist_screen::@5)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @6
Adding NOP phi() at start of @4
Adding NOP phi() at start of @8
Adding NOP phi() at start of @11
Adding NOP phi() at start of @27
Adding NOP phi() at start of @34
Adding NOP phi() at start of @36
Adding NOP phi() at start of @37
Adding NOP phi() at start of @16
Adding NOP phi() at start of @32
Adding NOP phi() at start of @39
Adding NOP phi() at start of @41
Adding NOP phi() at start of @42
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
@ -2378,66 +2387,67 @@ Adding NOP phi() at start of init_squares::@3
Adding NOP phi() at start of malloc
Adding NOP phi() at start of init_font_hex
CALL GRAPH
Calls in [] to main:7
Calls in [main] to init_font_hex:11 clock_start:16 init_dist_screen:18 clock:20 print_dword_at:25
Calls in [print_dword_at] to print_word_at:33 print_word_at:36
Calls in [print_word_at] to print_byte_at:44 print_byte_at:49
Calls in [print_byte_at] to print_char_at:58 print_char_at:64
Calls in [init_dist_screen] to init_squares:73 sqr:83 sqr:94 sqrt:99
Calls in [sqrt] to bsearch16u:124
Calls in [init_squares] to malloc:164
Calls in [] to main:8
Calls in [main] to init_font_hex:12 clock_start:17 init_dist_screen:19 clock:21 print_dword_at:26
Calls in [print_dword_at] to print_word_at:34 print_word_at:37
Calls in [print_word_at] to print_byte_at:45 print_byte_at:50
Calls in [print_byte_at] to print_char_at:59 print_char_at:65
Calls in [init_dist_screen] to init_squares:74 sqr:84 sqr:95 sqrt:100
Calls in [sqrt] to bsearch16u:125
Calls in [init_squares] to malloc:165
Created 31 initial phi equivalence classes
Coalesced [32] print_word_at::w#4 ← print_word_at::w#0
Coalesced [35] print_word_at::w#5 ← print_word_at::w#1
Coalesced [42] print_byte_at::b#4 ← print_byte_at::b#0
Coalesced [43] print_byte_at::at#4 ← print_byte_at::at#0
Coalesced [47] print_byte_at::b#5 ← print_byte_at::b#1
Coalesced [48] print_byte_at::at#5 ← print_byte_at::at#1
Coalesced [56] print_char_at::ch#3 ← print_char_at::ch#0
Coalesced [57] print_char_at::at#3 ← print_char_at::at#0
Coalesced [62] print_char_at::ch#4 ← print_char_at::ch#1
Coalesced [63] print_char_at::at#4 ← print_char_at::at#1
Coalesced [79] init_dist_screen::yd#2 ← init_dist_screen::$5
Coalesced [82] sqr::val#3 ← sqr::val#0
Coalesced [90] init_dist_screen::xd#2 ← init_dist_screen::$13
Coalesced [93] sqr::val#4 ← sqr::val#1
Coalesced [114] init_dist_screen::y#14 ← init_dist_screen::y#1
Coalesced [115] init_dist_screen::screen_topline#14 ← init_dist_screen::screen_topline#1
Coalesced [116] init_dist_screen::screen_bottomline#14 ← init_dist_screen::screen_bottomline#1
Coalesced [117] init_dist_screen::x#8 ← init_dist_screen::x#1
Coalesced [118] init_dist_screen::xb#8 ← init_dist_screen::xb#1
Coalesced [120] init_dist_screen::xd#1 ← init_dist_screen::$15
Coalesced [122] init_dist_screen::yd#1 ← init_dist_screen::$7
Coalesced [136] bsearch16u::return#9 ← bsearch16u::$2
Coalesced [138] bsearch16u::return#7 ← bsearch16u::return#2
Coalesced [141] bsearch16u::return#8 ← bsearch16u::items#2
Not coalescing [147] bsearch16u::return#6 ← bsearch16u::pivot#0
Coalesced [151] bsearch16u::num#10 ← bsearch16u::num#1
Coalesced [152] bsearch16u::items#11 ← bsearch16u::items#0
Coalesced [155] bsearch16u::num#9 ← bsearch16u::num#0
Coalesced [156] bsearch16u::items#10 ← bsearch16u::items#8
Coalesced [157] bsearch16u::num#11 ← bsearch16u::num#3
Coalesced (already) [158] bsearch16u::items#12 ← bsearch16u::items#2
Coalesced [175] init_squares::sqr#3 ← init_squares::sqr#1
Coalesced [176] init_squares::squares#3 ← init_squares::squares#1
Coalesced [177] init_squares::i#3 ← init_squares::i#1
Coalesced [188] init_font_hex::charset#9 ← init_font_hex::charset#5
Coalesced [210] init_font_hex::charset#8 ← init_font_hex::charset#0
Coalesced [211] init_font_hex::proto_hi#7 ← init_font_hex::proto_hi#1
Coalesced [212] init_font_hex::c#7 ← init_font_hex::c#1
Coalesced (already) [213] init_font_hex::charset#10 ← init_font_hex::charset#0
Coalesced [214] init_font_hex::proto_lo#5 ← init_font_hex::proto_lo#1
Coalesced [215] init_font_hex::c1#5 ← init_font_hex::c1#1
Coalesced [216] init_font_hex::i#3 ← init_font_hex::i#1
Coalesced [217] init_font_hex::idx#7 ← init_font_hex::idx#2
Coalesced [33] print_word_at::w#4 ← print_word_at::w#0
Coalesced [36] print_word_at::w#5 ← print_word_at::w#1
Coalesced [43] print_byte_at::b#4 ← print_byte_at::b#0
Coalesced [44] print_byte_at::at#4 ← print_byte_at::at#0
Coalesced [48] print_byte_at::b#5 ← print_byte_at::b#1
Coalesced [49] print_byte_at::at#5 ← print_byte_at::at#1
Coalesced [57] print_char_at::ch#3 ← print_char_at::ch#0
Coalesced [58] print_char_at::at#3 ← print_char_at::at#0
Coalesced [63] print_char_at::ch#4 ← print_char_at::ch#1
Coalesced [64] print_char_at::at#4 ← print_char_at::at#1
Coalesced [80] init_dist_screen::yd#2 ← init_dist_screen::$5
Coalesced [83] sqr::val#3 ← sqr::val#0
Coalesced [91] init_dist_screen::xd#2 ← init_dist_screen::$13
Coalesced [94] sqr::val#4 ← sqr::val#1
Coalesced [115] init_dist_screen::y#14 ← init_dist_screen::y#1
Coalesced [116] init_dist_screen::screen_topline#14 ← init_dist_screen::screen_topline#1
Coalesced [117] init_dist_screen::screen_bottomline#14 ← init_dist_screen::screen_bottomline#1
Coalesced [118] init_dist_screen::x#8 ← init_dist_screen::x#1
Coalesced [119] init_dist_screen::xb#8 ← init_dist_screen::xb#1
Coalesced [121] init_dist_screen::xd#1 ← init_dist_screen::$15
Coalesced [123] init_dist_screen::yd#1 ← init_dist_screen::$7
Coalesced [137] bsearch16u::return#9 ← bsearch16u::$2
Coalesced [139] bsearch16u::return#7 ← bsearch16u::return#2
Coalesced [142] bsearch16u::return#8 ← bsearch16u::items#2
Not coalescing [148] bsearch16u::return#6 ← bsearch16u::pivot#0
Coalesced [152] bsearch16u::num#10 ← bsearch16u::num#1
Coalesced [153] bsearch16u::items#11 ← bsearch16u::items#0
Coalesced [156] bsearch16u::num#9 ← bsearch16u::num#0
Coalesced [157] bsearch16u::items#10 ← bsearch16u::items#8
Coalesced [158] bsearch16u::num#11 ← bsearch16u::num#3
Coalesced (already) [159] bsearch16u::items#12 ← bsearch16u::items#2
Coalesced [176] init_squares::sqr#3 ← init_squares::sqr#1
Coalesced [177] init_squares::squares#3 ← init_squares::squares#1
Coalesced [178] init_squares::i#3 ← init_squares::i#1
Coalesced [189] init_font_hex::charset#9 ← init_font_hex::charset#5
Coalesced [211] init_font_hex::charset#8 ← init_font_hex::charset#0
Coalesced [212] init_font_hex::proto_hi#7 ← init_font_hex::proto_hi#1
Coalesced [213] init_font_hex::c#7 ← init_font_hex::c#1
Coalesced (already) [214] init_font_hex::charset#10 ← init_font_hex::charset#0
Coalesced [215] init_font_hex::proto_lo#5 ← init_font_hex::proto_lo#1
Coalesced [216] init_font_hex::c1#5 ← init_font_hex::c1#1
Coalesced [217] init_font_hex::i#3 ← init_font_hex::i#1
Coalesced [218] init_font_hex::idx#7 ← init_font_hex::idx#2
Coalesced down to 27 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) @6
Culled Empty Block (label) @4
Culled Empty Block (label) @8
Culled Empty Block (label) @11
Culled Empty Block (label) @27
Culled Empty Block (label) @34
Culled Empty Block (label) @37
Culled Empty Block (label) @16
Culled Empty Block (label) @32
Culled Empty Block (label) @39
Culled Empty Block (label) @42
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@7
@ -2455,7 +2465,7 @@ Culled Empty Block (label) init_squares::@4
Culled Empty Block (label) init_font_hex::@7
Culled Empty Block (label) init_font_hex::@8
Culled Empty Block (label) init_font_hex::@9
Renumbering block @36 to @1
Renumbering block @41 to @1
Renumbering block bsearch16u::@2 to bsearch16u::@1
Renumbering block bsearch16u::@3 to bsearch16u::@2
Renumbering block bsearch16u::@6 to bsearch16u::@3

View File

@ -14,15 +14,21 @@ Fixing pointer array-indexing *((word[]) main::bucket + (byte) main::i)
Fixing pointer array-indexing *((word*[]) BUCKETS + (word) init_buckets::i2)
Fixing pointer array-indexing *((word*[]) BUCKETS + (word~) init_buckets::$9)
Fixing pointer array-indexing *((word*) init_buckets::bucket + *((byte[]) BUCKET_IDX + (byte) init_buckets::distance))
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Warning! Adding boolean cast to non-boolean sub-expression (byte) atan2_16::shift
Identified constant variable (byte*) HEAP_TOP
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @9
Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) bsearch16u::@11
Culled Empty Block (label) bsearch16u::@12
Culled Empty Block (label) bsearch16u::@14
@ -31,9 +37,9 @@ Culled Empty Block (label) bsearch16u::@17
Culled Empty Block (label) bsearch16u::@4
Culled Empty Block (label) bsearch16u::@5
Culled Empty Block (label) init_squares::@2
Culled Empty Block (label) @8
Culled Empty Block (label) @13
Culled Empty Block (label) sqr::@1
Culled Empty Block (label) @9
Culled Empty Block (label) @14
Culled Empty Block (label) sqrt::@1
Culled Empty Block (label) atan2_16::@9
Culled Empty Block (label) atan2_16::@10
@ -47,7 +53,7 @@ Culled Empty Block (label) atan2_16::@23
Culled Empty Block (label) atan2_16::@31
Culled Empty Block (label) atan2_16::@32
Culled Empty Block (label) atan2_16::@14
Culled Empty Block (label) @11
Culled Empty Block (label) @16
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@19
Culled Empty Block (label) main::@3
@ -63,9 +69,9 @@ Culled Empty Block (label) main::@26
Culled Empty Block (label) main::@28
Culled Empty Block (label) main::@29
Culled Empty Block (label) init_buckets::@10
Culled Empty Block (label) @14
Culled Empty Block (label) @19
Culled Empty Block (label) init_angle_screen::@4
Culled Empty Block (label) @15
Culled Empty Block (label) @20
Culled Empty Block (label) init_dist_screen::@13
Culled Empty Block (label) init_dist_screen::@14
Culled Empty Block (label) init_dist_screen::@9
@ -77,14 +83,14 @@ CONTROL FLOW GRAPH SSA
(byte*) RASTER#0 ← ((byte*)) (number) $d012
(byte*) BORDERCOL#0 ← ((byte*)) (number) $d020
(byte*) COLS#0 ← ((byte*)) (number) $d800
to:@4
@4: scope:[] from @begin
to:@8
@8: scope:[] from @begin
(byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000
(byte*) heap_head#0 ← (byte*) HEAP_TOP#0
to:@7
malloc: scope:[malloc] from @12 @13 @17 @19 @20 init_buckets::@5 init_squares
(word) malloc::size#7 ← phi( @12/(word) malloc::size#1 @13/(word) malloc::size#3 @17/(word) malloc::size#2 @19/(word) malloc::size#4 @20/(word) malloc::size#5 init_buckets::@5/(word) malloc::size#6 init_squares/(word) malloc::size#0 )
(byte*) heap_head#18 ← phi( @12/(byte*) heap_head#35 @13/(byte*) heap_head#36 @17/(byte*) heap_head#5 @19/(byte*) heap_head#10 @20/(byte*) heap_head#11 init_buckets::@5/(byte*) heap_head#37 init_squares/(byte*) heap_head#38 )
to:@12
malloc: scope:[malloc] from @17 @18 @22 @24 @25 init_buckets::@5 init_squares
(word) malloc::size#7 ← phi( @17/(word) malloc::size#1 @18/(word) malloc::size#3 @22/(word) malloc::size#2 @24/(word) malloc::size#4 @25/(word) malloc::size#5 init_buckets::@5/(word) malloc::size#6 init_squares/(word) malloc::size#0 )
(byte*) heap_head#18 ← phi( @17/(byte*) heap_head#35 @18/(byte*) heap_head#36 @22/(byte*) heap_head#5 @24/(byte*) heap_head#10 @25/(byte*) heap_head#11 init_buckets::@5/(byte*) heap_head#37 init_squares/(byte*) heap_head#38 )
(byte*~) malloc::$0 ← (byte*) heap_head#18 - (word) malloc::size#7
(byte*) malloc::mem#0 ← (byte*~) malloc::$0
(byte*) heap_head#1 ← (byte*) malloc::mem#0
@ -179,11 +185,11 @@ bsearch16u::@3: scope:[bsearch16u] from bsearch16u::@1 bsearch16u::@2
(word*~) bsearch16u::$4 ← phi( bsearch16u::@1/(word*~) bsearch16u::$3 bsearch16u::@2/(word*~) bsearch16u::$2 )
(word*) bsearch16u::return#2 ← (word*~) bsearch16u::$4
to:bsearch16u::@return
@7: scope:[] from @4
(byte*) heap_head#54 ← phi( @4/(byte*) heap_head#0 )
@12: scope:[] from @8
(byte*) heap_head#54 ← phi( @8/(byte*) heap_head#0 )
(byte) NUM_SQUARES#0 ← (number) $ff
(word*) SQUARES#0 ← (word*) 0
to:@10
to:@15
init_squares: scope:[init_squares] from init_dist_screen
(byte*) heap_head#38 ← phi( init_dist_screen/(byte*) heap_head#44 )
(byte) NUM_SQUARES#6 ← phi( init_dist_screen/(byte) NUM_SQUARES#3 )
@ -263,15 +269,15 @@ sqrt::@return: scope:[sqrt] from sqrt::@2
(byte) sqrt::return#1 ← (byte) sqrt::return#3
return
to:@return
@10: scope:[] from @7
(word*) SQUARES#57 ← phi( @7/(word*) SQUARES#0 )
(byte) NUM_SQUARES#51 ← phi( @7/(byte) NUM_SQUARES#0 )
(byte*) heap_head#47 ← phi( @7/(byte*) heap_head#54 )
@15: scope:[] from @12
(word*) SQUARES#57 ← phi( @12/(word*) SQUARES#0 )
(byte) NUM_SQUARES#51 ← phi( @12/(byte) NUM_SQUARES#0 )
(byte*) heap_head#47 ← phi( @12/(byte*) heap_head#54 )
(byte) CORDIC_ITERATIONS_16#0 ← (number) $f
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 ← kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@12
to:@17
atan2_16: scope:[atan2_16] from init_angle_screen::@2
(signed word) atan2_16::x#9 ← phi( init_angle_screen::@2/(signed word) atan2_16::x#0 )
(signed word) atan2_16::y#1 ← phi( init_angle_screen::@2/(signed word) atan2_16::y#0 )
@ -482,41 +488,41 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(word) atan2_16::return#1 ← (word) atan2_16::return#3
return
to:@return
@12: scope:[] from @10
(word*) SQUARES#56 ← phi( @10/(word*) SQUARES#57 )
(byte) NUM_SQUARES#49 ← phi( @10/(byte) NUM_SQUARES#51 )
(byte*) heap_head#35 ← phi( @10/(byte*) heap_head#47 )
@17: scope:[] from @15
(word*) SQUARES#56 ← phi( @15/(word*) SQUARES#57 )
(byte) NUM_SQUARES#49 ← phi( @15/(byte) NUM_SQUARES#51 )
(byte*) heap_head#35 ← phi( @15/(byte*) heap_head#47 )
(word) malloc::size#1 ← (number) $3e8
call malloc
(void*) malloc::return#3 ← (void*) malloc::return#1
to:@17
@17: scope:[] from @12
(word*) SQUARES#54 ← phi( @12/(word*) SQUARES#56 )
(byte) NUM_SQUARES#45 ← phi( @12/(byte) NUM_SQUARES#49 )
(byte*) heap_head#22 ← phi( @12/(byte*) heap_head#2 )
(void*) malloc::return#11 ← phi( @12/(void*) malloc::return#3 )
to:@22
@22: scope:[] from @17
(word*) SQUARES#54 ← phi( @17/(word*) SQUARES#56 )
(byte) NUM_SQUARES#45 ← phi( @17/(byte) NUM_SQUARES#49 )
(byte*) heap_head#22 ← phi( @17/(byte*) heap_head#2 )
(void*) malloc::return#11 ← phi( @17/(void*) malloc::return#3 )
(void*~) $0 ← (void*) malloc::return#11
(byte*) heap_head#5 ← (byte*) heap_head#22
(byte[]) SCREEN_DIST#0 ← ((byte*)) (void*~) $0
(word) malloc::size#2 ← (number) $3e8
call malloc
(void*) malloc::return#4 ← (void*) malloc::return#1
to:@18
@18: scope:[] from @17
(word*) SQUARES#53 ← phi( @17/(word*) SQUARES#54 )
(byte) NUM_SQUARES#43 ← phi( @17/(byte) NUM_SQUARES#45 )
(byte*) heap_head#23 ← phi( @17/(byte*) heap_head#2 )
(void*) malloc::return#12 ← phi( @17/(void*) malloc::return#4 )
to:@23
@23: scope:[] from @22
(word*) SQUARES#53 ← phi( @22/(word*) SQUARES#54 )
(byte) NUM_SQUARES#43 ← phi( @22/(byte) NUM_SQUARES#45 )
(byte*) heap_head#23 ← phi( @22/(byte*) heap_head#2 )
(void*) malloc::return#12 ← phi( @22/(void*) malloc::return#4 )
(void*~) $1 ← (void*) malloc::return#12
(byte*) heap_head#6 ← (byte*) heap_head#23
(byte[]) SCREEN_ANGLE#0 ← ((byte*)) (void*~) $1
(byte*) SCREEN_FILL#0 ← ((byte*)) (number) $400
(byte) FILL_CHAR#0 ← (byte) '*'
to:@13
main: scope:[main] from @16
(word*) SQUARES#21 ← phi( @16/(word*) SQUARES#25 )
(byte*) heap_head#40 ← phi( @16/(byte*) heap_head#46 )
(byte) NUM_SQUARES#14 ← phi( @16/(byte) NUM_SQUARES#17 )
to:@18
main: scope:[main] from @21
(word*) SQUARES#21 ← phi( @21/(word*) SQUARES#25 )
(byte*) heap_head#40 ← phi( @21/(byte*) heap_head#46 )
(byte) NUM_SQUARES#14 ← phi( @21/(byte) NUM_SQUARES#17 )
asm { sei }
(byte*) init_dist_screen::screen#0 ← (byte[]) SCREEN_DIST#0
call init_dist_screen
@ -707,21 +713,21 @@ main::@return: scope:[main] from main::@24
(word*) SQUARES#4 ← (word*) SQUARES#13
return
to:@return
@13: scope:[] from @18
(word*) SQUARES#49 ← phi( @18/(word*) SQUARES#53 )
(byte) NUM_SQUARES#38 ← phi( @18/(byte) NUM_SQUARES#43 )
(byte*) heap_head#36 ← phi( @18/(byte*) heap_head#6 )
@18: scope:[] from @23
(word*) SQUARES#49 ← phi( @23/(word*) SQUARES#53 )
(byte) NUM_SQUARES#38 ← phi( @23/(byte) NUM_SQUARES#43 )
(byte*) heap_head#36 ← phi( @23/(byte*) heap_head#6 )
(byte) NUM_BUCKETS#0 ← (number) $30
(byte~) $2 ← (byte) NUM_BUCKETS#0 * (const byte) SIZEOF_BYTE
(word) malloc::size#3 ← (byte~) $2
call malloc
(void*) malloc::return#5 ← (void*) malloc::return#1
to:@19
@19: scope:[] from @13
(word*) SQUARES#45 ← phi( @13/(word*) SQUARES#49 )
(byte) NUM_SQUARES#34 ← phi( @13/(byte) NUM_SQUARES#38 )
(byte*) heap_head#27 ← phi( @13/(byte*) heap_head#2 )
(void*) malloc::return#13 ← phi( @13/(void*) malloc::return#5 )
to:@24
@24: scope:[] from @18
(word*) SQUARES#45 ← phi( @18/(word*) SQUARES#49 )
(byte) NUM_SQUARES#34 ← phi( @18/(byte) NUM_SQUARES#38 )
(byte*) heap_head#27 ← phi( @18/(byte*) heap_head#2 )
(void*) malloc::return#13 ← phi( @18/(void*) malloc::return#5 )
(void*~) $3 ← (void*) malloc::return#13
(byte*) heap_head#10 ← (byte*) heap_head#27
(byte[]) BUCKET_SIZES#0 ← ((byte*)) (void*~) $3
@ -729,12 +735,12 @@ main::@return: scope:[main] from main::@24
(word) malloc::size#4 ← (byte~) $4
call malloc
(void*) malloc::return#6 ← (void*) malloc::return#1
to:@20
@20: scope:[] from @19
(word*) SQUARES#39 ← phi( @19/(word*) SQUARES#45 )
(byte) NUM_SQUARES#28 ← phi( @19/(byte) NUM_SQUARES#34 )
(byte*) heap_head#28 ← phi( @19/(byte*) heap_head#2 )
(void*) malloc::return#14 ← phi( @19/(void*) malloc::return#6 )
to:@25
@25: scope:[] from @24
(word*) SQUARES#39 ← phi( @24/(word*) SQUARES#45 )
(byte) NUM_SQUARES#28 ← phi( @24/(byte) NUM_SQUARES#34 )
(byte*) heap_head#28 ← phi( @24/(byte*) heap_head#2 )
(void*) malloc::return#14 ← phi( @24/(void*) malloc::return#6 )
(void*~) $5 ← (void*) malloc::return#14
(byte*) heap_head#11 ← (byte*) heap_head#28
(word*[]) BUCKETS#0 ← ((word**)) (void*~) $5
@ -742,16 +748,16 @@ main::@return: scope:[main] from main::@24
(word) malloc::size#5 ← (byte~) $6
call malloc
(void*) malloc::return#7 ← (void*) malloc::return#1
to:@21
@21: scope:[] from @20
(word*) SQUARES#34 ← phi( @20/(word*) SQUARES#39 )
(byte) NUM_SQUARES#23 ← phi( @20/(byte) NUM_SQUARES#28 )
(byte*) heap_head#29 ← phi( @20/(byte*) heap_head#2 )
(void*) malloc::return#15 ← phi( @20/(void*) malloc::return#7 )
to:@26
@26: scope:[] from @25
(word*) SQUARES#34 ← phi( @25/(word*) SQUARES#39 )
(byte) NUM_SQUARES#23 ← phi( @25/(byte) NUM_SQUARES#28 )
(byte*) heap_head#29 ← phi( @25/(byte*) heap_head#2 )
(void*) malloc::return#15 ← phi( @25/(void*) malloc::return#7 )
(void*~) $7 ← (void*) malloc::return#15
(byte*) heap_head#12 ← (byte*) heap_head#29
(byte[]) BUCKET_IDX#0 ← ((byte*)) (void*~) $7
to:@16
to:@21
init_buckets: scope:[init_buckets] from main::@31
(byte*) heap_head#74 ← phi( main::@31/(byte*) heap_head#41 )
(byte*) init_buckets::screen#6 ← phi( main::@31/(byte*) init_buckets::screen#0 )
@ -1129,21 +1135,21 @@ init_dist_screen::@return: scope:[init_dist_screen] from init_dist_screen::@11
(word*) SQUARES#6 ← (word*) SQUARES#15
return
to:@return
@16: scope:[] from @21
(word*) SQUARES#25 ← phi( @21/(word*) SQUARES#34 )
(byte*) heap_head#46 ← phi( @21/(byte*) heap_head#12 )
(byte) NUM_SQUARES#17 ← phi( @21/(byte) NUM_SQUARES#23 )
@21: scope:[] from @26
(word*) SQUARES#25 ← phi( @26/(word*) SQUARES#34 )
(byte*) heap_head#46 ← phi( @26/(byte*) heap_head#12 )
(byte) NUM_SQUARES#17 ← phi( @26/(byte) NUM_SQUARES#23 )
call main
to:@22
@22: scope:[] from @16
(word*) SQUARES#16 ← phi( @16/(word*) SQUARES#4 )
(byte*) heap_head#34 ← phi( @16/(byte*) heap_head#9 )
(byte) NUM_SQUARES#12 ← phi( @16/(byte) NUM_SQUARES#2 )
to:@27
@27: scope:[] from @21
(word*) SQUARES#16 ← phi( @21/(word*) SQUARES#4 )
(byte*) heap_head#34 ← phi( @21/(byte*) heap_head#9 )
(byte) NUM_SQUARES#12 ← phi( @21/(byte) NUM_SQUARES#2 )
(byte) NUM_SQUARES#5 ← (byte) NUM_SQUARES#12
(byte*) heap_head#17 ← (byte*) heap_head#34
(word*) SQUARES#7 ← (word*) SQUARES#16
to:@end
@end: scope:[] from @22
@end: scope:[] from @27
SYMBOL TABLE SSA
(void*~) $0
@ -1154,18 +1160,18 @@ SYMBOL TABLE SSA
(void*~) $5
(byte~) $6
(void*~) $7
(label) @10
(label) @12
(label) @13
(label) @16
(label) @15
(label) @17
(label) @18
(label) @19
(label) @20
(label) @21
(label) @22
(label) @4
(label) @7
(label) @23
(label) @24
(label) @25
(label) @26
(label) @27
(label) @8
(label) @begin
(label) @end
(byte*) BORDERCOL
@ -3137,12 +3143,12 @@ Added new block during phi lifting init_angle_screen::@7(between init_angle_scre
Added new block during phi lifting init_dist_screen::@19(between init_dist_screen::@11 and init_dist_screen::@1)
Added new block during phi lifting init_dist_screen::@20(between init_dist_screen::@18 and init_dist_screen::@5)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @7
Adding NOP phi() at start of @10
Adding NOP phi() at start of @8
Adding NOP phi() at start of @12
Adding NOP phi() at start of @16
Adding NOP phi() at start of @22
Adding NOP phi() at start of @15
Adding NOP phi() at start of @17
Adding NOP phi() at start of @21
Adding NOP phi() at start of @27
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@32
Adding NOP phi() at start of main::@6
@ -3256,10 +3262,10 @@ Coalesced [341] init_squares::sqr#3 ← init_squares::sqr#1
Coalesced [342] init_squares::squares#3 ← init_squares::squares#1
Coalesced [343] init_squares::i#3 ← init_squares::i#1
Coalesced down to 45 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) @7
Culled Empty Block (label) @10
Culled Empty Block (label) @22
Culled Empty Block (label) @8
Culled Empty Block (label) @12
Culled Empty Block (label) @15
Culled Empty Block (label) @27
Culled Empty Block (label) main::@32
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@24
@ -3283,14 +3289,14 @@ Culled Empty Block (label) init_dist_screen::@20
Culled Empty Block (label) bsearch16u::@1
Culled Empty Block (label) bsearch16u::@18
Culled Empty Block (label) init_squares::@4
Renumbering block @12 to @1
Renumbering block @13 to @2
Renumbering block @16 to @3
Renumbering block @17 to @4
Renumbering block @18 to @5
Renumbering block @19 to @6
Renumbering block @20 to @7
Renumbering block @21 to @8
Renumbering block @17 to @1
Renumbering block @18 to @2
Renumbering block @21 to @3
Renumbering block @22 to @4
Renumbering block @23 to @5
Renumbering block @24 to @6
Renumbering block @25 to @7
Renumbering block @26 to @8
Renumbering block bsearch16u::@2 to bsearch16u::@1
Renumbering block bsearch16u::@3 to bsearch16u::@2
Renumbering block bsearch16u::@6 to bsearch16u::@3

View File

@ -377,8 +377,8 @@ init_squares::@return: scope:[init_squares] from init_squares::@1
[189] return
to:@return
malloc: scope:[malloc] from @1 @3 init_squares
[190] (word) malloc::size#3 ← phi( @3/(word) $3e8 @1/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD )
[190] (byte*) heap_head#12 ← phi( @3/(byte*) heap_head#1 @1/(const byte*) HEAP_TOP#0 init_squares/(byte*) heap_head#1 )
[190] (word) malloc::size#3 ← phi( @1/(word) $3e8 @3/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD )
[190] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP#0 @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 )
[191] (byte*) malloc::mem#0 ← (byte*) heap_head#12 - (word) malloc::size#3
[192] (byte*) heap_head#1 ← (byte*) malloc::mem#0
to:malloc::@return

View File

@ -6,11 +6,16 @@ Fixing pointer addition (word~) sqrt::$1 ← (word*) sqrt::found - (word*) SQUAR
Fixing pointer array-indexing *((word*) SQUARES + (byte) sqr::val)
Fixing pointer array-indexing *((word[CORDIC_ITERATIONS_16]) CORDIC_ATAN2_ANGLES_16 + (byte) atan2_16::i)
Fixing pointer array-indexing *((word[CORDIC_ITERATIONS_16]) CORDIC_ATAN2_ANGLES_16 + (byte) atan2_16::i)
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Warning! Adding boolean cast to non-boolean sub-expression (byte) atan2_16::shift
Identified constant variable (byte*) HEAP_TOP
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) malloc::@1
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) bsearch16u::@11
Culled Empty Block (label) bsearch16u::@12
Culled Empty Block (label) bsearch16u::@14
@ -19,9 +24,9 @@ Culled Empty Block (label) bsearch16u::@17
Culled Empty Block (label) bsearch16u::@4
Culled Empty Block (label) bsearch16u::@5
Culled Empty Block (label) init_squares::@2
Culled Empty Block (label) @4
Culled Empty Block (label) @9
Culled Empty Block (label) sqr::@1
Culled Empty Block (label) @5
Culled Empty Block (label) @10
Culled Empty Block (label) sqrt::@1
Culled Empty Block (label) atan2_16::@9
Culled Empty Block (label) atan2_16::@10
@ -35,7 +40,7 @@ Culled Empty Block (label) atan2_16::@23
Culled Empty Block (label) atan2_16::@31
Culled Empty Block (label) atan2_16::@32
Culled Empty Block (label) atan2_16::@14
Culled Empty Block (label) @7
Culled Empty Block (label) @12
Culled Empty Block (label) main::@14
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@15
@ -44,9 +49,9 @@ Culled Empty Block (label) main::@10
Culled Empty Block (label) main::@13
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@16
Culled Empty Block (label) @9
Culled Empty Block (label) @14
Culled Empty Block (label) init_angle_screen::@4
Culled Empty Block (label) @10
Culled Empty Block (label) @15
Culled Empty Block (label) init_dist_screen::@13
Culled Empty Block (label) init_dist_screen::@14
Culled Empty Block (label) init_dist_screen::@9
@ -55,12 +60,14 @@ Culled Empty Block (label) init_dist_screen::@12
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000
(byte*) heap_head#0 ← (byte*) HEAP_TOP#0
to:@3
malloc: scope:[malloc] from @12 @8 init_squares
(word) malloc::size#3 ← phi( @12/(word) malloc::size#2 @8/(word) malloc::size#1 init_squares/(word) malloc::size#0 )
(byte*) heap_head#12 ← phi( @12/(byte*) heap_head#5 @8/(byte*) heap_head#23 init_squares/(byte*) heap_head#24 )
to:@8
malloc: scope:[malloc] from @13 @17 init_squares
(word) malloc::size#3 ← phi( @13/(word) malloc::size#1 @17/(word) malloc::size#2 init_squares/(word) malloc::size#0 )
(byte*) heap_head#12 ← phi( @13/(byte*) heap_head#23 @17/(byte*) heap_head#5 init_squares/(byte*) heap_head#24 )
(byte*~) malloc::$0 ← (byte*) heap_head#12 - (word) malloc::size#3
(byte*) malloc::mem#0 ← (byte*~) malloc::$0
(byte*) heap_head#1 ← (byte*) malloc::mem#0
@ -155,11 +162,11 @@ bsearch16u::@3: scope:[bsearch16u] from bsearch16u::@1 bsearch16u::@2
(word*~) bsearch16u::$4 ← phi( bsearch16u::@1/(word*~) bsearch16u::$3 bsearch16u::@2/(word*~) bsearch16u::$2 )
(word*) bsearch16u::return#2 ← (word*~) bsearch16u::$4
to:bsearch16u::@return
@3: scope:[] from @begin
(byte*) heap_head#37 ← phi( @begin/(byte*) heap_head#0 )
@8: scope:[] from @4
(byte*) heap_head#37 ← phi( @4/(byte*) heap_head#0 )
(byte) NUM_SQUARES#0 ← (number) $ff
(word*) SQUARES#0 ← (word*) 0
to:@6
to:@11
init_squares: scope:[init_squares] from init_dist_screen
(byte*) heap_head#24 ← phi( init_dist_screen/(byte*) heap_head#29 )
(byte) NUM_SQUARES#6 ← phi( init_dist_screen/(byte) NUM_SQUARES#3 )
@ -239,15 +246,15 @@ sqrt::@return: scope:[sqrt] from sqrt::@2
(byte) sqrt::return#1 ← (byte) sqrt::return#3
return
to:@return
@6: scope:[] from @3
(word*) SQUARES#45 ← phi( @3/(word*) SQUARES#0 )
(byte) NUM_SQUARES#34 ← phi( @3/(byte) NUM_SQUARES#0 )
(byte*) heap_head#32 ← phi( @3/(byte*) heap_head#37 )
@11: scope:[] from @8
(word*) SQUARES#45 ← phi( @8/(word*) SQUARES#0 )
(byte) NUM_SQUARES#34 ← phi( @8/(byte) NUM_SQUARES#0 )
(byte*) heap_head#32 ← phi( @8/(byte*) heap_head#37 )
(byte) CORDIC_ITERATIONS_16#0 ← (number) $f
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 ← kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@8
to:@13
atan2_16: scope:[atan2_16] from init_angle_screen::@2
(signed word) atan2_16::x#9 ← phi( init_angle_screen::@2/(signed word) atan2_16::x#0 )
(signed word) atan2_16::y#1 ← phi( init_angle_screen::@2/(signed word) atan2_16::y#0 )
@ -458,41 +465,41 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(word) atan2_16::return#1 ← (word) atan2_16::return#3
return
to:@return
@8: scope:[] from @6
(word*) SQUARES#42 ← phi( @6/(word*) SQUARES#45 )
(byte) NUM_SQUARES#31 ← phi( @6/(byte) NUM_SQUARES#34 )
(byte*) heap_head#23 ← phi( @6/(byte*) heap_head#32 )
@13: scope:[] from @11
(word*) SQUARES#42 ← phi( @11/(word*) SQUARES#45 )
(byte) NUM_SQUARES#31 ← phi( @11/(byte) NUM_SQUARES#34 )
(byte*) heap_head#23 ← phi( @11/(byte*) heap_head#32 )
(word) malloc::size#1 ← (number) $3e8
call malloc
(void*) malloc::return#3 ← (void*) malloc::return#1
to:@12
@12: scope:[] from @8
(word*) SQUARES#36 ← phi( @8/(word*) SQUARES#42 )
(byte) NUM_SQUARES#25 ← phi( @8/(byte) NUM_SQUARES#31 )
(byte*) heap_head#16 ← phi( @8/(byte*) heap_head#2 )
(void*) malloc::return#7 ← phi( @8/(void*) malloc::return#3 )
to:@17
@17: scope:[] from @13
(word*) SQUARES#36 ← phi( @13/(word*) SQUARES#42 )
(byte) NUM_SQUARES#25 ← phi( @13/(byte) NUM_SQUARES#31 )
(byte*) heap_head#16 ← phi( @13/(byte*) heap_head#2 )
(void*) malloc::return#7 ← phi( @13/(void*) malloc::return#3 )
(void*~) $0 ← (void*) malloc::return#7
(byte*) heap_head#5 ← (byte*) heap_head#16
(byte*) SCREEN_DIST#0 ← ((byte*)) (void*~) $0
(word) malloc::size#2 ← (number) $3e8
call malloc
(void*) malloc::return#4 ← (void*) malloc::return#1
to:@13
@13: scope:[] from @12
(word*) SQUARES#35 ← phi( @12/(word*) SQUARES#36 )
(byte) NUM_SQUARES#24 ← phi( @12/(byte) NUM_SQUARES#25 )
(byte*) heap_head#17 ← phi( @12/(byte*) heap_head#2 )
(void*) malloc::return#8 ← phi( @12/(void*) malloc::return#4 )
to:@18
@18: scope:[] from @17
(word*) SQUARES#35 ← phi( @17/(word*) SQUARES#36 )
(byte) NUM_SQUARES#24 ← phi( @17/(byte) NUM_SQUARES#25 )
(byte*) heap_head#17 ← phi( @17/(byte*) heap_head#2 )
(void*) malloc::return#8 ← phi( @17/(void*) malloc::return#4 )
(void*~) $1 ← (void*) malloc::return#8
(byte*) heap_head#6 ← (byte*) heap_head#17
(byte*) SCREEN_ANGLE#0 ← ((byte*)) (void*~) $1
(byte*) SCREEN_FILL#0 ← ((byte*)) (number) $400
(byte) FILL_CHAR#0 ← (byte) '@'
to:@11
main: scope:[main] from @11
(word*) SQUARES#21 ← phi( @11/(word*) SQUARES#26 )
(byte*) heap_head#26 ← phi( @11/(byte*) heap_head#31 )
(byte) NUM_SQUARES#14 ← phi( @11/(byte) NUM_SQUARES#18 )
to:@16
main: scope:[main] from @16
(word*) SQUARES#21 ← phi( @16/(word*) SQUARES#26 )
(byte*) heap_head#26 ← phi( @16/(byte*) heap_head#31 )
(byte) NUM_SQUARES#14 ← phi( @16/(byte) NUM_SQUARES#18 )
(byte*) init_dist_screen::screen#0 ← (byte*) SCREEN_DIST#0
call init_dist_screen
to:main::@17
@ -880,31 +887,32 @@ init_dist_screen::@return: scope:[init_dist_screen] from init_dist_screen::@11
(word*) SQUARES#6 ← (word*) SQUARES#15
return
to:@return
@11: scope:[] from @13
(word*) SQUARES#26 ← phi( @13/(word*) SQUARES#35 )
(byte*) heap_head#31 ← phi( @13/(byte*) heap_head#6 )
(byte) NUM_SQUARES#18 ← phi( @13/(byte) NUM_SQUARES#24 )
@16: scope:[] from @18
(word*) SQUARES#26 ← phi( @18/(word*) SQUARES#35 )
(byte*) heap_head#31 ← phi( @18/(byte*) heap_head#6 )
(byte) NUM_SQUARES#18 ← phi( @18/(byte) NUM_SQUARES#24 )
call main
to:@14
@14: scope:[] from @11
(word*) SQUARES#16 ← phi( @11/(word*) SQUARES#4 )
(byte*) heap_head#22 ← phi( @11/(byte*) heap_head#8 )
(byte) NUM_SQUARES#12 ← phi( @11/(byte) NUM_SQUARES#2 )
to:@19
@19: scope:[] from @16
(word*) SQUARES#16 ← phi( @16/(word*) SQUARES#4 )
(byte*) heap_head#22 ← phi( @16/(byte*) heap_head#8 )
(byte) NUM_SQUARES#12 ← phi( @16/(byte) NUM_SQUARES#2 )
(byte) NUM_SQUARES#5 ← (byte) NUM_SQUARES#12
(byte*) heap_head#11 ← (byte*) heap_head#22
(word*) SQUARES#7 ← (word*) SQUARES#16
to:@end
@end: scope:[] from @14
@end: scope:[] from @19
SYMBOL TABLE SSA
(void*~) $0
(void*~) $1
(label) @11
(label) @12
(label) @13
(label) @14
(label) @3
(label) @6
(label) @16
(label) @17
(label) @18
(label) @19
(label) @4
(label) @8
(label) @begin
(label) @end
@ -2452,111 +2460,113 @@ Added new block during phi lifting init_angle_screen::@7(between init_angle_scre
Added new block during phi lifting init_dist_screen::@19(between init_dist_screen::@11 and init_dist_screen::@1)
Added new block during phi lifting init_dist_screen::@20(between init_dist_screen::@18 and init_dist_screen::@5)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @6
Adding NOP phi() at start of @4
Adding NOP phi() at start of @8
Adding NOP phi() at start of @11
Adding NOP phi() at start of @14
Adding NOP phi() at start of @13
Adding NOP phi() at start of @16
Adding NOP phi() at start of @19
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@18
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of init_dist_screen
CALL GRAPH
Calls in [] to malloc:4 malloc:7 main:10
Calls in [main] to init_dist_screen:14 init_angle_screen:16
Calls in [init_angle_screen] to atan2_16:59
Calls in [init_dist_screen] to init_squares:155 sqr:167 sqr:178 sqrt:183
Calls in [sqrt] to bsearch16u:209
Calls in [init_squares] to malloc:249
Calls in [] to malloc:5 malloc:8 main:11
Calls in [main] to init_dist_screen:15 init_angle_screen:17
Calls in [init_angle_screen] to atan2_16:60
Calls in [init_dist_screen] to init_squares:156 sqr:168 sqr:179 sqrt:184
Calls in [sqrt] to bsearch16u:210
Calls in [init_squares] to malloc:250
Created 48 initial phi equivalence classes
Coalesced [6] heap_head#52 ← heap_head#1
Coalesced [21] main::dist#6 ← main::dist#0
Coalesced [22] main::angle#6 ← main::angle#0
Coalesced [27] main::min_dist_angle#9 ← main::dist_angle#0
Not coalescing [28] main::min_fill#10 ← main::fill#2
Coalesced [37] main::fill#6 ← main::fill#1
Coalesced [38] main::dist#7 ← main::dist#1
Coalesced [39] main::angle#7 ← main::angle#1
Not coalescing [40] main::min_dist_angle#6 ← main::min_dist_angle#3
Coalesced [41] main::min_fill#7 ← main::min_fill#2
Not coalescing [42] main::min_dist_angle#8 ← main::min_dist_angle#2
Coalesced (already) [43] main::min_fill#9 ← main::min_fill#5
Not coalescing [44] main::min_dist_angle#7 ← main::min_dist_angle#2
Coalesced (already) [45] main::min_fill#8 ← main::min_fill#5
Coalesced [48] init_angle_screen::screen_bottomline#6 ← init_angle_screen::screen_bottomline#0
Coalesced [49] init_angle_screen::screen_topline#6 ← init_angle_screen::screen_topline#0
Coalesced [79] init_angle_screen::y#6 ← init_angle_screen::y#1
Coalesced [80] init_angle_screen::screen_bottomline#7 ← init_angle_screen::screen_bottomline#1
Coalesced [81] init_angle_screen::screen_topline#7 ← init_angle_screen::screen_topline#1
Coalesced [82] init_angle_screen::x#4 ← init_angle_screen::x#1
Coalesced [83] init_angle_screen::xb#4 ← init_angle_screen::xb#1
Coalesced [86] atan2_16::yi#17 ← atan2_16::$2
Coalesced [90] atan2_16::xi#14 ← atan2_16::$7
Coalesced [92] atan2_16::yi#19 ← atan2_16::yi#0
Coalesced [93] atan2_16::xi#16 ← atan2_16::xi#0
Coalesced [96] atan2_16::angle#22 ← atan2_16::angle#12
Coalesced [101] atan2_16::angle#27 ← atan2_16::angle#4
Coalesced [105] atan2_16::return#5 ← atan2_16::angle#5
Coalesced [108] atan2_16::return#6 ← atan2_16::angle#11
Coalesced [109] atan2_16::angle#26 ← atan2_16::angle#1
Not coalescing [110] atan2_16::shift#5 ← atan2_16::i#2
Not coalescing [111] atan2_16::xd#10 ← atan2_16::xi#3
Not coalescing [112] atan2_16::yd#10 ← atan2_16::yi#3
Coalesced [118] atan2_16::yd#13 ← atan2_16::yd#2
Coalesced [119] atan2_16::xd#13 ← atan2_16::xd#2
Coalesced [126] atan2_16::yi#21 ← atan2_16::yi#2
Coalesced [127] atan2_16::angle#25 ← atan2_16::angle#3
Coalesced [128] atan2_16::xi#18 ← atan2_16::xi#2
Coalesced [132] atan2_16::yi#18 ← atan2_16::yi#8
Coalesced [133] atan2_16::xi#15 ← atan2_16::xi#8
Coalesced [134] atan2_16::i#12 ← atan2_16::i#1
Coalesced [135] atan2_16::angle#21 ← atan2_16::angle#13
Coalesced (already) [136] atan2_16::angle#23 ← atan2_16::angle#13
Coalesced [141] atan2_16::yi#20 ← atan2_16::yi#1
Coalesced [142] atan2_16::angle#24 ← atan2_16::angle#2
Coalesced [143] atan2_16::xi#17 ← atan2_16::xi#1
Coalesced [144] atan2_16::yd#12 ← atan2_16::yd#3
Coalesced [145] atan2_16::xd#12 ← atan2_16::xd#3
Coalesced [149] atan2_16::shift#6 ← atan2_16::shift#1
Coalesced [150] atan2_16::xd#11 ← atan2_16::xd#1
Coalesced [151] atan2_16::yd#11 ← atan2_16::yd#1
Not coalescing [152] atan2_16::xi#13 ← atan2_16::x#0
Not coalescing [153] atan2_16::yi#16 ← atan2_16::y#0
Coalesced [157] init_dist_screen::screen_topline#15 ← init_dist_screen::screen#0
Coalesced [158] init_dist_screen::screen_bottomline#15 ← init_dist_screen::screen_bottomline#0
Coalesced [163] init_dist_screen::yd#2 ← init_dist_screen::$5
Coalesced [166] sqr::val#3 ← sqr::val#0
Coalesced [174] init_dist_screen::xd#2 ← init_dist_screen::$13
Coalesced [177] sqr::val#4 ← sqr::val#1
Coalesced [198] init_dist_screen::y#14 ← init_dist_screen::y#1
Coalesced [199] init_dist_screen::screen_topline#14 ← init_dist_screen::screen_topline#1
Coalesced [200] init_dist_screen::screen_bottomline#14 ← init_dist_screen::screen_bottomline#1
Coalesced [201] init_dist_screen::x#8 ← init_dist_screen::x#1
Coalesced [202] init_dist_screen::xb#8 ← init_dist_screen::xb#1
Coalesced [204] init_dist_screen::xd#1 ← init_dist_screen::$15
Coalesced [206] init_dist_screen::yd#1 ← init_dist_screen::$7
Coalesced [216] bsearch16u::items#10 ← bsearch16u::items#1
Coalesced [221] bsearch16u::return#9 ← bsearch16u::$2
Coalesced [223] bsearch16u::return#7 ← bsearch16u::return#2
Coalesced [226] bsearch16u::return#8 ← bsearch16u::items#2
Not coalescing [232] bsearch16u::return#6 ← bsearch16u::pivot#0
Coalesced [236] bsearch16u::num#10 ← bsearch16u::num#1
Coalesced [237] bsearch16u::items#12 ← bsearch16u::items#0
Coalesced [240] bsearch16u::num#9 ← bsearch16u::num#0
Coalesced [241] bsearch16u::items#11 ← bsearch16u::items#8
Coalesced [242] bsearch16u::num#11 ← bsearch16u::num#3
Coalesced (already) [243] bsearch16u::items#13 ← bsearch16u::items#2
Coalesced (already) [248] heap_head#53 ← heap_head#1
Coalesced [252] init_squares::squares#4 ← init_squares::squares#0
Coalesced [262] init_squares::sqr#3 ← init_squares::sqr#1
Coalesced [263] init_squares::squares#3 ← init_squares::squares#1
Coalesced [264] init_squares::i#3 ← init_squares::i#1
Not coalescing [267] heap_head#1 ← malloc::mem#0
Coalesced [7] heap_head#52 ← heap_head#1
Coalesced [22] main::dist#6 ← main::dist#0
Coalesced [23] main::angle#6 ← main::angle#0
Coalesced [28] main::min_dist_angle#9 ← main::dist_angle#0
Not coalescing [29] main::min_fill#10 ← main::fill#2
Coalesced [38] main::fill#6 ← main::fill#1
Coalesced [39] main::dist#7 ← main::dist#1
Coalesced [40] main::angle#7 ← main::angle#1
Not coalescing [41] main::min_dist_angle#6 ← main::min_dist_angle#3
Coalesced [42] main::min_fill#7 ← main::min_fill#2
Not coalescing [43] main::min_dist_angle#8 ← main::min_dist_angle#2
Coalesced (already) [44] main::min_fill#9 ← main::min_fill#5
Not coalescing [45] main::min_dist_angle#7 ← main::min_dist_angle#2
Coalesced (already) [46] main::min_fill#8 ← main::min_fill#5
Coalesced [49] init_angle_screen::screen_bottomline#6 ← init_angle_screen::screen_bottomline#0
Coalesced [50] init_angle_screen::screen_topline#6 ← init_angle_screen::screen_topline#0
Coalesced [80] init_angle_screen::y#6 ← init_angle_screen::y#1
Coalesced [81] init_angle_screen::screen_bottomline#7 ← init_angle_screen::screen_bottomline#1
Coalesced [82] init_angle_screen::screen_topline#7 ← init_angle_screen::screen_topline#1
Coalesced [83] init_angle_screen::x#4 ← init_angle_screen::x#1
Coalesced [84] init_angle_screen::xb#4 ← init_angle_screen::xb#1
Coalesced [87] atan2_16::yi#17 ← atan2_16::$2
Coalesced [91] atan2_16::xi#14 ← atan2_16::$7
Coalesced [93] atan2_16::yi#19 ← atan2_16::yi#0
Coalesced [94] atan2_16::xi#16 ← atan2_16::xi#0
Coalesced [97] atan2_16::angle#22 ← atan2_16::angle#12
Coalesced [102] atan2_16::angle#27 ← atan2_16::angle#4
Coalesced [106] atan2_16::return#5 ← atan2_16::angle#5
Coalesced [109] atan2_16::return#6 ← atan2_16::angle#11
Coalesced [110] atan2_16::angle#26 ← atan2_16::angle#1
Not coalescing [111] atan2_16::shift#5 ← atan2_16::i#2
Not coalescing [112] atan2_16::xd#10 ← atan2_16::xi#3
Not coalescing [113] atan2_16::yd#10 ← atan2_16::yi#3
Coalesced [119] atan2_16::yd#13 ← atan2_16::yd#2
Coalesced [120] atan2_16::xd#13 ← atan2_16::xd#2
Coalesced [127] atan2_16::yi#21 ← atan2_16::yi#2
Coalesced [128] atan2_16::angle#25 ← atan2_16::angle#3
Coalesced [129] atan2_16::xi#18 ← atan2_16::xi#2
Coalesced [133] atan2_16::yi#18 ← atan2_16::yi#8
Coalesced [134] atan2_16::xi#15 ← atan2_16::xi#8
Coalesced [135] atan2_16::i#12 ← atan2_16::i#1
Coalesced [136] atan2_16::angle#21 ← atan2_16::angle#13
Coalesced (already) [137] atan2_16::angle#23 ← atan2_16::angle#13
Coalesced [142] atan2_16::yi#20 ← atan2_16::yi#1
Coalesced [143] atan2_16::angle#24 ← atan2_16::angle#2
Coalesced [144] atan2_16::xi#17 ← atan2_16::xi#1
Coalesced [145] atan2_16::yd#12 ← atan2_16::yd#3
Coalesced [146] atan2_16::xd#12 ← atan2_16::xd#3
Coalesced [150] atan2_16::shift#6 ← atan2_16::shift#1
Coalesced [151] atan2_16::xd#11 ← atan2_16::xd#1
Coalesced [152] atan2_16::yd#11 ← atan2_16::yd#1
Not coalescing [153] atan2_16::xi#13 ← atan2_16::x#0
Not coalescing [154] atan2_16::yi#16 ← atan2_16::y#0
Coalesced [158] init_dist_screen::screen_topline#15 ← init_dist_screen::screen#0
Coalesced [159] init_dist_screen::screen_bottomline#15 ← init_dist_screen::screen_bottomline#0
Coalesced [164] init_dist_screen::yd#2 ← init_dist_screen::$5
Coalesced [167] sqr::val#3 ← sqr::val#0
Coalesced [175] init_dist_screen::xd#2 ← init_dist_screen::$13
Coalesced [178] sqr::val#4 ← sqr::val#1
Coalesced [199] init_dist_screen::y#14 ← init_dist_screen::y#1
Coalesced [200] init_dist_screen::screen_topline#14 ← init_dist_screen::screen_topline#1
Coalesced [201] init_dist_screen::screen_bottomline#14 ← init_dist_screen::screen_bottomline#1
Coalesced [202] init_dist_screen::x#8 ← init_dist_screen::x#1
Coalesced [203] init_dist_screen::xb#8 ← init_dist_screen::xb#1
Coalesced [205] init_dist_screen::xd#1 ← init_dist_screen::$15
Coalesced [207] init_dist_screen::yd#1 ← init_dist_screen::$7
Coalesced [217] bsearch16u::items#10 ← bsearch16u::items#1
Coalesced [222] bsearch16u::return#9 ← bsearch16u::$2
Coalesced [224] bsearch16u::return#7 ← bsearch16u::return#2
Coalesced [227] bsearch16u::return#8 ← bsearch16u::items#2
Not coalescing [233] bsearch16u::return#6 ← bsearch16u::pivot#0
Coalesced [237] bsearch16u::num#10 ← bsearch16u::num#1
Coalesced [238] bsearch16u::items#12 ← bsearch16u::items#0
Coalesced [241] bsearch16u::num#9 ← bsearch16u::num#0
Coalesced [242] bsearch16u::items#11 ← bsearch16u::items#8
Coalesced [243] bsearch16u::num#11 ← bsearch16u::num#3
Coalesced (already) [244] bsearch16u::items#13 ← bsearch16u::items#2
Coalesced (already) [249] heap_head#53 ← heap_head#1
Coalesced [253] init_squares::squares#4 ← init_squares::squares#0
Coalesced [263] init_squares::sqr#3 ← init_squares::sqr#1
Coalesced [264] init_squares::squares#3 ← init_squares::squares#1
Coalesced [265] init_squares::i#3 ← init_squares::i#1
Not coalescing [268] heap_head#1 ← malloc::mem#0
Coalesced down to 38 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) @6
Culled Empty Block (label) @14
Culled Empty Block (label) @4
Culled Empty Block (label) @8
Culled Empty Block (label) @11
Culled Empty Block (label) @19
Culled Empty Block (label) main::@18
Culled Empty Block (label) main::@1
Culled Empty Block (label) init_angle_screen::@6
@ -2572,10 +2582,10 @@ Culled Empty Block (label) init_dist_screen::@20
Culled Empty Block (label) bsearch16u::@1
Culled Empty Block (label) bsearch16u::@18
Culled Empty Block (label) init_squares::@4
Renumbering block @8 to @1
Renumbering block @11 to @2
Renumbering block @12 to @3
Renumbering block @13 to @4
Renumbering block @13 to @1
Renumbering block @16 to @2
Renumbering block @17 to @3
Renumbering block @18 to @4
Renumbering block bsearch16u::@2 to bsearch16u::@1
Renumbering block bsearch16u::@3 to bsearch16u::@2
Renumbering block bsearch16u::@6 to bsearch16u::@3
@ -3005,8 +3015,8 @@ init_squares::@return: scope:[init_squares] from init_squares::@1
[189] return
to:@return
malloc: scope:[malloc] from @1 @3 init_squares
[190] (word) malloc::size#3 ← phi( @3/(word) $3e8 @1/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD )
[190] (byte*) heap_head#12 ← phi( @3/(byte*) heap_head#1 @1/(const byte*) HEAP_TOP#0 init_squares/(byte*) heap_head#1 )
[190] (word) malloc::size#3 ← phi( @1/(word) $3e8 @3/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD )
[190] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP#0 @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 )
[191] (byte*) malloc::mem#0 ← (byte*) heap_head#12 - (word) malloc::size#3
[192] (byte*) heap_head#1 ← (byte*) malloc::mem#0
to:malloc::@return