[oe] experiments with thumb on gta01

Phil Blundell pb at reciva.com
Wed Oct 29 13:37:12 UTC 2008


Over the past week or so, I've been doing a few experiments to compare
the relative behaviour of ARM-state vs Thumb-state userspace on the
openmoko gta01 (ARM920T core and hence ARMv4 architecture).

Although I haven't yet run the full freesmartphone software stack in
Thumb state, the initial results are fairly encouraging.  Some headline
numbers are as follows:

The average reduction in binary size is about 12%.  Some binaries do
significantly better than this, for example busybox shrinks by 25%;
libxml2 shrinks by 24%; libgstffmpegcolorspace.so shrinks by 34%.  The
only binary which seems to have actually increased in size is the tslib
corgi.so plugin, which was only 3060 bytes to start with.

Performance is slightly harder to quantify but, according to lmbench,
the /bin/sh overhead (busybox sh) is down from 35ms to 30ms, an
improvement of 16%.  Python is up from 954 to 1043 pystones/second, an
improvement of 9%.  (These numbers were actually measured with different
kernels, which might have distorted the figures for sh slightly; I don't
think pystone is very much influenced by kernel behaviour so that number
is probably more representative.)

Building for Thumb should, nowadays, be as simple as making sure that
you have tune-thumb.inc included from your MACHINE.conf (which, courtesy
Koen, should now be automatically true for most people), then setting:

ARM_INSTRUCTION_SET = "thumb"
THUMB_INTERWORK = "yes"

in some appropriate place.  Note that tune-thumb.inc needs to override
CFLAGS, so including this file directly from local.conf will probably
not do what you need.

Note also that you need a fairly recent toolchain, in particular
binutils, for interworking to do the right thing on ARMv4T.  Binutils
2.18 seems to be OK for me but I have not tried older versions.  For
ARMv5 and newer, more or less any version ought to be fine since
interworking is much easier on the newer architectures.

Thanks as ever to Mickey and Holger for their kind assistance in getting
this to work.

Share and enjoy

p.






More information about the Openembedded-devel mailing list