[Top][All Lists]

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

Re: [avr-libc-dev] code size increase with log

From: Dmitry K.
Subject: Re: [avr-libc-dev] code size increase with log
Date: Thu, 17 Jan 2008 07:58:11 +1000
User-agent: KMail/1.5

On Wednesday 16 January 2008 17:57, Dig Kleppe wrote:
> Hi all
> I noticed a big codesize difference when using the log function:
> ---------------- without log -- with log
> winAVR20070525 2958 4152
> winAVR20071221 2940 5744
> using math lib. Also in case of without log fp is used
> opt = s

Hi, Dig.

I can not reproduce this big codesize difference.

  #include <math.h>
  float main ()
      volatile float x = 1.2345;
      return log (x);

$ avr-gcc -mmcu=atmega8 -Os -o foo.elf foo.c -lm
$ avr-size foo.elf
==> 1146 bytes
Check the resulting program:
$ savrauto -e -m atmega8 foo.elf
==> 2.106660e-01

Remove log() function (i.e. replace to dummy):
  float log (float x)
      return x;

$ avr-gcc -mmcu=atmega8 -Os -o foo.elf foo.c log.c
$ avr-size foo.elf
==> 134 bytes
$ savrauto -e -m atmega8 foo.elf
==> 1.234500e+00

So, the log() function is approx. 1100 bytes (including
all float point operations, needed to it).
Avr-gcc is 4.2.2 (without any patches).
Avr-libc is CVS HEAD (2008-01-13).

The first yours result (WinAVR 20070525) is strange also.
I remember that size of log() in Avr-libc 1.4.x is approx.
900..1000 bytes (1200 is too big).

Dig, please, try this small example in your system
(simulation is not needed).  Also, try to make
replacement of log() in full program as above.


reply via email to

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