A microprocessor with a write queue for a branch target address cache
(BTAC) is disclosed. The BTAC is read in parallel with an instruction
cache in order to predict a target address of a branch instruction in the
accessed cache line. In one embodiment, the BTAC is single-ported; hence,
the single port must be shared for reading and writing. When the BTAC
needs updating, such as when a branch target address is resolved, the
microprocessor stores the branch target address and related information
in the write queue. Thus, the write queue potentially enables updating of
the BTAC to be delayed until the BTAC is not being read, such as when the
instruction cache is idle, a misprediction by the BTAC is being
corrected, or a prediction by the BTAC is being overridden. If the write
queue becomes full, then it updates the BTAC anyway.