2016-11-08 08:10 PM
After spending a little comparative analysis of the code generated by the compiler SDCC for various 8-bit microcontrollers, I was surprised. Efficiency STM8 outside of competition. In my opinion this is the best among the 8 bit microcontrollers. And now I'm plan to use it in some of the technical solutions in the future.
Excellent! #efficiency-code #efficiency-code-compiler-cosmic2016-11-24 08:35 AM
Hi Viachelav,
I also look into the generated code to check compiler and CPU architecture efficency. I was also pleasently suprised with the COSMIC compiler. Furthermore, the STM8 value line is loaded with features. MCU's with less features from other manufacturers cost more. Cheers, John72016-11-27 10:06 PM
Hello John7, thanks for reply.
Yes, it is very attractive concept. Context free processor allow very fast switch between processes. But this feature do not supported in accessible compilers. I studied IAR and SDCC. IAR compiler have excellent optimisation for complex algorithms but have huge execution context with virtual registers. SDCC used global stack for storage local data, that is encouraging, but have some annoying bugs. The next step will be COSMIC, when I will get the license. ... COSMIC compiler may be that what me need! Viacheslav2016-12-05 03:57 PM
On one hand, the latest Cosmic release generates faster code than the latest SDCC release (though IAR does even better):
http://colecovision.eu/stm8/compilers.shtml
On the other hand, recent development versions of SDCC generate really fast code:
https://community.st.com/0D50X00009Xki9LSAR
So I'd expect SDCC 3.7.0 (probably to be released in the first half of 2017) to generate faster code than Cosmic.
Philipp
2016-12-05 09:49 PM
Thanks, it is very interested. But I prefer analyse by learning result. IAR is best. However, COSMIC and SDCC have advantages, though have a few minor flaws in the optimisation. For the systems with very small memory they more preferable, by my view. Based on the charts, is possible that Raisonance is most preferred for the small controllers, however I no studied it.
This is example of lack of the optimisation by COSMIC compiler:
222 ; 35 unsigned get(void)
222 ; 36 { 223 switch .text 224 005f f_get: 226 005f 89 pushw x 227 00000002 OFST: set 2 230 ; 38 result = private_var; 232 0060 ce0000 ldw x,_private_var 234 ; 39 return result; 238 0063 5b02 addw sp, ♯ 2 239 0065 87 retf