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-EABI…
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
Hi,
[my first, friendly, post]
At Mandriva there is some interest of having an arm based distro.
Matthew Dawkins made an awesome job on providing a very complete
qemu image with a Mandriva/Unity Linux distro
http://distro.ibiblio.org/pub/linux/distributions/unity/other/unitybuild-ar…
[above link is a qemu image, kernel and a script to start qemu]
Personally, I am doing some research on it for self teaching, and
I made several qemu images for testing, based on buildroot.net and
based on openembedded.org.
Also for the sake of self teaching, I made an arm port of my fork
of gnu lightning at https://github.com/pcpa/lightning and I also
wrote another jit (based on lightning) for my toy/hobby programming
language at https://code.google.com/p/exl/source/browse/
That being said, we have an almost ready to go armv5 port, based
on mostly unmodified upstream packages (gcc, binutils, etc). But we
expect that armv7 based boards will be common enough to require
another distro build. So far our idea should to be to work on what
appears to be the Fedora goal, e.g.
http://fedoraproject.org/wiki/Architectures/ARM/Fedora15_HardFP_Bootstrap
but from my minimal arm architecture knowledge, what I am proposing
"over here at Mandriva" is to make it using arm instruction set, and
using armv5 abi (floats passed/returned on integer registers), but
enabling vfp-16 (using floats only for temporaries), this way,
armv5 packages would work unmodified in the armv7 based distro.
Well, this is kind of attempting to work on sequential steps, but
of course, going to thumb-2 and full/proper aapcs (hard float register
arguments, etc) is not out of question. But so far my knowledge of
of the state of art of thumb2 toolchain is not that great, but I
made a "contrib" mandriva package based on codesourcery toolchain
http://svn.mandriva.com/viewvc/packages/cooker/cross-arm/current/
Thanks,
Paulo
Hi folks,
Many GNU/Linux distributions are doing some ARM porting; this tends to
result in work duplication, and there doesn't seem to be a general
purpose forum to bring ARM porters together.
We're inviting developers of GNU/Linux distributions with an interest
in ARM to join a new "cross-distro" list, hosted at Linaro:
http://lists.linaro.org/mailman/listinfo/cross-distro
Any ARM Linux / Free Software discussion is welcome on the list, for
instance porting software to build on ARM, toolchain problems, dealing
with new ABIs, Thumb-2, NEON, kernel problems, announcement of new
tools etc.
Cheers,
--
Steve McIntyre steve.mcintyre(a)linaro.org
<http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs