> On 19 April 2016 at 08:15, Philipp Klaus Krause <p...@spth.de> wrote:
>
>> 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.
>
> Hmmm. Very very interesting.
>
> I guess float math functions are the ones you would really want to
> optimise away since the compiled functions are, from the perspective
> of a small micro, large and have a very high processing penalty.
> Whilst I can't think of one, perhaps there is some technical or
> historical precedent for this?
>
> I thought I had done well with a function which takes a few parameters
> from a thermistor circuit to calculate the temperature. If I start
> running out of code space or CPU cycles, it might be better to instead
> use the formulas in a spreadsheet to produce a coarse table with log
> points, then use linear integer scaling to approximate in the smaller
> values unless there are preprocessor tricks which might yield the same
> result.

What kind of 'functions' are you talking about here? SDCC uses functions
even for 'normal' operations like multiplication and addition at runtime.
I would expect these to be optimised out, but not the functions from e.g.
math.h.

float a = 12.0f * 0.123f; // hopefully optimized
float b = sinf(3.14f);    // unlikely to be optimized

Maarten


------------------------------------------------------------------------------
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

Reply via email to