using ARM VFP hardware
Ineiev
ineiev@gmail.com
Mon Nov 9 12:16:00 GMT 2009
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,
More information about the Gcc-help
mailing list