problem while building arm vfp softfloat gcc

Dan Kegel dank@kegel.com
Fri Feb 6 16:50:00 GMT 2004


add <addsub@eyou.com> wrote:
> I'm building a arm-linux-gcc toolchain with soft-vfp support by
> crosstool-0.27(Thanks to Dan). But generated code cannot execute
> "printf("%f",1.00)" well, it will output 0.00000.
> 
> Then I found gcc doesn't produce right code, it uses wrong registers sequence
> to pass float argument to function()

Richard Earnshaw wrote:
> To the best of my knowledge the only configuration of a released version 
> of gcc that supports soft-vfp is arm-netbsdelf.

He's using a patch that adds that, I think.  The patch is taken from
http://www.pengutronix.de/software/ptxdist/patches-cvs/gcc-3.3.2/generic/gcc-3.3.2-arm-softfloat.diff
This is mostly just Nicholas Pitre's patch:
http://lists.arm.linux.org.uk/pipermail/linux-arm/2003-October/006436.html

(The script he's using to build gcc is
http://kegel.com/crosstool/crosstool-0.27/demo-arm-softfloat.sh
and the complete set of gcc patches he's using is
http://kegel.com/crosstool/crosstool-0.27/patches/gcc-3.3.2/
most of which just deal with the regression test suite,
or fix minor sh4 problems.)

Anyway, he says in his little "float i=1.0; foo(i);" test program, gcc generates
         mov     r4, r1
         mov     r3, r0
         mov     r1, r4           /* this line wrong -by addsub*/
         mov     r0, r3           /* this line wrong -by addsub*/
         bl      foo
when it should generate
         mov     r4, r1
         mov     r3, r0
         mov	r2, r3
         mov	r3, r4
         bl      foo
I don't know anything about arm assembly, and it'll be a while before
I can dig into this.  I'd probably start by just building the latest cvs
version of ptxdist's toolchain, and see where its gcc build procedure
differs from mine... although I could also try running the gcc regression
tests on the arm hardware I have.  Anyway, perhaps Robert or Nicolas will
rescue me and tell me what I forgot :-)
- Dan


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list