Concurrently fetching instructions for multiple decode clusters
In one embodiment, an apparatus comprises: a branch prediction circuit to predict whether a branch is to be taken; a fetch circuit, in a single fetch cycle, to send a first portion of a fetch region of instructions to a first decode cluster and send a second portion of the fetch region to the second decode cluster; the first decode cluster comprising a first plurality of decode circuits to decode one or more instructions in the first portion of the fetch region; and the second decode cluster comprising a second plurality of decode circuits to decode one or more other instructions in the second portion of the fetch region. Other embodiments are described and claimed.
1 . An apparatus comprising:
a branch prediction circuit to predict whether a branch is to be taken;
a fetch circuit coupled to the branch prediction circuit, wherein the fetch circuit, in a single fetch cycle, is to send a first portion of a fetch region of instructions to a first decode cluster and send a second portion of the fetch region to a second decode cluster when the fetch region comprises multiple predictions;
the first decode cluster coupled to the fetch circuit, the first decode cluster comprising a first plurality of decode circuits to decode one or more instructions in the first portion of the fetch region; and
the second decode cluster coupled to the fetch circuit, the second decode cluster comprising a second plurality of decode circuits to decode one or more other instructions in the second portion of the fetch region.
2 . The apparatus of claim 1 , wherein the fetch region comprises a first branch and a second branch.
3 . The apparatus of claim 1 , further comprising a first branch prediction queue coupled to the first decode cluster and a second branch prediction queue coupled to the second decode cluster.
4 . The apparatus of claim 3 , wherein:
the first portion of the fetch region comprises a start of the fetch region as a start point and an end of a first branch instruction comprising the first branch as an endpoint; and
the second portion of the fetch region comprises a start of a first branch target of the first branch.
5 . The apparatus of claim 1 , wherein the branch prediction circuit comprises memory to store a branch target buffer, the branch target buffer to store a plurality of entries, wherein each entry comprises a first field to store a branch target of a branch and a second field to store a double prediction indicator to indicate whether the branch is associated with a fetch region of instructions having a double prediction.
6 . The apparatus of claim 5 , wherein the branch prediction circuit is to allocate a first entry into the branch target buffer with the double prediction indicator of the second field set to indicate whether the branch is associated with a fetch region of instructions having a double prediction.
7 . The apparatus of claim 6 , wherein the branch prediction circuit is to set the double prediction indicator of the second field based at least in part on one or more characteristics of the branch.
8 . The apparatus of claim 7 , wherein the one or more characteristics comprise a distance between the branch and the branch target.
9 . The apparatus of claim 8 , wherein if the distance exceeds a threshold distance, the branch prediction circuit is to store in the second field a single prediction indicator to indicate that the branch is not associated with a fetch region of instructions having the double prediction.
10 . The apparatus of claim 1 , further comprising an allocation circuit coupled to the first decode cluster and the second decode cluster, wherein the first decode cluster and the second decode cluster are to decode instructions out of order and the allocation circuit is to reorder the decoded instructions.
11 . A processor comprising:
a branch prediction circuit to identify a first branch and a second branch within a fetch region of code, wherein when the fetch region comprises a target of the first branch, the branch prediction circuit is to identify a double prediction in the fetch region;
a fetch circuit coupled to the branch prediction circuit, wherein in response to the double prediction identification, the fetch circuit, in a single fetch cycle, is to send a first portion of the fetch region to a first decode cluster and send a second portion of the fetch region to a second decode cluster;
the first decode cluster coupled to the fetch circuit, the first decode cluster comprising a first plurality of decode circuits to decode one or more instructions in the first portion of the fetch region; and
the second decode cluster coupled to the fetch circuit, the second decode cluster comprising a second plurality of decode circuits to decode one or more other instructions in the second portion of the fetch region concurrently with the first decode cluster decoding of the one or more instructions in the first portion of the fetch region.
12 . The processor of claim 11 , further comprising an allocation circuit coupled to the first decode cluster and the second decode cluster, wherein the allocation circuit is to reorder at least some of the decoded one or more instructions in the first portion of the fetch region and the one or more other instructions in the second portion of the fetch region.
13 . The processor of claim 11 , wherein the branch prediction circuit comprises memory to store a branch target buffer, the branch target buffer to store a plurality of entries, each of the plurality of entries associated with a branch, wherein each entry comprises a first field to store a target and a second field to store a double prediction indicator to indicate whether the branch is associated with the double prediction.
14 . The processor of claim 13 , wherein the fetch circuit is to send the first portion of the fetch region to the first decode cluster and send the second portion of the fetch region to the second decode cluster when the first portion of the fetch region comprises a start of the fetch region and the first branch and the second portion of the fetch region comprises the target of the first branch.