A
data processing apparatus is disclosed that comprises: a processor for
processing a
stream of decoded instructions; a prefetch unit for fetching instructions within a
stream of instructions from a memory prior to sending said
stream of instructions to said processor;
branch prediction logic operable to predict a behaviour of a
branch instruction; a
branch target cache for storing predetermined information about branch operations executed by said processor, said predetermined information comprising: identification data for an instruction specifying a branch operation and data relating to whether said branch is taken or not; wherein said
data processing apparatus is operable to access said branch target cache and to determine if there is data corresponding to instructions within said stream of instructions stored within said branch target cache and if there is to output said data; said
data processing apparatus further comprising: a
data store operable to store data indicative of a behaviour of a branch instruction; and said data
processing apparatus is operable over a period of time to access predetermined information corresponding to more instructions within said branch target cache than instructions it prefetches from said memory such that said accesses to said branch target cache develop an advance in said
instruction stream with respect to accesses to said memory; and said prefetch unit is operable to access said
data store and to determine if there is data corresponding to an instruction within said
data store that indicates that said instruction specifies a branch operation that will be taken and will cause a change in instruction flow.