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
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
-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
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.
-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
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
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
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
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