This site is no longer active and is available for archival purposes only. Registration and login is disabled.

THUMB vs. ARM


THUMB vs. ARM

Postby cryo » Jan 6, 2002 @ 9:56am

Hey,<br><br>as far as i understand, the only reason for using the THUMB instructions in assembler is the higher code density. For speed, one should always go for ARM instructions. <br>Does anyone know if this is generally true or are there exception to this rule? Has someone measured performance vs. code size? The only real problem i see is that a too large rutine in ARM could be small enough if recoded in THUMB to use the cache better. And does a veneer mean a high preformance penalty? What does eVC do, it seems like it always generates ARM, or does it depend on the optimization settings, i.e. if i go for "smallest code" will it use THUMB instead of ARM instructions? <br><br>I guess THUMB is cool for the smaller devices and processors like cell phones and the like, i dont think with modern PDA's having at least 32MB the size of an executable is such a problem.<br><br>thanx in advance, i hope some guru can answer some of this  :)<br><br>cryo<br>
User avatar
cryo
pm Member
 
Posts: 204
Joined: Sep 19, 2001 @ 6:01am
Location: Bonn, Germany


Re: THUMB vs. ARM

Postby Digby » Jan 6, 2002 @ 5:18pm

The StrongARM used in the current crop of Pocket PC devices has an ARM V4 core (no Thumb support).<br><br>eVC's ARM compiler supports generation of ARM Thumb instructions via the /QRarch4T switch, however I doubt that this is invoked through the compiler optimizer's flags because it would never produce the proper code in a debug build where the optimizations typically are disabled.<br><br>Realize that although the Thumb instructions are half the size of the ARM instructions, it might take two of them to do what you could do in one of the ARM instructions.<br><br>Code size typically isn't a problem, it's usually data size that gets you in trouble on a handheld device - especially with games.  Porting code from the PC can sometimes be a challenge because the Windows programmers have basically no memory restrictions (or at least they seem to code that way).  As long as there is free disk space, malloc won't fail.<br><br>I recall some gaming device using Thumb instructions... Does the GameBoy Advance use Thumb instructions?<br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: THUMB vs. ARM

Postby cryo » Jan 6, 2002 @ 5:27pm

thanx Digby,<br><br>yeah, the GBA supports both THUMB and ARM instructions. I have read some tutorials on GBA coding and it seems to be possible to jump between ARM and THUMB code areas arbitrarily.<br>BTW: GBA sites are a good source of graphics-oriented ARM assembler source code. I have found to quite useful.<br><br>cryo<br>
User avatar
cryo
pm Member
 
Posts: 204
Joined: Sep 19, 2001 @ 6:01am
Location: Bonn, Germany


Postby Guest » Mar 28, 2002 @ 12:33am

Also--THUMB is much faster for instruction lookup when your memory bus is 16-bit instead of 32-bit (true for many embedded devices.) In this case, each ARM instruction causes an extra 1-read stall, which can be significant on slow devices.
Guest
 


Postby refractor » Mar 28, 2002 @ 9:28am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum