versions for thumb and thumb-2 instruction sets

Mike via D.gnu d.gnu at puremagic.com
Sun Feb 7 05:02:55 PST 2016


On Saturday, 6 February 2016 at 21:58:17 UTC, Dan Olson wrote:
> Hi Iain, Johannes.  I'm asking here because I don't expect 
> anybody else is playing with thumb instructions.
>
> Both GDC and LDC have version ARM_Thumb defined for original 
> thumb (call it thumb-1) and thumb-2.  But there is no way to 
> tell in D code which set is supported.
>
> GCC and clang define these:
>
> __arm__
> Always defined when building for the ARM architecture 
> (regardless of
> target instruction set)
>
> __thumb__
> Defined only when targeting any Thumb instruction set variant 
> (Thumb-1
> or Thumb-2)
>
> __thumb2__
> Defined only when targeting Thumb-2
>
> We could mimic this by adding ARM_Thumb2.
>
> But in my experience it is usually thumb-1 that needs special 
> handling because it is very limited, and thumb-2 uses unified 
> assembler so often same code works for either thumb-2 or arm 
> modes.
>
> So I am thinking that ARM_Thumb1 would be more practical.  What 
> do you think?

I think to do this properly with ARM you need to consider the ARM 
architecture (ARMv6, ARMv7, ARMv7-A, ARMv7-M, etc..) AND the 
instruction set (ARM or ARM_Thumb).  I read it somewhere, but I'm 
having trouble finding it again.

Anyway, used in conjunction with the architecture, I believe only 
one ARM_Thumb identifier is needed.

It also appears that, with the introduction of AArch64, ARM is 
trying to transition this nomenclature to A32 (ARM), T32 (Thumb), 
A64 (64-bit ARM?).  See 
http://www.arm.com/products/processors/instruction-set-architectures/

Mike

Mike




More information about the D.gnu mailing list