EP0401992A2

Method and apparatus for speeding branch instructions.

Abstract

A super-scalar processor is disclosed wherein branch-prediction information is provided within an instruction cache memory. Each instruction cache block stored in the instruction cache memory includes branch-prediction information fields in addition to instruction fields, which indicate the address of the instruction block's successor and information indicating the location of a branch instruction within the instruction block. Thus, the next cache block can be easily fetched without waiting on a decoder or execution unit to indicate the proper fetch action to be taken.

EP0401992A2, drawing sheet 1
Sheet 1 of 7

Term

Term ended

Projected expiry passed 18 May 2010, 16.4 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

12 claims: 3 independent, 9 dependent

  1. 1
    A branch prediction method comprising:a. loading a plurality of instruction blocks into an instruction cache memory, each of said instruction blocks comprising a plurality of instructions and instruction fetch information, wherein said instruction fetch information comprises an address tag, a branch block index and a successor index that includes a successor valid bit;b. generating and supplying a fetch program counter to said instruction cache memory in order to prefetch one of said plurality of instruction blocks stored in said instruction cache memory;c. determining whether said successor valid bit of said prefetched instruction block is set to a predetermined condition which indicates that a branch instruction within said prefetched instruction block is predicted as taken;d. incrementing said fetch program counter and supplying the incremented fetch program counter to said instruction cache memory to prefetch a succeeding instruction block if said successor valid bit is not set to said predetermined condition, and generating a branch location address indicative of the location of said branch instruction within said instruction memory cache and a predicted target branch address if said successor valid bit is set to said predetermined condition;e. storing said predicted target branch address and said branch location address in a branch prediction memory;f. executing said branch instruction with an execution unit and generating an actual branch address and a target branch address for the executed branch instruction;g. comparing said actual address generated by said execution unit with said branch location stored in said branch prediction memory and generating a misprediction signal if said actual address is not equal to said branch location;h. comparing the executed target branch address with the predicted branch address stored in said branch prediction memory and generating a misprediction signal if the executed target branch address is not equal to the predicted target branch address;and i. updating the successor valid bit and instruction fetch information for said instruction block in response to said misprediction signal.
  2. 4
    An apparatus comprising:a. first means for storing a plurality of instruction blocks, each of said instruction blocks comprising a plurality of instructions and instruction fetch information, wherein said instruction fetch information comprises an address tag, a branch block index and a successor index that includes a successor valid bit;b. second means for generating and supplying a fetch program counter value to said first means in order to prefetch one of said plurality of instruction blocks stored in said first means;c. third means for determining whether said successor valid bit of said prefetched instruction block is set to a predetermined condition which indicates that a branch instruction within said prefetched instruction block is predicted as taken;d. fourth means for incrementing said fetch program counter and supplying the incremented fetch program counter to said first means to prefetch a succeeding instruction block if said successor valid bit is not set to said predetermined condition;e. fifth means for generating a branch location address and a predicted target branch address if said successor valid bit is set to said predetermined condition;f. sixth means for storing said predicted target branch address and said branch location address;g. seventh means for executing said branch instruction and generating an actual branch address and a target branch address for the executed branch instruction;h. eighth means for comparing said actual address generated by said seventh means with said branch location stored in said sixth means and for comparing the executed target branch address with the predicted branch address stored in said branch prediction memory and generating a misprediction signal based on the result of said comparisons;and i. ninth means for updating the successor valid bit and instruction fetch information for said instruction block in response to said misprediction signal.
  3. 7
    An apparatus comprising a bus interface unit, an instruction cache memory coupled to said bus interface unit and configured to receive a plurality of instruction blocks, each of said instruction blocks comprising a plurality of instructions and instruction fetch information, wherein said instruction fetch information comprises an address tag, a branch block index and a successor index that includes a successor valid bit;a branch prediction memory coupled to said instruction cache memory;an instruction decoder coupled to said instruction branch memory;a processing unit including a branch execution unit coupled to said instruction decoder and a register file.