Patent ID: 7454602

Claim:
A method for updating global branch history (GBH) information in a pipelined instruction processing system, said method comprising: providing a branch history table having a plurality of entries, wherein each entry associates a branch instruction with a branch prediction value; providing a bifurcated GBH buffer that contains GBH information that is used to index into said branch history table to obtain a branch prediction signal, said bifurcated GBH buffer comprising: a front-end GBH buffer containing GBH bits for indexing into said branch history table, said front-end GBH buffer coupled to an input side of an instruction processing pipeline; and a back-end GBH buffer containing GBH bits for indexing into said branch history table, said back-end GBH buffer coupled to an output side of the instruction processing pipeline; providing a fetch group pattern counter that counts the number of taken branch instructions within a single fetch group; providing a taken-branch flag that indicates whether a branch has been taken in a single fetch group; responsive to a next fetch group of instructions being fetched from an instruction cache, initializing said front-end GBH buffer by shifting a fixed number of GBH bits into said front-end GBH buffer, wherein said fixed number is independent of the number of branch instructions within said next fetch group; in further response to fetching said next fetch group, updating said back-end GBH buffer by performing the following steps: responsive to determining that an instruction is a first instruction of said next fetch group: determining whether or not said taken-branch flag is set to true; responsive to determining that said taken-branch flag is set to true, shifting the bits in said fetch group pattern counter into said back-end GBH buffer; responsive to determining that said taken-branch flag is set to false, shifting a not-taken pattern into said back-end GBH buffer; and responsive to either one of said shifting said bits in said fetch group pattern counter into said back-end GBH buffer step or said shifting said not-taken pattern into said back-end GBH buffer step, setting said fetch group pattern counter to zero and setting said taken-branch flag to false; if a fetched instruction is a taken branch, setting the taken-branch flag to true; and if said fetched instruction is a branch instruction, incrementing said fetch group pattern counter; and using the updated GBH bits in back-end GBH buffer to update the front-end GBH buffer.