RTEMS and ARM/Thumb

Bill Knight BillK at rosw.com
Mon Feb 10 21:45:22 UTC 2003


This is not specific to RTEMS but gcc & ARM/Thumb processors in
general.

gcc prior to 3.0 had seperate compilers for ARM and Thumb modes.
The two modes are supported with a single compiler w/ gcc 3.0 & newer.
ARM & Thumb instructions can be mixed within assembly source files but
not within C source files.

Thumb mode does offer some very nice benefits.  For one, it is about
30% smaller.  The other real nice feature is that for processors
executing code over an external 16-bit data path, Thumb mode is
also to be about 30% faster.  For 32-bit data path processors with
lots of memory, ARM mode is faster.

Regards
-Bill Knight
R O SoftWare

On Mon, 10 Feb 2003 14:29:29 -0600, Joel Sherrill wrote:



>Jay Monkman wrote:
>> 
>> On Mon, Feb 10, 2003 at 10:13:59AM -0600, Joel Sherrill wrote:
>> > Does anyone out there have experience using the Thumb instructions
>> > with RTEMS?
>> 
>> I haven't used thumb mode, but I think there are some difficulties
>> you'll have to work around.
>> 
>> The last time I checked, gcc could generate ARM or THUMB instructions,
>> but not both. If that's true, you'll need different compilers for
>> exceptions (since they run in ARM mode) and everything else. You might
>> need different assemblers as well.

>The arm-rtems-gcc multilibs for ARM and Thumb so I think it is OK
>to use a single compiler but being an either ARM or THUMB situation
>makes sense.

>Sounds like all assembly will have to be modified to be conditionally
>compiled for THUMB mode.  Newlib has a lot of that in its assembly.
>C code will take care of itself.


>> Since exceptions always start in ARM mode, the current handlers would
>> have to modified.

>But since they are calling THUMB ISR Handlers, they would have to 
>honor that, right?  And they wouldn't have to save as much context
>since there aren't as many registers, right?

>Thanks Jay.  Any insight would be appreciated.

>>   ------------------------------------------------------------------------
>>    Part 1.2Type: application/pgp-signature

>-- 
>Joel Sherrill, Ph.D.             Director of Research & Development
>joel at OARcorp.com                 On-Line Applications Research
>Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>Support Available                (256) 722-9985






More information about the users mailing list