投机与预测之间的差异 [英] difference between speculation and prediction

查看:163
本文介绍了投机与预测之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在计算机体系结构中,

(分支)预测和推测之间有什么区别?

what is difference between (branch) prediction and speculation??

这些看起来很相似,但是我认为它们之间有微妙的区别.

These seems very similar, but i think there is a subtle distinction between them.

推荐答案

处理器执行分支预测,以尝试确定在有条件跳转之后执行将在哪里继续,以便它可以从中读取下一条指令.记忆.

Branch prediction is done by the processor to try to determine where the execution will continue after a conditional jump, so that it can read the next instruction(s) from memory.

推测性执行又前进了一步,并确定了执行下一条指令的结果.如果分支预测正确,则使用结果,否则将其丢弃.

Speculative execution goes one step further and determines what the result would be from executing the next instruction(s). If the branch prediction was correct, the result is used, otherwise it is discarded.

请注意,即使代码中没有实际的条件分支,也可以应用推测执行.处理器可以从通常会连续执行的几条指令中确定结果,但是可以通过例如算术溢出中断来停止执行.

Note that speculative execution can be applied even if there isn't an actual conditional branch in the code. The processor can determine the result from several instructions that normally would execute in succession, but the execution could be stopped for example by an arithmetic overflow interrupt.

这篇关于投机与预测之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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