Difference between revisions of "Stm8 code size"

From SDCC wiki
Jump to: navigation, search
m
m (STM8 code size comparison (bytes):)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
Note: There is [http://www.colecovision.eu/stm8/compilers.shtml another comparison of compilers targeting the STM8], that uses standard benchmarks and also considers other aspects, such as standard compliance and code speed.
 +
 
A history of code size in sdcc and a comparison to other compilers.
 
A history of code size in sdcc and a comparison to other compilers.
  
Line 6: Line 8:
 
! Cosmic C¹
 
! Cosmic C¹
 
! IAR C²
 
! IAR C²
! sdcc-stm8 #8537
+
! sdcc 3.4.0³
! sdcc #8820³
+
! sdcc 3.6.0³
 
|-  
 
|-  
 
|  cvu_vinb.c  
 
|  cvu_vinb.c  
 
|  '''6'''
 
|  '''6'''
 
|  '''6'''
 
|  '''6'''
15
+
10
11
+
10
 
|-  
 
|-  
 
|  galois_lfsr.c  
 
|  galois_lfsr.c  
|  '''15'''
+
|  15
|  '''15'''
+
|  15
|  34
+
|  '''12'''
|  20
+
|  '''12'''
 
|-  
 
|-  
 
|  get_tile.c  
 
|  get_tile.c  
 
|  89
 
|  89
|  '''87'''
+
|  87
129
+
|  '''82'''
|  90
+
'''82'''
 
|-  
 
|-  
 
|  huffman_iterative.c  
 
|  huffman_iterative.c  
 
|  '''134'''
 
|  '''134'''
 
|  171
 
|  171
323
+
162
156
+
138
 
|-  
 
|-  
 
|  huffman_recursive.c  
 
|  huffman_recursive.c  
 
|  '''140'''
 
|  '''140'''
 
|  168
 
|  168
358
+
174
195
+
178
 
|-  
 
|-  
 
|  init_loop.c  
 
|  init_loop.c  
 
|  '''24'''
 
|  '''24'''
 
|  31
 
|  31
69
+
27
30
+
27
 
|-  
 
|-  
 
|  insertion_sort.c  
 
|  insertion_sort.c  
 
|  '''92'''
 
|  '''92'''
 
|  111
 
|  111
|  247
 
 
|  137
 
|  137
 +
|  126
 
|-  
 
|-  
 
|  memcpy_compression.c  
 
|  memcpy_compression.c  
 
|  '''43'''
 
|  '''43'''
 
|  54
 
|  54
93
+
56
66
+
57
 
|-  
 
|-  
 
|  memtovmemcpy.c  
 
|  memtovmemcpy.c  
 
|  '''44'''
 
|  '''44'''
 
|  55
 
|  55
101
+
51
55
+
50
 
|-  
 
|-  
 
|  play_music.c  
 
|  play_music.c  
 
|  354
 
|  354
 
|  '''290'''
 
|  '''290'''
721
+
352
357
+
347
 
|-  
 
|-  
 
|  sdcc_mullong.c  
 
|  sdcc_mullong.c  
 
|  '''127'''
 
|  '''127'''
 
|  179
 
|  179
673
+
352
348
+
298
 
|-  
 
|-  
 
|  set_screen_mode.c  
 
|  set_screen_mode.c  
'''49'''
+
|  49
'''49'''
+
|  49
75
+
61
66
+
'''47'''
 
|-  
 
|-  
 
|  set_sprite_x.c  
 
|  set_sprite_x.c  
 
|  '''55'''
 
|  '''55'''
 
|  65
 
|  65
152
+
57
66
+
63
 
|-  
 
|-  
 
|  z88dk-mktime.c  
 
|  z88dk-mktime.c  
 
|  221
 
|  221
 
|  '''209'''
 
|  '''209'''
618
+
347
404
+
335
 
|-  
 
|-  
 
|  total  
 
|  total  
 
|  '''1393'''
 
|  '''1393'''
 
|  1490
 
|  1490
3609
+
1880
1998
+
1770
 
|}
 
|}
  
Line 109: Line 111:
 
² IAR C/C++ Compiler V1.40.1.50106 for STM8. Current version as of mid-2013.
 
² IAR C/C++ Compiler V1.40.1.50106 for STM8. Current version as of mid-2013.
  
³ --opt-code-size --max-allocs-per-node 2500000
+
³ Compiler options --opt-code-size --max-allocs-per-node 10000000
  
 
This is a list of feature requests, that combined will probably get code size down near to the level of the non-free compilers.
 
This is a list of feature requests, that combined will probably get code size down near to the level of the non-free compilers.

Latest revision as of 15:41, 27 May 2016

Note: There is another comparison of compilers targeting the STM8, that uses standard benchmarks and also considers other aspects, such as standard compliance and code speed.

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

[edit] STM8 code size comparison (bytes):

File Cosmic C¹ IAR C² sdcc 3.4.0³ sdcc 3.6.0³
cvu_vinb.c 6 6 10 10
galois_lfsr.c 15 15 12 12
get_tile.c 89 87 82 82
huffman_iterative.c 134 171 162 138
huffman_recursive.c 140 168 174 178
init_loop.c 24 31 27 27
insertion_sort.c 92 111 137 126
memcpy_compression.c 43 54 56 57
memtovmemcpy.c 44 55 51 50
play_music.c 354 290 352 347
sdcc_mullong.c 127 179 352 298
set_screen_mode.c 49 49 61 47
set_sprite_x.c 55 65 57 63
z88dk-mktime.c 221 209 347 335
total 1393 1490 1880 1770


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

All compilers have been configured for strong optimization for code size.

¹ C Compiler for STM8 (COSMIC Software); Generator V4.3.7; Optimizer V4.3.6. Current version as of mid-2013.

² IAR C/C++ Compiler V1.40.1.50106 for STM8. Current version as of mid-2013.

³ Compiler options --opt-code-size --max-allocs-per-node 10000000

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
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox