1.2.1. The Thumb-2 instruction set

Thumb-2 is a superset of the Thumb instruction set. Thumb-2 introduces 32-bit instructions that are intermixed with the 16-bit instructions. The Thumb-2 instruction set covers almost all the functionality of the ARM instruction set. Thumb-2 is backwards compatible with the ARMv6 Thumb instruction set. Any code that you have compiled to run on the ARMv6 thumb instruction set runs on the Thumb-2 instruction set.

The most important difference between the Thumb-2 instruction set and the ARM instruction set is that most Thumb-2 instructions are unconditional, where as almost all ARM instructions can be conditional. However, Thumb-2 introduces a new conditional execution instruction, IT, that is a logical if-then-else function.

Thumb-2 has the performance close to or better than that of the ARM instruction set and has the code density of the original Thumb ISA.

In addition to the new 32-bit Thumb instructions, there are several new 16-bit Thumb instructions. Several new 32-bit ARM instructions are introduced at the same time.

The main enhancements are:

The 32-bit ARM Thumb-2 instructions are added in the space occupied by the Thumb BL and BLX instructions. The 32-bit ARM Thumb-2 instruction format is shown in Figure 1.1.

Figure 1.1. 32-bit ARM Thumb-2 instruction format

The instruction length and functionality is determined by first halfword (hw1). If the instruction is decoded as being 32-bits long, the second halfword (hw2) of the instruction is fetched from the instruction address plus two.

For details on Thumb-2 operations and assembler, see the ARM Architecture Reference Manual.

Copyright ©  2005-2007 ARM Limited. All rights reserved.ARM DDI 0338G