ARM
- ARM 指令集是一组提供一整套运算的 32 位指令。
ARMv4T
- ARMv4T 及更高版本定义了一个名为 Thumb 指令集的 16 位指令集。 32 位 ARM指令的多数功能都可用,但有些运算需要与其他指令结合使用。 Thumb 指令集提供了更好的代码密度,但会损害性能。
ARMv6T2
- ARMv6T2 定义了 Thumb-2,它与 Thumb 指令集相比有了重大改进。 Thumb-2 提供了几乎与 ARM 指令集完全相同的功能。 它同时具有 16 位和 32 位指令,并可同时实现类似于 ARM 的性能以及类似于 Thumb 的代码密度。.
- 在 ARMv6 及更高版本中,所有 ARM 和 Thumb 指令都是小端的。 在 ARMv6T2及更高版本中,所有 Thumb-2 指令获取也都是小端的。
ARMv7
- ARMv7 定义了 Thumb-2 执行环境 (Thumb-2EE)。 Thumb-2EE 指令集基于的是Thumb-2,但与后者相比有一些变更和补充,从而可以更好地适用于动态生成的代码,即就在执行前或执行期间在设备上编译的代码。
Trumb
- 较新的ARM处理器有一种16-bit指令模式,叫做Thumb,也许跟每个条件式运行指令均耗用4位的情形有关。
- 在Thumb模式下,较小的opcode有更少的功能性。例如,只有分支可以是条件式的,且许多opcode无法访问所有CPU的寄存器。
- 然而,较短的opcode提供整体更佳的编码密度(注:意指代码在存储器中占的空间),即使有些运算需要更多的指令。特别在存储器端口或总线宽度限制在32以下的情形时,更短的Thumb opcode能更有效地使用有限的存储器带宽,因而提供比32位代码更佳的性能。
- 典型的嵌入式硬件仅具有较小的32-bit datapath定址范围以及其他更窄的16 bits定址(例如Game Boy Advance)。在这种情形下,通常可行的方案是编译成Thumb代码,并自行最优化一些使用(非Thumb)32位指令集的CPU相关程序区,因而能将它们置入受限的32-bit总线宽度的存储器中。
- 首颗具备Thumb技术的处理器是ARM7TDMI。所有ARM9和后来的家族,包括XScale,都纳入了Thumb技术。
Thumb-2
- Thumb-2技术首见于“ARM1156核心”,并于2003年发表。Thumb-2扩展了受限的16位Thumb指令集,以额外的32位指令让指令集的使用更广泛。因此Thumb-2的预期目标是要达到近乎Thumb的编码密度,但能表现出近乎ARM指令集在32位存储器下的性能。
- Thumb-2至今也从ARM和Thumb指令集中衍伸出多种指令,包含位段操作、分支建表和条件运行等功能。
Thumb Execution Environment(ThumbEE)
- ThumbEE,也就是所谓的Thumb-2EE,业界称为Jazelle RCT技术,于2005年发表,首见于“Cortex-A8”处理器。ThumbEE提供从Thumb-2而来的一些扩展性,在所处的运行环境下,使得指令集能特别适用于运行阶段的编码产生(例如即时编译)。Thumb-2EE是专为一些语言如Limbo、Java、C#、Perl和Python,并能让即时编译器能够输出更小的编译码却不会影响到性能。
- ThumbEE所提供的新功能,包括在每次访问指令时自动检查是否有无效指针,以及一种可以运行数组范围检查的指令,并能够分支到分类器,其包含一小部分经常调用的编码,通常用于高级语言功能的实现,例如对一个新对象做存储器配置。
注:若要在 ARM 和 Thumb 状态之间进行转换,必须切换汇编程序模式,以便使用ARM 或 THUMB 指令生成正确的操作代码。