diff --git a/src/main/kc/stdlib/print.kc b/src/main/kc/stdlib/print.kc index c08e7e8e4..2dce19f9e 100644 --- a/src/main/kc/stdlib/print.kc +++ b/src/main/kc/stdlib/print.kc @@ -95,6 +95,12 @@ void print_word(word w) { // Digits used for storing the decimal word char[6] decimal_digits; +// Print a byte as DECIMAL +void print_byte_decimal(byte b) { + utoa((word)b, decimal_digits, DECIMAL); + print_str(decimal_digits); +} + // Print a word as DECIMAL void print_word_decimal(word w) { utoa(w, decimal_digits, DECIMAL); diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 6e3945ea8..0cc48883a 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -35,6 +35,11 @@ public class TestPrograms { public TestPrograms() { } + @Test + public void testEuclid2() throws IOException, URISyntaxException { + compileAndCompare("euclid-3"); + } + @Test public void testEuclidProblem2() throws IOException, URISyntaxException { compileAndCompare("euclid-problem-2"); diff --git a/src/test/kc/euclid-3.kc b/src/test/kc/euclid-3.kc new file mode 100644 index 000000000..2e697c271 --- /dev/null +++ b/src/test/kc/euclid-3.kc @@ -0,0 +1,37 @@ +/* + * Find least common denominator using subtraction-based Euclidian algorithm + * See https://en.wikipedia.org/wiki/Euclidean_algorithm + * Based on facebook post from + */ + +import "print" + +void main () { + print_cls(); + print_euclid(128,2); + print_euclid(169,69); + print_euclid(155,55); + print_euclid(199,3); + print_euclid(91,26); + print_euclid(119,187); +} + +void print_euclid(unsigned char a, unsigned char b) { + print_byte(a); + print_char(' '); + print_byte(b); + print_char(' '); + print_byte(euclid(a,b)); + print_ln(); +} + +unsigned char euclid(unsigned char a, unsigned char b) { + while (a!=b) { + if(a>b) { + a=a-b; + } else { + b=b-a; + } + } + return a; +} diff --git a/src/test/ref/bitmap-plot-3.log b/src/test/ref/bitmap-plot-3.log index 82b107908..0caf62fa5 100644 --- a/src/test/ref/bitmap-plot-3.log +++ b/src/test/ref/bitmap-plot-3.log @@ -69,6 +69,7 @@ Culled Empty Block (label) @41 Culled Empty Block (label) @42 Culled Empty Block (label) @43 Culled Empty Block (label) @44 +Culled Empty Block (label) @45 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::@2 Culled Empty Block (label) main::@6 @@ -128,7 +129,7 @@ memset::@return: scope:[memset] from memset::@1 (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } - to:@45 + to:@46 bitmap_init: scope:[bitmap_init] from main (byte*) bitmap_init::screen#1 ← phi( main/(byte*) bitmap_init::screen#0 ) (byte*) bitmap_init::gfx#1 ← phi( main/(byte*) bitmap_init::gfx#0 ) @@ -531,7 +532,7 @@ sgn_u16::@return: scope:[sgn_u16] from sgn_u16::@1 sgn_u16::@3 (word) sgn_u16::return#4 ← (word) sgn_u16::return#7 return to:@return -@45: scope:[] from @8 +@46: scope:[] from @8 (byte*) bitmap_screen#19 ← phi( @8/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#20 ← phi( @8/(byte*) bitmap_gfx#0 ) (byte*) BITMAP#0 ← ((byte*)) (number) $2000 @@ -539,11 +540,11 @@ sgn_u16::@return: scope:[sgn_u16] from sgn_u16::@1 sgn_u16::@3 (byte[$180]) SINTAB#0 ← kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} (byte*~) $0 ← (byte[$180]) SINTAB#0 + (number) $40 (byte*) COSTAB#0 ← (byte*~) $0 - to:@46 -main: scope:[main] from @46 - (byte*) COSTAB#8 ← phi( @46/(byte*) COSTAB#9 ) - (byte*) bitmap_screen#12 ← phi( @46/(byte*) bitmap_screen#14 ) - (byte*) bitmap_gfx#13 ← phi( @46/(byte*) bitmap_gfx#15 ) + to:@47 +main: scope:[main] from @47 + (byte*) COSTAB#8 ← phi( @47/(byte*) COSTAB#9 ) + (byte*) bitmap_screen#12 ← phi( @47/(byte*) bitmap_screen#14 ) + (byte*) bitmap_gfx#13 ← phi( @47/(byte*) bitmap_gfx#15 ) (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 call bitmap_init @@ -652,25 +653,25 @@ main::@return: scope:[main] from main::@3 (byte*) bitmap_screen#4 ← (byte*) bitmap_screen#9 return to:@return -@46: scope:[] from @45 - (byte*) COSTAB#9 ← phi( @45/(byte*) COSTAB#0 ) - (byte*) bitmap_screen#14 ← phi( @45/(byte*) bitmap_screen#19 ) - (byte*) bitmap_gfx#15 ← phi( @45/(byte*) bitmap_gfx#20 ) - call main - to:@47 @47: scope:[] from @46 - (byte*) bitmap_screen#10 ← phi( @46/(byte*) bitmap_screen#4 ) - (byte*) bitmap_gfx#10 ← phi( @46/(byte*) bitmap_gfx#4 ) + (byte*) COSTAB#9 ← phi( @46/(byte*) COSTAB#0 ) + (byte*) bitmap_screen#14 ← phi( @46/(byte*) bitmap_screen#19 ) + (byte*) bitmap_gfx#15 ← phi( @46/(byte*) bitmap_gfx#20 ) + call main + to:@48 +@48: scope:[] from @47 + (byte*) bitmap_screen#10 ← phi( @47/(byte*) bitmap_screen#4 ) + (byte*) bitmap_gfx#10 ← phi( @47/(byte*) bitmap_gfx#4 ) (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 to:@end -@end: scope:[] from @47 +@end: scope:[] from @48 SYMBOL TABLE SSA (byte*~) $0 -(label) @45 (label) @46 (label) @47 +(label) @48 (label) @8 (label) @begin (label) @end @@ -1802,9 +1803,9 @@ Added new block during phi lifting bitmap_line::@30(between bitmap_line::@23 and Added new block during phi lifting main::@13(between main::@12 and main::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @8 -Adding NOP phi() at start of @45 Adding NOP phi() at start of @46 Adding NOP phi() at start of @47 +Adding NOP phi() at start of @48 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@10 @@ -1879,8 +1880,8 @@ Coalesced [188] bitmap_init::x#5 ← bitmap_init::x#1 Coalesced [189] bitmap_init::bits#6 ← bitmap_init::bits#1 Coalesced down to 19 phi equivalence classes Culled Empty Block (label) @8 -Culled Empty Block (label) @45 -Culled Empty Block (label) @47 +Culled Empty Block (label) @46 +Culled Empty Block (label) @48 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@13 @@ -1902,7 +1903,7 @@ Culled Empty Block (label) bitmap_init::@4 Culled Empty Block (label) bitmap_init::@11 Culled Empty Block (label) bitmap_init::@12 Culled Empty Block (label) bitmap_init::@9 -Renumbering block @46 to @1 +Renumbering block @47 to @1 Renumbering block memset::@2 to memset::@1 Renumbering block memset::@4 to memset::@2 Renumbering block bitmap_init::@5 to bitmap_init::@3 diff --git a/src/test/ref/c-types.log b/src/test/ref/c-types.log index 93acb503e..23f239c6a 100644 --- a/src/test/ref/c-types.log +++ b/src/test/ref/c-types.log @@ -51,8 +51,8 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 +Culled Empty Block (label) @28 Culled Empty Block (label) print_sdword::@4 -Culled Empty Block (label) @29 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 @@ -63,6 +63,7 @@ Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 +Culled Empty Block (label) @40 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -107,7 +108,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_str: scope:[print_str] from testChar testInt testLong testShort (byte*) print_char_cursor#156 ← phi( testChar/(byte*) print_char_cursor#151 testInt/(byte*) print_char_cursor#153 testLong/(byte*) print_char_cursor#154 testShort/(byte*) print_char_cursor#152 ) (byte*) print_str::str#7 ← phi( testChar/(byte*) print_str::str#1 testInt/(byte*) print_str::str#3 testLong/(byte*) print_str::str#4 testShort/(byte*) print_str::str#2 ) @@ -339,12 +340,12 @@ print_sdword::@return: scope:[print_sdword] from print_sdword::@7 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#90 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#5 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#160 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#50 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@40 + to:@41 print_byte: scope:[print_byte] from print_sbyte::@2 print_word print_word::@1 testChar::@1 testChar::@3 (byte*) print_char_cursor#149 ← phi( print_sbyte::@2/(byte*) print_char_cursor#143 print_word/(byte*) print_char_cursor#144 print_word::@1/(byte*) print_char_cursor#13 testChar::@1/(byte*) print_char_cursor#36 testChar::@3/(byte*) print_char_cursor#38 ) (byte) print_byte::b#5 ← phi( print_sbyte::@2/(byte) print_byte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 testChar::@1/(byte) print_byte::b#3 testChar::@3/(byte) print_byte::b#4 ) @@ -400,10 +401,10 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#29 ← (byte*) print_char_cursor#96 return to:@return -main: scope:[main] from @40 - (byte*) print_char_cursor#150 ← phi( @40/(byte*) print_char_cursor#155 ) - (byte*) print_line_cursor#40 ← phi( @40/(byte*) print_line_cursor#45 ) - (byte*) print_screen#3 ← phi( @40/(byte*) print_screen#4 ) +main: scope:[main] from @41 + (byte*) print_char_cursor#150 ← phi( @41/(byte*) print_char_cursor#155 ) + (byte*) print_line_cursor#40 ← phi( @41/(byte*) print_line_cursor#45 ) + (byte*) print_screen#3 ← phi( @41/(byte*) print_screen#4 ) call print_cls to:main::@1 main::@1: scope:[main] from main @@ -699,26 +700,26 @@ testLong::@return: scope:[testLong] from testLong::@7 (byte*) print_line_cursor#18 ← (byte*) print_line_cursor#37 return to:@return -@40: scope:[] from @28 - (byte*) print_screen#4 ← phi( @28/(byte*) print_screen#5 ) - (byte*) print_char_cursor#155 ← phi( @28/(byte*) print_char_cursor#160 ) - (byte*) print_line_cursor#45 ← phi( @28/(byte*) print_line_cursor#50 ) +@41: scope:[] from @29 + (byte*) print_screen#4 ← phi( @29/(byte*) print_screen#5 ) + (byte*) print_char_cursor#155 ← phi( @29/(byte*) print_char_cursor#160 ) + (byte*) print_line_cursor#45 ← phi( @29/(byte*) print_line_cursor#50 ) call main - to:@41 -@41: scope:[] from @40 - (byte*) print_char_cursor#135 ← phi( @40/(byte*) print_char_cursor#35 ) - (byte*) print_line_cursor#38 ← phi( @40/(byte*) print_line_cursor#10 ) + to:@42 +@42: scope:[] from @41 + (byte*) print_char_cursor#135 ← phi( @41/(byte*) print_char_cursor#35 ) + (byte*) print_line_cursor#38 ← phi( @41/(byte*) print_line_cursor#10 ) (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#38 (byte*) print_char_cursor#68 ← (byte*) print_char_cursor#135 to:@end -@end: scope:[] from @41 +@end: scope:[] from @42 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @40 +(label) @29 (label) @41 +(label) @42 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -1655,9 +1656,9 @@ Added new block during phi lifting memset::@6(between memset::@4 and memset::@4) Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @40 +Adding NOP phi() at start of @29 Adding NOP phi() at start of @41 +Adding NOP phi() at start of @42 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -1762,8 +1763,8 @@ Coalesced (already) [177] print_char_cursor#173 ← print_char_cursor#26 Coalesced [193] memset::dst#3 ← memset::dst#1 Coalesced down to 10 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @41 +Culled Empty Block (label) @29 +Culled Empty Block (label) @42 Culled Empty Block (label) main::@5 Culled Empty Block (label) testLong::@7 Culled Empty Block (label) print_ln::@2 @@ -1784,7 +1785,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @40 to @1 +Renumbering block @41 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block print_sdword::@5 to print_sdword::@4 diff --git a/src/test/ref/c64dtv-gfxexplorer.log b/src/test/ref/c64dtv-gfxexplorer.log index d9cb809cf..8411b6223 100644 --- a/src/test/ref/c64dtv-gfxexplorer.log +++ b/src/test/ref/c64dtv-gfxexplorer.log @@ -51,33 +51,34 @@ Culled Empty Block (label) @29 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 -Culled Empty Block (label) @34 +Culled Empty Block (label) @33 Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 -Culled Empty Block (label) @41 -Culled Empty Block (label) keyboard_matrix_read::@1 +Culled Empty Block (label) @40 Culled Empty Block (label) @42 +Culled Empty Block (label) keyboard_matrix_read::@1 Culled Empty Block (label) @43 +Culled Empty Block (label) @44 Culled Empty Block (label) keyboard_event_scan::@22 Culled Empty Block (label) keyboard_event_scan::@13 Culled Empty Block (label) keyboard_event_scan::@15 Culled Empty Block (label) keyboard_event_scan::@19 Culled Empty Block (label) keyboard_event_scan::@4 -Culled Empty Block (label) @45 -Culled Empty Block (label) keyboard_event_pressed::@1 Culled Empty Block (label) @46 +Culled Empty Block (label) keyboard_event_pressed::@1 +Culled Empty Block (label) @47 Culled Empty Block (label) keyboard_event_get::@4 Culled Empty Block (label) keyboard_event_get::@2 Culled Empty Block (label) keyboard_event_get::@5 Culled Empty Block (label) keyboard_event_get::@6 Culled Empty Block (label) bitmap_init::@8 -Culled Empty Block (label) @48 -Culled Empty Block (label) bitmap_clear::@4 Culled Empty Block (label) @49 +Culled Empty Block (label) bitmap_clear::@4 Culled Empty Block (label) @50 +Culled Empty Block (label) @51 Culled Empty Block (label) bitmap_line::@12 Culled Empty Block (label) bitmap_line::@6 Culled Empty Block (label) bitmap_line::@14 @@ -92,15 +93,15 @@ Culled Empty Block (label) bitmap_line::@24 Culled Empty Block (label) bitmap_line::@23 Culled Empty Block (label) bitmap_line::@26 Culled Empty Block (label) bitmap_line::@28 -Culled Empty Block (label) @51 -Culled Empty Block (label) bitmap_line_xdyi::@4 Culled Empty Block (label) @52 -Culled Empty Block (label) bitmap_line_xdyd::@4 +Culled Empty Block (label) bitmap_line_xdyi::@4 Culled Empty Block (label) @53 -Culled Empty Block (label) bitmap_line_ydxi::@4 +Culled Empty Block (label) bitmap_line_xdyd::@4 Culled Empty Block (label) @54 -Culled Empty Block (label) bitmap_line_ydxd::@4 +Culled Empty Block (label) bitmap_line_ydxi::@4 Culled Empty Block (label) @55 +Culled Empty Block (label) bitmap_line_ydxd::@4 +Culled Empty Block (label) @56 Culled Empty Block (label) main::@4 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@5 @@ -146,7 +147,7 @@ Culled Empty Block (label) get_plane::@66 Culled Empty Block (label) get_plane::@67 Culled Empty Block (label) get_plane::@68 Culled Empty Block (label) get_plane::@69 -Culled Empty Block (label) @57 +Culled Empty Block (label) @58 Culled Empty Block (label) get_vic_screen::@5 Culled Empty Block (label) get_vic_screen::@15 Culled Empty Block (label) get_vic_screen::@6 @@ -161,7 +162,7 @@ Culled Empty Block (label) get_vic_screen::@21 Culled Empty Block (label) get_vic_screen::@22 Culled Empty Block (label) get_vic_screen::@23 Culled Empty Block (label) get_vic_screen::@24 -Culled Empty Block (label) @58 +Culled Empty Block (label) @59 Culled Empty Block (label) get_vic_charset::@2 Culled Empty Block (label) get_vic_charset::@6 Culled Empty Block (label) get_vic_charset::@7 @@ -189,7 +190,7 @@ Culled Empty Block (label) apply_preset::@21 Culled Empty Block (label) apply_preset::@43 Culled Empty Block (label) apply_preset::@44 Culled Empty Block (label) apply_preset::@46 -Culled Empty Block (label) @60 +Culled Empty Block (label) @61 Culled Empty Block (label) render_preset_name::@12 Culled Empty Block (label) render_preset_name::@34 Culled Empty Block (label) render_preset_name::@13 @@ -227,24 +228,23 @@ Culled Empty Block (label) gfx_mode::@42 Culled Empty Block (label) gfx_mode::@40 Culled Empty Block (label) gfx_mode::@41 Culled Empty Block (label) gfx_mode::@45 -Culled Empty Block (label) @62 Culled Empty Block (label) @63 Culled Empty Block (label) @64 -Culled Empty Block (label) gfx_init_screen0::@4 Culled Empty Block (label) @65 -Culled Empty Block (label) gfx_init_screen1::@4 +Culled Empty Block (label) gfx_init_screen0::@4 Culled Empty Block (label) @66 -Culled Empty Block (label) gfx_init_screen2::@4 +Culled Empty Block (label) gfx_init_screen1::@4 Culled Empty Block (label) @67 -Culled Empty Block (label) gfx_init_screen3::@4 +Culled Empty Block (label) gfx_init_screen2::@4 Culled Empty Block (label) @68 -Culled Empty Block (label) gfx_init_screen4::@4 +Culled Empty Block (label) gfx_init_screen3::@4 Culled Empty Block (label) @69 -Culled Empty Block (label) gfx_init_vic_bitmap::@2 +Culled Empty Block (label) gfx_init_screen4::@4 Culled Empty Block (label) @70 +Culled Empty Block (label) gfx_init_vic_bitmap::@2 Culled Empty Block (label) @71 -Culled Empty Block (label) gfx_init_plane_horisontal::@6 Culled Empty Block (label) @72 +Culled Empty Block (label) gfx_init_plane_horisontal::@6 Culled Empty Block (label) @73 Culled Empty Block (label) @74 Culled Empty Block (label) @75 @@ -252,6 +252,7 @@ Culled Empty Block (label) @76 Culled Empty Block (label) @77 Culled Empty Block (label) @78 Culled Empty Block (label) @79 +Culled Empty Block (label) @80 Culled Empty Block (label) form_mode::@4 Culled Empty Block (label) form_mode::@16 Culled Empty Block (label) form_mode::@5 @@ -266,11 +267,11 @@ Culled Empty Block (label) form_mode::@15 Culled Empty Block (label) form_mode::@19 Culled Empty Block (label) form_mode::@20 Culled Empty Block (label) form_set_screen::@2 -Culled Empty Block (label) @81 -Culled Empty Block (label) form_field_ptr::@1 Culled Empty Block (label) @82 -Culled Empty Block (label) form_render_values::@2 +Culled Empty Block (label) form_field_ptr::@1 Culled Empty Block (label) @83 +Culled Empty Block (label) form_render_values::@2 +Culled Empty Block (label) @84 Culled Empty Block (label) form_control::@9 Culled Empty Block (label) form_control::@20 Culled Empty Block (label) form_control::@21 @@ -393,7 +394,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@33 + to:@34 print_str_lines: scope:[print_str_lines] from form_mode::@22 form_mode::@25 (byte*) print_line_cursor#45 ← phi( form_mode::@22/(byte*) print_line_cursor#12 form_mode::@25/(byte*) print_line_cursor#15 ) (byte*) print_char_cursor#47 ← phi( form_mode::@22/(byte*) print_char_cursor#13 form_mode::@25/(byte*) print_char_cursor#16 ) @@ -495,12 +496,12 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#24 return to:@return -@33: scope:[] from @17 +@34: scope:[] from @17 (byte*) print_char_cursor#72 ← phi( @17/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#72 ← phi( @17/(byte*) print_line_cursor#0 ) (byte*) print_screen#51 ← phi( @17/(byte*) print_screen#0 ) (byte[]) print_hextab#0 ← (const string) $38 - to:@40 + to:@41 print_cls: scope:[print_cls] from form_mode::@21 form_mode::@24 (byte*) print_screen#9 ← phi( form_mode::@21/(byte*) print_screen#5 form_mode::@24/(byte*) print_screen#6 ) (void*) memset::str#0 ← (void*)(byte*) print_screen#9 @@ -536,10 +537,10 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#26 return to:@return -@40: scope:[] from @33 - (byte*) print_char_cursor#71 ← phi( @33/(byte*) print_char_cursor#72 ) - (byte*) print_line_cursor#71 ← phi( @33/(byte*) print_line_cursor#72 ) - (byte*) print_screen#49 ← phi( @33/(byte*) print_screen#51 ) +@41: scope:[] from @34 + (byte*) print_char_cursor#71 ← phi( @34/(byte*) print_char_cursor#72 ) + (byte*) print_line_cursor#71 ← phi( @34/(byte*) print_line_cursor#72 ) + (byte*) print_screen#49 ← phi( @34/(byte*) print_screen#51 ) (byte) KEY_CRSR_RIGHT#0 ← (number) 2 (byte) KEY_CRSR_DOWN#0 ← (number) 7 (byte) KEY_LSHIFT#0 ← (number) $f @@ -549,7 +550,7 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen (byte) KEY_COMMODORE#0 ← (number) $3d (byte[8]) keyboard_matrix_row_bitmask#0 ← { (number) $fe, (number) $fd, (number) $fb, (number) $f7, (number) $ef, (number) $df, (number) $bf, (number) $7f } (byte[8]) keyboard_matrix_col_bitmask#0 ← { (number) 1, (number) 2, (number) 4, (number) 8, (number) $10, (number) $20, (number) $40, (number) $80 } - to:@44 + to:@45 keyboard_init: scope:[keyboard_init] from main *((byte*) CIA1_PORT_A_DDR#0) ← (number) $ff *((byte*) CIA1_PORT_B_DDR#0) ← (number) 0 @@ -569,10 +570,10 @@ keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matri (byte) keyboard_matrix_read::return#1 ← (byte) keyboard_matrix_read::return#3 return to:@return -@44: scope:[] from @40 - (byte*) print_char_cursor#70 ← phi( @40/(byte*) print_char_cursor#71 ) - (byte*) print_line_cursor#70 ← phi( @40/(byte*) print_line_cursor#71 ) - (byte*) print_screen#47 ← phi( @40/(byte*) print_screen#49 ) +@45: scope:[] from @41 + (byte*) print_char_cursor#70 ← phi( @41/(byte*) print_char_cursor#71 ) + (byte*) print_line_cursor#70 ← phi( @41/(byte*) print_line_cursor#71 ) + (byte*) print_screen#47 ← phi( @41/(byte*) print_screen#49 ) (byte[8]) keyboard_events#0 ← { fill( 8, 0) } (byte) keyboard_events_size#0 ← (number) 0 (byte) keyboard_modifiers#0 ← (number) 0 @@ -583,7 +584,7 @@ keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matri (byte~) $0 ← (byte) KEY_MODIFIER_LSHIFT#0 | (byte) KEY_MODIFIER_RSHIFT#0 (byte) KEY_MODIFIER_SHIFT#0 ← (byte~) $0 (byte[8]) keyboard_scan_values#0 ← { fill( 8, 0) } - to:@47 + to:@48 keyboard_event_scan: scope:[keyboard_event_scan] from form_control::@3 gfx_mode::@36 (byte) keyboard_events_size#99 ← phi( form_control::@3/(byte) keyboard_events_size#48 gfx_mode::@36/(byte) keyboard_events_size#44 ) (byte) keyboard_event_scan::keycode#0 ← (number) 0 @@ -828,18 +829,18 @@ keyboard_event_get::@return: scope:[keyboard_event_get] from keyboard_event_get (byte) keyboard_events_size#5 ← (byte) keyboard_events_size#24 return to:@return -@47: scope:[] from @44 - (byte) keyboard_modifiers#95 ← phi( @44/(byte) keyboard_modifiers#0 ) - (byte) keyboard_events_size#111 ← phi( @44/(byte) keyboard_events_size#0 ) - (byte*) print_char_cursor#68 ← phi( @44/(byte*) print_char_cursor#70 ) - (byte*) print_line_cursor#68 ← phi( @44/(byte*) print_line_cursor#70 ) - (byte*) print_screen#45 ← phi( @44/(byte*) print_screen#47 ) +@48: scope:[] from @45 + (byte) keyboard_modifiers#95 ← phi( @45/(byte) keyboard_modifiers#0 ) + (byte) keyboard_events_size#111 ← phi( @45/(byte) keyboard_events_size#0 ) + (byte*) print_char_cursor#68 ← phi( @45/(byte*) print_char_cursor#70 ) + (byte*) print_line_cursor#68 ← phi( @45/(byte*) print_line_cursor#70 ) + (byte*) print_screen#45 ← phi( @45/(byte*) print_screen#47 ) (byte[$100]) bitmap_plot_xlo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_xhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } - to:@56 + to:@57 bitmap_init: scope:[bitmap_init] from gfx_init_vic_bitmap (byte*) bitmap_init::bitmap#2 ← phi( gfx_init_vic_bitmap/(byte*) bitmap_init::bitmap#0 ) (byte) bitmap_init::bits#0 ← (number) $80 @@ -1384,14 +1385,14 @@ bitmap_line_ydxd::@3: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@5 bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 return to:@return -main: scope:[main] from @84 - (byte) form_field_idx#48 ← phi( @84/(byte) form_field_idx#34 ) - (byte) keyboard_modifiers#83 ← phi( @84/(byte) keyboard_modifiers#52 ) - (byte) keyboard_events_size#92 ← phi( @84/(byte) keyboard_events_size#53 ) - (signed byte) form_cursor_count#43 ← phi( @84/(signed byte) form_cursor_count#26 ) - (byte*) print_char_cursor#61 ← phi( @84/(byte*) print_char_cursor#46 ) - (byte*) print_line_cursor#61 ← phi( @84/(byte*) print_line_cursor#44 ) - (byte*) print_screen#38 ← phi( @84/(byte*) print_screen#24 ) +main: scope:[main] from @85 + (byte) form_field_idx#48 ← phi( @85/(byte) form_field_idx#34 ) + (byte) keyboard_modifiers#83 ← phi( @85/(byte) keyboard_modifiers#52 ) + (byte) keyboard_events_size#92 ← phi( @85/(byte) keyboard_events_size#53 ) + (signed byte) form_cursor_count#43 ← phi( @85/(signed byte) form_cursor_count#26 ) + (byte*) print_char_cursor#61 ← phi( @85/(byte*) print_char_cursor#46 ) + (byte*) print_line_cursor#61 ← phi( @85/(byte*) print_line_cursor#44 ) + (byte*) print_screen#38 ← phi( @85/(byte*) print_screen#24 ) asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 *((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0 @@ -1482,12 +1483,12 @@ main::@return: scope:[main] from main::@1 (byte) form_field_idx#1 ← (byte) form_field_idx#12 return to:@return -@56: scope:[] from @47 - (byte) keyboard_modifiers#90 ← phi( @47/(byte) keyboard_modifiers#95 ) - (byte) keyboard_events_size#103 ← phi( @47/(byte) keyboard_events_size#111 ) - (byte*) print_char_cursor#65 ← phi( @47/(byte*) print_char_cursor#68 ) - (byte*) print_line_cursor#65 ← phi( @47/(byte*) print_line_cursor#68 ) - (byte*) print_screen#42 ← phi( @47/(byte*) print_screen#45 ) +@57: scope:[] from @48 + (byte) keyboard_modifiers#90 ← phi( @48/(byte) keyboard_modifiers#95 ) + (byte) keyboard_events_size#103 ← phi( @48/(byte) keyboard_events_size#111 ) + (byte*) print_char_cursor#65 ← phi( @48/(byte*) print_char_cursor#68 ) + (byte*) print_line_cursor#65 ← phi( @48/(byte*) print_line_cursor#68 ) + (byte*) print_screen#42 ← phi( @48/(byte*) print_screen#45 ) (byte*) VIC_SCREEN0#0 ← ((byte*)) (number) $4000 (byte*) VIC_SCREEN1#0 ← ((byte*)) (number) $4400 (byte*) VIC_SCREEN2#0 ← ((byte*)) (number) $4800 @@ -1503,7 +1504,7 @@ main::@return: scope:[main] from main::@1 (dword) PLANE_BLANK#0 ← (number) $38000 (dword) PLANE_FULL#0 ← (number) $3a000 (dword) PLANE_CHARSET8#0 ← (number) $3c000 - to:@59 + to:@60 get_plane: scope:[get_plane] from gfx_mode::@46 gfx_mode::@9 (byte) get_plane::idx#2 ← phi( gfx_mode::@46/(byte) get_plane::idx#1 gfx_mode::@9/(byte) get_plane::idx#0 ) (bool~) get_plane::$0 ← (byte) get_plane::idx#2 == (number) 0 @@ -1714,12 +1715,12 @@ get_vic_charset::@return: scope:[get_vic_charset] from get_vic_charset::@1 get_ get_vic_charset::@3: scope:[get_vic_charset] from get_vic_charset::@4 (byte*) get_vic_charset::return#3 ← (byte*) VIC_CHARSET_ROM#0 to:get_vic_charset::@return -@59: scope:[] from @56 - (byte) keyboard_modifiers#84 ← phi( @56/(byte) keyboard_modifiers#90 ) - (byte) keyboard_events_size#93 ← phi( @56/(byte) keyboard_events_size#103 ) - (byte*) print_char_cursor#62 ← phi( @56/(byte*) print_char_cursor#65 ) - (byte*) print_line_cursor#62 ← phi( @56/(byte*) print_line_cursor#65 ) - (byte*) print_screen#39 ← phi( @56/(byte*) print_screen#42 ) +@60: scope:[] from @57 + (byte) keyboard_modifiers#84 ← phi( @57/(byte) keyboard_modifiers#90 ) + (byte) keyboard_events_size#93 ← phi( @57/(byte) keyboard_events_size#103 ) + (byte*) print_char_cursor#62 ← phi( @57/(byte*) print_char_cursor#65 ) + (byte*) print_line_cursor#62 ← phi( @57/(byte*) print_line_cursor#65 ) + (byte*) print_screen#39 ← phi( @57/(byte*) print_screen#42 ) (byte*) FORM_SCREEN#0 ← ((byte*)) (number) $400 (byte*) FORM_CHARSET#0 ← ((byte*)) (number) $1800 (byte[]) FORM_TEXT#0 ← (const string) $39 @@ -1740,7 +1741,7 @@ get_vic_charset::@3: scope:[get_vic_charset] from get_vic_charset::@4 (byte[]) preset_sixsfred#0 ← { (number) 8, (number) 1, (number) 1, (number) 1, (number) 1, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 9, (number) 0, (number) 0, (number) 0, (number) 1, (number) 0, (number) 0, (number) $a, (number) 0, (number) 0, (number) 0, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 1, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } (byte[]) preset_sixsfred2#0 ← { (number) 9, (number) 1, (number) 1, (number) 1, (number) 0, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 9, (number) 0, (number) 0, (number) 0, (number) 1, (number) 0, (number) 0, (number) $a, (number) 0, (number) 0, (number) 0, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } (byte[]) preset_8bpppixelcell#0 ← { (number) $a, (number) 0, (number) 1, (number) 1, (number) 1, (number) 1, (number) 0, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 1, (number) 0, (number) 0, (number) $b, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 1, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } - to:@61 + to:@62 apply_preset: scope:[apply_preset] from form_mode::@18 (byte) apply_preset::idx#1 ← phi( form_mode::@18/(byte) apply_preset::idx#0 ) (byte*) apply_preset::preset#0 ← (byte*) 0 @@ -1953,12 +1954,12 @@ render_preset_name::@45: scope:[render_preset_name] from render_preset_name::@2 render_preset_name::@return: scope:[render_preset_name] from render_preset_name::@45 return to:@return -@61: scope:[] from @59 - (byte) keyboard_modifiers#81 ← phi( @59/(byte) keyboard_modifiers#84 ) - (byte) keyboard_events_size#85 ← phi( @59/(byte) keyboard_events_size#93 ) - (byte*) print_char_cursor#60 ← phi( @59/(byte*) print_char_cursor#62 ) - (byte*) print_line_cursor#60 ← phi( @59/(byte*) print_line_cursor#62 ) - (byte*) print_screen#37 ← phi( @59/(byte*) print_screen#39 ) +@62: scope:[] from @60 + (byte) keyboard_modifiers#81 ← phi( @60/(byte) keyboard_modifiers#84 ) + (byte) keyboard_events_size#85 ← phi( @60/(byte) keyboard_events_size#93 ) + (byte*) print_char_cursor#60 ← phi( @60/(byte*) print_char_cursor#62 ) + (byte*) print_line_cursor#60 ← phi( @60/(byte*) print_line_cursor#62 ) + (byte*) print_screen#37 ← phi( @60/(byte*) print_screen#39 ) (byte*~) $1 ← (byte[]) form_fields_val#0 + (number) 0 (byte*) form_preset#0 ← (byte*~) $1 (byte*~) $2 ← (byte[]) form_fields_val#0 + (number) 1 @@ -2031,7 +2032,7 @@ render_preset_name::@return: scope:[render_preset_name] from render_preset_name (byte*) form_vic_bg3_hi#0 ← (byte*~) $35 (byte*~) $36 ← (byte[]) form_fields_val#0 + (number) $23 (byte*) form_vic_bg3_lo#0 ← (byte*~) $36 - to:@80 + to:@81 gfx_mode: scope:[gfx_mode] from main::@9 (byte) keyboard_modifiers#128 ← phi( main::@9/(byte) keyboard_modifiers#7 ) (byte) keyboard_events_size#147 ← phi( main::@9/(byte) keyboard_events_size#6 ) @@ -3433,19 +3434,19 @@ form_mode::@33: scope:[form_mode] from form_mode::@32 (byte*) print_line_cursor#51 ← phi( form_mode::@32/(byte*) print_line_cursor#59 ) (byte*) print_screen#30 ← phi( form_mode::@32/(byte*) print_screen#36 ) to:form_mode::@3 -@80: scope:[] from @61 - (byte) keyboard_modifiers#75 ← phi( @61/(byte) keyboard_modifiers#81 ) - (byte) keyboard_events_size#76 ← phi( @61/(byte) keyboard_events_size#85 ) - (byte*) print_char_cursor#55 ← phi( @61/(byte*) print_char_cursor#60 ) - (byte*) print_line_cursor#53 ← phi( @61/(byte*) print_line_cursor#60 ) - (byte*) print_screen#32 ← phi( @61/(byte*) print_screen#37 ) +@81: scope:[] from @62 + (byte) keyboard_modifiers#75 ← phi( @62/(byte) keyboard_modifiers#81 ) + (byte) keyboard_events_size#76 ← phi( @62/(byte) keyboard_events_size#85 ) + (byte*) print_char_cursor#55 ← phi( @62/(byte*) print_char_cursor#60 ) + (byte*) print_line_cursor#53 ← phi( @62/(byte*) print_line_cursor#60 ) + (byte*) print_screen#32 ← phi( @62/(byte*) print_screen#37 ) (byte[$19]) form_line_lo#0 ← { fill( $19, 0) } (byte[$19]) form_line_hi#0 ← { fill( $19, 0) } (byte) form_field_idx#4 ← (number) 0 (signed byte) FORM_CURSOR_BLINK#0 ← (number) $28 (number~) $37 ← (signed byte) FORM_CURSOR_BLINK#0 / (number) 2 (signed byte) form_cursor_count#4 ← (number~) $37 - to:@84 + to:@85 form_set_screen: scope:[form_set_screen] from form_mode::@26 (byte*) form_set_screen::screen#1 ← phi( form_mode::@26/(byte*) form_set_screen::screen#0 ) (byte*) form_set_screen::line#0 ← (byte*) form_set_screen::screen#1 @@ -3747,24 +3748,24 @@ form_control::@16: scope:[form_control] from form_control::@5 (signed byte) form_cursor_count#23 ← phi( form_control::@5/(signed byte) form_cursor_count#37 ) (byte) form_control::return#5 ← (number) $ff to:form_control::@return -@84: scope:[] from @80 - (byte) form_field_idx#34 ← phi( @80/(byte) form_field_idx#4 ) - (byte) keyboard_modifiers#52 ← phi( @80/(byte) keyboard_modifiers#75 ) - (byte) keyboard_events_size#53 ← phi( @80/(byte) keyboard_events_size#76 ) - (signed byte) form_cursor_count#26 ← phi( @80/(signed byte) form_cursor_count#4 ) - (byte*) print_char_cursor#46 ← phi( @80/(byte*) print_char_cursor#55 ) - (byte*) print_line_cursor#44 ← phi( @80/(byte*) print_line_cursor#53 ) - (byte*) print_screen#24 ← phi( @80/(byte*) print_screen#32 ) +@85: scope:[] from @81 + (byte) form_field_idx#34 ← phi( @81/(byte) form_field_idx#4 ) + (byte) keyboard_modifiers#52 ← phi( @81/(byte) keyboard_modifiers#75 ) + (byte) keyboard_events_size#53 ← phi( @81/(byte) keyboard_events_size#76 ) + (signed byte) form_cursor_count#26 ← phi( @81/(signed byte) form_cursor_count#4 ) + (byte*) print_char_cursor#46 ← phi( @81/(byte*) print_char_cursor#55 ) + (byte*) print_line_cursor#44 ← phi( @81/(byte*) print_line_cursor#53 ) + (byte*) print_screen#24 ← phi( @81/(byte*) print_screen#32 ) call main - to:@85 -@85: scope:[] from @84 - (byte) form_field_idx#24 ← phi( @84/(byte) form_field_idx#1 ) - (byte) keyboard_modifiers#33 ← phi( @84/(byte) keyboard_modifiers#9 ) - (byte) keyboard_events_size#36 ← phi( @84/(byte) keyboard_events_size#8 ) - (signed byte) form_cursor_count#17 ← phi( @84/(signed byte) form_cursor_count#1 ) - (byte*) print_char_cursor#36 ← phi( @84/(byte*) print_char_cursor#11 ) - (byte*) print_line_cursor#35 ← phi( @84/(byte*) print_line_cursor#10 ) - (byte*) print_screen#17 ← phi( @84/(byte*) print_screen#4 ) + to:@86 +@86: scope:[] from @85 + (byte) form_field_idx#24 ← phi( @85/(byte) form_field_idx#1 ) + (byte) keyboard_modifiers#33 ← phi( @85/(byte) keyboard_modifiers#9 ) + (byte) keyboard_events_size#36 ← phi( @85/(byte) keyboard_events_size#8 ) + (signed byte) form_cursor_count#17 ← phi( @85/(signed byte) form_cursor_count#1 ) + (byte*) print_char_cursor#36 ← phi( @85/(byte*) print_char_cursor#11 ) + (byte*) print_line_cursor#35 ← phi( @85/(byte*) print_line_cursor#10 ) + (byte*) print_screen#17 ← phi( @85/(byte*) print_screen#4 ) (byte*) print_screen#8 ← (byte*) print_screen#17 (byte*) print_line_cursor#18 ← (byte*) print_line_cursor#35 (byte*) print_char_cursor#19 ← (byte*) print_char_cursor#36 @@ -3773,7 +3774,7 @@ form_control::@16: scope:[form_control] from form_control::@5 (byte) keyboard_modifiers#16 ← (byte) keyboard_modifiers#33 (byte) form_field_idx#10 ← (byte) form_field_idx#24 to:@end -@end: scope:[] from @85 +@end: scope:[] from @86 SYMBOL TABLE SSA (byte~) $0 @@ -3818,17 +3819,17 @@ SYMBOL TABLE SSA (byte*~) $8 (byte*~) $9 (label) @17 -(label) @33 +(label) @34 (label) @4 -(label) @40 -(label) @44 -(label) @47 -(label) @56 -(label) @59 -(label) @61 -(label) @80 -(label) @84 +(label) @41 +(label) @45 +(label) @48 +(label) @57 +(label) @60 +(label) @62 +(label) @81 (label) @85 +(label) @86 (label) @begin (label) @end (byte*) BGCOL @@ -10879,16 +10880,16 @@ Added new block during phi lifting form_control::@38(between form_control::@19 a Adding NOP phi() at start of @begin Adding NOP phi() at start of @4 Adding NOP phi() at start of @17 -Adding NOP phi() at start of @33 -Adding NOP phi() at start of @40 -Adding NOP phi() at start of @44 -Adding NOP phi() at start of @47 -Adding NOP phi() at start of @56 -Adding NOP phi() at start of @59 -Adding NOP phi() at start of @61 -Adding NOP phi() at start of @80 -Adding NOP phi() at start of @84 +Adding NOP phi() at start of @34 +Adding NOP phi() at start of @41 +Adding NOP phi() at start of @45 +Adding NOP phi() at start of @48 +Adding NOP phi() at start of @57 +Adding NOP phi() at start of @60 +Adding NOP phi() at start of @62 +Adding NOP phi() at start of @81 Adding NOP phi() at start of @85 +Adding NOP phi() at start of @86 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@7 Adding NOP phi() at start of main::@8 @@ -11361,15 +11362,15 @@ Coalesced (already) [1230] gfx_init_screen0::ch#7 ← gfx_init_screen0::ch#1 Coalesced down to 120 phi equivalence classes Culled Empty Block (label) @4 Culled Empty Block (label) @17 -Culled Empty Block (label) @33 -Culled Empty Block (label) @40 -Culled Empty Block (label) @44 -Culled Empty Block (label) @47 -Culled Empty Block (label) @56 -Culled Empty Block (label) @59 -Culled Empty Block (label) @61 -Culled Empty Block (label) @80 -Culled Empty Block (label) @85 +Culled Empty Block (label) @34 +Culled Empty Block (label) @41 +Culled Empty Block (label) @45 +Culled Empty Block (label) @48 +Culled Empty Block (label) @57 +Culled Empty Block (label) @60 +Culled Empty Block (label) @62 +Culled Empty Block (label) @81 +Culled Empty Block (label) @86 Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@10 Culled Empty Block (label) gfx_mode::@25 @@ -11521,7 +11522,7 @@ Culled Empty Block (label) gfx_init_screen1::@5 Culled Empty Block (label) gfx_init_screen1::@6 Culled Empty Block (label) gfx_init_screen0::@5 Culled Empty Block (label) gfx_init_screen0::@6 -Renumbering block @84 to @1 +Renumbering block @85 to @1 Renumbering block memset::@2 to memset::@1 Renumbering block memset::@4 to memset::@2 Renumbering block print_str_lines::@4 to print_str_lines::@2 diff --git a/src/test/ref/c64dtv-gfxmodes.log b/src/test/ref/c64dtv-gfxmodes.log index 10ee0ca48..7a8827f7b 100644 --- a/src/test/ref/c64dtv-gfxmodes.log +++ b/src/test/ref/c64dtv-gfxmodes.log @@ -54,19 +54,20 @@ Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 -Culled Empty Block (label) @41 -Culled Empty Block (label) keyboard_matrix_read::@1 +Culled Empty Block (label) @40 Culled Empty Block (label) @42 -Culled Empty Block (label) keyboard_key_pressed::@1 +Culled Empty Block (label) keyboard_matrix_read::@1 Culled Empty Block (label) @43 +Culled Empty Block (label) keyboard_key_pressed::@1 Culled Empty Block (label) @44 Culled Empty Block (label) @45 Culled Empty Block (label) @46 +Culled Empty Block (label) @47 Culled Empty Block (label) bitmap_init::@8 -Culled Empty Block (label) @48 -Culled Empty Block (label) bitmap_clear::@4 Culled Empty Block (label) @49 +Culled Empty Block (label) bitmap_clear::@4 Culled Empty Block (label) @50 +Culled Empty Block (label) @51 Culled Empty Block (label) bitmap_line::@12 Culled Empty Block (label) bitmap_line::@6 Culled Empty Block (label) bitmap_line::@14 @@ -81,15 +82,15 @@ Culled Empty Block (label) bitmap_line::@24 Culled Empty Block (label) bitmap_line::@23 Culled Empty Block (label) bitmap_line::@26 Culled Empty Block (label) bitmap_line::@28 -Culled Empty Block (label) @51 -Culled Empty Block (label) bitmap_line_xdyi::@4 Culled Empty Block (label) @52 -Culled Empty Block (label) bitmap_line_xdyd::@4 +Culled Empty Block (label) bitmap_line_xdyi::@4 Culled Empty Block (label) @53 -Culled Empty Block (label) bitmap_line_ydxi::@4 +Culled Empty Block (label) bitmap_line_xdyd::@4 Culled Empty Block (label) @54 -Culled Empty Block (label) bitmap_line_ydxd::@4 +Culled Empty Block (label) bitmap_line_ydxi::@4 Culled Empty Block (label) @55 +Culled Empty Block (label) bitmap_line_ydxd::@4 +Culled Empty Block (label) @56 Culled Empty Block (label) main::@4 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@5 @@ -123,7 +124,6 @@ Culled Empty Block (label) mode_ctrl::@10 Culled Empty Block (label) mode_ctrl::@11 Culled Empty Block (label) mode_ctrl::@20 Culled Empty Block (label) mode_ctrl::@31 -Culled Empty Block (label) @58 Culled Empty Block (label) @59 Culled Empty Block (label) @60 Culled Empty Block (label) @61 @@ -131,11 +131,12 @@ Culled Empty Block (label) @62 Culled Empty Block (label) @63 Culled Empty Block (label) @64 Culled Empty Block (label) @65 -Culled Empty Block (label) mode_twoplanebitmap::@12 Culled Empty Block (label) @66 +Culled Empty Block (label) mode_twoplanebitmap::@12 Culled Empty Block (label) @67 Culled Empty Block (label) @68 Culled Empty Block (label) @69 +Culled Empty Block (label) @70 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -248,7 +249,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@40 + to:@41 print_str_lines: scope:[print_str_lines] from menu::@48 (byte*) print_line_cursor#50 ← phi( menu::@48/(byte*) print_line_cursor#12 ) (byte*) print_char_cursor#52 ← phi( menu::@48/(byte*) print_char_cursor#13 ) @@ -365,7 +366,7 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#23 return to:@return -@40: scope:[] from @17 +@41: scope:[] from @17 (byte*) print_char_cursor#97 ← phi( @17/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#97 ← phi( @17/(byte*) print_line_cursor#0 ) (byte*) print_screen#78 ← phi( @17/(byte*) print_screen#0 ) @@ -389,7 +390,7 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen (byte) KEY_SPACE#0 ← (number) $3c (byte[8]) keyboard_matrix_row_bitmask#0 ← { (number) $fe, (number) $fd, (number) $fb, (number) $f7, (number) $ef, (number) $df, (number) $bf, (number) $7f } (byte[8]) keyboard_matrix_col_bitmask#0 ← { (number) 1, (number) 2, (number) 4, (number) 8, (number) $10, (number) $20, (number) $40, (number) $80 } - to:@47 + to:@48 keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed (byte) keyboard_matrix_read::rowid#1 ← phi( keyboard_key_pressed/(byte) keyboard_matrix_read::rowid#0 ) *((byte*) CIA1_PORT_A#0) ← *((byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#1) @@ -424,16 +425,16 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p (byte) keyboard_key_pressed::return#1 ← (byte) keyboard_key_pressed::return#22 return to:@return -@47: scope:[] from @40 - (byte*) print_char_cursor#84 ← phi( @40/(byte*) print_char_cursor#97 ) - (byte*) print_line_cursor#84 ← phi( @40/(byte*) print_line_cursor#97 ) - (byte*) print_screen#65 ← phi( @40/(byte*) print_screen#78 ) +@48: scope:[] from @41 + (byte*) print_char_cursor#84 ← phi( @41/(byte*) print_char_cursor#97 ) + (byte*) print_line_cursor#84 ← phi( @41/(byte*) print_line_cursor#97 ) + (byte*) print_screen#65 ← phi( @41/(byte*) print_screen#78 ) (byte[$100]) bitmap_plot_xlo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_xhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } - to:@56 + to:@57 bitmap_init: scope:[bitmap_init] from mode_stdbitmap::@6 (byte*) bitmap_init::bitmap#2 ← phi( mode_stdbitmap::@6/(byte*) bitmap_init::bitmap#0 ) (byte) bitmap_init::bits#0 ← (number) $80 @@ -978,11 +979,11 @@ bitmap_line_ydxd::@3: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@5 bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 return to:@return -main: scope:[main] from @70 - (byte) dtv_control#130 ← phi( @70/(byte) dtv_control#129 ) - (byte*) print_char_cursor#54 ← phi( @70/(byte*) print_char_cursor#51 ) - (byte*) print_line_cursor#52 ← phi( @70/(byte*) print_line_cursor#49 ) - (byte*) print_screen#33 ← phi( @70/(byte*) print_screen#32 ) +main: scope:[main] from @71 + (byte) dtv_control#130 ← phi( @71/(byte) dtv_control#129 ) + (byte*) print_char_cursor#54 ← phi( @71/(byte*) print_char_cursor#51 ) + (byte*) print_line_cursor#52 ← phi( @71/(byte*) print_line_cursor#49 ) + (byte*) print_screen#33 ← phi( @71/(byte*) print_screen#32 ) asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 *((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0 @@ -1023,12 +1024,12 @@ main::@return: scope:[main] from main::@1 (byte) dtv_control#1 ← (byte) dtv_control#56 return to:@return -@56: scope:[] from @47 - (byte*) print_char_cursor#83 ← phi( @47/(byte*) print_char_cursor#84 ) - (byte*) print_line_cursor#83 ← phi( @47/(byte*) print_line_cursor#84 ) - (byte*) print_screen#64 ← phi( @47/(byte*) print_screen#65 ) +@57: scope:[] from @48 + (byte*) print_char_cursor#83 ← phi( @48/(byte*) print_char_cursor#84 ) + (byte*) print_line_cursor#83 ← phi( @48/(byte*) print_line_cursor#84 ) + (byte*) print_screen#64 ← phi( @48/(byte*) print_screen#65 ) (byte[]) MENU_TEXT#0 ← (const string) $1 - to:@57 + to:@58 menu: scope:[menu] from main::@2 (byte) dtv_control#251 ← phi( main::@2/(byte) dtv_control#98 ) (byte*) print_char_cursor#98 ← phi( main::@2/(byte*) print_char_cursor#35 ) @@ -1564,12 +1565,12 @@ menu::@73: scope:[menu] from menu::@44 (byte) dtv_control#69 ← phi( menu::@44/(byte) dtv_control#53 ) (byte) dtv_control#14 ← (byte) dtv_control#69 to:menu::@return -@57: scope:[] from @56 - (byte*) print_char_cursor#69 ← phi( @56/(byte*) print_char_cursor#83 ) - (byte*) print_line_cursor#67 ← phi( @56/(byte*) print_line_cursor#83 ) - (byte*) print_screen#49 ← phi( @56/(byte*) print_screen#64 ) +@58: scope:[] from @57 + (byte*) print_char_cursor#69 ← phi( @57/(byte*) print_char_cursor#83 ) + (byte*) print_line_cursor#67 ← phi( @57/(byte*) print_line_cursor#83 ) + (byte*) print_screen#49 ← phi( @57/(byte*) print_screen#64 ) (byte) dtv_control#15 ← (number) 0 - to:@70 + to:@71 mode_ctrl: scope:[mode_ctrl] from mode_8bppchunkybmm::@11 mode_8bpppixelcell::@14 mode_ecmchar::@6 mode_hicolecmchar::@6 mode_hicolmcchar::@6 mode_hicolstdchar::@6 mode_mcchar::@6 mode_sixsfred2::@14 mode_sixsfred::@14 mode_stdbitmap::@8 mode_stdchar::@6 mode_twoplanebitmap::@18 (byte) dtv_control#144 ← phi( mode_8bppchunkybmm::@11/(byte) dtv_control#128 mode_8bpppixelcell::@14/(byte) dtv_control#127 mode_ecmchar::@6/(byte) dtv_control#118 mode_hicolecmchar::@6/(byte) dtv_control#122 mode_hicolmcchar::@6/(byte) dtv_control#123 mode_hicolstdchar::@6/(byte) dtv_control#121 mode_mcchar::@6/(byte) dtv_control#119 mode_sixsfred2::@14/(byte) dtv_control#126 mode_sixsfred::@14/(byte) dtv_control#125 mode_stdbitmap::@8/(byte) dtv_control#120 mode_stdchar::@6/(byte) dtv_control#117 mode_twoplanebitmap::@18/(byte) dtv_control#124 ) to:mode_ctrl::@1 @@ -3333,35 +3334,35 @@ mode_8bppchunkybmm::@return: scope:[mode_8bppchunkybmm] from mode_8bppchunkybmm (byte) dtv_control#53 ← (byte) dtv_control#96 return to:@return -@70: scope:[] from @57 - (byte) dtv_control#129 ← phi( @57/(byte) dtv_control#15 ) - (byte*) print_char_cursor#51 ← phi( @57/(byte*) print_char_cursor#69 ) - (byte*) print_line_cursor#49 ← phi( @57/(byte*) print_line_cursor#67 ) - (byte*) print_screen#32 ← phi( @57/(byte*) print_screen#49 ) +@71: scope:[] from @58 + (byte) dtv_control#129 ← phi( @58/(byte) dtv_control#15 ) + (byte*) print_char_cursor#51 ← phi( @58/(byte*) print_char_cursor#69 ) + (byte*) print_line_cursor#49 ← phi( @58/(byte*) print_line_cursor#67 ) + (byte*) print_screen#32 ← phi( @58/(byte*) print_screen#49 ) call main - to:@71 -@71: scope:[] from @70 - (byte) dtv_control#97 ← phi( @70/(byte) dtv_control#1 ) - (byte*) print_char_cursor#30 ← phi( @70/(byte*) print_char_cursor#11 ) - (byte*) print_line_cursor#29 ← phi( @70/(byte*) print_line_cursor#10 ) - (byte*) print_screen#15 ← phi( @70/(byte*) print_screen#4 ) + to:@72 +@72: scope:[] from @71 + (byte) dtv_control#97 ← phi( @71/(byte) dtv_control#1 ) + (byte*) print_char_cursor#30 ← phi( @71/(byte*) print_char_cursor#11 ) + (byte*) print_line_cursor#29 ← phi( @71/(byte*) print_line_cursor#10 ) + (byte*) print_screen#15 ← phi( @71/(byte*) print_screen#4 ) (byte*) print_screen#7 ← (byte*) print_screen#15 (byte*) print_line_cursor#15 ← (byte*) print_line_cursor#29 (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#30 (byte) dtv_control#54 ← (byte) dtv_control#97 to:@end -@end: scope:[] from @71 +@end: scope:[] from @72 SYMBOL TABLE SSA (const string) $1 = (string) "C64DTV Graphics Modes CCLHBME@ OHIIMCC@ LUNCMMM@----------------------------------------@1. Standard Char (V) 0000000@2. Extended Color Char (V) 0000001@3. Multicolor Char (V) 0000010@4. Standard Bitmap (V) 0000100@5. Multicolor Bitmap (V) 0000110@6. High Color Standard Char (H) 0001000@7. High Extended Color Char (H) 0001001@8. High Multicolor Char (H) 0001010@9. High Multicolor Bitmap (H) 0001110@a. Sixs Fred 2 (D) 0010111@b. Two Plane Bitmap (D) 0011101@c. Sixs Fred (2 Plane MC BM) (D) 0011111@d. 8bpp Pixel Cell (D) 0111011@e. Chunky 8bpp Bitmap (D) 1111011@----------------------------------------@ (V) vicII (H) vicII+hicol (D) c64dtv@@" (label) @17 (label) @4 -(label) @40 -(label) @47 -(label) @56 +(label) @41 +(label) @48 (label) @57 -(label) @70 +(label) @58 (label) @71 +(label) @72 (label) @begin (label) @end (byte*) BGCOL @@ -10139,12 +10140,12 @@ Added new block during phi lifting mode_8bppchunkybmm::@16(between mode_8bppchun Adding NOP phi() at start of @begin Adding NOP phi() at start of @4 Adding NOP phi() at start of @17 -Adding NOP phi() at start of @40 -Adding NOP phi() at start of @47 -Adding NOP phi() at start of @56 +Adding NOP phi() at start of @41 +Adding NOP phi() at start of @48 Adding NOP phi() at start of @57 -Adding NOP phi() at start of @70 +Adding NOP phi() at start of @58 Adding NOP phi() at start of @71 +Adding NOP phi() at start of @72 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@1 Adding NOP phi() at start of main::@2 @@ -10557,11 +10558,11 @@ Coalesced [1226] memset::dst#3 ← memset::dst#1 Coalesced down to 125 phi equivalence classes Culled Empty Block (label) @4 Culled Empty Block (label) @17 -Culled Empty Block (label) @40 -Culled Empty Block (label) @47 -Culled Empty Block (label) @56 +Culled Empty Block (label) @41 +Culled Empty Block (label) @48 Culled Empty Block (label) @57 -Culled Empty Block (label) @71 +Culled Empty Block (label) @58 +Culled Empty Block (label) @72 Culled Empty Block (label) main::@1 Culled Empty Block (label) main::@7 Culled Empty Block (label) menu::@2 @@ -10695,7 +10696,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @70 to @1 +Renumbering block @71 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_str_lines::@4 to print_str_lines::@2 Renumbering block print_str_lines::@5 to print_str_lines::@3 diff --git a/src/test/ref/cia-timer-cyclecount.log b/src/test/ref/cia-timer-cyclecount.log index 92f96d34c..5a69a931c 100644 --- a/src/test/ref/cia-timer-cyclecount.log +++ b/src/test/ref/cia-timer-cyclecount.log @@ -39,12 +39,13 @@ Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 -Culled Empty Block (label) @35 +Culled Empty Block (label) @34 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 Culled Empty Block (label) @40 +Culled Empty Block (label) @41 Culled Empty Block (label) main::@4 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@5 @@ -63,7 +64,7 @@ CONTROL FLOW GRAPH SSA to:@4 @4: scope:[] from @begin (dword) CLOCKS_PER_INIT#0 ← (number) $12 - to:@34 + to:@35 clock: scope:[clock] from main::@7 (number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0) (dword) clock::return#0 ← (number~) clock::$0 @@ -135,9 +136,9 @@ print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1 print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2 return to:@return -@34: scope:[] from @4 +@35: scope:[] from @4 (byte[]) print_hextab#0 ← (const string) $1 - to:@41 + to:@42 print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1 (byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 ) (byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 ) @@ -168,10 +169,10 @@ print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1 print_char_at::@return: scope:[print_char_at] from print_char_at return to:@return -@41: scope:[] from @34 +@42: scope:[] from @35 (byte*) SCREEN#0 ← ((byte*)) (number) $400 - to:@42 -main: scope:[main] from @42 + to:@43 +main: scope:[main] from @43 to:main::@1 main::@1: scope:[main] from main main::@9 if(true) goto main::@2 @@ -198,20 +199,20 @@ main::@9: scope:[main] from main::@8 main::@return: scope:[main] from main::@1 return to:@return -@42: scope:[] from @41 - call main - to:@43 @43: scope:[] from @42 + call main + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 SYMBOL TABLE SSA (const string) $1 = (string) "0123456789abcdef" -(label) @34 +(label) @35 (label) @4 -(label) @41 (label) @42 (label) @43 +(label) @44 (label) @begin (label) @end (dword*) CIA2_TIMER_AB @@ -472,10 +473,10 @@ Constant inlined clock_start::$3 = (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERF Successful SSA optimization Pass2ConstantInlining Adding NOP phi() at start of @begin Adding NOP phi() at start of @4 -Adding NOP phi() at start of @34 -Adding NOP phi() at start of @41 +Adding NOP phi() at start of @35 Adding NOP phi() at start of @42 Adding NOP phi() at start of @43 +Adding NOP phi() at start of @44 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -504,15 +505,15 @@ Coalesced [51] print_char_at::ch#4 ← print_char_at::ch#1 Coalesced [52] print_char_at::at#4 ← print_char_at::at#1 Coalesced down to 6 phi equivalence classes Culled Empty Block (label) @4 -Culled Empty Block (label) @34 -Culled Empty Block (label) @41 -Culled Empty Block (label) @43 +Culled Empty Block (label) @35 +Culled Empty Block (label) @42 +Culled Empty Block (label) @44 Culled Empty Block (label) main::@1 Culled Empty Block (label) main::@9 Culled Empty Block (label) print_dword_at::@2 Culled Empty Block (label) print_word_at::@2 Culled Empty Block (label) print_byte_at::@2 -Renumbering block @42 to @1 +Renumbering block @43 to @1 Renumbering block main::@2 to main::@1 Renumbering block main::@7 to main::@2 Renumbering block main::@8 to main::@3 diff --git a/src/test/ref/cia-timer-simple.log b/src/test/ref/cia-timer-simple.log index a29b33c69..28b958114 100644 --- a/src/test/ref/cia-timer-simple.log +++ b/src/test/ref/cia-timer-simple.log @@ -40,12 +40,13 @@ Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 -Culled Empty Block (label) @35 +Culled Empty Block (label) @34 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 Culled Empty Block (label) @40 +Culled Empty Block (label) @41 Culled Empty Block (label) main::@4 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@5 @@ -61,7 +62,7 @@ CONTROL FLOW GRAPH SSA (byte) CIA_TIMER_CONTROL_CONTINUOUS#0 ← (number) 0 (byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0 ← (number) 0 (byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 ← (number) $40 - to:@34 + to:@35 clock: scope:[clock] from main::@2 (number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0) (dword) clock::return#0 ← (number~) clock::$0 @@ -133,9 +134,9 @@ print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1 print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2 return to:@return -@34: scope:[] from @begin +@35: scope:[] from @begin (byte[]) print_hextab#0 ← (const string) $1 - to:@41 + to:@42 print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1 (byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 ) (byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 ) @@ -166,10 +167,10 @@ print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1 print_char_at::@return: scope:[print_char_at] from print_char_at return to:@return -@41: scope:[] from @34 +@42: scope:[] from @35 (byte*) SCREEN#0 ← ((byte*)) (number) $400 - to:@42 -main: scope:[main] from @42 + to:@43 +main: scope:[main] from @43 call clock_start to:main::@7 main::@7: scope:[main] from main @@ -193,19 +194,19 @@ main::@9: scope:[main] from main::@8 main::@return: scope:[main] from main::@1 return to:@return -@42: scope:[] from @41 - call main - to:@43 @43: scope:[] from @42 + call main + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 SYMBOL TABLE SSA (const string) $1 = (string) "0123456789abcdef" -(label) @34 -(label) @41 +(label) @35 (label) @42 (label) @43 +(label) @44 (label) @begin (label) @end (dword*) CIA2_TIMER_AB @@ -455,10 +456,10 @@ Constant inlined $1 = (const byte[]) print_hextab#0 Constant inlined clock_start::$3 = (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 Successful SSA optimization Pass2ConstantInlining Adding NOP phi() at start of @begin -Adding NOP phi() at start of @34 -Adding NOP phi() at start of @41 +Adding NOP phi() at start of @35 Adding NOP phi() at start of @42 Adding NOP phi() at start of @43 +Adding NOP phi() at start of @44 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@7 @@ -487,16 +488,16 @@ Coalesced [43] print_char_at::at#3 ← print_char_at::at#0 Coalesced [48] print_char_at::ch#4 ← print_char_at::ch#1 Coalesced [49] print_char_at::at#4 ← print_char_at::at#1 Coalesced down to 6 phi equivalence classes -Culled Empty Block (label) @34 -Culled Empty Block (label) @41 -Culled Empty Block (label) @43 +Culled Empty Block (label) @35 +Culled Empty Block (label) @42 +Culled Empty Block (label) @44 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@1 Culled Empty Block (label) main::@9 Culled Empty Block (label) print_dword_at::@2 Culled Empty Block (label) print_word_at::@2 Culled Empty Block (label) print_byte_at::@2 -Renumbering block @42 to @1 +Renumbering block @43 to @1 Renumbering block main::@2 to main::@1 Renumbering block main::@8 to main::@2 Adding NOP phi() at start of @begin diff --git a/src/test/ref/complex/splines/truetype-splines.log b/src/test/ref/complex/splines/truetype-splines.log index 5eaf5ce05..a799cf636 100644 --- a/src/test/ref/complex/splines/truetype-splines.log +++ b/src/test/ref/complex/splines/truetype-splines.log @@ -606,15 +606,16 @@ Culled Empty Block (label) @46 Culled Empty Block (label) @47 Culled Empty Block (label) @48 Culled Empty Block (label) @49 -Culled Empty Block (label) @51 +Culled Empty Block (label) @50 Culled Empty Block (label) @52 Culled Empty Block (label) @53 Culled Empty Block (label) @54 Culled Empty Block (label) @55 Culled Empty Block (label) @56 Culled Empty Block (label) @57 -Culled Empty Block (label) mulf16u::@1 Culled Empty Block (label) @58 +Culled Empty Block (label) mulf16u::@1 +Culled Empty Block (label) @59 Culled Empty Block (label) mulf16s::@5 Culled Empty Block (label) main::vicSelectGfxBank1_toDd001_@1 Culled Empty Block (label) main::vicSelectGfxBank1_@return @@ -629,12 +630,12 @@ Culled Empty Block (label) main::@16 Culled Empty Block (label) main::@15 Culled Empty Block (label) main::@17 Culled Empty Block (label) main::@18 -Culled Empty Block (label) @60 +Culled Empty Block (label) @61 Culled Empty Block (label) show_letter::@4 Culled Empty Block (label) show_letter::@8 Culled Empty Block (label) show_letter::@9 Culled Empty Block (label) show_letter::@10 -Culled Empty Block (label) @61 +Culled Empty Block (label) @62 Culled Empty Block (label) bitmap_plot_spline_8seg::@2 Culled Empty Block (label) rotate::@1 Unwinding list assignment { (signed word) show_letter::$2_x, (signed word) show_letter::$2_y } ← { (signed word) rotate::return_x, (signed word) rotate::return_y } @@ -1190,15 +1191,15 @@ sgn_u16::@return: scope:[sgn_u16] from sgn_u16::@1 sgn_u16::@3 (byte*) CIA2_PORT_A_DDR#0 ← ((byte*)) (number) $dd02 (byte) BLACK#0 ← (number) 0 (byte) WHITE#0 ← (number) 1 - to:@50 -@50: scope:[] from @13 + to:@51 +@51: scope:[] from @13 (byte*) bitmap_screen#27 ← phi( @13/(byte*) bitmap_screen#32 ) (byte*) bitmap_gfx#28 ← phi( @13/(byte*) bitmap_gfx#33 ) (byte[$200]) mulf_sqr1_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr1_hi#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_hi#0 ← { fill( $200, 0) } - to:@59 + to:@60 mulf_init: scope:[mulf_init] from main (word) mulf_init::sqr#0 ← (number) 0 (byte) mulf_init::x_2#0 ← (number) 0 @@ -1368,18 +1369,18 @@ mulf16s::@return: scope:[mulf16s] from mulf16s::@2 (signed dword) mulf16s::return#1 ← (signed dword) mulf16s::return#6 return to:@return -@59: scope:[] from @50 - (byte*) bitmap_screen#25 ← phi( @50/(byte*) bitmap_screen#27 ) - (byte*) bitmap_gfx#26 ← phi( @50/(byte*) bitmap_gfx#28 ) +@60: scope:[] from @51 + (byte*) bitmap_screen#25 ← phi( @51/(byte*) bitmap_screen#27 ) + (byte*) bitmap_gfx#26 ← phi( @51/(byte*) bitmap_gfx#28 ) (byte*) PRINT_SCREEN#0 ← ((byte*)) (number) $400 (byte*) BITMAP_SCREEN#0 ← ((byte*)) (number) $5c00 (byte*) BITMAP_GRAPHICS#0 ← ((byte*)) (number) $6000 (struct Segment[$16]) letter_c#0 ← { fill( $16, 0) } - to:@62 -main: scope:[main] from @63 - (signed byte*) COS#33 ← phi( @63/(signed byte*) COS#34 ) - (byte*) bitmap_screen#18 ← phi( @63/(byte*) bitmap_screen#15 ) - (byte*) bitmap_gfx#19 ← phi( @63/(byte*) bitmap_gfx#15 ) + to:@63 +main: scope:[main] from @64 + (signed byte*) COS#33 ← phi( @64/(signed byte*) COS#34 ) + (byte*) bitmap_screen#18 ← phi( @64/(byte*) bitmap_screen#15 ) + (byte*) bitmap_gfx#19 ← phi( @64/(byte*) bitmap_gfx#15 ) (number~) main::$16 ← (number) 0 * (const byte) SIZEOF_STRUCT_SEGMENT (byte*) main::$38 ← (byte*)(struct Segment[$16]) letter_c#0 + (const byte) OFFSET_STRUCT_SEGMENT_TYPE *((byte*) main::$38 + (number~) main::$16) ← (const byte) MOVE_TO @@ -2085,15 +2086,15 @@ bitmap_plot_spline_8seg::@3: scope:[bitmap_plot_spline_8seg] from bitmap_plot_s bitmap_plot_spline_8seg::@return: scope:[bitmap_plot_spline_8seg] from bitmap_plot_spline_8seg::@3 return to:@return -@62: scope:[] from @59 - (byte*) bitmap_screen#21 ← phi( @59/(byte*) bitmap_screen#25 ) - (byte*) bitmap_gfx#22 ← phi( @59/(byte*) bitmap_gfx#26 ) +@63: scope:[] from @60 + (byte*) bitmap_screen#21 ← phi( @60/(byte*) bitmap_screen#25 ) + (byte*) bitmap_gfx#22 ← phi( @60/(byte*) bitmap_gfx#26 ) (signed byte[$140]) SIN#0 ← kickasm {{ .for(var i=0;i<$140;i++) .byte >round($7fff*sin(i*2*PI/256)) }} (signed byte*~) $1 ← (signed byte[$140]) SIN#0 + (number) $40 (signed byte*) COS#0 ← (signed byte*~) $1 - to:@63 + to:@64 rotate: scope:[rotate] from show_letter::@1 show_letter::@11 (signed word) rotate::vector_y#4 ← phi( show_letter::@1/(signed word) rotate::vector_y#0 show_letter::@11/(signed word) rotate::vector_y#1 ) (signed word) rotate::vector_x#2 ← phi( show_letter::@1/(signed word) rotate::vector_x#0 show_letter::@11/(signed word) rotate::vector_x#1 ) @@ -2181,29 +2182,29 @@ rotate::@return: scope:[rotate] from rotate::@5 (struct SplineVector16) rotate::return#1 ← struct-unwound {(signed word) rotate::return_x#3, (signed word) rotate::return_y#3} return to:@return -@63: scope:[] from @62 - (signed byte*) COS#34 ← phi( @62/(signed byte*) COS#0 ) - (byte*) bitmap_screen#15 ← phi( @62/(byte*) bitmap_screen#21 ) - (byte*) bitmap_gfx#15 ← phi( @62/(byte*) bitmap_gfx#22 ) - call main - to:@64 @64: scope:[] from @63 - (byte*) bitmap_screen#10 ← phi( @63/(byte*) bitmap_screen#4 ) - (byte*) bitmap_gfx#10 ← phi( @63/(byte*) bitmap_gfx#4 ) + (signed byte*) COS#34 ← phi( @63/(signed byte*) COS#0 ) + (byte*) bitmap_screen#15 ← phi( @63/(byte*) bitmap_screen#21 ) + (byte*) bitmap_gfx#15 ← phi( @63/(byte*) bitmap_gfx#22 ) + call main + to:@65 +@65: scope:[] from @64 + (byte*) bitmap_screen#10 ← phi( @64/(byte*) bitmap_screen#4 ) + (byte*) bitmap_gfx#10 ← phi( @64/(byte*) bitmap_gfx#4 ) (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 to:@end -@end: scope:[] from @64 +@end: scope:[] from @65 SYMBOL TABLE SSA (signed byte*~) $1 (label) @1 (label) @13 -(label) @50 -(label) @59 -(label) @62 +(label) @51 +(label) @60 (label) @63 (label) @64 +(label) @65 (label) @7 (label) @begin (label) @end @@ -6118,11 +6119,11 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 Adding NOP phi() at start of @7 Adding NOP phi() at start of @13 -Adding NOP phi() at start of @50 -Adding NOP phi() at start of @59 -Adding NOP phi() at start of @62 +Adding NOP phi() at start of @51 +Adding NOP phi() at start of @60 Adding NOP phi() at start of @63 Adding NOP phi() at start of @64 +Adding NOP phi() at start of @65 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@21 Adding NOP phi() at start of main::@22 @@ -6272,10 +6273,10 @@ Coalesced down to 49 phi equivalence classes Culled Empty Block (label) @1 Culled Empty Block (label) @7 Culled Empty Block (label) @13 -Culled Empty Block (label) @50 -Culled Empty Block (label) @59 -Culled Empty Block (label) @62 -Culled Empty Block (label) @64 +Culled Empty Block (label) @51 +Culled Empty Block (label) @60 +Culled Empty Block (label) @63 +Culled Empty Block (label) @65 Culled Empty Block (label) main::@23 Culled Empty Block (label) main::vicSelectGfxBank1_toDd001_@return Culled Empty Block (label) main::@19 @@ -6313,7 +6314,7 @@ Culled Empty Block (label) mulf_init::@7 Culled Empty Block (label) mulf_init::@11 Culled Empty Block (label) mulf_init::@9 Culled Empty Block (label) mulf_init::@10 -Renumbering block @63 to @1 +Renumbering block @64 to @1 Renumbering block memset::@2 to memset::@1 Renumbering block memset::@4 to memset::@2 Renumbering block bitmap_init::@5 to bitmap_init::@3 diff --git a/src/test/ref/constants.log b/src/test/ref/constants.log index c3d9255eb..cdb47afe1 100644 --- a/src/test/ref/constants.log +++ b/src/test/ref/constants.log @@ -46,11 +46,12 @@ Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 -Culled Empty Block (label) @36 +Culled Empty Block (label) @35 Culled Empty Block (label) @37 -Culled Empty Block (label) assert_byte::@4 Culled Empty Block (label) @38 +Culled Empty Block (label) assert_byte::@4 Culled Empty Block (label) @39 +Culled Empty Block (label) @40 Culled Empty Block (label) assert_sbyte::@4 CONTROL FLOW GRAPH SSA @@ -96,7 +97,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@35 + to:@36 print_str: scope:[print_str] from assert_byte assert_byte::@1 assert_byte::@3 assert_byte::@5 assert_sbyte assert_sbyte::@1 assert_sbyte::@3 assert_sbyte::@5 (byte*) print_char_cursor#80 ← phi( assert_byte/(byte*) print_char_cursor#70 assert_byte::@1/(byte*) print_char_cursor#71 assert_byte::@3/(byte*) print_char_cursor#72 assert_byte::@5/(byte*) print_char_cursor#15 assert_sbyte/(byte*) print_char_cursor#75 assert_sbyte::@1/(byte*) print_char_cursor#76 assert_sbyte::@3/(byte*) print_char_cursor#77 assert_sbyte::@5/(byte*) print_char_cursor#27 ) (byte*) print_str::str#11 ← phi( assert_byte/(byte*) print_str::str#1 assert_byte::@1/(byte*) print_str::str#3 assert_byte::@3/(byte*) print_str::str#4 assert_byte::@5/(byte*) print_str::str#2 assert_sbyte/(byte*) print_str::str#5 assert_sbyte::@1/(byte*) print_str::str#7 assert_sbyte::@3/(byte*) print_str::str#8 assert_sbyte::@5/(byte*) print_str::str#6 ) @@ -162,18 +163,18 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#38 return to:@return -@35: scope:[] from @12 +@36: scope:[] from @12 (byte*) print_screen#5 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#81 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#58 ← phi( @12/(byte*) print_line_cursor#0 ) (byte*) BGCOL#0 ← ((byte*)) (number) $d021 (byte) GREEN#0 ← (number) 5 (byte) RED#0 ← (number) 2 - to:@40 -main: scope:[main] from @40 - (byte*) print_char_cursor#68 ← phi( @40/(byte*) print_char_cursor#79 ) - (byte*) print_line_cursor#48 ← phi( @40/(byte*) print_line_cursor#53 ) - (byte*) print_screen#3 ← phi( @40/(byte*) print_screen#4 ) + to:@41 +main: scope:[main] from @41 + (byte*) print_char_cursor#68 ← phi( @41/(byte*) print_char_cursor#79 ) + (byte*) print_line_cursor#48 ← phi( @41/(byte*) print_line_cursor#53 ) + (byte*) print_screen#3 ← phi( @41/(byte*) print_screen#4 ) call print_cls to:main::@1 main::@1: scope:[main] from main @@ -461,25 +462,25 @@ assert_sbyte::@return: scope:[assert_sbyte] from assert_sbyte::@9 (byte*) print_line_cursor#22 ← (byte*) print_line_cursor#45 return to:@return -@40: scope:[] from @35 - (byte*) print_screen#4 ← phi( @35/(byte*) print_screen#5 ) - (byte*) print_char_cursor#79 ← phi( @35/(byte*) print_char_cursor#81 ) - (byte*) print_line_cursor#53 ← phi( @35/(byte*) print_line_cursor#58 ) +@41: scope:[] from @36 + (byte*) print_screen#4 ← phi( @36/(byte*) print_screen#5 ) + (byte*) print_char_cursor#79 ← phi( @36/(byte*) print_char_cursor#81 ) + (byte*) print_line_cursor#53 ← phi( @36/(byte*) print_line_cursor#58 ) call main - to:@41 -@41: scope:[] from @40 - (byte*) print_char_cursor#65 ← phi( @40/(byte*) print_char_cursor#10 ) - (byte*) print_line_cursor#46 ← phi( @40/(byte*) print_line_cursor#8 ) + to:@42 +@42: scope:[] from @41 + (byte*) print_char_cursor#65 ← phi( @41/(byte*) print_char_cursor#10 ) + (byte*) print_line_cursor#46 ← phi( @41/(byte*) print_line_cursor#8 ) (byte*) print_line_cursor#23 ← (byte*) print_line_cursor#46 (byte*) print_char_cursor#33 ← (byte*) print_char_cursor#65 to:@end -@end: scope:[] from @41 +@end: scope:[] from @42 SYMBOL TABLE SSA (label) @12 -(label) @35 -(label) @40 +(label) @36 (label) @41 +(label) @42 (label) @begin (label) @end (byte*) BGCOL @@ -1229,9 +1230,9 @@ Added new block during phi lifting memset::@6(between memset::@4 and memset::@4) Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @40 +Adding NOP phi() at start of @36 Adding NOP phi() at start of @41 +Adding NOP phi() at start of @42 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@2 @@ -1291,8 +1292,8 @@ Coalesced (already) [91] print_char_cursor#83 ← print_char_cursor#2 Coalesced [106] memset::dst#3 ← memset::dst#1 Coalesced down to 10 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @35 -Culled Empty Block (label) @41 +Culled Empty Block (label) @36 +Culled Empty Block (label) @42 Culled Empty Block (label) main::@3 Culled Empty Block (label) test_sbytes::@5 Culled Empty Block (label) assert_sbyte::@8 @@ -1308,7 +1309,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @40 to @1 +Renumbering block @41 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block assert_byte::@5 to assert_byte::@4 Renumbering block assert_byte::@6 to assert_byte::@5 diff --git a/src/test/ref/cordic-atan2-16-ref.log b/src/test/ref/cordic-atan2-16-ref.log index c47a91898..35437e73b 100644 --- a/src/test/ref/cordic-atan2-16-ref.log +++ b/src/test/ref/cordic-atan2-16-ref.log @@ -56,18 +56,19 @@ Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 -Culled Empty Block (label) @36 +Culled Empty Block (label) @35 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 Culled Empty Block (label) @40 Culled Empty Block (label) @41 +Culled Empty Block (label) @42 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@9 Culled Empty Block (label) main::@10 -Culled Empty Block (label) @43 +Culled Empty Block (label) @44 Culled Empty Block (label) diff::@4 Culled Empty Block (label) diff::@5 Culled Empty Block (label) diff::@6 @@ -369,7 +370,7 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@35 + to:@36 print_word: scope:[print_word] from main::@4 (byte*) print_char_cursor#23 ← phi( main::@4/(byte*) print_char_cursor#25 ) (word) print_word::w#1 ← phi( main::@4/(word) print_word::w#0 ) @@ -394,10 +395,10 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#3 ← (byte*) print_char_cursor#14 return to:@return -@35: scope:[] from @19 +@36: scope:[] from @19 (byte*) print_char_cursor#31 ← phi( @19/(byte*) print_char_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@42 + to:@43 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#24 ← phi( print_word/(byte*) print_char_cursor#23 print_word::@1/(byte*) print_char_cursor#1 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -433,17 +434,17 @@ print_char::@return: scope:[print_char] from print_char (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#19 return to:@return -@42: scope:[] from @35 - (byte*) print_char_cursor#30 ← phi( @35/(byte*) print_char_cursor#31 ) +@43: scope:[] from @36 + (byte*) print_char_cursor#30 ← phi( @36/(byte*) print_char_cursor#31 ) (byte*) CHARSET#0 ← ((byte*)) (number) $2000 (byte*) SCREEN#0 ← ((byte*)) (number) $2800 (byte[$3e8]) SCREEN_REF#0 ← kickasm {{ .for(var y=-12;y<=12;y++) .for(var x=-19;x<=20;x++) .byte round(256*atan2(y, x)/PI/2) }} - to:@44 -main: scope:[main] from @44 - (byte*) print_char_cursor#40 ← phi( @44/(byte*) print_char_cursor#27 ) + to:@45 +main: scope:[main] from @45 + (byte*) print_char_cursor#40 ← phi( @45/(byte*) print_char_cursor#27 ) (byte*) init_font_hex::charset#1 ← (byte*) CHARSET#0 call init_font_hex to:main::@12 @@ -612,25 +613,25 @@ diff::@return: scope:[diff] from diff::@3 (byte) diff::return#2 ← (byte) diff::return#4 return to:@return -@44: scope:[] from @42 - (byte*) print_char_cursor#27 ← phi( @42/(byte*) print_char_cursor#30 ) +@45: scope:[] from @43 + (byte*) print_char_cursor#27 ← phi( @43/(byte*) print_char_cursor#30 ) call main - to:@45 -@45: scope:[] from @44 - (byte*) print_char_cursor#22 ← phi( @44/(byte*) print_char_cursor#10 ) + to:@46 +@46: scope:[] from @45 + (byte*) print_char_cursor#22 ← phi( @45/(byte*) print_char_cursor#10 ) (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#22 to:@end -@end: scope:[] from @45 +@end: scope:[] from @46 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @1 (label) @19 (label) @3 -(label) @35 -(label) @42 -(label) @44 +(label) @36 +(label) @43 (label) @45 +(label) @46 (label) @begin (label) @end (byte*) CHARSET @@ -1725,10 +1726,10 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 Adding NOP phi() at start of @3 Adding NOP phi() at start of @19 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @42 -Adding NOP phi() at start of @44 +Adding NOP phi() at start of @36 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @45 +Adding NOP phi() at start of @46 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@12 @@ -1811,9 +1812,9 @@ Coalesced down to 26 phi equivalence classes Culled Empty Block (label) @1 Culled Empty Block (label) @3 Culled Empty Block (label) @19 -Culled Empty Block (label) @35 -Culled Empty Block (label) @42 -Culled Empty Block (label) @45 +Culled Empty Block (label) @36 +Culled Empty Block (label) @43 +Culled Empty Block (label) @46 Culled Empty Block (label) main::@12 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@15 @@ -1831,7 +1832,7 @@ Culled Empty Block (label) atan2_16::@37 Culled Empty Block (label) init_font_hex::@7 Culled Empty Block (label) init_font_hex::@8 Culled Empty Block (label) init_font_hex::@9 -Renumbering block @44 to @1 +Renumbering block @45 to @1 Renumbering block atan2_16::@13 to atan2_16::@9 Renumbering block atan2_16::@15 to atan2_16::@10 Renumbering block atan2_16::@16 to atan2_16::@11 diff --git a/src/test/ref/euclid-3.asm b/src/test/ref/euclid-3.asm new file mode 100644 index 000000000..cf60e97a3 --- /dev/null +++ b/src/test/ref/euclid-3.asm @@ -0,0 +1,196 @@ +/* + * Find least common denominator using subtraction-based Euclidian algorithm + * See https://en.wikipedia.org/wiki/Euclidean_algorithm + * Based on facebook post from + */ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + .label print_line_cursor = 4 + .label print_char_cursor = 6 +main: { + jsr print_cls + lda #<$400 + sta print_line_cursor + lda #>$400 + sta print_line_cursor+1 + lda #2 + sta print_euclid.b + lda #<$400 + sta print_char_cursor + lda #>$400 + sta print_char_cursor+1 + lda #$80 + sta print_euclid.a + jsr print_euclid + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + lda #$45 + sta print_euclid.b + lda #$a9 + sta print_euclid.a + jsr print_euclid + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + lda #$37 + sta print_euclid.b + lda #$9b + sta print_euclid.a + jsr print_euclid + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + lda #3 + sta print_euclid.b + lda #$c7 + sta print_euclid.a + jsr print_euclid + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + lda #$1a + sta print_euclid.b + lda #$5b + sta print_euclid.a + jsr print_euclid + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + lda #$bb + sta print_euclid.b + lda #$77 + sta print_euclid.a + jsr print_euclid + rts +} +// print_euclid(byte zeropage(2) a, byte zeropage(3) b) +print_euclid: { + .label b = 3 + .label a = 2 + ldx a + jsr print_byte + lda #' ' + jsr print_char + ldx b + jsr print_byte + lda #' ' + jsr print_char + ldx b + jsr euclid + lda euclid.a + tax + jsr print_byte + jsr print_ln + rts +} +// Print a newline +print_ln: { + b1: + lda #$28 + clc + adc print_line_cursor + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + lda print_line_cursor+1 + cmp print_char_cursor+1 + bcc b1 + bne !+ + lda print_line_cursor + cmp print_char_cursor + bcc b1 + !: + rts +} +// Print a byte as HEX +// print_byte(byte register(X) b) +print_byte: { + txa + lsr + lsr + lsr + lsr + tay + lda print_hextab,y + jsr print_char + lda #$f + axs #0 + lda print_hextab,x + jsr print_char + rts +} +// Print a single char +// print_char(byte register(A) ch) +print_char: { + ldy #0 + sta (print_char_cursor),y + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + rts +} +// euclid(byte zeropage(2) a, byte register(X) b) +euclid: { + .label a = 2 + b1: + cpx a + bne b2 + rts + b2: + cpx a + bcc b3 + txa + sec + sbc a + tax + jmp b1 + b3: + txa + eor #$ff + sec + adc a + sta a + jmp b1 +} +// Clear the screen. Also resets current line/char cursor. +print_cls: { + jsr memset + rts +} +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = $400 + .label end = str+num + .label dst = 8 + lda #str + sta dst+1 + b1: + lda #c + ldy #0 + sta (dst),y + inc dst + bne !+ + inc dst+1 + !: + lda dst+1 + cmp #>end + bne b1 + lda dst + cmp #> (byte) 4 + [44] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0) + [45] call print_char + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + [46] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f + [47] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2) + [48] call print_char + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + [49] return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 print_euclid::@1 print_euclid::@3 + [50] (byte*) print_char_cursor#31 ← phi( print_byte/(byte*) print_char_cursor#51 print_byte::@1/(byte*) print_char_cursor#32 print_euclid::@1/(byte*) print_char_cursor#32 print_euclid::@3/(byte*) print_char_cursor#32 ) + [50] (byte) print_char::ch#4 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 print_euclid::@1/(byte) ' ' print_euclid::@3/(byte) ' ' ) + [51] *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 + [52] (byte*) print_char_cursor#32 ← ++ (byte*) print_char_cursor#31 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + [53] return + to:@return +euclid: scope:[euclid] from print_euclid::@4 + [54] phi() + to:euclid::@1 +euclid::@1: scope:[euclid] from euclid euclid::@3 euclid::@4 + [55] (byte) euclid::b#2 ← phi( euclid/(byte) euclid::b#0 euclid::@3/(byte) euclid::b#2 euclid::@4/(byte) euclid::b#1 ) + [55] (byte) euclid::a#2 ← phi( euclid/(byte) euclid::a#0 euclid::@3/(byte) euclid::a#1 euclid::@4/(byte) euclid::a#2 ) + [56] if((byte) euclid::a#2!=(byte) euclid::b#2) goto euclid::@2 + to:euclid::@return +euclid::@return: scope:[euclid] from euclid::@1 + [57] return + to:@return +euclid::@2: scope:[euclid] from euclid::@1 + [58] if((byte) euclid::a#2>(byte) euclid::b#2) goto euclid::@3 + to:euclid::@4 +euclid::@4: scope:[euclid] from euclid::@2 + [59] (byte) euclid::b#1 ← (byte) euclid::b#2 - (byte) euclid::a#2 + to:euclid::@1 +euclid::@3: scope:[euclid] from euclid::@2 + [60] (byte) euclid::a#1 ← (byte) euclid::a#2 - (byte) euclid::b#2 + to:euclid::@1 +print_cls: scope:[print_cls] from main + [61] phi() + [62] call memset + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls + [63] return + to:@return +memset: scope:[memset] from print_cls + [64] phi() + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@1 + [65] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@1/(byte*) memset::dst#1 ) + [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 + [67] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + [68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 + to:memset::@return +memset::@return: scope:[memset] from memset::@1 + [69] return + to:@return diff --git a/src/test/ref/euclid-3.log b/src/test/ref/euclid-3.log new file mode 100644 index 000000000..ff77e0788 --- /dev/null +++ b/src/test/ref/euclid-3.log @@ -0,0 +1,2842 @@ +Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items + (byte~) bsearch16u::$6 +Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot + (number) 1 +Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1 +Fixing pointer array-indexing *((word*) utoa::digit_values + (byte) utoa::digit) +Fixing pointer array-indexing *((dword*) ultoa::digit_values + (byte) ultoa::digit) +Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Identified constant variable (byte*) HEAP_TOP +Culled Empty Block (label) @1 +Culled Empty Block (label) @2 +Culled Empty Block (label) memset::@5 +Culled Empty Block (label) memset::@3 +Culled Empty Block (label) @3 +Culled Empty Block (label) @4 +Culled Empty Block (label) @5 +Culled Empty Block (label) @6 +Culled Empty Block (label) @7 +Culled Empty Block (label) @8 +Culled Empty Block (label) @9 +Culled Empty Block (label) @10 +Culled Empty Block (label) @11 +Culled Empty Block (label) @13 +Culled Empty Block (label) @14 +Culled Empty Block (label) @15 +Culled Empty Block (label) @16 +Culled Empty Block (label) @17 +Culled Empty Block (label) @18 +Culled Empty Block (label) @19 +Culled Empty Block (label) @20 +Culled Empty Block (label) @21 +Culled Empty Block (label) @22 +Culled Empty Block (label) @23 +Culled Empty Block (label) @24 +Culled Empty Block (label) @25 +Culled Empty Block (label) @26 +Culled Empty Block (label) @27 +Culled Empty Block (label) @28 +Culled Empty Block (label) @30 +Culled Empty Block (label) @31 +Culled Empty Block (label) @32 +Culled Empty Block (label) @33 +Culled Empty Block (label) @34 +Culled Empty Block (label) @35 +Culled Empty Block (label) @36 +Culled Empty Block (label) @37 +Culled Empty Block (label) @38 +Culled Empty Block (label) euclid::@6 +Culled Empty Block (label) euclid::@7 +Culled Empty Block (label) euclid::@5 +Culled Empty Block (label) euclid::@9 +Culled Empty Block (label) euclid::@10 +Culled Empty Block (label) euclid::@11 + +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + to:@12 +memset: scope:[memset] from print_cls + (byte) memset::c#3 ← phi( print_cls/(byte) memset::c#0 ) + (void*) memset::str#3 ← phi( print_cls/(void*) memset::str#0 ) + (word) memset::num#1 ← phi( print_cls/(word) memset::num#0 ) + (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 + (bool~) memset::$1 ← ! (bool~) memset::$0 + if((bool~) memset::$1) goto memset::@1 + to:memset::@2 +memset::@1: scope:[memset] from memset memset::@4 + (void*) memset::str#1 ← phi( memset/(void*) memset::str#3 memset::@4/(void*) memset::str#4 ) + (void*) memset::return#0 ← (void*) memset::str#1 + to:memset::@return +memset::@2: scope:[memset] from memset + (byte) memset::c#2 ← phi( memset/(byte) memset::c#3 ) + (word) memset::num#2 ← phi( memset/(word) memset::num#1 ) + (void*) memset::str#2 ← phi( memset/(void*) memset::str#3 ) + (byte*~) memset::$2 ← ((byte*)) (void*) memset::str#2 + (byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#2 + (byte*) memset::end#0 ← (byte*~) memset::$3 + (byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2 + to:memset::@4 +memset::@4: scope:[memset] from memset::@2 memset::@4 + (void*) memset::str#4 ← phi( memset::@2/(void*) memset::str#2 memset::@4/(void*) memset::str#4 ) + (byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@4/(byte*) memset::end#1 ) + (byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@4/(byte*) memset::dst#1 ) + (byte) memset::c#1 ← phi( memset::@2/(byte) memset::c#2 memset::@4/(byte) memset::c#1 ) + *((byte*) memset::dst#2) ← (byte) memset::c#1 + (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + (bool~) memset::$4 ← (byte*) memset::dst#1 != (byte*) memset::end#1 + if((bool~) memset::$4) goto memset::@4 + to:memset::@1 +memset::@return: scope:[memset] from memset::@1 + (void*) memset::return#3 ← phi( memset::@1/(void*) memset::return#0 ) + (void*) memset::return#1 ← (void*) memset::return#3 + return + to:@return +@12: scope:[] from @begin + (byte*) print_screen#0 ← ((byte*)) (number) $400 + (byte*) print_line_cursor#0 ← (byte*) print_screen#0 + (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 + to:@29 +print_ln: scope:[print_ln] from print_euclid::@6 + (byte*) print_char_cursor#50 ← phi( print_euclid::@6/(byte*) print_char_cursor#22 ) + (byte*) print_line_cursor#31 ← phi( print_euclid::@6/(byte*) print_line_cursor#33 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) print_char_cursor#26 ← phi( print_ln/(byte*) print_char_cursor#50 print_ln::@1/(byte*) print_char_cursor#26 ) + (byte*) print_line_cursor#16 ← phi( print_ln/(byte*) print_line_cursor#31 print_ln::@1/(byte*) print_line_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) print_line_cursor#16 + (number) $28 + (byte*) print_line_cursor#1 ← (byte*~) print_ln::$0 + (bool~) print_ln::$1 ← (byte*) print_line_cursor#1 < (byte*) print_char_cursor#26 + if((bool~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) print_line_cursor#17 ← phi( print_ln::@1/(byte*) print_line_cursor#1 ) + (byte*) print_char_cursor#1 ← (byte*) print_line_cursor#17 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) print_char_cursor#27 ← phi( print_ln::@2/(byte*) print_char_cursor#1 ) + (byte*) print_line_cursor#18 ← phi( print_ln::@2/(byte*) print_line_cursor#17 ) + (byte*) print_line_cursor#2 ← (byte*) print_line_cursor#18 + (byte*) print_char_cursor#2 ← (byte*) print_char_cursor#27 + return + to:@return +@29: scope:[] from @12 + (byte*) print_screen#5 ← phi( @12/(byte*) print_screen#0 ) + (byte*) print_char_cursor#56 ← phi( @12/(byte*) print_char_cursor#0 ) + (byte*) print_line_cursor#36 ← phi( @12/(byte*) print_line_cursor#0 ) + (byte[]) print_hextab#0 ← (const string) $0 + to:@39 +print_byte: scope:[print_byte] from print_euclid print_euclid::@2 print_euclid::@5 + (byte*) print_char_cursor#51 ← phi( print_euclid/(byte*) print_char_cursor#53 print_euclid::@2/(byte*) print_char_cursor#19 print_euclid::@5/(byte*) print_char_cursor#54 ) + (byte) print_byte::b#3 ← phi( print_euclid/(byte) print_byte::b#0 print_euclid::@2/(byte) print_byte::b#1 print_euclid::@5/(byte) print_byte::b#2 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (number) 4 + (byte) print_char::ch#0 ← *((byte[]) print_hextab#0 + (byte~) print_byte::$0) + call print_char + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte) print_byte::b#4 ← phi( print_byte/(byte) print_byte::b#3 ) + (byte*) print_char_cursor#28 ← phi( print_byte/(byte*) print_char_cursor#7 ) + (byte*) print_char_cursor#3 ← (byte*) print_char_cursor#28 + (number~) print_byte::$2 ← (byte) print_byte::b#4 & (number) $f + (byte) print_char::ch#1 ← *((byte[]) print_hextab#0 + (number~) print_byte::$2) + call print_char + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + (byte*) print_char_cursor#29 ← phi( print_byte::@1/(byte*) print_char_cursor#7 ) + (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#29 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + (byte*) print_char_cursor#30 ← phi( print_byte::@2/(byte*) print_char_cursor#4 ) + (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#30 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 print_euclid::@1 print_euclid::@3 + (byte*) print_char_cursor#31 ← phi( print_byte/(byte*) print_char_cursor#51 print_byte::@1/(byte*) print_char_cursor#3 print_euclid::@1/(byte*) print_char_cursor#18 print_euclid::@3/(byte*) print_char_cursor#20 ) + (byte) print_char::ch#4 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 print_euclid::@1/(byte) print_char::ch#2 print_euclid::@3/(byte) print_char::ch#3 ) + *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 + (byte*) print_char_cursor#6 ← ++ (byte*) print_char_cursor#31 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + (byte*) print_char_cursor#32 ← phi( print_char/(byte*) print_char_cursor#6 ) + (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#32 + return + to:@return +print_cls: scope:[print_cls] from main + (byte*) print_screen#1 ← phi( main/(byte*) print_screen#3 ) + (void*) memset::str#0 ← (void*)(byte*) print_screen#1 + (byte) memset::c#0 ← (byte) ' ' + (word) memset::num#0 ← (number) $3e8 + call memset + (void*) memset::return#2 ← (void*) memset::return#1 + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls + (byte*) print_screen#2 ← phi( print_cls/(byte*) print_screen#1 ) + (byte*) print_line_cursor#3 ← (byte*) print_screen#2 + (byte*) print_char_cursor#8 ← (byte*) print_line_cursor#3 + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@1 + (byte*) print_char_cursor#33 ← phi( print_cls::@1/(byte*) print_char_cursor#8 ) + (byte*) print_line_cursor#19 ← phi( print_cls::@1/(byte*) print_line_cursor#3 ) + (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#19 + (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#33 + return + to:@return +main: scope:[main] from @39 + (byte*) print_char_cursor#52 ← phi( @39/(byte*) print_char_cursor#55 ) + (byte*) print_line_cursor#32 ← phi( @39/(byte*) print_line_cursor#34 ) + (byte*) print_screen#3 ← phi( @39/(byte*) print_screen#4 ) + call print_cls + to:main::@1 +main::@1: scope:[main] from main + (byte*) print_char_cursor#34 ← phi( main/(byte*) print_char_cursor#9 ) + (byte*) print_line_cursor#20 ← phi( main/(byte*) print_line_cursor#4 ) + (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#20 + (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#34 + (byte) print_euclid::a#0 ← (number) $80 + (byte) print_euclid::b#0 ← (number) 2 + call print_euclid + to:main::@2 +main::@2: scope:[main] from main::@1 + (byte*) print_line_cursor#21 ← phi( main::@1/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#35 ← phi( main::@1/(byte*) print_char_cursor#24 ) + (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#35 + (byte*) print_line_cursor#6 ← (byte*) print_line_cursor#21 + (byte) print_euclid::a#1 ← (number) $a9 + (byte) print_euclid::b#1 ← (number) $45 + call print_euclid + to:main::@3 +main::@3: scope:[main] from main::@2 + (byte*) print_line_cursor#22 ← phi( main::@2/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#36 ← phi( main::@2/(byte*) print_char_cursor#24 ) + (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#36 + (byte*) print_line_cursor#7 ← (byte*) print_line_cursor#22 + (byte) print_euclid::a#2 ← (number) $9b + (byte) print_euclid::b#2 ← (number) $37 + call print_euclid + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte*) print_line_cursor#23 ← phi( main::@3/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#37 ← phi( main::@3/(byte*) print_char_cursor#24 ) + (byte*) print_char_cursor#13 ← (byte*) print_char_cursor#37 + (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#23 + (byte) print_euclid::a#3 ← (number) $c7 + (byte) print_euclid::b#3 ← (number) 3 + call print_euclid + to:main::@5 +main::@5: scope:[main] from main::@4 + (byte*) print_line_cursor#24 ← phi( main::@4/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#38 ← phi( main::@4/(byte*) print_char_cursor#24 ) + (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#38 + (byte*) print_line_cursor#9 ← (byte*) print_line_cursor#24 + (byte) print_euclid::a#4 ← (number) $5b + (byte) print_euclid::b#4 ← (number) $1a + call print_euclid + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) print_line_cursor#25 ← phi( main::@5/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#39 ← phi( main::@5/(byte*) print_char_cursor#24 ) + (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#39 + (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#25 + (byte) print_euclid::a#5 ← (number) $77 + (byte) print_euclid::b#5 ← (number) $bb + call print_euclid + to:main::@7 +main::@7: scope:[main] from main::@6 + (byte*) print_line_cursor#26 ← phi( main::@6/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#40 ← phi( main::@6/(byte*) print_char_cursor#24 ) + (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#40 + (byte*) print_line_cursor#11 ← (byte*) print_line_cursor#26 + to:main::@return +main::@return: scope:[main] from main::@7 + (byte*) print_char_cursor#41 ← phi( main::@7/(byte*) print_char_cursor#16 ) + (byte*) print_line_cursor#27 ← phi( main::@7/(byte*) print_line_cursor#11 ) + (byte*) print_line_cursor#12 ← (byte*) print_line_cursor#27 + (byte*) print_char_cursor#17 ← (byte*) print_char_cursor#41 + return + to:@return +print_euclid: scope:[print_euclid] from main::@1 main::@2 main::@3 main::@4 main::@5 main::@6 + (byte*) print_line_cursor#41 ← phi( main::@1/(byte*) print_line_cursor#5 main::@2/(byte*) print_line_cursor#6 main::@3/(byte*) print_line_cursor#7 main::@4/(byte*) print_line_cursor#8 main::@5/(byte*) print_line_cursor#9 main::@6/(byte*) print_line_cursor#10 ) + (byte) print_euclid::b#10 ← phi( main::@1/(byte) print_euclid::b#0 main::@2/(byte) print_euclid::b#1 main::@3/(byte) print_euclid::b#2 main::@4/(byte) print_euclid::b#3 main::@5/(byte) print_euclid::b#4 main::@6/(byte) print_euclid::b#5 ) + (byte*) print_char_cursor#53 ← phi( main::@1/(byte*) print_char_cursor#10 main::@2/(byte*) print_char_cursor#11 main::@3/(byte*) print_char_cursor#12 main::@4/(byte*) print_char_cursor#13 main::@5/(byte*) print_char_cursor#14 main::@6/(byte*) print_char_cursor#15 ) + (byte) print_euclid::a#6 ← phi( main::@1/(byte) print_euclid::a#0 main::@2/(byte) print_euclid::a#1 main::@3/(byte) print_euclid::a#2 main::@4/(byte) print_euclid::a#3 main::@5/(byte) print_euclid::a#4 main::@6/(byte) print_euclid::a#5 ) + (byte) print_byte::b#0 ← (byte) print_euclid::a#6 + call print_byte + to:print_euclid::@1 +print_euclid::@1: scope:[print_euclid] from print_euclid + (byte*) print_line_cursor#40 ← phi( print_euclid/(byte*) print_line_cursor#41 ) + (byte) print_euclid::a#10 ← phi( print_euclid/(byte) print_euclid::a#6 ) + (byte) print_euclid::b#8 ← phi( print_euclid/(byte) print_euclid::b#10 ) + (byte*) print_char_cursor#42 ← phi( print_euclid/(byte*) print_char_cursor#5 ) + (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#42 + (byte) print_char::ch#2 ← (byte) ' ' + call print_char + to:print_euclid::@2 +print_euclid::@2: scope:[print_euclid] from print_euclid::@1 + (byte*) print_line_cursor#39 ← phi( print_euclid::@1/(byte*) print_line_cursor#40 ) + (byte) print_euclid::a#9 ← phi( print_euclid::@1/(byte) print_euclid::a#10 ) + (byte) print_euclid::b#6 ← phi( print_euclid::@1/(byte) print_euclid::b#8 ) + (byte*) print_char_cursor#43 ← phi( print_euclid::@1/(byte*) print_char_cursor#7 ) + (byte*) print_char_cursor#19 ← (byte*) print_char_cursor#43 + (byte) print_byte::b#1 ← (byte) print_euclid::b#6 + call print_byte + to:print_euclid::@3 +print_euclid::@3: scope:[print_euclid] from print_euclid::@2 + (byte*) print_line_cursor#38 ← phi( print_euclid::@2/(byte*) print_line_cursor#39 ) + (byte) print_euclid::b#9 ← phi( print_euclid::@2/(byte) print_euclid::b#6 ) + (byte) print_euclid::a#8 ← phi( print_euclid::@2/(byte) print_euclid::a#9 ) + (byte*) print_char_cursor#44 ← phi( print_euclid::@2/(byte*) print_char_cursor#5 ) + (byte*) print_char_cursor#20 ← (byte*) print_char_cursor#44 + (byte) print_char::ch#3 ← (byte) ' ' + call print_char + to:print_euclid::@4 +print_euclid::@4: scope:[print_euclid] from print_euclid::@3 + (byte*) print_line_cursor#37 ← phi( print_euclid::@3/(byte*) print_line_cursor#38 ) + (byte) print_euclid::b#7 ← phi( print_euclid::@3/(byte) print_euclid::b#9 ) + (byte) print_euclid::a#7 ← phi( print_euclid::@3/(byte) print_euclid::a#8 ) + (byte*) print_char_cursor#45 ← phi( print_euclid::@3/(byte*) print_char_cursor#7 ) + (byte*) print_char_cursor#21 ← (byte*) print_char_cursor#45 + (byte) euclid::a#0 ← (byte) print_euclid::a#7 + (byte) euclid::b#0 ← (byte) print_euclid::b#7 + call euclid + (byte) euclid::return#0 ← (byte) euclid::return#2 + to:print_euclid::@5 +print_euclid::@5: scope:[print_euclid] from print_euclid::@4 + (byte*) print_line_cursor#35 ← phi( print_euclid::@4/(byte*) print_line_cursor#37 ) + (byte*) print_char_cursor#54 ← phi( print_euclid::@4/(byte*) print_char_cursor#21 ) + (byte) euclid::return#3 ← phi( print_euclid::@4/(byte) euclid::return#0 ) + (byte~) print_euclid::$4 ← (byte) euclid::return#3 + (byte) print_byte::b#2 ← (byte~) print_euclid::$4 + call print_byte + to:print_euclid::@6 +print_euclid::@6: scope:[print_euclid] from print_euclid::@5 + (byte*) print_line_cursor#33 ← phi( print_euclid::@5/(byte*) print_line_cursor#35 ) + (byte*) print_char_cursor#46 ← phi( print_euclid::@5/(byte*) print_char_cursor#5 ) + (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#46 + call print_ln + to:print_euclid::@7 +print_euclid::@7: scope:[print_euclid] from print_euclid::@6 + (byte*) print_char_cursor#47 ← phi( print_euclid::@6/(byte*) print_char_cursor#2 ) + (byte*) print_line_cursor#28 ← phi( print_euclid::@6/(byte*) print_line_cursor#2 ) + (byte*) print_line_cursor#13 ← (byte*) print_line_cursor#28 + (byte*) print_char_cursor#23 ← (byte*) print_char_cursor#47 + to:print_euclid::@return +print_euclid::@return: scope:[print_euclid] from print_euclid::@7 + (byte*) print_line_cursor#29 ← phi( print_euclid::@7/(byte*) print_line_cursor#13 ) + (byte*) print_char_cursor#48 ← phi( print_euclid::@7/(byte*) print_char_cursor#23 ) + (byte*) print_char_cursor#24 ← (byte*) print_char_cursor#48 + (byte*) print_line_cursor#14 ← (byte*) print_line_cursor#29 + return + to:@return +euclid: scope:[euclid] from print_euclid::@4 + (byte) euclid::b#6 ← phi( print_euclid::@4/(byte) euclid::b#0 ) + (byte) euclid::a#7 ← phi( print_euclid::@4/(byte) euclid::a#0 ) + to:euclid::@1 +euclid::@1: scope:[euclid] from euclid euclid::@4 euclid::@8 + (byte) euclid::b#2 ← phi( euclid/(byte) euclid::b#6 euclid::@4/(byte) euclid::b#4 euclid::@8/(byte) euclid::b#1 ) + (byte) euclid::a#2 ← phi( euclid/(byte) euclid::a#7 euclid::@4/(byte) euclid::a#1 euclid::@8/(byte) euclid::a#6 ) + (bool~) euclid::$0 ← (byte) euclid::a#2 != (byte) euclid::b#2 + if((bool~) euclid::$0) goto euclid::@2 + to:euclid::@3 +euclid::@2: scope:[euclid] from euclid::@1 + (byte) euclid::b#3 ← phi( euclid::@1/(byte) euclid::b#2 ) + (byte) euclid::a#3 ← phi( euclid::@1/(byte) euclid::a#2 ) + (bool~) euclid::$1 ← (byte) euclid::a#3 > (byte) euclid::b#3 + if((bool~) euclid::$1) goto euclid::@4 + to:euclid::@8 +euclid::@3: scope:[euclid] from euclid::@1 + (byte) euclid::a#4 ← phi( euclid::@1/(byte) euclid::a#2 ) + (byte) euclid::return#1 ← (byte) euclid::a#4 + to:euclid::@return +euclid::@4: scope:[euclid] from euclid::@2 + (byte) euclid::b#4 ← phi( euclid::@2/(byte) euclid::b#3 ) + (byte) euclid::a#5 ← phi( euclid::@2/(byte) euclid::a#3 ) + (byte~) euclid::$3 ← (byte) euclid::a#5 - (byte) euclid::b#4 + (byte) euclid::a#1 ← (byte~) euclid::$3 + to:euclid::@1 +euclid::@8: scope:[euclid] from euclid::@2 + (byte) euclid::a#6 ← phi( euclid::@2/(byte) euclid::a#3 ) + (byte) euclid::b#5 ← phi( euclid::@2/(byte) euclid::b#3 ) + (byte~) euclid::$2 ← (byte) euclid::b#5 - (byte) euclid::a#6 + (byte) euclid::b#1 ← (byte~) euclid::$2 + to:euclid::@1 +euclid::@return: scope:[euclid] from euclid::@3 + (byte) euclid::return#4 ← phi( euclid::@3/(byte) euclid::return#1 ) + (byte) euclid::return#2 ← (byte) euclid::return#4 + return + to:@return +@39: scope:[] from @29 + (byte*) print_screen#4 ← phi( @29/(byte*) print_screen#5 ) + (byte*) print_char_cursor#55 ← phi( @29/(byte*) print_char_cursor#56 ) + (byte*) print_line_cursor#34 ← phi( @29/(byte*) print_line_cursor#36 ) + call main + to:@40 +@40: scope:[] from @39 + (byte*) print_char_cursor#49 ← phi( @39/(byte*) print_char_cursor#17 ) + (byte*) print_line_cursor#30 ← phi( @39/(byte*) print_line_cursor#12 ) + (byte*) print_line_cursor#15 ← (byte*) print_line_cursor#30 + (byte*) print_char_cursor#25 ← (byte*) print_char_cursor#49 + to:@end +@end: scope:[] from @40 + +SYMBOL TABLE SSA +(const string) $0 = (string) "0123456789abcdef" +(label) @12 +(label) @29 +(label) @39 +(label) @40 +(label) @begin +(label) @end +(const byte) RADIX::BINARY = (number) 2 +(const byte) RADIX::DECIMAL = (number) $a +(const byte) RADIX::HEXADECIMAL = (number) $10 +(const byte) RADIX::OCTAL = (number) 8 +(byte()) euclid((byte) euclid::a , (byte) euclid::b) +(bool~) euclid::$0 +(bool~) euclid::$1 +(byte~) euclid::$2 +(byte~) euclid::$3 +(label) euclid::@1 +(label) euclid::@2 +(label) euclid::@3 +(label) euclid::@4 +(label) euclid::@8 +(label) euclid::@return +(byte) euclid::a +(byte) euclid::a#0 +(byte) euclid::a#1 +(byte) euclid::a#2 +(byte) euclid::a#3 +(byte) euclid::a#4 +(byte) euclid::a#5 +(byte) euclid::a#6 +(byte) euclid::a#7 +(byte) euclid::b +(byte) euclid::b#0 +(byte) euclid::b#1 +(byte) euclid::b#2 +(byte) euclid::b#3 +(byte) euclid::b#4 +(byte) euclid::b#5 +(byte) euclid::b#6 +(byte) euclid::return +(byte) euclid::return#0 +(byte) euclid::return#1 +(byte) euclid::return#2 +(byte) euclid::return#3 +(byte) euclid::return#4 +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@return +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(bool~) memset::$0 +(bool~) memset::$1 +(byte*~) memset::$2 +(byte*~) memset::$3 +(bool~) memset::$4 +(label) memset::@1 +(label) memset::@2 +(label) memset::@4 +(label) memset::@return +(byte) memset::c +(byte) memset::c#0 +(byte) memset::c#1 +(byte) memset::c#2 +(byte) memset::c#3 +(byte*) memset::dst +(byte*) memset::dst#0 +(byte*) memset::dst#1 +(byte*) memset::dst#2 +(byte*) memset::end +(byte*) memset::end#0 +(byte*) memset::end#1 +(word) memset::num +(word) memset::num#0 +(word) memset::num#1 +(word) memset::num#2 +(void*) memset::return +(void*) memset::return#0 +(void*) memset::return#1 +(void*) memset::return#2 +(void*) memset::return#3 +(void*) memset::str +(void*) memset::str#0 +(void*) memset::str#1 +(void*) memset::str#2 +(void*) memset::str#3 +(void*) memset::str#4 +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 +(number~) print_byte::$2 +(label) print_byte::@1 +(label) print_byte::@2 +(label) print_byte::@return +(byte) print_byte::b +(byte) print_byte::b#0 +(byte) print_byte::b#1 +(byte) print_byte::b#2 +(byte) print_byte::b#3 +(byte) print_byte::b#4 +(void()) print_char((byte) print_char::ch) +(label) print_char::@return +(byte) print_char::ch +(byte) print_char::ch#0 +(byte) print_char::ch#1 +(byte) print_char::ch#2 +(byte) print_char::ch#3 +(byte) print_char::ch#4 +(byte*) print_char_cursor +(byte*) print_char_cursor#0 +(byte*) print_char_cursor#1 +(byte*) print_char_cursor#10 +(byte*) print_char_cursor#11 +(byte*) print_char_cursor#12 +(byte*) print_char_cursor#13 +(byte*) print_char_cursor#14 +(byte*) print_char_cursor#15 +(byte*) print_char_cursor#16 +(byte*) print_char_cursor#17 +(byte*) print_char_cursor#18 +(byte*) print_char_cursor#19 +(byte*) print_char_cursor#2 +(byte*) print_char_cursor#20 +(byte*) print_char_cursor#21 +(byte*) print_char_cursor#22 +(byte*) print_char_cursor#23 +(byte*) print_char_cursor#24 +(byte*) print_char_cursor#25 +(byte*) print_char_cursor#26 +(byte*) print_char_cursor#27 +(byte*) print_char_cursor#28 +(byte*) print_char_cursor#29 +(byte*) print_char_cursor#3 +(byte*) print_char_cursor#30 +(byte*) print_char_cursor#31 +(byte*) print_char_cursor#32 +(byte*) print_char_cursor#33 +(byte*) print_char_cursor#34 +(byte*) print_char_cursor#35 +(byte*) print_char_cursor#36 +(byte*) print_char_cursor#37 +(byte*) print_char_cursor#38 +(byte*) print_char_cursor#39 +(byte*) print_char_cursor#4 +(byte*) print_char_cursor#40 +(byte*) print_char_cursor#41 +(byte*) print_char_cursor#42 +(byte*) print_char_cursor#43 +(byte*) print_char_cursor#44 +(byte*) print_char_cursor#45 +(byte*) print_char_cursor#46 +(byte*) print_char_cursor#47 +(byte*) print_char_cursor#48 +(byte*) print_char_cursor#49 +(byte*) print_char_cursor#5 +(byte*) print_char_cursor#50 +(byte*) print_char_cursor#51 +(byte*) print_char_cursor#52 +(byte*) print_char_cursor#53 +(byte*) print_char_cursor#54 +(byte*) print_char_cursor#55 +(byte*) print_char_cursor#56 +(byte*) print_char_cursor#6 +(byte*) print_char_cursor#7 +(byte*) print_char_cursor#8 +(byte*) print_char_cursor#9 +(void()) print_cls() +(label) print_cls::@1 +(label) print_cls::@return +(void()) print_euclid((byte) print_euclid::a , (byte) print_euclid::b) +(byte~) print_euclid::$4 +(label) print_euclid::@1 +(label) print_euclid::@2 +(label) print_euclid::@3 +(label) print_euclid::@4 +(label) print_euclid::@5 +(label) print_euclid::@6 +(label) print_euclid::@7 +(label) print_euclid::@return +(byte) print_euclid::a +(byte) print_euclid::a#0 +(byte) print_euclid::a#1 +(byte) print_euclid::a#10 +(byte) print_euclid::a#2 +(byte) print_euclid::a#3 +(byte) print_euclid::a#4 +(byte) print_euclid::a#5 +(byte) print_euclid::a#6 +(byte) print_euclid::a#7 +(byte) print_euclid::a#8 +(byte) print_euclid::a#9 +(byte) print_euclid::b +(byte) print_euclid::b#0 +(byte) print_euclid::b#1 +(byte) print_euclid::b#10 +(byte) print_euclid::b#2 +(byte) print_euclid::b#3 +(byte) print_euclid::b#4 +(byte) print_euclid::b#5 +(byte) print_euclid::b#6 +(byte) print_euclid::b#7 +(byte) print_euclid::b#8 +(byte) print_euclid::b#9 +(byte[]) print_hextab +(byte[]) print_hextab#0 +(byte*) print_line_cursor +(byte*) print_line_cursor#0 +(byte*) print_line_cursor#1 +(byte*) print_line_cursor#10 +(byte*) print_line_cursor#11 +(byte*) print_line_cursor#12 +(byte*) print_line_cursor#13 +(byte*) print_line_cursor#14 +(byte*) print_line_cursor#15 +(byte*) print_line_cursor#16 +(byte*) print_line_cursor#17 +(byte*) print_line_cursor#18 +(byte*) print_line_cursor#19 +(byte*) print_line_cursor#2 +(byte*) print_line_cursor#20 +(byte*) print_line_cursor#21 +(byte*) print_line_cursor#22 +(byte*) print_line_cursor#23 +(byte*) print_line_cursor#24 +(byte*) print_line_cursor#25 +(byte*) print_line_cursor#26 +(byte*) print_line_cursor#27 +(byte*) print_line_cursor#28 +(byte*) print_line_cursor#29 +(byte*) print_line_cursor#3 +(byte*) print_line_cursor#30 +(byte*) print_line_cursor#31 +(byte*) print_line_cursor#32 +(byte*) print_line_cursor#33 +(byte*) print_line_cursor#34 +(byte*) print_line_cursor#35 +(byte*) print_line_cursor#36 +(byte*) print_line_cursor#37 +(byte*) print_line_cursor#38 +(byte*) print_line_cursor#39 +(byte*) print_line_cursor#4 +(byte*) print_line_cursor#40 +(byte*) print_line_cursor#41 +(byte*) print_line_cursor#5 +(byte*) print_line_cursor#6 +(byte*) print_line_cursor#7 +(byte*) print_line_cursor#8 +(byte*) print_line_cursor#9 +(void()) print_ln() +(byte*~) print_ln::$0 +(bool~) print_ln::$1 +(label) print_ln::@1 +(label) print_ln::@2 +(label) print_ln::@return +(byte*) print_screen +(byte*) print_screen#0 +(byte*) print_screen#1 +(byte*) print_screen#2 +(byte*) print_screen#3 +(byte*) print_screen#4 +(byte*) print_screen#5 + +Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 +Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#16 + (number) $28 +Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (number) 4 +Adding number conversion cast (unumber) $f in (number~) print_byte::$2 ← (byte) print_byte::b#4 & (number) $f +Adding number conversion cast (unumber) print_byte::$2 in (number~) print_byte::$2 ← (byte) print_byte::b#4 & (unumber)(number) $f +Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 +Adding number conversion cast (unumber) $80 in (byte) print_euclid::a#0 ← (number) $80 +Adding number conversion cast (unumber) 2 in (byte) print_euclid::b#0 ← (number) 2 +Adding number conversion cast (unumber) $a9 in (byte) print_euclid::a#1 ← (number) $a9 +Adding number conversion cast (unumber) $45 in (byte) print_euclid::b#1 ← (number) $45 +Adding number conversion cast (unumber) $9b in (byte) print_euclid::a#2 ← (number) $9b +Adding number conversion cast (unumber) $37 in (byte) print_euclid::b#2 ← (number) $37 +Adding number conversion cast (unumber) $c7 in (byte) print_euclid::a#3 ← (number) $c7 +Adding number conversion cast (unumber) 3 in (byte) print_euclid::b#3 ← (number) 3 +Adding number conversion cast (unumber) $5b in (byte) print_euclid::a#4 ← (number) $5b +Adding number conversion cast (unumber) $1a in (byte) print_euclid::b#4 ← (number) $1a +Adding number conversion cast (unumber) $77 in (byte) print_euclid::a#5 ← (number) $77 +Adding number conversion cast (unumber) $bb in (byte) print_euclid::b#5 ← (number) $bb +Successful SSA optimization PassNAddNumberTypeConversions +Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2 +Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 +Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 +Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 +Inlining cast (byte) print_euclid::a#0 ← (unumber)(number) $80 +Inlining cast (byte) print_euclid::b#0 ← (unumber)(number) 2 +Inlining cast (byte) print_euclid::a#1 ← (unumber)(number) $a9 +Inlining cast (byte) print_euclid::b#1 ← (unumber)(number) $45 +Inlining cast (byte) print_euclid::a#2 ← (unumber)(number) $9b +Inlining cast (byte) print_euclid::b#2 ← (unumber)(number) $37 +Inlining cast (byte) print_euclid::a#3 ← (unumber)(number) $c7 +Inlining cast (byte) print_euclid::b#3 ← (unumber)(number) 3 +Inlining cast (byte) print_euclid::a#4 ← (unumber)(number) $5b +Inlining cast (byte) print_euclid::b#4 ← (unumber)(number) $1a +Inlining cast (byte) print_euclid::a#5 ← (unumber)(number) $77 +Inlining cast (byte) print_euclid::b#5 ← (unumber)(number) $bb +Successful SSA optimization Pass2InlineCast +Simplifying constant integer cast 0 +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant integer cast $28 +Simplifying constant integer cast 4 +Simplifying constant integer cast $f +Simplifying constant integer cast $3e8 +Simplifying constant integer cast $80 +Simplifying constant integer cast 2 +Simplifying constant integer cast $a9 +Simplifying constant integer cast $45 +Simplifying constant integer cast $9b +Simplifying constant integer cast $37 +Simplifying constant integer cast $c7 +Simplifying constant integer cast 3 +Simplifying constant integer cast $5b +Simplifying constant integer cast $1a +Simplifying constant integer cast $77 +Simplifying constant integer cast $bb +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $3e8 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $a9 +Finalized unsigned number type (byte) $45 +Finalized unsigned number type (byte) $9b +Finalized unsigned number type (byte) $37 +Finalized unsigned number type (byte) $c7 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $5b +Finalized unsigned number type (byte) $1a +Finalized unsigned number type (byte) $77 +Finalized unsigned number type (byte) $bb +Successful SSA optimization PassNFinalizeNumberTypeConversions +Inferred type updated to byte in (unumber~) print_byte::$2 ← (byte) print_byte::b#4 & (byte) $f +Inversing boolean not [2] (bool~) memset::$1 ← (word) memset::num#1 <= (byte) 0 from [1] (bool~) memset::$0 ← (word) memset::num#1 > (byte) 0 +Successful SSA optimization Pass2UnaryNotSimplification +Alias (void*) memset::return#0 = (void*) memset::str#1 (void*) memset::return#3 (void*) memset::return#1 +Alias (void*) memset::str#2 = (void*) memset::str#3 +Alias (word) memset::num#1 = (word) memset::num#2 +Alias (byte) memset::c#2 = (byte) memset::c#3 +Alias (byte*) memset::end#0 = (byte*~) memset::$3 +Alias (byte*) print_line_cursor#0 = (byte*) print_screen#0 (byte*) print_char_cursor#0 (byte*) print_line_cursor#36 (byte*) print_char_cursor#56 (byte*) print_screen#5 (byte*) print_line_cursor#34 (byte*) print_char_cursor#55 (byte*) print_screen#4 +Alias (byte*) print_line_cursor#1 = (byte*~) print_ln::$0 (byte*) print_line_cursor#17 (byte*) print_char_cursor#1 (byte*) print_line_cursor#18 (byte*) print_char_cursor#27 (byte*) print_line_cursor#2 (byte*) print_char_cursor#2 +Alias (byte) print_byte::b#3 = (byte) print_byte::b#4 +Alias (byte*) print_char_cursor#28 = (byte*) print_char_cursor#3 +Alias (byte*) print_char_cursor#29 = (byte*) print_char_cursor#4 (byte*) print_char_cursor#30 (byte*) print_char_cursor#5 +Alias (byte*) print_char_cursor#32 = (byte*) print_char_cursor#6 (byte*) print_char_cursor#7 +Alias (byte*) print_line_cursor#19 = (byte*) print_screen#2 (byte*) print_screen#1 (byte*) print_line_cursor#3 (byte*) print_char_cursor#8 (byte*) print_char_cursor#33 (byte*) print_line_cursor#4 (byte*) print_char_cursor#9 +Alias (byte*) print_line_cursor#20 = (byte*) print_line_cursor#5 +Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#34 +Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#35 +Alias (byte*) print_line_cursor#21 = (byte*) print_line_cursor#6 +Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#36 +Alias (byte*) print_line_cursor#22 = (byte*) print_line_cursor#7 +Alias (byte*) print_char_cursor#13 = (byte*) print_char_cursor#37 +Alias (byte*) print_line_cursor#23 = (byte*) print_line_cursor#8 +Alias (byte*) print_char_cursor#14 = (byte*) print_char_cursor#38 +Alias (byte*) print_line_cursor#24 = (byte*) print_line_cursor#9 +Alias (byte*) print_char_cursor#15 = (byte*) print_char_cursor#39 +Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#25 +Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#40 (byte*) print_char_cursor#41 (byte*) print_char_cursor#17 +Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#26 (byte*) print_line_cursor#27 (byte*) print_line_cursor#12 +Alias (byte) print_euclid::b#10 = (byte) print_euclid::b#8 (byte) print_euclid::b#6 (byte) print_euclid::b#9 (byte) print_euclid::b#7 +Alias (byte) print_euclid::a#10 = (byte) print_euclid::a#6 (byte) print_euclid::a#9 (byte) print_euclid::a#8 (byte) print_euclid::a#7 +Alias (byte*) print_line_cursor#33 = (byte*) print_line_cursor#40 (byte*) print_line_cursor#41 (byte*) print_line_cursor#39 (byte*) print_line_cursor#38 (byte*) print_line_cursor#37 (byte*) print_line_cursor#35 +Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#42 +Alias (byte*) print_char_cursor#19 = (byte*) print_char_cursor#43 +Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#44 +Alias (byte*) print_char_cursor#21 = (byte*) print_char_cursor#45 (byte*) print_char_cursor#54 +Alias (byte) euclid::return#0 = (byte) euclid::return#3 +Alias (byte) print_byte::b#2 = (byte~) print_euclid::$4 +Alias (byte*) print_char_cursor#22 = (byte*) print_char_cursor#46 +Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#28 (byte*) print_line_cursor#29 (byte*) print_line_cursor#14 +Alias (byte*) print_char_cursor#23 = (byte*) print_char_cursor#47 (byte*) print_char_cursor#48 (byte*) print_char_cursor#24 +Alias (byte) euclid::a#2 = (byte) euclid::a#3 (byte) euclid::a#4 (byte) euclid::return#1 (byte) euclid::a#5 (byte) euclid::a#6 (byte) euclid::return#4 (byte) euclid::return#2 +Alias (byte) euclid::b#2 = (byte) euclid::b#3 (byte) euclid::b#4 (byte) euclid::b#5 +Alias (byte) euclid::a#1 = (byte~) euclid::$3 +Alias (byte) euclid::b#1 = (byte~) euclid::$2 +Alias (byte*) print_line_cursor#15 = (byte*) print_line_cursor#30 +Alias (byte*) print_char_cursor#25 = (byte*) print_char_cursor#49 +Successful SSA optimization Pass2AliasElimination +Identical Phi Values (word) memset::num#1 (word) memset::num#0 +Identical Phi Values (void*) memset::str#2 (void*) memset::str#0 +Identical Phi Values (byte) memset::c#2 (byte) memset::c#0 +Identical Phi Values (byte) memset::c#1 (byte) memset::c#2 +Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0 +Identical Phi Values (void*) memset::str#4 (void*) memset::str#2 +Identical Phi Values (byte*) print_line_cursor#31 (byte*) print_line_cursor#33 +Identical Phi Values (byte*) print_char_cursor#50 (byte*) print_char_cursor#22 +Identical Phi Values (byte*) print_char_cursor#26 (byte*) print_char_cursor#50 +Identical Phi Values (byte*) print_char_cursor#28 (byte*) print_char_cursor#32 +Identical Phi Values (byte*) print_char_cursor#29 (byte*) print_char_cursor#32 +Identical Phi Values (byte*) print_line_cursor#19 (byte*) print_screen#3 +Identical Phi Values (byte*) print_screen#3 (byte*) print_line_cursor#0 +Identical Phi Values (byte*) print_line_cursor#32 (byte*) print_line_cursor#0 +Identical Phi Values (byte*) print_char_cursor#52 (byte*) print_line_cursor#0 +Identical Phi Values (byte*) print_line_cursor#20 (byte*) print_line_cursor#19 +Identical Phi Values (byte*) print_char_cursor#10 (byte*) print_line_cursor#19 +Identical Phi Values (byte*) print_char_cursor#11 (byte*) print_char_cursor#23 +Identical Phi Values (byte*) print_line_cursor#21 (byte*) print_line_cursor#13 +Identical Phi Values (byte*) print_char_cursor#12 (byte*) print_char_cursor#23 +Identical Phi Values (byte*) print_line_cursor#22 (byte*) print_line_cursor#13 +Identical Phi Values (byte*) print_char_cursor#13 (byte*) print_char_cursor#23 +Identical Phi Values (byte*) print_line_cursor#23 (byte*) print_line_cursor#13 +Identical Phi Values (byte*) print_char_cursor#14 (byte*) print_char_cursor#23 +Identical Phi Values (byte*) print_line_cursor#24 (byte*) print_line_cursor#13 +Identical Phi Values (byte*) print_char_cursor#15 (byte*) print_char_cursor#23 +Identical Phi Values (byte*) print_line_cursor#10 (byte*) print_line_cursor#13 +Identical Phi Values (byte*) print_char_cursor#16 (byte*) print_char_cursor#23 +Identical Phi Values (byte*) print_line_cursor#11 (byte*) print_line_cursor#13 +Identical Phi Values (byte*) print_char_cursor#18 (byte*) print_char_cursor#29 +Identical Phi Values (byte*) print_char_cursor#19 (byte*) print_char_cursor#32 +Identical Phi Values (byte*) print_char_cursor#20 (byte*) print_char_cursor#29 +Identical Phi Values (byte*) print_char_cursor#21 (byte*) print_char_cursor#32 +Identical Phi Values (byte*) print_char_cursor#22 (byte*) print_char_cursor#29 +Identical Phi Values (byte*) print_line_cursor#13 (byte*) print_line_cursor#1 +Identical Phi Values (byte*) print_char_cursor#23 (byte*) print_line_cursor#1 +Identical Phi Values (byte) euclid::a#7 (byte) euclid::a#0 +Identical Phi Values (byte) euclid::b#6 (byte) euclid::b#0 +Identical Phi Values (byte*) print_line_cursor#15 (byte*) print_line_cursor#11 +Identical Phi Values (byte*) print_char_cursor#25 (byte*) print_char_cursor#16 +Successful SSA optimization Pass2IdenticalPhiElimination +Identical Phi Values (void*) memset::return#0 (void*) memset::str#0 +Successful SSA optimization Pass2IdenticalPhiElimination +Simple Condition (bool~) memset::$1 [3] if((word) memset::num#0<=(byte) 0) goto memset::@1 +Simple Condition (bool~) memset::$4 [15] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@4 +Simple Condition (bool~) print_ln::$1 [27] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#32) goto print_ln::@1 +Simple Condition (bool~) euclid::$0 [152] if((byte) euclid::a#2!=(byte) euclid::b#2) goto euclid::@2 +Simple Condition (bool~) euclid::$1 [155] if((byte) euclid::a#2>(byte) euclid::b#2) goto euclid::@4 +Successful SSA optimization Pass2ConditionalJumpSimplification +Constant (const byte*) print_line_cursor#0 = (byte*) 1024 +Constant (const byte[]) print_hextab#0 = $0 +Constant (const byte) memset::c#0 = ' ' +Constant (const word) memset::num#0 = $3e8 +Constant (const byte) print_euclid::a#0 = $80 +Constant (const byte) print_euclid::b#0 = 2 +Constant (const byte) print_euclid::a#1 = $a9 +Constant (const byte) print_euclid::b#1 = $45 +Constant (const byte) print_euclid::a#2 = $9b +Constant (const byte) print_euclid::b#2 = $37 +Constant (const byte) print_euclid::a#3 = $c7 +Constant (const byte) print_euclid::b#3 = 3 +Constant (const byte) print_euclid::a#4 = $5b +Constant (const byte) print_euclid::b#4 = $1a +Constant (const byte) print_euclid::a#5 = $77 +Constant (const byte) print_euclid::b#5 = $bb +Constant (const byte) print_char::ch#2 = ' ' +Constant (const byte) print_char::ch#3 = ' ' +Successful SSA optimization Pass2ConstantIdentification +Constant value identified (void*)print_line_cursor#0 in [57] (void*) memset::str#0 ← (void*)(const byte*) print_line_cursor#0 +Successful SSA optimization Pass2ConstantValues +if() condition always false - eliminating [3] if((const word) memset::num#0<=(byte) 0) goto memset::@1 +Successful SSA optimization Pass2ConstantIfs +Eliminating unused variable (void*) memset::return#2 and assignment [26] (void*) memset::return#2 ← (void*) memset::str#0 +Successful SSA optimization PassNEliminateUnusedVars +Constant (const void*) memset::str#0 = (void*)print_line_cursor#0 +Successful SSA optimization Pass2ConstantIdentification +Constant value identified (byte*)memset::str#0 in [0] (byte*~) memset::$2 ← (byte*)(const void*) memset::str#0 +Constant value identified (byte*)memset::str#0 in [2] (byte*) memset::dst#0 ← (byte*)(const void*) memset::str#0 +Successful SSA optimization Pass2ConstantValues +Constant (const byte*) memset::$2 = (byte*)memset::str#0 +Constant (const byte*) memset::dst#0 = (byte*)memset::str#0 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memset::$2 + (const word) memset::num#0 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte*) memset::end#0 = memset::$2+memset::num#0 +Successful SSA optimization Pass2ConstantIdentification +Inlining constant with var siblings (const byte*) memset::dst#0 +Inlining constant with var siblings (const byte) print_char::ch#2 +Inlining constant with var siblings (const byte) print_char::ch#3 +Inlining constant with var siblings (const byte) print_euclid::a#0 +Inlining constant with var siblings (const byte) print_euclid::b#0 +Inlining constant with var siblings (const byte) print_euclid::a#1 +Inlining constant with var siblings (const byte) print_euclid::b#1 +Inlining constant with var siblings (const byte) print_euclid::a#2 +Inlining constant with var siblings (const byte) print_euclid::b#2 +Inlining constant with var siblings (const byte) print_euclid::a#3 +Inlining constant with var siblings (const byte) print_euclid::b#3 +Inlining constant with var siblings (const byte) print_euclid::a#4 +Inlining constant with var siblings (const byte) print_euclid::b#4 +Inlining constant with var siblings (const byte) print_euclid::a#5 +Inlining constant with var siblings (const byte) print_euclid::b#5 +Inlining constant with var siblings (const byte*) print_line_cursor#0 +Constant inlined print_line_cursor#0 = (byte*) 1024 +Constant inlined $0 = (const byte[]) print_hextab#0 +Constant inlined print_char::ch#3 = (byte) ' ' +Constant inlined print_euclid::b#4 = (byte) $1a +Constant inlined print_euclid::a#5 = (byte) $77 +Constant inlined print_char::ch#2 = (byte) ' ' +Constant inlined print_euclid::b#3 = (byte) 3 +Constant inlined print_euclid::a#4 = (byte) $5b +Constant inlined memset::$2 = (byte*)(const void*) memset::str#0 +Constant inlined print_euclid::b#5 = (byte) $bb +Constant inlined print_euclid::b#0 = (byte) 2 +Constant inlined print_euclid::a#1 = (byte) $a9 +Constant inlined print_euclid::a#0 = (byte) $80 +Constant inlined print_euclid::b#2 = (byte) $37 +Constant inlined print_euclid::a#3 = (byte) $c7 +Constant inlined print_euclid::b#1 = (byte) $45 +Constant inlined print_euclid::a#2 = (byte) $9b +Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 +Successful SSA optimization Pass2ConstantInlining +Added new block during phi lifting memset::@6(between memset::@4 and memset::@4) +Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @12 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @39 +Adding NOP phi() at start of @40 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of main::@7 +Adding NOP phi() at start of print_euclid::@6 +Adding NOP phi() at start of print_euclid::@7 +Adding NOP phi() at start of print_ln::@2 +Adding NOP phi() at start of print_byte::@2 +Adding NOP phi() at start of euclid::@3 +Adding NOP phi() at start of print_cls +Adding NOP phi() at start of print_cls::@1 +Adding NOP phi() at start of memset +Adding NOP phi() at start of memset::@2 +Adding NOP phi() at start of memset::@1 +CALL GRAPH +Calls in [] to main:4 +Calls in [main] to print_cls:8 print_euclid:10 print_euclid:13 print_euclid:16 print_euclid:19 print_euclid:22 print_euclid:25 +Calls in [print_euclid] to print_byte:32 print_char:34 print_byte:38 print_char:40 euclid:43 print_byte:48 print_ln:50 +Calls in [print_byte] to print_char:65 print_char:70 +Calls in [print_cls] to memset:91 + +Created 12 initial phi equivalence classes +Not coalescing [11] print_char_cursor#64 ← print_line_cursor#1 +Coalesced [12] print_line_cursor#44 ← print_line_cursor#1 +Not coalescing [14] print_char_cursor#65 ← print_line_cursor#1 +Coalesced (already) [15] print_line_cursor#45 ← print_line_cursor#1 +Not coalescing [17] print_char_cursor#66 ← print_line_cursor#1 +Coalesced (already) [18] print_line_cursor#46 ← print_line_cursor#1 +Not coalescing [20] print_char_cursor#67 ← print_line_cursor#1 +Coalesced (already) [21] print_line_cursor#47 ← print_line_cursor#1 +Not coalescing [23] print_char_cursor#68 ← print_line_cursor#1 +Coalesced (already) [24] print_line_cursor#48 ← print_line_cursor#1 +Coalesced [30] print_byte::b#5 ← print_byte::b#0 +Coalesced [31] print_char_cursor#57 ← print_char_cursor#53 +Coalesced [33] print_char_cursor#62 ← print_char_cursor#32 +Coalesced [36] print_byte::b#6 ← print_byte::b#1 +Coalesced [37] print_char_cursor#58 ← print_char_cursor#32 +Coalesced (already) [39] print_char_cursor#63 ← print_char_cursor#32 +Coalesced [46] print_byte::b#7 ← print_byte::b#2 +Coalesced (already) [47] print_char_cursor#59 ← print_char_cursor#32 +Coalesced [53] print_line_cursor#42 ← print_line_cursor#33 +Coalesced (already) [59] print_line_cursor#43 ← print_line_cursor#1 +Coalesced [63] print_char::ch#5 ← print_char::ch#0 +Coalesced (already) [64] print_char_cursor#60 ← print_char_cursor#51 +Coalesced [68] print_char::ch#6 ← print_char::ch#1 +Coalesced (already) [69] print_char_cursor#61 ← print_char_cursor#32 +Coalesced [77] euclid::a#8 ← euclid::a#0 +Coalesced [78] euclid::b#7 ← euclid::b#0 +Coalesced (already) [85] euclid::a#10 ← euclid::a#2 +Coalesced [86] euclid::b#9 ← euclid::b#1 +Coalesced [88] euclid::a#9 ← euclid::a#1 +Coalesced (already) [89] euclid::b#8 ← euclid::b#2 +Coalesced [102] memset::dst#3 ← memset::dst#1 +Coalesced down to 9 phi equivalence classes +Culled Empty Block (label) @12 +Culled Empty Block (label) @29 +Culled Empty Block (label) @40 +Culled Empty Block (label) main::@7 +Culled Empty Block (label) print_euclid::@7 +Culled Empty Block (label) print_ln::@2 +Culled Empty Block (label) print_ln::@3 +Culled Empty Block (label) print_byte::@2 +Culled Empty Block (label) euclid::@3 +Culled Empty Block (label) print_cls::@1 +Culled Empty Block (label) memset::@2 +Culled Empty Block (label) memset::@1 +Culled Empty Block (label) memset::@6 +Renumbering block @39 to @1 +Renumbering block memset::@4 to memset::@1 +Renumbering block euclid::@4 to euclid::@3 +Renumbering block euclid::@8 to euclid::@4 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of print_euclid::@1 +Adding NOP phi() at start of print_euclid::@3 +Adding NOP phi() at start of print_euclid::@6 +Adding NOP phi() at start of print_ln +Adding NOP phi() at start of euclid +Adding NOP phi() at start of print_cls +Adding NOP phi() at start of memset + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() + to:@1 +@1: scope:[] from @begin + [1] phi() + [2] call main + to:@end +@end: scope:[] from @1 + [3] phi() +main: scope:[main] from @1 + [4] phi() + [5] call print_cls + to:main::@1 +main::@1: scope:[main] from main + [6] phi() + [7] call print_euclid + to:main::@2 +main::@2: scope:[main] from main::@1 + [8] (byte*~) print_char_cursor#64 ← (byte*) print_line_cursor#1 + [9] call print_euclid + to:main::@3 +main::@3: scope:[main] from main::@2 + [10] (byte*~) print_char_cursor#65 ← (byte*) print_line_cursor#1 + [11] call print_euclid + to:main::@4 +main::@4: scope:[main] from main::@3 + [12] (byte*~) print_char_cursor#66 ← (byte*) print_line_cursor#1 + [13] call print_euclid + to:main::@5 +main::@5: scope:[main] from main::@4 + [14] (byte*~) print_char_cursor#67 ← (byte*) print_line_cursor#1 + [15] call print_euclid + to:main::@6 +main::@6: scope:[main] from main::@5 + [16] (byte*~) print_char_cursor#68 ← (byte*) print_line_cursor#1 + [17] call print_euclid + to:main::@return +main::@return: scope:[main] from main::@6 + [18] return + to:@return +print_euclid: scope:[print_euclid] from main::@1 main::@2 main::@3 main::@4 main::@5 main::@6 + [19] (byte*) print_line_cursor#33 ← phi( main::@1/(byte*) 1024 main::@2/(byte*) print_line_cursor#1 main::@3/(byte*) print_line_cursor#1 main::@4/(byte*) print_line_cursor#1 main::@5/(byte*) print_line_cursor#1 main::@6/(byte*) print_line_cursor#1 ) + [19] (byte) print_euclid::b#10 ← phi( main::@1/(byte) 2 main::@2/(byte) $45 main::@3/(byte) $37 main::@4/(byte) 3 main::@5/(byte) $1a main::@6/(byte) $bb ) + [19] (byte*) print_char_cursor#53 ← phi( main::@1/(byte*) 1024 main::@2/(byte*~) print_char_cursor#64 main::@3/(byte*~) print_char_cursor#65 main::@4/(byte*~) print_char_cursor#66 main::@5/(byte*~) print_char_cursor#67 main::@6/(byte*~) print_char_cursor#68 ) + [19] (byte) print_euclid::a#10 ← phi( main::@1/(byte) $80 main::@2/(byte) $a9 main::@3/(byte) $9b main::@4/(byte) $c7 main::@5/(byte) $5b main::@6/(byte) $77 ) + [20] (byte) print_byte::b#0 ← (byte) print_euclid::a#10 + [21] call print_byte + to:print_euclid::@1 +print_euclid::@1: scope:[print_euclid] from print_euclid + [22] phi() + [23] call print_char + to:print_euclid::@2 +print_euclid::@2: scope:[print_euclid] from print_euclid::@1 + [24] (byte) print_byte::b#1 ← (byte) print_euclid::b#10 + [25] call print_byte + to:print_euclid::@3 +print_euclid::@3: scope:[print_euclid] from print_euclid::@2 + [26] phi() + [27] call print_char + to:print_euclid::@4 +print_euclid::@4: scope:[print_euclid] from print_euclid::@3 + [28] (byte) euclid::a#0 ← (byte) print_euclid::a#10 + [29] (byte) euclid::b#0 ← (byte) print_euclid::b#10 + [30] call euclid + [31] (byte) euclid::return#0 ← (byte) euclid::a#2 + to:print_euclid::@5 +print_euclid::@5: scope:[print_euclid] from print_euclid::@4 + [32] (byte) print_byte::b#2 ← (byte) euclid::return#0 + [33] call print_byte + to:print_euclid::@6 +print_euclid::@6: scope:[print_euclid] from print_euclid::@5 + [34] phi() + [35] call print_ln + to:print_euclid::@return +print_euclid::@return: scope:[print_euclid] from print_euclid::@6 + [36] return + to:@return +print_ln: scope:[print_ln] from print_euclid::@6 + [37] phi() + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + [38] (byte*) print_line_cursor#16 ← phi( print_ln/(byte*) print_line_cursor#33 print_ln::@1/(byte*) print_line_cursor#1 ) + [39] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#16 + (byte) $28 + [40] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#32) goto print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [41] return + to:@return +print_byte: scope:[print_byte] from print_euclid print_euclid::@2 print_euclid::@5 + [42] (byte*) print_char_cursor#51 ← phi( print_euclid/(byte*) print_char_cursor#53 print_euclid::@2/(byte*) print_char_cursor#32 print_euclid::@5/(byte*) print_char_cursor#32 ) + [42] (byte) print_byte::b#3 ← phi( print_euclid/(byte) print_byte::b#0 print_euclid::@2/(byte) print_byte::b#1 print_euclid::@5/(byte) print_byte::b#2 ) + [43] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte) 4 + [44] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0) + [45] call print_char + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + [46] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f + [47] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2) + [48] call print_char + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + [49] return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 print_euclid::@1 print_euclid::@3 + [50] (byte*) print_char_cursor#31 ← phi( print_byte/(byte*) print_char_cursor#51 print_byte::@1/(byte*) print_char_cursor#32 print_euclid::@1/(byte*) print_char_cursor#32 print_euclid::@3/(byte*) print_char_cursor#32 ) + [50] (byte) print_char::ch#4 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 print_euclid::@1/(byte) ' ' print_euclid::@3/(byte) ' ' ) + [51] *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 + [52] (byte*) print_char_cursor#32 ← ++ (byte*) print_char_cursor#31 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + [53] return + to:@return +euclid: scope:[euclid] from print_euclid::@4 + [54] phi() + to:euclid::@1 +euclid::@1: scope:[euclid] from euclid euclid::@3 euclid::@4 + [55] (byte) euclid::b#2 ← phi( euclid/(byte) euclid::b#0 euclid::@3/(byte) euclid::b#2 euclid::@4/(byte) euclid::b#1 ) + [55] (byte) euclid::a#2 ← phi( euclid/(byte) euclid::a#0 euclid::@3/(byte) euclid::a#1 euclid::@4/(byte) euclid::a#2 ) + [56] if((byte) euclid::a#2!=(byte) euclid::b#2) goto euclid::@2 + to:euclid::@return +euclid::@return: scope:[euclid] from euclid::@1 + [57] return + to:@return +euclid::@2: scope:[euclid] from euclid::@1 + [58] if((byte) euclid::a#2>(byte) euclid::b#2) goto euclid::@3 + to:euclid::@4 +euclid::@4: scope:[euclid] from euclid::@2 + [59] (byte) euclid::b#1 ← (byte) euclid::b#2 - (byte) euclid::a#2 + to:euclid::@1 +euclid::@3: scope:[euclid] from euclid::@2 + [60] (byte) euclid::a#1 ← (byte) euclid::a#2 - (byte) euclid::b#2 + to:euclid::@1 +print_cls: scope:[print_cls] from main + [61] phi() + [62] call memset + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls + [63] return + to:@return +memset: scope:[memset] from print_cls + [64] phi() + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@1 + [65] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@1/(byte*) memset::dst#1 ) + [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 + [67] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + [68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 + to:memset::@return +memset::@return: scope:[memset] from memset::@1 + [69] return + to:@return + + +VARIABLE REGISTER WEIGHTS +(byte()) euclid((byte) euclid::a , (byte) euclid::b) +(byte) euclid::a +(byte) euclid::a#0 1.3333333333333333 +(byte) euclid::a#1 22.0 +(byte) euclid::a#2 13.5 +(byte) euclid::b +(byte) euclid::b#0 2.0 +(byte) euclid::b#1 22.0 +(byte) euclid::b#2 19.75 +(byte) euclid::return +(byte) euclid::return#0 4.0 +(void()) main() +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(byte) memset::c +(byte*) memset::dst +(byte*) memset::dst#1 16.5 +(byte*) memset::dst#2 16.5 +(byte*) memset::end +(word) memset::num +(void*) memset::return +(void*) memset::str +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 4.0 +(byte~) print_byte::$2 4.0 +(byte) print_byte::b +(byte) print_byte::b#0 4.0 +(byte) print_byte::b#1 4.0 +(byte) print_byte::b#2 4.0 +(byte) print_byte::b#3 2.5 +(void()) print_char((byte) print_char::ch) +(byte) print_char::ch +(byte) print_char::ch#0 4.0 +(byte) print_char::ch#1 4.0 +(byte) print_char::ch#4 6.0 +(byte*) print_char_cursor +(byte*) print_char_cursor#31 6.0 +(byte*) print_char_cursor#32 0.9199999999999998 +(byte*) print_char_cursor#51 2.6666666666666665 +(byte*) print_char_cursor#53 6.0 +(byte*~) print_char_cursor#64 4.0 +(byte*~) print_char_cursor#65 4.0 +(byte*~) print_char_cursor#66 4.0 +(byte*~) print_char_cursor#67 4.0 +(byte*~) print_char_cursor#68 4.0 +(void()) print_cls() +(void()) print_euclid((byte) print_euclid::a , (byte) print_euclid::b) +(byte) print_euclid::a +(byte) print_euclid::a#10 0.4444444444444444 +(byte) print_euclid::b +(byte) print_euclid::b#10 0.4 +(byte[]) print_hextab +(byte*) print_line_cursor +(byte*) print_line_cursor#1 3.533333333333333 +(byte*) print_line_cursor#16 24.0 +(byte*) print_line_cursor#33 0.7058823529411765 +(void()) print_ln() +(byte*) print_screen + +Initial phi equivalence classes +[ print_euclid::a#10 ] +[ print_euclid::b#10 ] +[ print_line_cursor#16 print_line_cursor#33 print_line_cursor#1 ] +[ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] +[ print_char::ch#4 print_char::ch#0 print_char::ch#1 ] +[ print_char_cursor#31 print_char_cursor#51 print_char_cursor#53 print_char_cursor#64 print_char_cursor#65 print_char_cursor#66 print_char_cursor#67 print_char_cursor#68 print_char_cursor#32 ] +[ euclid::a#2 euclid::a#0 euclid::a#1 ] +[ euclid::b#2 euclid::b#0 euclid::b#1 ] +[ memset::dst#2 memset::dst#1 ] +Added variable euclid::return#0 to zero page equivalence class [ euclid::return#0 ] +Added variable print_byte::$0 to zero page equivalence class [ print_byte::$0 ] +Added variable print_byte::$2 to zero page equivalence class [ print_byte::$2 ] +Complete equivalence classes +[ print_euclid::a#10 ] +[ print_euclid::b#10 ] +[ print_line_cursor#16 print_line_cursor#33 print_line_cursor#1 ] +[ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] +[ print_char::ch#4 print_char::ch#0 print_char::ch#1 ] +[ print_char_cursor#31 print_char_cursor#51 print_char_cursor#53 print_char_cursor#64 print_char_cursor#65 print_char_cursor#66 print_char_cursor#67 print_char_cursor#68 print_char_cursor#32 ] +[ euclid::a#2 euclid::a#0 euclid::a#1 ] +[ euclid::b#2 euclid::b#0 euclid::b#1 ] +[ memset::dst#2 memset::dst#1 ] +[ euclid::return#0 ] +[ print_byte::$0 ] +[ print_byte::$2 ] +Allocated zp ZP_BYTE:2 [ print_euclid::a#10 ] +Allocated zp ZP_BYTE:3 [ print_euclid::b#10 ] +Allocated zp ZP_WORD:4 [ print_line_cursor#16 print_line_cursor#33 print_line_cursor#1 ] +Allocated zp ZP_BYTE:6 [ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] +Allocated zp ZP_BYTE:7 [ print_char::ch#4 print_char::ch#0 print_char::ch#1 ] +Allocated zp ZP_WORD:8 [ print_char_cursor#31 print_char_cursor#51 print_char_cursor#53 print_char_cursor#64 print_char_cursor#65 print_char_cursor#66 print_char_cursor#67 print_char_cursor#68 print_char_cursor#32 ] +Allocated zp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] +Allocated zp ZP_BYTE:11 [ euclid::b#2 euclid::b#0 euclid::b#1 ] +Allocated zp ZP_WORD:12 [ memset::dst#2 memset::dst#1 ] +Allocated zp ZP_BYTE:14 [ euclid::return#0 ] +Allocated zp ZP_BYTE:15 [ print_byte::$0 ] +Allocated zp ZP_BYTE:16 [ print_byte::$2 ] + +INITIAL ASM + // File Comments +/* + * Find least common denominator using subtraction-based Euclidian algorithm + * See https://en.wikipedia.org/wiki/Euclidean_algorithm + * Based on facebook post from + */ + // Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" + // Global Constants & labels + .label print_line_cursor = 4 + .label print_char_cursor = 8 + // @begin +bbegin: + // [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 + // @1 +b1: + // [2] call main + // [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main + // [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend + // @end +bend: + // main +main: { + // [5] call print_cls + // [61] phi from main to print_cls [phi:main->print_cls] + print_cls_from_main: + jsr print_cls + // [6] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + jmp b1 + // main::@1 + b1: + // [7] call print_euclid + // [19] phi from main::@1 to print_euclid [phi:main::@1->print_euclid] + print_euclid_from_b1: + // [19] phi (byte*) print_line_cursor#33 = (byte*) 1024 [phi:main::@1->print_euclid#0] -- pbuz1=pbuc1 + lda #<$400 + sta print_line_cursor + lda #>$400 + sta print_line_cursor+1 + // [19] phi (byte) print_euclid::b#10 = (byte) 2 [phi:main::@1->print_euclid#1] -- vbuz1=vbuc1 + lda #2 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*) 1024 [phi:main::@1->print_euclid#2] -- pbuz1=pbuc1 + lda #<$400 + sta print_char_cursor + lda #>$400 + sta print_char_cursor+1 + // [19] phi (byte) print_euclid::a#10 = (byte) $80 [phi:main::@1->print_euclid#3] -- vbuz1=vbuc1 + lda #$80 + sta print_euclid.a + jsr print_euclid + jmp b2 + // main::@2 + b2: + // [8] (byte*~) print_char_cursor#64 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [9] call print_euclid + // [19] phi from main::@2 to print_euclid [phi:main::@2->print_euclid] + print_euclid_from_b2: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@2->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $45 [phi:main::@2->print_euclid#1] -- vbuz1=vbuc1 + lda #$45 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#64 [phi:main::@2->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $a9 [phi:main::@2->print_euclid#3] -- vbuz1=vbuc1 + lda #$a9 + sta print_euclid.a + jsr print_euclid + jmp b3 + // main::@3 + b3: + // [10] (byte*~) print_char_cursor#65 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [11] call print_euclid + // [19] phi from main::@3 to print_euclid [phi:main::@3->print_euclid] + print_euclid_from_b3: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@3->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $37 [phi:main::@3->print_euclid#1] -- vbuz1=vbuc1 + lda #$37 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#65 [phi:main::@3->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $9b [phi:main::@3->print_euclid#3] -- vbuz1=vbuc1 + lda #$9b + sta print_euclid.a + jsr print_euclid + jmp b4 + // main::@4 + b4: + // [12] (byte*~) print_char_cursor#66 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [13] call print_euclid + // [19] phi from main::@4 to print_euclid [phi:main::@4->print_euclid] + print_euclid_from_b4: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@4->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) 3 [phi:main::@4->print_euclid#1] -- vbuz1=vbuc1 + lda #3 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#66 [phi:main::@4->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $c7 [phi:main::@4->print_euclid#3] -- vbuz1=vbuc1 + lda #$c7 + sta print_euclid.a + jsr print_euclid + jmp b5 + // main::@5 + b5: + // [14] (byte*~) print_char_cursor#67 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [15] call print_euclid + // [19] phi from main::@5 to print_euclid [phi:main::@5->print_euclid] + print_euclid_from_b5: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@5->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $1a [phi:main::@5->print_euclid#1] -- vbuz1=vbuc1 + lda #$1a + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#67 [phi:main::@5->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $5b [phi:main::@5->print_euclid#3] -- vbuz1=vbuc1 + lda #$5b + sta print_euclid.a + jsr print_euclid + jmp b6 + // main::@6 + b6: + // [16] (byte*~) print_char_cursor#68 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [17] call print_euclid + // [19] phi from main::@6 to print_euclid [phi:main::@6->print_euclid] + print_euclid_from_b6: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@6->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $bb [phi:main::@6->print_euclid#1] -- vbuz1=vbuc1 + lda #$bb + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#68 [phi:main::@6->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $77 [phi:main::@6->print_euclid#3] -- vbuz1=vbuc1 + lda #$77 + sta print_euclid.a + jsr print_euclid + jmp breturn + // main::@return + breturn: + // [18] return + rts +} + // print_euclid +// print_euclid(byte zeropage(2) a, byte zeropage(3) b) +print_euclid: { + .label b = 3 + .label a = 2 + // [20] (byte) print_byte::b#0 ← (byte) print_euclid::a#10 -- vbuz1=vbuz2 + lda a + sta print_byte.b + // [21] call print_byte + // [42] phi from print_euclid to print_byte [phi:print_euclid->print_byte] + print_byte_from_print_euclid: + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#53 [phi:print_euclid->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#0 [phi:print_euclid->print_byte#1] -- register_copy + jsr print_byte + // [22] phi from print_euclid to print_euclid::@1 [phi:print_euclid->print_euclid::@1] + b1_from_print_euclid: + jmp b1 + // print_euclid::@1 + b1: + // [23] call print_char + // [50] phi from print_euclid::@1 to print_char [phi:print_euclid::@1->print_char] + print_char_from_b1: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_euclid::@1->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) ' ' [phi:print_euclid::@1->print_char#1] -- vbuz1=vbuc1 + lda #' ' + sta print_char.ch + jsr print_char + jmp b2 + // print_euclid::@2 + b2: + // [24] (byte) print_byte::b#1 ← (byte) print_euclid::b#10 -- vbuz1=vbuz2 + lda b + sta print_byte.b + // [25] call print_byte + // [42] phi from print_euclid::@2 to print_byte [phi:print_euclid::@2->print_byte] + print_byte_from_b2: + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#32 [phi:print_euclid::@2->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#1 [phi:print_euclid::@2->print_byte#1] -- register_copy + jsr print_byte + // [26] phi from print_euclid::@2 to print_euclid::@3 [phi:print_euclid::@2->print_euclid::@3] + b3_from_b2: + jmp b3 + // print_euclid::@3 + b3: + // [27] call print_char + // [50] phi from print_euclid::@3 to print_char [phi:print_euclid::@3->print_char] + print_char_from_b3: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_euclid::@3->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) ' ' [phi:print_euclid::@3->print_char#1] -- vbuz1=vbuc1 + lda #' ' + sta print_char.ch + jsr print_char + jmp b4 + // print_euclid::@4 + b4: + // [28] (byte) euclid::a#0 ← (byte) print_euclid::a#10 -- vbuz1=vbuz2 + lda a + sta euclid.a + // [29] (byte) euclid::b#0 ← (byte) print_euclid::b#10 -- vbuz1=vbuz2 + lda b + sta euclid.b + // [30] call euclid + // [54] phi from print_euclid::@4 to euclid [phi:print_euclid::@4->euclid] + euclid_from_b4: + jsr euclid + // [31] (byte) euclid::return#0 ← (byte) euclid::a#2 -- vbuz1=vbuz2 + lda euclid.a + sta euclid.return + jmp b5 + // print_euclid::@5 + b5: + // [32] (byte) print_byte::b#2 ← (byte) euclid::return#0 -- vbuz1=vbuz2 + lda euclid.return + sta print_byte.b + // [33] call print_byte + // [42] phi from print_euclid::@5 to print_byte [phi:print_euclid::@5->print_byte] + print_byte_from_b5: + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#32 [phi:print_euclid::@5->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#2 [phi:print_euclid::@5->print_byte#1] -- register_copy + jsr print_byte + // [34] phi from print_euclid::@5 to print_euclid::@6 [phi:print_euclid::@5->print_euclid::@6] + b6_from_b5: + jmp b6 + // print_euclid::@6 + b6: + // [35] call print_ln + // [37] phi from print_euclid::@6 to print_ln [phi:print_euclid::@6->print_ln] + print_ln_from_b6: + jsr print_ln + jmp breturn + // print_euclid::@return + breturn: + // [36] return + rts +} + // print_ln +// Print a newline +print_ln: { + // [38] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + b1_from_print_ln: + b1_from_b1: + // [38] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#33 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + jmp b1 + // print_ln::@1 + b1: + // [39] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#16 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc print_line_cursor + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + // [40] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#32) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1 + lda print_line_cursor+1 + cmp print_char_cursor+1 + bcc b1_from_b1 + bne !+ + lda print_line_cursor + cmp print_char_cursor + bcc b1_from_b1 + !: + jmp breturn + // print_ln::@return + breturn: + // [41] return + rts +} + // print_byte +// Print a byte as HEX +// print_byte(byte zeropage(6) b) +print_byte: { + .label _0 = $f + .label _2 = $10 + .label b = 6 + // [43] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte) 4 -- vbuz1=vbuz2_ror_4 + lda b + lsr + lsr + lsr + lsr + sta _0 + // [44] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy _0 + lda print_hextab,y + sta print_char.ch + // [45] call print_char + // [50] phi from print_byte to print_char [phi:print_byte->print_char] + print_char_from_print_byte: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#51 [phi:print_byte->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + jmp b1 + // print_byte::@1 + b1: + // [46] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f -- vbuz1=vbuz2_band_vbuc1 + lda #$f + and b + sta _2 + // [47] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy _2 + lda print_hextab,y + sta print_char.ch + // [48] call print_char + // [50] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + print_char_from_b1: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_byte::@1->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + jmp breturn + // print_byte::@return + breturn: + // [49] return + rts +} + // print_char +// Print a single char +// print_char(byte zeropage(7) ch) +print_char: { + .label ch = 7 + // [51] *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuz2 + lda ch + ldy #0 + sta (print_char_cursor),y + // [52] (byte*) print_char_cursor#32 ← ++ (byte*) print_char_cursor#31 -- pbuz1=_inc_pbuz1 + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + jmp breturn + // print_char::@return + breturn: + // [53] return + rts +} + // euclid +// euclid(byte zeropage($a) a, byte zeropage($b) b) +euclid: { + .label a = $a + .label b = $b + .label return = $e + // [55] phi from euclid euclid::@3 euclid::@4 to euclid::@1 [phi:euclid/euclid::@3/euclid::@4->euclid::@1] + b1_from_euclid: + b1_from_b3: + b1_from_b4: + // [55] phi (byte) euclid::b#2 = (byte) euclid::b#0 [phi:euclid/euclid::@3/euclid::@4->euclid::@1#0] -- register_copy + // [55] phi (byte) euclid::a#2 = (byte) euclid::a#0 [phi:euclid/euclid::@3/euclid::@4->euclid::@1#1] -- register_copy + jmp b1 + // euclid::@1 + b1: + // [56] if((byte) euclid::a#2!=(byte) euclid::b#2) goto euclid::@2 -- vbuz1_neq_vbuz2_then_la1 + lda a + cmp b + bne b2 + jmp breturn + // euclid::@return + breturn: + // [57] return + rts + // euclid::@2 + b2: + // [58] if((byte) euclid::a#2>(byte) euclid::b#2) goto euclid::@3 -- vbuz1_gt_vbuz2_then_la1 + lda b + cmp a + bcc b3 + jmp b4 + // euclid::@4 + b4: + // [59] (byte) euclid::b#1 ← (byte) euclid::b#2 - (byte) euclid::a#2 -- vbuz1=vbuz1_minus_vbuz2 + lda b + sec + sbc a + sta b + jmp b1_from_b4 + // euclid::@3 + b3: + // [60] (byte) euclid::a#1 ← (byte) euclid::a#2 - (byte) euclid::b#2 -- vbuz1=vbuz1_minus_vbuz2 + lda a + sec + sbc b + sta a + jmp b1_from_b3 +} + // print_cls +// Clear the screen. Also resets current line/char cursor. +print_cls: { + // [62] call memset + // [64] phi from print_cls to memset [phi:print_cls->memset] + memset_from_print_cls: + jsr memset + jmp breturn + // print_cls::@return + breturn: + // [63] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = $400 + .label end = str+num + .label dst = $c + // [65] phi from memset to memset::@1 [phi:memset->memset::@1] + b1_from_memset: + // [65] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 + lda #str + sta dst+1 + jmp b1 + // [65] phi from memset::@1 to memset::@1 [phi:memset::@1->memset::@1] + b1_from_b1: + // [65] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@1->memset::@1#0] -- register_copy + jmp b1 + // memset::@1 + b1: + // [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1 + lda #c + ldy #0 + sta (dst),y + // [67] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + // [68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuc1_then_la1 + lda dst+1 + cmp #>end + bne b1_from_b1 + lda dst + cmp #> (byte) 4 [ print_byte::b#3 print_char_cursor#51 print_byte::$0 ] ( main:2::print_euclid:7::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:9::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:11::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:13::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:15::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:17::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:7::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:9::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:11::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:13::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:15::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:17::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:7::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:9::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:11::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:13::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:15::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:17::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ print_euclid::a#10 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ print_euclid::b#10 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] +Statement [46] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f [ print_char_cursor#32 print_byte::$2 ] ( main:2::print_euclid:7::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:9::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:11::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:13::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:15::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:17::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:7::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:9::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:11::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:13::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:15::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:17::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:7::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:9::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:11::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:13::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:15::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:17::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] ) always clobbers reg byte a +Statement [51] *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 [ print_char_cursor#31 ] ( main:2::print_euclid:7::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] ) always clobbers reg byte y +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ print_euclid::a#10 ] +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ print_euclid::b#10 ] +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] +Statement [59] (byte) euclid::b#1 ← (byte) euclid::b#2 - (byte) euclid::a#2 [ euclid::a#2 euclid::b#1 ] ( main:2::print_euclid:7::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:9::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:11::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:13::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:15::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:17::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] +Statement [60] (byte) euclid::a#1 ← (byte) euclid::a#2 - (byte) euclid::b#2 [ euclid::b#2 euclid::a#1 ] ( main:2::print_euclid:7::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:9::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:11::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:13::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:15::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:17::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ euclid::b#2 euclid::b#0 euclid::b#1 ] +Statement [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:62 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y +Statement [68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 [ memset::dst#1 ] ( main:2::print_cls:5::memset:62 [ memset::dst#1 ] ) always clobbers reg byte a +Statement [8] (byte*~) print_char_cursor#64 ← (byte*) print_line_cursor#1 [ print_char_cursor#64 print_line_cursor#1 ] ( main:2 [ print_char_cursor#64 print_line_cursor#1 ] ) always clobbers reg byte a +Statement [10] (byte*~) print_char_cursor#65 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#65 ] ( main:2 [ print_line_cursor#1 print_char_cursor#65 ] ) always clobbers reg byte a +Statement [12] (byte*~) print_char_cursor#66 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#66 ] ( main:2 [ print_line_cursor#1 print_char_cursor#66 ] ) always clobbers reg byte a +Statement [14] (byte*~) print_char_cursor#67 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#67 ] ( main:2 [ print_line_cursor#1 print_char_cursor#67 ] ) always clobbers reg byte a +Statement [16] (byte*~) print_char_cursor#68 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#68 ] ( main:2 [ print_line_cursor#1 print_char_cursor#68 ] ) always clobbers reg byte a +Statement [39] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#16 + (byte) $28 [ print_line_cursor#1 print_char_cursor#32 ] ( main:2::print_euclid:7::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:9::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:11::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:13::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:15::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:17::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] ) always clobbers reg byte a +Statement [40] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#1 print_char_cursor#32 ] ( main:2::print_euclid:7::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:9::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:11::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:13::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:15::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] main:2::print_euclid:17::print_ln:35 [ print_line_cursor#1 print_char_cursor#32 ] ) always clobbers reg byte a +Statement [43] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte) 4 [ print_byte::b#3 print_char_cursor#51 print_byte::$0 ] ( main:2::print_euclid:7::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:9::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:11::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:13::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:15::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:17::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:7::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:9::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:11::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:13::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:15::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:17::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:7::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:9::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:11::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:13::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:15::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] main:2::print_euclid:17::print_byte:33 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#51 print_byte::$0 ] ) always clobbers reg byte a +Statement [46] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f [ print_char_cursor#32 print_byte::$2 ] ( main:2::print_euclid:7::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:9::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:11::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:13::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:15::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:17::print_byte:21 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:7::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:9::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:11::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:13::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:15::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:17::print_byte:25 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:7::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:9::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:11::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:13::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:15::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] main:2::print_euclid:17::print_byte:33 [ print_line_cursor#33 print_char_cursor#32 print_byte::$2 ] ) always clobbers reg byte a +Statement [51] *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 [ print_char_cursor#31 ] ( main:2::print_euclid:7::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_char:23 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_char:27 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:21::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:25::print_char:45 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:33::print_char:45 [ print_line_cursor#33 print_byte::b#3 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:21::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:25::print_char:48 [ print_euclid::a#10 print_euclid::b#10 print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:7::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:9::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:11::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:13::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:15::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] main:2::print_euclid:17::print_byte:33::print_char:48 [ print_line_cursor#33 print_char_cursor#31 ] ) always clobbers reg byte y +Statement [59] (byte) euclid::b#1 ← (byte) euclid::b#2 - (byte) euclid::a#2 [ euclid::a#2 euclid::b#1 ] ( main:2::print_euclid:7::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:9::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:11::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:13::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:15::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] main:2::print_euclid:17::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::a#2 euclid::b#1 ] ) always clobbers reg byte a +Statement [60] (byte) euclid::a#1 ← (byte) euclid::a#2 - (byte) euclid::b#2 [ euclid::b#2 euclid::a#1 ] ( main:2::print_euclid:7::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:9::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:11::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:13::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:15::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] main:2::print_euclid:17::euclid:30 [ print_line_cursor#33 print_char_cursor#32 euclid::b#2 euclid::a#1 ] ) always clobbers reg byte a +Statement [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:62 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y +Statement [68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 [ memset::dst#1 ] ( main:2::print_cls:5::memset:62 [ memset::dst#1 ] ) always clobbers reg byte a +Potential registers zp ZP_BYTE:2 [ print_euclid::a#10 ] : zp ZP_BYTE:2 , reg byte x , +Potential registers zp ZP_BYTE:3 [ print_euclid::b#10 ] : zp ZP_BYTE:3 , reg byte x , +Potential registers zp ZP_WORD:4 [ print_line_cursor#16 print_line_cursor#33 print_line_cursor#1 ] : zp ZP_WORD:4 , +Potential registers zp ZP_BYTE:6 [ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] : zp ZP_BYTE:6 , reg byte x , +Potential registers zp ZP_BYTE:7 [ print_char::ch#4 print_char::ch#0 print_char::ch#1 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:8 [ print_char_cursor#31 print_char_cursor#51 print_char_cursor#53 print_char_cursor#64 print_char_cursor#65 print_char_cursor#66 print_char_cursor#67 print_char_cursor#68 print_char_cursor#32 ] : zp ZP_WORD:8 , +Potential registers zp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] : zp ZP_BYTE:10 , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:11 [ euclid::b#2 euclid::b#0 euclid::b#1 ] : zp ZP_BYTE:11 , reg byte x , reg byte y , +Potential registers zp ZP_WORD:12 [ memset::dst#2 memset::dst#1 ] : zp ZP_WORD:12 , +Potential registers zp ZP_BYTE:14 [ euclid::return#0 ] : zp ZP_BYTE:14 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:15 [ print_byte::$0 ] : zp ZP_BYTE:15 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:16 [ print_byte::$2 ] : zp ZP_BYTE:16 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [euclid] 43.75: zp ZP_BYTE:11 [ euclid::b#2 euclid::b#0 euclid::b#1 ] 36.83: zp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] 4: zp ZP_BYTE:14 [ euclid::return#0 ] +Uplift Scope [] 35.59: zp ZP_WORD:8 [ print_char_cursor#31 print_char_cursor#51 print_char_cursor#53 print_char_cursor#64 print_char_cursor#65 print_char_cursor#66 print_char_cursor#67 print_char_cursor#68 print_char_cursor#32 ] 28.24: zp ZP_WORD:4 [ print_line_cursor#16 print_line_cursor#33 print_line_cursor#1 ] +Uplift Scope [memset] 33: zp ZP_WORD:12 [ memset::dst#2 memset::dst#1 ] +Uplift Scope [print_byte] 14.5: zp ZP_BYTE:6 [ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] 4: zp ZP_BYTE:15 [ print_byte::$0 ] 4: zp ZP_BYTE:16 [ print_byte::$2 ] +Uplift Scope [print_char] 14: zp ZP_BYTE:7 [ print_char::ch#4 print_char::ch#0 print_char::ch#1 ] +Uplift Scope [print_euclid] 0.44: zp ZP_BYTE:2 [ print_euclid::a#10 ] 0.4: zp ZP_BYTE:3 [ print_euclid::b#10 ] +Uplift Scope [RADIX] +Uplift Scope [print_ln] +Uplift Scope [print_cls] +Uplift Scope [main] + +Uplifting [euclid] best 1923 combination reg byte x [ euclid::b#2 euclid::b#0 euclid::b#1 ] zp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] reg byte a [ euclid::return#0 ] +Uplifting [] best 1923 combination zp ZP_WORD:8 [ print_char_cursor#31 print_char_cursor#51 print_char_cursor#53 print_char_cursor#64 print_char_cursor#65 print_char_cursor#66 print_char_cursor#67 print_char_cursor#68 print_char_cursor#32 ] zp ZP_WORD:4 [ print_line_cursor#16 print_line_cursor#33 print_line_cursor#1 ] +Uplifting [memset] best 1923 combination zp ZP_WORD:12 [ memset::dst#2 memset::dst#1 ] +Uplifting [print_byte] best 1904 combination reg byte x [ print_byte::b#3 print_byte::b#0 print_byte::b#1 print_byte::b#2 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] +Uplifting [print_char] best 1889 combination reg byte a [ print_char::ch#4 print_char::ch#0 print_char::ch#1 ] +Uplifting [print_euclid] best 1889 combination zp ZP_BYTE:2 [ print_euclid::a#10 ] zp ZP_BYTE:3 [ print_euclid::b#10 ] +Uplifting [RADIX] best 1889 combination +Uplifting [print_ln] best 1889 combination +Uplifting [print_cls] best 1889 combination +Uplifting [main] best 1889 combination +Attempting to uplift remaining variables inzp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] +Uplifting [euclid] best 1889 combination zp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:2 [ print_euclid::a#10 ] +Uplifting [print_euclid] best 1889 combination zp ZP_BYTE:2 [ print_euclid::a#10 ] +Attempting to uplift remaining variables inzp ZP_BYTE:3 [ print_euclid::b#10 ] +Uplifting [print_euclid] best 1889 combination zp ZP_BYTE:3 [ print_euclid::b#10 ] +Coalescing zero page register with common assignment [ zp ZP_BYTE:2 [ print_euclid::a#10 ] ] with [ zp ZP_BYTE:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] ] - score: 1 +Allocated (was zp ZP_WORD:8) zp ZP_WORD:6 [ print_char_cursor#31 print_char_cursor#51 print_char_cursor#53 print_char_cursor#64 print_char_cursor#65 print_char_cursor#66 print_char_cursor#67 print_char_cursor#68 print_char_cursor#32 ] +Allocated (was zp ZP_WORD:12) zp ZP_WORD:8 [ memset::dst#2 memset::dst#1 ] + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +/* + * Find least common denominator using subtraction-based Euclidian algorithm + * See https://en.wikipedia.org/wiki/Euclidean_algorithm + * Based on facebook post from + */ + // Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" + // Global Constants & labels + .label print_line_cursor = 4 + .label print_char_cursor = 6 + // @begin +bbegin: + // [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 + // @1 +b1: + // [2] call main + // [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main + // [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend + // @end +bend: + // main +main: { + // [5] call print_cls + // [61] phi from main to print_cls [phi:main->print_cls] + print_cls_from_main: + jsr print_cls + // [6] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + jmp b1 + // main::@1 + b1: + // [7] call print_euclid + // [19] phi from main::@1 to print_euclid [phi:main::@1->print_euclid] + print_euclid_from_b1: + // [19] phi (byte*) print_line_cursor#33 = (byte*) 1024 [phi:main::@1->print_euclid#0] -- pbuz1=pbuc1 + lda #<$400 + sta print_line_cursor + lda #>$400 + sta print_line_cursor+1 + // [19] phi (byte) print_euclid::b#10 = (byte) 2 [phi:main::@1->print_euclid#1] -- vbuz1=vbuc1 + lda #2 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*) 1024 [phi:main::@1->print_euclid#2] -- pbuz1=pbuc1 + lda #<$400 + sta print_char_cursor + lda #>$400 + sta print_char_cursor+1 + // [19] phi (byte) print_euclid::a#10 = (byte) $80 [phi:main::@1->print_euclid#3] -- vbuz1=vbuc1 + lda #$80 + sta print_euclid.a + jsr print_euclid + jmp b2 + // main::@2 + b2: + // [8] (byte*~) print_char_cursor#64 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [9] call print_euclid + // [19] phi from main::@2 to print_euclid [phi:main::@2->print_euclid] + print_euclid_from_b2: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@2->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $45 [phi:main::@2->print_euclid#1] -- vbuz1=vbuc1 + lda #$45 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#64 [phi:main::@2->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $a9 [phi:main::@2->print_euclid#3] -- vbuz1=vbuc1 + lda #$a9 + sta print_euclid.a + jsr print_euclid + jmp b3 + // main::@3 + b3: + // [10] (byte*~) print_char_cursor#65 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [11] call print_euclid + // [19] phi from main::@3 to print_euclid [phi:main::@3->print_euclid] + print_euclid_from_b3: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@3->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $37 [phi:main::@3->print_euclid#1] -- vbuz1=vbuc1 + lda #$37 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#65 [phi:main::@3->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $9b [phi:main::@3->print_euclid#3] -- vbuz1=vbuc1 + lda #$9b + sta print_euclid.a + jsr print_euclid + jmp b4 + // main::@4 + b4: + // [12] (byte*~) print_char_cursor#66 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [13] call print_euclid + // [19] phi from main::@4 to print_euclid [phi:main::@4->print_euclid] + print_euclid_from_b4: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@4->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) 3 [phi:main::@4->print_euclid#1] -- vbuz1=vbuc1 + lda #3 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#66 [phi:main::@4->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $c7 [phi:main::@4->print_euclid#3] -- vbuz1=vbuc1 + lda #$c7 + sta print_euclid.a + jsr print_euclid + jmp b5 + // main::@5 + b5: + // [14] (byte*~) print_char_cursor#67 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [15] call print_euclid + // [19] phi from main::@5 to print_euclid [phi:main::@5->print_euclid] + print_euclid_from_b5: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@5->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $1a [phi:main::@5->print_euclid#1] -- vbuz1=vbuc1 + lda #$1a + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#67 [phi:main::@5->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $5b [phi:main::@5->print_euclid#3] -- vbuz1=vbuc1 + lda #$5b + sta print_euclid.a + jsr print_euclid + jmp b6 + // main::@6 + b6: + // [16] (byte*~) print_char_cursor#68 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // [17] call print_euclid + // [19] phi from main::@6 to print_euclid [phi:main::@6->print_euclid] + print_euclid_from_b6: + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@6->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $bb [phi:main::@6->print_euclid#1] -- vbuz1=vbuc1 + lda #$bb + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#68 [phi:main::@6->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $77 [phi:main::@6->print_euclid#3] -- vbuz1=vbuc1 + lda #$77 + sta print_euclid.a + jsr print_euclid + jmp breturn + // main::@return + breturn: + // [18] return + rts +} + // print_euclid +// print_euclid(byte zeropage(2) a, byte zeropage(3) b) +print_euclid: { + .label b = 3 + .label a = 2 + // [20] (byte) print_byte::b#0 ← (byte) print_euclid::a#10 -- vbuxx=vbuz1 + ldx a + // [21] call print_byte + // [42] phi from print_euclid to print_byte [phi:print_euclid->print_byte] + print_byte_from_print_euclid: + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#53 [phi:print_euclid->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#0 [phi:print_euclid->print_byte#1] -- register_copy + jsr print_byte + // [22] phi from print_euclid to print_euclid::@1 [phi:print_euclid->print_euclid::@1] + b1_from_print_euclid: + jmp b1 + // print_euclid::@1 + b1: + // [23] call print_char + // [50] phi from print_euclid::@1 to print_char [phi:print_euclid::@1->print_char] + print_char_from_b1: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_euclid::@1->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) ' ' [phi:print_euclid::@1->print_char#1] -- vbuaa=vbuc1 + lda #' ' + jsr print_char + jmp b2 + // print_euclid::@2 + b2: + // [24] (byte) print_byte::b#1 ← (byte) print_euclid::b#10 -- vbuxx=vbuz1 + ldx b + // [25] call print_byte + // [42] phi from print_euclid::@2 to print_byte [phi:print_euclid::@2->print_byte] + print_byte_from_b2: + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#32 [phi:print_euclid::@2->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#1 [phi:print_euclid::@2->print_byte#1] -- register_copy + jsr print_byte + // [26] phi from print_euclid::@2 to print_euclid::@3 [phi:print_euclid::@2->print_euclid::@3] + b3_from_b2: + jmp b3 + // print_euclid::@3 + b3: + // [27] call print_char + // [50] phi from print_euclid::@3 to print_char [phi:print_euclid::@3->print_char] + print_char_from_b3: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_euclid::@3->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) ' ' [phi:print_euclid::@3->print_char#1] -- vbuaa=vbuc1 + lda #' ' + jsr print_char + jmp b4 + // print_euclid::@4 + b4: + // [28] (byte) euclid::a#0 ← (byte) print_euclid::a#10 + // [29] (byte) euclid::b#0 ← (byte) print_euclid::b#10 -- vbuxx=vbuz1 + ldx b + // [30] call euclid + // [54] phi from print_euclid::@4 to euclid [phi:print_euclid::@4->euclid] + euclid_from_b4: + jsr euclid + // [31] (byte) euclid::return#0 ← (byte) euclid::a#2 -- vbuaa=vbuz1 + lda euclid.a + jmp b5 + // print_euclid::@5 + b5: + // [32] (byte) print_byte::b#2 ← (byte) euclid::return#0 -- vbuxx=vbuaa + tax + // [33] call print_byte + // [42] phi from print_euclid::@5 to print_byte [phi:print_euclid::@5->print_byte] + print_byte_from_b5: + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#32 [phi:print_euclid::@5->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#2 [phi:print_euclid::@5->print_byte#1] -- register_copy + jsr print_byte + // [34] phi from print_euclid::@5 to print_euclid::@6 [phi:print_euclid::@5->print_euclid::@6] + b6_from_b5: + jmp b6 + // print_euclid::@6 + b6: + // [35] call print_ln + // [37] phi from print_euclid::@6 to print_ln [phi:print_euclid::@6->print_ln] + print_ln_from_b6: + jsr print_ln + jmp breturn + // print_euclid::@return + breturn: + // [36] return + rts +} + // print_ln +// Print a newline +print_ln: { + // [38] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + b1_from_print_ln: + b1_from_b1: + // [38] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#33 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + jmp b1 + // print_ln::@1 + b1: + // [39] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#16 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc print_line_cursor + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + // [40] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#32) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1 + lda print_line_cursor+1 + cmp print_char_cursor+1 + bcc b1_from_b1 + bne !+ + lda print_line_cursor + cmp print_char_cursor + bcc b1_from_b1 + !: + jmp breturn + // print_ln::@return + breturn: + // [41] return + rts +} + // print_byte +// Print a byte as HEX +// print_byte(byte register(X) b) +print_byte: { + // [43] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte) 4 -- vbuaa=vbuxx_ror_4 + txa + lsr + lsr + lsr + lsr + // [44] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa + tay + lda print_hextab,y + // [45] call print_char + // [50] phi from print_byte to print_char [phi:print_byte->print_char] + print_char_from_print_byte: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#51 [phi:print_byte->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + jmp b1 + // print_byte::@1 + b1: + // [46] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f -- vbuxx=vbuxx_band_vbuc1 + lda #$f + axs #0 + // [47] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuxx + lda print_hextab,x + // [48] call print_char + // [50] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + print_char_from_b1: + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_byte::@1->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + jmp breturn + // print_byte::@return + breturn: + // [49] return + rts +} + // print_char +// Print a single char +// print_char(byte register(A) ch) +print_char: { + // [51] *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa + ldy #0 + sta (print_char_cursor),y + // [52] (byte*) print_char_cursor#32 ← ++ (byte*) print_char_cursor#31 -- pbuz1=_inc_pbuz1 + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + jmp breturn + // print_char::@return + breturn: + // [53] return + rts +} + // euclid +// euclid(byte zeropage(2) a, byte register(X) b) +euclid: { + .label a = 2 + // [55] phi from euclid euclid::@3 euclid::@4 to euclid::@1 [phi:euclid/euclid::@3/euclid::@4->euclid::@1] + b1_from_euclid: + b1_from_b3: + b1_from_b4: + // [55] phi (byte) euclid::b#2 = (byte) euclid::b#0 [phi:euclid/euclid::@3/euclid::@4->euclid::@1#0] -- register_copy + // [55] phi (byte) euclid::a#2 = (byte) euclid::a#0 [phi:euclid/euclid::@3/euclid::@4->euclid::@1#1] -- register_copy + jmp b1 + // euclid::@1 + b1: + // [56] if((byte) euclid::a#2!=(byte) euclid::b#2) goto euclid::@2 -- vbuz1_neq_vbuxx_then_la1 + cpx a + bne b2 + jmp breturn + // euclid::@return + breturn: + // [57] return + rts + // euclid::@2 + b2: + // [58] if((byte) euclid::a#2>(byte) euclid::b#2) goto euclid::@3 -- vbuz1_gt_vbuxx_then_la1 + cpx a + bcc b3 + jmp b4 + // euclid::@4 + b4: + // [59] (byte) euclid::b#1 ← (byte) euclid::b#2 - (byte) euclid::a#2 -- vbuxx=vbuxx_minus_vbuz1 + txa + sec + sbc a + tax + jmp b1_from_b4 + // euclid::@3 + b3: + // [60] (byte) euclid::a#1 ← (byte) euclid::a#2 - (byte) euclid::b#2 -- vbuz1=vbuz1_minus_vbuxx + txa + eor #$ff + sec + adc a + sta a + jmp b1_from_b3 +} + // print_cls +// Clear the screen. Also resets current line/char cursor. +print_cls: { + // [62] call memset + // [64] phi from print_cls to memset [phi:print_cls->memset] + memset_from_print_cls: + jsr memset + jmp breturn + // print_cls::@return + breturn: + // [63] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = $400 + .label end = str+num + .label dst = 8 + // [65] phi from memset to memset::@1 [phi:memset->memset::@1] + b1_from_memset: + // [65] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 + lda #str + sta dst+1 + jmp b1 + // [65] phi from memset::@1 to memset::@1 [phi:memset::@1->memset::@1] + b1_from_b1: + // [65] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@1->memset::@1#0] -- register_copy + jmp b1 + // memset::@1 + b1: + // [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1 + lda #c + ldy #0 + sta (dst),y + // [67] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + // [68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuc1_then_la1 + lda dst+1 + cmp #>end + bne b1_from_b1 + lda dst + cmp #@1] + // @1 + // [2] call main + // [4] phi from @1 to main [phi:@1->main] + // [3] phi from @1 to @end [phi:@1->@end] + // @end + // main +main: { + // print_cls() + // [5] call print_cls + // [61] phi from main to print_cls [phi:main->print_cls] + jsr print_cls + // [6] phi from main to main::@1 [phi:main->main::@1] + // main::@1 + // print_euclid(128,2) + // [7] call print_euclid + // [19] phi from main::@1 to print_euclid [phi:main::@1->print_euclid] + // [19] phi (byte*) print_line_cursor#33 = (byte*) 1024 [phi:main::@1->print_euclid#0] -- pbuz1=pbuc1 + lda #<$400 + sta print_line_cursor + lda #>$400 + sta print_line_cursor+1 + // [19] phi (byte) print_euclid::b#10 = (byte) 2 [phi:main::@1->print_euclid#1] -- vbuz1=vbuc1 + lda #2 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*) 1024 [phi:main::@1->print_euclid#2] -- pbuz1=pbuc1 + lda #<$400 + sta print_char_cursor + lda #>$400 + sta print_char_cursor+1 + // [19] phi (byte) print_euclid::a#10 = (byte) $80 [phi:main::@1->print_euclid#3] -- vbuz1=vbuc1 + lda #$80 + sta print_euclid.a + jsr print_euclid + // main::@2 + // [8] (byte*~) print_char_cursor#64 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // print_euclid(169,69) + // [9] call print_euclid + // [19] phi from main::@2 to print_euclid [phi:main::@2->print_euclid] + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@2->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $45 [phi:main::@2->print_euclid#1] -- vbuz1=vbuc1 + lda #$45 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#64 [phi:main::@2->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $a9 [phi:main::@2->print_euclid#3] -- vbuz1=vbuc1 + lda #$a9 + sta print_euclid.a + jsr print_euclid + // main::@3 + // [10] (byte*~) print_char_cursor#65 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // print_euclid(155,55) + // [11] call print_euclid + // [19] phi from main::@3 to print_euclid [phi:main::@3->print_euclid] + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@3->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $37 [phi:main::@3->print_euclid#1] -- vbuz1=vbuc1 + lda #$37 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#65 [phi:main::@3->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $9b [phi:main::@3->print_euclid#3] -- vbuz1=vbuc1 + lda #$9b + sta print_euclid.a + jsr print_euclid + // main::@4 + // [12] (byte*~) print_char_cursor#66 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // print_euclid(199,3) + // [13] call print_euclid + // [19] phi from main::@4 to print_euclid [phi:main::@4->print_euclid] + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@4->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) 3 [phi:main::@4->print_euclid#1] -- vbuz1=vbuc1 + lda #3 + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#66 [phi:main::@4->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $c7 [phi:main::@4->print_euclid#3] -- vbuz1=vbuc1 + lda #$c7 + sta print_euclid.a + jsr print_euclid + // main::@5 + // [14] (byte*~) print_char_cursor#67 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // print_euclid(91,26) + // [15] call print_euclid + // [19] phi from main::@5 to print_euclid [phi:main::@5->print_euclid] + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@5->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $1a [phi:main::@5->print_euclid#1] -- vbuz1=vbuc1 + lda #$1a + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#67 [phi:main::@5->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $5b [phi:main::@5->print_euclid#3] -- vbuz1=vbuc1 + lda #$5b + sta print_euclid.a + jsr print_euclid + // main::@6 + // [16] (byte*~) print_char_cursor#68 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + // print_euclid(119,187) + // [17] call print_euclid + // [19] phi from main::@6 to print_euclid [phi:main::@6->print_euclid] + // [19] phi (byte*) print_line_cursor#33 = (byte*) print_line_cursor#1 [phi:main::@6->print_euclid#0] -- register_copy + // [19] phi (byte) print_euclid::b#10 = (byte) $bb [phi:main::@6->print_euclid#1] -- vbuz1=vbuc1 + lda #$bb + sta print_euclid.b + // [19] phi (byte*) print_char_cursor#53 = (byte*~) print_char_cursor#68 [phi:main::@6->print_euclid#2] -- register_copy + // [19] phi (byte) print_euclid::a#10 = (byte) $77 [phi:main::@6->print_euclid#3] -- vbuz1=vbuc1 + lda #$77 + sta print_euclid.a + jsr print_euclid + // main::@return + // } + // [18] return + rts +} + // print_euclid +// print_euclid(byte zeropage(2) a, byte zeropage(3) b) +print_euclid: { + .label b = 3 + .label a = 2 + // print_byte(a) + // [20] (byte) print_byte::b#0 ← (byte) print_euclid::a#10 -- vbuxx=vbuz1 + ldx a + // [21] call print_byte + // [42] phi from print_euclid to print_byte [phi:print_euclid->print_byte] + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#53 [phi:print_euclid->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#0 [phi:print_euclid->print_byte#1] -- register_copy + jsr print_byte + // [22] phi from print_euclid to print_euclid::@1 [phi:print_euclid->print_euclid::@1] + // print_euclid::@1 + // print_char(' ') + // [23] call print_char + // [50] phi from print_euclid::@1 to print_char [phi:print_euclid::@1->print_char] + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_euclid::@1->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) ' ' [phi:print_euclid::@1->print_char#1] -- vbuaa=vbuc1 + lda #' ' + jsr print_char + // print_euclid::@2 + // print_byte(b) + // [24] (byte) print_byte::b#1 ← (byte) print_euclid::b#10 -- vbuxx=vbuz1 + ldx b + // [25] call print_byte + // [42] phi from print_euclid::@2 to print_byte [phi:print_euclid::@2->print_byte] + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#32 [phi:print_euclid::@2->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#1 [phi:print_euclid::@2->print_byte#1] -- register_copy + jsr print_byte + // [26] phi from print_euclid::@2 to print_euclid::@3 [phi:print_euclid::@2->print_euclid::@3] + // print_euclid::@3 + // print_char(' ') + // [27] call print_char + // [50] phi from print_euclid::@3 to print_char [phi:print_euclid::@3->print_char] + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_euclid::@3->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) ' ' [phi:print_euclid::@3->print_char#1] -- vbuaa=vbuc1 + lda #' ' + jsr print_char + // print_euclid::@4 + // euclid(a,b) + // [28] (byte) euclid::a#0 ← (byte) print_euclid::a#10 + // [29] (byte) euclid::b#0 ← (byte) print_euclid::b#10 -- vbuxx=vbuz1 + ldx b + // [30] call euclid + // [54] phi from print_euclid::@4 to euclid [phi:print_euclid::@4->euclid] + jsr euclid + // euclid(a,b) + // [31] (byte) euclid::return#0 ← (byte) euclid::a#2 -- vbuaa=vbuz1 + lda euclid.a + // print_euclid::@5 + // print_byte(euclid(a,b)) + // [32] (byte) print_byte::b#2 ← (byte) euclid::return#0 -- vbuxx=vbuaa + tax + // [33] call print_byte + // [42] phi from print_euclid::@5 to print_byte [phi:print_euclid::@5->print_byte] + // [42] phi (byte*) print_char_cursor#51 = (byte*) print_char_cursor#32 [phi:print_euclid::@5->print_byte#0] -- register_copy + // [42] phi (byte) print_byte::b#3 = (byte) print_byte::b#2 [phi:print_euclid::@5->print_byte#1] -- register_copy + jsr print_byte + // [34] phi from print_euclid::@5 to print_euclid::@6 [phi:print_euclid::@5->print_euclid::@6] + // print_euclid::@6 + // print_ln() + // [35] call print_ln + // [37] phi from print_euclid::@6 to print_ln [phi:print_euclid::@6->print_ln] + jsr print_ln + // print_euclid::@return + // } + // [36] return + rts +} + // print_ln +// Print a newline +print_ln: { + // [38] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + // [38] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#33 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + // print_ln::@1 + b1: + // print_line_cursor + $28 + // [39] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#16 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc print_line_cursor + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + // while (print_line_cursor>4 + // [43] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte) 4 -- vbuaa=vbuxx_ror_4 + txa + lsr + lsr + lsr + lsr + // print_char(print_hextab[b>>4]) + // [44] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa + tay + lda print_hextab,y + // [45] call print_char + // [50] phi from print_byte to print_char [phi:print_byte->print_char] + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#51 [phi:print_byte->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + // print_byte::@1 + // b&$f + // [46] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f -- vbuxx=vbuxx_band_vbuc1 + lda #$f + axs #0 + // print_char(print_hextab[b&$f]) + // [47] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuxx + lda print_hextab,x + // [48] call print_char + // [50] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + // [50] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#32 [phi:print_byte::@1->print_char#0] -- register_copy + // [50] phi (byte) print_char::ch#4 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + // print_byte::@return + // } + // [49] return + rts +} + // print_char +// Print a single char +// print_char(byte register(A) ch) +print_char: { + // *(print_char_cursor++) = ch + // [51] *((byte*) print_char_cursor#31) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa + ldy #0 + sta (print_char_cursor),y + // *(print_char_cursor++) = ch; + // [52] (byte*) print_char_cursor#32 ← ++ (byte*) print_char_cursor#31 -- pbuz1=_inc_pbuz1 + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + // print_char::@return + // } + // [53] return + rts +} + // euclid +// euclid(byte zeropage(2) a, byte register(X) b) +euclid: { + .label a = 2 + // [55] phi from euclid euclid::@3 euclid::@4 to euclid::@1 [phi:euclid/euclid::@3/euclid::@4->euclid::@1] + // [55] phi (byte) euclid::b#2 = (byte) euclid::b#0 [phi:euclid/euclid::@3/euclid::@4->euclid::@1#0] -- register_copy + // [55] phi (byte) euclid::a#2 = (byte) euclid::a#0 [phi:euclid/euclid::@3/euclid::@4->euclid::@1#1] -- register_copy + // euclid::@1 + b1: + // while (a!=b) + // [56] if((byte) euclid::a#2!=(byte) euclid::b#2) goto euclid::@2 -- vbuz1_neq_vbuxx_then_la1 + cpx a + bne b2 + // euclid::@return + // } + // [57] return + rts + // euclid::@2 + b2: + // if(a>b) + // [58] if((byte) euclid::a#2>(byte) euclid::b#2) goto euclid::@3 -- vbuz1_gt_vbuxx_then_la1 + cpx a + bcc b3 + // euclid::@4 + // b=b-a + // [59] (byte) euclid::b#1 ← (byte) euclid::b#2 - (byte) euclid::a#2 -- vbuxx=vbuxx_minus_vbuz1 + txa + sec + sbc a + tax + jmp b1 + // euclid::@3 + b3: + // a=a-b + // [60] (byte) euclid::a#1 ← (byte) euclid::a#2 - (byte) euclid::b#2 -- vbuz1=vbuz1_minus_vbuxx + txa + eor #$ff + sec + adc a + sta a + jmp b1 +} + // print_cls +// Clear the screen. Also resets current line/char cursor. +print_cls: { + // memset(print_screen, ' ', 1000) + // [62] call memset + // [64] phi from print_cls to memset [phi:print_cls->memset] + jsr memset + // print_cls::@return + // } + // [63] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = $400 + .label end = str+num + .label dst = 8 + // [65] phi from memset to memset::@1 [phi:memset->memset::@1] + // [65] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 + lda #str + sta dst+1 + // [65] phi from memset::@1 to memset::@1 [phi:memset::@1->memset::@1] + // [65] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@1->memset::@1#0] -- register_copy + // memset::@1 + b1: + // *dst = c + // [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1 + lda #c + ldy #0 + sta (dst),y + // for(char* dst = str; dst!=end; dst++) + // [67] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + // [68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuc1_then_la1 + lda dst+1 + cmp #>end + bne b1 + lda dst + cmp #159 && i<=351 ) { .byte round(((i-256)*(i-256))/256) } @@ -1264,26 +1265,26 @@ rotate_matrix::@return: scope:[rotate_matrix] from rotate_matrix (signed byte*~) $1 ← (signed byte[$140]) SINQ#0 + (number) $40 (signed byte*) COSQ#0 ← (signed byte*~) $1 call main - to:@50 -@50: scope:[] from @49 - (signed byte) sy#12 ← phi( @49/(signed byte) sy#1 ) - (signed byte) sx#12 ← phi( @49/(signed byte) sx#1 ) + to:@51 +@51: scope:[] from @50 + (signed byte) sy#12 ← phi( @50/(signed byte) sy#1 ) + (signed byte) sx#12 ← phi( @50/(signed byte) sx#1 ) (signed byte) sx#5 ← (signed byte) sx#12 (signed byte) sy#5 ← (signed byte) sy#12 to:@end -@end: scope:[] from @50 +@end: scope:[] from @51 SYMBOL TABLE SSA (signed byte*~) $0 (signed byte*~) $1 (const string) $6 = (string) "0123456789abcdef" (label) @16 -(label) @32 -(label) @39 +(label) @33 (label) @40 -(label) @44 -(label) @49 +(label) @41 +(label) @45 (label) @50 +(label) @51 (label) @begin (label) @end (byte*) BORDERCOL @@ -3463,11 +3464,11 @@ Added new block during phi lifting debug_print::@33(between debug_print::@32 and Added new block during phi lifting sprites_init::@3(between sprites_init::@1 and sprites_init::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @16 -Adding NOP phi() at start of @32 -Adding NOP phi() at start of @39 +Adding NOP phi() at start of @33 Adding NOP phi() at start of @40 -Adding NOP phi() at start of @44 -Adding NOP phi() at start of @50 +Adding NOP phi() at start of @41 +Adding NOP phi() at start of @45 +Adding NOP phi() at start of @51 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@2 Adding NOP phi() at start of main::@3 @@ -3575,11 +3576,11 @@ Coalesced [337] memset::dst#3 ← memset::dst#1 Coalesced [345] sprites_init::i#3 ← sprites_init::i#1 Coalesced down to 16 phi equivalence classes Culled Empty Block (label) @16 -Culled Empty Block (label) @32 -Culled Empty Block (label) @39 +Culled Empty Block (label) @33 Culled Empty Block (label) @40 -Culled Empty Block (label) @44 -Culled Empty Block (label) @50 +Culled Empty Block (label) @41 +Culled Empty Block (label) @45 +Culled Empty Block (label) @51 Culled Empty Block (label) main::@3 Culled Empty Block (label) anim::@28 Culled Empty Block (label) anim::@31 @@ -3610,7 +3611,7 @@ Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 Culled Empty Block (label) sprites_init::@3 -Renumbering block @49 to @1 +Renumbering block @50 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sbyte_at::@5 to print_sbyte_at::@4 Renumbering block anim::@4 to anim::@2 diff --git a/src/test/ref/examples/3d/perspective.log b/src/test/ref/examples/3d/perspective.log index cfe5f00da..498ebc075 100644 --- a/src/test/ref/examples/3d/perspective.log +++ b/src/test/ref/examples/3d/perspective.log @@ -51,14 +51,15 @@ Culled Empty Block (label) @28 Culled Empty Block (label) @29 Culled Empty Block (label) @30 Culled Empty Block (label) @31 -Culled Empty Block (label) @33 +Culled Empty Block (label) @32 Culled Empty Block (label) @34 Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 -Culled Empty Block (label) @40 +Culled Empty Block (label) @39 Culled Empty Block (label) @41 +Culled Empty Block (label) @42 Culled Empty Block (label) mulf_init::@2 CONTROL FLOW GRAPH SSA @@ -104,7 +105,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@32 + to:@33 print_str: scope:[print_str] from do_perspective do_perspective::@11 do_perspective::@2 do_perspective::@4 do_perspective::@6 do_perspective::@9 (byte*) print_char_cursor#74 ← phi( do_perspective/(byte*) print_char_cursor#71 do_perspective::@11/(byte*) print_char_cursor#28 do_perspective::@2/(byte*) print_char_cursor#20 do_perspective::@4/(byte*) print_char_cursor#22 do_perspective::@6/(byte*) print_char_cursor#24 do_perspective::@9/(byte*) print_char_cursor#26 ) (byte*) print_str::str#9 ← phi( do_perspective/(byte*) print_str::str#1 do_perspective::@11/(byte*) print_str::str#6 do_perspective::@2/(byte*) print_str::str#2 do_perspective::@4/(byte*) print_str::str#3 do_perspective::@6/(byte*) print_str::str#4 do_perspective::@9/(byte*) print_str::str#5 ) @@ -196,12 +197,12 @@ print_sbyte::@return: scope:[print_sbyte] from print_sbyte::@7 (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#40 return to:@return -@32: scope:[] from @16 +@33: scope:[] from @16 (byte*) print_screen#8 ← phi( @16/(byte*) print_screen#0 ) (byte*) print_char_cursor#79 ← phi( @16/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#30 ← phi( @16/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@39 + to:@40 print_byte: scope:[print_byte] from do_perspective::@10 do_perspective::@8 print_sbyte::@2 (byte*) print_char_cursor#69 ← phi( do_perspective::@10/(byte*) print_char_cursor#27 do_perspective::@8/(byte*) print_char_cursor#72 print_sbyte::@2/(byte*) print_char_cursor#68 ) (byte) print_byte::b#3 ← phi( do_perspective::@10/(byte) print_byte::b#2 do_perspective::@8/(byte) print_byte::b#1 print_sbyte::@2/(byte) print_byte::b#0 ) @@ -257,20 +258,20 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#46 return to:@return -@39: scope:[] from @32 - (byte*) print_screen#7 ← phi( @32/(byte*) print_screen#8 ) - (byte*) print_char_cursor#78 ← phi( @32/(byte*) print_char_cursor#79 ) - (byte*) print_line_cursor#29 ← phi( @32/(byte*) print_line_cursor#30 ) +@40: scope:[] from @33 + (byte*) print_screen#7 ← phi( @33/(byte*) print_screen#8 ) + (byte*) print_char_cursor#78 ← phi( @33/(byte*) print_char_cursor#79 ) + (byte*) print_line_cursor#29 ← phi( @33/(byte*) print_line_cursor#30 ) (signed byte*) xr#0 ← ((signed byte*)) (number) $f0 (signed byte*) yr#0 ← ((signed byte*)) (number) $f1 (signed byte*) zr#0 ← ((signed byte*)) (number) $f2 (word*) psp1#0 ← ((word*)) (number) $f3 (word*) psp2#0 ← ((word*)) (number) $f5 - to:@42 -main: scope:[main] from @43 - (byte*) print_char_cursor#76 ← phi( @43/(byte*) print_char_cursor#73 ) - (byte*) print_line_cursor#25 ← phi( @43/(byte*) print_line_cursor#24 ) - (byte*) print_screen#4 ← phi( @43/(byte*) print_screen#5 ) + to:@43 +main: scope:[main] from @44 + (byte*) print_char_cursor#76 ← phi( @44/(byte*) print_char_cursor#73 ) + (byte*) print_line_cursor#25 ← phi( @44/(byte*) print_line_cursor#24 ) + (byte*) print_screen#4 ← phi( @44/(byte*) print_screen#5 ) asm { sei } call mulf_init to:main::@1 @@ -448,13 +449,13 @@ perspective: scope:[perspective] from do_perspective::@7 perspective::@return: scope:[perspective] from perspective return to:@return -@42: scope:[] from @39 - (byte*) print_screen#6 ← phi( @39/(byte*) print_screen#7 ) - (byte*) print_char_cursor#77 ← phi( @39/(byte*) print_char_cursor#78 ) - (byte*) print_line_cursor#27 ← phi( @39/(byte*) print_line_cursor#29 ) +@43: scope:[] from @40 + (byte*) print_screen#6 ← phi( @40/(byte*) print_screen#7 ) + (byte*) print_char_cursor#77 ← phi( @40/(byte*) print_char_cursor#78 ) + (byte*) print_line_cursor#27 ← phi( @40/(byte*) print_line_cursor#29 ) (byte[$200]) mulf_sqr1#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2#0 ← { fill( $200, 0) } - to:@43 + to:@44 mulf_init: scope:[mulf_init] from main (signed word) mulf_init::sqr#0 ← (number) 0 (signed word) mulf_init::add#0 ← (number) 1 @@ -493,10 +494,10 @@ mulf_init::@1: scope:[mulf_init] from mulf_init mulf_init::@1 mulf_init::@return: scope:[mulf_init] from mulf_init::@1 return to:@return -@43: scope:[] from @42 - (byte*) print_screen#5 ← phi( @42/(byte*) print_screen#6 ) - (byte*) print_char_cursor#73 ← phi( @42/(byte*) print_char_cursor#77 ) - (byte*) print_line_cursor#24 ← phi( @42/(byte*) print_line_cursor#27 ) +@44: scope:[] from @43 + (byte*) print_screen#5 ← phi( @43/(byte*) print_screen#6 ) + (byte*) print_char_cursor#73 ← phi( @43/(byte*) print_char_cursor#77 ) + (byte*) print_line_cursor#24 ← phi( @43/(byte*) print_line_cursor#27 ) (signed byte[$100]) PERSP_Z#0 ← kickasm {{ { .var d = 256.0 .var z0 = 5.0 @@ -510,23 +511,23 @@ mulf_init::@return: scope:[mulf_init] from mulf_init::@1 } }} call main - to:@44 -@44: scope:[] from @43 - (byte*) print_char_cursor#63 ← phi( @43/(byte*) print_char_cursor#18 ) - (byte*) print_line_cursor#20 ← phi( @43/(byte*) print_line_cursor#7 ) + to:@45 +@45: scope:[] from @44 + (byte*) print_char_cursor#63 ← phi( @44/(byte*) print_char_cursor#18 ) + (byte*) print_line_cursor#20 ← phi( @44/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#20 (byte*) print_char_cursor#32 ← (byte*) print_char_cursor#63 to:@end -@end: scope:[] from @44 +@end: scope:[] from @45 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @16 -(label) @32 -(label) @39 -(label) @42 +(label) @33 +(label) @40 (label) @43 (label) @44 +(label) @45 (label) @begin (label) @end (signed byte[$100]) PERSP_Z @@ -1249,11 +1250,11 @@ Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_l Added new block during phi lifting mulf_init::@3(between mulf_init::@1 and mulf_init::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @16 -Adding NOP phi() at start of @32 -Adding NOP phi() at start of @39 -Adding NOP phi() at start of @42 +Adding NOP phi() at start of @33 +Adding NOP phi() at start of @40 Adding NOP phi() at start of @43 Adding NOP phi() at start of @44 +Adding NOP phi() at start of @45 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@2 Adding NOP phi() at start of main::@3 @@ -1311,10 +1312,10 @@ Coalesced [137] mulf_init::i#3 ← mulf_init::i#1 Coalesced [138] mulf_init::add#3 ← mulf_init::add#1 Coalesced down to 10 phi equivalence classes Culled Empty Block (label) @16 -Culled Empty Block (label) @32 -Culled Empty Block (label) @39 -Culled Empty Block (label) @42 -Culled Empty Block (label) @44 +Culled Empty Block (label) @33 +Culled Empty Block (label) @40 +Culled Empty Block (label) @43 +Culled Empty Block (label) @45 Culled Empty Block (label) main::@3 Culled Empty Block (label) do_perspective::@13 Culled Empty Block (label) print_ln::@2 @@ -1327,7 +1328,7 @@ Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 Culled Empty Block (label) mulf_init::@3 -Renumbering block @43 to @1 +Renumbering block @44 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sbyte::@5 to print_sbyte::@4 Adding NOP phi() at start of @begin diff --git a/src/test/ref/examples/fastmultiply/fastmultiply8.log b/src/test/ref/examples/fastmultiply/fastmultiply8.log index f24eac4d7..01ffb2ab2 100644 --- a/src/test/ref/examples/fastmultiply/fastmultiply8.log +++ b/src/test/ref/examples/fastmultiply/fastmultiply8.log @@ -40,14 +40,15 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Culled Empty Block (label) main::@6 -Culled Empty Block (label) @36 +Culled Empty Block (label) @37 Culled Empty Block (label) init_screen::@4 Culled Empty Block (label) fmul8::@1 @@ -92,7 +93,7 @@ memset::@return: scope:[memset] from memset::@1 to:@return @12: scope:[] from @begin (byte*) print_screen#0 ← ((byte*)) (number) $400 - to:@28 + to:@29 print_sbyte_at: scope:[print_sbyte_at] from main::@1 main::@10 main::@3 (byte*) print_sbyte_at::at#6 ← phi( main::@1/(byte*) print_sbyte_at::at#0 main::@10/(byte*) print_sbyte_at::at#2 main::@3/(byte*) print_sbyte_at::at#1 ) (signed byte) print_sbyte_at::b#4 ← phi( main::@1/(signed byte) print_sbyte_at::b#1 main::@10/(signed byte) print_sbyte_at::b#3 main::@3/(signed byte) print_sbyte_at::b#2 ) @@ -137,10 +138,10 @@ print_sbyte_at::@7: scope:[print_sbyte_at] from print_sbyte_at::@2 print_sbyte_at::@return: scope:[print_sbyte_at] from print_sbyte_at::@7 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#7 ← phi( @12/(byte*) print_screen#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@35 + to:@36 print_byte_at: scope:[print_byte_at] from print_sbyte_at::@2 (byte*) print_byte_at::at#1 ← phi( print_sbyte_at::@2/(byte*) print_byte_at::at#0 ) (byte) print_byte_at::b#1 ← phi( print_sbyte_at::@2/(byte) print_byte_at::b#0 ) @@ -184,12 +185,12 @@ print_cls::@1: scope:[print_cls] from print_cls print_cls::@return: scope:[print_cls] from print_cls::@1 return to:@return -@35: scope:[] from @28 - (byte*) print_screen#6 ← phi( @28/(byte*) print_screen#7 ) +@36: scope:[] from @29 + (byte*) print_screen#6 ← phi( @29/(byte*) print_screen#7 ) (signed byte[]) vals#0 ← { (number) -$5f, (number) -$40, (number) -$20, (number) -$10, (number) 0, (number) $10, (number) $20, (number) $40, (number) $5f } - to:@37 -main: scope:[main] from @38 - (byte*) print_screen#3 ← phi( @38/(byte*) print_screen#4 ) + to:@38 +main: scope:[main] from @39 + (byte*) print_screen#3 ← phi( @39/(byte*) print_screen#4 ) call init_screen to:main::@7 main::@7: scope:[main] from main @@ -312,12 +313,12 @@ init_screen::@3: scope:[init_screen] from init_screen::@2 init_screen::@3 init_screen::@return: scope:[init_screen] from init_screen::@3 return to:@return -@37: scope:[] from @35 - (byte*) print_screen#5 ← phi( @35/(byte*) print_screen#6 ) +@38: scope:[] from @36 + (byte*) print_screen#5 ← phi( @36/(byte*) print_screen#6 ) (signed byte*) ap#0 ← ((signed byte*)) (number) $fd (signed byte*) bp#0 ← ((signed byte*)) (number) $fe (signed byte*) cp#0 ← ((signed byte*)) (number) $ff - to:@38 + to:@39 fmul8: scope:[fmul8] from main::@4 (signed byte) fmul8::b#1 ← phi( main::@4/(signed byte) fmul8::b#0 ) (signed byte) fmul8::a#1 ← phi( main::@4/(signed byte) fmul8::a#0 ) @@ -331,8 +332,8 @@ fmul8::@return: scope:[fmul8] from fmul8 (signed byte) fmul8::return#2 ← (signed byte) fmul8::return#4 return to:@return -@38: scope:[] from @37 - (byte*) print_screen#4 ← phi( @37/(byte*) print_screen#5 ) +@39: scope:[] from @38 + (byte*) print_screen#4 ← phi( @38/(byte*) print_screen#5 ) (byte[$200]) mulf_sqr1#0 ← kickasm {{ .for(var i=0;i<$200;i++) { .if(i<=159) { .byte round((i*i)/256) } .if(i>159 && i<=351 ) { .byte round(((i-256)*(i-256))/256) } @@ -346,19 +347,19 @@ fmul8::@return: scope:[fmul8] from fmul8 } }} call main - to:@39 -@39: scope:[] from @38 + to:@40 +@40: scope:[] from @39 to:@end -@end: scope:[] from @39 +@end: scope:[] from @40 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @35 -(label) @37 +(label) @29 +(label) @36 (label) @38 (label) @39 +(label) @40 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -855,11 +856,11 @@ Added new block during phi lifting init_screen::@6(between init_screen::@1 and i Added new block during phi lifting init_screen::@7(between init_screen::@3 and init_screen::@3) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @37 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @36 Adding NOP phi() at start of @38 Adding NOP phi() at start of @39 +Adding NOP phi() at start of @40 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@7 @@ -910,10 +911,10 @@ Coalesced [111] init_screen::l#3 ← init_screen::l#1 Coalesced [124] memset::dst#3 ← memset::dst#1 Coalesced down to 14 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @35 -Culled Empty Block (label) @37 -Culled Empty Block (label) @39 +Culled Empty Block (label) @29 +Culled Empty Block (label) @36 +Culled Empty Block (label) @38 +Culled Empty Block (label) @40 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@2 Culled Empty Block (label) main::@13 @@ -930,7 +931,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @38 to @1 +Renumbering block @39 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sbyte_at::@5 to print_sbyte_at::@4 Renumbering block main::@3 to main::@2 diff --git a/src/test/ref/examples/helloworld/helloworld.log b/src/test/ref/examples/helloworld/helloworld.log index b1a006403..11a939604 100644 --- a/src/test/ref/examples/helloworld/helloworld.log +++ b/src/test/ref/examples/helloworld/helloworld.log @@ -43,6 +43,7 @@ Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 +Culled Empty Block (label) @36 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -51,7 +52,7 @@ CONTROL FLOW GRAPH SSA (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@36 + to:@37 print_str: scope:[print_str] from main (byte*) print_char_cursor#21 ← phi( main/(byte*) print_char_cursor#19 ) (byte*) print_str::str#4 ← phi( main/(byte*) print_str::str#1 ) @@ -97,9 +98,9 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#12 return to:@return -main: scope:[main] from @36 - (byte*) print_line_cursor#15 ← phi( @36/(byte*) print_line_cursor#14 ) - (byte*) print_char_cursor#19 ← phi( @36/(byte*) print_char_cursor#20 ) +main: scope:[main] from @37 + (byte*) print_line_cursor#15 ← phi( @37/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#19 ← phi( @37/(byte*) print_char_cursor#20 ) (byte*) print_str::str#1 ← (const string) main::str call print_str to:main::@1 @@ -122,23 +123,23 @@ main::@return: scope:[main] from main::@2 (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#10 return to:@return -@36: scope:[] from @12 +@37: scope:[] from @12 (byte*) print_line_cursor#14 ← phi( @12/(byte*) print_line_cursor#0 ) (byte*) print_char_cursor#20 ← phi( @12/(byte*) print_char_cursor#0 ) call main - to:@37 -@37: scope:[] from @36 - (byte*) print_line_cursor#11 ← phi( @36/(byte*) print_line_cursor#4 ) - (byte*) print_char_cursor#16 ← phi( @36/(byte*) print_char_cursor#7 ) + to:@38 +@38: scope:[] from @37 + (byte*) print_line_cursor#11 ← phi( @37/(byte*) print_line_cursor#4 ) + (byte*) print_char_cursor#16 ← phi( @37/(byte*) print_char_cursor#7 ) (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#16 (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#11 to:@end -@end: scope:[] from @37 +@end: scope:[] from @38 SYMBOL TABLE SSA (label) @12 -(label) @36 (label) @37 +(label) @38 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -257,8 +258,8 @@ Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @36 Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -276,11 +277,11 @@ Coalesced [26] print_str::str#5 ← print_str::str#0 Coalesced [27] print_char_cursor#22 ← print_char_cursor#1 Coalesced down to 3 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @37 +Culled Empty Block (label) @38 Culled Empty Block (label) main::@2 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 -Renumbering block @36 to @1 +Renumbering block @37 to @1 Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 Adding NOP phi() at start of @end diff --git a/src/test/ref/examples/plasma/plasma-unroll.log b/src/test/ref/examples/plasma/plasma-unroll.log index d07adf021..27ac9faf0 100644 --- a/src/test/ref/examples/plasma/plasma-unroll.log +++ b/src/test/ref/examples/plasma/plasma-unroll.log @@ -46,7 +46,8 @@ Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 -Culled Empty Block (label) @40 +Culled Empty Block (label) @39 +Culled Empty Block (label) @41 Culled Empty Block (label) sid_rnd::@1 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::@6 @@ -54,7 +55,7 @@ Culled Empty Block (label) main::@5 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@8 Culled Empty Block (label) doplasma::@8 -Culled Empty Block (label) @43 +Culled Empty Block (label) @44 Culled Empty Block (label) makecharset::@10 CONTROL FLOW GRAPH SSA @@ -106,7 +107,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@39 + to:@40 print_char: scope:[print_char] from makecharset::@8 (byte*) print_char_cursor#11 ← phi( makecharset::@8/(byte*) print_char_cursor#20 ) (byte) print_char::ch#1 ← phi( makecharset::@8/(byte) print_char::ch#0 ) @@ -138,7 +139,7 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#13 return to:@return -@39: scope:[] from @16 +@40: scope:[] from @16 (byte*) print_screen#11 ← phi( @16/(byte*) print_screen#0 ) (byte*) print_char_cursor#37 ← phi( @16/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#32 ← phi( @16/(byte*) print_line_cursor#0 ) @@ -146,7 +147,7 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) SID_VOICE3_CONTROL#0 ← ((byte*)) (number) $d412 (byte) SID_CONTROL_NOISE#0 ← (number) $80 (byte*) SID_VOICE3_OSC#0 ← ((byte*)) (number) $d41b - to:@41 + to:@42 sid_rnd_init: scope:[sid_rnd_init] from makecharset *((word*) SID_VOICE3_FREQ#0) ← (number) $ffff *((byte*) SID_VOICE3_CONTROL#0) ← (byte) SID_CONTROL_NOISE#0 @@ -162,24 +163,24 @@ sid_rnd::@return: scope:[sid_rnd] from sid_rnd (byte) sid_rnd::return#1 ← (byte) sid_rnd::return#3 return to:@return -@41: scope:[] from @39 - (byte*) print_screen#10 ← phi( @39/(byte*) print_screen#11 ) - (byte*) print_char_cursor#35 ← phi( @39/(byte*) print_char_cursor#37 ) - (byte*) print_line_cursor#29 ← phi( @39/(byte*) print_line_cursor#32 ) +@42: scope:[] from @40 + (byte*) print_screen#10 ← phi( @40/(byte*) print_screen#11 ) + (byte*) print_char_cursor#35 ← phi( @40/(byte*) print_char_cursor#37 ) + (byte*) print_line_cursor#29 ← phi( @40/(byte*) print_line_cursor#32 ) (byte*) SCREEN1#0 ← ((byte*)) (number) $2800 (byte*) CHARSET#0 ← ((byte*)) (number) $2000 (byte[$100]) SINTABLE#0 ← kickasm {{ .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(toRadians(360*i/256))) }} - to:@42 -main: scope:[main] from @44 - (byte) c2B#27 ← phi( @44/(byte) c2B#17 ) - (byte) c2A#27 ← phi( @44/(byte) c2A#17 ) - (byte) c1B#27 ← phi( @44/(byte) c1B#16 ) - (byte) c1A#27 ← phi( @44/(byte) c1A#16 ) - (byte*) print_screen#7 ← phi( @44/(byte*) print_screen#8 ) - (byte*) print_char_cursor#32 ← phi( @44/(byte*) print_char_cursor#25 ) - (byte*) print_line_cursor#26 ← phi( @44/(byte*) print_line_cursor#18 ) + to:@43 +main: scope:[main] from @45 + (byte) c2B#27 ← phi( @45/(byte) c2B#17 ) + (byte) c2A#27 ← phi( @45/(byte) c2A#17 ) + (byte) c1B#27 ← phi( @45/(byte) c1B#16 ) + (byte) c1A#27 ← phi( @45/(byte) c1A#16 ) + (byte*) print_screen#7 ← phi( @45/(byte*) print_screen#8 ) + (byte*) print_char_cursor#32 ← phi( @45/(byte*) print_char_cursor#25 ) + (byte*) print_line_cursor#26 ← phi( @45/(byte*) print_line_cursor#18 ) asm { sei } *((byte*) BORDERCOL#0) ← (byte) BLUE#0 *((byte*) BGCOL#0) ← (byte) BLUE#0 @@ -310,15 +311,15 @@ main::@return: scope:[main] from main::@3 (byte) c2B#1 ← (byte) c2B#7 return to:@return -@42: scope:[] from @41 - (byte*) print_screen#9 ← phi( @41/(byte*) print_screen#10 ) - (byte*) print_char_cursor#31 ← phi( @41/(byte*) print_char_cursor#35 ) - (byte*) print_line_cursor#25 ← phi( @41/(byte*) print_line_cursor#29 ) +@43: scope:[] from @42 + (byte*) print_screen#9 ← phi( @42/(byte*) print_screen#10 ) + (byte*) print_char_cursor#31 ← phi( @42/(byte*) print_char_cursor#35 ) + (byte*) print_line_cursor#25 ← phi( @42/(byte*) print_line_cursor#29 ) (byte) c1A#2 ← (number) 0 (byte) c1B#2 ← (number) 0 (byte) c2A#2 ← (number) 0 (byte) c2B#2 ← (number) 0 - to:@44 + to:@45 doplasma: scope:[doplasma] from main::@4 (byte*) doplasma::screen#8 ← phi( main::@4/(byte*) doplasma::screen#0 ) (byte) c2B#19 ← phi( main::@4/(byte) c2B#12 ) @@ -591,23 +592,23 @@ makecharset::@return: scope:[makecharset] from makecharset::@9 (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#18 return to:@return -@44: scope:[] from @42 - (byte*) print_screen#8 ← phi( @42/(byte*) print_screen#9 ) - (byte) c2B#17 ← phi( @42/(byte) c2B#2 ) - (byte) c2A#17 ← phi( @42/(byte) c2A#2 ) - (byte) c1B#16 ← phi( @42/(byte) c1B#2 ) - (byte) c1A#16 ← phi( @42/(byte) c1A#2 ) - (byte*) print_char_cursor#25 ← phi( @42/(byte*) print_char_cursor#31 ) - (byte*) print_line_cursor#18 ← phi( @42/(byte*) print_line_cursor#25 ) +@45: scope:[] from @43 + (byte*) print_screen#8 ← phi( @43/(byte*) print_screen#9 ) + (byte) c2B#17 ← phi( @43/(byte) c2B#2 ) + (byte) c2A#17 ← phi( @43/(byte) c2A#2 ) + (byte) c1B#16 ← phi( @43/(byte) c1B#2 ) + (byte) c1A#16 ← phi( @43/(byte) c1A#2 ) + (byte*) print_char_cursor#25 ← phi( @43/(byte*) print_char_cursor#31 ) + (byte*) print_line_cursor#18 ← phi( @43/(byte*) print_line_cursor#25 ) call main - to:@45 -@45: scope:[] from @44 - (byte) c2B#11 ← phi( @44/(byte) c2B#1 ) - (byte) c2A#11 ← phi( @44/(byte) c2A#1 ) - (byte) c1B#11 ← phi( @44/(byte) c1B#1 ) - (byte) c1A#11 ← phi( @44/(byte) c1A#1 ) - (byte*) print_char_cursor#19 ← phi( @44/(byte*) print_char_cursor#6 ) - (byte*) print_line_cursor#13 ← phi( @44/(byte*) print_line_cursor#4 ) + to:@46 +@46: scope:[] from @45 + (byte) c2B#11 ← phi( @45/(byte) c2B#1 ) + (byte) c2A#11 ← phi( @45/(byte) c2A#1 ) + (byte) c1B#11 ← phi( @45/(byte) c1B#1 ) + (byte) c1A#11 ← phi( @45/(byte) c1A#1 ) + (byte*) print_char_cursor#19 ← phi( @45/(byte*) print_char_cursor#6 ) + (byte*) print_line_cursor#13 ← phi( @45/(byte*) print_line_cursor#4 ) (byte*) print_line_cursor#7 ← (byte*) print_line_cursor#13 (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#19 (byte) c1A#5 ← (byte) c1A#11 @@ -615,15 +616,15 @@ makecharset::@return: scope:[makecharset] from makecharset::@9 (byte) c2A#5 ← (byte) c2A#11 (byte) c2B#5 ← (byte) c2B#11 to:@end -@end: scope:[] from @45 +@end: scope:[] from @46 SYMBOL TABLE SSA (label) @16 -(label) @39 -(label) @41 +(label) @40 (label) @42 -(label) @44 +(label) @43 (label) @45 +(label) @46 (label) @begin (label) @end (byte*) BGCOL @@ -2424,11 +2425,11 @@ Added new block during phi lifting makecharset::@19(between makecharset::@7 and Added new block during phi lifting memset::@6(between memset::@4 and memset::@4) Adding NOP phi() at start of @begin Adding NOP phi() at start of @16 -Adding NOP phi() at start of @39 -Adding NOP phi() at start of @41 +Adding NOP phi() at start of @40 Adding NOP phi() at start of @42 -Adding NOP phi() at start of @44 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @45 +Adding NOP phi() at start of @46 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@2 Adding NOP phi() at start of main::@10 @@ -2480,10 +2481,10 @@ Coalesced (already) [161] makecharset::b#8 ← makecharset::b#2 Coalesced [179] memset::dst#3 ← memset::dst#1 Coalesced down to 20 phi equivalence classes Culled Empty Block (label) @16 -Culled Empty Block (label) @39 -Culled Empty Block (label) @41 +Culled Empty Block (label) @40 Culled Empty Block (label) @42 -Culled Empty Block (label) @45 +Culled Empty Block (label) @43 +Culled Empty Block (label) @46 Culled Empty Block (label) main::@10 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@11 @@ -2501,7 +2502,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @44 to @1 +Renumbering block @45 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block main::@9 to main::@5 Renumbering block doplasma::@9 to doplasma::@8 diff --git a/src/test/ref/examples/plasma/plasma.log b/src/test/ref/examples/plasma/plasma.log index 1185793ef..18b9efdfc 100644 --- a/src/test/ref/examples/plasma/plasma.log +++ b/src/test/ref/examples/plasma/plasma.log @@ -47,7 +47,8 @@ Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 -Culled Empty Block (label) @40 +Culled Empty Block (label) @39 +Culled Empty Block (label) @41 Culled Empty Block (label) sid_rnd::@1 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::toD0182_@1 @@ -56,7 +57,7 @@ Culled Empty Block (label) main::@5 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@8 Culled Empty Block (label) doplasma::@8 -Culled Empty Block (label) @43 +Culled Empty Block (label) @44 Culled Empty Block (label) makecharset::@10 CONTROL FLOW GRAPH SSA @@ -108,7 +109,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@39 + to:@40 print_char: scope:[print_char] from makecharset::@8 (byte*) print_char_cursor#11 ← phi( makecharset::@8/(byte*) print_char_cursor#20 ) (byte) print_char::ch#1 ← phi( makecharset::@8/(byte) print_char::ch#0 ) @@ -140,7 +141,7 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#13 return to:@return -@39: scope:[] from @16 +@40: scope:[] from @16 (byte*) print_screen#11 ← phi( @16/(byte*) print_screen#0 ) (byte*) print_char_cursor#35 ← phi( @16/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#30 ← phi( @16/(byte*) print_line_cursor#0 ) @@ -148,7 +149,7 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) SID_VOICE3_CONTROL#0 ← ((byte*)) (number) $d412 (byte) SID_CONTROL_NOISE#0 ← (number) $80 (byte*) SID_VOICE3_OSC#0 ← ((byte*)) (number) $d41b - to:@41 + to:@42 sid_rnd_init: scope:[sid_rnd_init] from makecharset *((word*) SID_VOICE3_FREQ#0) ← (number) $ffff *((byte*) SID_VOICE3_CONTROL#0) ← (byte) SID_CONTROL_NOISE#0 @@ -164,25 +165,25 @@ sid_rnd::@return: scope:[sid_rnd] from sid_rnd (byte) sid_rnd::return#1 ← (byte) sid_rnd::return#3 return to:@return -@41: scope:[] from @39 - (byte*) print_screen#10 ← phi( @39/(byte*) print_screen#11 ) - (byte*) print_char_cursor#33 ← phi( @39/(byte*) print_char_cursor#35 ) - (byte*) print_line_cursor#27 ← phi( @39/(byte*) print_line_cursor#30 ) +@42: scope:[] from @40 + (byte*) print_screen#10 ← phi( @40/(byte*) print_screen#11 ) + (byte*) print_char_cursor#33 ← phi( @40/(byte*) print_char_cursor#35 ) + (byte*) print_line_cursor#27 ← phi( @40/(byte*) print_line_cursor#30 ) (byte*) SCREEN1#0 ← ((byte*)) (number) $2800 (byte*) SCREEN2#0 ← ((byte*)) (number) $2c00 (byte*) CHARSET#0 ← ((byte*)) (number) $2000 (byte[$100]) SINTABLE#0 ← kickasm {{ .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(2*PI*i/256)) }} - to:@42 -main: scope:[main] from @44 - (byte*) print_screen#7 ← phi( @44/(byte*) print_screen#8 ) - (byte) c2B#32 ← phi( @44/(byte) c2B#20 ) - (byte) c2A#32 ← phi( @44/(byte) c2A#20 ) - (byte) c1B#31 ← phi( @44/(byte) c1B#19 ) - (byte) c1A#31 ← phi( @44/(byte) c1A#19 ) - (byte*) print_char_cursor#31 ← phi( @44/(byte*) print_char_cursor#25 ) - (byte*) print_line_cursor#25 ← phi( @44/(byte*) print_line_cursor#18 ) + to:@43 +main: scope:[main] from @45 + (byte*) print_screen#7 ← phi( @45/(byte*) print_screen#8 ) + (byte) c2B#32 ← phi( @45/(byte) c2B#20 ) + (byte) c2A#32 ← phi( @45/(byte) c2A#20 ) + (byte) c1B#31 ← phi( @45/(byte) c1B#19 ) + (byte) c1A#31 ← phi( @45/(byte) c1A#19 ) + (byte*) print_char_cursor#31 ← phi( @45/(byte*) print_char_cursor#25 ) + (byte*) print_line_cursor#25 ← phi( @45/(byte*) print_line_cursor#18 ) asm { sei } *((byte*) BORDERCOL#0) ← (byte) BLUE#0 *((byte*) BGCOL#0) ← (byte) BLUE#0 @@ -370,15 +371,15 @@ main::@return: scope:[main] from main::@3 (byte) c2B#2 ← (byte) c2B#9 return to:@return -@42: scope:[] from @41 - (byte*) print_screen#9 ← phi( @41/(byte*) print_screen#10 ) - (byte*) print_char_cursor#30 ← phi( @41/(byte*) print_char_cursor#33 ) - (byte*) print_line_cursor#24 ← phi( @41/(byte*) print_line_cursor#27 ) +@43: scope:[] from @42 + (byte*) print_screen#9 ← phi( @42/(byte*) print_screen#10 ) + (byte*) print_char_cursor#30 ← phi( @42/(byte*) print_char_cursor#33 ) + (byte*) print_line_cursor#24 ← phi( @42/(byte*) print_line_cursor#27 ) (byte) c1A#3 ← (number) 0 (byte) c1B#3 ← (number) 0 (byte) c2A#3 ← (number) 0 (byte) c2B#3 ← (number) 0 - to:@44 + to:@45 doplasma: scope:[doplasma] from main::@4 main::@9 (byte*) doplasma::screen#10 ← phi( main::@4/(byte*) doplasma::screen#0 main::@9/(byte*) doplasma::screen#1 ) (byte) c2B#24 ← phi( main::@4/(byte) c2B#14 main::@9/(byte) c2B#15 ) @@ -643,23 +644,23 @@ makecharset::@return: scope:[makecharset] from makecharset::@9 (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#18 return to:@return -@44: scope:[] from @42 - (byte*) print_screen#8 ← phi( @42/(byte*) print_screen#9 ) - (byte) c2B#20 ← phi( @42/(byte) c2B#3 ) - (byte) c2A#20 ← phi( @42/(byte) c2A#3 ) - (byte) c1B#19 ← phi( @42/(byte) c1B#3 ) - (byte) c1A#19 ← phi( @42/(byte) c1A#3 ) - (byte*) print_char_cursor#25 ← phi( @42/(byte*) print_char_cursor#30 ) - (byte*) print_line_cursor#18 ← phi( @42/(byte*) print_line_cursor#24 ) +@45: scope:[] from @43 + (byte*) print_screen#8 ← phi( @43/(byte*) print_screen#9 ) + (byte) c2B#20 ← phi( @43/(byte) c2B#3 ) + (byte) c2A#20 ← phi( @43/(byte) c2A#3 ) + (byte) c1B#19 ← phi( @43/(byte) c1B#3 ) + (byte) c1A#19 ← phi( @43/(byte) c1A#3 ) + (byte*) print_char_cursor#25 ← phi( @43/(byte*) print_char_cursor#30 ) + (byte*) print_line_cursor#18 ← phi( @43/(byte*) print_line_cursor#24 ) call main - to:@45 -@45: scope:[] from @44 - (byte) c2B#13 ← phi( @44/(byte) c2B#2 ) - (byte) c2A#13 ← phi( @44/(byte) c2A#2 ) - (byte) c1B#13 ← phi( @44/(byte) c1B#2 ) - (byte) c1A#13 ← phi( @44/(byte) c1A#2 ) - (byte*) print_char_cursor#19 ← phi( @44/(byte*) print_char_cursor#6 ) - (byte*) print_line_cursor#13 ← phi( @44/(byte*) print_line_cursor#4 ) + to:@46 +@46: scope:[] from @45 + (byte) c2B#13 ← phi( @45/(byte) c2B#2 ) + (byte) c2A#13 ← phi( @45/(byte) c2A#2 ) + (byte) c1B#13 ← phi( @45/(byte) c1B#2 ) + (byte) c1A#13 ← phi( @45/(byte) c1A#2 ) + (byte*) print_char_cursor#19 ← phi( @45/(byte*) print_char_cursor#6 ) + (byte*) print_line_cursor#13 ← phi( @45/(byte*) print_line_cursor#4 ) (byte*) print_line_cursor#7 ← (byte*) print_line_cursor#13 (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#19 (byte) c1A#6 ← (byte) c1A#13 @@ -667,15 +668,15 @@ makecharset::@return: scope:[makecharset] from makecharset::@9 (byte) c2A#6 ← (byte) c2A#13 (byte) c2B#6 ← (byte) c2B#13 to:@end -@end: scope:[] from @45 +@end: scope:[] from @46 SYMBOL TABLE SSA (label) @16 -(label) @39 -(label) @41 +(label) @40 (label) @42 -(label) @44 +(label) @43 (label) @45 +(label) @46 (label) @begin (label) @end (byte*) BGCOL @@ -1877,11 +1878,11 @@ Added new block during phi lifting makecharset::@18(between makecharset::@13 and Added new block during phi lifting makecharset::@19(between makecharset::@7 and makecharset::@9) Adding NOP phi() at start of @begin Adding NOP phi() at start of @16 -Adding NOP phi() at start of @39 -Adding NOP phi() at start of @41 +Adding NOP phi() at start of @40 Adding NOP phi() at start of @42 -Adding NOP phi() at start of @44 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @45 +Adding NOP phi() at start of @46 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@2 Adding NOP phi() at start of main::@11 @@ -1946,10 +1947,10 @@ Coalesced (already) [131] makecharset::b#8 ← makecharset::b#2 Coalesced [149] memset::dst#3 ← memset::dst#1 Coalesced down to 20 phi equivalence classes Culled Empty Block (label) @16 -Culled Empty Block (label) @39 -Culled Empty Block (label) @41 +Culled Empty Block (label) @40 Culled Empty Block (label) @42 -Culled Empty Block (label) @45 +Culled Empty Block (label) @43 +Culled Empty Block (label) @46 Culled Empty Block (label) main::@11 Culled Empty Block (label) main::@12 Culled Empty Block (label) main::toD0181_@return @@ -1971,7 +1972,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @44 to @1 +Renumbering block @45 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block main::@9 to main::@5 Renumbering block main::@10 to main::@6 diff --git a/src/test/ref/examples/rotate/rotate.log b/src/test/ref/examples/rotate/rotate.log index a7621e411..d26d5fdc7 100644 --- a/src/test/ref/examples/rotate/rotate.log +++ b/src/test/ref/examples/rotate/rotate.log @@ -55,13 +55,14 @@ Culled Empty Block (label) @39 Culled Empty Block (label) @40 Culled Empty Block (label) @41 Culled Empty Block (label) @42 -Culled Empty Block (label) @44 +Culled Empty Block (label) @43 Culled Empty Block (label) @45 Culled Empty Block (label) @46 Culled Empty Block (label) @47 Culled Empty Block (label) @48 Culled Empty Block (label) @49 -Culled Empty Block (label) @51 +Culled Empty Block (label) @50 +Culled Empty Block (label) @52 Culled Empty Block (label) init::@2 Culled Empty Block (label) anim::@2 Culled Empty Block (label) anim::@15 @@ -272,7 +273,7 @@ mulf8s_prepared::@return: scope:[mulf8s_prepared] from mulf8s_prepared::@2 to:@return @13: scope:[] from @4 (dword) CLOCKS_PER_INIT#0 ← (number) $12 - to:@43 + to:@44 clock: scope:[clock] from anim::@13 (number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0) (dword) clock::return#0 ← (number~) clock::$0 @@ -344,9 +345,9 @@ print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1 print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2 return to:@return -@43: scope:[] from @13 +@44: scope:[] from @13 (byte[]) print_hextab#0 ← (const string) $2 - to:@50 + to:@51 print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1 (byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 ) (byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 ) @@ -377,16 +378,16 @@ print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1 print_char_at::@return: scope:[print_char_at] from print_char_at return to:@return -@50: scope:[] from @43 +@51: scope:[] from @44 (byte*) SCREEN#0 ← ((byte*)) (number) $400 (byte[$140]) SIN#0 ← kickasm {{ .for(var i=0;i<$140;i++) .byte >round($7fff*sin(i*2*PI/256)) }} (byte*~) $1 ← (byte[$140]) SIN#0 + (number) $40 (byte*) COS#0 ← (byte*~) $1 - to:@52 -main: scope:[main] from @53 - (byte*) COS#9 ← phi( @53/(byte*) COS#11 ) + to:@53 +main: scope:[main] from @54 + (byte*) COS#9 ← phi( @54/(byte*) COS#11 ) asm { sei } call init to:main::@1 @@ -422,11 +423,11 @@ init::@1: scope:[init] from init::@1 init::@3 init::@return: scope:[init] from init::@1 return to:@return -@52: scope:[] from @50 - (byte*) COS#15 ← phi( @50/(byte*) COS#0 ) +@53: scope:[] from @51 + (byte*) COS#15 ← phi( @51/(byte*) COS#0 ) (signed byte[8]) xs#0 ← { (number) -$46, (number) -$46, (number) -$46, (number) 0, (number) 0, (number) $46, (number) $46, (number) $46 } (signed byte[8]) ys#0 ← { (number) -$46, (number) 0, (number) $46, (number) -$46, (number) $46, (number) -$46, (number) 0, (number) $46 } - to:@53 + to:@54 anim: scope:[anim] from main::@1 (byte*) COS#5 ← phi( main::@1/(byte*) COS#7 ) (byte) anim::angle#0 ← (number) 0 @@ -686,8 +687,8 @@ anim::@27: scope:[anim] from anim::@26 anim::@return: scope:[anim] from anim::@1 return to:@return -@53: scope:[] from @52 - (byte*) COS#11 ← phi( @52/(byte*) COS#15 ) +@54: scope:[] from @53 + (byte*) COS#11 ← phi( @53/(byte*) COS#15 ) (byte*) SPRITE#0 ← ((byte*)) (number) $3000 kickasm(location (byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) @@ -695,21 +696,21 @@ anim::@return: scope:[anim] from anim::@1 .byte pic.getSinglecolorByte(x,y) }} call main - to:@54 -@54: scope:[] from @53 + to:@55 +@55: scope:[] from @54 to:@end -@end: scope:[] from @54 +@end: scope:[] from @55 SYMBOL TABLE SSA (byte*~) $1 (const string) $2 = (string) "0123456789abcdef" (label) @13 (label) @4 -(label) @43 -(label) @50 -(label) @52 +(label) @44 +(label) @51 (label) @53 (label) @54 +(label) @55 (label) @begin (label) @end (byte*) BORDERCOL @@ -1856,10 +1857,10 @@ Added new block during phi lifting anim::@29(between anim::@25 and anim::@11) Adding NOP phi() at start of @begin Adding NOP phi() at start of @4 Adding NOP phi() at start of @13 -Adding NOP phi() at start of @43 -Adding NOP phi() at start of @50 -Adding NOP phi() at start of @52 -Adding NOP phi() at start of @54 +Adding NOP phi() at start of @44 +Adding NOP phi() at start of @51 +Adding NOP phi() at start of @53 +Adding NOP phi() at start of @55 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@1 Adding NOP phi() at start of main::@2 @@ -1926,10 +1927,10 @@ Coalesced (already) [210] mulf_init::x_2#6 ← mulf_init::x_2#3 Coalesced down to 22 phi equivalence classes Culled Empty Block (label) @4 Culled Empty Block (label) @13 -Culled Empty Block (label) @43 -Culled Empty Block (label) @50 -Culled Empty Block (label) @52 -Culled Empty Block (label) @54 +Culled Empty Block (label) @44 +Culled Empty Block (label) @51 +Culled Empty Block (label) @53 +Culled Empty Block (label) @55 Culled Empty Block (label) main::@2 Culled Empty Block (label) anim::@19 Culled Empty Block (label) anim::@20 @@ -1947,7 +1948,7 @@ Culled Empty Block (label) mulf_init::@7 Culled Empty Block (label) mulf_init::@11 Culled Empty Block (label) mulf_init::@9 Culled Empty Block (label) mulf_init::@10 -Renumbering block @53 to @1 +Renumbering block @54 to @1 Renumbering block mulf_init::@5 to mulf_init::@4 Renumbering block mulf_init::@6 to mulf_init::@5 Renumbering block mulf_init::@8 to mulf_init::@6 diff --git a/src/test/ref/examples/sinsprites/sinus-sprites.log b/src/test/ref/examples/sinsprites/sinus-sprites.log index 91fdbcda3..4efa48503 100644 --- a/src/test/ref/examples/sinsprites/sinus-sprites.log +++ b/src/test/ref/examples/sinsprites/sinus-sprites.log @@ -72,18 +72,19 @@ Culled Empty Block (label) @62 Culled Empty Block (label) @63 Culled Empty Block (label) @64 Culled Empty Block (label) @65 +Culled Empty Block (label) @66 Culled Empty Block (label) main::@1 Culled Empty Block (label) main::@4 -Culled Empty Block (label) @67 Culled Empty Block (label) @68 +Culled Empty Block (label) @69 Culled Empty Block (label) clear_screen::@2 -Culled Empty Block (label) @70 -Culled Empty Block (label) @72 -Culled Empty Block (label) place_sprites::@2 +Culled Empty Block (label) @71 Culled Empty Block (label) @73 -Culled Empty Block (label) gen_sprites::@2 +Culled Empty Block (label) place_sprites::@2 Culled Empty Block (label) @74 +Culled Empty Block (label) gen_sprites::@2 Culled Empty Block (label) @75 +Culled Empty Block (label) @76 Culled Empty Block (label) gen_sintab::@2 CONTROL FLOW GRAPH SSA @@ -104,7 +105,7 @@ CONTROL FLOW GRAPH SSA @4: scope:[] from @begin (byte*) memLo#0 ← ((byte*)) (number) $fe (byte*) memHi#0 ← ((byte*)) (number) $ff - to:@66 + to:@67 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -199,19 +200,19 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@66: scope:[] from @4 +@67: scope:[] from @4 (byte) sinlen_x#0 ← (number) $dd (byte[$dd]) sintab_x#0 ← { fill( $dd, 0) } (byte) sinlen_y#0 ← (number) $c5 (byte[$c5]) sintab_y#0 ← { fill( $c5, 0) } (byte*) sprites#0 ← ((byte*)) (number) $2000 (byte*) SCREEN#0 ← ((byte*)) (number) $400 - to:@69 -main: scope:[main] from @76 - (byte) sin_idx_y#23 ← phi( @76/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#25 ← phi( @76/(byte) sin_idx_x#16 ) - (byte) progress_idx#30 ← phi( @76/(byte) progress_idx#35 ) - (byte*) progress_cursor#29 ← phi( @76/(byte*) progress_cursor#35 ) + to:@70 +main: scope:[main] from @77 + (byte) sin_idx_y#23 ← phi( @77/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#25 ← phi( @77/(byte) sin_idx_x#16 ) + (byte) progress_idx#30 ← phi( @77/(byte) progress_idx#35 ) + (byte*) progress_cursor#29 ← phi( @77/(byte*) progress_cursor#35 ) call init to:main::@5 main::@5: scope:[main] from main @@ -357,10 +358,10 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@69: scope:[] from @66 +@70: scope:[] from @67 (byte*) progress_cursor#7 ← (byte*) SCREEN#0 (byte) progress_idx#7 ← (number) 0 - to:@71 + to:@72 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#8 ← (byte*) progress_init::line#2 @@ -400,12 +401,12 @@ progress_inc::@return: scope:[progress_inc] from progress_inc::@1 (byte*) progress_cursor#11 ← (byte*) progress_cursor#25 return to:@return -@71: scope:[] from @69 - (byte) progress_idx#39 ← phi( @69/(byte) progress_idx#7 ) - (byte*) progress_cursor#39 ← phi( @69/(byte*) progress_cursor#7 ) +@72: scope:[] from @70 + (byte) progress_idx#39 ← phi( @70/(byte) progress_idx#7 ) + (byte*) progress_cursor#39 ← phi( @70/(byte*) progress_cursor#7 ) (byte) sin_idx_x#2 ← (number) 0 (byte) sin_idx_y#2 ← (number) 0 - to:@76 + to:@77 anim: scope:[anim] from main::@3 (byte) sin_idx_y#9 ← phi( main::@3/(byte) sin_idx_y#13 ) (byte) sin_idx_x#9 ← phi( main::@3/(byte) sin_idx_x#13 ) @@ -942,32 +943,32 @@ gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 (byte*) progress_cursor#13 ← (byte*) progress_cursor#27 return to:@return -@76: scope:[] from @71 - (byte) sin_idx_y#17 ← phi( @71/(byte) sin_idx_y#2 ) - (byte) sin_idx_x#16 ← phi( @71/(byte) sin_idx_x#2 ) - (byte) progress_idx#35 ← phi( @71/(byte) progress_idx#39 ) - (byte*) progress_cursor#35 ← phi( @71/(byte*) progress_cursor#39 ) +@77: scope:[] from @72 + (byte) sin_idx_y#17 ← phi( @72/(byte) sin_idx_y#2 ) + (byte) sin_idx_x#16 ← phi( @72/(byte) sin_idx_x#2 ) + (byte) progress_idx#35 ← phi( @72/(byte) progress_idx#39 ) + (byte*) progress_cursor#35 ← phi( @72/(byte*) progress_cursor#39 ) call main - to:@77 -@77: scope:[] from @76 - (byte) sin_idx_y#12 ← phi( @76/(byte) sin_idx_y#1 ) - (byte) sin_idx_x#12 ← phi( @76/(byte) sin_idx_x#1 ) - (byte) progress_idx#29 ← phi( @76/(byte) progress_idx#1 ) - (byte*) progress_cursor#28 ← phi( @76/(byte*) progress_cursor#1 ) + to:@78 +@78: scope:[] from @77 + (byte) sin_idx_y#12 ← phi( @77/(byte) sin_idx_y#1 ) + (byte) sin_idx_x#12 ← phi( @77/(byte) sin_idx_x#1 ) + (byte) progress_idx#29 ← phi( @77/(byte) progress_idx#1 ) + (byte*) progress_cursor#28 ← phi( @77/(byte*) progress_cursor#1 ) (byte*) progress_cursor#14 ← (byte*) progress_cursor#28 (byte) progress_idx#15 ← (byte) progress_idx#29 (byte) sin_idx_x#6 ← (byte) sin_idx_x#12 (byte) sin_idx_y#6 ← (byte) sin_idx_y#12 to:@end -@end: scope:[] from @77 +@end: scope:[] from @78 SYMBOL TABLE SSA (label) @4 -(label) @66 -(label) @69 -(label) @71 -(label) @76 +(label) @67 +(label) @70 +(label) @72 (label) @77 +(label) @78 (label) @begin (label) @end (byte*) BORDERCOL @@ -2507,11 +2508,11 @@ Added new block during phi lifting gen_chargen_sprite::@14(between gen_chargen_s Added new block during phi lifting gen_sintab::@24(between gen_sintab::@23 and gen_sintab::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @4 -Adding NOP phi() at start of @66 -Adding NOP phi() at start of @69 -Adding NOP phi() at start of @71 -Adding NOP phi() at start of @76 +Adding NOP phi() at start of @67 +Adding NOP phi() at start of @70 +Adding NOP phi() at start of @72 Adding NOP phi() at start of @77 +Adding NOP phi() at start of @78 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@5 @@ -2626,10 +2627,10 @@ Coalesced [296] place_sprites::j2#4 ← place_sprites::j2#2 Coalesced [297] place_sprites::col#3 ← place_sprites::col#1 Coalesced down to 36 phi equivalence classes Culled Empty Block (label) @4 -Culled Empty Block (label) @66 -Culled Empty Block (label) @69 -Culled Empty Block (label) @71 -Culled Empty Block (label) @77 +Culled Empty Block (label) @67 +Culled Empty Block (label) @70 +Culled Empty Block (label) @72 +Culled Empty Block (label) @78 Culled Empty Block (label) main::@5 Culled Empty Block (label) main::@6 Culled Empty Block (label) main::@7 @@ -2651,7 +2652,7 @@ Culled Empty Block (label) gen_chargen_sprite::@12 Culled Empty Block (label) gen_chargen_sprite::@13 Culled Empty Block (label) gen_chargen_sprite::@14 Culled Empty Block (label) place_sprites::@3 -Renumbering block @76 to @1 +Renumbering block @77 to @1 Renumbering block main::@2 to main::@1 Renumbering block main::@3 to main::@2 Renumbering block init::@4 to init::@3 diff --git a/src/test/ref/fastmultiply-127.log b/src/test/ref/fastmultiply-127.log index 0c66cc142..7f75fa984 100644 --- a/src/test/ref/fastmultiply-127.log +++ b/src/test/ref/fastmultiply-127.log @@ -39,7 +39,7 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 @@ -48,8 +48,9 @@ Culled Empty Block (label) @34 Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 +Culled Empty Block (label) @38 Culled Empty Block (label) mulf8u127::@1 -Culled Empty Block (label) @39 +Culled Empty Block (label) @40 Culled Empty Block (label) mulf8s127::@7 CONTROL FLOW GRAPH SSA @@ -95,7 +96,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_str: scope:[print_str] from main::@1 main::@11 (byte*) print_char_cursor#136 ← phi( main::@1/(byte*) print_char_cursor#23 main::@11/(byte*) print_char_cursor#33 ) (byte*) print_str::str#5 ← phi( main::@1/(byte*) print_str::str#1 main::@11/(byte*) print_str::str#2 ) @@ -257,12 +258,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#76 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#6 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#142 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#75 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@38 + to:@39 print_byte: scope:[print_byte] from print_mulf8u127::@1 print_mulf8u127::@3 print_sbyte::@2 print_word print_word::@1 (byte*) print_char_cursor#131 ← phi( print_mulf8u127::@1/(byte*) print_char_cursor#133 print_mulf8u127::@3/(byte*) print_char_cursor#48 print_sbyte::@2/(byte*) print_char_cursor#129 print_word/(byte*) print_char_cursor#130 print_word::@1/(byte*) print_char_cursor#13 ) (byte) print_byte::b#5 ← phi( print_mulf8u127::@1/(byte) print_byte::b#3 print_mulf8u127::@3/(byte) print_byte::b#4 print_sbyte::@2/(byte) print_byte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 ) @@ -318,10 +319,10 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#82 return to:@return -main: scope:[main] from @40 - (byte*) print_char_cursor#132 ← phi( @40/(byte*) print_char_cursor#135 ) - (byte*) print_line_cursor#64 ← phi( @40/(byte*) print_line_cursor#69 ) - (byte*) print_screen#3 ← phi( @40/(byte*) print_screen#4 ) +main: scope:[main] from @41 + (byte*) print_char_cursor#132 ← phi( @41/(byte*) print_char_cursor#135 ) + (byte*) print_line_cursor#64 ← phi( @41/(byte*) print_line_cursor#69 ) + (byte*) print_screen#3 ← phi( @41/(byte*) print_screen#4 ) call print_cls to:main::@1 main::@1: scope:[main] from main @@ -675,15 +676,15 @@ print_mulf8s127::@return: scope:[print_mulf8s127] from print_mulf8s127::@7 (byte*) print_line_cursor#30 ← (byte*) print_line_cursor#61 return to:@return -@38: scope:[] from @28 - (byte*) print_screen#5 ← phi( @28/(byte*) print_screen#6 ) - (byte*) print_char_cursor#141 ← phi( @28/(byte*) print_char_cursor#142 ) - (byte*) print_line_cursor#72 ← phi( @28/(byte*) print_line_cursor#75 ) +@39: scope:[] from @29 + (byte*) print_screen#5 ← phi( @29/(byte*) print_screen#6 ) + (byte*) print_char_cursor#141 ← phi( @29/(byte*) print_char_cursor#142 ) + (byte*) print_line_cursor#72 ← phi( @29/(byte*) print_line_cursor#75 ) (byte[$200]) mulf127_sqr1_lo#0 ← kickasm {{ .fill 512, round((i/127*i/127)*127/4) }} (byte[$200]) mulf127_sqr2_lo#0 ← kickasm {{ .fill 512, round(((i-255)/127*(i-255)/127)*127/4) }} - to:@40 + to:@41 mulf8u127: scope:[mulf8u127] from mulf8s127 print_mulf8u127 (byte) mulf8u127::b#2 ← phi( mulf8s127/(byte) mulf8u127::b#1 print_mulf8u127/(byte) mulf8u127::b#0 ) (byte) mulf8u127::a#2 ← phi( mulf8s127/(byte) mulf8u127::a#1 print_mulf8u127/(byte) mulf8u127::a#0 ) @@ -770,27 +771,27 @@ mulf8s127::@return: scope:[mulf8s127] from mulf8s127::@3 (signed word) mulf8s127::return#2 ← (signed word) mulf8s127::return#4 return to:@return -@40: scope:[] from @38 - (byte*) print_screen#4 ← phi( @38/(byte*) print_screen#5 ) - (byte*) print_char_cursor#135 ← phi( @38/(byte*) print_char_cursor#141 ) - (byte*) print_line_cursor#69 ← phi( @38/(byte*) print_line_cursor#72 ) +@41: scope:[] from @39 + (byte*) print_screen#4 ← phi( @39/(byte*) print_screen#5 ) + (byte*) print_char_cursor#135 ← phi( @39/(byte*) print_char_cursor#141 ) + (byte*) print_line_cursor#69 ← phi( @39/(byte*) print_line_cursor#72 ) call main - to:@41 -@41: scope:[] from @40 - (byte*) print_char_cursor#121 ← phi( @40/(byte*) print_char_cursor#46 ) - (byte*) print_line_cursor#62 ← phi( @40/(byte*) print_line_cursor#26 ) + to:@42 +@42: scope:[] from @41 + (byte*) print_char_cursor#121 ← phi( @41/(byte*) print_char_cursor#46 ) + (byte*) print_line_cursor#62 ← phi( @41/(byte*) print_line_cursor#26 ) (byte*) print_line_cursor#31 ← (byte*) print_line_cursor#62 (byte*) print_char_cursor#61 ← (byte*) print_char_cursor#121 to:@end -@end: scope:[] from @41 +@end: scope:[] from @42 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @38 -(label) @40 +(label) @29 +(label) @39 (label) @41 +(label) @42 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -2027,10 +2028,10 @@ Added new block during phi lifting mulf8s127::@11(between mulf8s127::@1 and mulf Added new block during phi lifting mulf8s127::@12(between mulf8s127::@2 and mulf8s127::@3) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @38 -Adding NOP phi() at start of @40 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @39 Adding NOP phi() at start of @41 +Adding NOP phi() at start of @42 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -2136,9 +2137,9 @@ Coalesced (already) [217] print_char_cursor#149 ← print_char_cursor#19 Coalesced [233] memset::dst#3 ← memset::dst#1 Coalesced down to 16 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @38 -Culled Empty Block (label) @41 +Culled Empty Block (label) @29 +Culled Empty Block (label) @39 +Culled Empty Block (label) @42 Culled Empty Block (label) main::@23 Culled Empty Block (label) print_mulf8s127::@7 Culled Empty Block (label) print_ln::@2 @@ -2156,7 +2157,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @40 to @1 +Renumbering block @41 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block print_sbyte::@5 to print_sbyte::@4 diff --git a/src/test/ref/incrementinarray.log b/src/test/ref/incrementinarray.log index b6ce59126..7f27373e8 100644 --- a/src/test/ref/incrementinarray.log +++ b/src/test/ref/incrementinarray.log @@ -44,6 +44,7 @@ Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @@ -89,7 +90,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@35 + to:@36 print_str: scope:[print_str] from main::@1 (byte*) print_char_cursor#27 ← phi( main::@1/(byte*) print_char_cursor#25 ) (byte*) print_str::str#4 ← phi( main::@1/(byte*) print_str::str#1 ) @@ -155,16 +156,16 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#16 return to:@return -@35: scope:[] from @12 +@36: scope:[] from @12 (byte*) print_screen#5 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#28 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#22 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) txt#0 ← (const string) $0 - to:@36 -main: scope:[main] from @36 - (byte*) print_char_cursor#24 ← phi( @36/(byte*) print_char_cursor#26 ) - (byte*) print_line_cursor#18 ← phi( @36/(byte*) print_line_cursor#20 ) - (byte*) print_screen#3 ← phi( @36/(byte*) print_screen#4 ) + to:@37 +main: scope:[main] from @37 + (byte*) print_char_cursor#24 ← phi( @37/(byte*) print_char_cursor#26 ) + (byte*) print_line_cursor#18 ← phi( @37/(byte*) print_line_cursor#20 ) + (byte*) print_screen#3 ← phi( @37/(byte*) print_screen#4 ) call print_cls to:main::@3 main::@3: scope:[main] from main @@ -206,26 +207,26 @@ main::@return: scope:[main] from main::@5 (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#20 return to:@return -@36: scope:[] from @35 - (byte*) print_screen#4 ← phi( @35/(byte*) print_screen#5 ) - (byte*) print_char_cursor#26 ← phi( @35/(byte*) print_char_cursor#28 ) - (byte*) print_line_cursor#20 ← phi( @35/(byte*) print_line_cursor#22 ) - call main - to:@37 @37: scope:[] from @36 - (byte*) print_char_cursor#21 ← phi( @36/(byte*) print_char_cursor#10 ) - (byte*) print_line_cursor#16 ← phi( @36/(byte*) print_line_cursor#7 ) + (byte*) print_screen#4 ← phi( @36/(byte*) print_screen#5 ) + (byte*) print_char_cursor#26 ← phi( @36/(byte*) print_char_cursor#28 ) + (byte*) print_line_cursor#20 ← phi( @36/(byte*) print_line_cursor#22 ) + call main + to:@38 +@38: scope:[] from @37 + (byte*) print_char_cursor#21 ← phi( @37/(byte*) print_char_cursor#10 ) + (byte*) print_line_cursor#16 ← phi( @37/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#21 to:@end -@end: scope:[] from @37 +@end: scope:[] from @38 SYMBOL TABLE SSA (const string) $0 = (string) "camelot@" (label) @12 -(label) @35 (label) @36 (label) @37 +(label) @38 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -496,9 +497,9 @@ Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_l Added new block during phi lifting main::@6(between main::@5 and main::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @35 Adding NOP phi() at start of @36 Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -526,8 +527,8 @@ Coalesced [36] print_char_cursor#30 ← print_char_cursor#1 Coalesced [49] memset::dst#3 ← memset::dst#1 Coalesced down to 5 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @35 -Culled Empty Block (label) @37 +Culled Empty Block (label) @36 +Culled Empty Block (label) @38 Culled Empty Block (label) main::@3 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 @@ -535,7 +536,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @36 to @1 +Renumbering block @37 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block main::@4 to main::@2 Renumbering block main::@5 to main::@3 diff --git a/src/test/ref/linegen.log b/src/test/ref/linegen.log index e58b57766..9c72e5b1f 100644 --- a/src/test/ref/linegen.log +++ b/src/test/ref/linegen.log @@ -49,7 +49,7 @@ Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 -Culled Empty Block (label) @37 +Culled Empty Block (label) @36 Culled Empty Block (label) @38 Culled Empty Block (label) @39 Culled Empty Block (label) @40 @@ -57,6 +57,7 @@ Culled Empty Block (label) @41 Culled Empty Block (label) @42 Culled Empty Block (label) @43 Culled Empty Block (label) @44 +Culled Empty Block (label) @45 Culled Empty Block (label) lin16u_gen::@2 CONTROL FLOW GRAPH SSA @@ -183,7 +184,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@36 + to:@37 print_str: scope:[print_str] from main::@10 main::@14 main::@16 main::@18 main::@2 main::@23 main::@25 main::@6 main::@8 (byte*) print_char_cursor#86 ← phi( main::@10/(byte*) print_char_cursor#19 main::@14/(byte*) print_char_cursor#23 main::@16/(byte*) print_char_cursor#25 main::@18/(byte*) print_char_cursor#27 main::@2/(byte*) print_char_cursor#84 main::@23/(byte*) print_char_cursor#32 main::@25/(byte*) print_char_cursor#34 main::@6/(byte*) print_char_cursor#15 main::@8/(byte*) print_char_cursor#17 ) (byte*) print_str::str#12 ← phi( main::@10/(byte*) print_str::str#3 main::@14/(byte*) print_str::str#4 main::@16/(byte*) print_str::str#5 main::@18/(byte*) print_str::str#6 main::@2/(byte*) print_str::str#7 main::@23/(byte*) print_str::str#8 main::@25/(byte*) print_str::str#9 main::@6/(byte*) print_str::str#1 main::@8/(byte*) print_str::str#2 ) @@ -253,13 +254,13 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#46 return to:@return -@36: scope:[] from @20 +@37: scope:[] from @20 (byte*) print_screen#8 ← phi( @20/(byte*) print_screen#0 ) (byte*) print_char_cursor#88 ← phi( @20/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#31 ← phi( @20/(byte*) print_line_cursor#0 ) (word) rem16u#26 ← phi( @20/(word) rem16u#27 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@45 + to:@46 print_byte: scope:[print_byte] from main::@1 print_word print_word::@1 (byte*) print_char_cursor#81 ← phi( main::@1/(byte*) print_char_cursor#83 print_word/(byte*) print_char_cursor#80 print_word::@1/(byte*) print_char_cursor#5 ) (byte) print_byte::b#3 ← phi( main::@1/(byte) print_byte::b#2 print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -315,11 +316,11 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#52 return to:@return -main: scope:[main] from @45 - (byte*) print_char_cursor#90 ← phi( @45/(byte*) print_char_cursor#85 ) - (byte*) print_line_cursor#36 ← phi( @45/(byte*) print_line_cursor#26 ) - (byte*) print_screen#6 ← phi( @45/(byte*) print_screen#7 ) - (word) rem16u#20 ← phi( @45/(word) rem16u#24 ) +main: scope:[main] from @46 + (byte*) print_char_cursor#90 ← phi( @46/(byte*) print_char_cursor#85 ) + (byte*) print_line_cursor#36 ← phi( @46/(byte*) print_line_cursor#26 ) + (byte*) print_screen#6 ← phi( @46/(byte*) print_screen#7 ) + (word) rem16u#20 ← phi( @46/(word) rem16u#24 ) (word[$14]) main::lintab1#0 ← { fill( $14, 0) } (word) lin16u_gen::min#0 ← (number) $22d (word) lin16u_gen::max#0 ← (number) $7461 @@ -645,30 +646,30 @@ lin16u_gen::@return: scope:[lin16u_gen] from lin16u_gen::@1 (word) rem16u#9 ← (word) rem16u#18 return to:@return -@45: scope:[] from @36 - (byte*) print_screen#7 ← phi( @36/(byte*) print_screen#8 ) - (byte*) print_char_cursor#85 ← phi( @36/(byte*) print_char_cursor#88 ) - (byte*) print_line_cursor#26 ← phi( @36/(byte*) print_line_cursor#31 ) - (word) rem16u#24 ← phi( @36/(word) rem16u#26 ) +@46: scope:[] from @37 + (byte*) print_screen#7 ← phi( @37/(byte*) print_screen#8 ) + (byte*) print_char_cursor#85 ← phi( @37/(byte*) print_char_cursor#88 ) + (byte*) print_line_cursor#26 ← phi( @37/(byte*) print_line_cursor#31 ) + (word) rem16u#24 ← phi( @37/(word) rem16u#26 ) call main - to:@46 -@46: scope:[] from @45 - (byte*) print_char_cursor#77 ← phi( @45/(byte*) print_char_cursor#38 ) - (byte*) print_line_cursor#20 ← phi( @45/(byte*) print_line_cursor#9 ) - (word) rem16u#19 ← phi( @45/(word) rem16u#6 ) + to:@47 +@47: scope:[] from @46 + (byte*) print_char_cursor#77 ← phi( @46/(byte*) print_char_cursor#38 ) + (byte*) print_line_cursor#20 ← phi( @46/(byte*) print_line_cursor#9 ) + (word) rem16u#19 ← phi( @46/(word) rem16u#6 ) (word) rem16u#10 ← (word) rem16u#19 (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#20 (byte*) print_char_cursor#39 ← (byte*) print_char_cursor#77 to:@end -@end: scope:[] from @46 +@end: scope:[] from @47 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @2 (label) @20 -(label) @36 -(label) @45 +(label) @37 (label) @46 +(label) @47 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -1693,9 +1694,9 @@ Added new block during phi lifting lin16u_gen::@5(between lin16u_gen::@1 and lin Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 Adding NOP phi() at start of @20 -Adding NOP phi() at start of @36 -Adding NOP phi() at start of @45 +Adding NOP phi() at start of @37 Adding NOP phi() at start of @46 +Adding NOP phi() at start of @47 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -1781,8 +1782,8 @@ Coalesced [191] divr16u::rem#15 ← divr16u::rem#0 Coalesced down to 18 phi equivalence classes Culled Empty Block (label) @2 Culled Empty Block (label) @20 -Culled Empty Block (label) @36 -Culled Empty Block (label) @46 +Culled Empty Block (label) @37 +Culled Empty Block (label) @47 Culled Empty Block (label) main::@13 Culled Empty Block (label) main::@28 Culled Empty Block (label) main::@29 @@ -1798,7 +1799,7 @@ Culled Empty Block (label) lin16u_gen::@5 Culled Empty Block (label) divr16u::@8 Culled Empty Block (label) divr16u::@10 Culled Empty Block (label) divr16u::@9 -Renumbering block @45 to @1 +Renumbering block @46 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block main::@14 to main::@13 Renumbering block main::@15 to main::@14 diff --git a/src/test/ref/min-fmul-16.log b/src/test/ref/min-fmul-16.log index e76c2d9b1..7f9672a30 100644 --- a/src/test/ref/min-fmul-16.log +++ b/src/test/ref/min-fmul-16.log @@ -36,12 +36,13 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Culled Empty Block (label) main::@2 Culled Empty Block (label) main::@11 Culled Empty Block (label) main::@3 @@ -51,7 +52,7 @@ Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@9 Culled Empty Block (label) main::@10 -Culled Empty Block (label) @37 +Culled Empty Block (label) @38 Culled Empty Block (label) mulf16u::@1 CONTROL FLOW GRAPH SSA @@ -61,7 +62,7 @@ CONTROL FLOW GRAPH SSA (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_word: scope:[print_word] from print_dword print_dword::@1 (byte*) print_char_cursor#34 ← phi( print_dword/(byte*) print_char_cursor#35 print_dword::@1/(byte*) print_char_cursor#4 ) (word) print_word::w#2 ← phi( print_dword/(word) print_word::w#0 print_dword::@1/(word) print_word::w#1 ) @@ -110,12 +111,12 @@ print_dword::@return: scope:[print_dword] from print_dword::@2 (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#23 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_line_cursor#19 ← phi( @12/(byte*) print_line_cursor#0 ) (byte*) print_screen#19 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#46 ← phi( @12/(byte*) print_char_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@35 + to:@36 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#36 ← phi( print_word/(byte*) print_char_cursor#34 print_word::@1/(byte*) print_char_cursor#1 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -166,18 +167,18 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen (byte*) print_char_cursor#13 ← (byte*) print_char_cursor#29 return to:@return -@35: scope:[] from @28 - (byte*) print_line_cursor#18 ← phi( @28/(byte*) print_line_cursor#19 ) - (byte*) print_screen#18 ← phi( @28/(byte*) print_screen#19 ) - (byte*) print_char_cursor#45 ← phi( @28/(byte*) print_char_cursor#46 ) +@36: scope:[] from @29 + (byte*) print_line_cursor#18 ← phi( @29/(byte*) print_line_cursor#19 ) + (byte*) print_screen#18 ← phi( @29/(byte*) print_screen#19 ) + (byte*) print_char_cursor#45 ← phi( @29/(byte*) print_char_cursor#46 ) (byte*) RASTER#0 ← ((byte*)) (number) $d012 (byte*) BORDERCOL#0 ← ((byte*)) (number) $d020 (byte*) SCREEN#0 ← ((byte*)) (number) $400 - to:@36 -main: scope:[main] from @38 - (byte*) print_line_cursor#16 ← phi( @38/(byte*) print_line_cursor#12 ) - (byte*) print_screen#16 ← phi( @38/(byte*) print_screen#12 ) - (byte*) print_char_cursor#43 ← phi( @38/(byte*) print_char_cursor#39 ) + to:@37 +main: scope:[main] from @39 + (byte*) print_line_cursor#16 ← phi( @39/(byte*) print_line_cursor#12 ) + (byte*) print_screen#16 ← phi( @39/(byte*) print_screen#12 ) + (byte*) print_char_cursor#43 ← phi( @39/(byte*) print_char_cursor#39 ) call mulf_init to:main::@13 main::@13: scope:[main] from main @@ -247,15 +248,15 @@ main::@return: scope:[main] from main::@1 (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#8 return to:@return -@36: scope:[] from @35 - (byte*) print_line_cursor#15 ← phi( @35/(byte*) print_line_cursor#18 ) - (byte*) print_screen#15 ← phi( @35/(byte*) print_screen#18 ) - (byte*) print_char_cursor#42 ← phi( @35/(byte*) print_char_cursor#45 ) +@37: scope:[] from @36 + (byte*) print_line_cursor#15 ← phi( @36/(byte*) print_line_cursor#18 ) + (byte*) print_screen#15 ← phi( @36/(byte*) print_screen#18 ) + (byte*) print_char_cursor#42 ← phi( @36/(byte*) print_char_cursor#45 ) (byte[$200]) mulf_sqr1_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr1_hi#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_hi#0 ← { fill( $200, 0) } - to:@38 + to:@39 mulf_init: scope:[mulf_init] from main (word) mulf_init::sqr#0 ← (number) 0 (byte) mulf_init::x_2#0 ← (number) 0 @@ -368,30 +369,30 @@ mulf16u::@return: scope:[mulf16u] from mulf16u (dword) mulf16u::return#2 ← (dword) mulf16u::return#4 return to:@return -@38: scope:[] from @36 - (byte*) print_line_cursor#12 ← phi( @36/(byte*) print_line_cursor#15 ) - (byte*) print_screen#12 ← phi( @36/(byte*) print_screen#15 ) - (byte*) print_char_cursor#39 ← phi( @36/(byte*) print_char_cursor#42 ) +@39: scope:[] from @37 + (byte*) print_line_cursor#12 ← phi( @37/(byte*) print_line_cursor#15 ) + (byte*) print_screen#12 ← phi( @37/(byte*) print_screen#15 ) + (byte*) print_char_cursor#39 ← phi( @37/(byte*) print_char_cursor#42 ) call main - to:@39 -@39: scope:[] from @38 - (byte*) print_line_cursor#9 ← phi( @38/(byte*) print_line_cursor#4 ) - (byte*) print_screen#9 ← phi( @38/(byte*) print_screen#4 ) - (byte*) print_char_cursor#33 ← phi( @38/(byte*) print_char_cursor#16 ) + to:@40 +@40: scope:[] from @39 + (byte*) print_line_cursor#9 ← phi( @39/(byte*) print_line_cursor#4 ) + (byte*) print_screen#9 ← phi( @39/(byte*) print_screen#4 ) + (byte*) print_char_cursor#33 ← phi( @39/(byte*) print_char_cursor#16 ) (byte*) print_char_cursor#17 ← (byte*) print_char_cursor#33 (byte*) print_screen#5 ← (byte*) print_screen#9 (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#9 to:@end -@end: scope:[] from @39 +@end: scope:[] from @40 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @35 +(label) @29 (label) @36 -(label) @38 +(label) @37 (label) @39 +(label) @40 (label) @begin (label) @end (byte*) BORDERCOL @@ -953,11 +954,11 @@ Added new block during phi lifting mulf_init::@11(between mulf_init::@6 and mulf Added new block during phi lifting mulf_init::@12(between mulf_init::@5 and mulf_init::@6) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @35 +Adding NOP phi() at start of @29 Adding NOP phi() at start of @36 -Adding NOP phi() at start of @38 +Adding NOP phi() at start of @37 Adding NOP phi() at start of @39 +Adding NOP phi() at start of @40 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@15 @@ -1005,10 +1006,10 @@ Coalesced [111] mulf_init::sqr#7 ← mulf_init::sqr#4 Coalesced (already) [112] mulf_init::x_2#6 ← mulf_init::x_2#3 Coalesced down to 13 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @35 +Culled Empty Block (label) @29 Culled Empty Block (label) @36 -Culled Empty Block (label) @39 +Culled Empty Block (label) @37 +Culled Empty Block (label) @40 Culled Empty Block (label) main::@16 Culled Empty Block (label) print_dword::@2 Culled Empty Block (label) print_word::@2 @@ -1018,7 +1019,7 @@ Culled Empty Block (label) mulf_init::@7 Culled Empty Block (label) mulf_init::@11 Culled Empty Block (label) mulf_init::@9 Culled Empty Block (label) mulf_init::@10 -Renumbering block @38 to @1 +Renumbering block @39 to @1 Renumbering block main::@4 to main::@2 Renumbering block main::@6 to main::@3 Renumbering block main::@13 to main::@4 diff --git a/src/test/ref/plasma-center.log b/src/test/ref/plasma-center.log index b10ee003a..767ceea56 100644 --- a/src/test/ref/plasma-center.log +++ b/src/test/ref/plasma-center.log @@ -78,7 +78,8 @@ Culled Empty Block (label) @40 Culled Empty Block (label) @41 Culled Empty Block (label) @42 Culled Empty Block (label) @43 -Culled Empty Block (label) @45 +Culled Empty Block (label) @44 +Culled Empty Block (label) @46 Culled Empty Block (label) sid_rnd::@1 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::toD0182_@1 @@ -86,15 +87,15 @@ Culled Empty Block (label) main::@4 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@5 Culled Empty Block (label) main::@6 -Culled Empty Block (label) @48 -Culled Empty Block (label) init_angle_screen::@4 Culled Empty Block (label) @49 +Culled Empty Block (label) init_angle_screen::@4 +Culled Empty Block (label) @50 Culled Empty Block (label) init_dist_screen::@13 Culled Empty Block (label) init_dist_screen::@14 Culled Empty Block (label) init_dist_screen::@9 Culled Empty Block (label) init_dist_screen::@10 Culled Empty Block (label) init_dist_screen::@12 -Culled Empty Block (label) @50 +Culled Empty Block (label) @51 Culled Empty Block (label) make_plasma_charset::@10 CONTROL FLOW GRAPH SSA @@ -143,9 +144,9 @@ memset::@return: scope:[memset] from memset::@1 (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 to:@16 -malloc: scope:[malloc] from @46 @52 init_squares - (word) malloc::size#3 ← phi( @46/(word) malloc::size#1 @52/(word) malloc::size#2 init_squares/(word) malloc::size#0 ) - (byte*) heap_head#12 ← phi( @46/(byte*) heap_head#23 @52/(byte*) heap_head#5 init_squares/(byte*) heap_head#24 ) +malloc: scope:[malloc] from @47 @53 init_squares + (word) malloc::size#3 ← phi( @47/(word) malloc::size#1 @53/(word) malloc::size#2 init_squares/(word) malloc::size#0 ) + (byte*) heap_head#12 ← phi( @47/(byte*) heap_head#23 @53/(byte*) heap_head#5 init_squares/(byte*) heap_head#24 ) (byte*~) malloc::$0 ← (byte*) heap_head#12 - (word) malloc::size#3 (byte*) malloc::mem#0 ← (byte*~) malloc::$0 (byte*) heap_head#1 ← (byte*) malloc::mem#0 @@ -550,7 +551,7 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@44 + to:@45 print_char: scope:[print_char] from make_plasma_charset::@8 (byte*) print_char_cursor#11 ← phi( make_plasma_charset::@8/(byte*) print_char_cursor#20 ) (byte) print_char::ch#1 ← phi( make_plasma_charset::@8/(byte) print_char::ch#0 ) @@ -582,7 +583,7 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#13 return to:@return -@44: scope:[] from @21 +@45: scope:[] from @21 (byte*) print_screen#13 ← phi( @21/(byte*) print_screen#0 ) (byte*) print_char_cursor#43 ← phi( @21/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#38 ← phi( @21/(byte*) print_line_cursor#0 ) @@ -593,7 +594,7 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) SID_VOICE3_CONTROL#0 ← ((byte*)) (number) $d412 (byte) SID_CONTROL_NOISE#0 ← (number) $80 (byte*) SID_VOICE3_OSC#0 ← ((byte*)) (number) $d41b - to:@46 + to:@47 sid_rnd_init: scope:[sid_rnd_init] from make_plasma_charset *((word*) SID_VOICE3_FREQ#0) ← (number) $ffff *((byte*) SID_VOICE3_CONTROL#0) ← (byte) SID_CONTROL_NOISE#0 @@ -609,59 +610,59 @@ sid_rnd::@return: scope:[sid_rnd] from sid_rnd (byte) sid_rnd::return#1 ← (byte) sid_rnd::return#3 return to:@return -@46: scope:[] from @44 - (byte*) print_screen#12 ← phi( @44/(byte*) print_screen#13 ) - (byte*) print_char_cursor#39 ← phi( @44/(byte*) print_char_cursor#43 ) - (byte*) print_line_cursor#34 ← phi( @44/(byte*) print_line_cursor#38 ) - (word*) SQUARES#43 ← phi( @44/(word*) SQUARES#45 ) - (byte) NUM_SQUARES#32 ← phi( @44/(byte) NUM_SQUARES#35 ) - (byte*) heap_head#23 ← phi( @44/(byte*) heap_head#31 ) +@47: scope:[] from @45 + (byte*) print_screen#12 ← phi( @45/(byte*) print_screen#13 ) + (byte*) print_char_cursor#39 ← phi( @45/(byte*) print_char_cursor#43 ) + (byte*) print_line_cursor#34 ← phi( @45/(byte*) print_line_cursor#38 ) + (word*) SQUARES#43 ← phi( @45/(word*) SQUARES#45 ) + (byte) NUM_SQUARES#32 ← phi( @45/(byte) NUM_SQUARES#35 ) + (byte*) heap_head#23 ← phi( @45/(byte*) heap_head#31 ) (byte[$200]) SINTABLE#0 ← kickasm {{ .for(var i=0;i<$200;i++) .byte round(127.5+127.5*sin(2*PI*i/256)) }} (word) malloc::size#1 ← (number) $3e8 call malloc (void*) malloc::return#3 ← (void*) malloc::return#1 - to:@52 -@52: scope:[] from @46 - (byte*) print_screen#11 ← phi( @46/(byte*) print_screen#12 ) - (byte*) print_char_cursor#36 ← phi( @46/(byte*) print_char_cursor#39 ) - (byte*) print_line_cursor#31 ← phi( @46/(byte*) print_line_cursor#34 ) - (word*) SQUARES#39 ← phi( @46/(word*) SQUARES#43 ) - (byte) NUM_SQUARES#28 ← phi( @46/(byte) NUM_SQUARES#32 ) - (byte*) heap_head#16 ← phi( @46/(byte*) heap_head#2 ) - (void*) malloc::return#7 ← phi( @46/(void*) malloc::return#3 ) + to:@53 +@53: scope:[] from @47 + (byte*) print_screen#11 ← phi( @47/(byte*) print_screen#12 ) + (byte*) print_char_cursor#36 ← phi( @47/(byte*) print_char_cursor#39 ) + (byte*) print_line_cursor#31 ← phi( @47/(byte*) print_line_cursor#34 ) + (word*) SQUARES#39 ← phi( @47/(word*) SQUARES#43 ) + (byte) NUM_SQUARES#28 ← phi( @47/(byte) NUM_SQUARES#32 ) + (byte*) heap_head#16 ← phi( @47/(byte*) heap_head#2 ) + (void*) malloc::return#7 ← phi( @47/(void*) malloc::return#3 ) (void*~) $0 ← (void*) malloc::return#7 (byte*) heap_head#5 ← (byte*) heap_head#16 (byte*) SCREEN_DIST#0 ← ((byte*)) (void*~) $0 (word) malloc::size#2 ← (number) $3e8 call malloc (void*) malloc::return#4 ← (void*) malloc::return#1 - to:@53 -@53: scope:[] from @52 - (byte*) print_screen#10 ← phi( @52/(byte*) print_screen#11 ) - (byte*) print_char_cursor#34 ← phi( @52/(byte*) print_char_cursor#36 ) - (byte*) print_line_cursor#28 ← phi( @52/(byte*) print_line_cursor#31 ) - (word*) SQUARES#36 ← phi( @52/(word*) SQUARES#39 ) - (byte) NUM_SQUARES#25 ← phi( @52/(byte) NUM_SQUARES#28 ) - (byte*) heap_head#17 ← phi( @52/(byte*) heap_head#2 ) - (void*) malloc::return#8 ← phi( @52/(void*) malloc::return#4 ) + to:@54 +@54: scope:[] from @53 + (byte*) print_screen#10 ← phi( @53/(byte*) print_screen#11 ) + (byte*) print_char_cursor#34 ← phi( @53/(byte*) print_char_cursor#36 ) + (byte*) print_line_cursor#28 ← phi( @53/(byte*) print_line_cursor#31 ) + (word*) SQUARES#36 ← phi( @53/(word*) SQUARES#39 ) + (byte) NUM_SQUARES#25 ← phi( @53/(byte) NUM_SQUARES#28 ) + (byte*) heap_head#17 ← phi( @53/(byte*) heap_head#2 ) + (void*) malloc::return#8 ← phi( @53/(void*) malloc::return#4 ) (void*~) $1 ← (void*) malloc::return#8 (byte*) heap_head#6 ← (byte*) heap_head#17 (byte*) SCREEN_ANGLE#0 ← ((byte*)) (void*~) $1 (byte*) CHARSET#0 ← ((byte*)) (number) $2000 (byte*) SCREEN1#0 ← ((byte*)) (number) $2800 (byte*) SCREEN2#0 ← ((byte*)) (number) $2c00 - to:@47 -main: scope:[main] from @51 - (byte) sin_offset_y#30 ← phi( @51/(byte) sin_offset_y#18 ) - (byte) sin_offset_x#30 ← phi( @51/(byte) sin_offset_x#18 ) - (byte*) print_screen#7 ← phi( @51/(byte*) print_screen#8 ) - (byte*) print_char_cursor#32 ← phi( @51/(byte*) print_char_cursor#25 ) - (byte*) print_line_cursor#26 ← phi( @51/(byte*) print_line_cursor#18 ) - (word*) SQUARES#21 ← phi( @51/(word*) SQUARES#25 ) - (byte*) heap_head#26 ← phi( @51/(byte*) heap_head#30 ) - (byte) NUM_SQUARES#14 ← phi( @51/(byte) NUM_SQUARES#17 ) + to:@48 +main: scope:[main] from @52 + (byte) sin_offset_y#30 ← phi( @52/(byte) sin_offset_y#18 ) + (byte) sin_offset_x#30 ← phi( @52/(byte) sin_offset_x#18 ) + (byte*) print_screen#7 ← phi( @52/(byte*) print_screen#8 ) + (byte*) print_char_cursor#32 ← phi( @52/(byte*) print_char_cursor#25 ) + (byte*) print_line_cursor#26 ← phi( @52/(byte*) print_line_cursor#18 ) + (word*) SQUARES#21 ← phi( @52/(word*) SQUARES#25 ) + (byte*) heap_head#26 ← phi( @52/(byte*) heap_head#30 ) + (byte) NUM_SQUARES#14 ← phi( @52/(byte) NUM_SQUARES#17 ) (byte*) init_dist_screen::screen#0 ← (byte*) SCREEN_DIST#0 call init_dist_screen to:main::@9 @@ -871,16 +872,16 @@ main::@return: scope:[main] from main::@1 (byte) sin_offset_y#2 ← (byte) sin_offset_y#9 return to:@return -@47: scope:[] from @53 - (byte*) print_screen#9 ← phi( @53/(byte*) print_screen#10 ) - (byte*) print_char_cursor#31 ← phi( @53/(byte*) print_char_cursor#34 ) - (byte*) print_line_cursor#25 ← phi( @53/(byte*) print_line_cursor#28 ) - (word*) SQUARES#33 ← phi( @53/(word*) SQUARES#36 ) - (byte*) heap_head#35 ← phi( @53/(byte*) heap_head#6 ) - (byte) NUM_SQUARES#22 ← phi( @53/(byte) NUM_SQUARES#25 ) +@48: scope:[] from @54 + (byte*) print_screen#9 ← phi( @54/(byte*) print_screen#10 ) + (byte*) print_char_cursor#31 ← phi( @54/(byte*) print_char_cursor#34 ) + (byte*) print_line_cursor#25 ← phi( @54/(byte*) print_line_cursor#28 ) + (word*) SQUARES#33 ← phi( @54/(word*) SQUARES#36 ) + (byte*) heap_head#35 ← phi( @54/(byte*) heap_head#6 ) + (byte) NUM_SQUARES#22 ← phi( @54/(byte) NUM_SQUARES#25 ) (byte) sin_offset_x#3 ← (number) 0 (byte) sin_offset_y#3 ← (number) 0 - to:@51 + to:@52 doplasma: scope:[doplasma] from main::@2 main::@7 (byte*) doplasma::screen#6 ← phi( main::@2/(byte*) doplasma::screen#0 main::@7/(byte*) doplasma::screen#1 ) (byte) sin_offset_y#10 ← phi( main::@2/(byte) sin_offset_y#14 main::@7/(byte) sin_offset_y#15 ) @@ -1372,25 +1373,25 @@ make_plasma_charset::@return: scope:[make_plasma_charset] from make_plasma_char (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#18 return to:@return -@51: scope:[] from @47 - (byte*) print_screen#8 ← phi( @47/(byte*) print_screen#9 ) - (byte) sin_offset_y#18 ← phi( @47/(byte) sin_offset_y#3 ) - (byte) sin_offset_x#18 ← phi( @47/(byte) sin_offset_x#3 ) - (byte*) print_char_cursor#25 ← phi( @47/(byte*) print_char_cursor#31 ) - (byte*) print_line_cursor#18 ← phi( @47/(byte*) print_line_cursor#25 ) - (word*) SQUARES#25 ← phi( @47/(word*) SQUARES#33 ) - (byte*) heap_head#30 ← phi( @47/(byte*) heap_head#35 ) - (byte) NUM_SQUARES#17 ← phi( @47/(byte) NUM_SQUARES#22 ) +@52: scope:[] from @48 + (byte*) print_screen#8 ← phi( @48/(byte*) print_screen#9 ) + (byte) sin_offset_y#18 ← phi( @48/(byte) sin_offset_y#3 ) + (byte) sin_offset_x#18 ← phi( @48/(byte) sin_offset_x#3 ) + (byte*) print_char_cursor#25 ← phi( @48/(byte*) print_char_cursor#31 ) + (byte*) print_line_cursor#18 ← phi( @48/(byte*) print_line_cursor#25 ) + (word*) SQUARES#25 ← phi( @48/(word*) SQUARES#33 ) + (byte*) heap_head#30 ← phi( @48/(byte*) heap_head#35 ) + (byte) NUM_SQUARES#17 ← phi( @48/(byte) NUM_SQUARES#22 ) call main - to:@54 -@54: scope:[] from @51 - (byte) sin_offset_y#13 ← phi( @51/(byte) sin_offset_y#2 ) - (byte) sin_offset_x#13 ← phi( @51/(byte) sin_offset_x#2 ) - (byte*) print_char_cursor#19 ← phi( @51/(byte*) print_char_cursor#6 ) - (byte*) print_line_cursor#13 ← phi( @51/(byte*) print_line_cursor#4 ) - (word*) SQUARES#16 ← phi( @51/(word*) SQUARES#4 ) - (byte*) heap_head#22 ← phi( @51/(byte*) heap_head#8 ) - (byte) NUM_SQUARES#12 ← phi( @51/(byte) NUM_SQUARES#2 ) + to:@55 +@55: scope:[] from @52 + (byte) sin_offset_y#13 ← phi( @52/(byte) sin_offset_y#2 ) + (byte) sin_offset_x#13 ← phi( @52/(byte) sin_offset_x#2 ) + (byte*) print_char_cursor#19 ← phi( @52/(byte*) print_char_cursor#6 ) + (byte*) print_line_cursor#13 ← phi( @52/(byte*) print_line_cursor#4 ) + (word*) SQUARES#16 ← phi( @52/(word*) SQUARES#4 ) + (byte*) heap_head#22 ← phi( @52/(byte*) heap_head#8 ) + (byte) NUM_SQUARES#12 ← phi( @52/(byte) NUM_SQUARES#2 ) (byte) NUM_SQUARES#5 ← (byte) NUM_SQUARES#12 (byte*) heap_head#11 ← (byte*) heap_head#22 (word*) SQUARES#7 ← (word*) SQUARES#16 @@ -1399,7 +1400,7 @@ make_plasma_charset::@return: scope:[make_plasma_charset] from make_plasma_char (byte) sin_offset_x#6 ← (byte) sin_offset_x#13 (byte) sin_offset_y#6 ← (byte) sin_offset_y#13 to:@end -@end: scope:[] from @54 +@end: scope:[] from @55 SYMBOL TABLE SSA (void*~) $0 @@ -1407,13 +1408,13 @@ SYMBOL TABLE SSA (label) @16 (label) @19 (label) @21 -(label) @44 -(label) @46 +(label) @45 (label) @47 -(label) @51 +(label) @48 (label) @52 (label) @53 (label) @54 +(label) @55 (label) @8 (label) @begin (label) @end @@ -3796,11 +3797,11 @@ Adding NOP phi() at start of @8 Adding NOP phi() at start of @16 Adding NOP phi() at start of @19 Adding NOP phi() at start of @21 -Adding NOP phi() at start of @44 -Adding NOP phi() at start of @46 +Adding NOP phi() at start of @45 Adding NOP phi() at start of @47 -Adding NOP phi() at start of @51 -Adding NOP phi() at start of @54 +Adding NOP phi() at start of @48 +Adding NOP phi() at start of @52 +Adding NOP phi() at start of @55 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@10 Adding NOP phi() at start of main::@11 @@ -3929,9 +3930,9 @@ Culled Empty Block (label) @8 Culled Empty Block (label) @16 Culled Empty Block (label) @19 Culled Empty Block (label) @21 -Culled Empty Block (label) @44 -Culled Empty Block (label) @47 -Culled Empty Block (label) @54 +Culled Empty Block (label) @45 +Culled Empty Block (label) @48 +Culled Empty Block (label) @55 Culled Empty Block (label) main::@12 Culled Empty Block (label) main::@13 Culled Empty Block (label) main::toD0181_@return @@ -3962,10 +3963,10 @@ Culled Empty Block (label) init_dist_screen::@20 Culled Empty Block (label) bsearch16u::@1 Culled Empty Block (label) bsearch16u::@18 Culled Empty Block (label) init_squares::@4 -Renumbering block @46 to @1 -Renumbering block @51 to @2 -Renumbering block @52 to @3 -Renumbering block @53 to @4 +Renumbering block @47 to @1 +Renumbering block @52 to @2 +Renumbering block @53 to @3 +Renumbering block @54 to @4 Renumbering block memset::@2 to memset::@1 Renumbering block memset::@4 to memset::@2 Renumbering block bsearch16u::@2 to bsearch16u::@1 diff --git a/src/test/ref/printmsg.log b/src/test/ref/printmsg.log index 0ed44098c..d492f53d5 100644 --- a/src/test/ref/printmsg.log +++ b/src/test/ref/printmsg.log @@ -42,6 +42,7 @@ Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -50,7 +51,7 @@ CONTROL FLOW GRAPH SSA (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@35 + to:@36 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) print_char_cursor#29 ← phi( main/(byte*) print_char_cursor#27 main::@2/(byte*) print_char_cursor#6 main::@4/(byte*) print_char_cursor#8 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -96,16 +97,16 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#16 return to:@return -@35: scope:[] from @12 +@36: scope:[] from @12 (byte*) print_line_cursor#22 ← phi( @12/(byte*) print_line_cursor#0 ) (byte*) print_char_cursor#30 ← phi( @12/(byte*) print_char_cursor#0 ) (byte[]) msg#0 ← (const string) $0 (byte[]) msg2#0 ← (const string) $1 (byte[]) msg3#0 ← (const string) $2 - to:@36 -main: scope:[main] from @36 - (byte*) print_line_cursor#21 ← phi( @36/(byte*) print_line_cursor#20 ) - (byte*) print_char_cursor#27 ← phi( @36/(byte*) print_char_cursor#28 ) + to:@37 +main: scope:[main] from @37 + (byte*) print_line_cursor#21 ← phi( @37/(byte*) print_line_cursor#20 ) + (byte*) print_char_cursor#27 ← phi( @37/(byte*) print_char_cursor#28 ) (byte*) print_str::str#1 ← (byte[]) msg#0 call print_str to:main::@1 @@ -156,27 +157,27 @@ main::@return: scope:[main] from main::@6 (byte*) print_line_cursor#6 ← (byte*) print_line_cursor#14 return to:@return -@36: scope:[] from @35 - (byte*) print_line_cursor#20 ← phi( @35/(byte*) print_line_cursor#22 ) - (byte*) print_char_cursor#28 ← phi( @35/(byte*) print_char_cursor#30 ) - call main - to:@37 @37: scope:[] from @36 - (byte*) print_line_cursor#15 ← phi( @36/(byte*) print_line_cursor#6 ) - (byte*) print_char_cursor#24 ← phi( @36/(byte*) print_char_cursor#11 ) + (byte*) print_line_cursor#20 ← phi( @36/(byte*) print_line_cursor#22 ) + (byte*) print_char_cursor#28 ← phi( @36/(byte*) print_char_cursor#30 ) + call main + to:@38 +@38: scope:[] from @37 + (byte*) print_line_cursor#15 ← phi( @37/(byte*) print_line_cursor#6 ) + (byte*) print_char_cursor#24 ← phi( @37/(byte*) print_char_cursor#11 ) (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#24 (byte*) print_line_cursor#7 ← (byte*) print_line_cursor#15 to:@end -@end: scope:[] from @37 +@end: scope:[] from @38 SYMBOL TABLE SSA (const string) $0 = (string) "hello world! @" (const string) $1 = (string) "hello c64! @" (const string) $2 = (string) "hello 2017! @" (label) @12 -(label) @35 (label) @36 (label) @37 +(label) @38 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -345,9 +346,9 @@ Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @35 Adding NOP phi() at start of @36 Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -370,12 +371,12 @@ Coalesced [38] print_str::str#8 ← print_str::str#0 Coalesced [39] print_char_cursor#34 ← print_char_cursor#1 Coalesced down to 3 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @35 -Culled Empty Block (label) @37 +Culled Empty Block (label) @36 +Culled Empty Block (label) @38 Culled Empty Block (label) main::@6 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 -Renumbering block @36 to @1 +Renumbering block @37 to @1 Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 Adding NOP phi() at start of @end diff --git a/src/test/ref/screen-center-angle.log b/src/test/ref/screen-center-angle.log index f21548852..3d074e9a4 100644 --- a/src/test/ref/screen-center-angle.log +++ b/src/test/ref/screen-center-angle.log @@ -62,15 +62,16 @@ Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 Culled Empty Block (label) @36 -Culled Empty Block (label) @38 +Culled Empty Block (label) @37 Culled Empty Block (label) @39 Culled Empty Block (label) @40 Culled Empty Block (label) @41 Culled Empty Block (label) @42 Culled Empty Block (label) @43 +Culled Empty Block (label) @44 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::toD0182_@1 -Culled Empty Block (label) @45 +Culled Empty Block (label) @46 Culled Empty Block (label) init_angle_screen::@4 CONTROL FLOW GRAPH SSA @@ -375,7 +376,7 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8 to:@return @19: scope:[] from @17 (dword) CLOCKS_PER_INIT#0 ← (number) $12 - to:@37 + to:@38 clock: scope:[clock] from main::@5 (number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0) (dword) clock::return#0 ← (number~) clock::$0 @@ -447,9 +448,9 @@ print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1 print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2 return to:@return -@37: scope:[] from @19 +@38: scope:[] from @19 (byte[]) print_hextab#0 ← (const string) $1 - to:@44 + to:@45 print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1 (byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 ) (byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 ) @@ -480,11 +481,11 @@ print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1 print_char_at::@return: scope:[print_char_at] from print_char_at return to:@return -@44: scope:[] from @37 +@45: scope:[] from @38 (byte*) CHARSET#0 ← ((byte*)) (number) $2000 (byte*) SCREEN#0 ← ((byte*)) (number) $2800 - to:@46 -main: scope:[main] from @46 + to:@47 +main: scope:[main] from @47 (byte*) init_font_hex::charset#1 ← (byte*) CHARSET#0 call init_font_hex to:main::@3 @@ -637,22 +638,22 @@ init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@5 init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@3 return to:@return -@46: scope:[] from @44 +@47: scope:[] from @45 call main - to:@47 -@47: scope:[] from @46 + to:@48 +@48: scope:[] from @47 to:@end -@end: scope:[] from @47 +@end: scope:[] from @48 SYMBOL TABLE SSA (const string) $1 = (string) "0123456789abcdef" (label) @12 (label) @17 (label) @19 -(label) @37 -(label) @44 -(label) @46 +(label) @38 +(label) @45 (label) @47 +(label) @48 (label) @begin (label) @end (byte*) CHARSET @@ -1917,10 +1918,10 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 Adding NOP phi() at start of @17 Adding NOP phi() at start of @19 -Adding NOP phi() at start of @37 -Adding NOP phi() at start of @44 -Adding NOP phi() at start of @46 +Adding NOP phi() at start of @38 +Adding NOP phi() at start of @45 Adding NOP phi() at start of @47 +Adding NOP phi() at start of @48 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -2005,9 +2006,9 @@ Coalesced down to 28 phi equivalence classes Culled Empty Block (label) @12 Culled Empty Block (label) @17 Culled Empty Block (label) @19 -Culled Empty Block (label) @37 -Culled Empty Block (label) @44 -Culled Empty Block (label) @47 +Culled Empty Block (label) @38 +Culled Empty Block (label) @45 +Culled Empty Block (label) @48 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@7 @@ -2026,7 +2027,7 @@ Culled Empty Block (label) atan2_16::@37 Culled Empty Block (label) init_font_hex::@7 Culled Empty Block (label) init_font_hex::@8 Culled Empty Block (label) init_font_hex::@9 -Renumbering block @46 to @1 +Renumbering block @47 to @1 Renumbering block atan2_16::@13 to atan2_16::@9 Renumbering block atan2_16::@15 to atan2_16::@10 Renumbering block atan2_16::@16 to atan2_16::@11 diff --git a/src/test/ref/screen-center-distance.log b/src/test/ref/screen-center-distance.log index 2d0c4250d..dd7f8547e 100644 --- a/src/test/ref/screen-center-distance.log +++ b/src/test/ref/screen-center-distance.log @@ -61,15 +61,16 @@ Culled Empty Block (label) @34 Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 -Culled Empty Block (label) @39 +Culled Empty Block (label) @38 Culled Empty Block (label) @40 Culled Empty Block (label) @41 Culled Empty Block (label) @42 Culled Empty Block (label) @43 Culled Empty Block (label) @44 +Culled Empty Block (label) @45 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::toD0182_@1 -Culled Empty Block (label) @46 +Culled Empty Block (label) @47 Culled Empty Block (label) init_dist_screen::@13 Culled Empty Block (label) init_dist_screen::@14 Culled Empty Block (label) init_dist_screen::@9 @@ -353,7 +354,7 @@ init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5 (byte) NUM_SQUARES#28 ← phi( @15/(byte) NUM_SQUARES#32 ) (byte[]) FONT_HEX_PROTO#0 ← { (number) 2, (number) 5, (number) 5, (number) 5, (number) 2, (number) 6, (number) 2, (number) 2, (number) 2, (number) 7, (number) 6, (number) 1, (number) 2, (number) 4, (number) 7, (number) 6, (number) 1, (number) 2, (number) 1, (number) 6, (number) 5, (number) 5, (number) 7, (number) 1, (number) 1, (number) 7, (number) 4, (number) 6, (number) 1, (number) 6, (number) 3, (number) 4, (number) 6, (number) 5, (number) 2, (number) 7, (number) 1, (number) 1, (number) 1, (number) 1, (number) 2, (number) 5, (number) 2, (number) 5, (number) 2, (number) 2, (number) 5, (number) 3, (number) 1, (number) 1, (number) 2, (number) 5, (number) 7, (number) 5, (number) 5, (number) 6, (number) 5, (number) 6, (number) 5, (number) 6, (number) 2, (number) 5, (number) 4, (number) 5, (number) 2, (number) 6, (number) 5, (number) 5, (number) 5, (number) 6, (number) 7, (number) 4, (number) 6, (number) 4, (number) 7, (number) 7, (number) 4, (number) 6, (number) 4, (number) 4 } (dword) CLOCKS_PER_INIT#0 ← (number) $12 - to:@38 + to:@39 clock: scope:[clock] from main::@5 (number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0) (dword) clock::return#0 ← (number~) clock::$0 @@ -425,12 +426,12 @@ print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1 print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2 return to:@return -@38: scope:[] from @20 +@39: scope:[] from @20 (word*) SQUARES#34 ← phi( @20/(word*) SQUARES#39 ) (byte*) heap_head#30 ← phi( @20/(byte*) heap_head#34 ) (byte) NUM_SQUARES#23 ← phi( @20/(byte) NUM_SQUARES#28 ) (byte[]) print_hextab#0 ← (const string) $1 - to:@45 + to:@46 print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1 (byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 ) (byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 ) @@ -461,17 +462,17 @@ print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1 print_char_at::@return: scope:[print_char_at] from print_char_at return to:@return -@45: scope:[] from @38 - (word*) SQUARES#33 ← phi( @38/(word*) SQUARES#34 ) - (byte*) heap_head#29 ← phi( @38/(byte*) heap_head#30 ) - (byte) NUM_SQUARES#22 ← phi( @38/(byte) NUM_SQUARES#23 ) +@46: scope:[] from @39 + (word*) SQUARES#33 ← phi( @39/(word*) SQUARES#34 ) + (byte*) heap_head#29 ← phi( @39/(byte*) heap_head#30 ) + (byte) NUM_SQUARES#22 ← phi( @39/(byte) NUM_SQUARES#23 ) (byte*) CHARSET#0 ← ((byte*)) (number) $2000 (byte*) SCREEN#0 ← ((byte*)) (number) $2800 - to:@47 -main: scope:[main] from @47 - (word*) SQUARES#46 ← phi( @47/(word*) SQUARES#25 ) - (byte*) heap_head#44 ← phi( @47/(byte*) heap_head#25 ) - (byte) NUM_SQUARES#36 ← phi( @47/(byte) NUM_SQUARES#17 ) + to:@48 +main: scope:[main] from @48 + (word*) SQUARES#46 ← phi( @48/(word*) SQUARES#25 ) + (byte*) heap_head#44 ← phi( @48/(byte*) heap_head#25 ) + (byte) NUM_SQUARES#36 ← phi( @48/(byte) NUM_SQUARES#17 ) (byte*) init_font_hex::charset#1 ← (byte*) CHARSET#0 call init_font_hex to:main::@3 @@ -795,32 +796,32 @@ init_dist_screen::@return: scope:[init_dist_screen] from init_dist_screen::@11 (word*) SQUARES#6 ← (word*) SQUARES#15 return to:@return -@47: scope:[] from @45 - (word*) SQUARES#25 ← phi( @45/(word*) SQUARES#33 ) - (byte*) heap_head#25 ← phi( @45/(byte*) heap_head#29 ) - (byte) NUM_SQUARES#17 ← phi( @45/(byte) NUM_SQUARES#22 ) +@48: scope:[] from @46 + (word*) SQUARES#25 ← phi( @46/(word*) SQUARES#33 ) + (byte*) heap_head#25 ← phi( @46/(byte*) heap_head#29 ) + (byte) NUM_SQUARES#17 ← phi( @46/(byte) NUM_SQUARES#22 ) call main - to:@48 -@48: scope:[] from @47 - (word*) SQUARES#16 ← phi( @47/(word*) SQUARES#4 ) - (byte*) heap_head#18 ← phi( @47/(byte*) heap_head#6 ) - (byte) NUM_SQUARES#12 ← phi( @47/(byte) NUM_SQUARES#2 ) + to:@49 +@49: scope:[] from @48 + (word*) SQUARES#16 ← phi( @48/(word*) SQUARES#4 ) + (byte*) heap_head#18 ← phi( @48/(byte*) heap_head#6 ) + (byte) NUM_SQUARES#12 ← phi( @48/(byte) NUM_SQUARES#2 ) (byte) NUM_SQUARES#5 ← (byte) NUM_SQUARES#12 (byte*) heap_head#9 ← (byte*) heap_head#18 (word*) SQUARES#7 ← (word*) SQUARES#16 to:@end -@end: scope:[] from @48 +@end: scope:[] from @49 SYMBOL TABLE SSA (const string) $1 = (string) "0123456789abcdef" (label) @12 (label) @15 (label) @20 -(label) @38 +(label) @39 (label) @4 -(label) @45 -(label) @47 +(label) @46 (label) @48 +(label) @49 (label) @begin (label) @end (byte*) CHARSET @@ -2351,10 +2352,10 @@ Adding NOP phi() at start of @4 Adding NOP phi() at start of @12 Adding NOP phi() at start of @15 Adding NOP phi() at start of @20 -Adding NOP phi() at start of @38 -Adding NOP phi() at start of @45 -Adding NOP phi() at start of @47 +Adding NOP phi() at start of @39 +Adding NOP phi() at start of @46 Adding NOP phi() at start of @48 +Adding NOP phi() at start of @49 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -2434,9 +2435,9 @@ Culled Empty Block (label) @4 Culled Empty Block (label) @12 Culled Empty Block (label) @15 Culled Empty Block (label) @20 -Culled Empty Block (label) @38 -Culled Empty Block (label) @45 -Culled Empty Block (label) @48 +Culled Empty Block (label) @39 +Culled Empty Block (label) @46 +Culled Empty Block (label) @49 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@7 @@ -2454,7 +2455,7 @@ Culled Empty Block (label) init_squares::@4 Culled Empty Block (label) init_font_hex::@7 Culled Empty Block (label) init_font_hex::@8 Culled Empty Block (label) init_font_hex::@9 -Renumbering block @47 to @1 +Renumbering block @48 to @1 Renumbering block bsearch16u::@2 to bsearch16u::@1 Renumbering block bsearch16u::@3 to bsearch16u::@2 Renumbering block bsearch16u::@6 to bsearch16u::@3 diff --git a/src/test/ref/semi-struct-1.log b/src/test/ref/semi-struct-1.log index 572ab9b72..0e2ed1e9e 100644 --- a/src/test/ref/semi-struct-1.log +++ b/src/test/ref/semi-struct-1.log @@ -43,21 +43,22 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 -Culled Empty Block (label) @36 +Culled Empty Block (label) @35 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 +Culled Empty Block (label) @40 Culled Empty Block (label) init_points::getPoint1_@1 Culled Empty Block (label) init_points::pointXpos1_@1 Culled Empty Block (label) init_points::pointYpos1_@1 Culled Empty Block (label) init_points::@2 -Culled Empty Block (label) @40 +Culled Empty Block (label) @41 Culled Empty Block (label) print_points::getPoint1_@1 Culled Empty Block (label) print_points::pointXpos1_@1 Culled Empty Block (label) print_points::pointYpos1_@1 @@ -106,7 +107,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_str: scope:[print_str] from print_points::@7 (byte*) print_char_cursor#48 ← phi( print_points::@7/(byte*) print_char_cursor#15 ) (byte*) print_str::str#4 ← phi( print_points::@7/(byte*) print_str::str#1 ) @@ -152,12 +153,12 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#24 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#8 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#53 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#29 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $1 - to:@35 + to:@36 print_byte: scope:[print_byte] from print_points::@4 print_points::@5 (byte*) print_char_cursor#42 ← phi( print_points::@4/(byte*) print_char_cursor#45 print_points::@5/(byte*) print_char_cursor#46 ) (byte) print_byte::b#2 ← phi( print_points::@4/(byte) print_byte::b#0 print_points::@5/(byte) print_byte::b#1 ) @@ -213,19 +214,19 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#30 return to:@return -@35: scope:[] from @28 - (byte*) print_screen#7 ← phi( @28/(byte*) print_screen#8 ) - (byte*) print_char_cursor#52 ← phi( @28/(byte*) print_char_cursor#53 ) - (byte*) print_line_cursor#28 ← phi( @28/(byte*) print_line_cursor#29 ) +@36: scope:[] from @29 + (byte*) print_screen#7 ← phi( @29/(byte*) print_screen#8 ) + (byte*) print_char_cursor#52 ← phi( @29/(byte*) print_char_cursor#53 ) + (byte*) print_line_cursor#28 ← phi( @29/(byte*) print_line_cursor#29 ) (byte) SIZEOF_POINT#0 ← (number) 2 (byte) NUM_POINTS#0 ← (number) 4 (byte~) $0 ← (byte) NUM_POINTS#0 * (byte) SIZEOF_POINT#0 (byte[$0]) points#0 ← { fill( $0, 0) } - to:@41 -main: scope:[main] from @41 - (byte*) print_screen#5 ← phi( @41/(byte*) print_screen#6 ) - (byte*) print_char_cursor#49 ← phi( @41/(byte*) print_char_cursor#47 ) - (byte*) print_line_cursor#26 ← phi( @41/(byte*) print_line_cursor#25 ) + to:@42 +main: scope:[main] from @42 + (byte*) print_screen#5 ← phi( @42/(byte*) print_screen#6 ) + (byte*) print_char_cursor#49 ← phi( @42/(byte*) print_char_cursor#47 ) + (byte*) print_line_cursor#26 ← phi( @42/(byte*) print_line_cursor#25 ) call init_points to:main::@1 main::@1: scope:[main] from main @@ -472,28 +473,28 @@ print_points::@return: scope:[print_points] from print_points::@10 (byte*) print_char_cursor#19 ← (byte*) print_char_cursor#38 return to:@return -@41: scope:[] from @35 - (byte*) print_screen#6 ← phi( @35/(byte*) print_screen#7 ) - (byte*) print_char_cursor#47 ← phi( @35/(byte*) print_char_cursor#52 ) - (byte*) print_line_cursor#25 ← phi( @35/(byte*) print_line_cursor#28 ) +@42: scope:[] from @36 + (byte*) print_screen#6 ← phi( @36/(byte*) print_screen#7 ) + (byte*) print_char_cursor#47 ← phi( @36/(byte*) print_char_cursor#52 ) + (byte*) print_line_cursor#25 ← phi( @36/(byte*) print_line_cursor#28 ) call main - to:@42 -@42: scope:[] from @41 - (byte*) print_char_cursor#39 ← phi( @41/(byte*) print_char_cursor#13 ) - (byte*) print_line_cursor#20 ← phi( @41/(byte*) print_line_cursor#6 ) + to:@43 +@43: scope:[] from @42 + (byte*) print_char_cursor#39 ← phi( @42/(byte*) print_char_cursor#13 ) + (byte*) print_line_cursor#20 ← phi( @42/(byte*) print_line_cursor#6 ) (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#20 (byte*) print_char_cursor#20 ← (byte*) print_char_cursor#39 to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 SYMBOL TABLE SSA (byte~) $0 (const string) $1 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @35 -(label) @41 +(label) @29 +(label) @36 (label) @42 +(label) @43 (label) @begin (label) @end (byte) NUM_POINTS @@ -1125,10 +1126,10 @@ Added new block during phi lifting init_points::@6(between init_points::@5 and i Added new block during phi lifting print_points::@11(between print_points::@10 and print_points::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @41 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @36 Adding NOP phi() at start of @42 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -1187,9 +1188,9 @@ Coalesced [108] init_points::i#12 ← init_points::i#1 Coalesced [109] init_points::pos#13 ← init_points::pos#2 Coalesced down to 9 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @35 -Culled Empty Block (label) @42 +Culled Empty Block (label) @29 +Culled Empty Block (label) @36 +Culled Empty Block (label) @43 Culled Empty Block (label) main::@2 Culled Empty Block (label) print_points::@6 Culled Empty Block (label) print_points::getPoint1_@return @@ -1209,7 +1210,7 @@ Culled Empty Block (label) init_points::@3 Culled Empty Block (label) init_points::pointXpos1_@return Culled Empty Block (label) init_points::pointYpos1_@return Culled Empty Block (label) init_points::@6 -Renumbering block @41 to @1 +Renumbering block @42 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block init_points::@4 to init_points::@2 Renumbering block init_points::@5 to init_points::@3 diff --git a/src/test/ref/semi-struct-2.log b/src/test/ref/semi-struct-2.log index 205589bb6..5463b823d 100644 --- a/src/test/ref/semi-struct-2.log +++ b/src/test/ref/semi-struct-2.log @@ -75,24 +75,24 @@ Culled Empty Block (label) @29 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 -Culled Empty Block (label) @34 +Culled Empty Block (label) @33 Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 Culled Empty Block (label) @39 -Culled Empty Block (label) @41 +Culled Empty Block (label) @40 Culled Empty Block (label) @42 Culled Empty Block (label) @43 -Culled Empty Block (label) @45 -Culled Empty Block (label) keyboard_matrix_read::@1 +Culled Empty Block (label) @44 Culled Empty Block (label) @46 -Culled Empty Block (label) keyboard_key_pressed::@1 +Culled Empty Block (label) keyboard_matrix_read::@1 Culled Empty Block (label) @47 +Culled Empty Block (label) keyboard_key_pressed::@1 Culled Empty Block (label) @48 Culled Empty Block (label) @49 Culled Empty Block (label) @50 -Culled Empty Block (label) @52 +Culled Empty Block (label) @51 Culled Empty Block (label) @53 Culled Empty Block (label) @54 Culled Empty Block (label) @55 @@ -106,6 +106,7 @@ Culled Empty Block (label) @62 Culled Empty Block (label) @63 Culled Empty Block (label) @64 Culled Empty Block (label) @65 +Culled Empty Block (label) @66 Culled Empty Block (label) main::fileEntry1_@1 Culled Empty Block (label) main::fileEntry2_@1 Culled Empty Block (label) main::@2 @@ -116,7 +117,7 @@ Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@10 Culled Empty Block (label) main::@11 Culled Empty Block (label) main::@12 -Culled Empty Block (label) @66 +Culled Empty Block (label) @67 Culled Empty Block (label) initEntry::entryBufDisk1_@1 Culled Empty Block (label) initEntry::entryBufEdit1_@1 Culled Empty Block (label) initEntry::entryTsLen1_@1 @@ -130,7 +131,7 @@ Culled Empty Block (label) initEntry::entryBAddrLo1_@1 Culled Empty Block (label) initEntry::entryBAddrHi1_@1 Culled Empty Block (label) initEntry::entryTHi1_@1 Culled Empty Block (label) initEntry::entryTLo1_@1 -Culled Empty Block (label) @67 +Culled Empty Block (label) @68 Culled Empty Block (label) printEntry::entryBufDisk1_@1 Culled Empty Block (label) printEntry::entryBufEdit1_@1 Culled Empty Block (label) printEntry::entryTsLen1_@1 @@ -235,7 +236,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@33 + to:@34 print_str: scope:[print_str] from main::@20 main::@25 main::@28 main::@33 printEntry printEntry::@16 printEntry::@19 printEntry::@22 printEntry::@25 printEntry::@28 printEntry::@31 printEntry::@34 printEntry::@37 printEntry::@40 printEntry::@43 printEntry::@46 printEntry::@49 (byte*) print_char_cursor#164 ← phi( main::@20/(byte*) print_char_cursor#15 main::@25/(byte*) print_char_cursor#20 main::@28/(byte*) print_char_cursor#22 main::@33/(byte*) print_char_cursor#27 printEntry/(byte*) print_char_cursor#149 printEntry::@16/(byte*) print_char_cursor#33 printEntry::@19/(byte*) print_char_cursor#36 printEntry::@22/(byte*) print_char_cursor#39 printEntry::@25/(byte*) print_char_cursor#42 printEntry::@28/(byte*) print_char_cursor#45 printEntry::@31/(byte*) print_char_cursor#48 printEntry::@34/(byte*) print_char_cursor#51 printEntry::@37/(byte*) print_char_cursor#54 printEntry::@40/(byte*) print_char_cursor#57 printEntry::@43/(byte*) print_char_cursor#60 printEntry::@46/(byte*) print_char_cursor#63 printEntry::@49/(byte*) print_char_cursor#66 ) (byte*) print_str::str#20 ← phi( main::@20/(byte*) print_str::str#1 main::@25/(byte*) print_str::str#2 main::@28/(byte*) print_str::str#3 main::@33/(byte*) print_str::str#4 printEntry/(byte*) print_str::str#5 printEntry::@16/(byte*) print_str::str#6 printEntry::@19/(byte*) print_str::str#7 printEntry::@22/(byte*) print_str::str#8 printEntry::@25/(byte*) print_str::str#9 printEntry::@28/(byte*) print_str::str#10 printEntry::@31/(byte*) print_str::str#11 printEntry::@34/(byte*) print_str::str#12 printEntry::@37/(byte*) print_str::str#13 printEntry::@40/(byte*) print_str::str#14 printEntry::@43/(byte*) print_str::str#15 printEntry::@46/(byte*) print_str::str#16 printEntry::@49/(byte*) print_str::str#17 ) @@ -305,12 +306,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#78 return to:@return -@33: scope:[] from @17 +@34: scope:[] from @17 (byte*) print_screen#39 ← phi( @17/(byte*) print_screen#0 ) (byte*) print_char_cursor#201 ← phi( @17/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#134 ← phi( @17/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $3 - to:@40 + to:@41 print_byte: scope:[print_byte] from printEntry::@10 printEntry::@11 printEntry::@12 printEntry::@13 printEntry::@5 printEntry::@6 printEntry::@7 printEntry::@8 print_word print_word::@1 (byte*) print_char_cursor#145 ← phi( printEntry::@10/(byte*) print_char_cursor#159 printEntry::@11/(byte*) print_char_cursor#160 printEntry::@12/(byte*) print_char_cursor#161 printEntry::@13/(byte*) print_char_cursor#162 printEntry::@5/(byte*) print_char_cursor#154 printEntry::@6/(byte*) print_char_cursor#155 printEntry::@7/(byte*) print_char_cursor#156 printEntry::@8/(byte*) print_char_cursor#157 print_word/(byte*) print_char_cursor#144 print_word::@1/(byte*) print_char_cursor#5 ) (byte) print_byte::b#10 ← phi( printEntry::@10/(byte) print_byte::b#6 printEntry::@11/(byte) print_byte::b#7 printEntry::@12/(byte) print_byte::b#8 printEntry::@13/(byte) print_byte::b#9 printEntry::@5/(byte) print_byte::b#2 printEntry::@6/(byte) print_byte::b#3 printEntry::@7/(byte) print_byte::b#4 printEntry::@8/(byte) print_byte::b#5 print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -366,23 +367,23 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#84 return to:@return -@40: scope:[] from @33 - (byte*) print_screen#38 ← phi( @33/(byte*) print_screen#39 ) - (byte*) print_char_cursor#199 ← phi( @33/(byte*) print_char_cursor#201 ) - (byte*) print_line_cursor#117 ← phi( @33/(byte*) print_line_cursor#134 ) +@41: scope:[] from @34 + (byte*) print_screen#38 ← phi( @34/(byte*) print_screen#39 ) + (byte*) print_char_cursor#199 ← phi( @34/(byte*) print_char_cursor#201 ) + (byte*) print_line_cursor#117 ← phi( @34/(byte*) print_line_cursor#134 ) (byte*) CIA1_PORT_A#0 ← ((byte*)) (number) $dc00 (byte*) CIA1_PORT_B#0 ← ((byte*)) (number) $dc01 (byte*) CIA1_PORT_A_DDR#0 ← ((byte*)) (number) $dc02 (byte*) CIA1_PORT_B_DDR#0 ← ((byte*)) (number) $dc03 - to:@44 -@44: scope:[] from @40 - (byte*) print_screen#37 ← phi( @40/(byte*) print_screen#38 ) - (byte*) print_char_cursor#182 ← phi( @40/(byte*) print_char_cursor#199 ) - (byte*) print_line_cursor#100 ← phi( @40/(byte*) print_line_cursor#117 ) + to:@45 +@45: scope:[] from @41 + (byte*) print_screen#37 ← phi( @41/(byte*) print_screen#38 ) + (byte*) print_char_cursor#182 ← phi( @41/(byte*) print_char_cursor#199 ) + (byte*) print_line_cursor#100 ← phi( @41/(byte*) print_line_cursor#117 ) (byte) KEY_SPACE#0 ← (number) $3c (byte[8]) keyboard_matrix_row_bitmask#0 ← { (number) $fe, (number) $fd, (number) $fb, (number) $f7, (number) $ef, (number) $df, (number) $bf, (number) $7f } (byte[8]) keyboard_matrix_col_bitmask#0 ← { (number) 1, (number) 2, (number) 4, (number) 8, (number) $10, (number) $20, (number) $40, (number) $80 } - to:@51 + to:@52 keyboard_init: scope:[keyboard_init] from main *((byte*) CIA1_PORT_A_DDR#0) ← (number) $ff *((byte*) CIA1_PORT_B_DDR#0) ← (number) 0 @@ -424,20 +425,20 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p (byte) keyboard_key_pressed::return#1 ← (byte) keyboard_key_pressed::return#4 return to:@return -@51: scope:[] from @44 - (byte*) print_screen#36 ← phi( @44/(byte*) print_screen#37 ) - (byte*) print_char_cursor#181 ← phi( @44/(byte*) print_char_cursor#182 ) - (byte*) print_line_cursor#99 ← phi( @44/(byte*) print_line_cursor#100 ) +@52: scope:[] from @45 + (byte*) print_screen#36 ← phi( @45/(byte*) print_screen#37 ) + (byte*) print_char_cursor#181 ← phi( @45/(byte*) print_char_cursor#182 ) + (byte*) print_line_cursor#99 ← phi( @45/(byte*) print_line_cursor#100 ) (byte) SIZEOF_ENTRY#0 ← (number) $12 (byte) MAX_FILES#0 ← (number) $90 (word~) $1 ← ((word)) (byte) MAX_FILES#0 (word~) $2 ← (word~) $1 * (byte) SIZEOF_ENTRY#0 (byte[$2]) files#0 ← { fill( $2, 0) } - to:@68 -main: scope:[main] from @68 - (byte*) print_char_cursor#209 ← phi( @68/(byte*) print_char_cursor#163 ) - (byte*) print_line_cursor#156 ← phi( @68/(byte*) print_line_cursor#82 ) - (byte*) print_screen#34 ← phi( @68/(byte*) print_screen#35 ) + to:@69 +main: scope:[main] from @69 + (byte*) print_char_cursor#209 ← phi( @69/(byte*) print_char_cursor#163 ) + (byte*) print_line_cursor#156 ← phi( @69/(byte*) print_line_cursor#82 ) + (byte*) print_screen#34 ← phi( @69/(byte*) print_screen#35 ) call keyboard_init to:main::@15 main::@15: scope:[main] from main @@ -1664,31 +1665,31 @@ printEntry::@return: scope:[printEntry] from printEntry::@52 (byte*) print_line_cursor#30 ← (byte*) print_line_cursor#61 return to:@return -@68: scope:[] from @51 - (byte*) print_screen#35 ← phi( @51/(byte*) print_screen#36 ) - (byte*) print_char_cursor#163 ← phi( @51/(byte*) print_char_cursor#181 ) - (byte*) print_line_cursor#82 ← phi( @51/(byte*) print_line_cursor#99 ) +@69: scope:[] from @52 + (byte*) print_screen#35 ← phi( @52/(byte*) print_screen#36 ) + (byte*) print_char_cursor#163 ← phi( @52/(byte*) print_char_cursor#181 ) + (byte*) print_line_cursor#82 ← phi( @52/(byte*) print_line_cursor#99 ) call main - to:@69 -@69: scope:[] from @68 - (byte*) print_char_cursor#141 ← phi( @68/(byte*) print_char_cursor#30 ) - (byte*) print_line_cursor#62 ← phi( @68/(byte*) print_line_cursor#16 ) + to:@70 +@70: scope:[] from @69 + (byte*) print_char_cursor#141 ← phi( @69/(byte*) print_char_cursor#30 ) + (byte*) print_line_cursor#62 ← phi( @69/(byte*) print_line_cursor#16 ) (byte*) print_line_cursor#31 ← (byte*) print_line_cursor#62 (byte*) print_char_cursor#71 ← (byte*) print_char_cursor#141 to:@end -@end: scope:[] from @69 +@end: scope:[] from @70 SYMBOL TABLE SSA (word~) $1 (word~) $2 (const string) $3 = (string) "0123456789abcdef" (label) @17 -(label) @33 -(label) @40 -(label) @44 -(label) @51 -(label) @68 +(label) @34 +(label) @41 +(label) @45 +(label) @52 (label) @69 +(label) @70 (label) @begin (label) @end (byte*) CIA1_PORT_A @@ -3898,12 +3899,12 @@ Added new block during phi lifting memset::@6(between memset::@4 and memset::@4) Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @17 -Adding NOP phi() at start of @33 -Adding NOP phi() at start of @40 -Adding NOP phi() at start of @44 -Adding NOP phi() at start of @51 -Adding NOP phi() at start of @68 +Adding NOP phi() at start of @34 +Adding NOP phi() at start of @41 +Adding NOP phi() at start of @45 +Adding NOP phi() at start of @52 Adding NOP phi() at start of @69 +Adding NOP phi() at start of @70 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@15 @@ -4104,11 +4105,11 @@ Coalesced [371] mul8u::mb#6 ← mul8u::mb#1 Coalesced (already) [372] mul8u::res#8 ← mul8u::res#2 Coalesced down to 14 phi equivalence classes Culled Empty Block (label) @17 -Culled Empty Block (label) @33 -Culled Empty Block (label) @40 -Culled Empty Block (label) @44 -Culled Empty Block (label) @51 -Culled Empty Block (label) @69 +Culled Empty Block (label) @34 +Culled Empty Block (label) @41 +Culled Empty Block (label) @45 +Culled Empty Block (label) @52 +Culled Empty Block (label) @70 Culled Empty Block (label) main::@15 Culled Empty Block (label) main::fileEntry1_@return Culled Empty Block (label) main::@13 @@ -4165,7 +4166,7 @@ Culled Empty Block (label) initEntry::entryTHi1_@return Culled Empty Block (label) initEntry::entryTLo1_@return Culled Empty Block (label) mul8u::@3 Culled Empty Block (label) mul8u::@10 -Renumbering block @68 to @1 +Renumbering block @69 to @1 Renumbering block mul8u::@4 to mul8u::@3 Renumbering block mul8u::@7 to mul8u::@4 Renumbering block memset::@4 to memset::@1 diff --git a/src/test/ref/sieve.log b/src/test/ref/sieve.log index 39800e6c0..5c730fba0 100644 --- a/src/test/ref/sieve.log +++ b/src/test/ref/sieve.log @@ -74,7 +74,7 @@ Culled Empty Block (label) @34 Culled Empty Block (label) @35 Culled Empty Block (label) @37 Culled Empty Block (label) @38 -Culled Empty Block (label) @40 +Culled Empty Block (label) @39 Culled Empty Block (label) @41 Culled Empty Block (label) @42 Culled Empty Block (label) @43 @@ -83,6 +83,7 @@ Culled Empty Block (label) @45 Culled Empty Block (label) @46 Culled Empty Block (label) @47 Culled Empty Block (label) @48 +Culled Empty Block (label) @49 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::@11 Culled Empty Block (label) main::@12 @@ -709,7 +710,7 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) print_char_cursor#78 ← phi( @26/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#38 ← phi( @26/(byte*) print_line_cursor#0 ) (byte[6]) decimal_digits#0 ← { fill( 6, 0) } - to:@39 + to:@40 print_word_decimal: scope:[print_word_decimal] from main::@17 main::@29 main::@36 (byte*) print_char_cursor#67 ← phi( main::@17/(byte*) print_char_cursor#62 main::@29/(byte*) print_char_cursor#16 main::@36/(byte*) print_char_cursor#19 ) (word) print_word_decimal::w#3 ← phi( main::@17/(word) print_word_decimal::w#2 main::@29/(word) print_word_decimal::w#0 main::@36/(word) print_word_decimal::w#1 ) @@ -732,13 +733,13 @@ print_word_decimal::@return: scope:[print_word_decimal] from print_word_decimal (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#34 return to:@return -@39: scope:[] from @36 +@40: scope:[] from @36 (byte*) print_screen#9 ← phi( @36/(byte*) print_screen#10 ) (word) rem16u#24 ← phi( @36/(word) rem16u#27 ) (byte*) print_char_cursor#75 ← phi( @36/(byte*) print_char_cursor#78 ) (byte*) print_line_cursor#34 ← phi( @36/(byte*) print_line_cursor#38 ) (byte[$b]) decimal_digits_long#0 ← { fill( $b, 0) } - to:@49 + to:@50 print_dword_decimal: scope:[print_dword_decimal] from main::@38 (byte*) print_char_cursor#68 ← phi( main::@38/(byte*) print_char_cursor#21 ) (dword) print_dword_decimal::w#1 ← phi( main::@38/(dword) print_dword_decimal::w#0 ) @@ -792,21 +793,21 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#39 return to:@return -@49: scope:[] from @39 - (byte*) print_screen#8 ← phi( @39/(byte*) print_screen#9 ) - (word) rem16u#23 ← phi( @39/(word) rem16u#24 ) - (byte*) print_char_cursor#74 ← phi( @39/(byte*) print_char_cursor#75 ) - (byte*) print_line_cursor#33 ← phi( @39/(byte*) print_line_cursor#34 ) +@50: scope:[] from @40 + (byte*) print_screen#8 ← phi( @40/(byte*) print_screen#9 ) + (word) rem16u#23 ← phi( @40/(word) rem16u#24 ) + (byte*) print_char_cursor#74 ← phi( @40/(byte*) print_char_cursor#75 ) + (byte*) print_line_cursor#33 ← phi( @40/(byte*) print_line_cursor#34 ) (byte*) SCREEN#0 ← ((byte*)) (number) $400 (word) COUNT#0 ← (number) $4000 (byte) SQRT_COUNT#0 ← (number) $80 (byte*) sieve#0 ← ((byte*)) (number) $1000 - to:@50 -main: scope:[main] from @50 - (word) rem16u#57 ← phi( @50/(word) rem16u#19 ) - (byte*) print_char_cursor#79 ← phi( @50/(byte*) print_char_cursor#65 ) - (byte*) print_line_cursor#39 ← phi( @50/(byte*) print_line_cursor#27 ) - (byte*) print_screen#6 ← phi( @50/(byte*) print_screen#7 ) + to:@51 +main: scope:[main] from @51 + (word) rem16u#57 ← phi( @51/(word) rem16u#19 ) + (byte*) print_char_cursor#79 ← phi( @51/(byte*) print_char_cursor#65 ) + (byte*) print_line_cursor#39 ← phi( @51/(byte*) print_line_cursor#27 ) + (byte*) print_screen#6 ← phi( @51/(byte*) print_screen#7 ) (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 (byte*) main::toD0181_gfx#0 ← (byte*)(number) $1800 to:main::toD0181 @@ -1131,22 +1132,22 @@ main::@return: scope:[main] from main::@19 (word) rem16u#7 ← (word) rem16u#14 return to:@return -@50: scope:[] from @49 - (byte*) print_screen#7 ← phi( @49/(byte*) print_screen#8 ) - (word) rem16u#19 ← phi( @49/(word) rem16u#23 ) - (byte*) print_char_cursor#65 ← phi( @49/(byte*) print_char_cursor#74 ) - (byte*) print_line_cursor#27 ← phi( @49/(byte*) print_line_cursor#33 ) - call main - to:@51 @51: scope:[] from @50 - (word) rem16u#15 ← phi( @50/(word) rem16u#7 ) - (byte*) print_char_cursor#55 ← phi( @50/(byte*) print_char_cursor#27 ) - (byte*) print_line_cursor#20 ← phi( @50/(byte*) print_line_cursor#9 ) + (byte*) print_screen#7 ← phi( @50/(byte*) print_screen#8 ) + (word) rem16u#19 ← phi( @50/(word) rem16u#23 ) + (byte*) print_char_cursor#65 ← phi( @50/(byte*) print_char_cursor#74 ) + (byte*) print_line_cursor#27 ← phi( @50/(byte*) print_line_cursor#33 ) + call main + to:@52 +@52: scope:[] from @51 + (word) rem16u#15 ← phi( @51/(word) rem16u#7 ) + (byte*) print_char_cursor#55 ← phi( @51/(byte*) print_char_cursor#27 ) + (byte*) print_line_cursor#20 ← phi( @51/(byte*) print_line_cursor#9 ) (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#20 (byte*) print_char_cursor#28 ← (byte*) print_char_cursor#55 (word) rem16u#8 ← (word) rem16u#15 to:@end -@end: scope:[] from @51 +@end: scope:[] from @52 SYMBOL TABLE SSA (word~) $0 @@ -1156,11 +1157,11 @@ SYMBOL TABLE SSA (label) @24 (label) @26 (label) @36 -(label) @39 (label) @4 -(label) @49 +(label) @40 (label) @50 (label) @51 +(label) @52 (label) @8 (label) @begin (label) @end @@ -3130,10 +3131,10 @@ Adding NOP phi() at start of @22 Adding NOP phi() at start of @24 Adding NOP phi() at start of @26 Adding NOP phi() at start of @36 -Adding NOP phi() at start of @39 -Adding NOP phi() at start of @49 +Adding NOP phi() at start of @40 Adding NOP phi() at start of @50 Adding NOP phi() at start of @51 +Adding NOP phi() at start of @52 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::toD0181 @@ -3248,9 +3249,9 @@ Culled Empty Block (label) @22 Culled Empty Block (label) @24 Culled Empty Block (label) @26 Culled Empty Block (label) @36 -Culled Empty Block (label) @39 -Culled Empty Block (label) @49 -Culled Empty Block (label) @51 +Culled Empty Block (label) @40 +Culled Empty Block (label) @50 +Culled Empty Block (label) @52 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@33 Culled Empty Block (label) main::@40 @@ -3275,7 +3276,7 @@ Culled Empty Block (label) divr16u::@9 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 Culled Empty Block (label) print_cls::@1 -Renumbering block @50 to @1 +Renumbering block @51 to @1 Renumbering block memset::@2 to memset::@1 Renumbering block memset::@4 to memset::@2 Renumbering block div32u16u::@2 to div32u16u::@1 diff --git a/src/test/ref/signed-indexed-subtract.log b/src/test/ref/signed-indexed-subtract.log index 40df48d26..798ee4bae 100644 --- a/src/test/ref/signed-indexed-subtract.log +++ b/src/test/ref/signed-indexed-subtract.log @@ -37,14 +37,15 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Culled Empty Block (label) main::@4 -Culled Empty Block (label) @36 +Culled Empty Block (label) @37 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -89,7 +90,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_ln: scope:[print_ln] from main::@9 (byte*) print_char_cursor#42 ← phi( main::@9/(byte*) print_char_cursor#18 ) (byte*) print_line_cursor#17 ← phi( main::@9/(byte*) print_line_cursor#19 ) @@ -183,12 +184,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#30 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#11 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#54 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#24 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@35 + to:@36 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#47 ← phi( print_word/(byte*) print_char_cursor#46 print_word::@1/(byte*) print_char_cursor#7 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -244,16 +245,16 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#36 return to:@return -@35: scope:[] from @28 - (byte*) print_screen#10 ← phi( @28/(byte*) print_screen#11 ) - (byte*) print_char_cursor#53 ← phi( @28/(byte*) print_char_cursor#54 ) - (byte*) print_line_cursor#23 ← phi( @28/(byte*) print_line_cursor#24 ) +@36: scope:[] from @29 + (byte*) print_screen#10 ← phi( @29/(byte*) print_screen#11 ) + (byte*) print_char_cursor#53 ← phi( @29/(byte*) print_char_cursor#54 ) + (byte*) print_line_cursor#23 ← phi( @29/(byte*) print_line_cursor#24 ) (signed word[]) words#0 ← { (number) -$6000, (number) -$600, (number) -$60, (number) -6, (number) 0, (number) 6, (number) $60, (number) $600, (number) $6000 } - to:@37 -main: scope:[main] from @37 - (byte*) print_char_cursor#58 ← phi( @37/(byte*) print_char_cursor#50 ) - (byte*) print_line_cursor#28 ← phi( @37/(byte*) print_line_cursor#20 ) - (byte*) print_screen#8 ← phi( @37/(byte*) print_screen#9 ) + to:@38 +main: scope:[main] from @38 + (byte*) print_char_cursor#58 ← phi( @38/(byte*) print_char_cursor#50 ) + (byte*) print_line_cursor#28 ← phi( @38/(byte*) print_line_cursor#20 ) + (byte*) print_screen#8 ← phi( @38/(byte*) print_screen#9 ) (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@7 @@ -346,27 +347,27 @@ sub: scope:[sub] from main::@1 main::@5 main::@6 sub::@return: scope:[sub] from sub return to:@return -@37: scope:[] from @35 - (byte*) print_screen#9 ← phi( @35/(byte*) print_screen#10 ) - (byte*) print_char_cursor#50 ← phi( @35/(byte*) print_char_cursor#53 ) - (byte*) print_line_cursor#20 ← phi( @35/(byte*) print_line_cursor#23 ) +@38: scope:[] from @36 + (byte*) print_screen#9 ← phi( @36/(byte*) print_screen#10 ) + (byte*) print_char_cursor#50 ← phi( @36/(byte*) print_char_cursor#53 ) + (byte*) print_line_cursor#20 ← phi( @36/(byte*) print_line_cursor#23 ) call main - to:@38 -@38: scope:[] from @37 - (byte*) print_char_cursor#41 ← phi( @37/(byte*) print_char_cursor#20 ) - (byte*) print_line_cursor#16 ← phi( @37/(byte*) print_line_cursor#7 ) + to:@39 +@39: scope:[] from @38 + (byte*) print_char_cursor#41 ← phi( @38/(byte*) print_char_cursor#20 ) + (byte*) print_line_cursor#16 ← phi( @38/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#21 ← (byte*) print_char_cursor#41 to:@end -@end: scope:[] from @38 +@end: scope:[] from @39 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @35 -(label) @37 +(label) @29 +(label) @36 (label) @38 +(label) @39 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -835,10 +836,10 @@ Added new block during phi lifting main::@11(between main::@7 and main::@1) Added new block during phi lifting main::@12(between main::@10 and main::@3) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @37 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @36 Adding NOP phi() at start of @38 +Adding NOP phi() at start of @39 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@2 @@ -884,9 +885,9 @@ Coalesced (already) [78] print_char_cursor#60 ← print_char_cursor#13 Coalesced [94] memset::dst#3 ← memset::dst#1 Coalesced down to 10 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @35 -Culled Empty Block (label) @38 +Culled Empty Block (label) @29 +Culled Empty Block (label) @36 +Culled Empty Block (label) @39 Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@11 Culled Empty Block (label) print_ln::@2 @@ -899,7 +900,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @37 to @1 +Renumbering block @38 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block main::@5 to main::@4 diff --git a/src/test/ref/sinus-basic.log b/src/test/ref/sinus-basic.log index 147fb7e0d..7d6d44965 100644 --- a/src/test/ref/sinus-basic.log +++ b/src/test/ref/sinus-basic.log @@ -31,16 +31,16 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 -Culled Empty Block (label) @36 +Culled Empty Block (label) @35 Culled Empty Block (label) @37 -Culled Empty Block (label) getFAC::@1 Culled Empty Block (label) @38 +Culled Empty Block (label) getFAC::@1 Culled Empty Block (label) @39 Culled Empty Block (label) @40 Culled Empty Block (label) @41 @@ -65,6 +65,7 @@ Culled Empty Block (label) @59 Culled Empty Block (label) @60 Culled Empty Block (label) @61 Culled Empty Block (label) @62 +Culled Empty Block (label) @63 Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @@ -74,7 +75,7 @@ CONTROL FLOW GRAPH SSA (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_ln: scope:[print_ln] from main::@15 (byte*) print_char_cursor#29 ← phi( main::@15/(byte*) print_char_cursor#11 ) (byte*) print_line_cursor#12 ← phi( main::@15/(byte*) print_line_cursor#13 ) @@ -122,11 +123,11 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#19 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_line_cursor#17 ← phi( @12/(byte*) print_line_cursor#0 ) (byte*) print_char_cursor#36 ← phi( @12/(byte*) print_char_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@35 + to:@36 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#31 ← phi( print_word/(byte*) print_char_cursor#30 print_word::@1/(byte*) print_char_cursor#3 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -162,12 +163,12 @@ print_char::@return: scope:[print_char] from print_char (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#24 return to:@return -@35: scope:[] from @28 - (byte*) print_line_cursor#16 ← phi( @28/(byte*) print_line_cursor#17 ) - (byte*) print_char_cursor#35 ← phi( @28/(byte*) print_char_cursor#36 ) +@36: scope:[] from @29 + (byte*) print_line_cursor#16 ← phi( @29/(byte*) print_line_cursor#17 ) + (byte*) print_char_cursor#35 ← phi( @29/(byte*) print_char_cursor#36 ) (byte*) memLo#0 ← ((byte*)) (number) $fe (byte*) memHi#0 ← ((byte*)) (number) $ff - to:@63 + to:@64 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -256,9 +257,9 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @63 - (byte*) print_line_cursor#30 ← phi( @63/(byte*) print_line_cursor#14 ) - (byte*) print_char_cursor#48 ← phi( @63/(byte*) print_char_cursor#33 ) +main: scope:[main] from @64 + (byte*) print_line_cursor#30 ← phi( @64/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#48 ← phi( @64/(byte*) print_char_cursor#33 ) (byte[]) main::f_i#0 ← { (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } (byte[]) main::f_127#0 ← { (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } (byte*) main::f_2pi#0 ← ((byte*)) (number) $e2e5 @@ -377,26 +378,26 @@ main::@return: scope:[main] from main::@16 (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#10 return to:@return -@63: scope:[] from @35 - (byte*) print_line_cursor#14 ← phi( @35/(byte*) print_line_cursor#16 ) - (byte*) print_char_cursor#33 ← phi( @35/(byte*) print_char_cursor#35 ) +@64: scope:[] from @36 + (byte*) print_line_cursor#14 ← phi( @36/(byte*) print_line_cursor#16 ) + (byte*) print_char_cursor#33 ← phi( @36/(byte*) print_char_cursor#35 ) call main - to:@64 -@64: scope:[] from @63 - (byte*) print_line_cursor#11 ← phi( @63/(byte*) print_line_cursor#4 ) - (byte*) print_char_cursor#28 ← phi( @63/(byte*) print_char_cursor#13 ) + to:@65 +@65: scope:[] from @64 + (byte*) print_line_cursor#11 ← phi( @64/(byte*) print_line_cursor#4 ) + (byte*) print_char_cursor#28 ← phi( @64/(byte*) print_char_cursor#13 ) (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#28 (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#11 to:@end -@end: scope:[] from @64 +@end: scope:[] from @65 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @35 -(label) @63 +(label) @29 +(label) @36 (label) @64 +(label) @65 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -787,10 +788,10 @@ Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_l Added new block during phi lifting main::@17(between main::@16 and main::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @63 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @36 Adding NOP phi() at start of @64 +Adding NOP phi() at start of @65 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -841,15 +842,15 @@ Coalesced [107] prepareMEM::mem#7 ← prepareMEM::mem#0 Coalesced [113] prepareMEM::mem#8 ← prepareMEM::mem#1 Coalesced down to 9 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @35 -Culled Empty Block (label) @64 +Culled Empty Block (label) @29 +Culled Empty Block (label) @36 +Culled Empty Block (label) @65 Culled Empty Block (label) main::@5 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 Culled Empty Block (label) print_word::@2 Culled Empty Block (label) print_byte::@2 -Renumbering block @63 to @1 +Renumbering block @64 to @1 Renumbering block main::@3 to main::@2 Renumbering block main::@4 to main::@3 Renumbering block main::@6 to main::@4 diff --git a/src/test/ref/sinusgen16.log b/src/test/ref/sinusgen16.log index 824d86624..e5cba3be7 100644 --- a/src/test/ref/sinusgen16.log +++ b/src/test/ref/sinusgen16.log @@ -70,13 +70,14 @@ Culled Empty Block (label) @44 Culled Empty Block (label) @45 Culled Empty Block (label) @46 Culled Empty Block (label) @47 -Culled Empty Block (label) @49 +Culled Empty Block (label) @48 Culled Empty Block (label) @50 Culled Empty Block (label) @51 Culled Empty Block (label) @52 Culled Empty Block (label) @53 Culled Empty Block (label) @54 Culled Empty Block (label) @55 +Culled Empty Block (label) @56 Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @@ -495,7 +496,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@48 + to:@49 print_str: scope:[print_str] from main::@3 main::@7 (byte*) print_char_cursor#54 ← phi( main::@3/(byte*) print_char_cursor#52 main::@7/(byte*) print_char_cursor#18 ) (byte*) print_str::str#5 ← phi( main::@3/(byte*) print_str::str#2 main::@7/(byte*) print_str::str#1 ) @@ -588,13 +589,13 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#31 return to:@return -@48: scope:[] from @32 +@49: scope:[] from @32 (byte*) print_screen#6 ← phi( @32/(byte*) print_screen#0 ) (byte*) print_char_cursor#58 ← phi( @32/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#15 ← phi( @32/(byte*) print_line_cursor#0 ) (word) rem16u#28 ← phi( @32/(word) rem16u#29 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@56 + to:@57 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#49 ← phi( print_word/(byte*) print_char_cursor#48 print_word::@1/(byte*) print_char_cursor#7 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -650,11 +651,11 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#37 return to:@return -main: scope:[main] from @56 - (byte*) print_char_cursor#56 ← phi( @56/(byte*) print_char_cursor#53 ) - (byte*) print_line_cursor#13 ← phi( @56/(byte*) print_line_cursor#12 ) - (byte*) print_screen#4 ← phi( @56/(byte*) print_screen#5 ) - (word) rem16u#23 ← phi( @56/(word) rem16u#25 ) +main: scope:[main] from @57 + (byte*) print_char_cursor#56 ← phi( @57/(byte*) print_char_cursor#53 ) + (byte*) print_line_cursor#13 ← phi( @57/(byte*) print_line_cursor#12 ) + (byte*) print_screen#4 ← phi( @57/(byte*) print_screen#5 ) + (word) rem16u#23 ← phi( @57/(word) rem16u#25 ) (word) main::wavelength#0 ← (number) $78 (signed word[$78]) main::sintab1#0 ← { fill( $78, 0) } (signed word*) sin16s_gen::sintab#1 ← (signed word[$78]) main::sintab1#0 @@ -743,31 +744,31 @@ main::@return: scope:[main] from main::@8 (byte*) print_char_cursor#21 ← (byte*) print_char_cursor#42 return to:@return -@56: scope:[] from @48 - (byte*) print_screen#5 ← phi( @48/(byte*) print_screen#6 ) - (byte*) print_char_cursor#53 ← phi( @48/(byte*) print_char_cursor#58 ) - (byte*) print_line_cursor#12 ← phi( @48/(byte*) print_line_cursor#15 ) - (word) rem16u#25 ← phi( @48/(word) rem16u#28 ) +@57: scope:[] from @49 + (byte*) print_screen#5 ← phi( @49/(byte*) print_screen#6 ) + (byte*) print_char_cursor#53 ← phi( @49/(byte*) print_char_cursor#58 ) + (byte*) print_line_cursor#12 ← phi( @49/(byte*) print_line_cursor#15 ) + (word) rem16u#25 ← phi( @49/(word) rem16u#28 ) call main - to:@57 -@57: scope:[] from @56 - (byte*) print_char_cursor#43 ← phi( @56/(byte*) print_char_cursor#21 ) - (byte*) print_line_cursor#9 ← phi( @56/(byte*) print_line_cursor#4 ) - (word) rem16u#19 ← phi( @56/(word) rem16u#9 ) + to:@58 +@58: scope:[] from @57 + (byte*) print_char_cursor#43 ← phi( @57/(byte*) print_char_cursor#21 ) + (byte*) print_line_cursor#9 ← phi( @57/(byte*) print_line_cursor#4 ) + (word) rem16u#19 ← phi( @57/(word) rem16u#9 ) (word) rem16u#10 ← (word) rem16u#19 (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#9 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#43 to:@end -@end: scope:[] from @57 +@end: scope:[] from @58 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @13 (label) @2 (label) @32 -(label) @48 -(label) @56 +(label) @49 (label) @57 +(label) @58 (label) @begin (label) @end (dword) PI2_u4f28 @@ -1888,9 +1889,9 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 Adding NOP phi() at start of @13 Adding NOP phi() at start of @32 -Adding NOP phi() at start of @48 -Adding NOP phi() at start of @56 +Adding NOP phi() at start of @49 Adding NOP phi() at start of @57 +Adding NOP phi() at start of @58 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@5 @@ -1981,8 +1982,8 @@ Coalesced down to 23 phi equivalence classes Culled Empty Block (label) @2 Culled Empty Block (label) @13 Culled Empty Block (label) @32 -Culled Empty Block (label) @48 -Culled Empty Block (label) @57 +Culled Empty Block (label) @49 +Culled Empty Block (label) @58 Culled Empty Block (label) main::@6 Culled Empty Block (label) main::@9 Culled Empty Block (label) main::@10 @@ -2003,7 +2004,7 @@ Culled Empty Block (label) mul16u::@10 Culled Empty Block (label) divr16u::@8 Culled Empty Block (label) divr16u::@10 Culled Empty Block (label) divr16u::@9 -Renumbering block @56 to @1 +Renumbering block @57 to @1 Renumbering block div32u16u::@2 to div32u16u::@1 Renumbering block div32u16u::@3 to div32u16u::@2 Renumbering block mul16u::@4 to mul16u::@3 diff --git a/src/test/ref/sinusgen16b.log b/src/test/ref/sinusgen16b.log index 8c664138a..d3392d209 100644 --- a/src/test/ref/sinusgen16b.log +++ b/src/test/ref/sinusgen16b.log @@ -75,13 +75,14 @@ Culled Empty Block (label) @46 Culled Empty Block (label) @47 Culled Empty Block (label) @48 Culled Empty Block (label) @49 -Culled Empty Block (label) @51 +Culled Empty Block (label) @50 Culled Empty Block (label) @52 Culled Empty Block (label) @53 Culled Empty Block (label) @54 Culled Empty Block (label) @55 Culled Empty Block (label) @56 Culled Empty Block (label) @57 +Culled Empty Block (label) @58 Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @@ -676,7 +677,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@50 + to:@51 print_str: scope:[print_str] from main::@3 main::@8 (byte*) print_char_cursor#54 ← phi( main::@3/(byte*) print_char_cursor#52 main::@8/(byte*) print_char_cursor#18 ) (byte*) print_str::str#5 ← phi( main::@3/(byte*) print_str::str#2 main::@8/(byte*) print_str::str#1 ) @@ -769,13 +770,13 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#31 return to:@return -@50: scope:[] from @34 +@51: scope:[] from @34 (byte*) print_screen#7 ← phi( @34/(byte*) print_screen#0 ) (byte*) print_char_cursor#58 ← phi( @34/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#15 ← phi( @34/(byte*) print_line_cursor#0 ) (word) rem16u#37 ← phi( @34/(word) rem16u#38 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@58 + to:@59 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#49 ← phi( print_word/(byte*) print_char_cursor#48 print_word::@1/(byte*) print_char_cursor#7 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -831,11 +832,11 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#37 return to:@return -main: scope:[main] from @58 - (byte*) print_char_cursor#59 ← phi( @58/(byte*) print_char_cursor#53 ) - (byte*) print_line_cursor#16 ← phi( @58/(byte*) print_line_cursor#12 ) - (byte*) print_screen#5 ← phi( @58/(byte*) print_screen#6 ) - (word) rem16u#31 ← phi( @58/(word) rem16u#33 ) +main: scope:[main] from @59 + (byte*) print_char_cursor#59 ← phi( @59/(byte*) print_char_cursor#53 ) + (byte*) print_line_cursor#16 ← phi( @59/(byte*) print_line_cursor#12 ) + (byte*) print_screen#5 ← phi( @59/(byte*) print_screen#6 ) + (word) rem16u#31 ← phi( @59/(word) rem16u#33 ) (word) main::wavelength#0 ← (number) $78 (signed word[$78]) main::sintab1#0 ← { fill( $78, 0) } (signed word[$78]) main::sintab2#0 ← { fill( $78, 0) } @@ -950,31 +951,31 @@ main::@return: scope:[main] from main::@9 (byte*) print_char_cursor#21 ← (byte*) print_char_cursor#42 return to:@return -@58: scope:[] from @50 - (byte*) print_screen#6 ← phi( @50/(byte*) print_screen#7 ) - (byte*) print_char_cursor#53 ← phi( @50/(byte*) print_char_cursor#58 ) - (byte*) print_line_cursor#12 ← phi( @50/(byte*) print_line_cursor#15 ) - (word) rem16u#33 ← phi( @50/(word) rem16u#37 ) +@59: scope:[] from @51 + (byte*) print_screen#6 ← phi( @51/(byte*) print_screen#7 ) + (byte*) print_char_cursor#53 ← phi( @51/(byte*) print_char_cursor#58 ) + (byte*) print_line_cursor#12 ← phi( @51/(byte*) print_line_cursor#15 ) + (word) rem16u#33 ← phi( @51/(word) rem16u#37 ) call main - to:@59 -@59: scope:[] from @58 - (byte*) print_char_cursor#43 ← phi( @58/(byte*) print_char_cursor#21 ) - (byte*) print_line_cursor#9 ← phi( @58/(byte*) print_line_cursor#4 ) - (word) rem16u#25 ← phi( @58/(word) rem16u#12 ) + to:@60 +@60: scope:[] from @59 + (byte*) print_char_cursor#43 ← phi( @59/(byte*) print_char_cursor#21 ) + (byte*) print_line_cursor#9 ← phi( @59/(byte*) print_line_cursor#4 ) + (word) rem16u#25 ← phi( @59/(word) rem16u#12 ) (word) rem16u#13 ← (word) rem16u#25 (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#9 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#43 to:@end -@end: scope:[] from @59 +@end: scope:[] from @60 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @13 (label) @2 (label) @34 -(label) @50 -(label) @58 +(label) @51 (label) @59 +(label) @60 (label) @begin (label) @end (dword) PI2_u4f28 @@ -2470,9 +2471,9 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 Adding NOP phi() at start of @13 Adding NOP phi() at start of @34 -Adding NOP phi() at start of @50 -Adding NOP phi() at start of @58 +Adding NOP phi() at start of @51 Adding NOP phi() at start of @59 +Adding NOP phi() at start of @60 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@5 @@ -2586,8 +2587,8 @@ Coalesced down to 31 phi equivalence classes Culled Empty Block (label) @2 Culled Empty Block (label) @13 Culled Empty Block (label) @34 -Culled Empty Block (label) @50 -Culled Empty Block (label) @59 +Culled Empty Block (label) @51 +Culled Empty Block (label) @60 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@10 Culled Empty Block (label) main::@11 @@ -2611,7 +2612,7 @@ Culled Empty Block (label) divr16u::@9 Culled Empty Block (label) sin16s_gen::@5 Culled Empty Block (label) sin16s::@14 Culled Empty Block (label) sin16s::@13 -Renumbering block @58 to @1 +Renumbering block @59 to @1 Renumbering block div32u16u::@2 to div32u16u::@1 Renumbering block div32u16u::@3 to div32u16u::@2 Renumbering block mul16u::@4 to mul16u::@3 diff --git a/src/test/ref/sinusgen8.log b/src/test/ref/sinusgen8.log index 8ef87821a..f9e59d8e5 100644 --- a/src/test/ref/sinusgen8.log +++ b/src/test/ref/sinusgen8.log @@ -69,13 +69,14 @@ Culled Empty Block (label) @44 Culled Empty Block (label) @45 Culled Empty Block (label) @46 Culled Empty Block (label) @47 -Culled Empty Block (label) @49 +Culled Empty Block (label) @48 Culled Empty Block (label) @50 Culled Empty Block (label) @51 Culled Empty Block (label) @52 Culled Empty Block (label) @53 Culled Empty Block (label) @54 Culled Empty Block (label) @55 +Culled Empty Block (label) @56 Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @@ -467,7 +468,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@48 + to:@49 print_str: scope:[print_str] from main::@3 main::@7 (byte*) print_char_cursor#47 ← phi( main::@3/(byte*) print_char_cursor#45 main::@7/(byte*) print_char_cursor#15 ) (byte*) print_str::str#5 ← phi( main::@3/(byte*) print_str::str#2 main::@7/(byte*) print_str::str#1 ) @@ -536,12 +537,12 @@ print_sbyte::@return: scope:[print_sbyte] from print_sbyte::@7 (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#25 return to:@return -@48: scope:[] from @32 +@49: scope:[] from @32 (byte*) print_screen#6 ← phi( @32/(byte*) print_screen#0 ) (byte*) print_char_cursor#51 ← phi( @32/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#15 ← phi( @32/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@56 + to:@57 print_byte: scope:[print_byte] from print_sbyte::@2 (byte*) print_char_cursor#42 ← phi( print_sbyte::@2/(byte*) print_char_cursor#41 ) (byte) print_byte::b#1 ← phi( print_sbyte::@2/(byte) print_byte::b#0 ) @@ -597,10 +598,10 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#13 ← (byte*) print_char_cursor#31 return to:@return -main: scope:[main] from @56 - (byte*) print_char_cursor#49 ← phi( @56/(byte*) print_char_cursor#46 ) - (byte*) print_line_cursor#13 ← phi( @56/(byte*) print_line_cursor#12 ) - (byte*) print_screen#4 ← phi( @56/(byte*) print_screen#5 ) +main: scope:[main] from @57 + (byte*) print_char_cursor#49 ← phi( @57/(byte*) print_char_cursor#46 ) + (byte*) print_line_cursor#13 ← phi( @57/(byte*) print_line_cursor#12 ) + (byte*) print_screen#4 ← phi( @57/(byte*) print_screen#5 ) (word) main::wavelength#0 ← (number) $c0 (signed byte[$c0]) main::sintab2#0 ← { fill( $c0, 0) } (byte[]) main::sintabref#0 ← { (number) 0, (number) 4, (number) 8, (number) $c, (number) $11, (number) $15, (number) $19, (number) $1d, (number) $21, (number) $25, (number) $29, (number) $2d, (number) $31, (number) $35, (number) $38, (number) $3c, (number) $40, (number) $43, (number) $47, (number) $4a, (number) $4e, (number) $51, (number) $54, (number) $57, (number) $5a, (number) $5d, (number) $60, (number) $63, (number) $65, (number) $68, (number) $6a, (number) $6c, (number) $6e, (number) $70, (number) $72, (number) $74, (number) $76, (number) $77, (number) $79, (number) $7a, (number) $7b, (number) $7c, (number) $7d, (number) $7e, (number) $7e, (number) $7f, (number) $7f, (number) $7f, (number) $80, (number) $7f, (number) $7f, (number) $7f, (number) $7e, (number) $7e, (number) $7d, (number) $7c, (number) $7b, (number) $7a, (number) $79, (number) $77, (number) $76, (number) $74, (number) $72, (number) $70, (number) $6e, (number) $6c, (number) $6a, (number) $68, (number) $65, (number) $63, (number) $60, (number) $5d, (number) $5a, (number) $57, (number) $54, (number) $51, (number) $4e, (number) $4a, (number) $47, (number) $43, (number) $40, (number) $3c, (number) $38, (number) $35, (number) $31, (number) $2d, (number) $29, (number) $25, (number) $21, (number) $1d, (number) $19, (number) $15, (number) $11, (number) $c, (number) 8, (number) 4, (number) 0, (number) $fc, (number) $f8, (number) $f4, (number) $ef, (number) $eb, (number) $e7, (number) $e3, (number) $df, (number) $db, (number) $d7, (number) $d3, (number) $cf, (number) $cb, (number) $c8, (number) $c4, (number) $c0, (number) $bd, (number) $b9, (number) $b6, (number) $b2, (number) $af, (number) $ac, (number) $a9, (number) $a6, (number) $a3, (number) $a0, (number) $9d, (number) $9b, (number) $98, (number) $96, (number) $94, (number) $92, (number) $90, (number) $8e, (number) $8c, (number) $8a, (number) $89, (number) $87, (number) $86, (number) $85, (number) $84, (number) $83, (number) $82, (number) $82, (number) $81, (number) $81, (number) $81, (number) $81, (number) $81, (number) $81, (number) $81, (number) $82, (number) $82, (number) $83, (number) $84, (number) $85, (number) $86, (number) $87, (number) $89, (number) $8a, (number) $8c, (number) $8e, (number) $90, (number) $92, (number) $94, (number) $96, (number) $98, (number) $9b, (number) $9d, (number) $a0, (number) $a3, (number) $a6, (number) $a9, (number) $ac, (number) $af, (number) $b2, (number) $b6, (number) $b9, (number) $bd, (number) $c0, (number) $c4, (number) $c8, (number) $cb, (number) $cf, (number) $d3, (number) $d7, (number) $db, (number) $df, (number) $e3, (number) $e7, (number) $eb, (number) $ef, (number) $f4, (number) $f8, (number) $fc } @@ -679,27 +680,27 @@ main::@return: scope:[main] from main::@8 (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#36 return to:@return -@56: scope:[] from @48 - (byte*) print_screen#5 ← phi( @48/(byte*) print_screen#6 ) - (byte*) print_char_cursor#46 ← phi( @48/(byte*) print_char_cursor#51 ) - (byte*) print_line_cursor#12 ← phi( @48/(byte*) print_line_cursor#15 ) +@57: scope:[] from @49 + (byte*) print_screen#5 ← phi( @49/(byte*) print_screen#6 ) + (byte*) print_char_cursor#46 ← phi( @49/(byte*) print_char_cursor#51 ) + (byte*) print_line_cursor#12 ← phi( @49/(byte*) print_line_cursor#15 ) call main - to:@57 -@57: scope:[] from @56 - (byte*) print_char_cursor#37 ← phi( @56/(byte*) print_char_cursor#18 ) - (byte*) print_line_cursor#9 ← phi( @56/(byte*) print_line_cursor#4 ) + to:@58 +@58: scope:[] from @57 + (byte*) print_char_cursor#37 ← phi( @57/(byte*) print_char_cursor#18 ) + (byte*) print_line_cursor#9 ← phi( @57/(byte*) print_line_cursor#4 ) (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#9 (byte*) print_char_cursor#19 ← (byte*) print_char_cursor#37 to:@end -@end: scope:[] from @57 +@end: scope:[] from @58 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @13 (label) @32 -(label) @48 -(label) @56 +(label) @49 (label) @57 +(label) @58 (label) @begin (label) @end (word) PI2_u4f12 @@ -1907,9 +1908,9 @@ Added new block during phi lifting main::@11(between main::@1 and main::@2) Adding NOP phi() at start of @begin Adding NOP phi() at start of @13 Adding NOP phi() at start of @32 -Adding NOP phi() at start of @48 -Adding NOP phi() at start of @56 +Adding NOP phi() at start of @49 Adding NOP phi() at start of @57 +Adding NOP phi() at start of @58 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@5 @@ -1996,8 +1997,8 @@ Coalesced [218] divr16u::rem#11 ← divr16u::rem#0 Coalesced down to 23 phi equivalence classes Culled Empty Block (label) @13 Culled Empty Block (label) @32 -Culled Empty Block (label) @48 -Culled Empty Block (label) @57 +Culled Empty Block (label) @49 +Culled Empty Block (label) @58 Culled Empty Block (label) main::@6 Culled Empty Block (label) main::@9 Culled Empty Block (label) main::@10 @@ -2019,7 +2020,7 @@ Culled Empty Block (label) divr16u::@6 Culled Empty Block (label) divr16u::@8 Culled Empty Block (label) divr16u::@10 Culled Empty Block (label) divr16u::@9 -Renumbering block @56 to @1 +Renumbering block @57 to @1 Renumbering block div16u::@2 to div16u::@1 Renumbering block mul8u::@4 to mul8u::@3 Renumbering block mul8u::@7 to mul8u::@4 diff --git a/src/test/ref/sinusgen8b.log b/src/test/ref/sinusgen8b.log index 3e91dbe86..27d593b94 100644 --- a/src/test/ref/sinusgen8b.log +++ b/src/test/ref/sinusgen8b.log @@ -77,13 +77,14 @@ Culled Empty Block (label) @44 Culled Empty Block (label) @45 Culled Empty Block (label) @46 Culled Empty Block (label) @47 -Culled Empty Block (label) @49 +Culled Empty Block (label) @48 Culled Empty Block (label) @50 Culled Empty Block (label) @51 Culled Empty Block (label) @52 Culled Empty Block (label) @53 Culled Empty Block (label) @54 Culled Empty Block (label) @55 +Culled Empty Block (label) @56 Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @@ -785,7 +786,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@48 + to:@49 print_str: scope:[print_str] from main::@6 (byte*) print_char_cursor#44 ← phi( main::@6/(byte*) print_char_cursor#15 ) (byte*) print_str::str#4 ← phi( main::@6/(byte*) print_str::str#1 ) @@ -854,13 +855,13 @@ print_sbyte::@return: scope:[print_sbyte] from print_sbyte::@7 (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#24 return to:@return -@48: scope:[] from @32 +@49: scope:[] from @32 (byte*) print_screen#7 ← phi( @32/(byte*) print_screen#0 ) (byte*) print_char_cursor#47 ← phi( @32/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#15 ← phi( @32/(byte*) print_line_cursor#0 ) (word) rem16u#42 ← phi( @32/(word) rem16u#43 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@56 + to:@57 print_byte: scope:[print_byte] from print_sbyte::@2 (byte*) print_char_cursor#40 ← phi( print_sbyte::@2/(byte*) print_char_cursor#39 ) (byte) print_byte::b#1 ← phi( print_sbyte::@2/(byte) print_byte::b#0 ) @@ -916,11 +917,11 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#13 ← (byte*) print_char_cursor#30 return to:@return -main: scope:[main] from @56 - (byte*) print_char_cursor#48 ← phi( @56/(byte*) print_char_cursor#43 ) - (byte*) print_line_cursor#16 ← phi( @56/(byte*) print_line_cursor#12 ) - (byte*) print_screen#5 ← phi( @56/(byte*) print_screen#6 ) - (word) rem16u#36 ← phi( @56/(word) rem16u#38 ) +main: scope:[main] from @57 + (byte*) print_char_cursor#48 ← phi( @57/(byte*) print_char_cursor#43 ) + (byte*) print_line_cursor#16 ← phi( @57/(byte*) print_line_cursor#12 ) + (byte*) print_screen#5 ← phi( @57/(byte*) print_screen#6 ) + (word) rem16u#36 ← phi( @57/(word) rem16u#38 ) (word) main::wavelength#0 ← (number) $c0 (signed byte[$c0]) main::sintabb#0 ← { fill( $c0, 0) } (signed byte*) sin8s_gen::sintab#1 ← (signed byte[$c0]) main::sintabb#0 @@ -999,31 +1000,31 @@ main::@return: scope:[main] from main::@7 (byte*) print_char_cursor#17 ← (byte*) print_char_cursor#34 return to:@return -@56: scope:[] from @48 - (byte*) print_screen#6 ← phi( @48/(byte*) print_screen#7 ) - (byte*) print_char_cursor#43 ← phi( @48/(byte*) print_char_cursor#47 ) - (byte*) print_line_cursor#12 ← phi( @48/(byte*) print_line_cursor#15 ) - (word) rem16u#38 ← phi( @48/(word) rem16u#42 ) +@57: scope:[] from @49 + (byte*) print_screen#6 ← phi( @49/(byte*) print_screen#7 ) + (byte*) print_char_cursor#43 ← phi( @49/(byte*) print_char_cursor#47 ) + (byte*) print_line_cursor#12 ← phi( @49/(byte*) print_line_cursor#15 ) + (word) rem16u#38 ← phi( @49/(word) rem16u#42 ) call main - to:@57 -@57: scope:[] from @56 - (byte*) print_char_cursor#35 ← phi( @56/(byte*) print_char_cursor#17 ) - (byte*) print_line_cursor#9 ← phi( @56/(byte*) print_line_cursor#4 ) - (word) rem16u#29 ← phi( @56/(word) rem16u#14 ) + to:@58 +@58: scope:[] from @57 + (byte*) print_char_cursor#35 ← phi( @57/(byte*) print_char_cursor#17 ) + (byte*) print_line_cursor#9 ← phi( @57/(byte*) print_line_cursor#4 ) + (word) rem16u#29 ← phi( @57/(word) rem16u#14 ) (word) rem16u#15 ← (word) rem16u#29 (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#9 (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#35 to:@end -@end: scope:[] from @57 +@end: scope:[] from @58 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @13 (label) @2 (label) @32 -(label) @48 -(label) @56 +(label) @49 (label) @57 +(label) @58 (label) @begin (label) @end (word) PI2_u4f12 @@ -2600,9 +2601,9 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 Adding NOP phi() at start of @13 Adding NOP phi() at start of @32 -Adding NOP phi() at start of @48 -Adding NOP phi() at start of @56 +Adding NOP phi() at start of @49 Adding NOP phi() at start of @57 +Adding NOP phi() at start of @58 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -2719,8 +2720,8 @@ Coalesced down to 35 phi equivalence classes Culled Empty Block (label) @2 Culled Empty Block (label) @13 Culled Empty Block (label) @32 -Culled Empty Block (label) @48 -Culled Empty Block (label) @57 +Culled Empty Block (label) @49 +Culled Empty Block (label) @58 Culled Empty Block (label) main::@5 Culled Empty Block (label) main::@8 Culled Empty Block (label) print_sbyte::@6 @@ -2744,7 +2745,7 @@ Culled Empty Block (label) sin8s::@16 Culled Empty Block (label) sin8s::@15 Culled Empty Block (label) mul8u::@3 Culled Empty Block (label) mul8u::@10 -Renumbering block @56 to @1 +Renumbering block @57 to @1 Renumbering block div16u::@2 to div16u::@1 Renumbering block div32u16u::@2 to div32u16u::@1 Renumbering block div32u16u::@3 to div32u16u::@2 diff --git a/src/test/ref/sinusgenscale8.log b/src/test/ref/sinusgenscale8.log index 7bb11621d..4c36e010e 100644 --- a/src/test/ref/sinusgenscale8.log +++ b/src/test/ref/sinusgenscale8.log @@ -70,7 +70,7 @@ Culled Empty Block (label) @44 Culled Empty Block (label) @45 Culled Empty Block (label) @46 Culled Empty Block (label) @47 -Culled Empty Block (label) @49 +Culled Empty Block (label) @48 Culled Empty Block (label) @50 Culled Empty Block (label) @51 Culled Empty Block (label) @52 @@ -78,6 +78,7 @@ Culled Empty Block (label) @53 Culled Empty Block (label) @54 Culled Empty Block (label) @55 Culled Empty Block (label) @56 +Culled Empty Block (label) @57 Culled Empty Block (label) sin8u_table::@2 CONTROL FLOW GRAPH SSA @@ -462,7 +463,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@48 + to:@49 print_str: scope:[print_str] from sin8u_table::@11 sin8u_table::@16 sin8u_table::@18 sin8u_table::@20 sin8u_table::@22 sin8u_table::@3 sin8u_table::@5 sin8u_table::@7 sin8u_table::@9 (byte*) print_char_cursor#108 ← phi( sin8u_table::@11/(byte*) print_char_cursor#33 sin8u_table::@16/(byte*) print_char_cursor#106 sin8u_table::@18/(byte*) print_char_cursor#38 sin8u_table::@20/(byte*) print_char_cursor#40 sin8u_table::@22/(byte*) print_char_cursor#42 sin8u_table::@3/(byte*) print_char_cursor#105 sin8u_table::@5/(byte*) print_char_cursor#27 sin8u_table::@7/(byte*) print_char_cursor#29 sin8u_table::@9/(byte*) print_char_cursor#31 ) (byte*) print_str::str#12 ← phi( sin8u_table::@11/(byte*) print_str::str#5 sin8u_table::@16/(byte*) print_str::str#6 sin8u_table::@18/(byte*) print_str::str#7 sin8u_table::@20/(byte*) print_str::str#8 sin8u_table::@22/(byte*) print_str::str#9 sin8u_table::@3/(byte*) print_str::str#1 sin8u_table::@5/(byte*) print_str::str#2 sin8u_table::@7/(byte*) print_str::str#3 sin8u_table::@9/(byte*) print_str::str#4 ) @@ -624,12 +625,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#62 return to:@return -@48: scope:[] from @32 +@49: scope:[] from @32 (byte*) print_screen#5 ← phi( @32/(byte*) print_screen#0 ) (byte*) print_char_cursor#113 ← phi( @32/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#30 ← phi( @32/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@57 + to:@58 print_byte: scope:[print_byte] from print_sbyte::@2 print_word print_word::@1 sin8u_table::@10 sin8u_table::@12 sin8u_table::@23 sin8u_table::@6 sin8u_table::@8 (byte*) print_char_cursor#103 ← phi( print_sbyte::@2/(byte*) print_char_cursor#101 print_word/(byte*) print_char_cursor#102 print_word::@1/(byte*) print_char_cursor#13 sin8u_table::@10/(byte*) print_char_cursor#32 sin8u_table::@12/(byte*) print_char_cursor#34 sin8u_table::@23/(byte*) print_char_cursor#43 sin8u_table::@6/(byte*) print_char_cursor#28 sin8u_table::@8/(byte*) print_char_cursor#30 ) (byte) print_byte::b#8 ← phi( print_sbyte::@2/(byte) print_byte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 sin8u_table::@10/(byte) print_byte::b#5 sin8u_table::@12/(byte) print_byte::b#6 sin8u_table::@23/(byte) print_byte::b#7 sin8u_table::@6/(byte) print_byte::b#3 sin8u_table::@8/(byte) print_byte::b#4 ) @@ -685,10 +686,10 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#68 return to:@return -main: scope:[main] from @57 - (byte*) print_char_cursor#104 ← phi( @57/(byte*) print_char_cursor#107 ) - (byte*) print_line_cursor#24 ← phi( @57/(byte*) print_line_cursor#27 ) - (byte*) print_screen#3 ← phi( @57/(byte*) print_screen#4 ) +main: scope:[main] from @58 + (byte*) print_char_cursor#104 ← phi( @58/(byte*) print_char_cursor#107 ) + (byte*) print_line_cursor#24 ← phi( @58/(byte*) print_line_cursor#27 ) + (byte*) print_screen#3 ← phi( @58/(byte*) print_screen#4 ) (word) main::tabsize#0 ← (number) $14 (byte[$14]) main::sintab#0 ← { fill( $14, 0) } call print_cls @@ -1099,27 +1100,27 @@ sin8u_table::@return: scope:[sin8u_table] from sin8u_table::@25 (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#21 return to:@return -@57: scope:[] from @48 - (byte*) print_screen#4 ← phi( @48/(byte*) print_screen#5 ) - (byte*) print_char_cursor#107 ← phi( @48/(byte*) print_char_cursor#113 ) - (byte*) print_line_cursor#27 ← phi( @48/(byte*) print_line_cursor#30 ) +@58: scope:[] from @49 + (byte*) print_screen#4 ← phi( @49/(byte*) print_screen#5 ) + (byte*) print_char_cursor#107 ← phi( @49/(byte*) print_char_cursor#113 ) + (byte*) print_line_cursor#27 ← phi( @49/(byte*) print_line_cursor#30 ) call main - to:@58 -@58: scope:[] from @57 - (byte*) print_char_cursor#93 ← phi( @57/(byte*) print_char_cursor#25 ) - (byte*) print_line_cursor#22 ← phi( @57/(byte*) print_line_cursor#7 ) + to:@59 +@59: scope:[] from @58 + (byte*) print_char_cursor#93 ← phi( @58/(byte*) print_char_cursor#25 ) + (byte*) print_line_cursor#22 ← phi( @58/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#11 ← (byte*) print_line_cursor#22 (byte*) print_char_cursor#47 ← (byte*) print_char_cursor#93 to:@end -@end: scope:[] from @58 +@end: scope:[] from @59 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @13 (label) @32 -(label) @48 -(label) @57 +(label) @49 (label) @58 +(label) @59 (label) @begin (label) @end (word) PI2_u4f12 @@ -2684,9 +2685,9 @@ Added new block during phi lifting sin8u_table::@26(between sin8u_table::@25 and Adding NOP phi() at start of @begin Adding NOP phi() at start of @13 Adding NOP phi() at start of @32 -Adding NOP phi() at start of @48 -Adding NOP phi() at start of @57 +Adding NOP phi() at start of @49 Adding NOP phi() at start of @58 +Adding NOP phi() at start of @59 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -2813,8 +2814,8 @@ Coalesced [306] memset::dst#3 ← memset::dst#1 Coalesced down to 27 phi equivalence classes Culled Empty Block (label) @13 Culled Empty Block (label) @32 -Culled Empty Block (label) @48 -Culled Empty Block (label) @58 +Culled Empty Block (label) @49 +Culled Empty Block (label) @59 Culled Empty Block (label) main::@2 Culled Empty Block (label) sin8u_table::@14 Culled Empty Block (label) sin8u_table::@26 @@ -2840,7 +2841,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @57 to @1 +Renumbering block @58 to @1 Renumbering block div16u::@2 to div16u::@1 Renumbering block mul8u::@4 to mul8u::@3 Renumbering block mul8u::@7 to mul8u::@4 diff --git a/src/test/ref/test-comparisons-sword.log b/src/test/ref/test-comparisons-sword.log index dd4347df6..6e582d474 100644 --- a/src/test/ref/test-comparisons-sword.log +++ b/src/test/ref/test-comparisons-sword.log @@ -45,12 +45,13 @@ Culled Empty Block (label) @28 Culled Empty Block (label) @29 Culled Empty Block (label) @30 Culled Empty Block (label) @31 -Culled Empty Block (label) @33 +Culled Empty Block (label) @32 Culled Empty Block (label) @34 Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 +Culled Empty Block (label) @39 Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@10 Culled Empty Block (label) main::@12 @@ -111,7 +112,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@32 + to:@33 print_str: scope:[print_str] from compare::@39 (byte*) print_char_cursor#76 ← phi( compare::@39/(byte*) print_char_cursor#23 ) (byte*) print_str::str#4 ← phi( compare::@39/(byte*) print_str::str#1 ) @@ -227,12 +228,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#41 return to:@return -@32: scope:[] from @16 +@33: scope:[] from @16 (byte*) print_screen#7 ← phi( @16/(byte*) print_screen#0 ) (byte*) print_char_cursor#93 ← phi( @16/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#28 ← phi( @16/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@39 + to:@40 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#66 ← phi( print_word/(byte*) print_char_cursor#65 print_word::@1/(byte*) print_char_cursor#9 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -288,16 +289,16 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#47 return to:@return -@39: scope:[] from @32 - (byte*) print_screen#6 ← phi( @32/(byte*) print_screen#7 ) - (byte*) print_char_cursor#85 ← phi( @32/(byte*) print_char_cursor#93 ) - (byte*) print_line_cursor#27 ← phi( @32/(byte*) print_line_cursor#28 ) +@40: scope:[] from @33 + (byte*) print_screen#6 ← phi( @33/(byte*) print_screen#7 ) + (byte*) print_char_cursor#85 ← phi( @33/(byte*) print_char_cursor#93 ) + (byte*) print_line_cursor#27 ← phi( @33/(byte*) print_line_cursor#28 ) (signed word[]) swords#0 ← { (number) -$6fed, (number) $12, (number) $7fed } - to:@40 -main: scope:[main] from @41 - (byte*) print_char_cursor#69 ← phi( @41/(byte*) print_char_cursor#75 ) - (byte*) print_line_cursor#18 ← phi( @41/(byte*) print_line_cursor#21 ) - (byte*) print_screen#3 ← phi( @41/(byte*) print_screen#4 ) + to:@41 +main: scope:[main] from @42 + (byte*) print_char_cursor#69 ← phi( @42/(byte*) print_char_cursor#75 ) + (byte*) print_line_cursor#18 ← phi( @42/(byte*) print_line_cursor#21 ) + (byte*) print_screen#3 ← phi( @42/(byte*) print_screen#4 ) call print_cls to:main::@15 main::@15: scope:[main] from main @@ -425,10 +426,10 @@ main::@return: scope:[main] from main::@9 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#51 return to:@return -@40: scope:[] from @39 - (byte*) print_screen#5 ← phi( @39/(byte*) print_screen#6 ) - (byte*) print_char_cursor#82 ← phi( @39/(byte*) print_char_cursor#85 ) - (byte*) print_line_cursor#24 ← phi( @39/(byte*) print_line_cursor#27 ) +@41: scope:[] from @40 + (byte*) print_screen#5 ← phi( @40/(byte*) print_screen#6 ) + (byte*) print_char_cursor#82 ← phi( @40/(byte*) print_char_cursor#85 ) + (byte*) print_line_cursor#24 ← phi( @40/(byte*) print_line_cursor#27 ) (byte) LT#0 ← (number) 0 (byte) LE#0 ← (number) 1 (byte) GT#0 ← (number) 2 @@ -437,7 +438,7 @@ main::@return: scope:[main] from main::@9 (byte) NE#0 ← (number) 5 (byte) FF#0 ← (number) $57 (byte) TT#0 ← (number) $51 - to:@41 + to:@42 compare: scope:[compare] from main::@3 (byte*) print_char_cursor#107 ← phi( main::@3/(byte*) print_char_cursor#70 ) (signed word) compare::w2#9 ← phi( main::@3/(signed word) compare::w2#0 ) @@ -721,28 +722,28 @@ compare::@return: scope:[compare] from compare::@43 (byte*) print_char_cursor#29 ← (byte*) print_char_cursor#58 return to:@return -@41: scope:[] from @40 - (byte*) print_screen#4 ← phi( @40/(byte*) print_screen#5 ) - (byte*) print_char_cursor#75 ← phi( @40/(byte*) print_char_cursor#82 ) - (byte*) print_line_cursor#21 ← phi( @40/(byte*) print_line_cursor#24 ) - call main - to:@42 @42: scope:[] from @41 - (byte*) print_char_cursor#59 ← phi( @41/(byte*) print_char_cursor#22 ) - (byte*) print_line_cursor#16 ← phi( @41/(byte*) print_line_cursor#7 ) + (byte*) print_screen#4 ← phi( @41/(byte*) print_screen#5 ) + (byte*) print_char_cursor#75 ← phi( @41/(byte*) print_char_cursor#82 ) + (byte*) print_line_cursor#21 ← phi( @41/(byte*) print_line_cursor#24 ) + call main + to:@43 +@43: scope:[] from @42 + (byte*) print_char_cursor#59 ← phi( @42/(byte*) print_char_cursor#22 ) + (byte*) print_line_cursor#16 ← phi( @42/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#30 ← (byte*) print_char_cursor#59 to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @16 -(label) @32 -(label) @39 +(label) @33 (label) @40 (label) @41 (label) @42 +(label) @43 (label) @begin (label) @end (byte) EQ @@ -1726,11 +1727,11 @@ Added new block during phi lifting compare::@45(between compare::@11 and compare Added new block during phi lifting compare::@46(between compare::@40 and compare::@13) Adding NOP phi() at start of @begin Adding NOP phi() at start of @16 -Adding NOP phi() at start of @32 -Adding NOP phi() at start of @39 +Adding NOP phi() at start of @33 Adding NOP phi() at start of @40 Adding NOP phi() at start of @41 Adding NOP phi() at start of @42 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@15 @@ -1822,10 +1823,10 @@ Coalesced [172] print_char_cursor#112 ← print_char_cursor#1 Coalesced [185] memset::dst#3 ← memset::dst#1 Coalesced down to 13 phi equivalence classes Culled Empty Block (label) @16 -Culled Empty Block (label) @32 -Culled Empty Block (label) @39 +Culled Empty Block (label) @33 Culled Empty Block (label) @40 -Culled Empty Block (label) @42 +Culled Empty Block (label) @41 +Culled Empty Block (label) @43 Culled Empty Block (label) main::@15 Culled Empty Block (label) main::@18 Culled Empty Block (label) main::@19 @@ -1846,7 +1847,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @41 to @1 +Renumbering block @42 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block main::@9 to main::@8 diff --git a/src/test/ref/test-comparisons-word.log b/src/test/ref/test-comparisons-word.log index 527416e20..8eb9797b0 100644 --- a/src/test/ref/test-comparisons-word.log +++ b/src/test/ref/test-comparisons-word.log @@ -44,12 +44,13 @@ Culled Empty Block (label) @28 Culled Empty Block (label) @29 Culled Empty Block (label) @30 Culled Empty Block (label) @31 -Culled Empty Block (label) @33 +Culled Empty Block (label) @32 Culled Empty Block (label) @34 Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 +Culled Empty Block (label) @39 Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@10 Culled Empty Block (label) main::@12 @@ -110,7 +111,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@32 + to:@33 print_str: scope:[print_str] from compare::@35 (byte*) print_char_cursor#60 ← phi( compare::@35/(byte*) print_char_cursor#19 ) (byte*) print_str::str#4 ← phi( compare::@35/(byte*) print_str::str#1 ) @@ -180,12 +181,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#32 return to:@return -@32: scope:[] from @16 +@33: scope:[] from @16 (byte*) print_screen#7 ← phi( @16/(byte*) print_screen#0 ) (byte*) print_char_cursor#88 ← phi( @16/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#28 ← phi( @16/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@39 + to:@40 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#53 ← phi( print_word/(byte*) print_char_cursor#52 print_word::@1/(byte*) print_char_cursor#5 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -241,16 +242,16 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#38 return to:@return -@39: scope:[] from @32 - (byte*) print_screen#6 ← phi( @32/(byte*) print_screen#7 ) - (byte*) print_char_cursor#74 ← phi( @32/(byte*) print_char_cursor#88 ) - (byte*) print_line_cursor#27 ← phi( @32/(byte*) print_line_cursor#28 ) +@40: scope:[] from @33 + (byte*) print_screen#6 ← phi( @33/(byte*) print_screen#7 ) + (byte*) print_char_cursor#74 ← phi( @33/(byte*) print_char_cursor#88 ) + (byte*) print_line_cursor#27 ← phi( @33/(byte*) print_line_cursor#28 ) (word[]) words#0 ← { (number) $12, (number) $3f34, (number) $cfed } - to:@40 -main: scope:[main] from @41 - (byte*) print_char_cursor#54 ← phi( @41/(byte*) print_char_cursor#59 ) - (byte*) print_line_cursor#18 ← phi( @41/(byte*) print_line_cursor#21 ) - (byte*) print_screen#3 ← phi( @41/(byte*) print_screen#4 ) + to:@41 +main: scope:[main] from @42 + (byte*) print_char_cursor#54 ← phi( @42/(byte*) print_char_cursor#59 ) + (byte*) print_line_cursor#18 ← phi( @42/(byte*) print_line_cursor#21 ) + (byte*) print_screen#3 ← phi( @42/(byte*) print_screen#4 ) call print_cls to:main::@15 main::@15: scope:[main] from main @@ -378,13 +379,13 @@ main::@return: scope:[main] from main::@9 (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#42 return to:@return -@40: scope:[] from @39 - (byte*) print_screen#5 ← phi( @39/(byte*) print_screen#6 ) - (byte*) print_char_cursor#71 ← phi( @39/(byte*) print_char_cursor#74 ) - (byte*) print_line_cursor#24 ← phi( @39/(byte*) print_line_cursor#27 ) +@41: scope:[] from @40 + (byte*) print_screen#5 ← phi( @40/(byte*) print_screen#6 ) + (byte*) print_char_cursor#71 ← phi( @40/(byte*) print_char_cursor#74 ) + (byte*) print_line_cursor#24 ← phi( @40/(byte*) print_line_cursor#27 ) (byte) FF#0 ← (number) $57 (byte) TT#0 ← (number) $51 - to:@41 + to:@42 compare: scope:[compare] from main::@3 (byte*) print_char_cursor#89 ← phi( main::@3/(byte*) print_char_cursor#55 ) (word) compare::w2#8 ← phi( main::@3/(word) compare::w2#0 ) @@ -626,28 +627,28 @@ compare::@return: scope:[compare] from compare::@39 (byte*) print_char_cursor#24 ← (byte*) print_char_cursor#48 return to:@return -@41: scope:[] from @40 - (byte*) print_screen#4 ← phi( @40/(byte*) print_screen#5 ) - (byte*) print_char_cursor#59 ← phi( @40/(byte*) print_char_cursor#71 ) - (byte*) print_line_cursor#21 ← phi( @40/(byte*) print_line_cursor#24 ) - call main - to:@42 @42: scope:[] from @41 - (byte*) print_char_cursor#49 ← phi( @41/(byte*) print_char_cursor#18 ) - (byte*) print_line_cursor#16 ← phi( @41/(byte*) print_line_cursor#7 ) + (byte*) print_screen#4 ← phi( @41/(byte*) print_screen#5 ) + (byte*) print_char_cursor#59 ← phi( @41/(byte*) print_char_cursor#71 ) + (byte*) print_line_cursor#21 ← phi( @41/(byte*) print_line_cursor#24 ) + call main + to:@43 +@43: scope:[] from @42 + (byte*) print_char_cursor#49 ← phi( @42/(byte*) print_char_cursor#18 ) + (byte*) print_line_cursor#16 ← phi( @42/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#25 ← (byte*) print_char_cursor#49 to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @16 -(label) @32 -(label) @39 +(label) @33 (label) @40 (label) @41 (label) @42 +(label) @43 (label) @begin (label) @end (byte) FF @@ -1486,11 +1487,11 @@ Added new block during phi lifting main::@20(between main::@4 and main::@3) Added new block during phi lifting main::@21(between main::@16 and main::@4) Adding NOP phi() at start of @begin Adding NOP phi() at start of @16 -Adding NOP phi() at start of @32 -Adding NOP phi() at start of @39 +Adding NOP phi() at start of @33 Adding NOP phi() at start of @40 Adding NOP phi() at start of @41 Adding NOP phi() at start of @42 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@15 @@ -1573,10 +1574,10 @@ Coalesced [151] print_char_cursor#94 ← print_char_cursor#1 Coalesced [164] memset::dst#3 ← memset::dst#1 Coalesced down to 13 phi equivalence classes Culled Empty Block (label) @16 -Culled Empty Block (label) @32 -Culled Empty Block (label) @39 +Culled Empty Block (label) @33 Culled Empty Block (label) @40 -Culled Empty Block (label) @42 +Culled Empty Block (label) @41 +Culled Empty Block (label) @43 Culled Empty Block (label) main::@15 Culled Empty Block (label) main::@18 Culled Empty Block (label) main::@19 @@ -1591,7 +1592,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @41 to @1 +Renumbering block @42 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block main::@9 to main::@8 Renumbering block main::@16 to main::@9 diff --git a/src/test/ref/test-comparisons.log b/src/test/ref/test-comparisons.log index 5d3340865..c287891ef 100644 --- a/src/test/ref/test-comparisons.log +++ b/src/test/ref/test-comparisons.log @@ -37,16 +37,17 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 +Culled Empty Block (label) @36 Culled Empty Block (label) main::@42 Culled Empty Block (label) main::@44 -Culled Empty Block (label) @36 +Culled Empty Block (label) @37 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -91,7 +92,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_str: scope:[print_str] from printu::@2 (byte*) print_char_cursor#119 ← phi( printu::@2/(byte*) print_char_cursor#40 ) (byte*) print_str::str#4 ← phi( printu::@2/(byte*) print_str::str#1 ) @@ -137,12 +138,12 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#50 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#5 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#141 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#39 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@37 + to:@38 print_byte: scope:[print_byte] from printu::@1 printu::@3 (byte*) print_char_cursor#94 ← phi( printu::@1/(byte*) print_char_cursor#39 printu::@3/(byte*) print_char_cursor#41 ) (byte) print_byte::b#2 ← phi( printu::@1/(byte) print_byte::b#0 printu::@3/(byte) print_byte::b#1 ) @@ -198,10 +199,10 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#56 return to:@return -main: scope:[main] from @37 - (byte*) print_char_cursor#96 ← phi( @37/(byte*) print_char_cursor#118 ) - (byte*) print_line_cursor#26 ← phi( @37/(byte*) print_line_cursor#33 ) - (byte*) print_screen#3 ← phi( @37/(byte*) print_screen#4 ) +main: scope:[main] from @38 + (byte*) print_char_cursor#96 ← phi( @38/(byte*) print_char_cursor#118 ) + (byte*) print_line_cursor#26 ← phi( @38/(byte*) print_line_cursor#33 ) + (byte*) print_screen#3 ← phi( @38/(byte*) print_screen#4 ) call print_cls to:main::@45 main::@45: scope:[main] from main @@ -997,26 +998,26 @@ printu::@return: scope:[printu] from printu::@6 (byte*) print_char_cursor#45 ← (byte*) print_char_cursor#90 return to:@return -@37: scope:[] from @28 - (byte*) print_screen#4 ← phi( @28/(byte*) print_screen#5 ) - (byte*) print_char_cursor#118 ← phi( @28/(byte*) print_char_cursor#141 ) - (byte*) print_line_cursor#33 ← phi( @28/(byte*) print_line_cursor#39 ) +@38: scope:[] from @29 + (byte*) print_screen#4 ← phi( @29/(byte*) print_screen#5 ) + (byte*) print_char_cursor#118 ← phi( @29/(byte*) print_char_cursor#141 ) + (byte*) print_line_cursor#33 ← phi( @29/(byte*) print_line_cursor#39 ) call main - to:@38 -@38: scope:[] from @37 - (byte*) print_char_cursor#91 ← phi( @37/(byte*) print_char_cursor#38 ) - (byte*) print_line_cursor#24 ← phi( @37/(byte*) print_line_cursor#11 ) + to:@39 +@39: scope:[] from @38 + (byte*) print_char_cursor#91 ← phi( @38/(byte*) print_char_cursor#38 ) + (byte*) print_line_cursor#24 ← phi( @38/(byte*) print_line_cursor#11 ) (byte*) print_line_cursor#12 ← (byte*) print_line_cursor#24 (byte*) print_char_cursor#46 ← (byte*) print_char_cursor#91 to:@end -@end: scope:[] from @38 +@end: scope:[] from @39 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @37 +(label) @29 (label) @38 +(label) @39 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -2492,9 +2493,9 @@ Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_l Added new block during phi lifting main::@71(between main::@70 and main::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @37 +Adding NOP phi() at start of @29 Adding NOP phi() at start of @38 +Adding NOP phi() at start of @39 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@45 @@ -2640,8 +2641,8 @@ Coalesced [295] print_char_cursor#143 ← print_char_cursor#1 Coalesced [308] memset::dst#3 ← memset::dst#1 Coalesced down to 32 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @38 +Culled Empty Block (label) @29 +Culled Empty Block (label) @39 Culled Empty Block (label) main::@45 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 @@ -2651,7 +2652,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @37 to @1 +Renumbering block @38 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block main::@43 to main::@42 Renumbering block main::@46 to main::@43 diff --git a/src/test/ref/test-division.log b/src/test/ref/test-division.log index 3518ebdab..70fa68261 100644 --- a/src/test/ref/test-division.log +++ b/src/test/ref/test-division.log @@ -44,19 +44,20 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Culled Empty Block (label) div8u::@1 -Culled Empty Block (label) @36 +Culled Empty Block (label) @37 Culled Empty Block (label) divr8u::@7 Culled Empty Block (label) divr16u::@7 -Culled Empty Block (label) @38 -Culled Empty Block (label) div16u::@1 Culled Empty Block (label) @39 +Culled Empty Block (label) div16u::@1 +Culled Empty Block (label) @40 Culled Empty Block (label) div8s::@8 Culled Empty Block (label) div8s::@10 Culled Empty Block (label) div8s::@12 @@ -69,16 +70,16 @@ Culled Empty Block (label) divr16s::@12 Culled Empty Block (label) divr16s::@6 Culled Empty Block (label) divr16s::@13 Culled Empty Block (label) divr16s::@14 -Culled Empty Block (label) @42 -Culled Empty Block (label) div16s::@1 Culled Empty Block (label) @43 +Culled Empty Block (label) div16s::@1 Culled Empty Block (label) @44 -Culled Empty Block (label) test_8u::@2 Culled Empty Block (label) @45 -Culled Empty Block (label) test_16u::@2 +Culled Empty Block (label) test_8u::@2 Culled Empty Block (label) @46 -Culled Empty Block (label) test_8s::@2 +Culled Empty Block (label) test_16u::@2 Culled Empty Block (label) @47 +Culled Empty Block (label) test_8s::@2 +Culled Empty Block (label) @48 Culled Empty Block (label) test_16s::@2 CONTROL FLOW GRAPH SSA @@ -124,7 +125,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_str: scope:[print_str] from test_16s::@4 test_16s::@6 test_16s::@8 test_16u::@4 test_16u::@6 test_16u::@8 test_8s::@4 test_8s::@6 test_8s::@8 test_8u::@4 test_8u::@6 test_8u::@8 (byte*) print_char_cursor#146 ← phi( test_16s::@4/(byte*) print_char_cursor#56 test_16s::@6/(byte*) print_char_cursor#58 test_16s::@8/(byte*) print_char_cursor#60 test_16u::@4/(byte*) print_char_cursor#38 test_16u::@6/(byte*) print_char_cursor#40 test_16u::@8/(byte*) print_char_cursor#42 test_8s::@4/(byte*) print_char_cursor#47 test_8s::@6/(byte*) print_char_cursor#49 test_8s::@8/(byte*) print_char_cursor#51 test_8u::@4/(byte*) print_char_cursor#29 test_8u::@6/(byte*) print_char_cursor#31 test_8u::@8/(byte*) print_char_cursor#33 ) (byte*) print_str::str#15 ← phi( test_16s::@4/(byte*) print_str::str#10 test_16s::@6/(byte*) print_str::str#11 test_16s::@8/(byte*) print_str::str#12 test_16u::@4/(byte*) print_str::str#4 test_16u::@6/(byte*) print_str::str#5 test_16u::@8/(byte*) print_str::str#6 test_8s::@4/(byte*) print_str::str#7 test_8s::@6/(byte*) print_str::str#8 test_8s::@8/(byte*) print_str::str#9 test_8u::@4/(byte*) print_str::str#1 test_8u::@6/(byte*) print_str::str#2 test_8u::@8/(byte*) print_str::str#3 ) @@ -286,12 +287,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#80 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#9 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#161 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#66 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@35 + to:@36 print_byte: scope:[print_byte] from print_sbyte::@2 print_word print_word::@1 test_8u::@3 test_8u::@5 test_8u::@7 test_8u::@9 (byte*) print_char_cursor#139 ← phi( print_sbyte::@2/(byte*) print_char_cursor#137 print_word/(byte*) print_char_cursor#138 print_word::@1/(byte*) print_char_cursor#13 test_8u::@3/(byte*) print_char_cursor#141 test_8u::@5/(byte*) print_char_cursor#30 test_8u::@7/(byte*) print_char_cursor#32 test_8u::@9/(byte*) print_char_cursor#34 ) (byte) print_byte::b#7 ← phi( print_sbyte::@2/(byte) print_byte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 test_8u::@3/(byte) print_byte::b#3 test_8u::@5/(byte) print_byte::b#4 test_8u::@7/(byte) print_byte::b#5 test_8u::@9/(byte) print_byte::b#6 ) @@ -347,12 +348,12 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#86 return to:@return -@35: scope:[] from @28 - (byte*) print_screen#8 ← phi( @28/(byte*) print_screen#9 ) - (byte*) print_char_cursor#160 ← phi( @28/(byte*) print_char_cursor#161 ) - (byte*) print_line_cursor#61 ← phi( @28/(byte*) print_line_cursor#66 ) +@36: scope:[] from @29 + (byte*) print_screen#8 ← phi( @29/(byte*) print_screen#9 ) + (byte*) print_char_cursor#160 ← phi( @29/(byte*) print_char_cursor#161 ) + (byte*) print_line_cursor#61 ← phi( @29/(byte*) print_line_cursor#66 ) (byte) rem8u#0 ← (number) 0 - to:@37 + to:@38 div8u: scope:[div8u] from div8s::@4 test_8u::@1 (byte) rem8u#31 ← phi( div8s::@4/(byte) rem8u#32 test_8u::@1/(byte) rem8u#36 ) (byte) div8u::divisor#2 ← phi( div8s::@4/(byte) div8u::divisor#0 test_8u::@1/(byte) div8u::divisor#1 ) @@ -453,13 +454,13 @@ divr8u::@return: scope:[divr8u] from divr8u::@6 (byte) rem8u#4 ← (byte) rem8u#17 return to:@return -@37: scope:[] from @35 - (byte*) print_screen#7 ← phi( @35/(byte*) print_screen#8 ) - (byte) rem8u#55 ← phi( @35/(byte) rem8u#0 ) - (byte*) print_char_cursor#159 ← phi( @35/(byte*) print_char_cursor#160 ) - (byte*) print_line_cursor#56 ← phi( @35/(byte*) print_line_cursor#61 ) +@38: scope:[] from @36 + (byte*) print_screen#7 ← phi( @36/(byte*) print_screen#8 ) + (byte) rem8u#55 ← phi( @36/(byte) rem8u#0 ) + (byte*) print_char_cursor#159 ← phi( @36/(byte*) print_char_cursor#160 ) + (byte*) print_line_cursor#56 ← phi( @36/(byte*) print_line_cursor#61 ) (word) rem16u#0 ← (number) 0 - to:@40 + to:@41 divr16u: scope:[divr16u] from div16u divr16s::@4 (word) divr16u::divisor#6 ← phi( div16u/(word) divr16u::divisor#0 divr16s::@4/(word) divr16u::divisor#1 ) (word) divr16u::dividend#5 ← phi( div16u/(word) divr16u::dividend#1 divr16s::@4/(word) divr16u::dividend#2 ) @@ -561,14 +562,14 @@ div16u::@return: scope:[div16u] from div16u::@2 (word) rem16u#4 ← (word) rem16u#19 return to:@return -@40: scope:[] from @37 - (byte*) print_screen#6 ← phi( @37/(byte*) print_screen#7 ) - (word) rem16u#55 ← phi( @37/(word) rem16u#0 ) - (byte) rem8u#52 ← phi( @37/(byte) rem8u#55 ) - (byte*) print_char_cursor#154 ← phi( @37/(byte*) print_char_cursor#159 ) - (byte*) print_line_cursor#51 ← phi( @37/(byte*) print_line_cursor#56 ) +@41: scope:[] from @38 + (byte*) print_screen#6 ← phi( @38/(byte*) print_screen#7 ) + (word) rem16u#55 ← phi( @38/(word) rem16u#0 ) + (byte) rem8u#52 ← phi( @38/(byte) rem8u#55 ) + (byte*) print_char_cursor#154 ← phi( @38/(byte*) print_char_cursor#159 ) + (byte*) print_line_cursor#51 ← phi( @38/(byte*) print_line_cursor#56 ) (signed byte) rem8s#0 ← (number) 0 - to:@41 + to:@42 div8s: scope:[div8s] from test_8s::@1 (byte) rem8u#60 ← phi( test_8s::@1/(byte) rem8u#39 ) (signed byte) div8s::divisor#6 ← phi( test_8s::@1/(signed byte) div8s::divisor#0 ) @@ -670,15 +671,15 @@ div8s::@return: scope:[div8s] from div8s::@11 div8s::@5 (signed byte) rem8s#3 ← (signed byte) rem8s#9 return to:@return -@41: scope:[] from @40 - (byte*) print_screen#5 ← phi( @40/(byte*) print_screen#6 ) - (signed byte) rem8s#26 ← phi( @40/(signed byte) rem8s#0 ) - (word) rem16u#54 ← phi( @40/(word) rem16u#55 ) - (byte) rem8u#50 ← phi( @40/(byte) rem8u#52 ) - (byte*) print_char_cursor#153 ← phi( @40/(byte*) print_char_cursor#154 ) - (byte*) print_line_cursor#50 ← phi( @40/(byte*) print_line_cursor#51 ) +@42: scope:[] from @41 + (byte*) print_screen#5 ← phi( @41/(byte*) print_screen#6 ) + (signed byte) rem8s#26 ← phi( @41/(signed byte) rem8s#0 ) + (word) rem16u#54 ← phi( @41/(word) rem16u#55 ) + (byte) rem8u#50 ← phi( @41/(byte) rem8u#52 ) + (byte*) print_char_cursor#153 ← phi( @41/(byte*) print_char_cursor#154 ) + (byte*) print_line_cursor#50 ← phi( @41/(byte*) print_line_cursor#51 ) (signed word) rem16s#0 ← (number) 0 - to:@48 + to:@49 divr16s: scope:[divr16s] from div16s (word) rem16u#64 ← phi( div16s/(word) rem16u#37 ) (signed word) divr16s::divisor#6 ← phi( div16s/(signed word) divr16s::divisor#0 ) @@ -825,14 +826,14 @@ div16s::@return: scope:[div16s] from div16s::@2 (signed word) rem16s#5 ← (signed word) rem16s#13 return to:@return -main: scope:[main] from @48 - (signed word) rem16s#34 ← phi( @48/(signed word) rem16s#25 ) - (signed byte) rem8s#29 ← phi( @48/(signed byte) rem8s#21 ) - (word) rem16u#57 ← phi( @48/(word) rem16u#45 ) - (byte) rem8u#44 ← phi( @48/(byte) rem8u#41 ) - (byte*) print_char_cursor#140 ← phi( @48/(byte*) print_char_cursor#145 ) - (byte*) print_line_cursor#40 ← phi( @48/(byte*) print_line_cursor#45 ) - (byte*) print_screen#3 ← phi( @48/(byte*) print_screen#4 ) +main: scope:[main] from @49 + (signed word) rem16s#34 ← phi( @49/(signed word) rem16s#25 ) + (signed byte) rem8s#29 ← phi( @49/(signed byte) rem8s#21 ) + (word) rem16u#57 ← phi( @49/(word) rem16u#45 ) + (byte) rem8u#44 ← phi( @49/(byte) rem8u#41 ) + (byte*) print_char_cursor#140 ← phi( @49/(byte*) print_char_cursor#145 ) + (byte*) print_line_cursor#40 ← phi( @49/(byte*) print_line_cursor#45 ) + (byte*) print_screen#3 ← phi( @49/(byte*) print_screen#4 ) call print_cls to:main::@1 main::@1: scope:[main] from main @@ -1430,23 +1431,23 @@ test_16s::@return: scope:[test_16s] from test_16s::@11 (byte*) print_line_cursor#18 ← (byte*) print_line_cursor#37 return to:@return -@48: scope:[] from @41 - (byte*) print_screen#4 ← phi( @41/(byte*) print_screen#5 ) - (signed word) rem16s#25 ← phi( @41/(signed word) rem16s#0 ) - (signed byte) rem8s#21 ← phi( @41/(signed byte) rem8s#26 ) - (word) rem16u#45 ← phi( @41/(word) rem16u#54 ) - (byte) rem8u#41 ← phi( @41/(byte) rem8u#50 ) - (byte*) print_char_cursor#145 ← phi( @41/(byte*) print_char_cursor#153 ) - (byte*) print_line_cursor#45 ← phi( @41/(byte*) print_line_cursor#50 ) +@49: scope:[] from @42 + (byte*) print_screen#4 ← phi( @42/(byte*) print_screen#5 ) + (signed word) rem16s#25 ← phi( @42/(signed word) rem16s#0 ) + (signed byte) rem8s#21 ← phi( @42/(signed byte) rem8s#26 ) + (word) rem16u#45 ← phi( @42/(word) rem16u#54 ) + (byte) rem8u#41 ← phi( @42/(byte) rem8u#50 ) + (byte*) print_char_cursor#145 ← phi( @42/(byte*) print_char_cursor#153 ) + (byte*) print_line_cursor#45 ← phi( @42/(byte*) print_line_cursor#50 ) call main - to:@49 -@49: scope:[] from @48 - (signed word) rem16s#19 ← phi( @48/(signed word) rem16s#7 ) - (signed byte) rem8s#15 ← phi( @48/(signed byte) rem8s#5 ) - (word) rem16u#34 ← phi( @48/(word) rem16u#11 ) - (byte) rem8u#30 ← phi( @48/(byte) rem8u#9 ) - (byte*) print_char_cursor#129 ← phi( @48/(byte*) print_char_cursor#28 ) - (byte*) print_line_cursor#38 ← phi( @48/(byte*) print_line_cursor#10 ) + to:@50 +@50: scope:[] from @49 + (signed word) rem16s#19 ← phi( @49/(signed word) rem16s#7 ) + (signed byte) rem8s#15 ← phi( @49/(signed byte) rem8s#5 ) + (word) rem16u#34 ← phi( @49/(word) rem16u#11 ) + (byte) rem8u#30 ← phi( @49/(byte) rem8u#9 ) + (byte*) print_char_cursor#129 ← phi( @49/(byte*) print_char_cursor#28 ) + (byte*) print_line_cursor#38 ← phi( @49/(byte*) print_line_cursor#10 ) (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#38 (byte*) print_char_cursor#65 ← (byte*) print_char_cursor#129 (byte) rem8u#14 ← (byte) rem8u#30 @@ -1454,18 +1455,18 @@ test_16s::@return: scope:[test_16s] from test_16s::@11 (signed byte) rem8s#8 ← (signed byte) rem8s#15 (signed word) rem16s#10 ← (signed word) rem16s#19 to:@end -@end: scope:[] from @49 +@end: scope:[] from @50 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @35 -(label) @37 -(label) @40 +(label) @29 +(label) @36 +(label) @38 (label) @41 -(label) @48 +(label) @42 (label) @49 +(label) @50 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -3633,13 +3634,13 @@ Added new block during phi lifting test_8s::@12(between test_8s::@11 and test_8s Added new block during phi lifting test_16s::@12(between test_16s::@11 and test_16s::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @37 -Adding NOP phi() at start of @40 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @36 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @41 -Adding NOP phi() at start of @48 +Adding NOP phi() at start of @42 Adding NOP phi() at start of @49 +Adding NOP phi() at start of @50 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -3802,12 +3803,12 @@ Coalesced (already) [393] print_line_cursor#93 ← print_line_cursor#1 Coalesced [406] memset::dst#3 ← memset::dst#1 Coalesced down to 34 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @35 -Culled Empty Block (label) @37 -Culled Empty Block (label) @40 +Culled Empty Block (label) @29 +Culled Empty Block (label) @36 +Culled Empty Block (label) @38 Culled Empty Block (label) @41 -Culled Empty Block (label) @49 +Culled Empty Block (label) @42 +Culled Empty Block (label) @50 Culled Empty Block (label) main::@5 Culled Empty Block (label) test_16s::@12 Culled Empty Block (label) print_ln::@2 @@ -3831,7 +3832,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @48 to @1 +Renumbering block @49 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block print_sbyte::@5 to print_sbyte::@4 diff --git a/src/test/ref/test-lowhigh.log b/src/test/ref/test-lowhigh.log index fc7f29964..33c1249bd 100644 --- a/src/test/ref/test-lowhigh.log +++ b/src/test/ref/test-lowhigh.log @@ -33,13 +33,14 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 +Culled Empty Block (label) @36 Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @@ -85,7 +86,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_ln: scope:[print_ln] from main::@16 (byte*) print_char_cursor#64 ← phi( main::@16/(byte*) print_char_cursor#29 ) (byte*) print_line_cursor#17 ← phi( main::@16/(byte*) print_line_cursor#19 ) @@ -157,12 +158,12 @@ print_dword::@return: scope:[print_dword] from print_dword::@2 (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#40 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#5 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#71 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#22 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@36 + to:@37 print_byte: scope:[print_byte] from main::@11 main::@13 main::@15 main::@9 print_word print_word::@1 (byte*) print_char_cursor#67 ← phi( main::@11/(byte*) print_char_cursor#24 main::@13/(byte*) print_char_cursor#26 main::@15/(byte*) print_char_cursor#28 main::@9/(byte*) print_char_cursor#22 print_word/(byte*) print_char_cursor#65 print_word::@1/(byte*) print_char_cursor#3 ) (byte) print_byte::b#6 ← phi( main::@11/(byte) print_byte::b#3 main::@13/(byte) print_byte::b#4 main::@15/(byte) print_byte::b#5 main::@9/(byte) print_byte::b#2 print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -218,10 +219,10 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#46 return to:@return -main: scope:[main] from @36 - (byte*) print_char_cursor#68 ← phi( @36/(byte*) print_char_cursor#70 ) - (byte*) print_line_cursor#18 ← phi( @36/(byte*) print_line_cursor#20 ) - (byte*) print_screen#3 ← phi( @36/(byte*) print_screen#4 ) +main: scope:[main] from @37 + (byte*) print_char_cursor#68 ← phi( @37/(byte*) print_char_cursor#70 ) + (byte*) print_line_cursor#18 ← phi( @37/(byte*) print_line_cursor#20 ) + (byte*) print_screen#3 ← phi( @37/(byte*) print_screen#4 ) call print_cls to:main::@3 main::@3: scope:[main] from main @@ -389,26 +390,26 @@ main::@return: scope:[main] from main::@17 (byte*) print_char_cursor#31 ← (byte*) print_char_cursor#62 return to:@return -@36: scope:[] from @28 - (byte*) print_screen#4 ← phi( @28/(byte*) print_screen#5 ) - (byte*) print_char_cursor#70 ← phi( @28/(byte*) print_char_cursor#71 ) - (byte*) print_line_cursor#20 ← phi( @28/(byte*) print_line_cursor#22 ) +@37: scope:[] from @29 + (byte*) print_screen#4 ← phi( @29/(byte*) print_screen#5 ) + (byte*) print_char_cursor#70 ← phi( @29/(byte*) print_char_cursor#71 ) + (byte*) print_line_cursor#20 ← phi( @29/(byte*) print_line_cursor#22 ) call main - to:@37 -@37: scope:[] from @36 - (byte*) print_char_cursor#63 ← phi( @36/(byte*) print_char_cursor#31 ) - (byte*) print_line_cursor#16 ← phi( @36/(byte*) print_line_cursor#7 ) + to:@38 +@38: scope:[] from @37 + (byte*) print_char_cursor#63 ← phi( @37/(byte*) print_char_cursor#31 ) + (byte*) print_line_cursor#16 ← phi( @37/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#32 ← (byte*) print_char_cursor#63 to:@end -@end: scope:[] from @37 +@end: scope:[] from @38 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @36 +(label) @29 (label) @37 +(label) @38 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -905,9 +906,9 @@ Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_l Added new block during phi lifting main::@18(between main::@17 and main::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @36 +Adding NOP phi() at start of @29 Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -968,8 +969,8 @@ Coalesced (already) [108] print_char_cursor#75 ← print_char_cursor#12 Coalesced [124] memset::dst#3 ← memset::dst#1 Coalesced down to 7 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @37 +Culled Empty Block (label) @29 +Culled Empty Block (label) @38 Culled Empty Block (label) main::@3 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 @@ -980,7 +981,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @36 to @1 +Renumbering block @37 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block main::@4 to main::@2 Renumbering block main::@5 to main::@3 diff --git a/src/test/ref/test-multiply-16bit.log b/src/test/ref/test-multiply-16bit.log index c5617e900..7708083ae 100644 --- a/src/test/ref/test-multiply-16bit.log +++ b/src/test/ref/test-multiply-16bit.log @@ -40,8 +40,8 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 +Culled Empty Block (label) @28 Culled Empty Block (label) print_sdword::@4 -Culled Empty Block (label) @29 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 @@ -51,37 +51,38 @@ Culled Empty Block (label) @35 Culled Empty Block (label) @36 Culled Empty Block (label) @37 Culled Empty Block (label) @38 +Culled Empty Block (label) @39 Culled Empty Block (label) mul16u::@5 Culled Empty Block (label) mul16u::@6 Culled Empty Block (label) mul16u::@8 Culled Empty Block (label) mul16u::@9 -Culled Empty Block (label) @39 +Culled Empty Block (label) @40 Culled Empty Block (label) mul16s::@5 -Culled Empty Block (label) @41 Culled Empty Block (label) @42 Culled Empty Block (label) @43 Culled Empty Block (label) @44 Culled Empty Block (label) @45 Culled Empty Block (label) @46 Culled Empty Block (label) @47 -Culled Empty Block (label) mulf16u::@1 Culled Empty Block (label) @48 +Culled Empty Block (label) mulf16u::@1 +Culled Empty Block (label) @49 Culled Empty Block (label) mulf16s::@5 -Culled Empty Block (label) @50 +Culled Empty Block (label) @51 Culled Empty Block (label) muls16u::@5 Culled Empty Block (label) muls16u::@3 -Culled Empty Block (label) @51 +Culled Empty Block (label) @52 Culled Empty Block (label) muls16s::@2 Culled Empty Block (label) muls16s::@9 Culled Empty Block (label) muls16s::@6 Culled Empty Block (label) muls16s::@11 Culled Empty Block (label) muls16s::@7 -Culled Empty Block (label) @52 -Culled Empty Block (label) mul16u_compare::@9 Culled Empty Block (label) @53 +Culled Empty Block (label) mul16u_compare::@9 Culled Empty Block (label) @54 -Culled Empty Block (label) mul16s_compare::@9 Culled Empty Block (label) @55 +Culled Empty Block (label) mul16s_compare::@9 +Culled Empty Block (label) @56 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -126,7 +127,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_str: scope:[print_str] from mul16s_compare::@1 mul16s_compare::@17 mul16s_error mul16s_error::@2 mul16s_error::@4 mul16s_error::@6 mul16s_error::@8 mul16u_compare::@1 mul16u_compare::@17 mul16u_error mul16u_error::@2 mul16u_error::@4 mul16u_error::@6 mul16u_error::@8 (byte*) print_char_cursor#154 ← phi( mul16s_compare::@1/(byte*) print_char_cursor#149 mul16s_compare::@17/(byte*) print_char_cursor#51 mul16s_error/(byte*) print_char_cursor#152 mul16s_error::@2/(byte*) print_char_cursor#55 mul16s_error::@4/(byte*) print_char_cursor#57 mul16s_error::@6/(byte*) print_char_cursor#59 mul16s_error::@8/(byte*) print_char_cursor#61 mul16u_compare::@1/(byte*) print_char_cursor#145 mul16u_compare::@17/(byte*) print_char_cursor#33 mul16u_error/(byte*) print_char_cursor#148 mul16u_error::@2/(byte*) print_char_cursor#37 mul16u_error::@4/(byte*) print_char_cursor#39 mul16u_error::@6/(byte*) print_char_cursor#41 mul16u_error::@8/(byte*) print_char_cursor#43 ) (byte*) print_str::str#17 ← phi( mul16s_compare::@1/(byte*) print_str::str#8 mul16s_compare::@17/(byte*) print_str::str#9 mul16s_error/(byte*) print_str::str#10 mul16s_error::@2/(byte*) print_str::str#11 mul16s_error::@4/(byte*) print_str::str#12 mul16s_error::@6/(byte*) print_str::str#13 mul16s_error::@8/(byte*) print_str::str#14 mul16u_compare::@1/(byte*) print_str::str#1 mul16u_compare::@17/(byte*) print_str::str#2 mul16u_error/(byte*) print_str::str#3 mul16u_error::@2/(byte*) print_str::str#4 mul16u_error::@4/(byte*) print_str::str#5 mul16u_error::@6/(byte*) print_str::str#6 mul16u_error::@8/(byte*) print_str::str#7 ) @@ -312,12 +313,12 @@ print_sdword::@return: scope:[print_sdword] from print_sdword::@7 (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#84 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#7 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#171 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#71 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@40 + to:@41 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#142 ← phi( print_word/(byte*) print_char_cursor#137 print_word::@1/(byte*) print_char_cursor#9 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -477,15 +478,15 @@ mul16s::@return: scope:[mul16s] from mul16s::@2 (signed dword) mul16s::return#1 ← (signed dword) mul16s::return#3 return to:@return -@40: scope:[] from @28 - (byte*) print_screen#6 ← phi( @28/(byte*) print_screen#7 ) - (byte*) print_char_cursor#164 ← phi( @28/(byte*) print_char_cursor#171 ) - (byte*) print_line_cursor#62 ← phi( @28/(byte*) print_line_cursor#71 ) +@41: scope:[] from @29 + (byte*) print_screen#6 ← phi( @29/(byte*) print_screen#7 ) + (byte*) print_char_cursor#164 ← phi( @29/(byte*) print_char_cursor#171 ) + (byte*) print_line_cursor#62 ← phi( @29/(byte*) print_line_cursor#71 ) (byte[$200]) mulf_sqr1_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr1_hi#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_hi#0 ← { fill( $200, 0) } - to:@49 + to:@50 mulf_init: scope:[mulf_init] from main::@1 (word) mulf_init::sqr#0 ← (number) 0 (byte) mulf_init::x_2#0 ← (number) 0 @@ -655,16 +656,16 @@ mulf16s::@return: scope:[mulf16s] from mulf16s::@2 (signed dword) mulf16s::return#1 ← (signed dword) mulf16s::return#3 return to:@return -@49: scope:[] from @40 - (byte*) print_screen#5 ← phi( @40/(byte*) print_screen#6 ) - (byte*) print_char_cursor#163 ← phi( @40/(byte*) print_char_cursor#164 ) - (byte*) print_line_cursor#61 ← phi( @40/(byte*) print_line_cursor#62 ) +@50: scope:[] from @41 + (byte*) print_screen#5 ← phi( @41/(byte*) print_screen#6 ) + (byte*) print_char_cursor#163 ← phi( @41/(byte*) print_char_cursor#164 ) + (byte*) print_line_cursor#61 ← phi( @41/(byte*) print_line_cursor#62 ) (byte*) BGCOL#0 ← ((byte*)) (number) $d021 - to:@56 -main: scope:[main] from @56 - (byte*) print_char_cursor#143 ← phi( @56/(byte*) print_char_cursor#153 ) - (byte*) print_line_cursor#44 ← phi( @56/(byte*) print_line_cursor#54 ) - (byte*) print_screen#3 ← phi( @56/(byte*) print_screen#4 ) + to:@57 +main: scope:[main] from @57 + (byte*) print_char_cursor#143 ← phi( @57/(byte*) print_char_cursor#153 ) + (byte*) print_line_cursor#44 ← phi( @57/(byte*) print_line_cursor#54 ) + (byte*) print_screen#3 ← phi( @57/(byte*) print_screen#4 ) *((byte*) BGCOL#0) ← (number) 5 call print_cls to:main::@1 @@ -1464,28 +1465,28 @@ mul16s_error::@return: scope:[mul16s_error] from mul16s_error::@11 (byte*) print_line_cursor#20 ← (byte*) print_line_cursor#41 return to:@return -@56: scope:[] from @49 - (byte*) print_screen#4 ← phi( @49/(byte*) print_screen#5 ) - (byte*) print_char_cursor#153 ← phi( @49/(byte*) print_char_cursor#163 ) - (byte*) print_line_cursor#54 ← phi( @49/(byte*) print_line_cursor#61 ) +@57: scope:[] from @50 + (byte*) print_screen#4 ← phi( @50/(byte*) print_screen#5 ) + (byte*) print_char_cursor#153 ← phi( @50/(byte*) print_char_cursor#163 ) + (byte*) print_line_cursor#54 ← phi( @50/(byte*) print_line_cursor#61 ) call main - to:@57 -@57: scope:[] from @56 - (byte*) print_char_cursor#131 ← phi( @56/(byte*) print_char_cursor#29 ) - (byte*) print_line_cursor#42 ← phi( @56/(byte*) print_line_cursor#8 ) + to:@58 +@58: scope:[] from @57 + (byte*) print_char_cursor#131 ← phi( @57/(byte*) print_char_cursor#29 ) + (byte*) print_line_cursor#42 ← phi( @57/(byte*) print_line_cursor#8 ) (byte*) print_line_cursor#21 ← (byte*) print_line_cursor#42 (byte*) print_char_cursor#66 ← (byte*) print_char_cursor#131 to:@end -@end: scope:[] from @57 +@end: scope:[] from @58 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @40 -(label) @49 -(label) @56 +(label) @29 +(label) @41 +(label) @50 (label) @57 +(label) @58 (label) @begin (label) @end (byte*) BGCOL @@ -3630,11 +3631,11 @@ Added new block during phi lifting mul16s_compare::@21(between mul16s_compare::@ Added new block during phi lifting mul16s_compare::@22(between mul16s_compare::@3 and mul16s_compare::@4) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @40 -Adding NOP phi() at start of @49 -Adding NOP phi() at start of @56 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @41 +Adding NOP phi() at start of @50 Adding NOP phi() at start of @57 +Adding NOP phi() at start of @58 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@1 Adding NOP phi() at start of main::@2 @@ -3825,10 +3826,10 @@ Coalesced (already) [442] mulf_init::x_2#6 ← mulf_init::x_2#3 Coalesced [455] memset::dst#3 ← memset::dst#1 Coalesced down to 41 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @40 -Culled Empty Block (label) @49 -Culled Empty Block (label) @57 +Culled Empty Block (label) @29 +Culled Empty Block (label) @41 +Culled Empty Block (label) @50 +Culled Empty Block (label) @58 Culled Empty Block (label) main::@4 Culled Empty Block (label) mul16s_compare::@12 Culled Empty Block (label) mul16s_compare::@7 @@ -3877,7 +3878,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @56 to @1 +Renumbering block @57 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block print_sdword::@5 to print_sdword::@4 diff --git a/src/test/ref/test-multiply-8bit.log b/src/test/ref/test-multiply-8bit.log index 5394d940d..fae9f4792 100644 --- a/src/test/ref/test-multiply-8bit.log +++ b/src/test/ref/test-multiply-8bit.log @@ -42,52 +42,53 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 +Culled Empty Block (label) @36 Culled Empty Block (label) mul8u::@5 Culled Empty Block (label) mul8u::@6 Culled Empty Block (label) mul8u::@8 Culled Empty Block (label) mul8u::@9 -Culled Empty Block (label) @36 -Culled Empty Block (label) mul8s::@5 Culled Empty Block (label) @37 +Culled Empty Block (label) mul8s::@5 Culled Empty Block (label) @38 Culled Empty Block (label) @39 -Culled Empty Block (label) @41 +Culled Empty Block (label) @40 Culled Empty Block (label) @42 -Culled Empty Block (label) mulf8u_prepared::@1 Culled Empty Block (label) @43 -Culled Empty Block (label) mulf8u::@1 +Culled Empty Block (label) mulf8u_prepared::@1 Culled Empty Block (label) @44 +Culled Empty Block (label) mulf8u::@1 Culled Empty Block (label) @45 -Culled Empty Block (label) mulf8s_prepared::@5 Culled Empty Block (label) @46 +Culled Empty Block (label) mulf8s_prepared::@5 +Culled Empty Block (label) @47 Culled Empty Block (label) mulf8s::mulf8s_prepare1_@return Culled Empty Block (label) mulf8s::@1 -Culled Empty Block (label) @47 Culled Empty Block (label) @48 -Culled Empty Block (label) @50 +Culled Empty Block (label) @49 +Culled Empty Block (label) @51 Culled Empty Block (label) muls8u::@5 Culled Empty Block (label) muls8u::@3 -Culled Empty Block (label) @51 +Culled Empty Block (label) @52 Culled Empty Block (label) muls8s::@2 Culled Empty Block (label) muls8s::@9 Culled Empty Block (label) muls8s::@6 Culled Empty Block (label) muls8s::@11 Culled Empty Block (label) muls8s::@7 -Culled Empty Block (label) @53 -Culled Empty Block (label) mulf_tables_cmp::@4 Culled Empty Block (label) @54 -Culled Empty Block (label) mul8u_compare::@9 +Culled Empty Block (label) mulf_tables_cmp::@4 Culled Empty Block (label) @55 +Culled Empty Block (label) mul8u_compare::@9 Culled Empty Block (label) @56 -Culled Empty Block (label) mul8s_compare::@9 Culled Empty Block (label) @57 +Culled Empty Block (label) mul8s_compare::@9 +Culled Empty Block (label) @58 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -132,7 +133,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_str: scope:[print_str] from mul8s_compare::@11 mul8s_error mul8s_error::@2 mul8s_error::@4 mul8s_error::@6 mul8s_error::@8 mul8u_compare::@11 mul8u_error mul8u_error::@2 mul8u_error::@4 mul8u_error::@6 mul8u_error::@8 mulf_tables_cmp::@3 mulf_tables_cmp::@5 mulf_tables_cmp::@7 (byte*) print_char_cursor#155 ← phi( mul8s_compare::@11/(byte*) print_char_cursor#152 mul8s_error/(byte*) print_char_cursor#153 mul8s_error::@2/(byte*) print_char_cursor#56 mul8s_error::@4/(byte*) print_char_cursor#58 mul8s_error::@6/(byte*) print_char_cursor#60 mul8s_error::@8/(byte*) print_char_cursor#62 mul8u_compare::@11/(byte*) print_char_cursor#149 mul8u_error/(byte*) print_char_cursor#150 mul8u_error::@2/(byte*) print_char_cursor#40 mul8u_error::@4/(byte*) print_char_cursor#42 mul8u_error::@6/(byte*) print_char_cursor#44 mul8u_error::@8/(byte*) print_char_cursor#46 mulf_tables_cmp::@3/(byte*) print_char_cursor#146 mulf_tables_cmp::@5/(byte*) print_char_cursor#147 mulf_tables_cmp::@7/(byte*) print_char_cursor#29 ) (byte*) print_str::str#18 ← phi( mul8s_compare::@11/(byte*) print_str::str#10 mul8s_error/(byte*) print_str::str#11 mul8s_error::@2/(byte*) print_str::str#12 mul8s_error::@4/(byte*) print_str::str#13 mul8s_error::@6/(byte*) print_str::str#14 mul8s_error::@8/(byte*) print_str::str#15 mul8u_compare::@11/(byte*) print_str::str#4 mul8u_error/(byte*) print_str::str#5 mul8u_error::@2/(byte*) print_str::str#6 mul8u_error::@4/(byte*) print_str::str#7 mul8u_error::@6/(byte*) print_str::str#8 mul8u_error::@8/(byte*) print_str::str#9 mulf_tables_cmp::@3/(byte*) print_str::str#1 mulf_tables_cmp::@5/(byte*) print_str::str#3 mulf_tables_cmp::@7/(byte*) print_str::str#2 ) @@ -294,12 +295,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#82 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#8 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#179 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#89 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@40 + to:@41 print_byte: scope:[print_byte] from mul8u_error::@1 mul8u_error::@3 print_sbyte::@2 print_word print_word::@1 (byte*) print_char_cursor#143 ← phi( mul8u_error::@1/(byte*) print_char_cursor#39 mul8u_error::@3/(byte*) print_char_cursor#41 print_sbyte::@2/(byte*) print_char_cursor#141 print_word/(byte*) print_char_cursor#142 print_word::@1/(byte*) print_char_cursor#13 ) (byte) print_byte::b#5 ← phi( mul8u_error::@1/(byte) print_byte::b#3 mul8u_error::@3/(byte) print_byte::b#4 print_sbyte::@2/(byte) print_byte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 ) @@ -459,15 +460,15 @@ mul8s::@return: scope:[mul8s] from mul8s::@2 (signed word) mul8s::return#1 ← (signed word) mul8s::return#3 return to:@return -@40: scope:[] from @28 - (byte*) print_screen#7 ← phi( @28/(byte*) print_screen#8 ) - (byte*) print_char_cursor#174 ← phi( @28/(byte*) print_char_cursor#179 ) - (byte*) print_line_cursor#78 ← phi( @28/(byte*) print_line_cursor#89 ) +@41: scope:[] from @29 + (byte*) print_screen#7 ← phi( @29/(byte*) print_screen#8 ) + (byte*) print_char_cursor#174 ← phi( @29/(byte*) print_char_cursor#179 ) + (byte*) print_line_cursor#78 ← phi( @29/(byte*) print_line_cursor#89 ) (byte[$200]) mulf_sqr1_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr1_hi#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_lo#0 ← { fill( $200, 0) } (byte[$200]) mulf_sqr2_hi#0 ← { fill( $200, 0) } - to:@49 + to:@50 mulf_init: scope:[mulf_init] from main::@1 (word) mulf_init::sqr#0 ← (number) 0 (byte) mulf_init::x_2#0 ← (number) 0 @@ -690,16 +691,16 @@ mulf8s::@return: scope:[mulf8s] from mulf8s::@4 (signed word) mulf8s::return#1 ← (signed word) mulf8s::return#3 return to:@return -@49: scope:[] from @40 - (byte*) print_screen#6 ← phi( @40/(byte*) print_screen#7 ) - (byte*) print_char_cursor#166 ← phi( @40/(byte*) print_char_cursor#174 ) - (byte*) print_line_cursor#67 ← phi( @40/(byte*) print_line_cursor#78 ) +@50: scope:[] from @41 + (byte*) print_screen#6 ← phi( @41/(byte*) print_screen#7 ) + (byte*) print_char_cursor#166 ← phi( @41/(byte*) print_char_cursor#174 ) + (byte*) print_line_cursor#67 ← phi( @41/(byte*) print_line_cursor#78 ) (byte*) BGCOL#0 ← ((byte*)) (number) $d021 - to:@52 -main: scope:[main] from @58 - (byte*) print_char_cursor#144 ← phi( @58/(byte*) print_char_cursor#154 ) - (byte*) print_line_cursor#46 ← phi( @58/(byte*) print_line_cursor#56 ) - (byte*) print_screen#3 ← phi( @58/(byte*) print_screen#4 ) + to:@53 +main: scope:[main] from @59 + (byte*) print_char_cursor#144 ← phi( @59/(byte*) print_char_cursor#154 ) + (byte*) print_line_cursor#46 ← phi( @59/(byte*) print_line_cursor#56 ) + (byte*) print_screen#3 ← phi( @59/(byte*) print_screen#4 ) *((byte*) BGCOL#0) ← (number) 5 call print_cls to:main::@1 @@ -839,15 +840,15 @@ muls8s::@return: scope:[muls8s] from muls8s::@3 (signed word) muls8s::return#1 ← (signed word) muls8s::return#3 return to:@return -@52: scope:[] from @49 - (byte*) print_screen#5 ← phi( @49/(byte*) print_screen#6 ) - (byte*) print_char_cursor#165 ← phi( @49/(byte*) print_char_cursor#166 ) - (byte*) print_line_cursor#66 ← phi( @49/(byte*) print_line_cursor#67 ) +@53: scope:[] from @50 + (byte*) print_screen#5 ← phi( @50/(byte*) print_screen#6 ) + (byte*) print_char_cursor#165 ← phi( @50/(byte*) print_char_cursor#166 ) + (byte*) print_line_cursor#66 ← phi( @50/(byte*) print_line_cursor#67 ) (byte[$200]) mula_sqr1_lo#0 ← { fill( $200, 0) } (byte[$200]) mula_sqr1_hi#0 ← { fill( $200, 0) } (byte[$200]) mula_sqr2_lo#0 ← { fill( $200, 0) } (byte[$200]) mula_sqr2_hi#0 ← { fill( $200, 0) } - to:@58 + to:@59 mulf_init_asm: scope:[mulf_init_asm] from main::@2 asm { ldx#$00 txa .byte$c9 lb1: tya adc#$00 ml1: stamula_sqr1_hi,x tay cmp#$40 txa ror ml9: adc#$00 staml9+1 inx ml0: stamula_sqr1_lo,x bnelb1 incml0+2 incml1+2 clc iny bnelb1 ldx#$00 ldy#$ff !: ldamula_sqr1_hi+1,x stamula_sqr2_hi+$100,x ldamula_sqr1_hi,x stamula_sqr2_hi,y ldamula_sqr1_lo+1,x stamula_sqr2_lo+$100,x ldamula_sqr1_lo,x stamula_sqr2_lo,y dey inx bne!- } (byte*) mulf_init_asm::mem#0 ← ((byte*)) (number) $ff @@ -1533,29 +1534,29 @@ mul8s_error::@return: scope:[mul8s_error] from mul8s_error::@11 (byte*) print_line_cursor#21 ← (byte*) print_line_cursor#43 return to:@return -@58: scope:[] from @52 - (byte*) print_screen#4 ← phi( @52/(byte*) print_screen#5 ) - (byte*) print_char_cursor#154 ← phi( @52/(byte*) print_char_cursor#165 ) - (byte*) print_line_cursor#56 ← phi( @52/(byte*) print_line_cursor#66 ) +@59: scope:[] from @53 + (byte*) print_screen#4 ← phi( @53/(byte*) print_screen#5 ) + (byte*) print_char_cursor#154 ← phi( @53/(byte*) print_char_cursor#165 ) + (byte*) print_line_cursor#56 ← phi( @53/(byte*) print_line_cursor#66 ) call main - to:@59 -@59: scope:[] from @58 - (byte*) print_char_cursor#133 ← phi( @58/(byte*) print_char_cursor#27 ) - (byte*) print_line_cursor#44 ← phi( @58/(byte*) print_line_cursor#9 ) + to:@60 +@60: scope:[] from @59 + (byte*) print_char_cursor#133 ← phi( @59/(byte*) print_char_cursor#27 ) + (byte*) print_line_cursor#44 ← phi( @59/(byte*) print_line_cursor#9 ) (byte*) print_line_cursor#22 ← (byte*) print_line_cursor#44 (byte*) print_char_cursor#67 ← (byte*) print_char_cursor#133 to:@end -@end: scope:[] from @59 +@end: scope:[] from @60 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @40 -(label) @49 -(label) @52 -(label) @58 +(label) @29 +(label) @41 +(label) @50 +(label) @53 (label) @59 +(label) @60 (label) @begin (label) @end (byte*) BGCOL @@ -3729,12 +3730,12 @@ Added new block during phi lifting mul8s_compare::@19(between mul8s_compare::@5 Added new block during phi lifting mul8s_compare::@20(between mul8s_compare::@3 and mul8s_compare::@4) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @40 -Adding NOP phi() at start of @49 -Adding NOP phi() at start of @52 -Adding NOP phi() at start of @58 +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @41 +Adding NOP phi() at start of @50 +Adding NOP phi() at start of @53 Adding NOP phi() at start of @59 +Adding NOP phi() at start of @60 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@1 Adding NOP phi() at start of main::@2 @@ -3921,11 +3922,11 @@ Coalesced (already) [459] mulf_init::x_2#6 ← mulf_init::x_2#3 Coalesced [472] memset::dst#3 ← memset::dst#1 Coalesced down to 38 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @40 -Culled Empty Block (label) @49 -Culled Empty Block (label) @52 -Culled Empty Block (label) @59 +Culled Empty Block (label) @29 +Culled Empty Block (label) @41 +Culled Empty Block (label) @50 +Culled Empty Block (label) @53 +Culled Empty Block (label) @60 Culled Empty Block (label) main::@6 Culled Empty Block (label) mul8s_compare::@7 Culled Empty Block (label) mul8s_compare::@15 @@ -3974,7 +3975,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @58 to @1 +Renumbering block @59 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block print_sbyte::@5 to print_sbyte::@4 diff --git a/src/test/ref/test-signed-word-minus-byte.log b/src/test/ref/test-signed-word-minus-byte.log index 1da21865e..bd1760292 100644 --- a/src/test/ref/test-signed-word-minus-byte.log +++ b/src/test/ref/test-signed-word-minus-byte.log @@ -34,13 +34,14 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 +Culled Empty Block (label) @36 Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @@ -86,7 +87,7 @@ memset::@return: scope:[memset] from memset::@1 (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_ln: scope:[print_ln] from main::@6 (byte*) print_char_cursor#46 ← phi( main::@6/(byte*) print_char_cursor#20 ) (byte*) print_line_cursor#17 ← phi( main::@6/(byte*) print_line_cursor#19 ) @@ -180,12 +181,12 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#32 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_screen#5 ← phi( @12/(byte*) print_screen#0 ) (byte*) print_char_cursor#56 ← phi( @12/(byte*) print_char_cursor#0 ) (byte*) print_line_cursor#22 ← phi( @12/(byte*) print_line_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@36 + to:@37 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#51 ← phi( print_word/(byte*) print_char_cursor#50 print_word::@1/(byte*) print_char_cursor#7 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -241,10 +242,10 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#38 return to:@return -main: scope:[main] from @36 - (byte*) print_char_cursor#52 ← phi( @36/(byte*) print_char_cursor#54 ) - (byte*) print_line_cursor#18 ← phi( @36/(byte*) print_line_cursor#20 ) - (byte*) print_screen#3 ← phi( @36/(byte*) print_screen#4 ) +main: scope:[main] from @37 + (byte*) print_char_cursor#52 ← phi( @37/(byte*) print_char_cursor#54 ) + (byte*) print_line_cursor#18 ← phi( @37/(byte*) print_line_cursor#20 ) + (byte*) print_screen#3 ← phi( @37/(byte*) print_screen#4 ) (signed word) main::w1#0 ← (number) $4d2 call print_cls to:main::@3 @@ -314,26 +315,26 @@ main::@return: scope:[main] from main::@7 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#44 return to:@return -@36: scope:[] from @28 - (byte*) print_screen#4 ← phi( @28/(byte*) print_screen#5 ) - (byte*) print_char_cursor#54 ← phi( @28/(byte*) print_char_cursor#56 ) - (byte*) print_line_cursor#20 ← phi( @28/(byte*) print_line_cursor#22 ) +@37: scope:[] from @29 + (byte*) print_screen#4 ← phi( @29/(byte*) print_screen#5 ) + (byte*) print_char_cursor#54 ← phi( @29/(byte*) print_char_cursor#56 ) + (byte*) print_line_cursor#20 ← phi( @29/(byte*) print_line_cursor#22 ) call main - to:@37 -@37: scope:[] from @36 - (byte*) print_char_cursor#45 ← phi( @36/(byte*) print_char_cursor#22 ) - (byte*) print_line_cursor#16 ← phi( @36/(byte*) print_line_cursor#7 ) + to:@38 +@38: scope:[] from @37 + (byte*) print_char_cursor#45 ← phi( @37/(byte*) print_char_cursor#22 ) + (byte*) print_line_cursor#16 ← phi( @37/(byte*) print_line_cursor#7 ) (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#23 ← (byte*) print_char_cursor#45 to:@end -@end: scope:[] from @37 +@end: scope:[] from @38 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @36 +(label) @29 (label) @37 +(label) @38 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -749,9 +750,9 @@ Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_l Added new block during phi lifting main::@8(between main::@7 and main::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @36 +Adding NOP phi() at start of @29 Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -798,8 +799,8 @@ Coalesced (already) [74] print_char_cursor#61 ← print_char_cursor#13 Coalesced [90] memset::dst#3 ← memset::dst#1 Coalesced down to 8 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @37 +Culled Empty Block (label) @29 +Culled Empty Block (label) @38 Culled Empty Block (label) main::@3 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 @@ -811,7 +812,7 @@ Culled Empty Block (label) print_cls::@1 Culled Empty Block (label) memset::@2 Culled Empty Block (label) memset::@1 Culled Empty Block (label) memset::@6 -Renumbering block @36 to @1 +Renumbering block @37 to @1 Renumbering block memset::@4 to memset::@1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block main::@4 to main::@2 diff --git a/src/test/ref/travis1.log b/src/test/ref/travis1.log index bde08170a..641144282 100644 --- a/src/test/ref/travis1.log +++ b/src/test/ref/travis1.log @@ -42,8 +42,9 @@ Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Culled Empty Block (label) main::@4 -Culled Empty Block (label) @36 +Culled Empty Block (label) @37 Culled Empty Block (label) game_ready::@3 CONTROL FLOW GRAPH SSA @@ -53,7 +54,7 @@ CONTROL FLOW GRAPH SSA (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@35 + to:@36 print_str_ln: scope:[print_str_ln] from game_ready::@1 main::@3 (byte*) print_line_cursor#29 ← phi( game_ready::@1/(byte*) print_line_cursor#27 main::@3/(byte*) print_line_cursor#25 ) (byte*) print_char_cursor#27 ← phi( game_ready::@1/(byte*) print_char_cursor#33 main::@3/(byte*) print_char_cursor#31 ) @@ -125,16 +126,16 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#20 return to:@return -@35: scope:[] from @12 +@36: scope:[] from @12 (byte*) print_line_cursor#33 ← phi( @12/(byte*) print_line_cursor#0 ) (byte*) print_char_cursor#39 ← phi( @12/(byte*) print_char_cursor#0 ) (byte) action_count#0 ← (number) 0 (byte) READY_FRAMES#0 ← (number) 5 - to:@37 -main: scope:[main] from @37 - (byte) action_count#17 ← phi( @37/(byte) action_count#16 ) - (byte*) print_line_cursor#30 ← phi( @37/(byte*) print_line_cursor#28 ) - (byte*) print_char_cursor#36 ← phi( @37/(byte*) print_char_cursor#34 ) + to:@38 +main: scope:[main] from @38 + (byte) action_count#17 ← phi( @38/(byte) action_count#16 ) + (byte*) print_line_cursor#30 ← phi( @38/(byte*) print_line_cursor#28 ) + (byte*) print_char_cursor#36 ← phi( @38/(byte*) print_char_cursor#34 ) (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@2 @@ -233,27 +234,27 @@ game_ready::@return: scope:[game_ready] from game_ready::@4 (byte) action_count#5 ← (byte) action_count#11 return to:@return -@37: scope:[] from @35 - (byte) action_count#16 ← phi( @35/(byte) action_count#0 ) - (byte*) print_line_cursor#28 ← phi( @35/(byte*) print_line_cursor#33 ) - (byte*) print_char_cursor#34 ← phi( @35/(byte*) print_char_cursor#39 ) +@38: scope:[] from @36 + (byte) action_count#16 ← phi( @36/(byte) action_count#0 ) + (byte*) print_line_cursor#28 ← phi( @36/(byte*) print_line_cursor#33 ) + (byte*) print_char_cursor#34 ← phi( @36/(byte*) print_char_cursor#39 ) call main - to:@38 -@38: scope:[] from @37 - (byte) action_count#12 ← phi( @37/(byte) action_count#2 ) - (byte*) print_line_cursor#21 ← phi( @37/(byte*) print_line_cursor#7 ) - (byte*) print_char_cursor#26 ← phi( @37/(byte*) print_char_cursor#10 ) + to:@39 +@39: scope:[] from @38 + (byte) action_count#12 ← phi( @38/(byte) action_count#2 ) + (byte*) print_line_cursor#21 ← phi( @38/(byte*) print_line_cursor#7 ) + (byte*) print_char_cursor#26 ← phi( @38/(byte*) print_char_cursor#10 ) (byte*) print_char_cursor#13 ← (byte*) print_char_cursor#26 (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#21 (byte) action_count#6 ← (byte) action_count#12 to:@end -@end: scope:[] from @38 +@end: scope:[] from @39 SYMBOL TABLE SSA (label) @12 -(label) @35 -(label) @37 +(label) @36 (label) @38 +(label) @39 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -551,9 +552,9 @@ Added new block during phi lifting main::@7(between main::@2 and main::@1) Added new block during phi lifting game_ready::@5(between game_ready and game_ready::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @37 +Adding NOP phi() at start of @36 Adding NOP phi() at start of @38 +Adding NOP phi() at start of @39 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@6 @@ -585,14 +586,14 @@ Coalesced (already) [52] print_line_cursor#34 ← print_line_cursor#24 Coalesced [57] action_count#21 ← action_count#13 Coalesced down to 6 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @35 -Culled Empty Block (label) @38 +Culled Empty Block (label) @36 +Culled Empty Block (label) @39 Culled Empty Block (label) main::@6 Culled Empty Block (label) print_str_ln::@2 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 Culled Empty Block (label) game_ready::@2 -Renumbering block @37 to @1 +Renumbering block @38 to @1 Renumbering block main::@5 to main::@4 Renumbering block main::@7 to main::@5 Renumbering block game_ready::@4 to game_ready::@2 diff --git a/src/test/ref/type-signed.log b/src/test/ref/type-signed.log index 530c4657c..1cc710aba 100644 --- a/src/test/ref/type-signed.log +++ b/src/test/ref/type-signed.log @@ -32,13 +32,14 @@ Culled Empty Block (label) @24 Culled Empty Block (label) @25 Culled Empty Block (label) @26 Culled Empty Block (label) @27 -Culled Empty Block (label) @29 +Culled Empty Block (label) @28 Culled Empty Block (label) @30 Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 Culled Empty Block (label) @35 +Culled Empty Block (label) @36 Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @@ -48,7 +49,7 @@ CONTROL FLOW GRAPH SSA (byte*) print_screen#0 ← ((byte*)) (number) $400 (byte*) print_line_cursor#0 ← (byte*) print_screen#0 (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 - to:@28 + to:@29 print_ln: scope:[print_ln] from main::@5 (byte*) print_char_cursor#41 ← phi( main::@5/(byte*) print_char_cursor#17 ) (byte*) print_line_cursor#12 ← phi( main::@5/(byte*) print_line_cursor#13 ) @@ -142,11 +143,11 @@ print_word::@return: scope:[print_word] from print_word::@2 (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#29 return to:@return -@28: scope:[] from @12 +@29: scope:[] from @12 (byte*) print_line_cursor#16 ← phi( @12/(byte*) print_line_cursor#0 ) (byte*) print_char_cursor#51 ← phi( @12/(byte*) print_char_cursor#0 ) (byte[]) print_hextab#0 ← (const string) $0 - to:@36 + to:@37 print_byte: scope:[print_byte] from print_word print_word::@1 (byte*) print_char_cursor#46 ← phi( print_word/(byte*) print_char_cursor#45 print_word::@1/(byte*) print_char_cursor#7 ) (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) @@ -182,9 +183,9 @@ print_char::@return: scope:[print_char] from print_char (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#34 return to:@return -main: scope:[main] from @36 - (byte*) print_line_cursor#19 ← phi( @36/(byte*) print_line_cursor#14 ) - (byte*) print_char_cursor#50 ← phi( @36/(byte*) print_char_cursor#48 ) +main: scope:[main] from @37 + (byte*) print_line_cursor#19 ← phi( @37/(byte*) print_line_cursor#14 ) + (byte*) print_char_cursor#50 ← phi( @37/(byte*) print_char_cursor#48 ) (signed word) main::a#0 ← (number) -$3ff (word) main::b#0 ← (number) $1024 (byte) main::i#0 ← (byte) 0 @@ -248,25 +249,25 @@ main::@return: scope:[main] from main::@6 (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#10 return to:@return -@36: scope:[] from @28 - (byte*) print_line_cursor#14 ← phi( @28/(byte*) print_line_cursor#16 ) - (byte*) print_char_cursor#48 ← phi( @28/(byte*) print_char_cursor#51 ) +@37: scope:[] from @29 + (byte*) print_line_cursor#14 ← phi( @29/(byte*) print_line_cursor#16 ) + (byte*) print_char_cursor#48 ← phi( @29/(byte*) print_char_cursor#51 ) call main - to:@37 -@37: scope:[] from @36 - (byte*) print_line_cursor#11 ← phi( @36/(byte*) print_line_cursor#4 ) - (byte*) print_char_cursor#40 ← phi( @36/(byte*) print_char_cursor#19 ) + to:@38 +@38: scope:[] from @37 + (byte*) print_line_cursor#11 ← phi( @37/(byte*) print_line_cursor#4 ) + (byte*) print_char_cursor#40 ← phi( @37/(byte*) print_char_cursor#19 ) (byte*) print_char_cursor#20 ← (byte*) print_char_cursor#40 (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#11 to:@end -@end: scope:[] from @37 +@end: scope:[] from @38 SYMBOL TABLE SSA (const string) $0 = (string) "0123456789abcdef" (label) @12 -(label) @28 -(label) @36 +(label) @29 (label) @37 +(label) @38 (label) @begin (label) @end (const byte) RADIX::BINARY = (number) 2 @@ -575,9 +576,9 @@ Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_l Added new block during phi lifting main::@7(between main::@6 and main::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @12 -Adding NOP phi() at start of @28 -Adding NOP phi() at start of @36 +Adding NOP phi() at start of @29 Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@5 @@ -615,15 +616,15 @@ Coalesced (already) [71] print_char_cursor#55 ← print_char_cursor#47 Coalesced [74] print_sword::w#8 ← print_sword::w#0 Coalesced down to 9 phi equivalence classes Culled Empty Block (label) @12 -Culled Empty Block (label) @28 -Culled Empty Block (label) @37 +Culled Empty Block (label) @29 +Culled Empty Block (label) @38 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_ln::@3 Culled Empty Block (label) print_word::@2 Culled Empty Block (label) print_byte::@2 Culled Empty Block (label) print_sword::@6 Culled Empty Block (label) print_sword::@7 -Renumbering block @36 to @1 +Renumbering block @37 to @1 Renumbering block print_sword::@5 to print_sword::@4 Renumbering block main::@3 to main::@2 Renumbering block main::@4 to main::@3 diff --git a/src/test/ref/wfragment1.log b/src/test/ref/wfragment1.log index b1c674472..5a62f9646 100644 --- a/src/test/ref/wfragment1.log +++ b/src/test/ref/wfragment1.log @@ -41,19 +41,20 @@ Culled Empty Block (label) @31 Culled Empty Block (label) @32 Culled Empty Block (label) @33 Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Culled Empty Block (label) main::@2 -Culled Empty Block (label) @36 -Culled Empty Block (label) move_enemy::@1 Culled Empty Block (label) @37 +Culled Empty Block (label) move_enemy::@1 +Culled Empty Block (label) @38 CONTROL FLOW GRAPH SSA @begin: scope:[] from - to:@35 -@35: scope:[] from @begin + to:@36 +@36: scope:[] from @begin (byte) MAX_OBJECTS#0 ← (number) $10 (word[MAX_OBJECTS#0]) OBJ_WORLD_X#0 ← { fill( MAX_OBJECTS#0, 0) } - to:@38 -main: scope:[main] from @38 + to:@39 +main: scope:[main] from @39 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@3 @@ -82,17 +83,17 @@ move_enemy::@return: scope:[move_enemy] from move_enemy (bool) move_enemy::return#2 ← (bool) move_enemy::return#3 return to:@return -@38: scope:[] from @35 +@39: scope:[] from @36 call main - to:@39 -@39: scope:[] from @38 + to:@40 +@40: scope:[] from @39 to:@end -@end: scope:[] from @39 +@end: scope:[] from @40 SYMBOL TABLE SSA -(label) @35 -(label) @38 +(label) @36 (label) @39 +(label) @40 (label) @begin (label) @end (byte) MAX_OBJECTS @@ -175,9 +176,9 @@ Eliminating unused constant (const byte) SIZEOF_WORD Successful SSA optimization PassNEliminateUnusedVars Added new block during phi lifting main::@4(between main::@3 and main::@1) Adding NOP phi() at start of @begin -Adding NOP phi() at start of @35 -Adding NOP phi() at start of @38 +Adding NOP phi() at start of @36 Adding NOP phi() at start of @39 +Adding NOP phi() at start of @40 Adding NOP phi() at start of @end Adding NOP phi() at start of main CALL GRAPH @@ -187,10 +188,10 @@ Calls in [main] to move_enemy:9 Created 1 initial phi equivalence classes Coalesced [13] main::i#4 ← main::i#1 Coalesced down to 1 phi equivalence classes -Culled Empty Block (label) @35 -Culled Empty Block (label) @39 +Culled Empty Block (label) @36 +Culled Empty Block (label) @40 Culled Empty Block (label) main::@4 -Renumbering block @38 to @1 +Renumbering block @39 to @1 Renumbering block main::@3 to main::@2 Adding NOP phi() at start of @begin Adding NOP phi() at start of @1