[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Double precision floating point routines
From: |
Martin Cibulski |
Subject: |
Re: [avr-libc-dev] Double precision floating point routines |
Date: |
Wed, 10 Dec 2003 20:08:23 +0100 |
>> > As Jörg Wunsch wrote:
>> >
>> > It would probably be very nice to combine all this into the
>> > compiler/library, but I believe that is not possible using the
>> > outlined stack engine.
>> > --
>>
>> I could modify my routines to use a stack in memory
>
>My guess would be that, to include these routines, you would have to use
>the normal data stack, just like other subroutines in the library. Even if
>it uses a lot.
>Would this be possible for you to do?
Eric,
it would be possible to use a separate data stack.
Can you please explain a little more how it works ?
I read that the IRC compiler uses a data stack pointed
by the Y register. Does AVRGCC do the same ?
If yes, how is it used (post/pre increment/decrement, which pointer
register) ?
How are parameters passed in AVRGCC ?
In the mean time I looked at the documentation of
the library and the GCC config files (for compilation of GCC itself, I
think).
It seems to me that GCC generates calls like
'result = add (parameter1, parameter2)'
and combines these to calculate more complex expressions.
In the sourcecode of the single precision math routines
I found both parameters passed in registers, not on the stack.
Would AVRGCC pass 8 byte wide double parameters in registers too ?
Perhaps you or someone else could do a little test
with simulated 8 byte wide doubles like the following
typedef struct {
char c[8];
} DOUBLE;
DOUBLE test (DOUBLE a, DOUBLE b)
{
return a;
}
DOUBLE b; // global
main()
{
DOUBLE b, c; // local
c = test (a, b);
}
The generated assembler code might
answer some of my questions.
Thanks for help
Martin