This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6734 - Compile Rockbox using ARM THUMB code
Attached to Project:
Rockbox
Opened by Daniel Ankers (dan_a) - Monday, 05 March 2007, 02:33 GMT+2
Last edited by Rafaël Carré (funman) - Friday, 11 June 2010, 07:37 GMT+2
Opened by Daniel Ankers (dan_a) - Monday, 05 March 2007, 02:33 GMT+2
Last edited by Rafaël Carré (funman) - Friday, 11 June 2010, 07:37 GMT+2
|
DetailsThis makes certain parts of Rockbox compile using the more space-efficient thumb code instruction set on the ARM architecture.
Whether the overall effect of this will be positive or negative is difficult to estimate, so it is worth trying it to see what works - there may be benefits to the battery life or to the boost rate. In general, non-performance critical code which does not contain large loops or ARM assembly will be better off as thumb code. Enabling the interworking between normal ARM and THUMB increases the size of the Rockbox binary, but moving code to THUMB decreases it. Some code will not work as THUMB for reasons which are not known at the moment. If you get a warning about libgcc not being compiled with interworking support, then you need to re-run the rockboxdev.sh script. |
This task depends upon
Closed by Rafaël Carré (funman)
Friday, 11 June 2010, 07:37 GMT+2
Reason for closing: Accepted
Additional comments about closing: r26760
Friday, 11 June 2010, 07:37 GMT+2
Reason for closing: Accepted
Additional comments about closing: r26760
To use just edit Makefile and replace CC=...gcc or CC=ccache ....gcc by CC=/path/to/script.py ....gcc
Only tested (r26353) with eabi gcc because the other one I have doesn't have a libgcc built with -mthumb-interwork
For fuzev1 I need to build with -mlong-calls => ram usage 64kB smaller
On clipv1 no need for -mlong-calls (because memory is only 2MB?) => ram usage 84kB smaller
The script simply runs gcc with -E and grep the output for 'asm' to reject files
This alone isn't enough so I added regexp code to remove unused static inline functions and grep for 'asm' again
With this version the Clip doesn't even boot fine (black screen), but before removing the static inline functions it booted and I could play chopper or display cube demo (which uses greylib) just fine.
codecs crashed immediately with an undef instruction in a HW register (TIMER register fwiw)
To disable the removal of static inline functions (and build much less files with -mthumb) just make "remove_static_inline" function return its input immediately, perhaps this version has less chance to touch sensible files
it works on armv5, so after r26386, Clipv2 runs just fine built with thumb:
binsize 94kB smaller
ram usage 93kB smaller
Note that apps/codecs/nsf.c doesn't build (ICE)
Also I didn't had to use -mlong-calls on Clipv2 although it has 8MB of ram, perhaps due to update to gcc 4.4.4
All codecs are a bit slower except AAC and AC3 which are a bit faster.
Difference is not significant though, I guess because most performance code is in asm
Just try to build anything that ends in .o with -mthumb
if that fails try again without it
Clipv2 (armv5t) range from 95.13% (ac3) to 102.08% (cook), going through 96.82% (aac) and 100.18% (mp3)
aac / ac3 are faster, others are slower
Fuzev1 (armv4t - arm9tdmi) range from 99.82% (wma) to 101.22% (aac)
mp3 / wma are faster, others are slower