Floatting point operation on PowerPC
Olivier DERVYN
dervyn@digigram.com
Tue May 25 02:15:00 GMT 1999
Scott Howard a écrit :
>
> Try adding '-mhard-float' to the command line. You shouldn't need to do
> this, but it's possible I mis-configured it to default to software
> floating point.
>
> Please let me know if this solves the problem for you.
>
> Scott
> Olivier DERVYN wrote:
> >
> > Brendan Simon a écrit :
> > >
> > > You need to have specify a linker script and a startup file. Look at the
> > > documetation on http://www.objsw.com/download.html . The example there shows
> > > how to use the gcc command line for the bcc target. The "-T bdd.ld"
> > > specifies that this linker script is to be used. You can copy on out of the
> > > ppc subdirectories and rename it to whatever you want. eg. foo.ld You also
> > > need a startup assembler file which will initialize the ROM, RAM and stack.
> > > Once this is done you can jump to C routines and do the rest of the
> > > initialization. The startup file is usually called crt0.S or something
> > > similar (eg. bcc-crt0.S, bcc-startup.S, ...). You need to copy one from the
> > > ppc subdirectory and modify it to suit your target. It generally uses
> > > symbols defined in the linker script so they it you will need to understand
> > > both. Look at the linker documentation for explanations of the commands.
> > >
> > > Brendan Simon.
> > >
> > > Olivier DERVYN wrote:
> > >
> > > > I have downloaded XGCC from your web site and I want use it
> > > > to build PowerPC binary.
> > > > I have installed compiler and tools (xgcc.zip, ppc.zip, ppc-gdb.zip,
> > > > ppc-1.zip, lsrc180.zip).
> > > > When I want to build a little program there is several error
> > > > message as :
> > > > c:\xgcc\bin/ld.exe: cannot open crt0.o: No such file or directory
> > > > (ENOENT)
> > > > I think my compiler isn't correctly configured.
> > > >
> > > > ppc.zip create a sub-tree called ppc\2_8_1\ etc..., What I do with
> > > > this files ?
> > > >
> > > > Can you help me ?
> > > >
> > > > --
> > > > Regards,
> > > >
> > > > Olivier DERVYN
> > > >
> > > > --
> > > > Cordialement,
> > > >
> > > > Olivier DERVYN
> > >
> > > _______________________________________________
> > > New CrossGCC FAQ: http://www.objsw.com/CrossGCC
> > > _______________________________________________
> > > To remove yourself from the crossgcc list, send
> > > mail to crossgcc-request@cygnus.com with the
> > > text 'unsubscribe' (without the quotes) in the
> > > body of the message.
> >
> > To evaluate GCC perf. as Power PC compiler. I have compiled
> > following prg :
> >
> > #define N 10
> >
> > int main()
> > {
> > float a;
> > float X[N],Y[N];
> > int cpt, cpt1;
> > float b;
> >
> > a = 0.0;
> >
> > for( cpt1 = 0; cpt1 < N ; cpt1++ )
> > {
> > X[cpt1] = 1.0;
> > Y[cpt1] = 2.0;
> > }
> >
> > for( cpt = 0; cpt < N ; cpt++ )
> > {
> > a += X[cpt] * Y[cpt];
> > }
> >
> > b = (int)a;
> >
> > return b;
> > }
> >
> > and with following command line
> >
> > gcc -b ppc -mcpu=603e -O3 -S test.c
> >
> > the result doesn't use floatting point inst.
> >
> > .L10:
> > lwzx 3,31,27
> > addi 30,30,1
> > lwzx 4,31,28
> > addi 31,31,4
> > bl __mulsf3 --> jump to __mulsf3 routine
> > mr 4,3
> > mr 3,29
> > bl __addsf3
> > cmpwi 0,30,9
> > mr 29,3
> > bc 4,1,.L10
> >
> > Anybody kwnow this problem ?
> > Any help would be appreciated.
> >
> > --
> > Regards,
> >
> > Olivier DERVYN
> >
> > ------------------------------------------------------------------------
> >
> > Olivier DERVYN <dervyn@digigram.com>
> > DIGIGRAM
> > Département R&D
> >
> > Olivier DERVYN
> > DIGIGRAM <dervyn@digigram.com>
> > Département R&D
> > Parc de Pré Milliet ;Montbonnot;;38330;France Fax: 04 76 52 18 44
> > Work: 04 76 52 55 01
> > DIGIGRAM Parc de Pré Milliet 38330 Montbonnot FRANCE
> > Additional Information:
> > Last Name DERVYN
> > First Name Olivier
> > Version 2.1
> _______________________________________________
> New CrossGCC FAQ: http://www.objsw.com/CrossGCC
> _______________________________________________
> To remove yourself from the crossgcc list, send
> mail to crossgcc-request@cygnus.com with the
> text 'unsubscribe' (without the quotes) in the
> body of the message.
I have tested several options as
-mhard-float or different type fo cpu 603, 603e 604 604e
with same result (no floating point inst.)
When I have tested -mcpu=cpu_type option with no-sense
value (as 9999) there is not any error message.
Do now if gcc is available for 740/750 ppc family?
Thank you for your help.
--
Regards,
Olivier DERVYN
begin:vcard
n:DERVYN;Olivier
tel;fax:04 76 52 18 44
tel;work:04 76 52 55 01
x-mozilla-html:FALSE
url: http://www.digigram.com
org:DIGIGRAM;Département R&D
version:2.1
email;internet:dervyn@digigram.com
adr;quoted-printable:;;Parc de Pr=E9 Milliet=0D=0A;Montbonnot;;38330;France
note;quoted-printable:DIGIGRAM=0D=0AParc de Pr=E9 Milliet=0D=0A38330 Montbonnot=0D=0AFRANCE
fn:Olivier DERVYN
end:vcard
More information about the crossgcc
mailing list