A method of operating a microprocessor having, a cache memory, a n instruction pipeline and a load target buffer, comprising the steps of:
- storing a plurality of entries in the load target buffer, each entry including an address tag, target data address prediction information and an indication of past prediction usefulness;
- receiving a data fetching instruction in the instruction pipeline, wherein the data fetching instruction has a corresponding memory address;
- upon a data fetching instruction reaching a first predetermined stage in the instruction pipeline comparing a memory address of the data fetching instructions with an address tag of each entry in the load target buffer;
- if the memory address of a data fetching instruction matches the address tag of an entry in the load target buffer:
- generating a prefetch request to a memory system at an address calculated from the target address prediction information and
- if the memory address of a data fetching instruction does not match the address tag of any entry in the load target buffer:
- identifying a group of entries in the load target buffer on the microprocessor, wherein the identified group is a group in which target data address prediction information corresponding to the received data fetching instruction may be stored based on the corresponding memory address;
- identifying a least recently used entry from the identified group of entries;
- in response to the indication of past prefetch usefulness falling below a predetermined threshold, overwriting the identified entry with target data address prediction information corresponding to the received data fetching instruction;
- and
- upon a data fetching instruction reaching a second predetermined state in the instruction pipeline:
- computing a target data address;
- fetching data from said memory system at said target data address in response to a data fetching instruction;
- detecting whether each data fetching instruction generates a cache hit or a cache miss;
- and
- updating the indication of past prefetch usefulness to indicate more usefulness upon a cache hit and to indicate less usefulness upon a cache miss.