本文介绍了ARM架构中按序执行和无序执行的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我对 ARM 处理器的理解,以下是顺序执行的特点(1) 按顺序执行指令(2) 直到当前指令执行完毕,才会执行下一条指令.(3) 执行速度较慢.

As per my understanding in ARM processors, following are the features of In-order execution(1) Executes instructions in sequential order(2) Until current instruction is completed, it will not execute next instruction.(3) Have slower execution speed.

乱序执行与 In-order 的行为正好相反.(1) 以非顺序执行指令(2) 即使当前指令未完成,也会执行下一条指令.(仅当下一条指令不依赖于当前指令的结果时才会这样做)(3)更快的执行速度.

Out-of order execution is just opposite behaviour of In-order.(1) Executes instructions in non-sequential order(2) Even if current instruction is NOT completed, it will execute next instruction. (This is done only if the next instruction does not depend on the result of current instruction)(3) Faster execution speed.

除了上面提到的,还有其他的功能区别吗??

Is there any other feature difference, other than the above mentioned ??

推荐答案

差不多就是这样.乱序执行贪婪"地尽可能快地执行每条指令,而无需等待前面的指令完成,除非它们依赖于尚未完成的指令的结果.

That's pretty much it. Out-of-order execution "greedily" executes every instruction it can as quickly as possible without waiting for previous instructions to finish unless they depend on the result of an as-yet unfinished instruction.

如果一条指令等待读取内存,这显然最有用.有序实现只会停止直到数据可用,而无序实现可以(前提是前面有不能独立执行的指令)在处理器等待数据传递时完成其他操作记忆.

This is obviously mostly useful if an instruction waits for memory to be read. An in-order implementation would just stall until the data becomes available, whereas an out of order implementation can (provided there are instructions ahead that can't be executed independently) get something else done while the processor waits for the data to be delivered from memory.

请注意,编译器和(如果编译器不够聪明的话)程序员都可以利用这一点,将内存中潜在的昂贵读取移动到远离数据实际使用点的地方.这对有序实现没有影响,但可以帮助隐藏无序实现中的内存延迟,从而使代码运行得更快.

Note that both compilers and (if the compiler is not clever enough) programmers can take advantage of this by moving potentially expensive reads from memory as far away as possible from the point where the data is actually used. This makes no difference for an in-order implementation but can help hiding memory latency in an out-of-order implementation and therefore makes the code run faster.

当然,不利的一面是,由于涉及所有簿记,无序实现往往更复杂且更耗电.

The downside is of course that out-of-order implementations tend to be more complex and more power hungry because of all the book-keeping involved.

这篇关于ARM架构中按序执行和无序执行的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-20 05:39