为什么后来的 ARM 指令集中没有条件执行指令? [英] Why are conditionally executed instructions not present in later ARM instruction sets?

查看:29
本文介绍了为什么后来的 ARM 指令集中没有条件执行指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

天真的,条件执行指令对我来说似乎是个好主意.

Naively, conditionally executed instructions seem like a great idea to me.

当我阅读更多关于 ARM(和类似 ARM)的指令集(Thumb2、Unicore、AArch64)时,我发现它们都缺乏条件执行的位.

As I read more about ARM (and ARM-like) instruction sets (Thumb2, Unicore, AArch64) I find that they all lack the bits for conditional execution.

为什么每一个都缺少条件执行?

Why is conditional execution missing from each of these?

条件执行在当时是一个错误,还是随后的更改使其成为对指令位的昂贵浪费?

Was conditional execution a mistake at the time, or have subsequent changes made it an expensive waste of instruction bits?

推荐答案

普遍声称现代系统有更好的分支预测器,编译器更先进,因此它们在指令编码空间上的成本是不合理的.

General claim is modern systems have better branch predictors and compilers are much more advanced so their cost on instruction encoding space is not justified.

这是来自 ARMv8指令集概述

A64 指令集不包含谓词或有条件的执行.基准测试表明现代分支预测器工作得很好,可以预测指令的执行没有提供足够的好处来证明其大量使用操作码空间,及其高级实现成本实施.

The A64 instruction set does not include the concept of predicated or conditional execution. Benchmarking shows that modern branch predictors work well enough that predicated execution of instructions does not offer sufficient benefit to justify its significant use of opcode space, and its implementation cost in advanced implementations.

它继续

一组非常小的条件数据处理"指令是假如.这些指令是无条件执行的,但使用条件标志作为指令的额外输入.这一套有在条件分支的情况下被证明是有益的预测不佳,或者效率低下.

A very small set of "conditional data processing" instructions are provided. These instructions are unconditionally executed but use the condition flags as an extra input to the instruction. This set has been shown to be beneficial in situations where conditional branches predict poorly, or are otherwise inefficient.

另一篇题为 在 ARM 处理器上交易更多寄存器的条件执行声明:

... 条件执行占用宝贵的指令空间,因为每个条件都被编码到一个 4 位的条件代码选择器中32 位 ARM 指令.此外,只有一小部分在现代嵌入式中,指令实际上是有条件的应用程序,条件执行甚至可能不会导致现代嵌入式处理器的性能改进.

... conditional execution takes up precious instruction space as conditions are encoded into a 4-bit condition code selector on every 32-bit ARM instruction. Besides, only small percentages of instructions are actually conditionalized in modern embedded applications, and conditional execution might not even lead to performance improvement on modern embedded processors.

这篇关于为什么后来的 ARM 指令集中没有条件执行指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆