[fpc-devel] More on arm4, armi and thumb
Florian Klaempfl
florian at freepascal.org
Thu Nov 1 13:46:50 CET 2007
Yury Sidorov schrieb:
> From: "Felipe Monteiro de Carvalho" <felipemonteiro.carvalho at gmail.com>
>> On 11/1/07, Marco van de Voort <marcov at stack.nl> wrote:
>>> It seems that when you branch, in the instruction you can encode if the
>>> instructionset of the target is thumb or not.
>>
>> So, currently fpc set's all branches to use arm4 mode
>>
>> And C++ apps compiled could check what the system is using and use a
>> if to either call in arm4 or call in thumb mode. The strange thing is
>> that this is a bit arbitrary. There is nothing special about an OS
>> call, it's just a call like any other. I wonder where does the
>> compiler get the information of if the function is in arm4 or thumb
>> mode.
>
> FPC just do calls using BL command. It expects that all procedures are
> ARM4.
> C compilers has option called thumb interworking which wraps each
> procedure call with code which checks for procedure mode and performs
> necessary mode swithes. It will slowdown calls.
>
> Also as Marco said interworking code can be added or not depending of
> object file instruction set.
On arm-linux and with gnu binutils, simply assemble everything with
-mthumb-interwork and you can mix arm and thumb o-files without worrying
about anything.
More information about the fpc-devel
mailing list