versions for thumb and thumb-2 instruction sets

Johannes Pfau via D.gnu d.gnu at puremagic.com
Sun Feb 7 01:48:05 PST 2016


Am Sat, 06 Feb 2016 13:58:17 -0800
schrieb Dan Olson <gorox at comcast.net>:

> 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?

Sorry, I never really used Thumb code so I don't know whether
Thumb1 or Thumb2 would be more useful. But both would be trivial to
implement in GDC, so just choose what you think makes most sense.

Or we could add both ARM_Thumb1 and ARM_Thumb2 versions. If there'll
ever be a Thumb3 we need both anyway.


More information about the D.gnu mailing list