Patent ID: 7613910

Claim:
An information processing apparatus comprising: a branch history register for holding, in order to predict a branch destination of a branch instruction, a correspondence table providing the correspondence between an address of said branch instruction and an address of the predicted branch destination of said branch instruction; a past branch history memory section for holding past branch directions of said branch instruction as a branch history; a branch direction predictor for predicting a branch direction of said branch instruction on the basis of said branch history held by said past branch history memory section; a branch history register updating section updating said correspondence table held by said branch history register on the basis of the branch direction predicted by said branch direction predictor; a selector for selecting one entry from all entries of said past branch history memory section if a plurality of the branch histories use all entries of said past branch history memory section when a branch history about a new branch instruction is being registered into said past branch history memory section; and a replacing section for replacing the branch history registered in said one entry selected by said selector with the branch history about said new branch instruction, said selector comprising a first selection function of selecting, as said one entry, if past branch directions exist in the past branch history memory section, an entry in which said branch history held by said past branch history memory section includes only branches taken and in which the number of branches taken included in said branch history held by said past branch history memory section is equal to or more than a predetermined number.