Why isn't MIPS BLT instruction implemented in hardware?

前端 未结 1 736
你的背包
你的背包 2021-01-23 07:00

I\'d like to ask why the BLT instruction is not a part of MIPS ISA. Instead they actually make it a pseudo-instruction for assembly programmers. I just couldn\'t re

相关标签:
1条回答
  • 2021-01-23 07:30

    It's much easier to compare with zero

    Because less than zero is really just a sign bit check while less than is a subtract and then jump based on the sign bit of the result. Therefore BLTZ is much faster. Similarly, >= 0 also needs only 1 sign bit check. <= 0 or > 0 need another zero check but it's rather trivial.

    In fact, it's not common that an architecture supports jump-and-compare between two values directly in a single instruction, although most will have jumps based on the value in relation to 0. Even CISC architectures like x86 require the user to compare and then jump

    0 讨论(0)
提交回复
热议问题