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

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

Re: [avr-gcc-list] Re: Wierd Calls.


From: Paulo Marques
Subject: Re: [avr-gcc-list] Re: Wierd Calls.
Date: Thu, 12 Mar 2009 13:17:31 +0000
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

Dave Hansen wrote:
> From: address@hidden
> [...] 
> I'm still puzzled as to why the compiler didn't change:
>  
> // This takes 53uS at 4 MHz
> Bin = ( A / Data_Divisor )  // Data_Divisor is a constant, 32.
>  
> into
>  
> // This takes 8.9uS at 4 MHz
> Bin = ( A >> 5)
>  
> Just guessing, but it may be trying to preserve truncation toward zero
> (required by C99) if the expression is signed.

Yes, guessing is all we can do because Dave keeps posting these things
without providing a proper snipet of compilable code, with compilation
options and compiler / libc / binutils versions.

Dave, if you want help from the users on this list, you _really_ need to
provide some compilable code so that we can actually see what's going on.

At high enough compilation (O2, O3, Os) levels it is very hard to track
down what the compiler is doing just from some bits of assembly taken
out of context... :(

-- 
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

"To know recursion, you must first know recursion."




reply via email to

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