This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

取指包中的分支跳转指令的影响,如何理解?



在sprugh7文档中有这样的描述:

If a branch into the middle of an execute packet occurs, all instructions at lower addresses are ignored. In Example 3-3, if a branch to the address containing instruction D occurs, then only D and E execute. Even though instruction C is in the same execute packet, it is ignored. Instructions A and B are also ignored because they are in earlier execute packets. If your result depends on executing A, B, or C, the branch to the middle of the execute packet will produce an erroneous result.

为什么同一个执行包中在分支语句的低地址部分被忽略,而不是高地址部分?

在同一个取指包中,含分支执行包之前的执行包(即低地址执行包)不应被忽略吧?

  • 这段叙述的理解应该是: 如果一个跳转指令的目的地址位于一个执行包的中间部分,那么这个执行包中at lower address的指令就被忽略掉。 在example3-3中第3个执行包有3条指令(C D E),假设他们在memory中的地址如下:

    0x84000 指令C

    0x84004 指令D

    0x84008 指令E

    如果在别的地方有一条branch指令跳转到目的地址是 0x84004的地方(也就是指令D的位置),那么只有D,E会被执行,C会被忽略。

  • 原文没有仔细看,现在明白了。谢谢