This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

If the mispredict happen, is there a mechanism to abort the instructions(have been fetched or decoded)?

If the mispredict happen, is there a mechanism to abort the instructions(have been fetched or decoded)?

If there is the mechanism, how does it work?

Thanks very much!

  • For an in-order processor the mispredicted instructions are not executed and for an out-of-order one the any results that have been generated assuming the predicted path of the branch are discarded. Is there something more specific you are asking about? There's a Wikipedia article about out-of-order execution at

    Out-of-order execution - Wikipedia, the free encyclopedia

  • If there is the mechanism, how does it work?

    ARM will not give information about how the internals of the processors work in public forums - it's not information developers need to know in order to make effective use of the CPUs.

    Regards,
    Pete

  • Theoretically, speculative instructions can get executed in both in-order as well as out-of-order processors as long as they are not committed (don't update/modify the processor status permanently) until the branch outcome is known. Practically, in an in-order processor speculative instructions follow the branch instructions and therefore they are never executed before the branch instruction itself is executed and actual branch outcome is known. If the branch outcome is mispredicted then speculatively fetched and decoded instructions are discarded (just ignored). In case of a misprediction there will be a few cycle delay to refill the pipeline with valid instructions (techniques like BTIC can reduce the branch misprediction penalty as you might remember from your previous post).

    To support execution of speculative instructions the processor need a shadow register-file as well as a shadow store-buffer to store the temporary values until the branch is executed and the branch outcome is known.

    The answer to your question is No. There is no need to have a special mechanism to flush mispeculatively fetched and decoded instructions from the pipeline. In case of a misprediction the PC is updated and new instructions are fetched. How long it takes for a processor to refill the pipeline should be clearly indicated in the user manual as it is a very important architectural feature.