Thank you for the interesting replies. It looks like things are moving in the right direction.
I have linked the SPL to my projects, but somewhat half-heartedly since it doesn't tend to resolve to register bits. I would rather do something like: while (!CLK.ICKR.HSIRDY); instead of: while ((CLK_ICKR & (1<<1)) == 0); Whilst both tend to compile to the same instructions, the former is self-documenting. From my limited tests so far, COSMIC doesn't complain when the necessary data structures are written in the same syntax as used in the SDCC examples. I think another thing to consider is naming conventions for common registers, and helper functions. This would significantly help code portability and helping new entrants get started. Perhaps there will be no runtime penalty for developing headers concurrently following STM8 and arduino naming conventions..? I haven't (yet) looked at arduino but perhaps some free, open de-facto standard for microcontroller naming and helper functions would be a good thing, On 19 April 2016 at 08:15, Philipp Klaus Krause <p...@spth.de> wrote: > On 18.04.2016 22:58, Nick Hill wrote: > >> >> I don't believe the Cosmic compiler free version is supposed to lack >> optimisation found on the paid for version. However, I'm not >> particularly impressed with the Cosmic compiler since I have defined a >> constant expression featuring a raised to the power expression. No run >> time variables, no globals affected. An inclusion of a reference to >> this constant results in the code growing from about 3.6k to nearly >> 8k. All the floating point math functions find their way into the >> final code, and doesn't even currently reference a run-time variable. >> The constant expression can and I believe should be evaluated at >> compile time, and superfluous math functions shouldn't find their way >> into the final release binary. >> >> Should I expect SDCC to do better, and to optimise away functions >> which are not dependent on run time variables? > > While SDCC has different optimizations from Cosmic, and in some cases > will optimize better or worse than Cosmic, in this case it probably > won't matter much. SDCC does not currently optimize calls to float > functions with constant arguments either. > > Philipp > > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > Sdcc-user mailing list > Sdcc-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sdcc-user > ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user