using ARM VFP hardware

View: New views
4 Messages — Rating Filter:   Alert me  

using ARM VFP hardware

by Ineiev-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm sorry, I tried to find some info on the subject
in this list archives; I saw this question asked
several times in different forms, but always with
no final solution.

We'd like to use GCC to build executables
running on a ARM946E-S with a VFP9 coprocessor,
bare metal (no OS).

The problems come when trying to actually use VFP9.

http://gcc.gnu.org/ml/gcc-help/2008-01/msg00133.html
suggests that building with -mfpu=vfp -mfloat-abi=soft
may produce code which will link to libgcc functions,
and libgcc will use VFP instructions.

Having read http://gcc.gnu.org/install/configure.html,
I install binutils-2.19.1 targeting arm-unknown-elf
into $HOME/arm, export PATH=$HOME/arm/bin:$PATH,
mkdir build and run
../gcc-4.4.1/configure --prefix=$HOME/arm \
--target=arm-unknown-elf --enable-interwork \
--disable-nls --with-mpfr=$HOME/mpfr \
--disable-libssp --enable-languages=c \
--with-fpu=vfp --with-cpu=arm946e-s --with-float=soft \
 && make && make install

After that I compile a test:
int
main(int argc,char**argv)
{double x=argc*.17,y=argc*2-.1;
 return(int)(x/y+y*x);
}

arm-unknown-elf-gcc -Wall -O0 -nostdlib \
 -mfpu=vfp -mfloat-abi=soft -o e e.c -lgcc

Then I look for instructions whose name begins with f
(according to VFP9 documentation, every coprocessor
 instruction mnemonic begins with that letter):
arm-unknown-elf-objdump -d e| \
 egrep ":[[:space:]]+[[:xdigit:]]+[[:space:]]+[Ff]"

It shows no lines, the same as

arm-unknown-elf-objdump -d \
 $HOME/arm/lib/gcc/arm-unknown-elf/4.4.1/libgcc.a| \
 egrep ":[[:space:]]+[[:xdigit:]]+[[:space:]]+[Ff]"

It seems to me that it just inserts floating
point emulation routines.

GCC sources (in particular, gcc/config/arm/vfp.md)
make me think that there must be more hardware VFP support
than I managed to switch on.

Does anybody know how to do this?

Thanks,

Re: using ARM VFP hardware

by Ian Lance Taylor-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ineiev <ineiev@...> writes:

> After that I compile a test:
> int
> main(int argc,char**argv)
> {double x=argc*.17,y=argc*2-.1;
>  return(int)(x/y+y*x);
> }
>
> arm-unknown-elf-gcc -Wall -O0 -nostdlib \
>  -mfpu=vfp -mfloat-abi=soft -o e e.c -lgcc
>
> Then I look for instructions whose name begins with f

Using -mfloat=abi=soft directs gcc to call floating point emulation
routines.  Have you tried -mfloat-abi=softfp or -mfloat-abi=hard?

> ../gcc-4.4.1/configure --prefix=$HOME/arm \
> --target=arm-unknown-elf --enable-interwork \
> --disable-nls --with-mpfr=$HOME/mpfr \
> --disable-libssp --enable-languages=c \
> --with-fpu=vfp --with-cpu=arm946e-s --with-float=soft \

Using --with-float=soft makes soft floating point the default.  If you
don't want soft floating point, what led you to use --with-float=soft?

Ian

Re: using ARM VFP hardware

by Richard Earnshaw :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, 2009-11-09 at 09:31 -0800, Ian Lance Taylor wrote:

> Ineiev <ineiev@...> writes:
>
> > After that I compile a test:
> > int
> > main(int argc,char**argv)
> > {double x=argc*.17,y=argc*2-.1;
> >  return(int)(x/y+y*x);
> > }
> >
> > arm-unknown-elf-gcc -Wall -O0 -nostdlib \
> >  -mfpu=vfp -mfloat-abi=soft -o e e.c -lgcc
> >
> > Then I look for instructions whose name begins with f
>
> Using -mfloat=abi=soft directs gcc to call floating point emulation
> routines.  Have you tried -mfloat-abi=softfp or -mfloat-abi=hard?
>
> > ../gcc-4.4.1/configure --prefix=$HOME/arm \
> > --target=arm-unknown-elf --enable-interwork \
> > --disable-nls --with-mpfr=$HOME/mpfr \
> > --disable-libssp --enable-languages=c \
> > --with-fpu=vfp --with-cpu=arm946e-s --with-float=soft \
>
> Using --with-float=soft makes soft floating point the default.  If you
> don't want soft floating point, what led you to use --with-float=soft?
>
> Ian

-mfloat-abi=hard will only work with gcc-4.5 (ie trunk)

R.


Parent Message unknown Re: using ARM VFP hardware

by Ineiev-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/20/09, Ian Lance Taylor <iant@...> wrote:

> Ineiev <ineiev@...> writes:
>
>> On 11/10/09, Ineiev <ineiev@...> wrote:
>>> Richard Earnshaw <rearnsha@...> wrote:
>>>> -mfloat-abi=hard will only work with gcc-4.5 (ie trunk)
>>> I tried the latest snapshot (gcc-core-4.5-20091105.tar.bz2).
>>> When configured like this:
>> [snip]
>>> it does not build libgcc
>> [snip]
>>> Surprising, when configured with `--with-float=soft',
>>> it does not build either
>>
>> The same with gcc-core-4.5-20091112.tar.bz2.
>> The same with gcc-core-4.5-20091119.tar.bz2.
>>
>> Should I report a bug?
>>
>> Is VFP support is broken? or
>>
>> Is it obsolete?
>
> You sent this to me directly, rather than to the mailing list, but I'm
> not sure why.

Sorry; I was confused by mailing system user interface.

> If the compiler doesn't build when using --with-float=soft, then you
> should report a bug.  If it is something else that doesn't build, I'm
> not sure what is expected.

Ok, I'll report.

Thanks,
Ineiev