You copied the Doc URL to your clipboard.

-mthumb

Requests that the compiler targets the T32 or Thumb® instruction sets.

Different architectures support different instruction sets:

  • ARMv8-A processors in AArch64 state execute A64 instructions.
  • ARMv8-A processors in AArch32 state can execute A32 or T32 instructions.
  • ARMv7-A processors can execute ARM® or Thumb instructions.

The -mthumb option targets the T32 (ARMv8-A AArch32 state) or Thumb (ARMv7-A) instruction set.

Note

The -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.

Default

The default for ARMv8-A AArch32 and ARMv7-A targets is -marm.

Example

armclang -c --target=arm-arm-none-eabi -march=armv8-a -mthumb test.c

Related reference

Was this page helpful? Yes No