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

2009-03-13 Thread Dave Hylands
Hi Eric, 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

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

2009-03-12 Thread Dave Hylands
I meant to sent my last reply to the list. Hi David, On Wed, Mar 11, 2009 at 2:17 PM, David VanHorn d...@mobilefusioninc.com wrote: The assembly above comes from the __udivmodhi4 helper function (found in libgcc.a), which is a helper function for performing a 32-bit divide. Let me

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

2009-03-12 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. 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

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

2009-03-11 Thread David VanHorn
Well.. Still flogging the horse here. I have the .S file, but I don't know how to interpret it. I carved up the statement even further, and moved the declarations so all the vars are in ram so I can watch them easily. A = Raw_Data[0][Raw_Data_Index]; // Gives the expected result.

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

2009-03-11 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of David VanHorn Sent: Wednesday, March 11, 2009 8:24 AM To: AVR-GCC Subject: Re: [avr-gcc-list] Re: Wierd Calls

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

2009-03-11 Thread Dave Hylands
Hi David, On Wed, Mar 11, 2009 at 7:23 AM, David VanHorn d...@mobilefusioninc.com wrote: Well.. Still flogging the horse here. ...snip... +0622:   1BAA    SUB   R26,R26    Subtract without carry +0623:   1BBB    SUB   R27,R27    Subtract without carry

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

2009-03-11 Thread David VanHorn
The assembly above comes from the __udivmodhi4 helper function (found in libgcc.a), which is a helper function for performing a 32-bit divide. Let me guess.. It was stuck on below the LCD routines in memory, and AVR Studio didn't know that somehow? Gak.. Ok. I'm still puzzled as to why

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

2009-03-11 Thread Dave Hansen
From: d...@mobilefusioninc.com [...] 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

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

2009-03-10 Thread David VanHorn
On Tue, Mar 10, 2009 at 2:44 PM, David Brown david.br...@hesbynett.nowrote: As I've told you before, if you think there is something odd about the generated assembly code, no one can give you more than very general guesses unless you post a minimal compilable code snippet. Given that this is