avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a


From: Dmitry K.
Subject: Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks.
Date: Sat, 20 Nov 2004 14:39:39 +1000
User-agent: KMail/1.5

Paul Schlie wrote:

> - any insight as to why the compiler (3.4.3 for the sake of argument) first
>   load variable into one set of registers to just then passes them to the
>   function's parameter registers, as opposed to loading them there
>   initially, which seems like a waste of cycles? happens for example with:
>
>   volatile float f;
>   f = f * f; // or most any other multi-byte libgcc defined function.

`volatile' is the reason of double reading.

avr-gcc 3.3.4 with `-mmcu=avr4 -Os -fnew-ra': beautiful code.

See:

   float x;
   float foo (void)
   {
       return x * x;
   }

produce:
        lds r22,x
        lds r23,(x)+1
        lds r24,(x)+2
        lds r25,(x)+3
        movw r18,r22
        movw r20,r24
        rcall __mulsf3

P.S. I do not say about the pair <rcall, ret>. In many cases gcc (x86 port,
for example) reduce such sequences.





reply via email to

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