1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-29 20:31:58 +00:00

Converting constant value lists directly to constant values during parse.

This commit is contained in:
jespergravgaard 2019-11-03 22:12:51 +01:00
parent cfb27e5915
commit b921c99661
15 changed files with 296 additions and 353 deletions

View File

@ -4,6 +4,7 @@ import dk.camelot64.kickc.NumberParser;
import dk.camelot64.kickc.SourceLoader;
import dk.camelot64.kickc.asm.AsmClobber;
import dk.camelot64.kickc.model.*;
import dk.camelot64.kickc.model.InternalError;
import dk.camelot64.kickc.model.iterator.ProgramValue;
import dk.camelot64.kickc.model.operators.*;
import dk.camelot64.kickc.model.statements.*;
@ -1412,8 +1413,8 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
if(lValue.isDeclaredConst() && (rValue instanceof ValueList)) {
SymbolType declaredType = lValue.getType();
ProgramValue programValue = new ProgramValue.GenericValue(rValue);
boolean modified = PassNAddInitializerValueListTypeCasts.addValueCasts(declaredType, programValue, program, statementSource);
if(modified && programValue.get() instanceof CastValue) {
PassNAddInitializerValueListTypeCasts.addValueCasts(declaredType, programValue, program, statementSource);
if(programValue.get() instanceof CastValue) {
CastValue castValue = (CastValue) programValue.get();
if(castValue.getValue() instanceof ValueList) {
// Found value list with cast - look through all elements
@ -1427,10 +1428,12 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
}
/* if(lValue.isDeclaredConst() && !(rValue instanceof ConstantValue)) {
/*
if(lValue.isDeclaredConst() && !(rValue instanceof ConstantValue)) {
throw new InternalError("RValue is not constant!");
}
*/
*/
if(lValue.isDeclaredConst() && rValue instanceof ConstantValue) {
Scope scope = lValue.getScope();
ConstantValue constantValue = (ConstantValue) rValue;

View File

@ -39,7 +39,7 @@ public class TestPrograms {
@Test
public void testConstDeclaration() throws IOException, URISyntaxException {
compileAndCompare("const-declaration", log());
compileAndCompare("const-declaration");
}
@Test

View File

@ -1,5 +1,5 @@
Warning! Adding boolean cast to non-boolean condition *((const byte[$10]) msg1 + (byte) main::i)
Warning! Adding boolean cast to non-boolean condition *((byte[$10]) msg2 + (byte) main::i1)
Warning! Adding boolean cast to non-boolean condition *((const byte[$10]) msg2 + (byte) main::i1)
Culled Empty Block (label) main::@4
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
@ -10,7 +10,6 @@ Culled Empty Block (label) main::@12
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte[$10]) msg2 ← { (byte) 'c', (byte) 'm', (byte) 'l' }
to:@1
(void()) main()
@ -32,12 +31,12 @@ main::@3: scope:[main] from main::@1
to:main::@7
main::@7: scope:[main] from main::@3 main::@8
(byte) main::i1#2 ← phi( main::@3/(byte) main::i1#0 main::@8/(byte) main::i1#1 )
(bool~) main::$1 ← (number) 0 != *((byte[$10]) msg2 + (byte) main::i1#2)
(bool~) main::$1 ← (number) 0 != *((const byte[$10]) msg2 + (byte) main::i1#2)
if((bool~) main::$1) goto main::@8
to:main::@return
main::@8: scope:[main] from main::@7
(byte) main::i1#3 ← phi( main::@7/(byte) main::i1#2 )
*((const byte*) SCREEN+(number) $28 + (byte) main::i1#3) ← *((byte[$10]) msg2 + (byte) main::i1#3)
*((const byte*) SCREEN+(number) $28 + (byte) main::i1#3) ← *((const byte[$10]) msg2 + (byte) main::i1#3)
(byte) main::i1#1 ← ++ (byte) main::i1#3
to:main::@7
main::@return: scope:[main] from main::@7
@ -76,13 +75,13 @@ SYMBOL TABLE SSA
(byte) main::i1#2
(byte) main::i1#3
(const byte[$10]) msg1 = (string) "camelot"
(byte[$10]) msg2
(const byte[$10]) msg2 = { (byte) 'c', (byte) 'm', (byte) 'l' }
Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$0 ← (number) 0 != *((const byte[$10]) msg1 + (byte) main::i#2)
Adding number conversion cast (unumber) 0 in (byte) main::i1#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (number) 0 != *((byte[$10]) msg2 + (byte) main::i1#2)
Adding number conversion cast (unumber) $28 in *((const byte*) SCREEN+(number) $28 + (byte) main::i1#3) ← *((byte[$10]) msg2 + (byte) main::i1#3)
Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (number) 0 != *((const byte[$10]) msg2 + (byte) main::i1#2)
Adding number conversion cast (unumber) $28 in *((const byte*) SCREEN+(number) $28 + (byte) main::i1#3) ← *((const byte[$10]) msg2 + (byte) main::i1#3)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) main::i#0 ← (unumber)(number) 0
Inlining cast (byte) main::i1#0 ← (unumber)(number) 0
@ -103,12 +102,9 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::i#2 = (byte) main::i#3
Alias (byte) main::i1#2 = (byte) main::i1#3
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$0 [4] if((byte) 0!=*((const byte[$10]) msg1 + (byte) main::i#2)) goto main::@2
Simple Condition (bool~) main::$1 [11] if((byte) 0!=*((byte[$10]) msg2 + (byte) main::i1#2)) goto main::@8
Simple Condition (bool~) main::$0 [3] if((byte) 0!=*((const byte[$10]) msg1 + (byte) main::i#2)) goto main::@2
Simple Condition (bool~) main::$1 [10] if((byte) 0!=*((const byte[$10]) msg2 + (byte) main::i1#2)) goto main::@8
Successful SSA optimization Pass2ConditionalJumpSimplification
Identified constant from value list (byte[$10]) { (byte) 'c', (byte) 'm', (byte) 'l' }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[$10]) msg2 = { 'c', 'm', 'l' }
Constant (const byte) main::i#0 = 0
Constant (const byte) main::i1#0 = 0
Successful SSA optimization Pass2ConstantIdentification

View File

@ -12,6 +12,6 @@ main: {
sta SCREEN+2
rts
}
c: .byte 'c', 'm', 'l'
d: .text "cml"
b: .fill 3, 0
c: .byte 'c', 'm', 'l'

View File

@ -3,7 +3,6 @@ Identified constant variable (byte*) SCREEN
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte[3]) b ← { fill( 3, 0) }
(byte[]) c ← { (byte) 'c', (byte) 'm', (byte) 'l' }
to:@1
(void()) main()
@ -11,7 +10,7 @@ main: scope:[main] from @1
*((byte[3]) b + (number) 0) ← (byte) 'c'
*((const byte*) SCREEN) ← *((byte[3]) b + (number) 0)
(byte*~) main::$0 ← (const byte*) SCREEN + (number) 1
*((byte*~) main::$0) ← *((byte[]) c + (number) 1)
*((byte*~) main::$0) ← *((const byte[]) c + (number) 1)
(byte*~) main::$1 ← (const byte*) SCREEN + (number) 2
*((byte*~) main::$1) ← *((const byte[]) d + (number) 2)
to:main::@return
@ -32,7 +31,7 @@ SYMBOL TABLE SSA
(label) @end
(const byte*) SCREEN = (byte*)(number) $400
(byte[3]) b
(byte[]) c
(const byte[]) c = { (byte) 'c', (byte) 'm', (byte) 'l' }
(const byte[]) d = (string) "cml"z
(void()) main()
(byte*~) main::$0
@ -42,7 +41,7 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in *((byte[3]) b + (number) 0) ← (byte) 'c'
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN) ← *((byte[3]) b + (number) 0)
Adding number conversion cast (unumber) 1 in (byte*~) main::$0 ← (const byte*) SCREEN + (number) 1
Adding number conversion cast (unumber) 1 in *((byte*~) main::$0) ← *((byte[]) c + (number) 1)
Adding number conversion cast (unumber) 1 in *((byte*~) main::$0) ← *((const byte[]) c + (number) 1)
Adding number conversion cast (unumber) 2 in (byte*~) main::$1 ← (const byte*) SCREEN + (number) 2
Adding number conversion cast (unumber) 2 in *((byte*~) main::$1) ← *((const byte[]) d + (number) 2)
Successful SSA optimization PassNAddNumberTypeConversions
@ -62,18 +61,15 @@ Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [0] (byte[3]) b ← { fill( 3, 0) }
Constant right-side identified [4] (byte*~) main::$0 ← (const byte*) SCREEN + (byte) 1
Constant right-side identified [6] (byte*~) main::$1 ← (const byte*) SCREEN + (byte) 2
Constant right-side identified [3] (byte*~) main::$0 ← (const byte*) SCREEN + (byte) 1
Constant right-side identified [5] (byte*~) main::$1 ← (const byte*) SCREEN + (byte) 2
Successful SSA optimization Pass2ConstantRValueConsolidation
Identified constant from value list (byte[]) { (byte) 'c', (byte) 'm', (byte) 'l' }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[3]) b = { fill( 3, 0) }
Constant (const byte[]) c = { 'c', 'm', 'l' }
Constant (const byte*) main::$0 = SCREEN+1
Constant (const byte*) main::$1 = SCREEN+2
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero b in [2] *((const byte[3]) b + (byte) 0) ← (byte) 'c'
Simplifying expression containing zero b in [3] *((const byte*) SCREEN) ← *((const byte[3]) b + (byte) 0)
Simplifying expression containing zero b in [1] *((const byte[3]) b + (byte) 0) ← (byte) 'c'
Simplifying expression containing zero b in [2] *((const byte*) SCREEN) ← *((const byte[3]) b + (byte) 0)
Successful SSA optimization PassNSimplifyExpressionWithZero
Constant inlined main::$1 = (const byte*) SCREEN+(byte) 2
Constant inlined main::$0 = (const byte*) SCREEN+(byte) 1
@ -168,9 +164,9 @@ main: {
rts
}
// File Data
c: .byte 'c', 'm', 'l'
d: .text "cml"
b: .fill 3, 0
c: .byte 'c', 'm', 'l'
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte[3]) b) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a
@ -228,9 +224,9 @@ main: {
rts
}
// File Data
c: .byte 'c', 'm', 'l'
d: .text "cml"
b: .fill 3, 0
c: .byte 'c', 'm', 'l'
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
@ -305,7 +301,7 @@ main: {
rts
}
// File Data
c: .byte 'c', 'm', 'l'
d: .text "cml"
b: .fill 3, 0
c: .byte 'c', 'm', 'l'

View File

@ -147,5 +147,5 @@ main: {
bne __b1
rts
}
SRCB: .byte $80
SRCA: .byte 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' '
SRCB: .byte $80

View File

@ -45,8 +45,8 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@1 main::@2
[36] (byte) main::r#2 ← phi( main/(byte) 0 main::@1/(byte) main::r#2 main::@2/(byte) main::r#1 )
[37] (byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY
[38] if((byte~) main::$2!=(byte) 0) goto main::@1
[37] (byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY
[38] if((byte~) main::$0!=(byte) 0) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[39] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD

View File

@ -5,24 +5,20 @@ 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) main::@1
Culled Empty Block (label) main::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@5
@5: scope:[] from @begin
(byte[]) SRCA ← { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
to:@6
(void()) main()
main: scope:[main] from @6
*((const byte*) DTV_FEATURE) ← (const byte) DTV_FEATURE_ENABLE
*((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_CLEAR_IRQ
(byte~) main::$0 ← < (byte[]) SRCA
*((const byte*) DTV_BLITTER_SRCA_LO) ← (byte~) main::$0
(byte~) main::$1 ← > (byte[]) SRCA
*((const byte*) DTV_BLITTER_SRCA_MI) ← (byte~) main::$1
*((const byte*) DTV_BLITTER_SRCA_LO) ← <(const byte[]) SRCA
*((const byte*) DTV_BLITTER_SRCA_MI) ← >(const byte[]) SRCA
*((const byte*) DTV_BLITTER_SRCA_HI) ← (number) 0
*((const byte*) DTV_BLITTER_SRCA_MOD_LO) ← (number) 0
*((const byte*) DTV_BLITTER_SRCA_MOD_HI) ← (number) 0
@ -55,21 +51,21 @@ main: scope:[main] from @6
to:main::@2
main::@2: scope:[main] from main main::@2 main::@3
(byte) main::r#3 ← phi( main/(byte) main::r#0 main::@2/(byte) main::r#3 main::@3/(byte) main::r#1 )
(byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY
(bool~) main::$3 ← (byte~) main::$2 != (number) 0
if((bool~) main::$3) goto main::@2
(byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY
(bool~) main::$1 ← (byte~) main::$0 != (number) 0
if((bool~) main::$1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
(byte) main::r#2 ← phi( main::@2/(byte) main::r#3 )
*((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD
(byte) main::r#1 ← (byte) main::r#2 + rangenext(0,7)
(bool~) main::$4 ← (byte) main::r#1 != rangelast(0,7)
if((bool~) main::$4) goto main::@2
(bool~) main::$2 ← (byte) main::r#1 != rangelast(0,7)
if((bool~) main::$2) goto main::@2
to:main::@return
main::@return: scope:[main] from main::@3
return
to:@return
@6: scope:[] from @5
@6: scope:[] from @begin
call main
to:@7
@7: scope:[] from @6
@ -77,7 +73,6 @@ main::@return: scope:[main] from main::@3
@end: scope:[] from @7
SYMBOL TABLE SSA
(label) @5
(label) @6
(label) @7
(label) @begin
@ -124,15 +119,13 @@ SYMBOL TABLE SSA
(const byte*) DTV_FEATURE = (byte*)(number) $d03f
(const byte) DTV_FEATURE_ENABLE = (number) 1
(const byte*) SCREEN = (byte*)(number) $400
(byte[]) SRCA
(const byte[]) SRCA = { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
(const byte) SRCA_LEN = (number) 9
(const byte[]) SRCB = { (byte)(number) $80 }
(void()) main()
(byte~) main::$0
(byte~) main::$1
(byte~) main::$2
(bool~) main::$3
(bool~) main::$4
(bool~) main::$1
(bool~) main::$2
(label) main::@2
(label) main::@3
(label) main::@return
@ -155,7 +148,7 @@ Adding number conversion cast (unumber) 0 in *((const byte*) DTV_BLITTER_DEST_MO
Adding number conversion cast (unumber) 0 in *((const byte*) DTV_BLITTER_DEST_MOD_HI) ← (number) 0
Adding number conversion cast (unumber) $10 in *((const byte*) DTV_BLITTER_DEST_STEP) ← (number) $10
Adding number conversion cast (unumber) 0 in *((const byte*) DTV_BLITTER_LEN_HI) ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$3 ← (byte~) main::$2 != (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (byte~) main::$0 != (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const byte*) DTV_BLITTER_SRCA_HI) ← (unumber)(number) 0
Inlining cast *((const byte*) DTV_BLITTER_SRCA_MOD_LO) ← (unumber)(number) 0
@ -236,20 +229,17 @@ Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::r#2 = (byte) main::r#3
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$3 [39] if((byte~) main::$2!=(byte) 0) goto main::@2
Simple Condition (bool~) main::$4 [44] if((byte) main::r#1!=rangelast(0,7)) goto main::@2
Simple Condition (bool~) main::$1 [36] if((byte~) main::$0!=(byte) 0) goto main::@2
Simple Condition (bool~) main::$2 [41] if((byte) main::r#1!=rangelast(0,7)) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Identified constant from value list (byte[]) { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[]) SRCA = { 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' ' }
Constant (const byte) main::r#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [42] main::r#1 ← ++ main::r#2 to ++
Resolved ranged comparison value [44] if(main::r#1!=rangelast(0,7)) goto main::@2 to (number) 8
Simplifying constant evaluating to zero <(word) $100 in [10] *((const byte*) DTV_BLITTER_SRCA_LIN_LO) ← <(word) $100
Simplifying constant evaluating to zero <(word) $100 in [18] *((const byte*) DTV_BLITTER_SRCB_LIN_LO) ← <(word) $100
Simplifying constant evaluating to zero <(const byte*) SCREEN in [21] *((const byte*) DTV_BLITTER_DEST_LO) ← <(const byte*) SCREEN
Simplifying constant evaluating to zero <(word) $100 in [26] *((const byte*) DTV_BLITTER_DEST_LIN_LO) ← <(word) $100
Resolved ranged next value [39] main::r#1 ← ++ main::r#2 to ++
Resolved ranged comparison value [41] if(main::r#1!=rangelast(0,7)) goto main::@2 to (number) 8
Simplifying constant evaluating to zero <(word) $100 in [7] *((const byte*) DTV_BLITTER_SRCA_LIN_LO) ← <(word) $100
Simplifying constant evaluating to zero <(word) $100 in [15] *((const byte*) DTV_BLITTER_SRCB_LIN_LO) ← <(word) $100
Simplifying constant evaluating to zero <(const byte*) SCREEN in [18] *((const byte*) DTV_BLITTER_DEST_LO) ← <(const byte*) SCREEN
Simplifying constant evaluating to zero <(word) $100 in [23] *((const byte*) DTV_BLITTER_DEST_LIN_LO) ← <(word) $100
Successful SSA optimization PassNSimplifyConstantZero
Adding number conversion cast (unumber) 8 in if((byte) main::r#1!=(number) 8) goto main::@2
Successful SSA optimization PassNAddNumberTypeConversions
@ -257,32 +247,22 @@ Simplifying constant integer cast 8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [2] (byte~) main::$0 ← < (const byte[]) SRCA
Constant right-side identified [4] (byte~) main::$1 ← > (const byte[]) SRCA
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = <SRCA
Constant (const byte) main::$1 = >SRCA
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) main::r#0
Constant inlined main::$1 = >(const byte[]) SRCA
Constant inlined main::r#0 = (byte) 0
Constant inlined main::$0 = <(const byte[]) SRCA
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@5(between main::@2 and main::@2)
Added new block during phi lifting main::@6(between main::@3 and main::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @5
Adding NOP phi() at start of @6
Adding NOP phi() at start of @7
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:3
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced [45] main::r#5 ← main::r#1
Coalesced (already) [46] main::r#4 ← main::r#2
Coalesced [44] main::r#5 ← main::r#1
Coalesced (already) [45] main::r#4 ← main::r#2
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) @7
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@5
@ -341,8 +321,8 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@1 main::@2
[36] (byte) main::r#2 ← phi( main/(byte) 0 main::@1/(byte) main::r#2 main::@2/(byte) main::r#1 )
[37] (byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY
[38] if((byte~) main::$2!=(byte) 0) goto main::@1
[37] (byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY
[38] if((byte~) main::$0!=(byte) 0) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[39] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD
@ -356,19 +336,19 @@ main::@return: scope:[main] from main::@2
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$2 202.0
(byte~) main::$0 202.0
(byte) main::r
(byte) main::r#1 16.5
(byte) main::r#2 56.0
Initial phi equivalence classes
[ main::r#2 main::r#1 ]
Added variable main::$2 to zero page equivalence class [ main::$2 ]
Added variable main::$0 to zero page equivalence class [ main::$0 ]
Complete equivalence classes
[ main::r#2 main::r#1 ]
[ main::$2 ]
[ main::$0 ]
Allocated zp[1]:2 [ main::r#2 main::r#1 ]
Allocated zp[1]:3 [ main::$2 ]
Allocated zp[1]:3 [ main::$0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -464,7 +444,7 @@ __bend_from___b1:
__bend:
// main
main: {
.label __2 = 3
.label __0 = 3
.label r = 2
// [4] *((const byte*) DTV_FEATURE) ← (const byte) DTV_FEATURE_ENABLE -- _deref_pbuc1=vbuc2
lda #DTV_FEATURE_ENABLE
@ -582,12 +562,12 @@ main: {
jmp __b1
// main::@1
__b1:
// [37] (byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY -- vbuz1=_deref_pbuc1_band_vbuc2
// [37] (byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY -- vbuz1=_deref_pbuc1_band_vbuc2
lda #DTV_BLIT_STATUS_BUSY
and DTV_BLITTER_CONTROL2
sta.z __2
// [38] if((byte~) main::$2!=(byte) 0) goto main::@1 -- vbuz1_neq_0_then_la1
lda.z __2
sta.z __0
// [38] if((byte~) main::$0!=(byte) 0) goto main::@1 -- vbuz1_neq_0_then_la1
lda.z __0
cmp #0
bne __b1_from___b1
jmp __b2
@ -610,8 +590,8 @@ main: {
rts
}
// File Data
SRCB: .byte $80
SRCA: .byte 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' '
SRCB: .byte $80
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) DTV_FEATURE) ← (const byte) DTV_FEATURE_ENABLE [ ] ( main:2 [ ] ) always clobbers reg byte a
@ -646,7 +626,7 @@ Statement [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [
Statement [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [37] (byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY [ main::r#2 main::$2 ] ( main:2 [ main::r#2 main::$2 ] ) always clobbers reg byte a
Statement [37] (byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY [ main::r#2 main::$0 ] ( main:2 [ main::r#2 main::$0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::r#2 main::r#1 ]
Statement [39] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [ main::r#2 ] ( main:2 [ main::r#2 ] ) always clobbers reg byte a
Statement [4] *((const byte*) DTV_FEATURE) ← (const byte) DTV_FEATURE_ENABLE [ ] ( main:2 [ ] ) always clobbers reg byte a
@ -681,16 +661,16 @@ Statement [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [
Statement [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [37] (byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY [ main::r#2 main::$2 ] ( main:2 [ main::r#2 main::$2 ] ) always clobbers reg byte a
Statement [37] (byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY [ main::r#2 main::$0 ] ( main:2 [ main::r#2 main::$0 ] ) always clobbers reg byte a
Statement [39] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [ main::r#2 ] ( main:2 [ main::r#2 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::r#2 main::r#1 ] : zp[1]:2 , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ main::$2 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ main::$0 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 202: zp[1]:3 [ main::$2 ] 72.5: zp[1]:2 [ main::r#2 main::r#1 ]
Uplift Scope [main] 202: zp[1]:3 [ main::$0 ] 72.5: zp[1]:2 [ main::r#2 main::r#1 ]
Uplift Scope []
Uplifting [main] best 2515 combination reg byte a [ main::$2 ] reg byte x [ main::r#2 main::r#1 ]
Uplifting [main] best 2515 combination reg byte a [ main::$0 ] reg byte x [ main::r#2 main::r#1 ]
Uplifting [] best 2515 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -901,10 +881,10 @@ main: {
jmp __b1
// main::@1
__b1:
// [37] (byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY -- vbuaa=_deref_pbuc1_band_vbuc2
// [37] (byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY -- vbuaa=_deref_pbuc1_band_vbuc2
lda #DTV_BLIT_STATUS_BUSY
and DTV_BLITTER_CONTROL2
// [38] if((byte~) main::$2!=(byte) 0) goto main::@1 -- vbuaa_neq_0_then_la1
// [38] if((byte~) main::$0!=(byte) 0) goto main::@1 -- vbuaa_neq_0_then_la1
cmp #0
bne __b1_from___b1
jmp __b2
@ -926,8 +906,8 @@ main: {
rts
}
// File Data
SRCB: .byte $80
SRCA: .byte 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' '
SRCB: .byte $80
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
@ -1019,7 +999,7 @@ FINAL SYMBOL TABLE
(const byte) SRCA_LEN = (number) 9
(const byte[]) SRCB = { (byte) $80 }
(void()) main()
(byte~) main::$2 reg byte a 202.0
(byte~) main::$0 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@return
@ -1028,7 +1008,7 @@ FINAL SYMBOL TABLE
(byte) main::r#2 reg byte x 56.0
reg byte x [ main::r#2 main::r#1 ]
reg byte a [ main::$2 ]
reg byte a [ main::$0 ]
FINAL ASSEMBLER
@ -1251,11 +1231,11 @@ main: {
// main::@1
__b1:
// *DTV_BLITTER_CONTROL2 & DTV_BLIT_STATUS_BUSY
// [37] (byte~) main::$2 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY -- vbuaa=_deref_pbuc1_band_vbuc2
// [37] (byte~) main::$0 ← *((const byte*) DTV_BLITTER_CONTROL2) & (const byte) DTV_BLIT_STATUS_BUSY -- vbuaa=_deref_pbuc1_band_vbuc2
lda #DTV_BLIT_STATUS_BUSY
and DTV_BLITTER_CONTROL2
// while((*DTV_BLITTER_CONTROL2 & DTV_BLIT_STATUS_BUSY)!=0)
// [38] if((byte~) main::$2!=(byte) 0) goto main::@1 -- vbuaa_neq_0_then_la1
// [38] if((byte~) main::$0!=(byte) 0) goto main::@1 -- vbuaa_neq_0_then_la1
cmp #0
bne __b1
// main::@2
@ -1276,6 +1256,6 @@ main: {
rts
}
// File Data
SRCB: .byte $80
SRCA: .byte 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' '
SRCB: .byte $80

View File

@ -47,7 +47,7 @@
(const byte) SRCA_LEN = (number) 9
(const byte[]) SRCB = { (byte) $80 }
(void()) main()
(byte~) main::$2 reg byte a 202.0
(byte~) main::$0 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@return
@ -56,4 +56,4 @@
(byte) main::r#2 reg byte x 56.0
reg byte x [ main::r#2 main::r#1 ]
reg byte a [ main::$2 ]
reg byte a [ main::$0 ]

View File

@ -1641,6 +1641,10 @@ sprites_irq: {
keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f
// Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7)
keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// The T-piece
.align $40
PIECE_T: .byte 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0
@ -1682,10 +1686,6 @@ sprites_irq: {
// The playfield. 0 is empty non-zero is color.
// The playfield is layed out line by line, meaning the first 10 bytes are line 1, the next 10 line 2 and so forth,
playfield: .fill PLAYFIELD_LINES*PLAYFIELD_COLS, 0
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// Pointers to the screen address for rendering each playfield line
// The lines for screen 1 is aligned with 0x80 and screen 2 with 0x40 - so XOR'ing with 0x40 gives screen 2 lines.
.align $80

View File

@ -469,8 +469,6 @@ sid_rnd_init::@return: scope:[sid_rnd_init] from sid_rnd_init
}}
kickasm(location (const byte*) PLAYFIELD_COLORS_ORIGINAL) {{ .import binary "playfield-screen.col"
}}
(byte[]) PIECES_COLORS_1 ← { (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED, (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED, (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED }
(byte[]) PIECES_COLORS_2 ← { (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE, (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE, (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE }
(byte*[PLAYFIELD_LINES]) screen_lines_1 ← { fill( PLAYFIELD_LINES, 0) }
(byte*[PLAYFIELD_LINES]) screen_lines_2 ← { fill( PLAYFIELD_LINES, 0) }
to:@22
@ -505,8 +503,8 @@ render_init::@3: scope:[render_init] from render_init::vicSelectGfxBank1_@1
*((const byte*) D011) ← (const byte) VIC_ECM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(number) 3
*((const byte*) BORDERCOL) ← (const byte) BLACK
*((const byte*) BGCOL1) ← (const byte) BLACK
*((const byte*) BGCOL2) ← *((byte[]) PIECES_COLORS_1 + (number) 0)
*((const byte*) BGCOL3) ← *((byte[]) PIECES_COLORS_2 + (number) 0)
*((const byte*) BGCOL2) ← *((const byte[]) PIECES_COLORS_1 + (number) 0)
*((const byte*) BGCOL3) ← *((const byte[]) PIECES_COLORS_2 + (number) 0)
*((const byte*) BGCOL4) ← (const byte) GREY
(byte*) render_screen_original::screen#0 ← (const byte*) PLAYFIELD_SCREEN_1
call render_screen_original
@ -629,8 +627,8 @@ render_show::@2: scope:[render_show] from render_show::@5 render_show::@6
(byte) level#12 ← phi( render_show::@5/(byte) level#26 render_show::@6/(byte) level#27 )
(byte) render_show::d018val#3 ← phi( render_show::@5/(byte) render_show::d018val#1 render_show::@6/(byte) render_show::d018val#2 )
*((const byte*) D018) ← (byte) render_show::d018val#3
*((const byte*) BGCOL2) ← *((byte[]) PIECES_COLORS_1 + (byte) level#12)
*((const byte*) BGCOL3) ← *((byte[]) PIECES_COLORS_2 + (byte) level#12)
*((const byte*) BGCOL2) ← *((const byte[]) PIECES_COLORS_1 + (byte) level#12)
*((const byte*) BGCOL3) ← *((const byte[]) PIECES_COLORS_2 + (byte) level#12)
(byte) render_screen_showing#1 ← (byte) render_screen_show#11
to:render_show::@return
render_show::@return: scope:[render_show] from render_show::@2
@ -3670,8 +3668,8 @@ SYMBOL TABLE SSA
(const byte) ORANGE = (number) 8
(word[]) PIECES
(const byte[]) PIECES_CHARS = { (byte)(number) $65, (byte)(number) $66, (byte)(number) $a6, (byte)(number) $66, (byte)(number) $65, (byte)(number) $65, (byte)(number) $a6 }
(byte[]) PIECES_COLORS_1
(byte[]) PIECES_COLORS_2
(const byte[]) PIECES_COLORS_1 = { (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED, (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED, (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED }
(const byte[]) PIECES_COLORS_2 = { (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE, (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE, (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE }
(const byte[]) PIECES_NEXT_CHARS = { (byte)(number) $63, (byte)(number) $64, (byte)(number) $a4, (byte)(number) $64, (byte)(number) $63, (byte)(number) $63, (byte)(number) $a4 }
(const byte[]) PIECES_START_X = { (byte)(number) 4, (byte)(number) 4, (byte)(number) 4, (byte)(number) 4, (byte)(number) 4, (byte)(number) 4, (byte)(number) 4 }
(const byte[]) PIECES_START_Y = { (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 0, (byte)(number) 1 }
@ -6734,8 +6732,8 @@ Adding number conversion cast (unumber) 3 in (number~) render_init::vicSelectGfx
Adding number conversion cast (unumber) render_init::vicSelectGfxBank1_toDd001_$3 in (number~) render_init::vicSelectGfxBank1_toDd001_$3 ← (unumber)(number) 3 ^ (unumber~) render_init::vicSelectGfxBank1_toDd001_$2
Adding number conversion cast (unumber) VIC_ECM|VIC_DEN|VIC_RSEL|3 in *((const byte*) D011) ← (const byte) VIC_ECM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(number) 3
Adding number conversion cast (unumber) 3 in *((const byte*) D011) ← ((unumber)) (const byte) VIC_ECM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(number) 3
Adding number conversion cast (unumber) 0 in *((const byte*) BGCOL2) ← *((byte[]) PIECES_COLORS_1 + (number) 0)
Adding number conversion cast (unumber) 0 in *((const byte*) BGCOL3) ← *((byte[]) PIECES_COLORS_2 + (number) 0)
Adding number conversion cast (unumber) 0 in *((const byte*) BGCOL2) ← *((const byte[]) PIECES_COLORS_1 + (number) 0)
Adding number conversion cast (unumber) 0 in *((const byte*) BGCOL3) ← *((const byte[]) PIECES_COLORS_2 + (number) 0)
Adding number conversion cast (unumber) $10 in (byte*) render_init::li_1#0 ← (const byte*) PLAYFIELD_SCREEN_1+(number) 2*(number) $28+(number) $10
Adding number conversion cast (unumber) 2*$28 in (byte*) render_init::li_1#0 ← (const byte*) PLAYFIELD_SCREEN_1+(number) 2*(number) $28+(unumber)(number) $10
Adding number conversion cast (unumber) $10 in (byte*) render_init::li_2#0 ← (const byte*) PLAYFIELD_SCREEN_2+(number) 2*(number) $28+(number) $10
@ -7997,31 +7995,31 @@ Inversing boolean not [70] (bool~) keyboard_event_scan::$2 ← (byte~) keyboard_
Inversing boolean not [79] (bool~) keyboard_event_scan::$5 ← (byte~) keyboard_event_scan::$3 == (byte) 0 from [78] (bool~) keyboard_event_scan::$4 ← (byte~) keyboard_event_scan::$3 != (byte) 0
Inversing boolean not [91] (bool~) keyboard_event_scan::$8 ← (byte~) keyboard_event_scan::$6 == (byte) 0 from [90] (bool~) keyboard_event_scan::$7 ← (byte~) keyboard_event_scan::$6 != (byte) 0
Inversing boolean not [103] (bool~) keyboard_event_scan::$11 ← (byte~) keyboard_event_scan::$9 == (byte) 0 from [102] (bool~) keyboard_event_scan::$10 ← (byte~) keyboard_event_scan::$9 != (byte) 0
Inversing boolean not [318] (bool~) render_bcd::$2 ← (byte) render_bcd::only_low#6 != (byte) 0 from [317] (bool~) render_bcd::$1 ← (byte) render_bcd::only_low#6 == (byte) 0
Inversing boolean not [413] (bool~) render_moving::$3 ← (byte) render_moving::current_cell#0 == (byte) 0 from [412] (bool~) render_moving::$2 ← (byte) render_moving::current_cell#0 != (byte) 0
Inversing boolean not [643] (bool~) play_movement::$2 ← (byte) game_over#1 == (byte) 0 from [642] (bool~) play_movement::$1 ← (byte) game_over#1 != (byte) 0
Inversing boolean not [685] (bool~) play_move_down::$1 ← (byte) play_move_down::key_event#1 != (const byte) KEY_SPACE from [684] (bool~) play_move_down::$0 ← (byte) play_move_down::key_event#1 == (const byte) KEY_SPACE
Inversing boolean not [694] (bool~) play_move_down::$4 ← (byte~) play_move_down::$2 == (byte) 0 from [693] (bool~) play_move_down::$3 ← (byte~) play_move_down::$2 != (byte) 0
Inversing boolean not [700] (bool~) play_move_down::$6 ← (byte) current_movedown_counter#12 < (byte) current_movedown_slow#19 from [699] (bool~) play_move_down::$5 ← (byte) current_movedown_counter#12 >= (byte) current_movedown_slow#19
Inversing boolean not [704] (bool~) play_move_down::$10 ← (byte) current_movedown_counter#13 < (const byte) current_movedown_fast from [703] (bool~) play_move_down::$9 ← (byte) current_movedown_counter#13 >= (const byte) current_movedown_fast
Inversing boolean not [710] (bool~) play_move_down::$8 ← (byte) play_move_down::movedown#6 == (byte) 0 from [709] (bool~) play_move_down::$7 ← (byte) play_move_down::movedown#6 != (byte) 0
Inversing boolean not [788] (bool~) play_move_leftright::$10 ← (byte~) play_move_leftright::$8 != (const byte) COLLISION_NONE from [787] (bool~) play_move_leftright::$9 ← (byte~) play_move_leftright::$8 == (const byte) COLLISION_NONE
Inversing boolean not [792] (bool~) play_move_leftright::$2 ← (byte) play_move_leftright::key_event#2 != (const byte) KEY_DOT from [791] (bool~) play_move_leftright::$1 ← (byte) play_move_leftright::key_event#2 == (const byte) KEY_DOT
Inversing boolean not [804] (bool~) play_move_leftright::$6 ← (byte~) play_move_leftright::$4 != (const byte) COLLISION_NONE from [803] (bool~) play_move_leftright::$5 ← (byte~) play_move_leftright::$4 == (const byte) COLLISION_NONE
Inversing boolean not [849] (bool~) play_move_rotate::$4 ← (byte~) play_move_rotate::$2 != (const byte) COLLISION_NONE from [848] (bool~) play_move_rotate::$3 ← (byte~) play_move_rotate::$2 == (const byte) COLLISION_NONE
Inversing boolean not [871] (bool~) play_collision::$2 ← *((byte*) play_collision::piece_gfx#1 + (byte) play_collision::i#2) == (byte) 0 from [870] (bool~) play_collision::$1 ← *((byte*) play_collision::piece_gfx#1 + (byte) play_collision::i#2) != (byte) 0
Inversing boolean not [881] (bool~) play_collision::$4 ← (byte) play_collision::yp#3 < (const byte) PLAYFIELD_LINES from [880] (bool~) play_collision::$3 ← (byte) play_collision::yp#3 >= (const byte) PLAYFIELD_LINES
Inversing boolean not [886] (bool~) play_collision::$7 ← (byte~) play_collision::$5 == (byte) 0 from [885] (bool~) play_collision::$6 ← (byte~) play_collision::$5 != (byte) 0
Inversing boolean not [894] (bool~) play_collision::$9 ← (byte) play_collision::xp#4 < (const byte) PLAYFIELD_COLS from [893] (bool~) play_collision::$8 ← (byte) play_collision::xp#4 >= (const byte) PLAYFIELD_COLS
Inversing boolean not [899] (bool~) play_collision::$11 ← *((byte*) play_collision::playfield_line#1 + (byte) play_collision::xp#5) == (byte) 0 from [898] (bool~) play_collision::$10 ← *((byte*) play_collision::playfield_line#1 + (byte) play_collision::xp#5) != (byte) 0
Inversing boolean not [920] (bool~) play_lock_current::$1 ← *((byte*) current_piece_gfx#22 + (byte) play_lock_current::i#2) == (byte) 0 from [919] (bool~) play_lock_current::$0 ← *((byte*) current_piece_gfx#22 + (byte) play_lock_current::i#2) != (byte) 0
Inversing boolean not [954] (bool~) play_spawn_current::$3 ← (byte~) play_spawn_current::$1 != (const byte) COLLISION_PLAYFIELD from [953] (bool~) play_spawn_current::$2 ← (byte~) play_spawn_current::$1 == (const byte) COLLISION_PLAYFIELD
Inversing boolean not [994] (bool~) play_remove_lines::$1 ← (byte) play_remove_lines::c#0 != (byte) 0 from [993] (bool~) play_remove_lines::$0 ← (byte) play_remove_lines::c#0 == (byte) 0
Inversing boolean not [1006] (bool~) play_remove_lines::$4 ← (byte) play_remove_lines::full#2 != (byte) 1 from [1005] (bool~) play_remove_lines::$3 ← (byte) play_remove_lines::full#2 == (byte) 1
Inversing boolean not [1029] (bool~) play_update_score::$1 ← (byte) play_update_score::removed#1 == (byte) 0 from [1028] (bool~) play_update_score::$0 ← (byte) play_update_score::removed#1 != (byte) 0
Inversing boolean not [1045] (bool~) play_update_score::$7 ← (byte) play_update_score::lines_before#0 == (byte) play_update_score::lines_after#0 from [1044] (bool~) play_update_score::$6 ← (byte) play_update_score::lines_before#0 != (byte) play_update_score::lines_after#0
Inversing boolean not [1072] (bool~) play_increase_level::$3 ← (byte~) play_increase_level::$1 != (byte) $a from [1071] (bool~) play_increase_level::$2 ← (byte~) play_increase_level::$1 == (byte) $a
Inversing boolean not [1182] (bool~) main::$18 ← (byte) main::render#2 == (byte) 0 from [1181] (bool~) main::$17 ← (byte) main::render#2 != (byte) 0
Inversing boolean not [316] (bool~) render_bcd::$2 ← (byte) render_bcd::only_low#6 != (byte) 0 from [315] (bool~) render_bcd::$1 ← (byte) render_bcd::only_low#6 == (byte) 0
Inversing boolean not [411] (bool~) render_moving::$3 ← (byte) render_moving::current_cell#0 == (byte) 0 from [410] (bool~) render_moving::$2 ← (byte) render_moving::current_cell#0 != (byte) 0
Inversing boolean not [641] (bool~) play_movement::$2 ← (byte) game_over#1 == (byte) 0 from [640] (bool~) play_movement::$1 ← (byte) game_over#1 != (byte) 0
Inversing boolean not [683] (bool~) play_move_down::$1 ← (byte) play_move_down::key_event#1 != (const byte) KEY_SPACE from [682] (bool~) play_move_down::$0 ← (byte) play_move_down::key_event#1 == (const byte) KEY_SPACE
Inversing boolean not [692] (bool~) play_move_down::$4 ← (byte~) play_move_down::$2 == (byte) 0 from [691] (bool~) play_move_down::$3 ← (byte~) play_move_down::$2 != (byte) 0
Inversing boolean not [698] (bool~) play_move_down::$6 ← (byte) current_movedown_counter#12 < (byte) current_movedown_slow#19 from [697] (bool~) play_move_down::$5 ← (byte) current_movedown_counter#12 >= (byte) current_movedown_slow#19
Inversing boolean not [702] (bool~) play_move_down::$10 ← (byte) current_movedown_counter#13 < (const byte) current_movedown_fast from [701] (bool~) play_move_down::$9 ← (byte) current_movedown_counter#13 >= (const byte) current_movedown_fast
Inversing boolean not [708] (bool~) play_move_down::$8 ← (byte) play_move_down::movedown#6 == (byte) 0 from [707] (bool~) play_move_down::$7 ← (byte) play_move_down::movedown#6 != (byte) 0
Inversing boolean not [786] (bool~) play_move_leftright::$10 ← (byte~) play_move_leftright::$8 != (const byte) COLLISION_NONE from [785] (bool~) play_move_leftright::$9 ← (byte~) play_move_leftright::$8 == (const byte) COLLISION_NONE
Inversing boolean not [790] (bool~) play_move_leftright::$2 ← (byte) play_move_leftright::key_event#2 != (const byte) KEY_DOT from [789] (bool~) play_move_leftright::$1 ← (byte) play_move_leftright::key_event#2 == (const byte) KEY_DOT
Inversing boolean not [802] (bool~) play_move_leftright::$6 ← (byte~) play_move_leftright::$4 != (const byte) COLLISION_NONE from [801] (bool~) play_move_leftright::$5 ← (byte~) play_move_leftright::$4 == (const byte) COLLISION_NONE
Inversing boolean not [847] (bool~) play_move_rotate::$4 ← (byte~) play_move_rotate::$2 != (const byte) COLLISION_NONE from [846] (bool~) play_move_rotate::$3 ← (byte~) play_move_rotate::$2 == (const byte) COLLISION_NONE
Inversing boolean not [869] (bool~) play_collision::$2 ← *((byte*) play_collision::piece_gfx#1 + (byte) play_collision::i#2) == (byte) 0 from [868] (bool~) play_collision::$1 ← *((byte*) play_collision::piece_gfx#1 + (byte) play_collision::i#2) != (byte) 0
Inversing boolean not [879] (bool~) play_collision::$4 ← (byte) play_collision::yp#3 < (const byte) PLAYFIELD_LINES from [878] (bool~) play_collision::$3 ← (byte) play_collision::yp#3 >= (const byte) PLAYFIELD_LINES
Inversing boolean not [884] (bool~) play_collision::$7 ← (byte~) play_collision::$5 == (byte) 0 from [883] (bool~) play_collision::$6 ← (byte~) play_collision::$5 != (byte) 0
Inversing boolean not [892] (bool~) play_collision::$9 ← (byte) play_collision::xp#4 < (const byte) PLAYFIELD_COLS from [891] (bool~) play_collision::$8 ← (byte) play_collision::xp#4 >= (const byte) PLAYFIELD_COLS
Inversing boolean not [897] (bool~) play_collision::$11 ← *((byte*) play_collision::playfield_line#1 + (byte) play_collision::xp#5) == (byte) 0 from [896] (bool~) play_collision::$10 ← *((byte*) play_collision::playfield_line#1 + (byte) play_collision::xp#5) != (byte) 0
Inversing boolean not [918] (bool~) play_lock_current::$1 ← *((byte*) current_piece_gfx#22 + (byte) play_lock_current::i#2) == (byte) 0 from [917] (bool~) play_lock_current::$0 ← *((byte*) current_piece_gfx#22 + (byte) play_lock_current::i#2) != (byte) 0
Inversing boolean not [952] (bool~) play_spawn_current::$3 ← (byte~) play_spawn_current::$1 != (const byte) COLLISION_PLAYFIELD from [951] (bool~) play_spawn_current::$2 ← (byte~) play_spawn_current::$1 == (const byte) COLLISION_PLAYFIELD
Inversing boolean not [992] (bool~) play_remove_lines::$1 ← (byte) play_remove_lines::c#0 != (byte) 0 from [991] (bool~) play_remove_lines::$0 ← (byte) play_remove_lines::c#0 == (byte) 0
Inversing boolean not [1004] (bool~) play_remove_lines::$4 ← (byte) play_remove_lines::full#2 != (byte) 1 from [1003] (bool~) play_remove_lines::$3 ← (byte) play_remove_lines::full#2 == (byte) 1
Inversing boolean not [1027] (bool~) play_update_score::$1 ← (byte) play_update_score::removed#1 == (byte) 0 from [1026] (bool~) play_update_score::$0 ← (byte) play_update_score::removed#1 != (byte) 0
Inversing boolean not [1043] (bool~) play_update_score::$7 ← (byte) play_update_score::lines_before#0 == (byte) play_update_score::lines_after#0 from [1042] (bool~) play_update_score::$6 ← (byte) play_update_score::lines_before#0 != (byte) play_update_score::lines_after#0
Inversing boolean not [1070] (bool~) play_increase_level::$3 ← (byte~) play_increase_level::$1 != (byte) $a from [1069] (bool~) play_increase_level::$2 ← (byte~) play_increase_level::$1 == (byte) $a
Inversing boolean not [1180] (bool~) main::$18 ← (byte) main::render#2 == (byte) 0 from [1179] (bool~) main::$17 ← (byte) main::render#2 != (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)(byte) render_screen_showing#1 = (byte) render_screen_show#11 (byte) render_screen_showing#6 (byte) render_screen_showing#2
Alias candidate removed (volatile)(byte) irq_sprite_ptr#0 = (byte~) $1 (byte) irq_sprite_ptr#17 (byte) irq_sprite_ptr#14
@ -8991,7 +8989,7 @@ Identical Phi Values (byte) current_xpos#16 (byte) current_xpos#59
Identical Phi Values (byte*) current_piece_gfx#29 (byte*) current_piece_gfx#64
Identical Phi Values (byte) current_piece_char#37 (byte) current_piece_char#68
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [191] (byte~) render_init::$5 ← (byte) render_init::i#2 * (const byte) SIZEOF_POINTER
Identified duplicate assignment right side [189] (byte~) render_init::$5 ← (byte) render_init::i#2 * (const byte) SIZEOF_POINTER
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition (bool~) keyboard_event_scan::$13 [23] if((byte) keyboard_event_scan::row_scan#0!=*((byte[8]) keyboard_scan_values + (byte) keyboard_event_scan::row#2)) goto keyboard_event_scan::@9
Simple Condition (bool~) keyboard_event_scan::$25 [32] if((byte) keyboard_event_scan::row#1!=rangelast(0,7)) goto keyboard_event_scan::@8
@ -9004,98 +9002,95 @@ Simple Condition (bool~) keyboard_event_scan::$5 [80] if((byte~) keyboard_event_
Simple Condition (bool~) keyboard_event_scan::$8 [92] if((byte~) keyboard_event_scan::$6==(byte) 0) goto keyboard_event_scan::@3
Simple Condition (bool~) keyboard_event_scan::$11 [104] if((byte~) keyboard_event_scan::$9==(byte) 0) goto keyboard_event_scan::@return
Simple Condition (bool~) keyboard_event_get::$0 [126] if((byte) keyboard_events_size#13==(byte) 0) goto keyboard_event_get::@1
Simple Condition (bool~) render_init::$3 [197] if((byte) render_init::i#1!=rangelast(0,PLAYFIELD_LINES-1)) goto render_init::@1
Simple Condition (bool~) render_show::$0 [207] if((byte) render_screen_show#16==(byte) 0) goto render_show::@1
Simple Condition (bool~) render_score::$0 [264] if((byte) render_screen_render#18==(byte) 0) goto render_score::@1
Simple Condition (bool~) render_bcd::$2 [319] if((byte) render_bcd::only_low#6!=(byte) 0) goto render_bcd::@1
Simple Condition (bool~) render_screen_original::$0 [345] if((byte) render_screen_original::x#1!=(byte) 4) goto render_screen_original::@2
Simple Condition (bool~) render_screen_original::$1 [355] if((byte) render_screen_original::x#2!=(byte) $24) goto render_screen_original::@4
Simple Condition (bool~) render_screen_original::$2 [363] if((byte) render_screen_original::x#3!=(byte) $28) goto render_screen_original::@6
Simple Condition (bool~) render_screen_original::$3 [367] if((byte) render_screen_original::y#1!=rangelast(0,$18)) goto render_screen_original::@1
Simple Condition (bool~) render_playfield::$1 [383] if((byte) render_playfield::c#1!=rangelast(0,PLAYFIELD_COLS-1)) goto render_playfield::@2
Simple Condition (bool~) render_playfield::$2 [387] if((byte) render_playfield::l#1!=rangelast(2,PLAYFIELD_LINES-1)) goto render_playfield::@1
Simple Condition (bool~) render_moving::$0 [395] if((byte) render_moving::ypos#2>(byte) 1) goto render_moving::@2
Simple Condition (bool~) render_moving::$5 [408] if((byte) render_moving::l#1!=rangelast(0,3)) goto render_moving::@1
Simple Condition (bool~) render_moving::$3 [414] if((byte) render_moving::current_cell#0==(byte) 0) goto render_moving::@5
Simple Condition (bool~) render_moving::$4 [419] if((byte) render_moving::c#1!=rangelast(0,3)) goto render_moving::@4
Simple Condition (bool~) render_next::$0 [426] if((byte) render_screen_render#15==(byte) 0) goto render_next::@1
Simple Condition (bool~) render_next::$3 [444] if((byte) render_next::cell#0!=(byte) 0) goto render_next::@7
Simple Condition (bool~) render_next::$4 [453] if((byte) render_next::c#1!=rangelast(0,3)) goto render_next::@6
Simple Condition (bool~) render_next::$5 [458] if((byte) render_next::l#1!=rangelast(0,3)) goto render_next::@5
Simple Condition (bool~) sprites_init::$2 [477] if((byte) sprites_init::s#1!=rangelast(0,3)) goto sprites_init::@1
Simple Condition (bool~) sprites_irq::$4 [519] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify#0) goto sprites_irq::@11
Simple Condition (bool~) sprites_irq::$1 [523] if((byte) render_screen_showing#0==(byte) 0) goto sprites_irq::@1
Simple Condition (bool~) sprites_irq::$2 [541] if((byte) irq_cnt#1==(byte) 9) goto sprites_irq::@3
Simple Condition (bool~) sprites_irq::$3 [558] if((byte) irq_cnt#1==(byte) $a) goto sprites_irq::@4
Simple Condition (bool~) play_init::$0 [606] if((byte) play_init::j#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_init::@1
Simple Condition (bool~) play_init::$1 [616] if((byte) play_init::b#1!=rangelast(0,4)) goto play_init::@3
Simple Condition (bool~) play_movement::$2 [644] if((byte) game_over#15==(byte) 0) goto play_movement::@1
Simple Condition (bool~) play_move_down::$1 [686] if((byte) play_move_down::key_event#0!=(const byte) KEY_SPACE) goto play_move_down::@1
Simple Condition (bool~) play_move_down::$4 [695] if((byte~) play_move_down::$2==(byte) 0) goto play_move_down::@2
Simple Condition (bool~) play_move_down::$6 [701] if((byte) current_movedown_counter#12<(byte) current_movedown_slow#14) goto play_move_down::@3
Simple Condition (bool~) play_move_down::$10 [705] if((byte) current_movedown_counter#12<(const byte) current_movedown_fast) goto play_move_down::@2
Simple Condition (bool~) play_move_down::$8 [711] if((byte) play_move_down::movedown#6==(byte) 0) goto play_move_down::@4
Simple Condition (bool~) play_move_down::$13 [726] if((byte~) play_move_down::$12==(const byte) COLLISION_NONE) goto play_move_down::@14
Simple Condition (bool~) play_move_leftright::$0 [777] if((byte) play_move_leftright::key_event#0==(const byte) KEY_COMMA) goto play_move_leftright::@1
Simple Condition (bool~) play_move_leftright::$10 [789] if((byte~) play_move_leftright::$8!=(const byte) COLLISION_NONE) goto play_move_leftright::@3
Simple Condition (bool~) play_move_leftright::$2 [793] if((byte) play_move_leftright::key_event#0!=(const byte) KEY_DOT) goto play_move_leftright::@3
Simple Condition (bool~) play_move_leftright::$6 [805] if((byte~) play_move_leftright::$4!=(const byte) COLLISION_NONE) goto play_move_leftright::@3
Simple Condition (bool~) play_move_rotate::$0 [821] if((byte) play_move_rotate::key_event#0==(const byte) KEY_Z) goto play_move_rotate::@1
Simple Condition (bool~) play_move_rotate::$1 [828] if((byte) play_move_rotate::key_event#0==(const byte) KEY_X) goto play_move_rotate::@2
Simple Condition (bool~) play_move_rotate::$4 [850] if((byte~) play_move_rotate::$2!=(const byte) COLLISION_NONE) goto play_move_rotate::@5
Simple Condition (bool~) play_collision::$2 [873] if(*((byte*) play_collision::piece_gfx#0 + (byte) play_collision::i#2)==(byte) 0) goto play_collision::@3
Simple Condition (bool~) play_collision::$12 [878] if((byte) play_collision::c#1!=rangelast(0,3)) goto play_collision::@2
Simple Condition (bool~) play_collision::$4 [882] if((byte) play_collision::yp#2<(const byte) PLAYFIELD_LINES) goto play_collision::@4
Simple Condition (bool~) play_collision::$7 [887] if((byte~) play_collision::$5==(byte) 0) goto play_collision::@5
Simple Condition (bool~) play_collision::$9 [895] if((byte) play_collision::xp#2<(const byte) PLAYFIELD_COLS) goto play_collision::@6
Simple Condition (bool~) play_collision::$11 [900] if(*((byte*) play_collision::playfield_line#0 + (byte) play_collision::xp#2)==(byte) 0) goto play_collision::@3
Simple Condition (bool~) play_collision::$13 [907] if((byte) play_collision::l#1!=rangelast(0,3)) goto play_collision::@1
Simple Condition (bool~) play_lock_current::$1 [922] if(*((byte*) current_piece_gfx#13 + (byte) play_lock_current::i#2)==(byte) 0) goto play_lock_current::@3
Simple Condition (bool~) play_lock_current::$2 [927] if((byte) play_lock_current::c#1!=rangelast(0,3)) goto play_lock_current::@2
Simple Condition (bool~) play_lock_current::$3 [934] if((byte) play_lock_current::l#1!=rangelast(0,3)) goto play_lock_current::@1
Simple Condition (bool~) play_spawn_current::$3 [955] if((byte~) play_spawn_current::$1!=(const byte) COLLISION_PLAYFIELD) goto play_spawn_current::@1
Simple Condition (bool~) play_spawn_current::$4 [962] if((byte) play_spawn_current::piece_idx#2==(byte) 7) goto play_spawn_current::sid_rnd1
Simple Condition (bool~) play_remove_lines::$1 [995] if((byte) play_remove_lines::c#0!=(byte) 0) goto play_remove_lines::@3
Simple Condition (bool~) play_remove_lines::$2 [1001] if((byte) play_remove_lines::x#1!=rangelast(0,PLAYFIELD_COLS-1)) goto play_remove_lines::@2
Simple Condition (bool~) play_remove_lines::$4 [1007] if((byte) play_remove_lines::full#2!=(byte) 1) goto play_remove_lines::@7
Simple Condition (bool~) play_remove_lines::$6 [1011] if((byte) play_remove_lines::y#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_remove_lines::@1
Simple Condition (bool~) play_remove_lines::$7 [1018] if((byte) play_remove_lines::w#6!=(byte) $ff) goto play_remove_lines::@10
Simple Condition (bool~) play_update_score::$1 [1030] if((byte) play_update_score::removed#0==(byte) 0) goto play_update_score::@return
Simple Condition (bool~) play_update_score::$7 [1046] if((byte) play_update_score::lines_before#0==(byte) play_update_score::lines_after#0) goto play_update_score::@return
Simple Condition (bool~) play_increase_level::$0 [1063] if((byte) level#21>(byte) $1d) goto play_increase_level::@1
Simple Condition (bool~) play_increase_level::$3 [1073] if((byte~) play_increase_level::$1!=(byte) $a) goto play_increase_level::@3
Simple Condition (bool~) play_increase_level::$4 [1084] if((byte) play_increase_level::b#1!=rangelast(0,4)) goto play_increase_level::@7
Simple Condition (bool~) main::$10 [1137] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@4
Simple Condition (bool~) main::$14 [1154] if((byte) game_over#10==(byte) 0) goto main::@11
Simple Condition (bool~) main::$18 [1183] if((byte) main::render#2==(byte) 0) goto main::@1
Simple Condition (bool~) render_init::$3 [195] if((byte) render_init::i#1!=rangelast(0,PLAYFIELD_LINES-1)) goto render_init::@1
Simple Condition (bool~) render_show::$0 [205] if((byte) render_screen_show#16==(byte) 0) goto render_show::@1
Simple Condition (bool~) render_score::$0 [262] if((byte) render_screen_render#18==(byte) 0) goto render_score::@1
Simple Condition (bool~) render_bcd::$2 [317] if((byte) render_bcd::only_low#6!=(byte) 0) goto render_bcd::@1
Simple Condition (bool~) render_screen_original::$0 [343] if((byte) render_screen_original::x#1!=(byte) 4) goto render_screen_original::@2
Simple Condition (bool~) render_screen_original::$1 [353] if((byte) render_screen_original::x#2!=(byte) $24) goto render_screen_original::@4
Simple Condition (bool~) render_screen_original::$2 [361] if((byte) render_screen_original::x#3!=(byte) $28) goto render_screen_original::@6
Simple Condition (bool~) render_screen_original::$3 [365] if((byte) render_screen_original::y#1!=rangelast(0,$18)) goto render_screen_original::@1
Simple Condition (bool~) render_playfield::$1 [381] if((byte) render_playfield::c#1!=rangelast(0,PLAYFIELD_COLS-1)) goto render_playfield::@2
Simple Condition (bool~) render_playfield::$2 [385] if((byte) render_playfield::l#1!=rangelast(2,PLAYFIELD_LINES-1)) goto render_playfield::@1
Simple Condition (bool~) render_moving::$0 [393] if((byte) render_moving::ypos#2>(byte) 1) goto render_moving::@2
Simple Condition (bool~) render_moving::$5 [406] if((byte) render_moving::l#1!=rangelast(0,3)) goto render_moving::@1
Simple Condition (bool~) render_moving::$3 [412] if((byte) render_moving::current_cell#0==(byte) 0) goto render_moving::@5
Simple Condition (bool~) render_moving::$4 [417] if((byte) render_moving::c#1!=rangelast(0,3)) goto render_moving::@4
Simple Condition (bool~) render_next::$0 [424] if((byte) render_screen_render#15==(byte) 0) goto render_next::@1
Simple Condition (bool~) render_next::$3 [442] if((byte) render_next::cell#0!=(byte) 0) goto render_next::@7
Simple Condition (bool~) render_next::$4 [451] if((byte) render_next::c#1!=rangelast(0,3)) goto render_next::@6
Simple Condition (bool~) render_next::$5 [456] if((byte) render_next::l#1!=rangelast(0,3)) goto render_next::@5
Simple Condition (bool~) sprites_init::$2 [475] if((byte) sprites_init::s#1!=rangelast(0,3)) goto sprites_init::@1
Simple Condition (bool~) sprites_irq::$4 [517] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify#0) goto sprites_irq::@11
Simple Condition (bool~) sprites_irq::$1 [521] if((byte) render_screen_showing#0==(byte) 0) goto sprites_irq::@1
Simple Condition (bool~) sprites_irq::$2 [539] if((byte) irq_cnt#1==(byte) 9) goto sprites_irq::@3
Simple Condition (bool~) sprites_irq::$3 [556] if((byte) irq_cnt#1==(byte) $a) goto sprites_irq::@4
Simple Condition (bool~) play_init::$0 [604] if((byte) play_init::j#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_init::@1
Simple Condition (bool~) play_init::$1 [614] if((byte) play_init::b#1!=rangelast(0,4)) goto play_init::@3
Simple Condition (bool~) play_movement::$2 [642] if((byte) game_over#15==(byte) 0) goto play_movement::@1
Simple Condition (bool~) play_move_down::$1 [684] if((byte) play_move_down::key_event#0!=(const byte) KEY_SPACE) goto play_move_down::@1
Simple Condition (bool~) play_move_down::$4 [693] if((byte~) play_move_down::$2==(byte) 0) goto play_move_down::@2
Simple Condition (bool~) play_move_down::$6 [699] if((byte) current_movedown_counter#12<(byte) current_movedown_slow#14) goto play_move_down::@3
Simple Condition (bool~) play_move_down::$10 [703] if((byte) current_movedown_counter#12<(const byte) current_movedown_fast) goto play_move_down::@2
Simple Condition (bool~) play_move_down::$8 [709] if((byte) play_move_down::movedown#6==(byte) 0) goto play_move_down::@4
Simple Condition (bool~) play_move_down::$13 [724] if((byte~) play_move_down::$12==(const byte) COLLISION_NONE) goto play_move_down::@14
Simple Condition (bool~) play_move_leftright::$0 [775] if((byte) play_move_leftright::key_event#0==(const byte) KEY_COMMA) goto play_move_leftright::@1
Simple Condition (bool~) play_move_leftright::$10 [787] if((byte~) play_move_leftright::$8!=(const byte) COLLISION_NONE) goto play_move_leftright::@3
Simple Condition (bool~) play_move_leftright::$2 [791] if((byte) play_move_leftright::key_event#0!=(const byte) KEY_DOT) goto play_move_leftright::@3
Simple Condition (bool~) play_move_leftright::$6 [803] if((byte~) play_move_leftright::$4!=(const byte) COLLISION_NONE) goto play_move_leftright::@3
Simple Condition (bool~) play_move_rotate::$0 [819] if((byte) play_move_rotate::key_event#0==(const byte) KEY_Z) goto play_move_rotate::@1
Simple Condition (bool~) play_move_rotate::$1 [826] if((byte) play_move_rotate::key_event#0==(const byte) KEY_X) goto play_move_rotate::@2
Simple Condition (bool~) play_move_rotate::$4 [848] if((byte~) play_move_rotate::$2!=(const byte) COLLISION_NONE) goto play_move_rotate::@5
Simple Condition (bool~) play_collision::$2 [871] if(*((byte*) play_collision::piece_gfx#0 + (byte) play_collision::i#2)==(byte) 0) goto play_collision::@3
Simple Condition (bool~) play_collision::$12 [876] if((byte) play_collision::c#1!=rangelast(0,3)) goto play_collision::@2
Simple Condition (bool~) play_collision::$4 [880] if((byte) play_collision::yp#2<(const byte) PLAYFIELD_LINES) goto play_collision::@4
Simple Condition (bool~) play_collision::$7 [885] if((byte~) play_collision::$5==(byte) 0) goto play_collision::@5
Simple Condition (bool~) play_collision::$9 [893] if((byte) play_collision::xp#2<(const byte) PLAYFIELD_COLS) goto play_collision::@6
Simple Condition (bool~) play_collision::$11 [898] if(*((byte*) play_collision::playfield_line#0 + (byte) play_collision::xp#2)==(byte) 0) goto play_collision::@3
Simple Condition (bool~) play_collision::$13 [905] if((byte) play_collision::l#1!=rangelast(0,3)) goto play_collision::@1
Simple Condition (bool~) play_lock_current::$1 [920] if(*((byte*) current_piece_gfx#13 + (byte) play_lock_current::i#2)==(byte) 0) goto play_lock_current::@3
Simple Condition (bool~) play_lock_current::$2 [925] if((byte) play_lock_current::c#1!=rangelast(0,3)) goto play_lock_current::@2
Simple Condition (bool~) play_lock_current::$3 [932] if((byte) play_lock_current::l#1!=rangelast(0,3)) goto play_lock_current::@1
Simple Condition (bool~) play_spawn_current::$3 [953] if((byte~) play_spawn_current::$1!=(const byte) COLLISION_PLAYFIELD) goto play_spawn_current::@1
Simple Condition (bool~) play_spawn_current::$4 [960] if((byte) play_spawn_current::piece_idx#2==(byte) 7) goto play_spawn_current::sid_rnd1
Simple Condition (bool~) play_remove_lines::$1 [993] if((byte) play_remove_lines::c#0!=(byte) 0) goto play_remove_lines::@3
Simple Condition (bool~) play_remove_lines::$2 [999] if((byte) play_remove_lines::x#1!=rangelast(0,PLAYFIELD_COLS-1)) goto play_remove_lines::@2
Simple Condition (bool~) play_remove_lines::$4 [1005] if((byte) play_remove_lines::full#2!=(byte) 1) goto play_remove_lines::@7
Simple Condition (bool~) play_remove_lines::$6 [1009] if((byte) play_remove_lines::y#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_remove_lines::@1
Simple Condition (bool~) play_remove_lines::$7 [1016] if((byte) play_remove_lines::w#6!=(byte) $ff) goto play_remove_lines::@10
Simple Condition (bool~) play_update_score::$1 [1028] if((byte) play_update_score::removed#0==(byte) 0) goto play_update_score::@return
Simple Condition (bool~) play_update_score::$7 [1044] if((byte) play_update_score::lines_before#0==(byte) play_update_score::lines_after#0) goto play_update_score::@return
Simple Condition (bool~) play_increase_level::$0 [1061] if((byte) level#21>(byte) $1d) goto play_increase_level::@1
Simple Condition (bool~) play_increase_level::$3 [1071] if((byte~) play_increase_level::$1!=(byte) $a) goto play_increase_level::@3
Simple Condition (bool~) play_increase_level::$4 [1082] if((byte) play_increase_level::b#1!=rangelast(0,4)) goto play_increase_level::@7
Simple Condition (bool~) main::$10 [1135] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@4
Simple Condition (bool~) main::$14 [1152] if((byte) game_over#10==(byte) 0) goto main::@11
Simple Condition (bool~) main::$18 [1181] if((byte) main::render#2==(byte) 0) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [8] (byte[8]) keyboard_events ← { fill( 8, 0) }
Constant right-side identified [11] (byte[8]) keyboard_scan_values ← { fill( 8, 0) }
Constant right-side identified [140] (byte[PLAYFIELD_LINES*PLAYFIELD_COLS]) playfield ← { fill( PLAYFIELD_LINES*PLAYFIELD_COLS, 0) }
Constant right-side identified [158] (byte*[PLAYFIELD_LINES]) screen_lines_1 ← { fill( PLAYFIELD_LINES, 0) }
Constant right-side identified [159] (byte*[PLAYFIELD_LINES]) screen_lines_2 ← { fill( PLAYFIELD_LINES, 0) }
Constant right-side identified [270] (dword*~) render_score::$1 ← & (dword) score_bcd#40
Constant right-side identified [279] (word) render_bcd::offset#1 ← (const word) render_score::score_offset + (byte) 2
Constant right-side identified [286] (word) render_bcd::offset#2 ← (const word) render_score::score_offset + (byte) 4
Constant right-side identified [300] (word) render_bcd::offset#4 ← (const word) render_score::lines_offset + (byte) 1
Constant right-side identified [428] (byte*) render_next::screen_next_area#1 ← (const byte*) PLAYFIELD_SCREEN_1 + (const word) render_next::next_area_offset
Constant right-side identified [431] (byte*) render_next::screen_next_area#2 ← (const byte*) PLAYFIELD_SCREEN_2 + (const word) render_next::next_area_offset
Constant right-side identified [466] (byte) sprites_init::xpos#0 ← (unumber)(number) $18+(number) $f*(number) 8
Constant right-side identified [504] (void()*~) sprites_irq_init::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
Constant right-side identified [578] (word~) $2 ← (word)(const byte[4*4*4]) PIECE_T
Constant right-side identified [579] (word~) $3 ← (word)(const byte[4*4*4]) PIECE_S
Constant right-side identified [580] (word~) $4 ← (word)(const byte[4*4*4]) PIECE_Z
Constant right-side identified [581] (word~) $5 ← (word)(const byte[4*4*4]) PIECE_J
Constant right-side identified [582] (word~) $6 ← (word)(const byte[4*4*4]) PIECE_O
Constant right-side identified [583] (word~) $7 ← (word)(const byte[4*4*4]) PIECE_I
Constant right-side identified [584] (word~) $8 ← (word)(const byte[4*4*4]) PIECE_L
Constant right-side identified [586] (byte*[PLAYFIELD_LINES]) playfield_lines ← { fill( PLAYFIELD_LINES, 0) }
Constant right-side identified [587] (byte[PLAYFIELD_LINES+1]) playfield_lines_idx ← { fill( PLAYFIELD_LINES+1, 0) }
Constant right-side identified [593] (dword[5]) score_add_bcd ← { fill( 5, 0) }
Constant right-side identified [156] (byte*[PLAYFIELD_LINES]) screen_lines_1 ← { fill( PLAYFIELD_LINES, 0) }
Constant right-side identified [157] (byte*[PLAYFIELD_LINES]) screen_lines_2 ← { fill( PLAYFIELD_LINES, 0) }
Constant right-side identified [268] (dword*~) render_score::$1 ← & (dword) score_bcd#40
Constant right-side identified [277] (word) render_bcd::offset#1 ← (const word) render_score::score_offset + (byte) 2
Constant right-side identified [284] (word) render_bcd::offset#2 ← (const word) render_score::score_offset + (byte) 4
Constant right-side identified [298] (word) render_bcd::offset#4 ← (const word) render_score::lines_offset + (byte) 1
Constant right-side identified [426] (byte*) render_next::screen_next_area#1 ← (const byte*) PLAYFIELD_SCREEN_1 + (const word) render_next::next_area_offset
Constant right-side identified [429] (byte*) render_next::screen_next_area#2 ← (const byte*) PLAYFIELD_SCREEN_2 + (const word) render_next::next_area_offset
Constant right-side identified [464] (byte) sprites_init::xpos#0 ← (unumber)(number) $18+(number) $f*(number) 8
Constant right-side identified [502] (void()*~) sprites_irq_init::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
Constant right-side identified [576] (word~) $2 ← (word)(const byte[4*4*4]) PIECE_T
Constant right-side identified [577] (word~) $3 ← (word)(const byte[4*4*4]) PIECE_S
Constant right-side identified [578] (word~) $4 ← (word)(const byte[4*4*4]) PIECE_Z
Constant right-side identified [579] (word~) $5 ← (word)(const byte[4*4*4]) PIECE_J
Constant right-side identified [580] (word~) $6 ← (word)(const byte[4*4*4]) PIECE_O
Constant right-side identified [581] (word~) $7 ← (word)(const byte[4*4*4]) PIECE_I
Constant right-side identified [582] (word~) $8 ← (word)(const byte[4*4*4]) PIECE_L
Constant right-side identified [584] (byte*[PLAYFIELD_LINES]) playfield_lines ← { fill( PLAYFIELD_LINES, 0) }
Constant right-side identified [585] (byte[PLAYFIELD_LINES+1]) playfield_lines_idx ← { fill( PLAYFIELD_LINES+1, 0) }
Constant right-side identified [591] (dword[5]) score_add_bcd ← { fill( 5, 0) }
Successful SSA optimization Pass2ConstantRValueConsolidation
Identified constant from value list (byte[]) { (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED, (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED, (const byte) BLUE, (const byte) GREEN, (const byte) PURPLE, (const byte) BLUE, (const byte) RED, (const byte) LIGHT_GREEN, (const byte) RED, (const byte) BLUE, (const byte) LIGHT_BLUE, (const byte) RED }
Identified constant from value list (byte[]) { (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE, (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE, (const byte) CYAN, (const byte) LIGHT_GREEN, (const byte) PINK, (const byte) LIGHT_GREEN, (const byte) LIGHT_GREEN, (const byte) LIGHT_BLUE, (const byte) DARK_GREY, (const byte) PURPLE, (const byte) RED, (const byte) ORANGE }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[8]) keyboard_events = { fill( 8, 0) }
Constant (const byte) keyboard_events_size#0 = 0
Constant (const byte) keyboard_modifiers#0 = 0
@ -9120,8 +9115,6 @@ Constant (const word) lines_bcd#0 = 0
Constant (const byte) level_bcd#0 = 0
Constant (const byte) level#0 = 0
Constant (const byte) game_over#0 = 0
Constant (const byte[]) PIECES_COLORS_1 = { BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED }
Constant (const byte[]) PIECES_COLORS_2 = { CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE }
Constant (const byte*[PLAYFIELD_LINES]) screen_lines_1 = { fill( PLAYFIELD_LINES, 0) }
Constant (const byte*[PLAYFIELD_LINES]) screen_lines_2 = { fill( PLAYFIELD_LINES, 0) }
Constant (const byte*) render_init::vicSelectGfxBank1_gfx#0 = PLAYFIELD_CHARSET
@ -9241,7 +9234,7 @@ Constant (const word) sprites_irq::toSpritePtr2_$0 = (word)sprites_irq::toSprite
Constant (const byte*) play_init::pli#0 = playfield
Constant (const byte) play_collision::orientation#4 = current_orientation#68
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [1134] if(true) goto main::@4
if() condition always true - replacing block destination [1132] if(true) goto main::@4
Removing PHI-reference to removed block (main::@12) in block main::@19
Removing PHI-reference to removed block (main::@12) in block main::@19
Removing PHI-reference to removed block (main::@12) in block main::@19
@ -9257,60 +9250,60 @@ Removing PHI-reference to removed block (main::@12) in block main::@19
Removing PHI-reference to removed block (main::@12) in block main::@19
Removing PHI-reference to removed block (main::@12) in block main::@19
Removing PHI-reference to removed block (main::@12) in block main::@19
if() condition always true - replacing block destination [1177] if(true) goto main::@13
if() condition always true - replacing block destination [1175] if(true) goto main::@13
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [30] keyboard_event_scan::row#1 ← ++ keyboard_event_scan::row#2 to ++
Resolved ranged comparison value [32] if(keyboard_event_scan::row#1!=rangelast(0,7)) goto keyboard_event_scan::@8 to (number) 8
Resolved ranged next value [41] keyboard_event_scan::col#1 ← ++ keyboard_event_scan::col#2 to ++
Resolved ranged comparison value [43] if(keyboard_event_scan::col#1!=rangelast(0,7)) goto keyboard_event_scan::@11 to (number) 8
Resolved ranged next value [195] render_init::i#1 ← ++ render_init::i#2 to ++
Resolved ranged comparison value [197] if(render_init::i#1!=rangelast(0,PLAYFIELD_LINES-1)) goto render_init::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [365] render_screen_original::y#1 ← ++ render_screen_original::y#6 to ++
Resolved ranged comparison value [367] if(render_screen_original::y#1!=rangelast(0,$18)) goto render_screen_original::@1 to (number) $19
Resolved ranged next value [381] render_playfield::c#1 ← ++ render_playfield::c#2 to ++
Resolved ranged comparison value [383] if(render_playfield::c#1!=rangelast(0,PLAYFIELD_COLS-1)) goto render_playfield::@2 to (const byte) PLAYFIELD_COLS-(byte) 1+(number) 1
Resolved ranged next value [385] render_playfield::l#1 ← ++ render_playfield::l#2 to ++
Resolved ranged comparison value [387] if(render_playfield::l#1!=rangelast(2,PLAYFIELD_LINES-1)) goto render_playfield::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [406] render_moving::l#1 ← ++ render_moving::l#4 to ++
Resolved ranged comparison value [408] if(render_moving::l#1!=rangelast(0,3)) goto render_moving::@1 to (number) 4
Resolved ranged next value [417] render_moving::c#1 ← ++ render_moving::c#2 to ++
Resolved ranged comparison value [419] if(render_moving::c#1!=rangelast(0,3)) goto render_moving::@4 to (number) 4
Resolved ranged next value [451] render_next::c#1 ← ++ render_next::c#2 to ++
Resolved ranged comparison value [453] if(render_next::c#1!=rangelast(0,3)) goto render_next::@6 to (number) 4
Resolved ranged next value [456] render_next::l#1 ← ++ render_next::l#7 to ++
Resolved ranged comparison value [458] if(render_next::l#1!=rangelast(0,3)) goto render_next::@5 to (number) 4
Resolved ranged next value [475] sprites_init::s#1 ← ++ sprites_init::s#2 to ++
Resolved ranged comparison value [477] if(sprites_init::s#1!=rangelast(0,3)) goto sprites_init::@1 to (number) 4
Resolved ranged next value [604] play_init::j#1 ← ++ play_init::j#2 to ++
Resolved ranged comparison value [606] if(play_init::j#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_init::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [614] play_init::b#1 ← ++ play_init::b#2 to ++
Resolved ranged comparison value [616] if(play_init::b#1!=rangelast(0,4)) goto play_init::@3 to (number) 5
Resolved ranged next value [876] play_collision::c#1 ← ++ play_collision::c#2 to ++
Resolved ranged comparison value [878] if(play_collision::c#1!=rangelast(0,3)) goto play_collision::@2 to (number) 4
Resolved ranged next value [905] play_collision::l#1 ← ++ play_collision::l#6 to ++
Resolved ranged comparison value [907] if(play_collision::l#1!=rangelast(0,3)) goto play_collision::@1 to (number) 4
Resolved ranged next value [925] play_lock_current::c#1 ← ++ play_lock_current::c#2 to ++
Resolved ranged comparison value [927] if(play_lock_current::c#1!=rangelast(0,3)) goto play_lock_current::@2 to (number) 4
Resolved ranged next value [932] play_lock_current::l#1 ← ++ play_lock_current::l#6 to ++
Resolved ranged comparison value [934] if(play_lock_current::l#1!=rangelast(0,3)) goto play_lock_current::@1 to (number) 4
Resolved ranged next value [999] play_remove_lines::x#1 ← ++ play_remove_lines::x#2 to ++
Resolved ranged comparison value [1001] if(play_remove_lines::x#1!=rangelast(0,PLAYFIELD_COLS-1)) goto play_remove_lines::@2 to (const byte) PLAYFIELD_COLS-(byte) 1+(number) 1
Resolved ranged next value [1009] play_remove_lines::y#1 ← ++ play_remove_lines::y#8 to ++
Resolved ranged comparison value [1011] if(play_remove_lines::y#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_remove_lines::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [1082] play_increase_level::b#1 ← ++ play_increase_level::b#2 to ++
Resolved ranged comparison value [1084] if(play_increase_level::b#1!=rangelast(0,4)) goto play_increase_level::@7 to (number) 5
Rewriting conditional comparison [395] if((byte) render_moving::ypos#2>(byte) 1) goto render_moving::@2
Rewriting conditional comparison [1063] if((byte) level#21>(byte) $1d) goto play_increase_level::@1
Resolved ranged next value [193] render_init::i#1 ← ++ render_init::i#2 to ++
Resolved ranged comparison value [195] if(render_init::i#1!=rangelast(0,PLAYFIELD_LINES-1)) goto render_init::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [363] render_screen_original::y#1 ← ++ render_screen_original::y#6 to ++
Resolved ranged comparison value [365] if(render_screen_original::y#1!=rangelast(0,$18)) goto render_screen_original::@1 to (number) $19
Resolved ranged next value [379] render_playfield::c#1 ← ++ render_playfield::c#2 to ++
Resolved ranged comparison value [381] if(render_playfield::c#1!=rangelast(0,PLAYFIELD_COLS-1)) goto render_playfield::@2 to (const byte) PLAYFIELD_COLS-(byte) 1+(number) 1
Resolved ranged next value [383] render_playfield::l#1 ← ++ render_playfield::l#2 to ++
Resolved ranged comparison value [385] if(render_playfield::l#1!=rangelast(2,PLAYFIELD_LINES-1)) goto render_playfield::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [404] render_moving::l#1 ← ++ render_moving::l#4 to ++
Resolved ranged comparison value [406] if(render_moving::l#1!=rangelast(0,3)) goto render_moving::@1 to (number) 4
Resolved ranged next value [415] render_moving::c#1 ← ++ render_moving::c#2 to ++
Resolved ranged comparison value [417] if(render_moving::c#1!=rangelast(0,3)) goto render_moving::@4 to (number) 4
Resolved ranged next value [449] render_next::c#1 ← ++ render_next::c#2 to ++
Resolved ranged comparison value [451] if(render_next::c#1!=rangelast(0,3)) goto render_next::@6 to (number) 4
Resolved ranged next value [454] render_next::l#1 ← ++ render_next::l#7 to ++
Resolved ranged comparison value [456] if(render_next::l#1!=rangelast(0,3)) goto render_next::@5 to (number) 4
Resolved ranged next value [473] sprites_init::s#1 ← ++ sprites_init::s#2 to ++
Resolved ranged comparison value [475] if(sprites_init::s#1!=rangelast(0,3)) goto sprites_init::@1 to (number) 4
Resolved ranged next value [602] play_init::j#1 ← ++ play_init::j#2 to ++
Resolved ranged comparison value [604] if(play_init::j#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_init::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [612] play_init::b#1 ← ++ play_init::b#2 to ++
Resolved ranged comparison value [614] if(play_init::b#1!=rangelast(0,4)) goto play_init::@3 to (number) 5
Resolved ranged next value [874] play_collision::c#1 ← ++ play_collision::c#2 to ++
Resolved ranged comparison value [876] if(play_collision::c#1!=rangelast(0,3)) goto play_collision::@2 to (number) 4
Resolved ranged next value [903] play_collision::l#1 ← ++ play_collision::l#6 to ++
Resolved ranged comparison value [905] if(play_collision::l#1!=rangelast(0,3)) goto play_collision::@1 to (number) 4
Resolved ranged next value [923] play_lock_current::c#1 ← ++ play_lock_current::c#2 to ++
Resolved ranged comparison value [925] if(play_lock_current::c#1!=rangelast(0,3)) goto play_lock_current::@2 to (number) 4
Resolved ranged next value [930] play_lock_current::l#1 ← ++ play_lock_current::l#6 to ++
Resolved ranged comparison value [932] if(play_lock_current::l#1!=rangelast(0,3)) goto play_lock_current::@1 to (number) 4
Resolved ranged next value [997] play_remove_lines::x#1 ← ++ play_remove_lines::x#2 to ++
Resolved ranged comparison value [999] if(play_remove_lines::x#1!=rangelast(0,PLAYFIELD_COLS-1)) goto play_remove_lines::@2 to (const byte) PLAYFIELD_COLS-(byte) 1+(number) 1
Resolved ranged next value [1007] play_remove_lines::y#1 ← ++ play_remove_lines::y#8 to ++
Resolved ranged comparison value [1009] if(play_remove_lines::y#1!=rangelast(0,PLAYFIELD_LINES-1)) goto play_remove_lines::@1 to (const byte) PLAYFIELD_LINES-(byte) 1+(number) 1
Resolved ranged next value [1080] play_increase_level::b#1 ← ++ play_increase_level::b#2 to ++
Resolved ranged comparison value [1082] if(play_increase_level::b#1!=rangelast(0,4)) goto play_increase_level::@7 to (number) 5
Rewriting conditional comparison [393] if((byte) render_moving::ypos#2>(byte) 1) goto render_moving::@2
Rewriting conditional comparison [1061] if((byte) level#21>(byte) $1d) goto play_increase_level::@1
Simplifying expression containing zero KEY_MODIFIER_LSHIFT in [82] (byte) keyboard_modifiers#2 ← (const byte) keyboard_modifiers#1 | (const byte) KEY_MODIFIER_LSHIFT
Simplifying expression containing zero PIECES_COLORS_1 in [178] *((const byte*) BGCOL2) ← *((const byte[]) PIECES_COLORS_1 + (byte) 0)
Simplifying expression containing zero PIECES_COLORS_2 in [179] *((const byte*) BGCOL3) ← *((const byte[]) PIECES_COLORS_2 + (byte) 0)
Simplifying expression containing zero render_score::score_bytes#0 in [289] (byte) render_bcd::bcd#2 ← *((const byte*) render_score::score_bytes#0 + (byte) 0)
Simplifying expression containing zero SPRITES_YPOS in [511] *((const byte*) SPRITES_YPOS + (byte) 0) ← (byte) sprites_irq::ypos#0
Simplifying expression containing zero PLAYFIELD_SPRITE_PTRS_1 in [525] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) 0) ← (byte) sprites_irq::ptr#0
Simplifying expression containing zero PLAYFIELD_SPRITE_PTRS_2 in [532] *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (byte) 0) ← (byte) sprites_irq::ptr#0
Simplifying expression containing zero MOVEDOWN_SLOW_SPEEDS in [609] (byte) current_movedown_slow#1 ← *((const byte[]) MOVEDOWN_SLOW_SPEEDS + (const byte) level#0)
Simplifying expression containing zero play_movement::$0 in [641] (byte) play_movement::render#1 ← (const byte) play_movement::render#0 + (byte~) play_movement::$0
Simplifying expression containing zero current_piece#5 in [942] (byte*) current_piece_gfx#74 ← (byte*) current_piece#5 + (const byte) current_orientation#68
Simplifying expression containing zero PIECES_COLORS_1 in [176] *((const byte*) BGCOL2) ← *((const byte[]) PIECES_COLORS_1 + (byte) 0)
Simplifying expression containing zero PIECES_COLORS_2 in [177] *((const byte*) BGCOL3) ← *((const byte[]) PIECES_COLORS_2 + (byte) 0)
Simplifying expression containing zero render_score::score_bytes#0 in [287] (byte) render_bcd::bcd#2 ← *((const byte*) render_score::score_bytes#0 + (byte) 0)
Simplifying expression containing zero SPRITES_YPOS in [509] *((const byte*) SPRITES_YPOS + (byte) 0) ← (byte) sprites_irq::ypos#0
Simplifying expression containing zero PLAYFIELD_SPRITE_PTRS_1 in [523] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) 0) ← (byte) sprites_irq::ptr#0
Simplifying expression containing zero PLAYFIELD_SPRITE_PTRS_2 in [530] *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (byte) 0) ← (byte) sprites_irq::ptr#0
Simplifying expression containing zero MOVEDOWN_SLOW_SPEEDS in [607] (byte) current_movedown_slow#1 ← *((const byte[]) MOVEDOWN_SLOW_SPEEDS + (const byte) level#0)
Simplifying expression containing zero play_movement::$0 in [639] (byte) play_movement::render#1 ← (const byte) play_movement::render#0 + (byte~) play_movement::$0
Simplifying expression containing zero current_piece#5 in [940] (byte*) current_piece_gfx#74 ← (byte*) current_piece#5 + (const byte) current_orientation#68
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte*) render_bcd::screen_pos#1 and assignment [150] (byte*) render_bcd::screen_pos#1 ← ++ (byte*) render_bcd::screen_pos#3
Eliminating unused variable - keeping the phi block (byte) keyboard_modifiers#16
@ -16805,6 +16798,10 @@ sprites_irq: {
keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f
// Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7)
keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// The T-piece
.align $40
PIECE_T: .byte 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0
@ -16846,10 +16843,6 @@ sprites_irq: {
// The playfield. 0 is empty non-zero is color.
// The playfield is layed out line by line, meaning the first 10 bytes are line 1, the next 10 line 2 and so forth,
playfield: .fill PLAYFIELD_LINES*PLAYFIELD_COLS, 0
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// Pointers to the screen address for rendering each playfield line
// The lines for screen 1 is aligned with 0x80 and screen 2 with 0x40 - so XOR'ing with 0x40 gives screen 2 lines.
.align $80
@ -21535,6 +21528,10 @@ sprites_irq: {
keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f
// Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7)
keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// The T-piece
.align $40
PIECE_T: .byte 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0
@ -21576,10 +21573,6 @@ sprites_irq: {
// The playfield. 0 is empty non-zero is color.
// The playfield is layed out line by line, meaning the first 10 bytes are line 1, the next 10 line 2 and so forth,
playfield: .fill PLAYFIELD_LINES*PLAYFIELD_COLS, 0
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// Pointers to the screen address for rendering each playfield line
// The lines for screen 1 is aligned with 0x80 and screen 2 with 0x40 - so XOR'ing with 0x40 gives screen 2 lines.
.align $80
@ -26626,6 +26619,10 @@ sprites_irq: {
keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f
// Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7)
keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// The T-piece
.align $40
PIECE_T: .byte 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0
@ -26667,10 +26664,6 @@ sprites_irq: {
// The playfield. 0 is empty non-zero is color.
// The playfield is layed out line by line, meaning the first 10 bytes are line 1, the next 10 line 2 and so forth,
playfield: .fill PLAYFIELD_LINES*PLAYFIELD_COLS, 0
// The color #1 to use for the pieces for each level
PIECES_COLORS_1: .byte BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED, BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
// The color #2 to use for the pieces for each level
PIECES_COLORS_2: .byte CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE, CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
// Pointers to the screen address for rendering each playfield line
// The lines for screen 1 is aligned with 0x80 and screen 2 with 0x40 - so XOR'ing with 0x40 gives screen 2 lines.
.align $80

View File

@ -2,20 +2,18 @@ Fixing pointer array-indexing *((const word*) SCREEN + (byte) screen_idx)
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte[]) msg1 ← { (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd' }
(byte[]) msg2 ← { (byte) '1', (byte) '2', (byte) '3', (byte) '4' }
to:@1
(void()) main()
main: scope:[main] from @2
(byte) screen_idx#13 ← phi( @2/(byte) screen_idx#14 )
(byte*) print::m#0 ← (byte[]) msg1
(byte*) print::m#0 ← (const byte[]) msg1
call print
to:main::@1
main::@1: scope:[main] from main
(byte) screen_idx#7 ← phi( main/(byte) screen_idx#5 )
(byte) screen_idx#0 ← (byte) screen_idx#7
(byte*) print::m#1 ← (byte[]) msg2
(byte*) print::m#1 ← (const byte[]) msg2
call print
to:main::@2
main::@2: scope:[main] from main::@1
@ -68,8 +66,8 @@ SYMBOL TABLE SSA
(label) main::@1
(label) main::@2
(label) main::@return
(byte[]) msg1
(byte[]) msg2
(const byte[]) msg1 = { (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd' }
(const byte[]) msg2 = { (byte) '1', (byte) '2', (byte) '3', (byte) '4' }
(void()) print((byte*) print::m)
(byte*~) print::$0
(word*~) print::$1
@ -120,17 +118,11 @@ Identical Phi Values (byte) screen_idx#0 (byte) screen_idx#11
Identical Phi Values (byte) screen_idx#1 (byte) screen_idx#11
Identical Phi Values (byte) screen_idx#12 (byte) screen_idx#1
Successful SSA optimization Pass2IdenticalPhiElimination
Identified constant from value list (byte[]) { (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd' }
Identified constant from value list (byte[]) { (byte) '1', (byte) '2', (byte) '3', (byte) '4' }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[]) msg1 = { 'a', 'b', 'c', 'd' }
Constant (const byte[]) msg2 = { '1', '2', '3', '4' }
Constant (const byte) screen_idx#14 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) print::m#0 = msg1
Constant (const byte*) print::m#1 = msg2
Constant (const byte) screen_idx#14 = 0
Successful SSA optimization Pass2ConstantIdentification
Converting *(pointer+n) to pointer[n] [19] *((const word*) SCREEN + (byte~) print::$2) ← *((word*~) print::$1) -- *((word*)print::m#2 + 2)
Converting *(pointer+n) to pointer[n] [17] *((const word*) SCREEN + (byte~) print::$2) ← *((word*~) print::$1) -- *((word*)print::m#2 + 2)
Successful SSA optimization Pass2InlineDerefIdx
Eliminating unused variable (word*~) print::$1 and assignment [5] (word*~) print::$1 ← (word*)(byte*~) print::$0
Successful SSA optimization PassNEliminateUnusedVars

View File

@ -1,20 +1,18 @@
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte[]) msg1 ← { (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd' }
(byte[]) msg2 ← { (byte) '1', (byte) '2', (byte) '3', (byte) '4' }
to:@1
(void()) main()
main: scope:[main] from @2
(byte) idx#13 ← phi( @2/(byte) idx#14 )
(byte*) print::m#0 ← (byte[]) msg1
(byte*) print::m#0 ← (const byte[]) msg1
call print
to:main::@1
main::@1: scope:[main] from main
(byte) idx#7 ← phi( main/(byte) idx#5 )
(byte) idx#0 ← (byte) idx#7
(byte*) print::m#1 ← (byte[]) msg2
(byte*) print::m#1 ← (const byte[]) msg2
call print
to:main::@2
main::@2: scope:[main] from main::@1
@ -80,8 +78,8 @@ SYMBOL TABLE SSA
(label) main::@1
(label) main::@2
(label) main::@return
(byte[]) msg1
(byte[]) msg2
(const byte[]) msg1 = { (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd' }
(const byte[]) msg2 = { (byte) '1', (byte) '2', (byte) '3', (byte) '4' }
(void()) print((byte*) print::m)
(byte*~) print::$0
(label) print::@return
@ -113,17 +111,11 @@ Identical Phi Values (byte) idx#0 (byte) idx#11
Identical Phi Values (byte) idx#1 (byte) idx#11
Identical Phi Values (byte) idx#12 (byte) idx#1
Successful SSA optimization Pass2IdenticalPhiElimination
Identified constant from value list (byte[]) { (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd' }
Identified constant from value list (byte[]) { (byte) '1', (byte) '2', (byte) '3', (byte) '4' }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[]) msg1 = { 'a', 'b', 'c', 'd' }
Constant (const byte[]) msg2 = { '1', '2', '3', '4' }
Constant (const byte) idx#14 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) print::m#0 = msg1
Constant (const byte*) print::m#1 = msg2
Constant (const byte) idx#14 = 0
Successful SSA optimization Pass2ConstantIdentification
Converting *(pointer+n) to pointer[n] [17] *((const byte*) SCREEN + (byte) idx#10) ← *((byte*~) print::$0) -- *(print::m#2 + 2)
Converting *(pointer+n) to pointer[n] [15] *((const byte*) SCREEN + (byte) idx#10) ← *((byte*~) print::$0) -- *(print::m#2 + 2)
Successful SSA optimization Pass2InlineDerefIdx
Eliminating unused variable (byte*~) print::$0 and assignment [4] (byte*~) print::$0 ← (byte*) print::m#2 + (byte) 2
Successful SSA optimization PassNEliminateUnusedVars

View File

@ -6,7 +6,6 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte[]) main::his ← { >(const byte*) SCREEN, >(const byte*) SCREEN+(number) $100, >(const byte*) SCREEN+(number) $200 }
(byte) main::h#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@3
@ -16,7 +15,7 @@ main::@1: scope:[main] from main main::@3
main::@2: scope:[main] from main::@1 main::@2
(byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 )
(byte) main::h#2 ← phi( main::@1/(byte) main::h#4 main::@2/(byte) main::h#2 )
(word) main::w#0 ← ((word)) { *((byte[]) main::his + (byte) main::h#2), (byte) main::l#2 }
(word) main::w#0 ← ((word)) { *((const byte[]) main::his + (byte) main::h#2), (byte) main::l#2 }
(byte*~) main::$0 ← ((byte*)) (word) main::w#0
(byte*) main::sc#0 ← (byte*~) main::$0
*((byte*) main::sc#0) ← (byte) '*'
@ -60,7 +59,7 @@ SYMBOL TABLE SSA
(byte) main::h#2
(byte) main::h#3
(byte) main::h#4
(byte[]) main::his
(const byte[]) main::his = { >(const byte*) SCREEN, >(const byte*) SCREEN+(number) $100, >(const byte*) SCREEN+(number) $200 }
(byte) main::l
(byte) main::l#0
(byte) main::l#1
@ -72,15 +71,15 @@ SYMBOL TABLE SSA
Fixing inline constructor with main::$3 ← (byte)*(main::his + main::h#2) w= (byte)main::l#2
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) $100 in (byte[]) main::his ← { >(const byte*) SCREEN, >(const byte*) SCREEN+(number) $100, >(const byte*) SCREEN+(number) $200 }
Adding number conversion cast (unumber) $200 in (byte[]) main::his ← { >(const byte*) SCREEN, >(const byte*) SCREEN+(unumber)(number) $100, >(const byte*) SCREEN+(number) $200 }
Adding number conversion cast (unumber) $100 in
Adding number conversion cast (unumber) $200 in
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) main::$0 ← (byte*)(word) main::w#0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $100
Simplifying constant integer cast $200
Simplifying constant integer cast *((byte[]) main::his + (byte) main::h#2)
Simplifying constant integer cast *((const byte[]) main::his + (byte) main::h#2)
Simplifying constant integer cast (byte) main::l#2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $100
@ -92,19 +91,16 @@ Alias (byte) main::h#2 = (byte) main::h#3
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) main::h#2 (byte) main::h#4
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$1 [12] if((byte) main::l#1!=rangelast(4,7)) goto main::@2
Simple Condition (bool~) main::$2 [16] if((byte) main::h#1!=rangelast(0,2)) goto main::@1
Simple Condition (bool~) main::$1 [11] if((byte) main::l#1!=rangelast(4,7)) goto main::@2
Simple Condition (bool~) main::$2 [15] if((byte) main::h#1!=rangelast(0,2)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Identified constant from value list (byte[]) { >(const byte*) SCREEN, >(const byte*) SCREEN+(word) $100, >(const byte*) SCREEN+(word) $200 }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[]) main::his = { >SCREEN, >SCREEN+$100, >SCREEN+$200 }
Constant (const byte) main::h#0 = 0
Constant (const byte) main::l#0 = 4
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [10] main::l#1 ← ++ main::l#2 to ++
Resolved ranged comparison value [12] if(main::l#1!=rangelast(4,7)) goto main::@2 to (number) 8
Resolved ranged next value [14] main::h#1 ← ++ main::h#4 to ++
Resolved ranged comparison value [16] if(main::h#1!=rangelast(0,2)) goto main::@1 to (number) 3
Resolved ranged next value [9] main::l#1 ← ++ main::l#2 to ++
Resolved ranged comparison value [11] if(main::l#1!=rangelast(4,7)) goto main::@2 to (number) 8
Resolved ranged next value [13] main::h#1 ← ++ main::h#4 to ++
Resolved ranged comparison value [15] if(main::h#1!=rangelast(0,2)) goto main::@1 to (number) 3
Adding number conversion cast (unumber) 8 in if((byte) main::l#1!=(number) 8) goto main::@2
Adding number conversion cast (unumber) 3 in if((byte) main::h#1!=(number) 3) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions

View File

@ -10,7 +10,6 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte[]) main::bs ← { (byte) 'c', (byte) 'm' }
(word) main::w#0 ← ((word)) { (const byte) main::b, (number) 0 }
(word~) main::$0 ← ((word)) { (number) 1, (number) 1 }
(word~) main::$1 ← (word~) main::$0 + (word) main::w#0
@ -18,7 +17,7 @@ main: scope:[main] from @1
(word~) main::$3 ← (word~) main::$1 + (word~) main::$2
(word) main::w2#0 ← (word~) main::$3
(byte*) main::sc#0 ← ((byte*)) (word) main::w2#0
*((byte*) main::sc#0) ← *((byte[]) main::bs + (number) 1)
*((byte*) main::sc#0) ← *((const byte[]) main::bs + (number) 1)
(bool~) main::$4 ← *((const byte*) main::pos) == (byte) 'm'
if((bool~) main::$4) goto main::@1
to:main::@3
@ -54,7 +53,7 @@ SYMBOL TABLE SSA
(label) main::@return
(const byte) main::b = (byte) 4
(const byte*) main::bgcol = (byte*)(number) $d021
(byte[]) main::bs
(const byte[]) main::bs = { (byte) 'c', (byte) 'm' }
(const byte*) main::pos = (byte*)(number) $501
(byte*) main::sc
(byte*) main::sc#0
@ -67,7 +66,7 @@ Fixing inline constructor with main::$5 ← (byte)main::b w= (byte)0
Fixing inline constructor with main::$6 ← (byte)1 w= (byte)1
Fixing inline constructor with main::$7 ← (byte)0 w= (byte)0
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) 1 in *((byte*) main::sc#0) ← *((byte[]) main::bs + (number) 1)
Adding number conversion cast (unumber) 1 in *((byte*) main::sc#0) ← *((const byte[]) main::bs + (number) 1)
Adding number conversion cast (unumber) 5 in *((const byte*) main::bgcol) ← (number) 5
Adding number conversion cast (unumber) 2 in *((const byte*) main::bgcol) ← (number) 2
Successful SSA optimization PassNAddNumberTypeConversions
@ -96,19 +95,15 @@ Alias (word~) main::$0 = (word~) main::$6
Alias (word~) main::$2 = (word~) main::$7
Alias (word) main::w2#0 = (word~) main::$3
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$4 [13] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1
Simple Condition (bool~) main::$4 [12] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [1] (word) main::w#0 ← (const byte) main::b w= (byte) 0
Constant right-side identified [3] (word~) main::$0 ← (byte) 1 w= (byte) 1
Constant right-side identified [6] (word~) main::$2 ← (byte) 0 w= (byte) 0
Constant right-side identified [0] (word) main::w#0 ← (const byte) main::b w= (byte) 0
Constant right-side identified [2] (word~) main::$0 ← (byte) 1 w= (byte) 1
Constant right-side identified [5] (word~) main::$2 ← (byte) 0 w= (byte) 0
Successful SSA optimization Pass2ConstantRValueConsolidation
Identified constant from value list (byte[]) { (byte) 'c', (byte) 'm' }
Successful SSA optimization Pass2ConstantInitializerValueLists
Constant (const byte[]) main::bs = { 'c', 'm' }
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero (byte) 0*(number) $100+(byte) 0 in [6] (word~) main::$2 ← (byte) 0*(number) $100+(byte) 0
Simplifying constant evaluating to zero (byte) 0*(number) $100+(byte) 0 in [5] (word~) main::$2 ← (byte) 0*(number) $100+(byte) 0
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::b*$100 in [1] (word) main::w#0 ← (const byte) main::b*(number) $100+(byte) 0
Simplifying expression containing zero main::b*$100 in [0] (word) main::w#0 ← (const byte) main::b*(number) $100+(byte) 0
Successful SSA optimization PassNSimplifyExpressionWithZero
Adding number conversion cast (unumber) main::b*$100 in (word) main::w#0 ← (const byte) main::b*(number) $100
Adding number conversion cast (unumber) $100 in (word) main::w#0 ← ((unumber)) (const byte) main::b*(number) $100