Branch prediction method and branch prediction circuit performing the method
AssigneeFujitsu Limited
InventorYoshimasa Takebe
Life of this patent
Estimating the term…
Abstract
A branch prediction circuit includes: a memory for storing information representing a branch instruction and a branch prediction; a control circuit for controlling rewriting information in the memory in accordance with a result of determining whether or not a predicted branch has been taken, and determining an attribute of the predicted branch from a branch condition set by the branch instruction and the predicted branch that has been taken, if the predicted branch has been taken; and a rewriting circuit rewriting the information in the memory under the control of the control circuit.
Claims5
A branch prediction circuit comprising:
- a memory for storing information representing a branch instruction and a branch prediction;
- a control circuit for controlling rewriting information in the memory in accordance with a result of determining whether or not a predicted branch has been taken, and determining an attribute of the predicted branch from a branch condition set by the branch instruction and the predicted branch that has been taken, if the predicted branch has been taken;
- and
- a rewriting circuit rewriting the information in the memory under the control of the control circuit;
- wherein the determining an attribute of the predicted branch is performed on the basis of an address difference multiplied by a length of the pipeline from an instruction decode stage to an instruction execution stage, the address difference being between a branch target address and an address of the branch instruction.
A branch prediction method performed by a processing device which executes a branch instruction, the processing device having a branch prediction circuit which includes a memory storing a branch instruction and information representing a branch prediction, the method comprising:
- storing the information in a memory;
- determining whether or not a predicted branch has been taken and determining an attribute of the predicted branch from a branch condition set by the branch instruction and the predicted branch which has been taken;
- rewriting the information in the memory in accordance with a result of determining whether or not a predicted branch has been taken, and determining an attribute of the predicted branch from a branch condition set by the branch instruction and the predicted branch that has been taken, if the predicted branch has been taken;
- and
- predicting a branch on the basis of the information when the branch instruction is executed on the processing;
- wherein the determining an attribute of the predicted branch is performed on the basis of an address difference multiplied by a length of the pipeline from an instruction decode stage to an instruction execution stage, the address difference being between a branch target address and an address of the branch instruction.
Dependencies are inferred from the claim text.