不同ISA的一些特点

通常x86架构的字节码长度是不固定的,x64也也沿袭了这种做法。

ARM架构则是具有固定长度的字节码。

在最开始的时候,所有的ARM指令都被编码为4字节。这被称为ARM mode。

后来发现可以压缩到两个字节。这被称为Thumb mode

* Thumb mode和ARM mode可能会同时存在于一个程序中。

在ARMv7中,又出现了Thumb-2.Thumb-2则在Thumb之外又加入了一些长度为4字节的指令。

ARM64的机器码则都是4字节长度的

* many other RISC ISAs with fixed length 32-bit opcodes, such as MIPS, PowerPC and Alpha AXP.

------------------原文---------------------

The x86 ISA has always been one with variable-length opcodes, so when the 64-bit era came, the x64 extensions did not impact the ISA very significantly. In fact, the x86 ISA still contains a lot of instructions that first appeared in 16-bit 8086 CPU, yet are still found in the CPUs of today. ARM is a RISC3 CPU designed with constant-length opcode in mind, which had some advantages in the past. In the very beginning, all ARM instructions were encoded in 4 bytes4. This is now referred to as “ARM mode”. Then they thought it wasn’t as frugal as they first imagined. In fact, most used CPU instructions5 in real world applications can be encoded using less information. They therefore added another ISA, called Thumb, where each instruction was encoded in just 2 bytes. This is now referred as “Thumb mode”. However, not all ARM instructions can be encoded in just 2 bytes, so the Thumb instruction set is somewhat limited. It is worth noting that code compiled for ARM mode and Thumb mode may of course coexist within one single program. The ARM creators thought Thumb could be extended, giving rise to Thumb-2, which appeared in ARMv7. Thumb-2 still uses 2-byte instructions, but has some new instructions which have the size of 4 bytes. There is a common misconception that Thumb-2 is a mix of ARM and Thumb. This is incorrect. Rather, Thumb- 2 was extended to fully support all processor features so it could compete with ARM mode—a goal that was clearly achieved, as the majority of applications for iPod/iPhone/iPad are compiled for the Thumb-2 instruction set (admittedly, largely due to the fact that Xcode does this by default). Later the 64-bit ARM came out. This ISA has 4-byte opcodes, and lacked the need of any additional Thumb mode. However, the 64-bit requirements affected the ISA, resulting in us now having three ARM instruction sets: ARM mode, Thumb mode (including Thumb-2) and ARM64. These ISAs intersect partially, but it can be said that they are different ISAs, rather than variations of the same one. Therefore, we would try to add fragments of code in all three ARM ISAs in this book. There are, by the way, many other RISC ISAs with fixed length 32-bit opcodes, such as MIPS, PowerPC and Alpha AXP.

时间: 2024-12-18 09:25:27

不同ISA的一些特点的相关文章

读书笔记 effective c++ Item 32 确保public继承建立“is-a”模型

1. 何为public继承的”is-a”关系 在C++面向对象准则中最重要的准则是:public继承意味着“is-a”.记住这个准则. 如果你实现一个类D(derived)public继承自类B(base),你在告诉c++编译器(也在告诉代码阅读者),每个类型D的对象也是一个类型B的对象,反过来说是不对的.你正在诉说B比D表示了一个更为一般的概念,而D比B表现了一个更为特殊的概念.你在主张:任何可以使用类型B的地方,也能使用类型D,因为每个类型D的对象都是类型B的对象:反过来却不对,也就是可以使

ISA Server 2006 软件防火墙管理

项目背景 公司是以生产制造企业,分有综合管理部.市场部.业务部.研发部门及制造部.为了适应市场的拓展,扩大公司网络规模,并希望拥有一套安全.高效.畅通的网络设施.安全.高效的网络,可以极大提高公司的办公效率.使公司安全高效的发展. ISA Server 2006 软件防火墙管理下载链接: http://down.51cto.com/data/2268161

IS-A 和 HAS-A

IS-A关系 IS-A就是说:一个对象是另一个对象的一个分类. 下面是使用关键字extends实现继承. public class Animal{ } public class Mammal extends Animal{ } public class Reptile extends Animal{ } public class Dog extends Mammal{ } 分析以上示例中的IS-A关系,如下: Mammal IS-A Animal Reptile IS-A Animal Dog

Java Inheritance ( IS-A relationship)

Inheritance (IS-A) when a class extends another another class it inherits all non private members including fields and methods. Inheritence in Java can be best understood in terms of Parent and child relationship. also known as Super class and Sub cl

计算机硬件软件接口ISA

计算机硬件软件接口ISA ISA(Instruction Set Architecture,指令集体系结构)     IBM为了让自己的一系列计算机能够使用相同的软件,免去重复编写软件的痛苦,在它的System/30计算机中引入了ISA(Instruction Set Architecture,指令集体系结构)的概念,将编程所需要了解的硬件信息从硬件系统中抽象出来,这样软件人员可以面向ISA进行编程,开发出的软件不经过修改就可以应用在其他ISA架构的系统上. ISA用来描述编程时用到的抽象机器,

Objective-C isa 指针 与 runtime 机制

一.isa指针 要认识什么是isa指针,我们得先明确一点: 在Objective-C中,任何类的定义都是对象.类和类的实例(对象)没有任何本质上的区别.任何对象都有isa指针. 那么什么是类呢?在xcode中用快捷键Shift+Cmd+O 打开文件objc.h 能看到类的定义: 可以看出: Class 是一个 objc_class 结构类型的指针, id是一个 objc_object 结构类型的指针. 我们再来看看 objc_class 的定义: 稍微解释一下各个参数的意思: isa:是一个Cl

类与类的关系 is-a is-like-a

1.泛化关系:类和类之间继承,接口与接口直接继承 2.实现关系:类和接口对接 3.关联关系:一个类可以知道另一个类的属性方法 4.聚合关系:较强的关联关系,不像关联关系那样平等,这个是一个整体一个部分.(整体无法决定部分) 5.合成关系:和聚合一样,区别是 整体决定部分 is-a: 继承 is-like-a:类和接口的关系 has-a:关联

C++ is-a was-a has-a holds-a

C++ is-a was-a has-a holds-a flyfish 2015-1-28 is-a :公有继承(public inheritance)一般称为两个对象是之间是 is-a 关系 was-a: 私有继承称两个对象是 was-a 关系 has-a:has-a关系描述一个类中有另一个类型的实例 holds-a:描述的是一个类中保存了指向另一个类型的指针或者引用 is-a :Liskov替换原则(Liskov Substitution Principle)对is-a 做出了更具有限制性

Object-C 类,对象,运行时,isa 附带类本质的内存图

如果不是Apple,不是App Store,Object-C恐怕早就淡出人们的视线了.大部分编程语言都是基于C语法风格的,所以初次接触这个非C风格的语言,会看不懂它那怪异的语法.但如果掌握了它之后,也并不会觉得它又太多的不同.今天记录一下它的底层运作.       1: 类Class:       typedef struct objc_class * Class;     从Class的定义可以看出,它是一个 objc_class 结构类型的指针,objc_class又是什么呢? struct