JP5387819B2 - Reliability estimation circuit and method for branch prediction - Google Patents
Reliability estimation circuit and method for branch prediction Download PDFInfo
- Publication number
- JP5387819B2 JP5387819B2 JP2008333049A JP2008333049A JP5387819B2 JP 5387819 B2 JP5387819 B2 JP 5387819B2 JP 2008333049 A JP2008333049 A JP 2008333049A JP 2008333049 A JP2008333049 A JP 2008333049A JP 5387819 B2 JP5387819 B2 JP 5387819B2
- Authority
- JP
- Japan
- Prior art keywords
- reliability
- prediction
- branch
- instruction
- allowable threshold
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Advance Control (AREA)
Description
本発明は、プロセッサ、特にパイプライン構造を持ち、かつ投機処理を行うプロセッサにおける分岐予測の信頼度見積もり回路及びその方法に関する。 The present invention relates to a branch prediction reliability estimation circuit and a method thereof in a processor, particularly a processor having a pipeline structure and performing speculative processing.
従来、プロセッサは命令レベル並列性を高めることで処理能力を向上させてきた。プロセッサのパイプライン構造は命令レベル並列性を得る為の方法の1つである。しかし、条件分岐命令は命令が実行させるまで後続の命令が不明なため、パイプライン構造による性能向上の妨げとなる。この問題を解決するために必要となるのが分岐予測器である。分岐予測器は条件分岐命令の分岐方向を予測し、プロセッサは分岐予測器の予測を元に投機的に後続の命令列を処理する。分岐予測器による予測が成功した場合、プロセッサは条件分岐命令による性能低下の影響を受けない。 Traditionally, processors have improved processing power by increasing instruction level parallelism. The pipeline structure of the processor is one way to obtain instruction level parallelism. However, the conditional branch instruction does not know the subsequent instruction until the instruction is executed, which hinders performance improvement by the pipeline structure. A branch predictor is required to solve this problem. The branch predictor predicts the branch direction of the conditional branch instruction, and the processor speculatively processes subsequent instruction sequences based on the prediction of the branch predictor. When the prediction by the branch predictor is successful, the processor is not affected by the performance degradation caused by the conditional branch instruction.
しかし、分岐予測器が予測に失敗すると間違って投機実行された命令列は実行が中止され、消去される。間違った命令の投機実行ために消費された電力は無駄となり、プロセッサの電力効率は低下してしまう。 However, if the branch predictor fails in prediction, the instruction sequence erroneously speculatively executed is stopped and deleted. The power consumed for speculative execution of the wrong instruction is wasted, and the power efficiency of the processor is reduced.
これに対し、パイプラインゲーティングと呼ばれる方法は予測の信頼性が低い条件分岐命令の投機処理を停止させる。無駄な投機実行を削減することによりプロセッサの電力効率を改善する。ただし、予測に成功する条件分岐命令を信頼できないと判断してその後続命令の投機処理を行わない場合、投機処理を行った場合と比較してプロセッサの処理時間が延び、電力効率向上の効果は薄れてしまう。このように、パイプラインゲーティングの効果は予測の信頼性の判定に依存しており、より高精度に信頼度を見積もる方法が必要とされている。 On the other hand, a method called pipeline gating stops speculative processing of a conditional branch instruction with low reliability of prediction. Improve processor power efficiency by reducing wasteful speculative execution. However, if the conditional branch instruction that succeeds in prediction is determined to be unreliable and the speculative processing of the subsequent instruction is not performed, the processing time of the processor is increased compared to the case where the speculative processing is performed, and the effect of improving the power efficiency is It will fade. Thus, the effect of pipeline gating depends on the determination of the reliability of prediction, and a method for estimating the reliability with higher accuracy is required.
予測の信頼度を見積もる技術は、Jacobsen, Rotenberg, and Smith Confidence Estimator(JRS Estimator)と呼ばれる方法や、飽和型カウンタを持つ分岐予測器の内部状態を利用する方法で分岐予測の信頼度を見積もる方法が提案されている。 The technique for estimating the reliability of prediction is a method called Jacobsen, Rotenberg, and Smith Confidence Estimator (JRS Estimator), or a method of estimating the reliability of branch prediction by using the internal state of a branch predictor having a saturation counter. Has been proposed.
JRS Estimatorは、Correct/Incorrect Register History Table にnビットの1つないし複数の信頼度を記憶している。分岐予測が行われる時に1つの信頼度が選択され、Reduction Function と呼ばれる装置で選択された信頼度から信頼性の有無を判断する。非特許文献1では、複数の信頼度見積もり方法が試されているが、中でもリセッティングカウンタを用いた方法が最も高い見積もり精度を示すとしている。 The JRS Estimator stores n-bit reliability or reliability in the Correct / Incorrect Register History Table. When branch prediction is performed, one reliability is selected, and the presence or absence of reliability is determined from the reliability selected by a device called a reduction function. In Non-Patent Document 1, a plurality of reliability estimation methods have been tried. Among them, a method using a resetting counter shows the highest estimation accuracy.
リセッティングカウンタを用いた方法による信頼度の更新は、分岐予測器が予測に成功した場合に信頼度の値に1を加算し、予測に失敗した場合に信頼度の値を0に再設定する。 In the reliability update by the method using the reset counter, 1 is added to the reliability value when the branch predictor succeeds in prediction, and the reliability value is reset to 0 when the prediction fails.
信頼性は信頼度が閾値以上であれば信頼性がある、閾値未満であれば信頼性が無いと判定する。ただし、予測に失敗すると信頼度は最小値である0に再設定されるため、信頼度を閾値より大きい値に更新することは実装上の問題であり、信頼性を見積もる精度に影響を与えない。 The reliability is determined to be reliable if the reliability is equal to or higher than a threshold value, and not reliable if the reliability is less than the threshold value. However, if the prediction fails, the reliability is reset to the minimum value of 0. Therefore, updating the reliability to a value larger than the threshold is an implementation problem and does not affect the accuracy of estimating the reliability. .
図2はリセッティングカウンタを用いた方法による信頼度更新手段と信頼性判定手段の一例である。状態名である2進数は信頼度の値を表す。図2では7(111)、すなわち信頼度が最大値の時のみ、予測は信頼できると判定される。予測に成功した場合は信頼度に1が加算され、予測に失敗した場合は信頼度が0に再設定される。 FIG. 2 shows an example of reliability update means and reliability determination means by a method using a resetting counter. A binary number that is a state name represents a reliability value. In FIG. 2, it is determined that the prediction is reliable only when 7 (111), that is, when the reliability is the maximum value. If the prediction is successful, 1 is added to the reliability, and if the prediction fails, the reliability is reset to 0.
又、特許文献1には、飽和型カウンタを持つ分岐予測器を用いた方法が開示されているが、これは非特許文献1でリセッティングカウンタを用いた方法と比較された飽和型カウンタを用いた方法と原理は同じであり、信頼度の見積もり精度の点でリセッティングカウンタを用いた方法に劣る。
しかしながら、上記の関連する技術に係る発明は、信頼度の見積もり精度が低いという問題点がある。この問題点により、投機処理の誤停止を招き、プロセッサの処理速度を低下させてしまう。 However, the invention according to the related technique has a problem that the estimation accuracy of the reliability is low. Due to this problem, speculative processing is erroneously stopped and the processing speed of the processor is reduced.
その理由は、リセッティングカウンタを用いた方法が条件分岐命令の特異な振る舞いを許容できない点にある。リセッティングカウンタを用いた方法は、ある条件分岐命令に対する分岐予測が失敗すると信頼度は0に再設定される。このため、次にこの条件分岐命令に対する分岐予測が行われると予測は信頼できないと判定される。 The reason is that the method using the resetting counter cannot tolerate the specific behavior of the conditional branch instruction. In the method using the reset counter, the reliability is reset to 0 when the branch prediction for a certain conditional branch instruction fails. For this reason, when the next branch prediction for the conditional branch instruction is performed, it is determined that the prediction is not reliable.
しかし、プログラム内には一時的に特異な振る舞いをする条件分岐命令が多数存在する。例えば、プログラム内に数多く存在するループ処理は必ず最後にループを抜ける処理が必要となる。このループを抜ける処理はループを構築する条件分岐命令がループを行なう分岐方向とは逆の方向へ分岐することにより実現される。 However, there are many conditional branch instructions that temporarily behave in a program. For example, many loop processes existing in a program always require a process to exit the loop. The process of exiting the loop is realized by a conditional branch instruction for constructing the loop branching in a direction opposite to the branching direction in which the loop is performed.
このため、ループ処理は通常の分岐方向とは異なる、特異な分岐の振る舞いが起こると、リセッティングカウンタを用いた方法は信頼度を再設定する。しかし、この特異な振る舞いは一時的なものであり、予測は再び成功するようになる。予測に成功するにも関わらず、このループ処理を構成する条件分岐命令に対する予測が信頼を取り戻すには多くの信頼度の更新機会を要する。信頼性を取り戻すまでの間、プロセッサの投機処理が誤停止することでプロセッサの処理能力は低下する。 For this reason, in the loop processing, when a unique branching behavior different from the normal branching direction occurs, the method using the reset counter resets the reliability. However, this anomalous behavior is temporary and the prediction becomes successful again. Despite the success of the prediction, many prediction opportunities for reliability are required for the prediction of the conditional branch instructions constituting the loop processing to regain the trust. Until the reliability is restored, the speculative processing of the processor stops erroneously, so that the processing capacity of the processor decreases.
本発明は上記に鑑みてなされたものであり、関連技術に係る発明よりも高精度な分岐予測の信頼度見積もりを行なう分岐予測の信頼度見積もり回路及びその方法を提供することを目的とする。 The present invention has been made in view of the above, and an object of the present invention is to provide a branch prediction reliability estimation circuit and a method for performing branch prediction reliability estimation with higher accuracy than the related art.
上述の問題を解決するため、本発明に係る分岐予測の信頼度見積もり回路は、入力されたプログラムをパイプライン処理する命令処理パイプラインと、プログラム内に含まれる条件分岐命令の分岐方向を予測する分岐予測器と、前記条件分岐命令に対する予測の信頼性の有無に応じて命令の投機処理実行の可否を決めるパイプラインゲーティング回路と、を有するプロセッサにおける分岐予測の信頼度見積もり回路であって、前記条件分岐命令に対する予測の信頼度から該予測の信頼性の有無を判定する信頼性判定手段と、前記条件分岐命令に対する前記予測の前記信頼度を更新する信頼度更新手段と、前記信頼性の判定に用いる許容閾値を記憶する許容閾値記憶回路と、を備え、前記信頼性判定手段は、前記許容閾値記憶回路から入力された前記許容閾値と前記信頼度とを比較して前記信頼性の有無を判定し、前記信頼度更新手段は、前記信頼度の値を増減させることで更新を行い、前記予測に成功した場合に前記信頼度を増加させ、前記予測に失敗かつ前記信頼度が前記許容閾値よりも高い場合に前記信頼度を減少させ、前記予測に失敗かつ前記許容閾値以下の場合に前記信頼度を最も低い値に再設定することを特徴とする。 In order to solve the above-described problem, a branch prediction reliability estimation circuit according to the present invention predicts an instruction processing pipeline that pipelines an input program and a branch direction of a conditional branch instruction included in the program. A branch prediction reliability estimation circuit in a processor having a branch predictor and a pipeline gating circuit that determines whether or not to execute speculative processing according to the presence or absence of prediction reliability for the conditional branch instruction, Reliability determination means for determining the reliability of the prediction from the reliability of prediction for the conditional branch instruction; reliability update means for updating the reliability of the prediction for the conditional branch instruction; and And an allowable threshold value storage circuit for storing an allowable threshold value used for the determination, wherein the reliability determination means is input from the allowable threshold value storage circuit. Said comparison threshold allowance and with said reliability determining the presence or absence of the reliability, the reliability update unit performs update by increasing or decreasing the value of the reliability, the if successful the prediction Increase the reliability, decrease the reliability when the prediction fails and the reliability is higher than the allowable threshold, and reduce the reliability to the lowest value when the prediction fails and is less than or equal to the allowable threshold It is characterized by resetting .
上述の問題を解決するため、本発明に係る分岐予測の信頼度見積もり方法は、入力されたプログラムをパイプライン処理する命令処理パイプラインと、プログラム内に含まれる条件分岐命令の分岐方向を予測する分岐予測器と、前記条件分岐命令に対する予測の信頼性の有無に応じて命令の投機処理実行の可否を決めるパイプラインゲーティング回路と、を有するプロセッサにおける分岐予測の信頼度見積もり方法であって、前記条件分岐命令に対する予測の信頼度から該予測の信頼性の有無を判定する際に用いる許容閾値を記憶する許容閾値記憶手順と、前記信頼性の有無を判定する信頼性判定手順と、前記条件分岐命令に対する前記予測の前記信頼度を更新する信頼度更新手順と、を備え、前記信頼性判定手順は、前記許容閾値記憶手順から入力された前記許容閾値と前記信頼度とを比較して前記信頼性の有無を判定し、前記信頼度更新手順は、前記信頼度の値を増減させることで更新を行い、前記予測に成功した場合に前記信頼度を増加させ、前記予測に失敗かつ前記信頼度が前記許容閾値よりも高い場合に前記信頼度を減少させ、前記予測に失敗かつ前記許容閾値以下の場合に前記信頼度を最も低い値に再設定することを特徴とする。 In order to solve the above-described problem, a branch prediction reliability estimation method according to the present invention predicts an instruction processing pipeline that pipelines an input program and a branch direction of a conditional branch instruction included in the program. A branch prediction reliability estimation method in a processor having a branch predictor and a pipeline gating circuit that determines whether or not to execute speculative processing of an instruction according to the presence or absence of prediction reliability for the conditional branch instruction, An allowable threshold value storing procedure for storing an allowable threshold value used when determining the presence or absence of the reliability of the prediction from the reliability of the prediction for the conditional branch instruction; a reliability determination procedure for determining the presence or absence of the reliability; and the condition A reliability update procedure for updating the reliability of the prediction for a branch instruction, and the reliability determination procedure includes the allowable threshold value storage procedure. Determines the presence of the reliability as compared with the al entered the allowable threshold and the reliability, the reliability update procedure to update by increasing or decreasing the value of the reliability, successful the prediction The reliability is increased, the reliability is decreased when the prediction fails and the reliability is higher than the allowable threshold, and the reliability is decreased when the prediction fails and is equal to or lower than the allowable threshold. It is characterized by resetting to the lowest value .
本発明によれば、信頼性判定手段により、予測の一定の失敗を許容することで条件分岐命令の特異な分岐の振る舞いを許容し、正常な分岐の振る舞いに対しての予測の信頼性を正しく判定することができる。併せて、信頼度更新手段により、予測の失敗数が許容できない場合に信頼度を最も低い状態に再設定することで、信頼を一度失った条件分岐命令が短期間で信頼を取り戻すことを避けることにより、高精度な分岐予測の信頼度見積もりを行なう分岐予測の信頼度見積もり回路及びその方法を提供することができる。 According to the present invention, the reliability determination means allows a specific branching behavior of the conditional branch instruction by allowing a certain prediction failure, and corrects the prediction reliability for the normal branching behavior correctly. Can be determined. At the same time, by using the reliability update means, if the number of prediction failures is unacceptable, the reliability is reset to the lowest state, so that the conditional branch instruction that once lost the trust avoids regaining the trust in a short period of time. Accordingly, it is possible to provide a branch prediction reliability estimation circuit and a method thereof that perform highly accurate branch prediction reliability estimation.
[第1の実施の形態の構成]
図3を用いて本発明の第1の実施の形態を説明する。ここで、図3は、本発明の第1の実施の形態の構成を示すブロック図である。
[Configuration of First Embodiment]
A first embodiment of the present invention will be described with reference to FIG. Here, FIG. 3 is a block diagram showing the configuration of the first exemplary embodiment of the present invention.
図3によると、本発明の第1の実施の形態は、本発明の条件分岐命令に対する予測の信頼性を判定する手段と、条件分岐命令に対する予測の信頼度を更新する手段を有する信頼度見積もり回路10、信頼度記憶回路11、許容閾値記憶回路12、パイプラインゲーティング回路20、命令処理パイプライン30及び分岐予測器40を備える。
According to FIG. 3, the first embodiment of the present invention is a reliability estimation having means for determining the reliability of prediction for a conditional branch instruction of the present invention and means for updating the reliability of prediction for a conditional branch instruction. The
命令処理パイプライン30は、プロセッサに入力された命令列を処理する装置であり、信頼度見積もり回路10、信頼度記憶回路11、パイプラインゲーティング回路20及び分岐予測器40と接続されている。
The
命令処理パイプライン30は条件分岐命令の入力時に分岐予測器40と信頼度記憶回路11とに条件分岐命令のアドレスを出力する。又、命令処理パイプライン30は、条件分岐命令の実行が完了した際にこの条件分岐命令のアドレスと分岐結果とを分岐予測器40と信頼度見積もり回路10とに出力する。
The
分岐予測器40は、命令処理パイプライン30接続されており、分岐の予測を行い、その結果を命令処理パイプライン30に出力する。又、分岐予測器40は、条件分岐命令の分岐結果が入力された際に予測の更新を行なう。
The
信頼度記憶回路11は、命令処理パイプライン30と、信頼度見積もり回路10とに接続されており、入力された条件分岐命令のアドレスから信頼度を読み出し、信頼度見積もり回路10に出力する。又、信頼度記憶回路11は、信頼度見積もり回路10から条件分岐命令のアドレスと更新された信頼度とを受け取り記憶する。
The
信頼度見積もり回路10は、信頼度記憶回路11、許容閾値記憶回路12、パイプラインゲーティング回路20及び命令処理パイプライン30と接続されており、信頼度記憶回路11から信頼度が入力されると、許容閾値記憶回路12から入力された許容閾値と信頼度とを比較して信頼性の有無を判定し、判定結果をパイプラインゲーティング装置20に出力する。又、信頼度見積もり回路10は、命令処理パイプライン30から実行された条件分岐命令のアドレスと分岐結果が入力された際に許容閾値記憶回路12から入力された許容閾値とを用いて信頼度を更新し、信頼度記憶回路11に出力する。
The
許容閾値記憶回路12は、信頼度見積もり回路10での信頼性の判定に用いる許容閾値を記憶する。
The allowable threshold
パイプラインゲーティング回路20は、信頼度見積もり回路10及び命令処理パイプライン30と接続されており、信頼度見積もり回路10から入力された条件分岐命令の信頼性の情報と、命令処理パイプライン30から入力された実行された条件分岐命令との情報から命令処理パイプライン30による命令フェッチの停止と再開を制御する。
The
[第1の実施の形態の動作]
図1は信頼度見積もり回路10で行なわれる信頼度更新手段及び信頼性判定手段の一例である。状態名である2進数は信頼度の値を表す。図1の許容閾値は4(100)であり、信頼度見積もり回路10は、例えば許容閾値記憶回路12から入力された信頼度が4(100)の場合は信頼できると判定し、許容閾値記憶回路12から入力された信頼度が3(011)の時は信頼できないと判定する。
[Operation of First Embodiment]
FIG. 1 shows an example of reliability update means and reliability determination means performed by the
又、状態の更新を行なう時は、信頼度見積もり回路10は、例えば信頼度が5(101)で予測に成功した場合は信頼度を6(110)に更新して条件分岐命令のアドレスと共に許容閾値記憶回路12に出力し、信頼度が5(101)で予測に失敗した場合は信頼度を4(100)に更新して条件分岐命令のアドレスと共に許容閾値記憶回路12に出力し、信頼度が4(100)で予測に失敗した場合は信頼度を0(000)に再設定して条件分岐命令のアドレスと共に許容閾値記憶回路12に出力する。
When the state is updated, the
[他の実施の形態]
次に、本発明の第2の実施の形態について図面を参照して説明する。第1の実施の形態と同様の構成要素については図と同様の符号を付し、詳細な説明を省略する。ここで、図4は、第2の実施の形態の構成を示すブロック図である。
[Other embodiments]
Next, a second embodiment of the present invention will be described with reference to the drawings. The same components as those in the first embodiment are denoted by the same reference numerals as those in the drawing, and detailed description thereof is omitted. Here, FIG. 4 is a block diagram showing a configuration of the second embodiment.
図4を参照すると、第2の実施の形態は、第1の実施の形態の分岐予測器の代わりに分岐予測記憶回路41を備える。
Referring to FIG. 4, the second embodiment includes a branch
分岐予測記憶回路41は1つ又は複数のエントリを持つテーブルであり、1つのエントリは1ビットで構成される。前記エントリは、例えば1ならば分岐成立、0ならば分岐不成立というように分岐の予測の方向を記憶している。
The branch
分岐予測記憶回路41は信頼度見積もり回路10と、命令処理パイプライン30とに接続されており、命令処理パイプライン30から入力されたアドレスに応じて、読み出した分岐の予測を命令処理パイプライン30に出力する。
The branch
命令処理パイプライン30は信頼度見積もり回路10に実行が完了した条件分岐命令のアドレスを出力する。
The
信頼度見積もり回路10は第1の実施の形態における接続に加えて、分岐予測記憶回路41に接続されている。信頼度見積もり回路10は、条件分岐命令に対する予測の信頼度から予測の信頼性の有無を判定し、入力されたアドレスと分岐結果とから信頼度と分岐の予測の方向とを更新する。信頼度見積もり回路10は信頼度が0で、かつ予測に失敗した場合に分岐予測の方向を反転し分岐予測記憶回路41に記憶する。
The
すなわち、信頼度更新手段は、信頼度の値を増減させることで更新を行い、予測に成功した場合に信頼度を増加させ、予測に失敗かつ信頼度が許容閾値よりも高い場合に信頼度を減少させ、予測に失敗かつ許容閾値以下の場合に信頼度を最も低い値に設定する。 That is, the reliability update means updates the value by increasing or decreasing the reliability value, increases the reliability when the prediction is successful, and increases the reliability when the prediction fails and the reliability is higher than the allowable threshold. Decrease and set the reliability to the lowest value if prediction fails and is below the acceptable threshold.
信頼度を最も低い値に設定した後に予測を失敗したときは、分岐予測更新手段が分岐成立の場合から分岐不成立の場合又は分岐不成立の場合から分岐成立の場合にそれぞれ分岐の予測の方向を反転する。その後、信頼度更新手段は信頼度の値を増減させることで更新を行う。 When prediction fails after setting the reliability to the lowest value, the branch prediction update means reverses the direction of branch prediction when the branch is taken to when the branch is not taken, or when the branch is not taken and the branch is taken. To do. Thereafter, the reliability update means performs update by increasing or decreasing the value of reliability.
図6は第2の実施の形態における信頼度更新手段と信頼性判定手段の一例を示す図である。状態名は1ビットの分岐の予測の方向と3ビットの信頼度の値の組み合わせである。分岐の予測は分岐成立を1、分岐不成立を0で表している。分岐の予測は信頼度が0で、かつ予測に失敗した場合にのみ値が反転される。又、分岐の予測の値に応じて複数の前記許容閾値を使用する事も可能である。図6では、分岐成立と予測する場合の前記許容閾値を5(101)、分岐不成立と予測する場合の前記許容閾値を4(100)と設定している。 FIG. 6 is a diagram illustrating an example of the reliability update unit and the reliability determination unit in the second embodiment. The state name is a combination of a 1-bit branch prediction direction and a 3-bit reliability value. In the branch prediction, a branch establishment is represented by 1 and a branch failure is represented by 0. The branch prediction is inverted only when the reliability is 0 and the prediction fails. It is also possible to use a plurality of the allowable thresholds depending on the branch prediction value. In FIG. 6, the allowable threshold for predicting that a branch is taken is set to 5 (101), and the allowable threshold for predicting that a branch is not taken is set to 4 (100).
なお、分岐予測記憶回路41は信頼度記憶回路11と統合することができる。
The branch
次に、本発明の第3の実施の形態について図面を参照して説明する。第1の実施の形態と同様の構成要素については図と同様の符号を付し、詳細な説明を省略する。ここで、図5は、第3の実施の形態の構成を示すブロック図である。 Next, a third embodiment of the present invention will be described with reference to the drawings. Constituent elements similar to those in the first embodiment are denoted by the same reference numerals as those in the drawing, and detailed description thereof is omitted. Here, FIG. 5 is a block diagram showing a configuration of the third embodiment.
図5を参照すると、第1の実施の形態の構造に加えて、許容閾値更新回路13と温度計測回路50とが設けられている。
Referring to FIG. 5, in addition to the structure of the first embodiment, an allowable threshold
温度計測回路50の情報は接続されている許容閾値更新回路13に逐次送信されている。
Information of the
許容閾値更新回路13は温度が予め設定された温度閾値より高い場合に許容閾値記憶回路12から入力された前述の許容閾値の値を小さくし、許容閾値記憶回路12に出力する。なお、この温度閾値は複数でもよい。更新された許容閾値の値は信頼度見積もり回路10で使用される。
When the temperature is higher than a preset temperature threshold, the allowable
前述の許容閾値を小さくすると信頼性があると判定される条件分岐命令が増え、フェッチが停止する回数が増加する。消費する電力が減り、プロセッサの温度を下げる効果が期待できる。 If the allowable threshold value is decreased, the number of conditional branch instructions that are determined to be reliable increases, and the number of times fetching stops increases. Power consumption is reduced, and the effect of lowering the processor temperature can be expected.
温度計回路50から許容閾値更新回路13に入力される信号は他のプロセッサからの減速命令や、システム上で動作するオペレーティングシステムやソフトウェアからの減速命令で代用できることを当業者は容易に想像できる。
Those skilled in the art can easily imagine that the signal input from the
又、信頼性見積もりの精度を向上させることで、パイプラインゲーティングによる投機処理の誤停止を削減する。この結果、プロセッサの性能低下を抑制し、電力効率を向上させることができる。信頼性が低いと判定される条件分岐命令の集合に予測に成功する条件分岐命令の含有率を減らし、処理速度の低下を抑える。 In addition, by improving the accuracy of reliability estimation, it is possible to reduce erroneous stoppage of speculative processing due to pipeline gating. As a result, it is possible to suppress the performance degradation of the processor and improve the power efficiency. The content rate of conditional branch instructions that are successfully predicted in a set of conditional branch instructions that are determined to be low in reliability is reduced, and a reduction in processing speed is suppressed.
本発明は、プロセッサ、特にパイプライン構造を持ち、かつ投機処理を行うプロセッサに適用することでプロセッサの電力効率を改善することができる。 The present invention can improve the power efficiency of a processor by applying it to a processor, particularly a processor having a pipeline structure and performing speculative processing.
10 信頼度見積もり回路
11 信頼度記憶回路
12 許容閾値記憶回路
13 許容閾値更新回路
20 パイプラインゲーティング回路
30 命令処理パイプライン
40 分岐予測器
41 分岐予測記憶回路
50 温度計測回路
DESCRIPTION OF
Claims (14)
前記条件分岐命令に対する予測の信頼度から該予測の信頼性の有無を判定する信頼性判定手段と、
前記条件分岐命令に対する前記予測の前記信頼度を更新する信頼度更新手段と、
前記信頼性の判定に用いる許容閾値を記憶する許容閾値記憶回路と、
を備え、
前記信頼性判定手段は、前記許容閾値記憶回路から入力された前記許容閾値と前記信頼度とを比較して前記信頼性の有無を判定し、前記信頼度更新手段は、前記信頼度の値を増減させることで更新を行い、前記予測に成功した場合に前記信頼度を増加させ、前記予測に失敗かつ前記信頼度が前記許容閾値よりも高い場合に前記信頼度を減少させ、前記予測に失敗かつ前記許容閾値以下の場合に前記信頼度を最も低い値に再設定することを特徴とする分岐予測の信頼度見積もり回路。 An instruction processing pipeline that pipelines an input program, a branch predictor that predicts the branch direction of a conditional branch instruction included in the program, and an instruction depending on whether or not the prediction reliability of the conditional branch instruction is reliable A pipeline gating circuit that determines whether or not to execute speculative processing, and a branch prediction reliability estimation circuit in a processor having:
Reliability determination means for determining the reliability of the prediction from the reliability of the prediction for the conditional branch instruction;
Reliability update means for updating the reliability of the prediction for the conditional branch instruction;
An allowable threshold value storage circuit for storing an allowable threshold value used for the determination of the reliability;
With
The reliability determination means determines the presence or absence of the reliability by comparing the allowable threshold value input from the allowable threshold value storage circuit with the reliability, and the reliability update means determines the value of the reliability. Update by increasing / decreasing, increase the reliability when the prediction succeeds, decrease the reliability when the prediction fails and the reliability is higher than the allowable threshold, and fail the prediction And a reliability estimation circuit for branch prediction , wherein the reliability is reset to the lowest value when the value is equal to or less than the allowable threshold .
前記命令処理パイプラインから入力されるアドレスと前記条件分岐命令の分岐結果とから前記条件分岐命令の分岐の予測の方向を分岐成立から分岐不成立又は分岐不成立から分岐成立へ更新する分岐予測更新手段と、
前記条件分岐命令に対する前記予測の信頼度から該予測の信頼性の有無を判定する信頼性判定手段と、
前記条件分岐命令に対する前記予測の前記信頼度を更新する信頼度更新手段と、
前記信頼性の判定に用いる許容閾値を記憶する許容閾値記憶回路と、
を備え、
前記信頼性判定手段は、前記許容閾値記憶回路から入力された前記許容閾値と前記信頼度とを比較して前記信頼性の有無を判定し、前記信頼度更新手段は、分岐成立又は分岐不成立のそれぞれで、前記信頼度の値を増減させることで更新を行い、前記予測に成功した場合に前記信頼度を増加させ、前記予測に失敗かつ前記信頼度が前記許容閾値よりも高い場合に前記信頼度を減少させ、前記予測に失敗かつ前記許容閾値以下の場合に前記信頼度を最も低い値に再設定することを特徴とする分岐予測の信頼度見積もり回路。 Branch prediction in a processor having an instruction processing pipeline that pipelines an input program, and a pipeline gating circuit that determines whether or not to execute speculative processing of an instruction according to the presence or absence of prediction reliability for a conditional branch instruction The reliability estimation circuit of
Branch prediction update means for updating the branch prediction direction of the conditional branch instruction from branch establishment to branch failure or from branch failure to branch establishment from the address input from the instruction processing pipeline and the branch result of the conditional branch instruction; ,
Reliability determination means for determining the reliability of the prediction from the reliability of the prediction for the conditional branch instruction;
Reliability update means for updating the reliability of the prediction for the conditional branch instruction;
An allowable threshold value storage circuit for storing an allowable threshold value used for the determination of the reliability;
With
The reliability determination means determines the presence or absence of the reliability by comparing the allowable threshold value input from the allowable threshold value storage circuit with the reliability, and the reliability update means determines whether the branch is established or not established. Each is updated by increasing / decreasing the value of the reliability, the reliability is increased when the prediction is successful, and the reliability is failed when the prediction fails and the reliability is higher than the allowable threshold. A reliability estimation circuit for branch prediction , wherein the reliability is reset to the lowest value when the prediction fails and is less than or equal to the allowable threshold .
前記信頼度更新手段は、該反転後に、前記信頼度の値を増減させることで前記信頼度の更新を行うことを特徴とする請求項3に記載の分岐予測の信頼度見積もり回路。 Before Symbol branch prediction updating means, when said the prediction after resetting the confidence to lowest value fails, the case of the branch establishment of the branch taken from the case or if the branch is not taken of the branch not taken Invert each case,
4. The branch prediction reliability estimation circuit according to claim 3 , wherein the reliability update means updates the reliability by increasing or decreasing the reliability value after the inversion.
前記分岐命令の信頼性を判定する閾値の値を動的に変更する閾値更新手段と、
を備え、
前記閾値更新手段は、前記プロセッサの速度と消費電力を動的に制御することを特徴とする請求項1に記載の分岐予測の信頼度見積もり回路。 Measuring means for measuring changes in the external environment;
Threshold update means for dynamically changing a threshold value for determining the reliability of the branch instruction;
With
The branch prediction reliability estimation circuit according to claim 1, wherein the threshold update unit dynamically controls the speed and power consumption of the processor.
前記条件分岐命令に対する予測の信頼度から該予測の信頼性の有無を判定する際に用いる許容閾値を記憶する許容閾値記憶手順と、
前記信頼性の有無を判定する信頼性判定手順と、
前記条件分岐命令に対する前記予測の前記信頼度を更新する信頼度更新手順と、
を備え、
前記信頼性判定手順は、前記許容閾値記憶手順から入力された前記許容閾値と前記信頼度とを比較して前記信頼性の有無を判定し、前記信頼度更新手順は、前記信頼度の値を増減させることで更新を行い、前記予測に成功した場合に前記信頼度を増加させ、前記予測に失敗かつ前記信頼度が前記許容閾値よりも高い場合に前記信頼度を減少させ、前記予測に失敗かつ前記許容閾値以下の場合に前記信頼度を最も低い値に再設定することを特徴とする分岐予測の信頼度見積もり方法。 An instruction processing pipeline that pipelines an input program, a branch predictor that predicts the branch direction of a conditional branch instruction included in the program, and an instruction depending on whether or not the prediction reliability of the conditional branch instruction is reliable A pipeline gating circuit that determines whether or not to execute speculative processing, and a branch prediction reliability estimation method in a processor having:
An allowable threshold value storing procedure for storing an allowable threshold value used when determining the reliability of the prediction from the reliability of the prediction for the conditional branch instruction;
A reliability determination procedure for determining the presence or absence of the reliability;
A reliability update procedure for updating the reliability of the prediction for the conditional branch instruction;
With
The reliability determination procedure compares the tolerance threshold input from the tolerance threshold storage procedure with the reliability to determine the presence or absence of the reliability, and the reliability update procedure determines the reliability value. Update by increasing / decreasing, increase the reliability when the prediction succeeds, decrease the reliability when the prediction fails and the reliability is higher than the allowable threshold, and fail the prediction A reliability estimation method for branch prediction , wherein the reliability is reset to the lowest value when the value is equal to or less than the allowable threshold .
前記命令処理パイプラインから入力されるアドレスと前記条件分岐命令の分岐結果とから前記条件分岐命令の分岐の予測の方向を分岐成立から分岐不成立又は分岐不成立から分岐成立へ更新する分岐予測更新手順と、
前記条件分岐命令に対する予測の信頼度から該予測の信頼性の有無を判定する際に用いる許容閾値を記憶する許容閾値記憶手順と、
前記信頼性の有無を判定する信頼性判定手順と、
前記条件分岐命令に対する前記予測の前記信頼度を更新する信頼度更新手順と、
を備え、
前記信頼性判定手順は、前記許容閾値記憶手順から入力された前記許容閾値と前記信頼度とを比較して前記信頼性の有無を判定し、前記信頼度更新手順は、分岐成立又は分岐不成立のそれぞれで、前記信頼度の値を増減させることで更新を行い、前記予測に成功した場合に前記信頼度を増加させ、前記予測に失敗かつ前記信頼度が前記許容閾値よりも高い場合に前記信頼度を減少させ、前記予測に失敗かつ前記許容閾値以下の場合に前記信頼度を最も低い値に再設定することを特徴とする分岐予測の信頼度見積もり方法。 Branch prediction in a processor having an instruction processing pipeline that pipelines an input program, and a pipeline gating circuit that determines whether or not to execute speculative processing of an instruction according to the presence or absence of prediction reliability for a conditional branch instruction The reliability estimation method of
A branch prediction update procedure for updating the branch prediction direction of the conditional branch instruction from branch establishment to branch failure or branch failure to branch establishment from the address input from the instruction processing pipeline and the branch result of the conditional branch instruction; ,
An allowable threshold value storing procedure for storing an allowable threshold value used when determining the reliability of the prediction from the reliability of the prediction for the conditional branch instruction;
A reliability determination procedure for determining the presence or absence of the reliability;
A reliability update procedure for updating the reliability of the prediction for the conditional branch instruction;
With
The reliability determination procedure compares the tolerance threshold input from the tolerance threshold storage procedure with the reliability to determine whether or not the reliability exists, and the reliability update procedure determines whether the branch is established or not established. Each is updated by increasing / decreasing the value of the reliability, the reliability is increased when the prediction is successful, and the reliability is failed when the prediction fails and the reliability is higher than the allowable threshold. A reliability estimation method for branch prediction , wherein the reliability is reset to the lowest value when the prediction fails and is less than or equal to the allowable threshold .
前記信頼度更新手順は、該反転後に、前記信頼度の値を増減させることで前記信頼度の更新を行うことを特徴とする請求項10に記載の分岐予測の信頼度見積もり方法。 Before Symbol branch prediction update procedure, when said the prediction after resetting the confidence to lowest value fails, the case of the branch establishment of the branch taken from the case or if the branch is not taken of the branch not taken Invert each case,
The reliability estimation method for branch prediction according to claim 10 , wherein the reliability update procedure updates the reliability by increasing or decreasing the reliability value after the inversion.
前記分岐命令の信頼性を判定する閾値の値を動的に変更する閾値更新手順と、
を備え、
前記閾値更新手順は、前記プロセッサの速度と消費電力を動的に制御することを特徴とする請求項8に記載の分岐予測の信頼度見積もり方法。 A measurement procedure for measuring changes in the external environment;
A threshold update procedure for dynamically changing a threshold value for determining the reliability of the branch instruction;
With
The branch prediction reliability estimation method according to claim 8 , wherein the threshold update procedure dynamically controls the speed and power consumption of the processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008333049A JP5387819B2 (en) | 2008-12-26 | 2008-12-26 | Reliability estimation circuit and method for branch prediction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008333049A JP5387819B2 (en) | 2008-12-26 | 2008-12-26 | Reliability estimation circuit and method for branch prediction |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010152843A JP2010152843A (en) | 2010-07-08 |
JP5387819B2 true JP5387819B2 (en) | 2014-01-15 |
Family
ID=42571822
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008333049A Expired - Fee Related JP5387819B2 (en) | 2008-12-26 | 2008-12-26 | Reliability estimation circuit and method for branch prediction |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5387819B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9116686B2 (en) * | 2012-04-02 | 2015-08-25 | Apple Inc. | Selective suppression of branch prediction in vector partitioning loops until dependency vector is available for predicate generating instruction |
US9389860B2 (en) | 2012-04-02 | 2016-07-12 | Apple Inc. | Prediction optimizations for Macroscalar vector partitioning loops |
US9817663B2 (en) | 2013-03-19 | 2017-11-14 | Apple Inc. | Enhanced Macroscalar predicate operations |
US9348589B2 (en) | 2013-03-19 | 2016-05-24 | Apple Inc. | Enhanced predicate registers having predicates corresponding to element widths |
US11507380B2 (en) * | 2018-08-29 | 2022-11-22 | Advanced Micro Devices, Inc. | Branch confidence throttle |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000322257A (en) * | 1999-05-10 | 2000-11-24 | Nec Corp | Speculative execution control method for conditional branch instruction |
JP2001014162A (en) * | 1999-07-02 | 2001-01-19 | Matsushita Electric Ind Co Ltd | Branch predicting method and data processor |
JP2001236225A (en) * | 2000-02-22 | 2001-08-31 | Fujitsu Ltd | Arithmetic unit and branch predicting method and information processor |
JP2002182906A (en) * | 2000-12-15 | 2002-06-28 | Nec Corp | Instruction executing method, its device, branching predicting method and its device |
US7587580B2 (en) * | 2005-02-03 | 2009-09-08 | Qualcomm Corporated | Power efficient instruction prefetch mechanism |
US7627742B2 (en) * | 2007-04-10 | 2009-12-01 | International Business Machines Corporation | Method and apparatus for conserving power by throttling instruction fetching when a processor encounters low confidence branches in an information handling system |
-
2008
- 2008-12-26 JP JP2008333049A patent/JP5387819B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010152843A (en) | 2010-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5387819B2 (en) | Reliability estimation circuit and method for branch prediction | |
EP2069915B1 (en) | Methods and system for resolving simultaneous predicted branch instructions | |
US7707398B2 (en) | System and method for speculative global history prediction updating | |
KR102556897B1 (en) | Accelerate or Inhibit a Processor's Loop Mode Using Loop Termination Prediction | |
JPH11282677A (en) | Method for predicting branch instruction in microprocessor | |
US11163574B2 (en) | Method for maintaining a branch prediction history table | |
US7844806B2 (en) | Global history branch prediction updating responsive to taken branches | |
JP4009248B2 (en) | Branch prediction apparatus and branch prediction method | |
JP2009528637A (en) | Method and apparatus for repairing a link stack | |
WO2012127666A1 (en) | Arithmetic processing device, information processing device, and arithmetic processing method | |
KR20210084625A (en) | Loop End Predictor | |
JP4213181B2 (en) | Branch prediction apparatus, method thereof, and processor | |
US20170039072A1 (en) | Method for branch prediction | |
JP2008262437A (en) | Processor system and exception handling method | |
US10324727B2 (en) | Memory dependence prediction | |
KR100980076B1 (en) | System and method for branch prediction with low-power consumption | |
US11663007B2 (en) | Control of branch prediction for zero-overhead loop | |
CN113032011B (en) | Method and system for executing cyclic program in data flow architecture | |
JP5209390B2 (en) | Information processing apparatus and instruction fetch control method | |
US7849299B2 (en) | Microprocessor system for simultaneously accessing multiple branch history table entries using a single port | |
JP2006040173A (en) | Branch prediction device and method | |
US20230350686A1 (en) | Logic circuit and method for checking and updating program counter values in pipeline architecture | |
JP4728877B2 (en) | Microprocessor and pipeline control method | |
US20230195467A1 (en) | Control flow prediction | |
JP2006163548A (en) | Prediction device using unstable state and processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20100720 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20100720 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110831 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130419 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130425 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130621 |
|
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: 20130911 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130924 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |