branch - 为什么 MIPS BLT 指令不在硬件中实现?

标签 branch mips hardware cpu-architecture

我想问为什么BLT指令不是MIPS ISA的一部分。相反,他们实际上将其设为汇编程序员的伪指令。从硬件实现的角度来看,我无法识别 BLTBLTZ(它是 MIPS ISA 的一部分)之间的区别。

顺便说一句,《计算机组织与设计》一书中说:

Heeding von Neumann's warning about the simplicity of the "equipment" the MIPS architecture doesn't include branch on less than because it's too complicated either it would stretch the clock cycle time or it would take extra clock cycles per instruction, the two faster instructions are more useful.

但我仍然不知道为什么会发生这些。

最佳答案

与零比较容易得多

因为小于零实际上只是一个符号位检查,而小于

任何一种方式都比一位检查复杂得多,因此BLTZ速度要快得多。同样,>= 0也只需要 1 个符号位检查。 <= 0> 0需要另一个零检查,但这相当简单。

事实上,架构支持直接在单个指令中在两个值之间进行跳转和比较的情况并不常见,尽管大多数架构都会基于与 0 相关的值进行跳转。即使是像 x86 这样的 CISC 架构也要求用户比较然后跳转

关于branch - 为什么 MIPS BLT 指令不在硬件中实现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19923977/

相关文章:

git - 如何列出 git 子模块的现有分支(无需先初始化它)?

svn - 为什么 SVN 中的分支不够好?

android - Android 应用程序中的 JPEG 硬件解码支持

c# - 如何检测任何特定驱动器是否为硬盘驱动器?

android - 检测手机键盘是否滑出

ruby - 我遇到 ruby 的分支问题

git - 为什么我的 `remotes/origin/HEAD -> origin/master` 输出中有一个 `git branch -l -a` 条目?

mips - 为什么我们在加载字指令中签名扩展?

numbers - 无符号数的上溢/下溢

arrays - 将带有 args 的 C 函数转换为 MIPS : loop over an int array and count negatives