JP2008217687A - Branch prediction device and branch prediction method using local branch history - Google Patents
Branch prediction device and branch prediction method using local branch history Download PDFInfo
- Publication number
- JP2008217687A JP2008217687A JP2007057520A JP2007057520A JP2008217687A JP 2008217687 A JP2008217687 A JP 2008217687A JP 2007057520 A JP2007057520 A JP 2007057520A JP 2007057520 A JP2007057520 A JP 2007057520A JP 2008217687 A JP2008217687 A JP 2008217687A
- Authority
- JP
- Japan
- Prior art keywords
- branch
- branch prediction
- history
- local
- prediction result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、ローカル分岐履歴を用いた分岐予測装置及び分岐予測方法に関する。 The present invention relates to a branch prediction apparatus and a branch prediction method using a local branch history.
これまでに、ローカル分岐履歴を用いて動的分岐予測を行う装置が多数提案されている。図4は、そのようなローカル分岐履歴を用いる従来の動的分岐予測装置の構成を示すブロック図である。 So far, many devices for performing dynamic branch prediction using local branch history have been proposed. FIG. 4 is a block diagram showing a configuration of a conventional dynamic branch prediction apparatus using such a local branch history.
図4に示すように、従来の動的分岐予測装置200は、ローカル分岐履歴テーブル202と、インデックス計算回路203と、パターン履歴テーブル204と、分岐予測結果演算回路205と、から構成されている。
As shown in FIG. 4, the conventional dynamic
ローカル分岐履歴テーブル202は、各分岐命令に関するローカル分岐履歴を保持している。 The local branch history table 202 holds a local branch history regarding each branch instruction.
インデックス計算回路203は、分岐命令アドレス201と、ローカル分岐履歴テーブル202から読み出したローカル分岐履歴とから、インデックスを計算する。
The index calculation circuit 203 calculates an index from the
ターン履歴テーブル204は、インデックス計算回路203が計算したインデックスを用いて、予測結果を求める。 The turn history table 204 obtains a prediction result using the index calculated by the index calculation circuit 203.
分岐予測結果演算回路205は、パターン履歴テーブル204の出力の総和を計算し、その総和を分岐予測結果206として出力する。
The branch prediction result calculation circuit 205 calculates the sum of the outputs of the pattern history table 204 and outputs the sum as a
このように、従来の動的分岐予測装置200においては、分岐予測結果206は単一のパターン履歴テーブル204を用いて計算されていた。
しかしながら、従来のローカル分岐履歴を用いた動的分岐予測装置200には次のような課題があった。
However, the conventional dynamic
第1の課題は、ローカル分岐履歴テーブル202とパターン履歴テーブル204との二つのテーブルにアクセスする必要があるため、十分に短い時間で分岐予測結果206を生成することができないという点である。
The first problem is that the
第2の課題は、単一のパターン履歴テーブル204を用いて分岐予測を行うため、十分に高度な分岐予測結果206を生成することができないという点である。
The second problem is that branch prediction is performed using a single pattern history table 204, so that a sufficiently advanced
本発明は、以上のような従来の動的分岐予測装置200における問題点に鑑みてなされたものであり、十分に短い時間で、より高精度な分岐予測結果を生成することができる動的分岐予測装置及び動的分岐予測方法を提供することを目的とする。
The present invention has been made in view of the problems in the conventional dynamic
上記の目的を達成するため、本発明は、各分岐命令に関するローカル分岐履歴を保持するローカル分岐履歴テーブルと、実行完了分岐命令アドレスと、前記ローカル分岐履歴テーブルから読み出したローカル分岐履歴とから、インデックスをそれぞれ計算する少なくとも二つのインデックス計算回路と、前記インデックス計算回路が計算した前記インデックスを用いて、予測結果を求める少なくとも一つのパターン履歴テーブルと、前記パターン履歴テーブルの出力の総和を計算し、その総和を分岐予測結果として出力する分岐予測結果演算回路と、前記分岐予測結果を記憶する分岐予測キャッシュメモリと、を備える動的分岐予測装置を提供する。 To achieve the above object, the present invention provides an index based on a local branch history table that holds a local branch history for each branch instruction, an execution completion branch instruction address, and a local branch history read from the local branch history table. Using at least two index calculation circuits for calculating each of the above, the index calculated by the index calculation circuit, at least one pattern history table for obtaining a prediction result, and calculating the sum of the outputs of the pattern history table, There is provided a dynamic branch prediction apparatus comprising a branch prediction result calculation circuit that outputs a sum as a branch prediction result, and a branch prediction cache memory that stores the branch prediction result.
本発明に係る動的分岐予測装置は、前記インデックス計算回路と同数のパターン履歴テーブルを備えることができる。この場合には、前記パターン履歴テーブルの各々は前記インデックス計算回路の各々と対応しており、前記パターン履歴テーブルの各々は、対応する前記インデックス計算回路が計算した前記インデックスを用いて、独立に各々の予測結果を求めるものであることが好ましい。 The dynamic branch prediction apparatus according to the present invention can include the same number of pattern history tables as the index calculation circuit. In this case, each of the pattern history tables corresponds to each of the index calculation circuits, and each of the pattern history tables independently uses the index calculated by the corresponding index calculation circuit. It is preferable that the prediction result is obtained.
前記インデックス計算回路はそれぞれ異なる分岐履歴長を利用するものであることが好ましい。 The index calculation circuits preferably use different branch history lengths.
前記分岐履歴長は、例えば、次式により表される。 The branch history length is represented by the following equation, for example.
L(j)=L(1)・α(j−1)
L(j):j番目のインデックス計算回路の分岐履歴長
L(1):1を超える定数
α:1を超える定数
前記分岐予測結果は前記実行完了分岐命令アドレスをキーとして前記分岐予測キャッシュメモリに記憶されるものであることが好ましい。
L (j) = L (1) · α (j−1)
L (j): Branch history length of the j-th index calculation circuit L (1): Constant exceeding 1: Constant exceeding α: 1 The branch prediction result is stored in the branch prediction cache memory using the execution completion branch instruction address as a key. Preferably it is stored.
前記分岐予測結果は予測対象分岐命令アドレスをキーとして前記分岐予測キャッシュメモリから読み出されることが好ましい。 The branch prediction result is preferably read from the branch prediction cache memory using a prediction target branch instruction address as a key.
前記ローカル分岐履歴テーブル及び前記パターン履歴テーブルの内容は、実行完了した分岐命令の実行結果によって、更新されることが好ましい。 The contents of the local branch history table and the pattern history table are preferably updated according to the execution result of the branch instruction that has been executed.
本発明は、さらに、各分岐命令に関するローカル分岐履歴を保持するローカル分岐履歴テーブルと、実行完了分岐命令アドレスと、前記ローカル分岐履歴テーブルから読み出した任意のローカル分岐履歴とから、インデックスを計算するとともに、前記インデックスを用いて、分岐予測結果を求める分岐予測器と、前記分岐予測結果を記憶する分岐予測キャッシュメモリと、を備える動的分岐予測装置を提供する。 The present invention further calculates an index from a local branch history table holding a local branch history for each branch instruction, an execution completion branch instruction address, and an arbitrary local branch history read from the local branch history table. A dynamic branch prediction apparatus comprising: a branch predictor that obtains a branch prediction result using the index; and a branch prediction cache memory that stores the branch prediction result.
前記分岐予測キャッシュメモリは、例えば、1リード1ライトのSRAMから構成することができる。 The branch prediction cache memory can be composed of, for example, a 1-read 1-write SRAM.
本発明は、さらに、インデックスをそれぞれ計算する少なくとも二つのインデックス計算回路において、実行完了分岐命令アドレスと、各分岐命令に関するローカル分岐履歴とから、インデックスをそれぞれ計算する第一の過程と、前記第一の過程において計算された前記インデックスの各々を用いて、相互に独立に各々の予測結果を求める第二の過程と、前記第二の過程における出力の総和を計算し、その総和を分岐予測結果として出力する第三の過程と、前記第三の過程において出力された前記分岐予測結果を記憶する第四の過程と、を備える動的分岐予測方法を提供する。 The present invention further includes a first step of calculating an index from an execution completion branch instruction address and a local branch history for each branch instruction in at least two index calculation circuits for calculating the index, respectively, Using each of the indexes calculated in the process of (2), a second process for obtaining each prediction result independently of each other, a sum of outputs in the second process, and calculating the sum as a branch prediction result A dynamic branch prediction method comprising: a third process for outputting; and a fourth process for storing the branch prediction result output in the third process.
本発明は、さらに、動的分岐予測方法をコンピュータに実行させるためのプログラムであって、前記プログラムが行う処理は、インデックスをそれぞれ計算する少なくとも二つのインデックス計算回路において、実行完了分岐命令アドレスと、各分岐命令に関するローカル分岐履歴とから、インデックスをそれぞれ計算する第一の処理と、前記第一の処理において計算された前記インデックスの各々を用いて、相互に独立に各々の予測結果を求める第二の処理と、前記第二の処理における出力の総和を計算し、その総和を分岐予測結果として出力する第三の処理と、前記第三の処理において出力された前記分岐予測結果を記憶する第四の処理と、からなるものであるプログラムを提供する。 The present invention is further a program for causing a computer to execute the dynamic branch prediction method, and the processing performed by the program is executed by an execution completion branch instruction address in at least two index calculation circuits that respectively calculate indexes. A first process for calculating each index from the local branch history for each branch instruction, and a second for obtaining each prediction result independently of each other using each of the indexes calculated in the first process. A fourth process for calculating the sum of outputs in the second process, outputting the sum as a branch prediction result, and storing the branch prediction result output in the third process. And a program comprising the following processes.
本発明に係る動的分岐予測装置においては、分岐予測結果は予め計算され、計算された分岐予測結果は分岐予測キャッシュメモリに格納される。分岐予測結果は、予測対象分岐命令アドレスをキーとして、分岐予測キャッシュメモリから直接的に読み出される。このため、分岐予測のレイテンシを低減させることが可能である。 In the dynamic branch prediction apparatus according to the present invention, the branch prediction result is calculated in advance, and the calculated branch prediction result is stored in the branch prediction cache memory. The branch prediction result is read directly from the branch prediction cache memory using the prediction target branch instruction address as a key. For this reason, it is possible to reduce the latency of branch prediction.
本発明に係る動的分岐予測装置においては、複数のパターン履歴テーブルを用いて、分岐予測結果が計算される。このため、単一のパターン履歴テーブル204を用いて分岐予測結果を計算していた従来の動的分岐予測装置200(図4参照)と比較して、より高精度な分岐予測結果を生成できることが可能である。 In the dynamic branch prediction apparatus according to the present invention, a branch prediction result is calculated using a plurality of pattern history tables. For this reason, compared with the conventional dynamic branch prediction apparatus 200 (refer FIG. 4) which calculated the branch prediction result using the single pattern history table 204, a more highly accurate branch prediction result can be produced | generated. Is possible.
(第一の実施形態)
図1は、本発明の第一の実施形態に係る動的分岐予測装置100の構造を示すブロック図である。
(First embodiment)
FIG. 1 is a block diagram showing the structure of a dynamic
本実施形態に係る動的分岐予測装置100は、例えば、中央演算処理装置に搭載されて使用される。
The dynamic
本実施形態に係る動的分岐予測装置100は、ローカル分岐履歴テーブル102と、N(Nは2以上の正の整数)個のインデックス計算回路103と、各々がN個のインデックス計算回路103の各々に対応しているN個のパターン履歴テーブル104と、分岐予測結果演算回路105と、分岐予測キャッシュメモリ108と、から構成されている。
The dynamic
ローカル分岐履歴テーブル102は、実行完了分岐命令アドレス109をキーとして、各分岐命令に関連するローカル分岐履歴を保持している。
The local branch history table 102 holds a local branch history related to each branch instruction with the execution completion
実行完了分岐命令アドレス109は更新対象となる実行が完了した分岐命令のアドレスを表している。
The execution completion
N個のインデックス計算回路103の各々は、実行完了分岐命令アドレス109と、ローカル履歴テーブル104から読み出したローカル分岐履歴とから、N個のインデックス計算回路103の各々に対応するパターン履歴テーブル104に対するインデックスを計算する。
Each of the N index calculation circuits 103 is an index for the pattern history table 104 corresponding to each of the N index calculation circuits 103 from the execution completion
なお、各インデックス計算回路103はそれぞれ異なる分岐履歴長を利用しており、各インデックス計算回路103が利用する分岐履歴長は次式により表される。 Each index calculation circuit 103 uses a different branch history length, and the branch history length used by each index calculation circuit 103 is expressed by the following equation.
L(j)=L(1)・α(j−1)
L(j):j番目のインデックス計算回路の分岐履歴長
L(1):1を超える定数
α:1を超える定数
N個のパターン履歴テーブル104の各々は、それに対応するインデックス計算回路103が計算したインデックスを用いて、独立に予測結果を求める。求められた予測結果は分岐予測結果演算回路105に出力される。
L (j) = L (1) · α (j−1)
L (j): Branch history length of the jth index calculation circuit L (1): Constant exceeding 1 α: Constant exceeding 1: Each of the N pattern history tables 104 is calculated by the index calculation circuit 103 corresponding thereto. Using the index, the prediction result is obtained independently. The obtained prediction result is output to the branch prediction result calculation circuit 105.
分岐予測結果演算回路105は各パターン履歴テーブル104からの出力の総和をとり、その総和を分岐予測結果106として出力する。 The branch prediction result calculation circuit 105 takes the sum of the outputs from each pattern history table 104 and outputs the sum as a branch prediction result 106.
分岐予測結果演算回路105から出力された分岐予測結果106は分岐予測キャッシュメモリ108に格納される。 The branch prediction result 106 output from the branch prediction result calculation circuit 105 is stored in the branch prediction cache memory 108.
図2は、本実施形態に係る動的分岐予測装置100を中央処理装置(CPU)を用いて構成した場合の一例を示すブロック図である。
FIG. 2 is a block diagram showing an example when the dynamic
動的分岐予測装置100は、中央処理装置(CPU)120と、第1メモリー121と、第1メモリー122と、各種命令及びデータを中央処理装置120に入力するための入力インターフェイス123と、中央処理装置120により実行された処理の結果を出力する出力インターフェイス124と、中央処理装置120と他の構成要素とを接続するバス125と、から構成されている。
The dynamic
第1及び第2メモリー121、122の各々は、リード・オンリー・メモリー(ROM)、ランダム・アクセス・メモリー(RAM)またはICメモリーカードなどの半導体記憶装置、フレキシブルディスクなどの記憶媒体、ハードディスク、あるいは、光学磁気ディスクなどからなる。例えば、第1メモリー121はROMからなり、第2メモリー122はRAMからなる。
Each of the first and
第1メモリー121は中央処理装置120が実行するための各種の制御用プログラムその他の固定的なデータを格納している。第2メモリー122は様々なデータ及びパラメータを記憶しているとともに、中央処理装置120に対する作動領域を提供する、すなわち、中央処理装置120がプログラムを実行する上で一時的に必要とされるデータを格納している。中央処理装置120は第1メモリー121からプログラムを読み出し、そのプログラムを実行する。すなわち、中央処理装置120は第1メモリー121に格納されているプログラムに従って作動する。
The
図2に示されるように、中央処理装置120及び第1及び第2メモリー121、122は、機能的には、ローカル分岐履歴テーブル102と、インデックス計算回路103と、パターン履歴テーブル104と、分岐予測結果演算回路105と、分岐予測キャッシュメモリ108と、を構成している。
As shown in FIG. 2, the
ローカル分岐履歴テーブル102及びパターン履歴テーブル104の内容は、中央演算処理装置(図示せず)の分岐命令ユニット(図示せず)から得られた分岐命令実行結果107に基づいて更新される。分岐命令実行結果107は実行完了した分岐命令の実行結果を表す。ローカル分岐履歴テーブル102及びパターン履歴テーブル104の更新された内容を用いることにより、各パターン履歴テーブル104は、次回の分岐予測結果を計算する。
The contents of the local branch history table 102 and the pattern history table 104 are updated based on a branch
各パターン履歴テーブル104において計算された分岐予測結果は分岐予測結果演算回路105において全て加算される。この加算結果が分岐予測結果として分岐予測キャッシュメモリ108に記憶される。 The branch prediction results calculated in each pattern history table 104 are all added in the branch prediction result calculation circuit 105. This addition result is stored in the branch prediction cache memory 108 as a branch prediction result.
分岐予測キャッシュメモリ108は、分岐予測結果演算回路105において計算された分岐予測結果の総和を、実行完了分岐命令アドレス109をキーとして格納する。
The branch prediction cache memory 108 stores the sum of the branch prediction results calculated by the branch prediction result calculation circuit 105 using the execution completion
また、分岐予測キャッシュメモリ108から分岐予測結果を読み出す際には、予測対象分岐命令アドレス101をキーとして、分岐予測結果が分岐予測キャッシュメモリ108から読み出される。予測対象分岐命令アドレス101は予測対象となる分岐命令のアドレスを表す。
When the branch prediction result is read from the branch prediction cache memory 108, the branch prediction result is read from the branch prediction cache memory 108 using the prediction target
例えば、分岐予測キャッシュメモリ108は1リード1ライトのSRAM(Static Random Access Memory)から構成することができる。 For example, the branch prediction cache memory 108 can be composed of a 1-read 1-write SRAM (Static Random Access Memory).
以下、本実施形態に係る動的分岐予測装置100の動作、すなわち、予測手順及びデータの更新手順を説明する。
Hereinafter, an operation of the dynamic
まず、予測手順に関して説明する。 First, the prediction procedure will be described.
本実施形態に係る動的分岐予測装置100が搭載されている中央演算処理装置において、分岐命令がメモリからフェッチされたときには、その分岐命令アドレス101をキーとして用いて、分岐予測キャッシュメモリ108から値を読み出す。
In the central processing unit in which the dynamic
その分岐予測キャッシュメモリ108から読み出された値が本実施形態に係る動的分岐予測装置100によって生成された分岐予測結果106となる。
The value read from the branch prediction cache memory 108 becomes the branch prediction result 106 generated by the dynamic
次に、更新手順に関して説明する。 Next, the update procedure will be described.
まず、各パターン履歴テーブル104を更新する必要があるか否かを以下の式(1)を用いて計算する。 First, whether or not each pattern history table 104 needs to be updated is calculated using the following equation (1).
予測値×X<θ (1)
予測値:予測時に生成された予測値
X:分岐命令実行結果107がTakenである場合には1、分岐命令実行結果107がTakenではない場合には−1
θ:閾値
(予測値×X)の値がθよりも小さい場合には、すなわち、式(1)が成立する場合には、各パターン履歴テーブル104を更新する必要はないものと判定される。
Predicted value × X <θ (1)
Predicted value: predicted value generated at the time of prediction X: 1 when the branch
θ: When the value of the threshold value (predicted value × X) is smaller than θ, that is, when Expression (1) is satisfied, it is determined that there is no need to update each pattern history table 104.
逆に、(予測値×X)の値がθよりも小さくない場合には、すなわち、式(1)が成立しない場合には、各パターン履歴テーブル104を更新する必要があるものと判定される。 Conversely, if the value of (predicted value × X) is not smaller than θ, that is, if equation (1) is not satisfied, it is determined that each pattern history table 104 needs to be updated. .
各パターン履歴テーブル104を更新する必要があるものと判定された場合、本実施形態に係る動的分岐予測装置100が搭載された中央演算処理装置において、分岐命令の実行が完了したときに、その分岐命令実行結果107及び実行完了分岐命令アドレス109を用いて、各パターン履歴テーブル104が更新される。
When it is determined that each pattern history table 104 needs to be updated, when execution of the branch instruction is completed in the central processing unit equipped with the dynamic
具体的には、以下のようにして、各パターン履歴テーブル104が更新される。 Specifically, each pattern history table 104 is updated as follows.
まず、更新直前のローカル分岐履歴102において、実行完了分岐命令アドレス109を用いて、更新直前の分岐履歴を得ると同時に、そのエントリを1ビット分だけシフトさせる。このシフトによって空いた1ビットに分岐命令実行結果107を挿入する。
First, in the local branch history 102 immediately before the update, the branch history immediately before the update is obtained using the execution completion
次いで、各インデックス計算回路103を用いて、更新直前の分岐履歴と実行完了分岐命令アドレス109のハッシュ値(以下、「第1ハッシュ値」と呼ぶ)とを計算する。 Next, each index calculation circuit 103 is used to calculate the branch history immediately before the update and the hash value of the execution completion branch instruction address 109 (hereinafter referred to as “first hash value”).
同様に、各インデックス計算回路103を用いて、更新直後の分岐履歴と実行完了分岐命令アドレス109のハッシュ値(以下、「第2ハッシュ値」と呼ぶ)とを計算する。 Similarly, each index calculation circuit 103 is used to calculate the branch history immediately after the update and the hash value of the execution completion branch instruction address 109 (hereinafter referred to as “second hash value”).
式(1)の計算結果が真である場合には、パターン履歴テーブル104の第1ハッシュ値の示すエントリの値を予測方向が真ならば+1、真でないならば−1とする。 When the calculation result of Expression (1) is true, the value of the entry indicated by the first hash value in the pattern history table 104 is +1 if the prediction direction is true, and -1 if not true.
パターン履歴テーブル104の第2ハッシュ値の示すエントリから値を読み出す。 A value is read from the entry indicated by the second hash value in the pattern history table 104.
分岐予測結果計算回路105は、パターン履歴テーブル104の第2ハッシュ値の示すエントリから読み出された複数の整数値の総和を計算し、これを分岐予測値として出力する。 The branch prediction result calculation circuit 105 calculates the sum of a plurality of integer values read from the entry indicated by the second hash value in the pattern history table 104, and outputs this as a branch prediction value.
分岐予測結果計算回路105から出力された分岐予測値を分岐予測キャッシュメモリ108内のエントリであって、実行完了分岐命令アドレス109が指定するエントリに格納する。
The branch prediction value output from the branch prediction result calculation circuit 105 is stored in an entry in the branch prediction cache memory 108 that is designated by the execution completion
本実施形態に係る動的分岐予測装置100によれば、以下のような効果を得ることができる。
According to the dynamic
本実施形態に係る動的分岐予測装置100においては、分岐予測結果は予め計算され、計算された分岐予測結果は分岐予測キャッシュメモリ108に格納される。このため、第1の効果として、本実施形態に係る動的分岐予測装置100によれば、分岐予測のレイテンシを低減させることが可能である。
In the dynamic
本実施形態に係る動的分岐予測装置100においては、N(Nは2以上の正の整数)個のパターン履歴テーブル104を用いて、分岐予測結果が計算される。このため、第2の効果として、単一のパターン履歴テーブル204を用いて分岐予測結果を計算していた従来の動的分岐予測装置200(図4参照)と比較して、より高精度な分岐予測結果を生成できることが可能である。
In the dynamic
なお、本実施形態に係る動的分岐予測装置100を利用することにより、従来の動的分岐予測装置200(図4参照)と比較して、分岐予測の精度を8%以上向上させることができた。
Note that by using the dynamic
なお、本実施形態に係る動的分岐予測装置100は上記の構成に限定されるものではなく、種々の改変が可能である。
The dynamic
例えば、本実施形態に係る動的分岐予測装置100は、インデックス計算回路103と同数のN個のパターン履歴テーブル104を有するものとして構成されているが、N個のパターン履歴テーブル104に代えて、単一のパターン履歴テーブル104を有するものとして構成することも可能である。本実施形態に係る動的分岐予測装置100が単一のパターン履歴テーブル104を有する場合には、分岐予測結果は各インデックス計算回路103に対応して順番に単一のパターン履歴テーブル104から分岐予測結果塩山回路105に出力され、分岐予測結果演算回路105はそれらの出力の総和を演算する。
For example, the dynamic
また、複数のインデックス計算回路103は排他的論理和を利用したインデックス計算回路として構成することが可能であり、あるいは、単に複数のインデックス計算回路103を相互にビット連結などで連結することにより実現することもできる。 Further, the plurality of index calculation circuits 103 can be configured as an index calculation circuit using exclusive OR, or can be realized by simply connecting the plurality of index calculation circuits 103 to each other by bit connection or the like. You can also.
(第二の実施形態)
図3は、本発明の第二の実施形態に係る動的分岐予測装置300の構造を示すブロック図である。
(Second embodiment)
FIG. 3 is a block diagram showing the structure of the dynamic
本実施形態に係る動的分岐予測装置300は、第一の実施形態に係る動的分岐予測装置100と同様に、例えば、中央演算処理装置に搭載されて使用される。
The dynamic
本実施形態に係る動的分岐予測装置300は、ローカル分岐履歴テーブル302と、分岐予測器303と、分岐予測キャッシュメモリ308と、から構成されている。
The dynamic
ローカル分岐履歴テーブル302は第一の実施形態に係る動的分岐予測装置100におけるローカル分岐履歴テーブル102と同様の構成及び機能を有している。
The local branch history table 302 has the same configuration and function as the local branch history table 102 in the dynamic
また、分岐予測キャッシュメモリ308は第一の実施形態に係る動的分岐予測装置100における分岐予測キャッシュメモリ108と同様の構成及び機能を有している。
The branch prediction cache memory 308 has the same configuration and function as the branch prediction cache memory 108 in the dynamic
本実施形態に係る動的分岐予測装置300は、第一の実施形態に係る動的分岐予測装置100と比較して、N個のインデックス計算回路103とN個のパターン履歴テーブル104と分岐予測結果演算回路105とに代えて、分岐予測器303を備えている。
The dynamic
分岐予測器303は、ローカル分岐履歴テーブル302に格納されているローカル分岐履歴のうちの任意のローカル分岐履歴を用いて分岐予測を行う機能を有している。すなわち、分岐予測器303は、第一の実施形態に係る動的分岐予測装置100におけるN個のインデックス計算回路103とN個のパターン履歴テーブル104と分岐予測結果演算回路105と同等の機能を有している。
The
分岐予測器303が出力した分岐予測結果は実行完了分岐命令アドレス309をキーとして分岐予測キャッシュメモリ308に格納される。
The branch prediction result output from the
本実施形態に係る動的分岐予測装置300によれば、第一の実施形態に係る動的分岐予測装置100と同等の効果を得ることができるとともに、分岐予測の予測レイテンシをさらに低減することが可能である。
According to the dynamic
本発明に係る動的分岐予測装置は、例えば、高性能計算を要求される中央演算処理装置に搭載することができる。 The dynamic branch prediction apparatus according to the present invention can be mounted on, for example, a central processing unit that requires high performance calculation.
100 本発明の第一の実施形態に係る動的分岐予測装置
101 予測対象分岐命令アドレス
102 ローカル分岐履歴テーブル
103 インデックス計算回路
104 パターン履歴テーブル104
105 分岐予測結果演算回路
106 分岐予測結果
107 分岐命令実行結果
108 分岐予測キャッシュメモリ
109 実行完了分岐命令アドレス
120 中央処理装置(CPU)
121 第一メモリ
122 第二メモリ
123 入力インターフェイス
124 出力インターフェイス
300 本発明の第二の実施形態に係る動的分岐予測装置
302 ローカル分岐履歴テーブル
303 分岐予測器
308 分岐予測キャッシュメモリ
100 dynamic
105 Branch prediction result calculation circuit 106
121
Claims (11)
実行完了分岐命令アドレスと、前記ローカル分岐履歴テーブルから読み出したローカル分岐履歴とから、インデックスをそれぞれ計算する少なくとも二つのインデックス計算回路と、
前記インデックス計算回路が計算した前記インデックスを用いて、予測結果を求める少なくとも一つのパターン履歴テーブルと、
前記パターン履歴テーブルの出力の総和を計算し、その総和を分岐予測結果として出力する分岐予測結果演算回路と、
前記分岐予測結果を記憶する分岐予測キャッシュメモリと、
を備える動的分岐予測装置。 A local branch history table that holds the local branch history for each branch instruction;
At least two index calculation circuits each for calculating an index from an execution completion branch instruction address and a local branch history read from the local branch history table;
Using the index calculated by the index calculation circuit, at least one pattern history table for obtaining a prediction result;
A branch prediction result calculation circuit that calculates a sum of outputs of the pattern history table and outputs the sum as a branch prediction result;
A branch prediction cache memory for storing the branch prediction result;
A dynamic branch prediction apparatus comprising:
L(j)=L(1)・α(j−1)
L(j):j番目のインデックス計算回路の分岐履歴長
L(1):1を超える定数
α:1を超える定数 The dynamic branch prediction apparatus according to claim 3, wherein the branch history length is expressed by the following equation.
L (j) = L (1) · α (j−1)
L (j): Branch history length of the j-th index calculation circuit L (1): constant exceeding 1; constant exceeding α: 1
実行完了分岐命令アドレスと、前記ローカル分岐履歴テーブルから読み出した任意のローカル分岐履歴とから、インデックスを計算するとともに、前記インデックスを用いて、分岐予測結果を求める分岐予測器と、
前記分岐予測結果を記憶する分岐予測キャッシュメモリと、
を備える動的分岐予測装置。 A local branch history table that holds the local branch history for each branch instruction;
A branch predictor that calculates an index from an execution completion branch instruction address and an arbitrary local branch history read from the local branch history table and obtains a branch prediction result using the index;
A branch prediction cache memory for storing the branch prediction result;
A dynamic branch prediction apparatus comprising:
前記第一の過程において計算された前記インデックスの各々を用いて、相互に独立に各々の予測結果を求める第二の過程と、
前記第二の過程における出力の総和を計算し、その総和を分岐予測結果として出力する第三の過程と、
前記第三の過程において出力された前記分岐予測結果を記憶する第四の過程と、
を備える動的分岐予測方法。 A first step of calculating an index from each of the execution completion branch instruction address and the local branch history for each branch instruction in at least two index calculation circuits each calculating an index;
Using each of the indices calculated in the first step, a second step for obtaining each prediction result independently of each other;
Calculating a sum of outputs in the second step, and outputting the sum as a branch prediction result;
A fourth step of storing the branch prediction result output in the third step;
A dynamic branch prediction method comprising:
前記プログラムが行う処理は、
インデックスをそれぞれ計算する少なくとも二つのインデックス計算回路において、実行完了分岐命令アドレスと、各分岐命令に関するローカル分岐履歴とから、インデックスをそれぞれ計算する第一の処理と、
前記第一の処理において計算された前記インデックスの各々を用いて、相互に独立に各々の予測結果を求める第二の処理と、
前記第二の処理における出力の総和を計算し、その総和を分岐予測結果として出力する第三の処理と、
前記第三の処理において出力された前記分岐予測結果を記憶する第四の処理と、
からなるものであるプログラム。 A program for causing a computer to execute a dynamic branch prediction method,
The processing performed by the program is as follows:
In at least two index calculation circuits each calculating an index, a first process for calculating an index from an execution completion branch instruction address and a local branch history for each branch instruction,
A second process for obtaining each prediction result independently of each other using each of the indexes calculated in the first process;
Calculating a sum of outputs in the second process, and outputting the sum as a branch prediction result;
A fourth process for storing the branch prediction result output in the third process;
A program that consists of:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007057520A JP5266651B2 (en) | 2007-03-07 | 2007-03-07 | Branch prediction apparatus and branch prediction method using local branch history |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007057520A JP5266651B2 (en) | 2007-03-07 | 2007-03-07 | Branch prediction apparatus and branch prediction method using local branch history |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008217687A true JP2008217687A (en) | 2008-09-18 |
JP5266651B2 JP5266651B2 (en) | 2013-08-21 |
Family
ID=39837619
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007057520A Active JP5266651B2 (en) | 2007-03-07 | 2007-03-07 | Branch prediction apparatus and branch prediction method using local branch history |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5266651B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009037302A (en) * | 2007-07-31 | 2009-02-19 | Nec Corp | Branch prediction device, hybrid branch prediction device, processor, branch prediction method, and branch prediction control program |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006092112A (en) * | 2004-09-22 | 2006-04-06 | Yamaha Corp | Processor |
-
2007
- 2007-03-07 JP JP2007057520A patent/JP5266651B2/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006092112A (en) * | 2004-09-22 | 2006-04-06 | Yamaha Corp | Processor |
Non-Patent Citations (3)
Title |
---|
JPN6011051646; Andre Seznec: '"Analysis of the O-GEometric history length branch predictor"' Proceedings. 32nd International Symposium on Computer Architecture, 2005. ISCA '05. , 20050608, pages: 394 - 405, IEEE * |
JPN6012024881; 二ノ宮 康之 他: '「実行パスとローカル履歴を重み選択に利用したパーセプトロン分岐予測器」' 情報処理学会研究報告 2006-ARC-169(6), 20060801, 31頁〜36頁, 社団法人情報処理学会 * |
JPN7011003594; Andre Seznec: '"The O-GEHL branch predictor"' In The 1stJILP Championship Branch Prediction Competition (CBP-1), 2004. , 2004 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009037302A (en) * | 2007-07-31 | 2009-02-19 | Nec Corp | Branch prediction device, hybrid branch prediction device, processor, branch prediction method, and branch prediction control program |
US8892852B2 (en) | 2007-07-31 | 2014-11-18 | Nec Corporation | Branch prediction device and method that breaks accessing a pattern history table into multiple pipeline stages |
Also Published As
Publication number | Publication date |
---|---|
JP5266651B2 (en) | 2013-08-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5573134B2 (en) | Vector computer and instruction control method for vector computer | |
KR101105474B1 (en) | Instruction and logic for performing range detection | |
US8788797B2 (en) | Combined level 1 and level 2 branch predictor | |
KR100681199B1 (en) | Method and apparatus for interrupt handling in coarse grained array | |
US20130036426A1 (en) | Information processing device and task switching method | |
US8769244B2 (en) | SIMD parallel computer system, SIMD parallel computing method, and control program | |
JP2005100403A (en) | Branch prediction apparatus for reducing power consumption, and realizing method | |
JP2011048681A (en) | Processor | |
US11226798B2 (en) | Information processing device and information processing method | |
KR101666974B1 (en) | Prime number generation | |
JP2009122925A (en) | Data processing program, data processing method and data processing system | |
JP5979966B2 (en) | Circuit design support apparatus, circuit design support method, and program | |
JP5266651B2 (en) | Branch prediction apparatus and branch prediction method using local branch history | |
CN107003855B (en) | Atomic addition instruction with carry | |
CN113360158A (en) | Loop vectorization based on vector mask and vector count distance | |
JP2006127469A (en) | Arithmetic unit | |
JP6367689B2 (en) | Multiprocessor system suitable for programmable controllers | |
JP2010140306A (en) | Control system for boundary execution, control method for boundary execution, and control program for boundary execution | |
JPWO2018167940A1 (en) | INFORMATION PROCESSING APPARATUS, INFORMATION PROCESSING METHOD, AND INFORMATION PROCESSING PROGRAM | |
JP4546557B2 (en) | Arithmetic unit | |
JP2013210837A (en) | Arithmetic circuit and arithmetic method | |
JP2011141619A (en) | Microprocessor | |
JP2011090517A (en) | Test device of information processor, method of testing by test device of information processor, and program | |
JP2008310719A (en) | Block transfer instruction execution device and block transfer method | |
JP2005149412A (en) | Memory shuffling device, memory shuffling method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20080825 |
|
RD05 | Notification of revocation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7425 Effective date: 20090701 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100218 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20100702 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110921 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20111004 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120814 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20121015 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130409 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130422 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 5266651 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |