A mechanism is described that predicts the usefulness of a prefetching
instruction during the instruction's decode cycle. Prefetching
instructions that are predicted as useful (prefetch useful data) are sent
to an execution unit of the processor for execution, while instructions
that are predicted as not useful are discarded. The prediction regarding
the usefulness of a prefetching instructions is performed utilizing a
branch prediction mask contained in the branch history mechanism. This
mask is compared to information contained in the prefetching instruction
that records the branch path between the prefetching instruction and
actual use of the data. Both instructions and data can be prefetched
using this mechanism.