From: Philipp K. K. <pk...@sp...> - 2016-09-22 09:23:55
|
On 22.09.2016 10:39, Maarten Brock wrote: >> dhry_1.c compiled with SDCC: >> 8156 Bytes of code >> 9606 Dhrystones / s >> >> dhry_1.c compiled with cfe+cbe+SDCC: >> 9040 Bytes of code >> 8190 Dhrystones / s >> >> dhry_1.c compiled with cfe+opt+cbe+SDCC >> 8888 Bytes of code >> 9857 Dhrystones / s >> >> So already in this early stage of the toolchain, we see a small increase >> in Dhrystone scores. SDCC 3.6.2 #9727 was invoced using -c -mstm8 >> --max-allocs-per-node 10000. The binary was executed on an >> STM8A-Discovery board. opt-3.8 was invoced with -O2. >> >> Philipp > > I see 2.5% speed increase at the cost of 9% more code space. I'm afraid > I'm not impressed, yet. I hope there is room for more improvement. > > Maarten 2.5% from optimizing just one of the two main files of Dhrystone is quite good, especially considering that Dhrystone spends most of time in library calls. The code size increase is mostly due to SDCC not being able to optimize out the definition of static inline functions even if all uses are actually inlined. When I manually change static inline to inline in the cbe output, the code size goes down to 8214 bytes for cfe+opt+cbe+SDCC. That's still an increase of code size by 0.7%, but I guess there might be some low hanging-fruit in terms of simple optimizations in SDCC that could easily eliminate that. Philipp |