versions for thumb and thumb-2 instruction sets

Dan Olson via D.gnu d.gnu at puremagic.com
Sun Feb 7 22:16:15 PST 2016


Timo Sintonen <t.sintonen at luukku.com> writes:
> Thumb2 is an extension to thumb. It has everything that thumb has and
> more. There is nothing in thumb that is not in thumb2. There is no
> thumb1. Thumb is sometimes called thumb1 because thumb is often
> understood to be both thumb and thumb2.
>
> Thumb2 was introduced to some armv6 devices and it is in all v7 and
> later devices, including all Cortex ones. I do not remember dates but
> I think it has been nearly 10 years that all new designs have been
> thumb2. There may not be many old thumb processors out there any more.
>
> I do not know if there is need to support old thumb any more. However,
> if it is wanted, plain thumb or thumb1 is just what is not thumb2 and
> can be handled in else branch of thumb2 test.

It just made my code uglier with version ARM_Thumb2 only because you
can't do !version like ifndef or !defined.  This is on an armv6 with
thumb1.  I know Walter is not for extra versions if they can be derived
from others though.

version (ARM)
{
    version (ARM_Thumb) // could be thumb1 or thumb2
    {
        version (ARM_Thumb2) {} else version = ARM_Thumb1;
    }

    version (ARM_Thumb1)
    {
        // orginal thumb inline asm
    }
    else
    {
        // arm and thumb-2 inline unified asm
    }
}


More information about the D.gnu mailing list