Requests that the compiler targets the T32 or Thumb® instruction sets.
Most ARMv7-A (and earlier) processors support two instruction sets:
the ARM instruction set, and the Thumb instruction set. ARMv8-A AArch32 continues to
support these two instruction sets, but they are renamed as A32 and T32
respectively. ARMv8-A additionally introduces the A64 instruction set, used in the
AArch64 execution state.
Different architectures support different instruction sets:
- ARMv8-A processors in AArch64 state execute A64 instructions.
- ARMv8-A processors in AArch32 state, in addition to ARMv7 and earlier A- and
R- profile processors execute A32 (formerly ARM) and T32 (formerly Thumb)
- M-profile processors execute T32 (formerly Thumb) instructions.
-mthumb option targets the T32 (formerly Thumb) instruction set.
-mthumb option is not valid with
AArch64 targets, for example
--target=aarch64-arm-none-eabi. The compiler ignores the
-mthumb option and generates a warning
with AArch64 targets.
-mthumb option is recognized when
using armclang as a compiler, but not
when using it as an assembler. To request armclang to assemble using the T32 or Thumb
instruction set for your assembly source files, you must use the
16 directive in the assembly files.
The default for all targets that support ARM or A32 instructions is
armclang -c --target=arm-arm-none-eabi -march=armv8-a -mthumb test.c