ancient ARM cpus

Martin Husemann martin at duskware.de
Sun Nov 15 12:35:07 UTC 2015


On Sun, Nov 15, 2015 at 12:57:47PM +0100, Torbjörn Granlund wrote:
> I don't know the following:
> 
> * Is bx always available in v5 (and later) or only when there is also
>   thumb support (which I think was optional before v7).

According to gcc sources:

          /* Use bx if it's available.  */
          if (arm_arch5 || arm_arch4t)
            sprintf (instr, "bx%s\t%%|lr", conditional);
          else
            sprintf (instr, "mov%s\t%%|pc, %%|lr", conditional);

and the __ARM_ARCH_ISA_THUMB builtin define is controlled inside gcc by 
TARGET_ARM_ARCH_ISA_THUMB, which in turn is defined like this:

#define TARGET_ARM_ARCH_ISA_THUMB               \
  (arm_arch_thumb2 ? 2                          \
                   : ((TARGET_ARM_ARCH >= 5 || arm_arch4t) ? 1 : 0))

... which basically caused us to use the test for thumb support (arm4v without
"t" being the only supported arch in our case that needed fixing, all others
supporting "bx").

Of course mimicing the gcc "if (arm_arch5 || arm_arch4t)" exactly would
work as well.

Splitting those files into armv4 and newer would be a waste IMHO.

Maybe instead of the ifdef define a M4 macro like "ret(reg)" ?

Martin


More information about the gmp-bugs mailing list