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: Weddington, Eric
Subject: RE: [avr-gcc-list] Re: Wierd Calls.
Date: Thu, 12 Mar 2009 08:41:02 -0600

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Dave Hylands
> Sent: Thursday, March 12, 2009 8:25 AM
> To: David VanHorn
> Cc: AVR-GCC
> Subject: Re: [avr-gcc-list] Re: Wierd Calls.
> 
> > 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.
> 
> If I declare
> 
> const uint32_t Data_Divisor = 32;
> 
> then it calls the helper function, but if I declare
> 
> const int Data_Divisor = 32;
> 
> then it appears to use the shift.
> 

??? That's weird. An unsigned divisor needs a helper function, but using a 
signed divisor will cause it to generate a shift.




reply via email to

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