
コンピュータ・アーキテクチャにおける分岐予測 (ぶんきよそく、 Branch Prediction 、ブランチプレディクタ)とは、 プログラム実行の流れの中で条件分岐命令が分岐するかしないかを予測することにより、 パイプライン処理の効果を可能な限り維持し、性能を高めるためのCPU内の機能である。 Branch prediction architecture of the computer (Soku literary acclaim, Branch Prediction, Buranchipuredikuta) is due to predict whether or not the branch is a conditional branch instruction in program execution flow, the effect of the processing pipeline maintained whenever possible, to improve the performance of the CPU in the function.
パイプライン処理プロセッサでは、パイプラインを途切れさせないようにするために命令を次々にフェッチする必要がある。 The processor pipeline, the following: Remember to give instructions to people cut off the pipeline that should be fetched. しかしプログラムに分岐がある場合は次の命令は未決定のため、本来はフェッチが待たされ、パイプラインの効果が低下し、性能劣化( スループット低下)を招いてしまう。 But if there is a branching program for the next instruction is pending, waiting to fetch the original is to reduce the effect of the pipeline, performance degradation (lower throughput) could lead to.
この性能劣化を減らすため、現代のCPUは多かれ少なかれ分岐予測を行っている。 To reduce this performance degradation, the modern CPU is doing more or less branch prediction. 予測が当たった場合はフェッチが有効となりパイプラインの効果が維持でき、予測が外れた場合はフェッチした命令を破棄して正しい分岐先の命令を再フェッチするため性能損失( オーバーヘッド )が発生する。 If you can hit to predict the effect of pipeline maintenance enables the fetching, if you missed a performance loss prediction to re-fetch the correct branch target instruction to discard the instruction fetch (head-over) to occur. しかし実際のプログラムの大半では、ループ処理や例外処理など各分岐先への分岐比率は偏りが大きいため、分岐予測によるメリットがデメリットを上回ることが多い。 In fact most of the programs, such as the ratio of each branch to branch target loops and exception handling are biased because of the large, often greater than the disadvantages of the benefits of branch prediction. つまり分岐予測の的中率は、使用するアプリケーションと、分岐予測に採用した技法次第である。 That branch prediction accuracy rate of the application and use, and depending on branch prediction techniques adopted. また、どこまで精緻な予測を行うべきかは、デメリット(CPU実装コスト、分岐予測処理のオーバーヘッド)とメリット(期待されるスループット向上)とのバランスとなる。 And how far should a detailed forecast, the disadvantages (CPU cost of implementation, processing overhead branch prediction) and benefits (the expected throughput increase) and the balance will be.
特にスーパースケーラ型プロセッサでは、パイプラインが複数となり、ある分岐予測結果が他のパイプラインの処理にも影響を及ぼしうるため、分岐予測は複雑となり重要である。 Type processor superscalar particular has become more and pipeline for processing may also affect the results of other pipelines that branch prediction, branch prediction is a complicated and important.
分岐予測は分岐先予測と同じではない。 Branch prediction is the same as the predicted branch target is not. 分岐予測は条件分岐で分岐するかどうかを予測するが、分岐先予測は分岐アドレスが実際に決定される前にそれを推察するものである。 Branch prediction is to predict whether a conditional branch, the branch target prediction is to guess what it is actually determined before the branch address.
歴史的にはパイプラインも分岐予測も、 マイクロプログラム方式のCISCプロセッサで生まれ発達した技術であり、 RISCを含むマイクロプロセッサでの分岐予測は最初は簡単なものであった。 Historically, pipelines and branch prediction, the method microprogrammed CISC was born and developed processor technology, RISC prediction branch in microprocessors, including the first was that easy. なお「マイクロプログラム方式のプロセッサは分岐予測を必要としなかった」という説があるが間違いである。 The "microprogrammed processors did not require branch prediction," there is a theory that is wrong. 一般論としてRISCの方がパイプラインの効果が発揮しやすい(逆に言えばパイプラインが乱れると性能劣化が大きい)ため、結果的に分岐予測が重要というだけである。 RISC in general easier to better demonstrate the effect of the pipeline (the pipeline is distorted and a large performance degradation conversely), it is just important branch prediction as a result.
分岐予測の最初は1961年のIBM 7030 (Stretch)と言われ、 マイクロプログラム方式でパイプラインを使っている[1] 。 Branch prediction is the first in 1961 was IBM 7030 (Stretch) is said, are using the pipeline in Microprogramming [1]. 以後のIBMのメインフレームの上位機種も分岐予測を採用している。 After IBM which uses a predictive model and the upper branch of the main frame.
VAX 9000もマイクロプログラム方式でパイプラインを使っていたが、何らかの分岐予測を行っていたと思われる[2] 。 VAX 9000 was also using a microprogrammed pipeline, which we thought was some kind of branch prediction [2].
最初の商用RISCプロセッサであるMIPSとSPARCは単純な「常に分岐しない]という分岐予測だけをした。これらは分岐遅延スロットを使い、1サイクルに1命令をフェッチするだけだったため、性能損失は全くなかった。後にR4000でも同様の予測方式だったが、分岐命令の評価に4サイクルかかったため分岐が発生すると2サイクルを無駄にすることになった。 The first commercial RISC processor, MIPS and SPARC is a simple "no branch Always it was the only branch prediction. They use a branch delay slot, was the only one for one cycle to fetch instructions, performance loss is totally unfamiliar Ta. After R4000 was similar prediction, and evaluation of four branch instruction for branching to occur was that it took two cycles to waste a cycle.
分岐予測はインテルPentium 、DEC Alpha 21064、MIPS R8000、IBM POWERのようなパイプライン化されたスーパースケーラプロセッサでは重要な問題となった。 Branch prediction Intel Pentium, DEC Alpha 21064, MIPS R8000, IBM POWER in the pipeline Supasukerapurosessa was such an important issue. これらのプロセッサは単純な1ビットあるいは2レベル分岐予測を使用している。 These processors are simple to use 1 bit or 2-level branch prediction. R10000 は2レベル分岐予測を採用した初期のプロセッサのひとつである。 R10000 processor is one of the two initial adoption level branch prediction.
DEC Alpha EV6 [3]は、次ライン分岐予測を基本とし、局所分岐予測と広域分岐予測を 2レベル分岐予測で統合した分岐予測で上書きを行う。 DEC Alpha EV6 [3] is based on the following line branch prediction, branch prediction and wide area two to override the local branch prediction branch prediction branch prediction level of integration. Alpha EV8(後に設計段階で開発中止)では分岐予測が失敗した場合に最低でも14サイクルかかった。 Alpha EV8 (stopped after development in the design phase), at least in the branch prediction fails when it took 14 cycles.
AMD K8 は2レベル分岐予測と広域分岐予測を統合しており、統合時の選択には別の2レベル分岐予測を使用している。 AMD K8 is to integrate the two branch prediction and branch prediction and regional level, the choice of integration time by using the two-level branch prediction. このプロセッサは、 ECCとして使われていた二次キャッシュ内のビット群を分岐予測に代用する。 This processor, ECC bits to be substituted for branch prediction in a group was used as a secondary cache. 結果として分岐予測テーブルとして大容量を使用可能となり、キャッシュに関してはECCではなくパリティビットを使用することになる。 Capacity becomes available as a branch prediction table as a result, for the cache will use the ECC parity instead. キャッシュエラー(ECCエラーやパリティエラー)が発生したらいずれにしてもそのキャッシュラインを無効化してメモリから読み直すので、この選択は非常に効果的と思われる。 Cache errors (ECC error or parity error), so reread from memory and invalidate the cache line when it occurs but in any case, this choice seems to be very effective.
SPARCとMIPS (最初の2つの商用RISCアーキテクチャ)で初期に実施された分岐予測は単純なものだった。 SPARC and MIPS (one of the first commercial RISC architecture) was conducted in the early branch prediction is so simple. それは、常に分岐しないと予測して命令順に実行を行おうとするものである。 It is what you try to execute the order branch instruction does not always predict. 実際に分岐すると判明した時点(分岐命令の解釈フェーズ)で不連続なアドレスへの分岐を準備する。 Actually turned out to branch point (phase interpretation of the branch instruction) to prepare a discontinuity in the branch address.
これらのCPUはデコード段階で分岐命令を評価し、1サイクルで命令をフェッチする。 These CPU will evaluate the branch instruction decode stage, instructions in one cycle to fetch. 従って分岐アドレスの命令をフェッチするには2サイクルかかり、その間にどうしても分岐命令の次の命令をフェッチしてしまう。 Branch address to fetch the instruction therefore takes two cycles to fetch the next instruction would branch instruction really in between. これを有効利用するために、これらのアーキテクチャでは分岐遅延スロットを定義した。 To use this effect, these architectures are defined slots delayed branch.
静的予測方式では、プログラムの流れる方向とは逆行する分岐命令をループの最後にある分岐と見なして、分岐する(可能性大)と予測する。 Prediction method is static, and direction of flow of the program and considers branching at the end of the loop branch instruction contrary to the branch (large potential) predicted. 逆にプログラムの流れる方向に分岐する命令はループからの脱出や例外的な処理と見なして、分岐しない(可能性大)と予測する。 Instruction to branch to the opposite direction of flow of the program is regarded as an exceptional treatment and escape from the loop, not a branch (potentially large) predicted.
この方式では、ループ実行の最後の分岐(つまりループの正常な終了)で予測を誤る。 In this method, the branching end of the run loop (closed loop that is normal) predicted incorrectly.
静的予測は、動的分岐予測を使用するプロセッサの予備の技術(動的予測のためのどのような情報もない時の予備手段)として使われる。 Static prediction techniques using spare processor dynamic branch prediction (means no spare time to predict what information dynamically) to be used as. モトローラMPC7450 (G4e)とインテルPentium 4はこの技術を使っている[4] 。 Motorola MPC7450 (G4e) and Intel Pentium 4 is using this technology [4].
また、静的予測方式には、何らかの静的な分岐予測情報(分岐命令に付与されたヒントビット等)に基づいて、分岐する/分岐しないを予測する方式もある。 In addition, the static prediction method, some static branch prediction information (such as that granted to the branch instruction hint bits), based on branch / branch is also no method to predict.
いくつかのスーパースケーラプロセッサ ( MIPS R8000, DEC Alpha EV6/EV8) では、一次命令キャッシュの各ライン毎に次に実行すべきキャッシュラインへのポインタを持つ。 Some Supasukerapurosessa (MIPS R8000, DEC Alpha Ev6/Ev8) provides a pointer to the cache line to be executed next to each line of the primary instruction cache. この次ライン予測は分岐予測だけでなく分岐先予測も兼ねているので、他の分岐予測方式と単純に比較することはできない。 This next line predictor because it doubles as well as branch prediction branch target prediction, and simple method to compare to the other branches can not be predicted.
次ライン予測は位置合わせされた命令グループ(2個、4個、8個の命令)を示すので、分岐先は通常その先頭の命令ではない。 The following lines are predicted alignment instruction group (two, four, eight individual instruction), so that the first branch target instruction that is not normal. 単純に分岐先が一様に分布すると仮定すれば、使われない命令の平均は、0.5個、1.5個、3.5個となる。 Assuming a uniform distribution of the branched to simple average of the instruction is not used, 0.5 total, 1.5 each, and 3.5 total. また、分岐命令もキャッシュラインの最後とは限らないので、こちらも使われない命令として0.5個、1.5個、3.5個が捨てられる。 Also, the end of the branch instruction cache line is not necessarily so, as each instruction is not used also 0.5, 1.5 total, 3.5 total is discarded.
一般に命令はキャッシュライン単位にキャッシュに取り込まれるが、次ライン予測が特殊なのは、予測結果に従って次ラインの先頭からフェッチし、分岐命令の評価結果に従って、フェッチ済みの命令を捨てることにある。 Although general instructions to be included in the cache to the cache line units, in particular the next line predictor, fetch next from the top of the line according to the results predicted, according to evaluation results of branch instructions, in order to discard the pre-fetched.
2レベル分岐予測は2ビットの飽和カウンターのテーブルを持ち、そのテーブルは命令アドレスの最下位桁ビット群によってインデックス付けされる。 Two-level branch prediction tables has two-bit saturation counters, the table is with the index by the least significant digit of the address-bit instruction set. 命令キャッシュとは異なり、2レベル分岐予測のテーブルはタグを持っていない。 Unlike the instruction cache and two-level branch prediction table does not have a tag. 従ってテーブルの各エントリーは異なる複数の分岐命令に対応する可能性がある(これを分岐妨害とか分岐の別名と呼ぶ)。 Each entry in the table may therefore correspond to different branch instructions (also known as the branch is called branch interference or this). 複数の分岐命令に対応したカウンターは正しい予測をしない。 Multiple counters corresponding to the branch instruction is not a correct prediction. 各カウンターは以下のような4つの状態を表す。 Each counter represents the following four states.
分岐命令が評価される際に対応するカウンターが更新される。 Counter is updated when the corresponding branch instruction is evaluated. 分岐しない場合、対応するカウンターはデクリメントされ、「分岐しない(可能性大)」の方向に状態が移行する。 If you do not branch, the corresponding counter is decremented, "do not branch (most likely to be)" to move in the direction of the state.
2ビット方式の利点は、1ビット方式よりも予測の誤りが少なくなることである。 Advantage of two-bit system, one that is less predictable than the system bit error.
1ビット方式では、2度目以降のループ処理では、ループの最初回と最後回の分岐時に予測を誤る。 1-bit system, the two loops after the first time, branch mis-predict when the first and last time most of the loop. 2ビット方式では、2度目以降のループ処理では、ループの最後回の分岐時にだけ予測を誤る。 Two-bit scheme, the two loops after the first time, only when branch mis-predict the end of the loop once.
ほとんど常に分岐する命令で分岐しない場合、1ビット方式では2回誤予測する(一度分岐しなかった場合に1ビット方式では「分岐しない」とされてしまうため)が、2ビット方式では誤予測は1回である(ただし、Weakly(可能性小)の際の動作によって性能が変化する)。 If no branch instruction to branch almost always one-bit method to predict two times false (if not branch in the system once one bit is "no branch" because they are), but two-bit prediction scheme is wrong one time (however, Weakly (small can) to change the behavior during the performance).
全ての分岐命令がそれぞれ独立したカウンターに対応している場合、 SPEC 89のベンチマークを実行したときの2レベル予測の予測性能は最終的に93.5%となる(一般に分岐予測は繰り返し実行されることを前提としており、あるプログラムを実行開始した直後の予測成功確率はもっと低い)。 If you have a separate counter for each branch instruction of all, SPEC 89 when running the performance benchmark for two-level forecasts predict will eventually be 93.5 percent (typically branch prediction to be repeated The assumption, the probability of successful prediction of the program is executed immediately after starting lower).
2レベルカウンターテーブルが命令アドレスのビット群によってインデックス付けされるため、これをキャッシュ化して命令フェッチと同時にテーブルの内容も取ってくることが可能である。 Because the two groups are indexed by the instruction address bits Reberukauntateburu, which can fetch the contents of the table and at the same time of instruction cache and fetch it. さらにコンパイル時の予測値を実行ファイルに格納すれば、最初の実行のときからある程度の正しい予測を行うことが可能となる。 If you run a file stored on a compile-time estimates also will be able to predict correctly when run from the first degree.
2レベル分岐予測はすべてのループの終了を誤予測する。 Two-level branch prediction is wrong to predict the end of every loop. 毎回ループ回数が同じになる傾向があるループについては、もっとよい予測方法が存在する。 Loops tend to be about the same number of times each loop, there is a better prediction method.
局所分岐予測では2つのテーブルを使用する。 The local branch prediction is to use a single table 2. ひとつは局所分岐履歴テーブルである。 One is the local branch history table. これは、分岐命令のアドレスの最下位桁ビット群によってインデックス付けされ、最近の n回の分岐命令実行の履歴(分岐したかしないか)を記録する。 This bit is indexed by a group of least significant digit of the address of the branch instruction, the recent history of n branch instruction execution times (whether or not the branch) to record.
もうひとつのテーブルはパターン履歴テーブルである。 Another table is the pattern history table. 2レベル予測のように、このテーブルは2レベルカウンターから構成される。 Level 2, as predicted, this table consists of two counter levels. ただしそのインデックスは上記の局所分岐履歴テーブルから生成される。 However, its index is generated from the local branch history table above. 分岐を予測するために分岐履歴を参照し、その内容から 2レベルカウンターを参照して予測を行う。 Refer to the branch history to predict the branch prediction from its contents to see the two-level counter.
SPEC89のベンチマークで、非常に大型の局所分岐予測を行うと正しい予測は最終的に97.1%となる。 SPEC89 benchmarks, and make the correct prediction of very large local branch prediction will ultimately be 97.1%.
局所分岐予測は2つのテーブル参照をしなければならないため、2レベル分岐予測よりも重い。 Local branch prediction must be a reference to two tables, two heavier than the level branch prediction. 高速さを求めた実装では、2レベルカウンターを別途用意して2レベル分岐予測と組み合わせて使用する。 In seeking to implement high-speed, and a separate two-level counter used in conjunction with two-level branch prediction. これらのテーブルは冗長ではなく、各カウンターはひとつの分岐命令のふるまいを格納することを前提としている。 These tables are not redundant, each counter is assumed to store the behavior of a single branch instruction.
広域分岐予測は多くの分岐命令のふるまいが最近の他の分岐命令のふるまいと強く相関するという事実を利用する。 Using global branch prediction is strongly correlated with the fact that other recent behavior of the branch instruction behavior of many branch instructions. ひとつのシフトレジスタで最近実行した分岐命令のふるまいの履歴を保持し、この内容を2レベルカウンターテーブルへのインデックス値として使用する。 Maintains a history of the behavior of the recently executed branch instructions in a single shift register, the contents of the two index values to be used as Reberukauntateburu. この方式自体はテーブルが大きければ2レベル分岐予測よりよい結果を示すが、局所分岐予測には敵わない。 The larger the table itself, this method shows better results than the two-level branch prediction, would I say to the local branch prediction.
ひとつのシフトレジスタではなく、命令アドレスの数ビットをインデックスとしたシフトレジスタのテーブルを使う方式を gselect分岐予測と呼ぶ。 Rather than a single shift register, the shift register and method of using a table index bits of instruction address and branch prediction gselect call. gselectはテーブルの小さい局所分岐予測よりもよい結果を示し、局所分岐予測はテーブルが1Kバイト以上になってもあまり予測結果が向上しない。 gselect showed better results than the small local branch prediction table, the local branch prediction table is 1K does not improve prediction results is much more than one byte.
分岐命令アドレスを広域履歴とXORすると gselect よりも若干効率がよくなる。 Global history branch instruction address and then XOR gselect become slightly more efficient. これをgshareと呼び、テーブルサイズが 256バイト以上ならばgselectよりもよい結果となる。 This is called gshare, the table size is 256 bytes or more if you work out than gselect.
SPEC89のベンチマークで、非常に大型のgshare分岐予測値を実施すると、正しい予測は最終的に96.6%となる(大型の局所分岐予測よりほんの少し悪い)。 SPEC89 benchmarks, and implementing very large gshare branch prediction value, 96.6% correct prediction will eventually become (slightly worse than expected large local branch).
gselectとgshareは分岐命令当たりのテーブル参照が一回で済むので、局所分岐予測よりも軽い。 gselect one and only once since gshare table reference instruction per branch, lighter than the local branch prediction. 2レベル分岐予測と併用してテーブル参照と命令フェッチを並行して行うこともできる。 2 can also be done in parallel with instruction fetch and branch prediction with reference to table level.
Scott McFarling は 1993年の論文で統合分岐予測 ( Combined branch prediction ) を提案した[5] 。 Scott McFarling branch predictor is integrated in the paper was 1993 (Combined branch prediction) was proposed [5]. この方式は2レベル分岐予測と同じくらい正確で、広域分岐予測と同じくらい高速である。 This method is accurate and as much as two-level branch prediction, branch prediction is as fast as global.
統合分岐予測は並列に3つの予測値を使う。 Integrated branch prediction is estimated using two parallel 3. それは 2レベル分岐予測とgshare分岐予測と、分岐命令毎にその二つのどちらを選択するかを示す2レベルカウンターテーブルを使った予測である。 It gshare two-level branch prediction and branch prediction, indicating that the two choice every branch instruction is predicted using Reberukauntateburu 2. 最後のものを選択分岐予測と呼び、このテーブルのインデックスは命令アドレスの最上位桁ビット群を使用する。 Choose branch prediction is called the last one, use the index of this table is the most significant digit of the address-bit instruction set. このテーブルは2レベル分岐予測とgshare分岐予測が食い違ったときに更新され、どちらが正しかったかを示す。 This two-level branch prediction table is updated when meanwhile gshare branch predictor, indicating that both were correct.
SPEC89のベンチマークで、統合分岐予測はほぼ局所分岐予測と同じ成績となる。 SPEC89 benchmarks, branch prediction will be integrated with the local branch prediction almost the same results.
分岐予測を統合する他の方法として、例えば3種類の分岐予測を使って多数決を行うことが考えられる。 Another way to integrate the branch prediction, for example, three possible with the majority to make the kind of branch prediction. 実際、インテルはそのような方式を採用している。 In fact, Intel has adopted such a scheme.
gshareのような分岐予測方法では、ひとつの分岐命令に対応するテーブルエントリが複数存在することになる。 methods such as gshare branch prediction is that there be multiple entries in the table corresponds to one branch instruction. それは逆に同じエントリで複数の分岐命令が競合することを意味し、結果として分岐予測精度を悪化させる。 It means that there is a conflict in the same entry to more than one branch instruction contrary, worsen as a result of branch prediction accuracy. 従って、複数の分岐予測手法を統合する際には、このエントリ競合パターンがそれぞれの手法で異なっているように設計することが重要である。 Therefore, when integrating multiple branch prediction techniques, it is important to be designed to have different patterns respectively in the competition entry method. そうすれば、どれかひとつは競合していないエントリで予測することができる確率が高まる。 If so, this increases the probability of any one can not predict competitive entry. このような考え方で統合された分岐予測をgskew分岐予測と呼ぶ。 Branch prediction in an integrated way of thinking this way is called gskew branch prediction. この名称はskewed cacheからの類推から来ている(skewed cacheとは連想度が複数のキャッシュについて、ウェイ毎に別のハッシュ関数を用いる手法)。 This name comes from the skewed cache from analogy (skewed cache and associate degrees for more than one cache, a hash function using a different method for each way).
パターン履歴テーブルの中で破壊的なエントリ競合を減らす別の技術として「合意予測 (agree predictor)」がある。 Another technique to reduce the entry of destructive conflict in the pattern history table "consensus forecasts (agree predictor)" there. 2レベル分岐予測や分岐命令にヒントビットを付与することで若干静的な予測を基本として行う。 Provide the basis of two static prediction bit to give some hints in the instruction branch prediction and branch level. そして、別の分岐予測機構(例えばgskew)でも予測を行うが、それは分岐するかしないかではなく、基本の予測に合意するかしないかを予測する。 And another branch prediction mechanism (eg gskew) to make predictions, but it is not whether or not to branch, to predict whether or not to agree to base predictions.
意図しているのは、gskew分岐予測による予測に対して静的なバイアスを与えることである。 The intention is that, gskew static bias is to give a prediction for the branch prediction. 容量の小さいパターン履歴テーブルでの競合を削減するのに有効であるが、基本となる静的予測の精度に性能が依存する。 To be effective in reducing the pattern history table competing in a small space, it depends on the accuracy of the forecasting performance of the underlying static.
合意予測は統合分岐予測と組み合わせるとうまく機能する。 Consensus forecast is combined with branch prediction and integration work. というのも統合分岐予測では一般に2レベル分岐予測を内包しており、それを基本の予測として使用できるからである。 The integrated branch prediction is generally because the capsule and the two-level branch prediction, since it can be used as the basic prediction. ただし分岐する/しないの傾向が特にない分岐命令についてはうまく機能しない(基本の予測結果が一定しないため)。 However branch / no branch instruction about the trend that one does not work particularly well (because they do not predict the results of certain basic). 従って、合意予測は3種類の分岐予測の組合せの一部として使用するのが最善である。 Therefore, the best prediction of the three agreements are used as part of a combination of types of branch prediction.
EV6とEV8コアは、高速な(1サイクル動作の)次ライン分岐予測を実施している。 EV8 and EV6 core is fast (one cycle operation) has implemented the following line branch prediction. しかし次ライン分岐予測は大雑把であり、命令単位での予測はコストが高くつく。 The next line is a rough branch prediction, instruction prediction unit is very expensive. そこでこれらのプロセッサでは2サイクルかかる別の分岐予測機構を用意し、次ライン分岐予測の結果を上書きするようになっている。 These processors provide a mechanism where the two take a different branch prediction cycle, is a branch predictor to override the results of the next line. これによって最悪でも1命令だけフェッチした命令を捨てるだけでよくなり、性能が向上する。 This one became even worse as well just throw away the instruction fetched instruction to improve performance.
4命令以上を同時にフェッチすると、複数の分岐命令が含まれる可能性がある。 Instruction to fetch more than four at a time, may include more than one branch instruction. そのため、上書きに際しては次の命令が分岐するかしないかを予測する必要がある。 Therefore, when you need to overwrite or not to predict the next branch instruction. 通常、分岐命令を評価して分岐アドレスを求める。 Usually seek to evaluate the branch instruction branch address.
ニューラル分岐予測(Neural Branch Prediciton)は、 ルーマニアの Lucian Vintan が論文 "Towards a High Performance Neural Branch Predictor" で最初に提唱した (Proceedings of The International Joint Conference on Neural Networks - IJCNN '99, Washington DC, USA, 1999)。 Neural branch prediction (Neural Branch Prediciton), the Romanian Lucian Vintan the paper "Towards a High Performance Neural Branch Predictor" was first proposed (Proceedings of The International Joint Conference on Neural Networks - IJCNN '99, Washington DC, USA, 1999). その後、アメリカのラトガース大学で Daniel Jimenez が研究を進めた。 Then, at the University of Rutgers in the United States proceeded to research Daniel Jimenez. 2001年 、ハードウェア実装が可能な最初のパーセプトロン予測器 (perceptron predictor) が登場した。 In 2001, the first perceptron predictor can be implemented with hardware (perceptron predictor) was launched.
ニューラル分岐予測の主な利点は、線形なリソース量の増大だけで長い履歴を扱える点である。 The main advantage of neural branch prediction is a long history points only handle linear increase in the amount of resources. 古典的な分岐予測では、履歴量の増大はリソース量の指数関数的増大を招いていた。 The classical branch prediction, the increase in the amount of history was leading to an exponential increase in the amount of resources. Jimenez は McFarling の統合分岐予測に対して 5.7% の向上が得られたことを報告している。 Jimenez is McFarling branch predictor integration for 5.7% of the reported improvements that were obtained.
パーセプトロン分岐予測の問題は、レイテンシが大きいことである。 Perceptron branch prediction problem is that large latency. 様々な技法を凝らして高速化しても、深いパイプラインを持つマイクロアーキテクチャのクロックに比較すると、計算レイテンシが長い。 Also various techniques to peer into a faster, compared to the clock of the micro-architecture with deep pipelines, long latency calculations. インテルのPentium 4のパイプラインは20ステージであり、研究者は高速化の追求によって最高 52 ステージまで細分化が進むだろうと予測している[6] 。 Intel Pentium 4 pipeline is 20 stages, the researchers speed up the pursuit of which 52 are becoming more fragmented and predict the Stage [6].
レイテンシを低減するため、Jimenez は2003年にfast-path neural predictorを提案した。 To reduce the latency, Jimenez in 2003 proposed a fast-path neural predictor. これは、分岐命令のアドレスではなく、分岐経路によって重み付けする方式である。 This is not a branch instruction address, the method of weighted by the branching paths. 他にも同様の方式を提案している者が何人もいる(A. Seznec、M. Monchiero、Tarjan & Skadron、V. Desmet、Akkary et al など)。 That no person who has also proposed a similar scheme (A. Seznec, M. Monchiero, Tarjan & Skadron, V. Desmet, Akkary et al, etc.).
ニューラル分岐予測はかなり見込みがあると考えられている。 Neural branch prediction is considered to have considerable potential. 最先端の分岐予測機構の多くは、パーセプトロン分岐予測器を用いている(インテルの "Championship Branch Prediction Competition" [7]を参照)。 Many of the most advanced branch prediction mechanism is using a perceptron branch predictor (Intel "Championship Branch Prediction Competition" [7] for details). インテルは既にIA-64シミュレータにこのアイデアを実装している。 Intel is already IA-64 implements the idea that the simulator.
