avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Whetstone Benchmark


From: Dmitry K.
Subject: Re: [avr-gcc-list] Whetstone Benchmark
Date: Wed, 23 Jan 2008 17:26:56 +1000
User-agent: KMail/1.5

On Wednesday 23 January 2008 12:35, you wrote:
[...]
> Why "unit at a time" compilation produced faster result ?  But the code
> was totally inlined and perhaps it optimised out something that it
> should not have for this purpose.

This Whetstone Benchmark is not a good test. It is
subjected to compiler optimization. Originaly with
avr-gcc 4.1.2 the result was: ~2500 bytes of flash
and ~30000 cycles.  The reason was that compiler
removes tests with math function: this functions are
declared as 'const' and result is not used in external
world.
  To avoid this omition I have add the calls of dummy
external functions, so all operations are present.
The 4.1.2 version is the best in both: size and speed:

> >>  4030   88565    4.1.2  -Os
> >>  5332   71751    4.1.2  -O3

But with avr-gcc 4.3-20080104 the result of '-O3' was
strange: normal size, but too quick:
      5494   31547   4.3  -O3
I do not study a reason. Possibly, it was any precalculation.
I have try '-fno-unit-at-a-time' to avoid this optimization.
After this:
      5608  75351

Avr-libc was the same for all versions: CVS HEAD 2008-01-13.

Regards,
Dmitry.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]