Hc08 code size - roybaer/sdcc-wiki GitHub Wiki

hc08 (and related ports) code size

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

HC08 code size comparison (bytes):

File ByteCraft C6808¹ hc08 Cosmic C² hc08 sdcc #7660 hc08 sdcc #7670 hc08 sdcc #8361 hc08
cvu_vinb.c fails 6 7 7 6
galois_lfsr.c 16 11 31 23 19
get_tile.c fails 103 138 130 123
huffman_iterative.c fails 198 490 325 224
huffman_recursive.c fails 222 713 433 261
init_loop.c 22 22 26 31 19
insertion_sort.c 73 83 162 180 152
memcpy_compression.c fails 78 111 101 97
memtovmemcpy.c fails 57 66 66 72
play_music.c fails 546 1257 734 650
sdcc_mullong.c fails 146 735 561 416
set_screen_mode.c fails 40 67 59 50
set_sprite_x.c fails 89 171 137 89
z88dk-mktime.c fails 321 845 726 601
total fails 1922 4819 3513 2779

S08 code size comparison (bytes):

File Code Warrior³ s08 sdcc #7753 s08 sdcc #8361 s08
cvu_vinb.c 6 6 6
galois_lfsr.c 17 23 19
get_tile.c 96 121 113
huffman_iterative.c 177 270 181
huffman_recursive.c 180 305 209
init_loop.c 17 31 19
insertion_sort.c 88 164 134
memcpy_compression.c 71 90 76
memtovmemcpy.c 57 52 57
play_music.c 466 622 570
sdcc_mullong.c 148 471 386
set_screen_mode.c 50 64 50
set_sprite_x.c 59 100 92
z88dk-mktime.c 308 641 542
total 1740 2960 2454

http://sdcc.sourceforge.net/wiki_images/graph-hc08.png

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

¹ C6808 "C" COMPILER 3.0.0.17 - Current evaluation version as of 2012-5-12

² C Compiler for M68HC08 (COSMIC Software); Generator V4.6.3 - 05 Aug 2008; Optimizer V4.5.9 - 05 Aug 2008 - Current evaluation version as of 2012-5-12

³ ANSI-C/cC++ Compiler for HC08 V-5.0.39 Build 11346, Dec 13 2011 - Current evaluation version as of 2012-5-12

This is a list of feature requests, that combined will probably get code size down near to the level of the non-free compilers.

Request ID Summary
3526527 Pointer analysis
3526526 Generalized constant propagation
3526292 Direct assignment / clear
3526285 Non-destructive and for ifx (hc08)
3526278 Multibyte constant assignment
3526274 Tail call optimization
3526270 Eliminate untargeted labels
3526269 Right operand for setting value at address
3526268 Right operand for GET_VALUE_AT_ADDRESS
3525464 lospre
3528282 notUsed()
⚠️ **GitHub.com Fallback** ⚠️