Hi,
Sorry for the cross post and long email :-)
Currently I am working on a very initial state build of Mandriva for arm.
Thanks to Jeff Johnson for giving me ssh access to armv7 hosts, and
Matthew Dawkins for building several Mandriva/Unity linux armv5
packages.
What I am trying to understand now is about choice of float abi.
I understand that the IHI0042D_aapcs.pdf file I donwload says
to use vfp registers for float/double arguments, but softfp seems
too good to miss, as armv5 should be around for some time yet.
So, I have two chroots, running:
softfp# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/armv7l-mandriva-linux-gnueabi/4.6.1/lto-wrapper
Target: armv7l-mandriva-linux-gnueabi
Configured with:
/home/pcpa/bootstrap/rpmbuild/BUILD/gcc-4.6-20110722/configure
--prefix=/usr --build=i586-mandriva-linux-gnu
--host=armv7l-mandriva-linux-gnueabi
--target=armv7l-mandriva-linux-gnueabi --enable-werror=no --enable-cxx
--with-cpu=cortex-a8 --with-tune=cortex-a8 --with-arch=armv7-a
--with-float=softfp --with-fpu=vfpv3-d16 --with-abi=aapcs-linux
--enable-languages=c,c++ --enable-threads=posix --disable-libssp
--disable-libmudflap
Thread model: posix
gcc version 4.6.1 20110722 (Mandriva) (GCC)
thumb# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/armv7l-mandriva-linux-gnueabi/4.6.1/lto-wrapper
Target: armv7l-mandriva-linux-gnueabi
Configured with:
/home/pcpa/bootstrap/rpmbuild/BUILD/gcc-4.6-20110722/configure
--prefix=/usr --build=i586-mandriva-linux-gnu
--host=armv7l-mandriva-linux-gnueabi
--target=armv7l-mandriva-linux-gnueabi --enable-werror=no --enable-cxx
--with-cpu=cortex-a8 --with-tune=cortex-a8 --with-arch=armv7-a
--with-mode=thumb --with-float=hard --with-fpu=vfpv3-d16
--with-abi=aapcs-linux --enable-languages=c,c++ --enable-threads=posix
--disable-libssp --disable-libmudflap
Thread model: posix
gcc version 4.6.1 20110722 (Mandriva) (GCC)
This is unmodified upstream gcc, and using a set of bootstrap
scripts from a git branch I made on a checkout of
git clone
git://fedorapeople.org/~djdelorie/bootstrap.git
Since I am still very "arm noob" :-) and just yesterday did
the thumb build to learn about thumb, so far, my impression
is that the best approach should be to use thumb+softfp.
Just so you know I am running thumb and arm builds, with
thumb using hard float and the softfp with arm instructions set:
softfp# objdump -d /usr/lib/libm.so | less
[...]
00008d30 <__ieee754_atan2>:
8d30: e3a0c000 mov ip, #0
8d34: e347cff0 movt ip, #32752 ; 0x7ff0
8d38: e92d4030 push {r4, r5, lr}
8d3c: ed2d8b10 vpush {d8-d15}
8d40: e3a05000 mov r5, #0
8d44: ec432b18 vmov d8, r2, r3
8d48: e3475ff0 movt r5, #32752 ; 0x7ff0
8d4c: e003c00c and ip, r3, ip
8d50: e15c0005 cmp ip, r5
8d54: e24dd02c sub sp, sp, #44 ; 0x2c
8d58: e1a04003 mov r4, r3
8d5c: ec410b19 vmov d9, r0, r1
8d60: e1a05002 mov r5, r2
8d64: 0a000022 beq 8df4 <__ieee754_atan2+0xc4>
[...]
thumb# objdump -d /usr/lib/libm.so | less
[...]
00007884 <__ieee754_atan2>:
7884: 2100 movs r1, #0
7886: 2000 movs r0, #0
7888: f6c7 71f0 movt r1, #32752 ; 0x7ff0
788c: ec53 2b11 vmov r2, r3, d1
7890: f6c7 70f0 movt r0, #32752 ; 0x7ff0
7894: 4019 ands r1, r3
7896: 4281 cmp r1, r0
7898: e92d 03f0 stmdb sp!, {r4, r5, r6, r7, r8, r9}
789c: ed2d 8b10 vpush {d8-d15}
78a0: 461c mov r4, r3
78a2: b08a sub sp, #40 ; 0x28
78a4: eeb0 8b41 vmov.f64 d8, d1
78a8: 4616 mov r6, r2
78aa: eeb0 9b40 vmov.f64 d9, d0
78ae: d03c beq.n 792a <__ieee754_atan2+0xa6>
[...]
I am kind of trying to figure what "The Industry" says about it,
and just checked the linaro gcc-4.6 relevant changes for me
right now, that are...
+ --with-arch=armv7-a --with-tune=cortex-a8 \
+ --with-float=$(float_abi) --with-fpu=neon \
+# check if we're building for armel or armhf
+ifeq ($(DEB_TARGET_ARCH),armhf)
+ float_abi := hard
+else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel))
+ float_abi := softfp
+endif
If I understand correctly, neon will have better support for
simd instructions right?
Either way, I used two simple benchmarks to try to sell
myself the idea of breaking compatibility with armv5 or
older binaries, but still not convinced, but, as I said, we
should use whatever "The Industry" chooses :-)
I used for benchmark
http://www.tux.org/~mayer/linux/bmark.html
and
http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Why-ARMs-EA...
and also compared with my home computer (quad)core i5 x86_64,
and attached results...
Thanks and again sorry for cross posting and long email,
Paulo