Sure, gcc and most other compilers use software floating point
operations if you dont have the hardware (well you have to tell the
compiler which way to do it).
Take some code like this:
float a,b,c;
void myfun ( void )
{
a=b+c;
}
And compile to asm and see what it produces
For example the gcc I use produced code like this
ldr r0, [r3, #0] @ float
ldr r1, [r2, #0] @ float
bl __addsf3
mov r3, r0
str r3, [r4, #0] @ float
Which is a soft fpu,
add -mhard-float to the command line and you get hardware fpu
instructions:
ldfs f1, [r3, #0]
ldfs f0, [r2, #0]
adfs f0, f1, f0
stfs f0, [r1, #0]
You dont want that, if you see f registers and adfs or adfd it is
building for a hard fpu...
And it runs as fast as it runs...
David
On Thu, 2003-12-11 at 08:13, Martijn Reuvers wrote:
> Hi all,
>
> Thanks for your comments, but please assume that I DO want to use floating
> point operations and not fixed point. There are only two operations that I'm
> interested in, addition and integer conversion. Is it possible at all to get
> these simple (to me) instructions fast on the AGB?
>
> Regards,
>
> Martijn
>
>
> ----- Original Message -----
> From: "Tomas Hallenberg" <
tomha219@...>
> To: <
gbadev@yahoogroups.com>
> Sent: Thursday 11 December 2003 15:30
> Subject: Re: [gbadev] Floating point questions
>
>
> > I don't see the reason for using any floating point arithmetics if
> > that's all you want to do. To begin with you'll only have integer
> > results unless you also have floating point constants, but then you
> > could do it with fixed point instead with good precision.
> >
> > Martijn Reuvers wrote:
> > > Hi,
> > >
> > > I want to do two floating point operations: addition/substraction and
> > > integer conversion. Is there any info on how fast these two operations
> are
> > > on the AGB since it hasn't any FP hardware? How many instructions,
> cycles?
> > > If it's really slow, does anyone know a fast trick to do these two
> > > operations?
> > >
> > > Regards,
> > >
> > > Martijn Reuvers
> >
> > --
> >
http://dreamcache.mine.nu
> >
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
>
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>