Difference between revisions of "Z80 code size"

From SDCC wiki
Jump to: navigation, search
 
m (Z80 Code size comparison (bytes):)
 
(2 intermediate revisions by one user not shown)
Line 12: Line 12:
 
! IAR 4.06A  
 
! IAR 4.06A  
 
! hand asm  
 
! hand asm  
! sdcc 3.1.5 !#7830¹  
+
! sdcc 3.1.5 #7830¹  
! sdcc-lospre !#8070¹
+
! sdcc-lospre #8070¹²
 +
! sdcc 3.5.5 #9383¹
 
|-  
 
|-  
 
|  cvu_vinb.c  
 
|  cvu_vinb.c  
Line 23: Line 24:
 
|   
 
|   
 
|  12  
 
|  12  
 +
|  12
 
|  12
 
|  12
 
|-  
 
|-  
Line 34: Line 36:
 
|  27  
 
|  27  
 
|  '''18'''
 
|  '''18'''
 +
|  25
 
|-  
 
|-  
 
|  get_tile.c  
 
|  get_tile.c  
Line 42: Line 45:
 
|  124  
 
|  124  
 
|   
 
|   
'''109'''  
+
|  109'
|  '''109'''
+
|  109
 +
|  '''103'''
 
|-  
 
|-  
 
|  huffman_iterative.c  
 
|  huffman_iterative.c  
Line 54: Line 58:
 
|  241  
 
|  241  
 
|  215
 
|  215
 +
|  206
 
|-  
 
|-  
 
|  huffman_recursive.c  
 
|  huffman_recursive.c  
Line 64: Line 69:
 
|  240  
 
|  240  
 
|  224
 
|  224
 +
|  221
 
|-  
 
|-  
 
|  init_loop.c  
 
|  init_loop.c  
Line 72: Line 78:
 
|  38  
 
|  38  
 
|   
 
|   
'''26'''
+
|  26
|  '''26'''
+
|  26
 +
|  '''25'''
 
|-  
 
|-  
 
|  insertion_sort.c  
 
|  insertion_sort.c  
Line 84: Line 91:
 
|  147  
 
|  147  
 
|  134
 
|  134
 +
|  139
 
|-  
 
|-  
 
|  memcpy_compression.c  
 
|  memcpy_compression.c  
Line 94: Line 102:
 
|  77  
 
|  77  
 
|  77
 
|  77
 +
|  73
 
|-  
 
|-  
 
|  memtovmemcpy.c  
 
|  memtovmemcpy.c  
Line 103: Line 112:
 
|   
 
|   
 
|  75  
 
|  75  
 +
|  75
 
|  75
 
|  75
 
|-  
 
|-  
Line 114: Line 124:
 
|  584  
 
|  584  
 
|  545
 
|  545
 +
|  586
 
|-  
 
|-  
 
|  sdcc_mullong.c  
 
|  sdcc_mullong.c  
Line 124: Line 135:
 
|  575  
 
|  575  
 
|  559
 
|  559
 +
|  595
 
|-  
 
|-  
 
|  set_screen_mode.c  
 
|  set_screen_mode.c  
Line 133: Line 145:
 
|   
 
|   
 
|  '''49'''  
 
|  '''49'''  
 +
|  50
 
|  50
 
|  50
 
|-  
 
|-  
Line 144: Line 157:
 
|  110  
 
|  110  
 
|  98
 
|  98
 +
|  93
 
|-  
 
|-  
 
|  z88dk-mktime.c  
 
|  z88dk-mktime.c  
Line 154: Line 168:
 
|  561  
 
|  561  
 
|  561
 
|  561
 +
|  482
 
|-  
 
|-  
 
|  total  
 
|  total  
Line 164: Line 179:
 
|  2832  
 
|  2832  
 
|  2703
 
|  2703
 +
|  2685
 
|}
 
|}
 
  
 
== Rabbit 2000 Code size comparison (bytes): ==
 
== Rabbit 2000 Code size comparison (bytes): ==

Latest revision as of 20:17, 1 November 2015

Contents

[edit] z80 (and related ports) code size

A history of code size in sdcc and a comparison to other compilers.

[edit] Z80 Code size comparison (bytes):

File z88dk 1.8 CROSS-C 2.57.02 HITECH-C 7.80PL2 ADC 5.02 IAR 4.06A hand asm sdcc 3.1.5 #7830¹ sdcc-lospre #8070¹² sdcc 3.5.5 #9383¹
cvu_vinb.c 18 39 26 28 9 12 12 12
galois_lfsr.c 54 39 20 62 19 13 27 18 25
get_tile.c 202 190 159 171 124 109' 109 103
huffman_iterative.c fails / 385 fails / 278 222 441 131 89 241 215 206
huffman_recursive.c fails / 521 fails / 470 299 662 161 240 224 221
init_loop.c 74 52 45 fails 38 26 26 25
insertion_sort.c 301 155 581 199 133 138 147 134 139
memcpy_compression.c fails / 80 93 100 163 68 77 77 73
memtovmemcpy.c 118 82 86 fails 60 75 75 75
play_music.c fails / 821 708 581 1309 426 584 545 586
sdcc_mullong.c 340 265 268 fails 219 575 559 595
set_screen_mode.c fails / 95 65 57 151 50 49 50 50
set_sprite_x.c 130 128 108 232 77 60 110 98 93
z88dk-mktime.c 453 425 409 fails 294 561 561 482
total fails / 3592 fails / 2989 2961 fails 1809 2832 2703 2685

[edit] Rabbit 2000 Code size comparison (bytes):

File Dynamic C 9.62 CROSS-C 2.18.01 sdcc 3.1.5 !#7830¹ sdcc-lospre !#8032¹²
cvu_vinb.c fails / 30 24 10 10
galois_lfsr.c fails / 76 33 27 18
get_tile.c fails / 225 fails / 161 101 101
huffman_iterative.c fails 214 209 193
huffman_recursive.c fails 371 219 209
init_loop.c fails / 109 55 26 26
insertion_sort.c 273 146 143 139
memcpy_compression.c fails 68 67 67
memtovmemcpy.c 103 68 53 53
play_music.c 585 579 494 472
sdcc_mullong.c 374 252 414 371
set_screen_mode.c fails / 110 66 49 50
set_sprite_x.c 148 98 97 87
z88dk-mktime.c fails 429 507 503
total fails fails / 2564 2416 2299


Total code size and compilation time over revisions (1M means --max-allocs-per-node 1000000):

graph-z80.png

The benchmark files can be found at http://colecovision.eu/stuff/testbench.tar.gz

Command line: sdcc -mz80 --opt-code-size --std-c89, zcc -O2, ZC -O. For z88dk, Dynamic C and CROSS-C slightly modified versions of the source have been used where the original didn't compile (still marked with "fails" though).

¹ --max-allocs-per-node 5000000, runtime approx. 13min.

² Experimental sdcc from lospre branch.

[edit] Code size vs. compilation time:

The --max-allocs-per-node parameter provides a code size vs. compilation speed trade-off:

test.png

Philipp

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox