什么是anulled分公司从经常转移指令有什么不同? [英] What is anulled branch different from regular branch instructions?

查看:373
本文介绍了什么是anulled分公司从经常转移指令有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关SPARC大会特别,怎么也anulled分行与常规不同的分支?

我一直以为anulling分支指令,当我需要填写NOP延迟槽分支指令是必需的。不过,我不认为我是正确的这一部分,因为你可以填写NOP没有anulling分支。


解决方案

该取消的分支指令导致延迟槽指令 - 如果不转移被忽略。

为什么会变成这样重要?因为通常,分支后的指令被执行,即使该分支被采用。这是因为有两个程序计数器,PC和NPC。个人电脑,它表示正在执行的指令,更新为鼻咽癌,这是PC + 4,在如鼻咽癌被更新为分支指令的目标在同一时间。如此,因为这些事件的定时的,下一条指令必须被加载。而不是仅仅把那个周期了,它更有利可图的使用周期,如果我们能。然后,我们只想让循环的该指令的部分。

 循环:someOp
        someOtherOp
        分支回路;
        delayslotOp;实际上将被执行,someOp之前,之后分支

如果我们不能分支后使用指令槽,然后我们坚持一个NOP在那里,做在该周期的什么都没有。

那么为什么有废止和非取消的分支选择不同的指令?为了让我们从循环退出会发生什么的选择。如果我们所做的循环活动的延迟槽部分,我们可能不希望在从循环而使执行的操作。因此,我们要补充,一个分支指令的结束。

本页面有一些很好的例子。

For SPARC Assembly particularly, how are anulled branches different from regular branches?

I always thought that anulling branch instructions is required when I need to fill the nop delay slot for branch instructions. However, I don't think I'm correct on this part, because you can fill the nop without anulling the branch.

解决方案

The annulled branch instruction causes the instruction in the delay slot -- the instruction after the branch -- to be ignored if the branch is not taken.

Why would this be important? Because normally, the instruction after the branch is executed, even if the branch is taken. This is because there are two program counters, PC and NPC. PC, which indicates the instruction being executed, is updated to NPC, which is PC + 4, at the same time as NPC is being updated to the target of the branch instruction. So because of the timing of these events, the next instruction has to be loaded. Rather than just throw that cycle away, it's more profitable to use that cycle if we can. We would then just make that instruction part of the loop.

loop:   someOp                
        someOtherOp
        branch      loop      ;
        delayslotOp           ; will actually be executed, before someOp, after branch

If we can't use the instruction slot after the branch, then we stick a nop in there, and do nothing on that cycle.

So why then have different instructions with annulled and non-annulled branch options? To give us the choice of what happens on exit from the loop. If we've made the delay slot part of the loop activity, we might not want that op executed upon leaving from the loop. Therefore, we'd add ",a" to the end of the branch instruction.

This page has some nice examples.

这篇关于什么是anulled分公司从经常转移指令有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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