[go: up one dir, main page]

JPH046983B2 - - Google Patents

Info

Publication number
JPH046983B2
JPH046983B2 JP59021114A JP2111484A JPH046983B2 JP H046983 B2 JPH046983 B2 JP H046983B2 JP 59021114 A JP59021114 A JP 59021114A JP 2111484 A JP2111484 A JP 2111484A JP H046983 B2 JPH046983 B2 JP H046983B2
Authority
JP
Japan
Prior art keywords
branch
instruction
address
circuit
information
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 - Lifetime
Application number
JP59021114A
Other languages
Japanese (ja)
Other versions
JPS60164842A (en
Inventor
Toshiteru Shibuya
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP2111484A priority Critical patent/JPS60164842A/en
Priority to US06/699,328 priority patent/US4764861A/en
Priority to DE3587811T priority patent/DE3587811D1/en
Priority to EP85101351A priority patent/EP0157125B1/en
Publication of JPS60164842A publication Critical patent/JPS60164842A/en
Publication of JPH046983B2 publication Critical patent/JPH046983B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】 発明の属する技術分野 本発明はデータ処理システムの命令シーケンス
のステツプに含まれる分岐条件判定ステツプ実行
処理に先立つて判定結果を予測しつつ次の命令の
先取りを行なう命令先取装置に関する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to an instruction prefetch method that prefetches the next instruction while predicting a decision result prior to execution of a branch condition decision step included in a step of an instruction sequence of a data processing system. Regarding equipment.

従来技術 少なくとも1個の分岐命令を含む命令群が記憶
装置に命令シーケンスの形で格納されているデー
タ処理システムにおいては、このような命令シー
ケンスの実行は、次のように行なわれる。
Prior Art In a data processing system in which a group of instructions including at least one branch instruction is stored in a storage device in the form of an instruction sequence, such an instruction sequence is executed as follows.

まず、前記記憶装置の分岐元アドレスに分岐命
令が格納される。次に、この分岐命令に引き続い
て実行される命令が先取りされる。このあと、分
岐命令が実行され、この実行結果により次に実行
される命令が明らかになる。このようなシステム
は米国特許4200927号に提案されている。しかし、
このシステムでは、分岐命令先取り制御において
実行結果の判別時まで命令先取り制御を停止させ
ると、処理の迅速化が妨げられる。
First, a branch instruction is stored at a branch source address in the storage device. Next, the instruction to be executed following this branch instruction is prefetched. After this, a branch instruction is executed, and the result of this execution reveals the next instruction to be executed. Such a system is proposed in US Pat. No. 4,200,927. but,
In this system, if the branch instruction prefetch control is stopped until the execution result is determined, speeding up of processing will be hindered.

この欠点の除去のため、分岐命令の実行結果を
予め予測しこの予測に従つて命令先取りを行なう
方式が提案されている。この予測が正しく行なわ
れたときには、データ処理システムは処理時間の
少ない遅れで稼働する。例えば、そのような従来
の予測方式としては次の3つの方式がある。第1
の予測方式では、全ての分岐命令の分岐先方向が
成功側または不成功側のいずれか一方のみに予測
されている。
In order to eliminate this drawback, a method has been proposed in which the execution result of a branch instruction is predicted in advance and instructions are prefetched in accordance with this prediction. When this prediction is made correctly, the data processing system operates with little delay in processing time. For example, there are the following three methods as such conventional prediction methods. 1st
In the above prediction method, the branch destination direction of all branch instructions is predicted to be either the successful side or the unsuccessful side.

他の1つの予測方式では、過去の事実に基づい
て分岐先方向を予測する。すなわち、同じ分岐命
令の過去の実行結果において分岐先がすでに明ら
かにされているという事実を用いてこの結果に基
づいて予測を行なうことにより予測的中率を高め
ている。このような予測方式はApril 1978 IEEE
COMPUTER「Component Progress;Its
Effecton High−Speed Computer
Arvhitecture and Machine Organization」に
考え方が示されており、具体的な構成を示したも
のとしては、特開昭57−76638号公報が存在する。
Another prediction method predicts the branch destination direction based on past facts. That is, by using the fact that the branch destination has already been revealed in the past execution results of the same branch instruction and making predictions based on these results, the prediction accuracy rate is increased. Such a prediction method was introduced in April 1978 IEEE
COMPUTER “Component Progress; Its
Effecton High-Speed Computer
The idea is shown in "Arvhitecture and Machine Organization", and Japanese Patent Application Laid-open No. 76638/1983 shows a specific structure.

さらにもう1つの予測方式では、分岐命令に対
応して分岐の方向を予測する分岐指示フラグを多
数用意し分岐命令の発生に応答しこれら分岐指示
フラグを参照することにより分岐先を予測してい
る。この例の詳細は特開昭53−74857号公報を参
照できる。しかし、上述の3つのいずれの予測方
式においても分岐命令の読出し、解読が必要不可
欠であり、予測的中にもかかわらずこれらの読出
しおよび解読動作分だけ処理が遅れるという欠点
がある。
In yet another prediction method, a large number of branch instruction flags are prepared to predict the branch direction in response to a branch instruction, and the branch destination is predicted by referring to these branch instruction flags in response to the occurrence of a branch instruction. . For details of this example, refer to Japanese Patent Application Laid-Open No. 74857/1983. However, in all three prediction methods described above, reading and decoding of branch instructions are essential, and there is a drawback that processing is delayed by the amount of these read and decoding operations even if the prediction is correct.

この欠点を除去する予測方式が特開昭57−
59253号公報に示されている。この方式では、主
記憶装置の命令部の写しである命令キヤツシユメ
モリのブロツクに対応して該ブロツク中に含まれ
る分岐命令の分岐先アドレスを、該ブロツクの次
にフエツチされるべきブロツクのアドレスとして
記憶手段に保持している。命令先取り動作におい
て、命令キヤツシユメモリへのアクセスと同時に
前記記憶装置手段をアクセスして前記分岐先アド
レスを読出し、読み出された分岐先アドレスによ
り先取りすべき命令のアドレスを決定している点
において、この方式は上述の従来の3つの予測方
式と異なり処理の迅速化に有効である。しかし、
この方式では、命令キヤツシユメモリのブロツク
対応で予測するため、該ブロツクに分岐命令が複
数個存在するときにはそのそれぞれの分岐命令に
対応して予測を行なうことができない。この結
果、精度の粗い予測的中率しか得られないという
欠点がある。
A prediction method that eliminates this drawback was developed in JP-A-57-
It is shown in Publication No. 59253. In this method, the branch destination address of a branch instruction contained in a block in the instruction cache memory, which is a copy of the instruction part of the main memory, is set as the address of the block to be fetched next after the block. It is retained in the storage means as . In the instruction prefetching operation, the storage device means is accessed at the same time as the instruction cache memory is accessed to read the branch destination address, and the address of the instruction to be prefetched is determined based on the read branch destination address. , this method is different from the three conventional prediction methods described above and is effective in speeding up the processing. but,
In this method, prediction is made in correspondence with blocks in the instruction cache memory, so when a plurality of branch instructions exist in the block, prediction cannot be made in correspondence with each branch instruction. As a result, there is a drawback that only a prediction hit rate with low accuracy can be obtained.

発明の目的 本発明の目的は上述の欠点を除去するようにし
た命令先取り装置を提供することにある。
OBJECTS OF THE INVENTION It is an object of the invention to provide an instruction prefetching device which eliminates the above-mentioned drawbacks.

発明の構成 本発明の命令先取り装置は、読み出された命令
を順次実行する命令実行手段と、分岐命令のアド
レスを指定する情報と該分岐命令の分岐先アドレ
スを含む分岐情報とを対にして複数対記憶する分
岐ヒストリテーブル手段と、命令先取り動作を行
う際に、該命令先取り動作において先取りされる
分岐命令のアドレスを指定する情報が前記分岐ヒ
ストリテーブル手段に登録されているか否かを調
べる点検手段と、該点検手段による登録の判明に
応答して前記分岐ヒストリテーブル手段から対応
する分岐情報を読出し該分岐情報に従つて命令先
取り動作を継続せしめるよう制御する命令先取り
制御手段と、分岐命令の実行結果と該分岐命令に
対応する前記分岐ヒストリテーブル手段の前記分
岐情報とが一致するか否かを判別する第1の判別
手段と、該分岐命令が計数分岐命令であるか否か
を判別する第2の判別手段と、前記命令実行手段
で該計数分岐命令が分岐を行なつたか否かを判別
する第3の判別手段と、前記第1の判別手段にお
ける判別結果が一致を示すとき前記分岐ヒストリ
テーブル手段の前記分岐命令に対応する分岐情報
の変更を行わない第1の制御と、前記第1、第2
および第3の判別結果に応じて第1の判別結果が
不一致を示しかつ第2の判別結果が計数分岐命令
を示しかつ第3の判別結果が命令実行手段で該計
数分岐命令が分岐を行わなかつたことを示すとき
前記分岐ヒストリテーブル手段の該計数分岐命令
に対応する分岐情報の変更を行わない第2の制御
と、第1の判別結果が不一致を示しかつ第2の判
別結果が計数分岐命令でないことを示すとき前記
分岐ヒストリテーブル手段の該分岐命令に対応す
る分岐情報を該分岐命令の実行結果に基づいて更
新する第3の制御と、第1の判別結果が不一致を
示しかつ第2の判別結果が計数分岐命令を示しか
つ第3の判別結果が命令実行手段で該計数分岐命
令が分岐を行なつたことを示すとき前記分岐ヒス
トリテーブル手段の該計数分岐命令に対応する分
岐情報を該計数分岐命令の実行結果に基づいて更
新する第4の制御とを行なう更新制御手段とを備
えている。
Composition of the Invention The instruction prefetching device of the present invention combines instruction execution means for sequentially executing read instructions, and branch information including information specifying the address of a branch instruction and a branch destination address of the branch instruction. A branch history table means for storing a plurality of pairs, and when performing an instruction prefetch operation, checking to check whether information specifying the address of a branch instruction to be prefetched in the instruction prefetch operation is registered in the branch history table means. means, instruction prefetch control means for reading corresponding branch information from the branch history table means in response to confirmation of registration by the checking means, and controlling the instruction prefetch operation to continue in accordance with the branch information; a first determining means for determining whether an execution result matches the branch information of the branch history table means corresponding to the branch instruction; and a first determining means for determining whether the branch instruction is a counting branch instruction. a second determining means, a third determining means for determining whether or not the counting branch instruction has executed a branch in the instruction execution means; a first control that does not change branch information corresponding to the branch instruction of the history table means;
and according to the third determination result, the first determination result indicates a mismatch, the second determination result indicates a counting branch instruction, and the third determination result indicates that the counting branch instruction does not branch in the instruction execution means. A second control that does not change the branch information corresponding to the counting branch instruction of the branch history table means and a first determination result indicating a mismatch and a second determination result indicating that the counting branch instruction a third control for updating the branch information corresponding to the branch instruction in the branch history table means based on the execution result of the branch instruction; When the determination result indicates a counted branch instruction and the third determination result indicates that the counted branch instruction executed a branch in the instruction execution means, the branch information corresponding to the counted branch instruction in the branch history table means is retrieved. and update control means for performing update control based on the execution result of the count branch instruction.

発明の原理と作用 本発明の特徴は分岐命令の実行における分岐方
向に加えて分岐先アドレスがその同じ分岐命令の
過去の結果の把握により比較的高い的中率で予測
可能であるという事実と、ループ回数を管理する
ために同じ計数分岐命令(以下BCT命令と呼ぶ)
を多数回繰返すようなループを構成するプログラ
ムにおいてループから脱出する際のBCT命令は
途中のBCT命令とは分岐方向が異なるという事
実と、脱出したループに再び入つた時のBCT命
令は、ループを脱出する時のBCT命令とは、分
岐方向が異なるという事実に基いて装置が動作す
ることにある。
Principle and Operation of the Invention The present invention is characterized by the fact that in addition to the branch direction in the execution of a branch instruction, the branch destination address can be predicted with a relatively high accuracy rate by understanding the past results of the same branch instruction; The same counting branch instruction (hereinafter referred to as BCT instruction) is used to manage the number of loops.
In a program that configures a loop that repeats many times, the BCT instruction when exiting from the loop has a different branch direction from the BCT instruction in the middle, and the BCT instruction when re-entering the loop that exited from the loop The BCT instruction when escaping means that the device operates based on the fact that the branch directions are different.

発明の実施例 次に本発明の一実施例を図面を参照して詳細に
説明する。第1図を参照すると本発明の一実施例
は、命令アドレス生成回路401、命令アドレス
変換回路402、命令解読回路403、オペラン
ドアドレス生成回路404、オペランドアドレス
変換回路405、オペランド記憶回路を有するオ
ペランド読出し回路406、命令実行回路40
7、命令記憶回路408、命令バツフア409、
分岐ヒストリテーブル(BHT)410、命令ア
ドレスレジスタ411、命令アドレス加算回路4
12、分岐情報バツフア413、命令整列回路4
14、分岐情報切換回路415、分岐情報レジス
タ416,417,418、および419、予測
確認回路420、アドレス生成回路421、選択
回路422、レジスタ423、命令先取り制御回
路424およびフリツプフロツプ425から構成
されている。
Embodiment of the Invention Next, an embodiment of the present invention will be described in detail with reference to the drawings. Referring to FIG. 1, one embodiment of the present invention is an operand reading circuit having an instruction address generation circuit 401, an instruction address conversion circuit 402, an instruction decoding circuit 403, an operand address generation circuit 404, an operand address conversion circuit 405, and an operand storage circuit. Circuit 406, instruction execution circuit 40
7, instruction storage circuit 408, instruction buffer 409,
Branch history table (BHT) 410, instruction address register 411, instruction address addition circuit 4
12, branch information buffer 413, instruction alignment circuit 4
14. Consists of a branch information switching circuit 415, branch information registers 416, 417, 418, and 419, a prediction confirmation circuit 420, an address generation circuit 421, a selection circuit 422, a register 423, an instruction prefetch control circuit 424, and a flip-flop 425. .

命令記憶回路408およびオペランド読出し回
路406内のオペランド記憶回路はともに主記憶
装置そのものであつてもよく、さらに命令記憶回
路408が主記憶装置の命令部の一部の写しであ
る命令キヤツシユメモリ、前記オペランド記憶回
路が主記憶装置のオペランド部の一部の写しであ
るオペランドキヤツシユメモリとして構成されう
る。前記命令キヤツシユメモリおよびオペランド
キヤツシユメモリの詳細は、特開昭56−87282号
公報を参照できる。
Both the instruction storage circuit 408 and the operand storage circuit in the operand readout circuit 406 may be main memory itself; further, an instruction cache memory in which the instruction storage circuit 408 is a copy of a portion of the instruction portion of the main memory; The operand storage circuit may be configured as an operand cache memory that is a copy of a portion of the operand portion of the main memory. For details of the instruction cache memory and operand cache memory, refer to Japanese Patent Laid-Open No. 87282/1982.

本発明は前述の命令の処理単位に対応した装置
構成を必ずしも有する必要はなく、例えば、命令
アドレス生成回路401とオペランドアドレス生
成回路404、命令アドレス変換回路405、命
令記憶回路408とオペランド読出し回路406
内の記憶回路が共用されたコンピユータシステム
においても適用され得る。
The present invention does not necessarily have a device configuration corresponding to the above-mentioned instruction processing units; for example, an instruction address generation circuit 401, an operand address generation circuit 404, an instruction address conversion circuit 405, an instruction storage circuit 408, and an operand readout circuit 406.
The present invention can also be applied to computer systems in which memory circuits are shared.

第1図において前記分岐ヒストリテーブル
(BHT)410は分岐命令のアドレスを指定する
情報と該分岐命令の実行の予測としての分岐成否
フラグと分岐先アドレスとを第3図に示すように
対にして記憶している。前記命令記憶回路408
に対する前記命令アドレスレジスタ(IAR)41
1は、命令読出しのリクエストアドレスを保持し
て命令の読出し動作を実行する。
In FIG. 1, the branch history table (BHT) 410 pairs information specifying the address of a branch instruction, a branch success/failure flag as a prediction of execution of the branch instruction, and a branch destination address as shown in FIG. I remember. The instruction storage circuit 408
The instruction address register (IAR) 41 for
1 holds the instruction read request address and executes the instruction read operation.

さらに前記命令アドレスレジスタ411
(IAR)は分岐ヒストリテーブル410(BHT)
および命令アドレス加算回路412に信号線10
1を介して接続されている。前記レジスタ411
の内容は該分岐ヒストリテーブル410(BAT)
を索引し読出されるべき命令のアドレスがそれに
登録されているか否かを示す信号を信号線106
に出力する。登録されていれば対応する分岐先ア
ドレスが信号線105に読出される。登録されて
いなければ前記命令アドレス加算回路412によ
り後続の命令語の命令先取りのためのアドレスが
生成される。
Furthermore, the instruction address register 411
(IAR) is branch history table 410 (BHT)
and the signal line 10 to the instruction address addition circuit 412.
1. The register 411
The contents of the branch history table 410 (BAT)
A signal indicating whether the address of the instruction to be indexed and read is registered in the signal line 106
Output to. If registered, the corresponding branch destination address is read out to the signal line 105. If it is not registered, the instruction address addition circuit 412 generates an address for prefetching the instruction of the subsequent instruction word.

前記命令アドレス加算回路412は1回のリク
エストで読出される命令語を8Byteと仮定したと
きに“IAR+8”を出力107に生成する回路で
ある。前記命令バツフア409は、命令記憶回路
408から読出された8Byteの先取り命令語を蓄
積し命令処理部への命令の供給における待行列
(Queue)を形成する。前記命令整列回路414
は、命令バツフア409が空のとき信号線102
を介して命令記憶回路408から読出される
8Byteの命令語に応答して前記命令バツフア40
9が空でないとき信号線103を介して前記命令
バツフアに貯えられる8Byteの命令語に応答して
命令を抽出して信号線104を介して命令解読回
路403に命令を供給する回路である。
The instruction address addition circuit 412 is a circuit that generates "IAR+8" at the output 107 when it is assumed that the instruction word read in one request is 8 bytes. The instruction buffer 409 stores 8-byte prefetched instruction words read from the instruction storage circuit 408 and forms a queue for supplying instructions to the instruction processing section. The instruction alignment circuit 414
is the signal line 102 when the command buffer 409 is empty.
is read from the instruction storage circuit 408 via
In response to the 8-byte command word, the command buffer 40
9 is not empty, this circuit extracts an instruction in response to the 8-byte instruction word stored in the instruction buffer via the signal line 103 and supplies the instruction to the instruction decoding circuit 403 via the signal line 104.

命令解読回路403は、信号線104を介して
命令語が与えられると、その命令語長と、その命
令語がBCT命令であるか否かを信号線126に
より分岐情報レジスタ417に報告する機能を有
する。前記分岐情報バツフア413は、前記命令
バツフア409に格納される命令語に対して用意
されておりその命令語中に分岐成功と予測された
分岐命令が存在すれば、第7図に示す該分岐命令
の分岐情報を格納する回路であり、分岐命令のア
ドレスは信号線101を介してまた分岐情報とし
ての分岐先アドレスおよびVビツトは分岐ヒスト
リテーブル410(BHT)から信号線105を
介してそれぞれセツトされ、分岐成功と予測され
た分岐命令が存在しなければ、Vビツトは0に、
分岐命令のアドレスは信号線101を介してそれ
ぞれセツトされる。前記分岐情報切替回路415
は、命令バツフア409が空のとき信号線101
および105を介して与えられる前記分岐情報を
そうでないときに前記分岐情報バツフア413を
介して与えられる前記分岐情報をそれぞれ出力す
る。前記レジスタ416,417および418は
それぞれ分岐命令の命令解読、命令アドレス生
成、アドレス変換の各処理ステージに対応しその
分岐情報を保持する。前記分岐情報レジスタ41
9はその分岐先アドレス部を該分岐命令の実行に
よつて生成される実際の分岐アドレスに置き換え
て保持するレジスタである。レジスタ417,4
18および419は第8図に示す分岐情報を保持
する。前記予測確認回路420は分岐命令の実行
によつて生成される実際の分岐先アドレス、およ
び分岐成否結果と、前記分岐情報レジスタ418
に保持される該分岐命令の予測情報との一致をと
る回路である。前記アドレス生成回路421は前
記分岐情報レジスタ419に保持される分岐命令
のアドレスと該分岐命令自身の命令語長とを加算
し分岐NOGO側の命令の命令アドレスを生成す
る。前記選択回路422は分岐命令の成否信号線
110の状態に応答して該信号線の状態が分岐
GOを示すとき線115を介して与えられる前記
分岐情報レジスタ419に保持される分岐先アド
レス部の出力を選択し、前記信号線の状態が分岐
NOGOを示すとき信号線116を介して与えら
れる前記アドレス生成回路421の出力を選択
し、信号線113を介して該選択回路422の出
力をレジスタ423と命令アドレスレジスタ
(IAR)411とに供給する。前記レジスタ42
3は分岐命令の予測が失敗したとき分岐ヒストリ
テーブル410(BHT)を更新するためのもの
であり、さらに信号線117を介して命令アドレ
スレジスタ411(IAR)に命令先取りのための
新たなアドレスを供給する。前記命令先取り制御
回路424は線106を介して分岐ヒストリテー
ブル410(BHT)から与えられる分岐予測信
号および予測確認回路から線112を介して与え
られる予測成否信号に基づいて命令アドレスレジ
スタ411(IAR)の入力を制御する回路であ
る。
The instruction decoding circuit 403 has a function of reporting the instruction word length and whether or not the instruction word is a BCT instruction to the branch information register 417 via the signal line 126 when an instruction word is given via the signal line 104. have The branch information buffer 413 is prepared for the instruction word stored in the instruction buffer 409, and if there is a branch instruction predicted to be a successful branch in the instruction word, the branch information buffer 413 is prepared for the instruction word stored in the instruction buffer 409. The branch instruction address is set via the signal line 101, and the branch destination address and V bit as branch information are set from the branch history table 410 (BHT) via the signal line 105. , if there is no branch instruction predicted as a successful branch, the V bit becomes 0;
The address of each branch instruction is set via signal line 101. The branch information switching circuit 415
When the command buffer 409 is empty, the signal line 101
and 105, otherwise the branch information provided via the branch information buffer 413 is output, respectively. The registers 416, 417, and 418 correspond to each processing stage of instruction decoding, instruction address generation, and address translation of a branch instruction, and hold branch information thereof. The branch information register 41
A register 9 replaces the branch destination address field with an actual branch address generated by executing the branch instruction. register 417,4
18 and 419 hold branch information shown in FIG. The prediction confirmation circuit 420 stores the actual branch destination address and branch success/failure result generated by executing the branch instruction, and the branch information register 418.
This circuit matches prediction information of the branch instruction held in the branch instruction. The address generation circuit 421 adds the address of the branch instruction held in the branch information register 419 and the instruction word length of the branch instruction itself to generate an instruction address of the instruction on the branch NOGO side. The selection circuit 422 responds to the state of the branch instruction success/failure signal line 110 to determine whether the state of the signal line is branched.
When indicating GO, the output of the branch destination address part held in the branch information register 419 given via line 115 is selected, and the state of the signal line is changed to branch.
When indicating NOGO, the output of the address generation circuit 421 given through the signal line 116 is selected, and the output of the selection circuit 422 is supplied to the register 423 and the instruction address register (IAR) 411 through the signal line 113. . The register 42
3 is for updating the branch history table 410 (BHT) when prediction of a branch instruction fails, and also inputs a new address for instruction prefetching to the instruction address register 411 (IAR) via the signal line 117. supply The instruction prefetch control circuit 424 controls the instruction address register 411 (IAR) based on the branch prediction signal provided from the branch history table 410 (BHT) via line 106 and the prediction success/failure signal provided from the prediction confirmation circuit via line 112. This is a circuit that controls the input of the

次に前記分岐ヒストリテーブル410
(BHT)、前記予測確認回路420および前記命
令先取り制御回路424の詳細なブロツク図とタ
イムチヤートを参照しながら本実施例の動作を詳
細に説明する。
Next, the branch history table 410
(BHT) The operation of this embodiment will be described in detail with reference to detailed block diagrams and time charts of the prediction confirmation circuit 420 and the instruction prefetch control circuit 424.

第2図を参照すると、前記分岐ヒストリテーブ
ル410(BHT)は、デイレクトリ記憶部50
1、データ記憶部502、テスト回路503,5
04,505,および506、プライオリテイ回
路507、レベル選択回路508、およびオア回
路509を備えている。前記記憶部501および
502は、1回のリクエストに対して命令記憶回
路408から読出される命令語の単位をブロツク
の単位とし、セツト数m、レベル数nの記憶部で
ある。
Referring to FIG. 2, the branch history table 410 (BHT) is stored in the directory storage unit 50.
1. Data storage section 502, test circuit 503, 5
04, 505, and 506, a priority circuit 507, a level selection circuit 508, and an OR circuit 509. The storage units 501 and 502 are storage units with the number of sets m and the number of levels n, in which the unit of the instruction word read from the instruction storage circuit 408 in response to one request is the unit of block.

第3図を参照すると、記憶部501には分岐命
令の命令アドレスの一部とその内容が有効か否か
を示すVビツトが格納され記憶部502には分岐
先アドレスの実アドレスが格納されている。前記
Vビツトは対応する分岐ヒストリテーブル
(BHT)410のワードの有効性を示すと同時に
該分岐命令の実行の予測としての分岐成否フラグ
の機能を有する。
Referring to FIG. 3, a part of the instruction address of a branch instruction and a V bit indicating whether or not the contents are valid are stored in a storage unit 501, and a real address of a branch destination address is stored in a storage unit 502. There is. The V bit indicates the validity of the word in the corresponding branch history table (BHT) 410, and at the same time functions as a branch success/failure flag as a prediction of execution of the branch instruction.

この分岐ヒストリテーブル(BHT)410へ
の索引は以下のようなセツトアソシアテイブ法に
よつて行われる。
Indexing into the branch history table (BHT) 410 is performed by the set associative method as described below.

第2図に示される前記テスト回路503,50
4,505,および506はテーブル410の各
レベルに対応して命令アドレスレジスタ411
(IAR)に保持されるリクエストアドレスが各レ
ベルのBHT−AAi(iはレベルに対応するサフイ
クスを示す)に登録されているか否かを示す信号
を信号線130,131,132,133に出力
する。第4図を参照すると、前記テスト回路50
3,504,505および506のそれぞれは、
一致回路701および大小比較回路702から構
成されている。
The test circuits 503, 50 shown in FIG.
4, 505, and 506 are instruction address registers 411 corresponding to each level of the table 410.
A signal indicating whether the request address held in (IAR) is registered in BHT-AAi of each level (i indicates the suffix corresponding to the level) is output to signal lines 130, 131, 132, and 133. . Referring to FIG. 4, the test circuit 50
3,504, 505 and 506 are each
It consists of a match circuit 701 and a magnitude comparison circuit 702.

前記一致回路701では、命令アドレスレジス
タ(IAR)411に保持されるリクエストアドレ
スの一部IAR(:18−28)をセツトアドレスとし
て読出された記憶部501の各レベルの内容と前
記レジスタ411の内容IAR(:4−17)とが比
較され、等しいアドレスが存在するか否かを検出
する。該一致回路701の出力により命令アドレ
スレジスタ(IAR)411に保持されるリクエス
トアドレスで読出されるべき命令語の8Byteブロ
ツク中にすでに分岐ヒストリテーブル(BHT)
410に登録された分岐命令が存在するか否か
が、判明する。しかしリクエストアドレスとそれ
が読出すべき分岐命令との対応をとるには上記一
致検出のみでは不十分である。第5図を参照する
と、1回のリクエストで読出される8Byteの命令
語のブロツク中に2Byte命令BC0,A,BC1
BC2の4個の命令が存在する。命令BC0,BC1
BC2がともに分岐成功と予測された分岐命令であ
るときには、各々の分岐命令はともにそのアドレ
スの一部が記憶部(BHT−AA)501に登録
される。このとき他の分岐命令から命令Aに分岐
して命令Aのアドレス〈A〉が前記命令語のブロ
ツクを読出すためのリクエストアドレスとして命
令アドレスレジスタ(IAR)411に保持される
ときには、分岐ヒストリテーブル(BHT)41
0から読出されるべき分岐命令の情報は命令の実
行の経路から分岐命令BC1の情報でなければなら
ない。
In the matching circuit 701, the contents of each level of the storage section 501 and the contents of the register 411 are read out using part IAR (:18-28) of the request address held in the instruction address register (IAR) 411 as a set address. IAR(:4-17) is compared to detect whether an equal address exists. The branch history table (BHT) is already in the 8-byte block of the instruction word to be read at the request address held in the instruction address register (IAR) 411 by the output of the matching circuit 701.
It is determined whether a branch instruction registered in 410 exists. However, the above-mentioned coincidence detection alone is not sufficient to establish a correspondence between the request address and the branch instruction from which it should be read. Referring to FIG. 5, in the block of 8-byte instruction words read in one request, 2-byte instructions BC 0 , A, BC 1 ,
There are four instructions with BC 2 . Instructions BC 0 , BC 1 ,
When both BC 2 are branch instructions predicted to be branch successes, part of the address of each branch instruction is registered in the storage unit (BHT-AA) 501. At this time, when branching to instruction A from another branch instruction and the address <A> of instruction A is held in the instruction address register (IAR) 411 as a request address for reading the block of the instruction word, the branch history table (BHT)41
The information of the branch instruction to be read from 0 must be the information of the branch instruction BC1 from the instruction execution path.

従つて前記レジスタ(IAR)411に保持され
るリクエストアドレスと前記記憶部(BHT−
AAi)501に保持される分岐命令のアドレスと
の関係が上記の一致条件とともに次の関係が成立
するとき、対応するレベルのBHT−HITi信号が
生成される。この信号は線130−133を介し
てオア回路509に与えられ、該BHT−HITi信
号のオア信号が線106を介して出力され分岐予
測信号(BHT−HITとなる。
Therefore, the request address held in the register (IAR) 411 and the storage unit (BHT-
AAi) When the following relationship with the address of the branch instruction held in 501 holds together with the above matching condition, a BHT-HITi signal of the corresponding level is generated. This signal is applied to the OR circuit 509 via lines 130-133, and the OR signal of the BHT-HITi signal is output via line 106 to become a branch prediction signal (BHT-HIT).

BHT−HITi={IAR(:4−17)=BHT−AAi (:4−17)} ∩{IAR(:29,30)≦BHT−AAi (:29,30)} ∩BHT−AAi(V) 再び第4図を参照すると、前記大小比較回路
は、この条件を実現する回路である。
BHT−HITi={IAR(:4−17)=BHT−AAi (:4−17)} ∩{IAR(:29, 30)≦BHT−AAi (:29,30)} ∩BHT−AAi(V) Referring again to FIG. 4, the magnitude comparison circuit is a circuit that realizes this condition.

さらに前記信号BHT−HITiの条件が2ケ以上
のレベルにおいて成立したとき記憶部501の対
応するレベル(BHT−AAi)に保持される分岐
命令のアドレスの8Byteブロツク内アドレス
BHT−AAi(:29,30)の値の最も小さいレベル
が選択される必要がある。再び第5図を参照する
と、命令BC1およびBC2の分岐命令関係情報が格
納される分岐ヒストリーテーブル410のレベル
で前記信号BHT−HITi条件が共に成立する。こ
のとき命令の実行の経路から命令BC1に対するレ
ベルが選択される必要がある。
Furthermore, when the condition of the signal BHT-HITi is satisfied at two or more levels, the address within the 8-byte block of the branch instruction address held at the corresponding level (BHT-AAi) in the storage unit 501.
The level with the smallest value of BHT−AAi (:29, 30) needs to be selected. Referring again to FIG. 5, the signal BHT-HITi conditions are both satisfied at the level of the branch history table 410 in which branch instruction related information of instructions BC 1 and BC 2 is stored. At this time, the level for instruction BC 1 needs to be selected from the instruction execution path.

前記プライオリテイ回路507は、前記信号
BHT−HITiの2ケ以上の成立に対するものであ
り、この出力により記憶部BHT−DA502のセツ
トアドレスIAR(:18−28)で示されるエントリ
の分岐先アドレスがレベル選択回路508を介し
て読出される。
The priority circuit 507 receives the signal
This is for the establishment of two or more BHT-HITi, and by this output, the branch destination address of the entry indicated by the set address IAR (:18-28) of the storage unit BHT-DA502 is read out via the level selection circuit 508. Ru.

第6図を参照すると、前記プライオリテイ回路
507はアンド回路群601−604およびオア
回路群605−608から構成されている。前記
アンド回路群601−604はn+1個並列に配
置されている。前記第2図におけるレベル選択回
路508のnケのレベルの選択信号は第6図にお
ける信号V0,V1,V2,V3により以下のように与
えられる。
Referring to FIG. 6, the priority circuit 507 is composed of a group of AND circuits 601-604 and a group of OR circuits 605-608. The n+1 AND circuit groups 601 to 604 are arranged in parallel. The n level selection signals of the level selection circuit 508 in FIG. 2 are given by the signals V 0 , V 1 , V 2 , and V 3 in FIG. 6 as follows.

V0のとき V0L0,V0L1,……,V0Lo 0・V1のとき V1L0,V1L1,……,V1Lo 01・V2 V2L0,V2L1,……,V2Lo 012・V3のとき V3L0,V3L1,……,
V3Lo 以上のようにして第2図におけるレベル選択回
路508から読出された分岐情報は第1図の命令
記憶回路408から読出される命令と対応づける
ことが可能である。
When V 0 , V 0 L 0 , V 0 L 1 , ..., V 0 L o 0 V 1, V 1 L 0 , V 1 L 1 , ..., V 1 L o 01・V 2 When V 2 L 0 , V 2 L 1 , ..., V 2 L o 012・V 3 V 3 L 0 , V 3 L 1 , ...,
V 3 Lo The branch information read out from the level selection circuit 508 in FIG. 2 as described above can be associated with the instruction read out from the instruction storage circuit 408 in FIG. 1.

第10図には、命令記憶回路408における命
令と分岐ヒストリテーブル(BHT)410にお
ける分岐情報の上記対応関係が示されている。命
令の実行順序が命令A0、分岐命令BC0,B1
BC1,B2,B3,BC2,C1,C2……と予測された
場合である。なお、〈A〉はA命令のアドレスを、
BCjは分岐命令をそれぞれ示す。
FIG. 10 shows the above-mentioned correspondence between instructions in the instruction storage circuit 408 and branch information in the branch history table (BHT) 410. The instruction execution order is instruction A 0 , branch instructions BC 0 , B 1 ,
This is a case where BC 1 , B 2 , B 3 , BC 2 , C 1 , C 2 . . . are predicted. In addition, <A> is the address of the A instruction,
BCj each indicates a branch instruction.

第11図を参照すると、前記第10図に示した
分岐ヒストリテーブルBHT410による命令先
取り動作は次のようにされる。リクエストアドレ
スの命令アドレスレジスタ411のセツトに応答
して命令記憶回路408から命令語が読出され、
これと同時にテーブルBHT410が索引される。
信号線106を介してBHT−HIT信号が出力さ
れると記憶部BHT−DA502の分岐先アドレ
ス〈B1〉がアドレスレジスタ411にセツトさ
れ、次の命令先取りが行われる。前記信号線10
6を介してBHT−HIT信号が出力されないとき
には命令アドレス加算回路412に命令Aの8バ
イト境界弁アドレス〈A〉が与えられ、「8」加
算されたアドレスが出力され、次の命令先取りが
逐次行われる。
Referring to FIG. 11, the instruction prefetching operation by the branch history table BHT 410 shown in FIG. 10 is performed as follows. An instruction word is read from the instruction storage circuit 408 in response to the setting of the instruction address register 411 of the request address.
At the same time, table BHT410 is indexed.
When the BHT-HIT signal is output via the signal line 106, the branch destination address <B 1 > of the storage unit BHT-DA 502 is set in the address register 411, and the next instruction is prefetched. The signal line 10
When the BHT-HIT signal is not output through 6, the 8-byte boundary valve address <A> of instruction A is given to the instruction address addition circuit 412, and the address added by 8 is output, and the next instruction is prefetched sequentially. It will be done.

以上の命令の先取りに従えば命令記憶回路40
8から読出される命令語は、テーブルBHT41
0の内容による予測に従つて順次読出され、命令
バツフア409には予測された命令の実行順に格
納することが可能である。
According to the above instruction preemption, the instruction storage circuit 40
The instruction word read from 8 is table BHT41
The instructions are sequentially read out according to the prediction based on the contents of 0, and can be stored in the instruction buffer 409 in the predicted execution order of the instructions.

このときたとえ信号BHT−HITが出力されて
も分岐予測方向と反対側の命令先取り動作を一部
行わせしめた後に分岐予測方向の命令先取り動作
を行つてもよい。
At this time, even if the signal BHT-HIT is output, the instruction prefetching operation in the branch prediction direction may be performed after a part of the instruction prefetching operation in the opposite direction to the branch prediction direction is performed.

以上のようにして命令先取りされた命令が分岐
命令で第1図の命令整列回路414により命令解
読回路403に導かれたとき同時に該分岐命令に
対応する分岐情報が最初の分岐情報レジスタ41
6(QR0)にセツトされる。
When the instruction prefetched as described above is a branch instruction and is guided to the instruction decoding circuit 403 by the instruction alignment circuit 414 in FIG.
It is set to 6 (QR 0 ).

以降前記分岐命令の進行に伴い前記命令解読、
アドレス変換に対応して前記分岐情報が第2およ
び第3の分岐情報レジスタ417(QR1)および
418(QR2)に転送される。そして前記分岐命
令の実行によつて生成される実際の分岐命令の生
成結果と前記分岐情報レジスタ418(QR2)に
保持される該分岐命令の予測情報との一致が予測
確認回路420によりチエツクされる。第9図を
参照すると、前記予測確認回路420は一致回路
801、フリツプフロツプ802および803、
真偽回路804−807、アンド回路808−8
13、およびオア回路814から構成されてい
る。前記一致回路801には分岐命令の実行によ
り生成された分岐先アドレスの実アドレスが命令
アドレス変換回路402から信号線109を介し
て与えられるとともに、分岐情報レジスタ418
(QR2)から予測された分岐先が信号線108を
介して与えられる。前記一致回路801では両者
の一致、不一致が判定され、判定結果は前記フリ
ツプフロツプ802にセツトされる。前記レジス
タ418から線108を介して与えられるVビツ
トは前記フリツプフロツプ803にセツトされ
る。
Thereafter, as the branch instruction progresses, the instruction is decoded,
The branch information is transferred to second and third branch information registers 417 (QR 1 ) and 418 (QR 2 ) in response to address conversion. Then, the prediction confirmation circuit 420 checks whether the actual branch instruction generation result generated by the execution of the branch instruction matches the prediction information of the branch instruction held in the branch information register 418 (QR 2 ). Ru. Referring to FIG. 9, the prediction confirmation circuit 420 includes a coincidence circuit 801, flip-flops 802 and 803,
Truth/false circuits 804-807, AND circuits 808-8
13 and an OR circuit 814. The matching circuit 801 is given the real address of the branch destination address generated by the execution of the branch instruction from the instruction address conversion circuit 402 via the signal line 109, and the branch information register 418
The branch destination predicted from (QR 2 ) is given via signal line 108. The coincidence circuit 801 determines whether the two match or do not match, and the determination result is set in the flip-flop 802. The V bit provided on line 108 from the register 418 is set in the flip-flop 803.

命令実行回路407から信号線110を介して
与えられる分岐の成否信号、レジスタ419から
信号線130を介して与えられるBCTビツト、
および前記フリツプフロツプ802および803
から真偽回路804−807、アンド回路808
−813を通して、Vビツトが0、すなわち、分
岐NOGO予測であつて実際の分岐成否結果がGO
であつた場合の予測NOGO失敗信号と、Vビツ
トが1、すなわち、分岐GO予測であつて分岐先
アドレスも一致していたにもかかわらず実際の分
岐成否結果がNOGOであつた場合の予測GO失敗
信号と、分岐GO予測であつて分岐先アドレスが
一致していなかつた場合の予測アドレス失敗信号
とが、BCT命令については、それぞれアンド回
路808,809および810で生成される。
BCT命令以外の分岐命令については、それぞれ
アンド回路811,812および813で生成さ
れる。さらに、アンド回路808,810,81
1,812および813の生成する予測失敗信号
は、オア回路814で論理和がとられ、分岐予測
失敗信号として信号線112に出力される。アン
ド回路809の生成する予測失敗信号は、BCT
GO予測失敗信号として信号線131に出力され
る。従つて、BCT命令において分岐GO予測であ
つて、分岐先アドレスが一致していたにもかかわ
らず、予測GO失敗であつた場合には信号線13
1にBCTGO予測失敗信号が出力され、それ以外
の予測失敗の場合には信号線112に分岐失敗信
号が出力される。
A branch success/failure signal given from the instruction execution circuit 407 via the signal line 110, a BCT bit given from the register 419 via the signal line 130,
and said flip-flops 802 and 803
From truth/false circuits 804-807, AND circuit 808
-813, the V bit is 0, that is, the branch NOGO prediction and the actual branch success/failure result is GO.
The predicted NOGO failure signal when the V bit is 1, that is, the predicted GO when the actual branch success/failure result is NOGO even though it was a branch GO prediction and the branch destination address also matched. A failure signal and a predicted address failure signal for a branch GO prediction in which the branch destination addresses do not match are generated by AND circuits 808, 809, and 810, respectively, for the BCT instruction.
Branch instructions other than BCT instructions are generated by AND circuits 811, 812, and 813, respectively. Furthermore, AND circuits 808, 810, 81
The prediction failure signals generated by branch prediction failure signals 1, 812, and 813 are logically summed by an OR circuit 814, and outputted to the signal line 112 as a branch prediction failure signal. The prediction failure signal generated by the AND circuit 809 is BCT
It is output to the signal line 131 as a GO prediction failure signal. Therefore, if the BCT instruction predicts a branch GO and the predicted GO fails even though the branch destination addresses match, the signal line 13
A BCTGO prediction failure signal is output to the signal line 112, and a branch failure signal is output to the signal line 112 in the case of other prediction failures.

第1図および第12図を参照すると、分岐情報
レジスタ419(QR3)の分岐先アドレス部には
前記命令アドレス変換回路402から新たに生成
される分岐先アドレスがセツトされる。また前記
分岐情報レジスタ419(QR3)の分岐命令BC1
のアドレス部の内容と該分岐命令BC1自身の命令
語長部の内容とがアドレス生成回路421により
加算され分岐NOGO側の命令の命令アドレスが
生成される。
Referring to FIGS. 1 and 12, the branch destination address newly generated from the instruction address conversion circuit 402 is set in the branch destination address field of the branch information register 419 (QR 3 ). Also, the branch instruction BC 1 of the branch information register 419 (QR 3 )
The contents of the address field of the branch instruction BC1 and the contents of the instruction word length field of the branch instruction BC1 itself are added by the address generation circuit 421 to generate the instruction address of the instruction on the branch NOGO side.

そして分岐命令BC1の実際の実行により分岐
GOならば前記分岐情報レジスタ419(QR3
から線115を介して与えられる分岐先アドレス
部の出力〈D1〉が、分岐NOGOならば線116
を介して与えられる前記アドレス生成回路421
の出力〈B2〉が選択回路422により選択され
る。前記分岐命令BC1の分岐予測失敗信号112
が予測確認回路420から発生したとき該選択回
路422の出力〈D1〉が線113を介してレジ
スタ423(WR)にセツトされる。
And branch by actual execution of branch instruction BC 1
If GO, the branch information register 419 (QR 3 )
If the output <D 1 > of the branch destination address field given via line 115 is branch NOGO, line 116
The address generation circuit 421 given via
The output <B 2 > of is selected by the selection circuit 422. Branch prediction failure signal 112 of the branch instruction BC 1
is generated from the prediction confirmation circuit 420, the output <D 1 > of the selection circuit 422 is set to the register 423 (WR) via the line 113.

一方、分岐情報レジスタ419(QR3)の分岐
命令のアドレス〈BC1〉は信号線114を介して
命令アドレスレジスタ411(IAR)にセツトさ
れる。このアドレスは該分岐命令に対応する分岐
ヒストリテーブル410(BHT)の更新のため
線101を介して該テーブル410にライトアド
レスとして供給される。前記分岐予測失敗信号1
12の出力がフリツプフロツプ425に与えら
れ、この出力が指示パルスとして線119を介し
て分岐ヒストリテーブル401に与えられる。こ
の出力に応答して分岐命令の次の命令先取り時の
ための分岐予測情報の更新が行なわれる。この更
新は本実施例では予測NOGO失敗のとき前記レ
ジスタ423(WR)に保持される新たな分岐先
アドレスで行なわれ、予測GO失敗のときはVビ
ツトをリセツトするように行われるが分岐予測情
報の更新におけるアルゴリズムを用いて他の方法
により行なつても差しつかえない。
On the other hand, the branch instruction address <BC 1 > of the branch information register 419 (QR 3 ) is set to the instruction address register 411 (IAR) via the signal line 114. This address is supplied as a write address to the branch history table 410 (BHT) corresponding to the branch instruction via line 101 for updating the table 410 (BHT). The branch prediction failure signal 1
12 is provided to flip-flop 425, which output is provided as an instruction pulse to branch history table 401 via line 119. In response to this output, branch prediction information for prefetching the next instruction of the branch instruction is updated. In this embodiment, this update is performed with a new branch destination address held in the register 423 (WR) when the predicted NOGO fails, and when the predicted GO fails, the V bit is reset, but the branch prediction information It is also possible to use other methods to update the algorithm.

予測失敗したとき予測側に後続する命令の動作
はすべてキヤンセルされ、前記レジスタ423
(WR)に保持される新たなリクエストアドレス
が分岐ヒストリテーブル410(BHT)の更新
後に命令アドレスレジスタ411(IAR)に供給
され改めて命令の取出しが開始される。
When prediction fails, all operations of instructions following the prediction side are canceled, and the register 423
After updating the branch history table 410 (BHT), the new request address held in the branch history table 410 (BHT) is supplied to the instruction address register 411 (IAR), and instruction fetching is started again.

第13図を参照すると、第12図における分岐
命令BC1と同様にBCT命令、BCT1の実際の分岐
先アドレスが命令アドレス変換回路402で生成
され、分岐情報レジスタ419にセツトされる。
さらに、前記レジスタ419の保持するBCT1
身のアドレスと、命令語長がアドレス生成回路4
21で加算され分岐NOGO側のBCT1の次の命令
のアドレス〈B3〉が生成される。
Referring to FIG. 13, the actual branch destination address of the BCT instruction BCT 1 is generated by the instruction address conversion circuit 402 and set in the branch information register 419, similar to the branch instruction BC 1 in FIG.
Furthermore, the address of BCT 1 itself held in the register 419 and the instruction word length are the address generation circuit 4
21 to generate the address <B3> of the next instruction of BCT 1 on the branch NOGO side.

BCT命令BCT1の実際の実行により、命令実行
回路407より信号線110に出力される分岐成
否信号に応じて前記レジスタ419の保持する
GO側分岐先アドレス〈D2〉、または前記アド
レス生成回路421の出力するNOGO側分岐先
アドレス〈B3〉が選択回路422により選択さ
れる。
The register 419 holds data according to the branch success/failure signal output from the instruction execution circuit 407 to the signal line 110 upon actual execution of the BCT instruction BCT 1 .
The GO side branch destination address <D2> or the NOGO side branch destination address <B3> output from the address generation circuit 421 is selected by the selection circuit 422.

前記予測確認回路420より、信号線131の
BCT GO予測失敗信号が出力されると、前記選
択回路422の出力は、信号線113を介してレ
ジスタ423と、命令アドレスレジスタ(2AR)
411に同時にセツトされる。しかし、分岐ヒス
トリテーブル410への指示パルスは信号線11
9に出力されないので、前記テーブル410の予
測情報の更新は行なわれず、すぐ、失敗した命令
の取り出しが実行される。
From the prediction confirmation circuit 420, the signal line 131 is
When the BCT GO prediction failure signal is output, the output of the selection circuit 422 is sent to the register 423 and the instruction address register (2AR) via the signal line 113.
411 at the same time. However, the instruction pulse to the branch history table 410 is
9, the prediction information in the table 410 is not updated, and the failed instruction is immediately retrieved.

第14図を参照すると、前記命令先取り制御回
路424はフリツプフロツプ1201、真偽回路
1202−1205およびアンド回路1206か
ら構成されている。前記フリツプフロツプ120
1は前記分岐予測失敗信号112を1マシンサイ
クル保持するためのフリツプフロツプである。こ
の回路424の出力はアドレスレジスタ411の
前段にあるセレクタの選択指示信号となる。この
選択指示信号は、前記命令アドレス加算回路41
2の出力、前記レジスタ423の出力、前記テー
ブル410の出力、分岐情報レジスタ419の出
力および選択回路422の出力のうちのどれを選
択するかを指示するための信号である。
Referring to FIG. 14, the instruction prefetch control circuit 424 is comprised of a flip-flop 1201, truth/false circuits 1202-1205, and an AND circuit 1206. The flip-flop 120
1 is a flip-flop for holding the branch prediction failure signal 112 for one machine cycle. The output of this circuit 424 becomes a selection instruction signal for the selector in the stage preceding the address register 411. This selection instruction signal is transmitted to the instruction address addition circuit 41.
2, the output of the register 423, the output of the table 410, the output of the branch information register 419, and the output of the selection circuit 422.

なお、この命令先取り制御回路424の制御に
より分岐予測が的中したときには後述する第18
図の命令処理が行なわれ、BCT命令の分岐GO予
測が失敗したときには後述する第20図の命令処
理が行なわれ、それ以外の分岐予測が失敗したと
きには後述する第19図の命令処理が行なわれ
る。前記命令アドレス加算回路412は分岐
NOGO側の命令の先取りを行うためのアドレス
生成を行う。このときアドレスは実アドレスで加
算が行われるために、例えば、ページングを行う
コンピユータシステムにおいて前記アドレス加算
がページ境界を越えた場合アドレス変換を改めて
やり直す必要が生じる。
Note that when the branch prediction is correct under the control of this instruction prefetch control circuit 424, the 18th
The instruction processing shown in the figure is performed, and if the branch GO prediction of the BCT instruction fails, the instruction processing shown in Fig. 20, which will be described later, is performed, and if any other branch prediction fails, the instruction processing shown in Fig. 19, which will be described later, is performed. . The instruction address addition circuit 412 branches
Generates an address to prefetch the NOGO side instruction. At this time, since the address is added as a real address, for example, in a computer system that performs paging, if the address addition exceeds a page boundary, it is necessary to perform address conversion again.

このために前記命令アドレス加算回路412に
ページ境界越え検出回路を設け該検出回路により
ページ境界越えが生じた場合信号線118により
命令アドレス生成回路1を起動し命令先取り動作
を改めて命令アドレス生成回路(IA)401及
び命令アドレス変換回路(IT)402から行う
ように制御すればよい。
For this purpose, a page boundary crossing detection circuit is provided in the instruction address addition circuit 412, and when the detection circuit detects that a page boundary crossing has occurred, the instruction address generation circuit 1 is activated by the signal line 118, and the instruction address generation circuit ( The IA) 401 and the instruction address translation circuit (IT) 402 may perform the control.

ここで問題となるのはあらたに分岐ヒストリテ
ーブルBHT410に前記命令アドレス情報を登
録するとき既存のどの部分に格納された命令アド
レス情報を追い出すかである。
The problem here is which part of the existing instruction address information should be removed when newly registering the instruction address information in the branch history table BHT 410.

この方法としては使われた順序、すなわち最も
古く使われたものから順に追い出す法LRU
(Least Recently Used)、情報が入つた順序、す
なわち最も古く入つたものから順に追い出す方法
FIFO(First In First Out)等があるがどちらを
用いてもよい。
This method uses the order of use, that is, the method of expelling from the oldest used LRU
(Least Recently Used), a method of expelling information in the order in which it was entered, that is, in order from the oldest one.
There are FIFO (First In First Out), etc., but either one may be used.

発明の効果 次に本発明の効果を第15図から第21図を参
照しながら詳細に説明する。
Effects of the Invention Next, the effects of the present invention will be explained in detail with reference to FIGS. 15 to 21.

第15図を参照すると、命令の処理は一般的に
次の8つの処理単位に分けられる。
Referring to FIG. 15, instruction processing is generally divided into the following eight processing units.

(1) IAステージ:実行すべき命令の命令アドレ
ス(論理アドレス)が生成される。
(1) IA stage: The instruction address (logical address) of the instruction to be executed is generated.

(2) ITステージ:生成された命令アドレスのア
ドレス変換が行われる。
(2) IT stage: Address translation of the generated instruction address is performed.

(3) ICステージ:変換された命令の実アドレス
で記憶装置から命令が読出される。
(3) IC stage: The instruction is read from the storage device at the translated real address of the instruction.

(4) IDステージ:読出された命令が解読される。(4) ID stage: The read instruction is decoded.

(5) OAステージ:解読された命令のオペランド
アドレス(論理アドレス)が生成される。
(5) OA stage: The operand address (logical address) of the decoded instruction is generated.

(6) OTステージ:生成されたオペランドアドレ
スのアドレス変換が行なわれる。
(6) OT stage: Address translation of the generated operand address is performed.

(7) OCステージ:変換されたオペランドの実ア
ドレスで記憶装置からオペランドが読出され
る。
(7) OC stage: The operand is read from storage at the translated real address of the operand.

(8) EXステージ:命令が実行される。(8) EX stage: Instruction is executed.

上述のITステージおよびOTステージのアドレ
ス変換においてアドレス変換バツフアを設け必要
な変換テーブルが該アドレス変換バツフアに存在
すれば上記アドレス変換処理は高速に実行し得
る。また、上述のICステージおよびOCステージ
の命令およびオペランドの読出し動作において主
記憶装置のデータの一部の写しを保持するキヤツ
シユメモリを設け必要な命令およびオペランドが
該キヤツシユメモリに存在すればICステージお
よびOCステージの処理は高速に行いうる。情報
処理システムは上述の各処理単位に対応したリソ
ースを必ずしも有する必要はない。しかし、説明
の簡単のためにここでは各処理単位にその機能を
果す回路があるものとする。上述のIT,OTおよ
びIC,OCの各ステージの高速処理が可能なとき
複数の命令の処理の流れを無駄なく実行する8段
のパイプライン制御が可能である。
If an address translation buffer is provided in the address translation of the IT stage and the OT stage, and the necessary translation table exists in the address translation buffer, the address translation process can be executed at high speed. In addition, a cache memory is provided to hold a copy of part of the data in the main memory during the instruction and operand read operations of the IC stage and OC stage, and if the necessary instructions and operands exist in the cache memory, the IC Stage and OC stage processing can be performed at high speed. The information processing system does not necessarily need to have resources corresponding to each of the above-mentioned processing units. However, for ease of explanation, it is assumed here that each processing unit has a circuit that performs its function. When the above-mentioned IT, OT, IC, and OC stages are capable of high-speed processing, eight-stage pipeline control is possible to efficiently execute the processing flow of multiple instructions.

このときの分岐命令を含む命令の処理の流れを
第16図および第17図を参照しながら説明す
る。
The flow of processing instructions including branch instructions at this time will be explained with reference to FIGS. 16 and 17.

第16図は分岐命令の命令先取りにおいて前述
のすべての分岐は“GO”であると予測した場合
の命令の処理の流れを示す。すなわち、命令A0
は分岐命令BCの分岐条件を決定する命令で該分
岐条件は命令A0の実行結果すなわち、時刻t7
において決定される。分岐命令BCは時刻t4に
おいて解読されると命令アドレスの生成回路を用
いて分岐命令B1のアドレスを生成し以後B1命令
を先取りするように動作する。時刻t2,t3,
およびt4には分岐NOGO側の後読命令A1,
A2,およびA3の命令先取りのためのアドレス
生成が開始される。時刻t6およびt7には予測
動作としての分岐GO側の後続命令B2およびB
3の命令先取り動作が開始される。時刻t7にお
いて分岐条件の判定結果により、時刻t8以降は
正しい命令の処理の流れに従つて処理が継続され
る。
FIG. 16 shows the flow of instruction processing when it is predicted that all the aforementioned branches will be "GO" in instruction prefetching of a branch instruction. i.e. instruction A 0
is an instruction that determines the branch condition of branch instruction BC, and the branch condition is the execution result of instruction A0 , that is, time t7.
Determined in When the branch instruction BC is decoded at time t4, it generates the address of the branch instruction B1 using the instruction address generation circuit, and thereafter operates to prefetch the B1 instruction. Time t2, t3,
And at t4, lookbehind instruction A1 on the branch NOGO side,
Address generation for prefetching instructions A2 and A3 is started. At times t6 and t7, subsequent instructions B2 and B on the branch GO side as predicted operations
The instruction prefetch operation of No. 3 is started. Based on the branch condition determination result at time t7, processing continues from time t8 onwards according to the correct instruction processing flow.

この場合、分岐命令の出現によるパイプライン
のロスサイクルは 予測的中(分岐GO)のとき 3サイクル 予測失敗(分岐NOGO)のとき 3サイクル である。
In this case, the pipeline loss cycles due to the appearance of a branch instruction are: 3 cycles when the prediction is correct (branch GO) and 3 cycles when the prediction is unsuccessful (branch NOGO).

分岐GO率γ、予測的中率αとしたときこの場
合γ=αであり予測的中率は5分5分である。従
つてγ=α=0.5であり1分岐命令当り平均的な
ロスサイクルは 3×γ+3×(1−γ)=3サイクル である。
When the branch GO rate γ and the predicted hit rate are α, in this case, γ=α, and the predicted hit rate is 5 minutes and 5 minutes. Therefore, γ=α=0.5, and the average loss cycle per branch instruction is 3×γ+3×(1−γ)=3 cycles.

一方、第17図は分岐命令の命令先取りにおい
て前述の同じ分岐命令の過去の結果に基づいて予
測を行つた場合の命令の処理の流れを示す。すな
わち、分岐命令BCは、時刻t4において解読さ
れるとともに分岐命令のアドレステーブルを探索
しその有無によるかもしくは分岐指示フラグの指
示の予測により、分岐GO側の命令B1を先取り
するか分岐NOGO側の命令A1を先取りするか
を決定する。前回と同様に時刻t2,t3および
t4には分岐NOGO側の後続命令A1,A2お
よびA3の命令先取りのためのアドレス生成が開
始される。時刻t6及びt7には予測による命令
先取りの後続命令B1およびB2もしくはA4お
よびA5の命令のアドレス生成が開始される。時
刻t7において分岐条件の判定結果により時刻t
8以降は正しい命令の処理の流れに従つて処理が
継続される。
On the other hand, FIG. 17 shows the flow of instruction processing when prediction is performed based on the past results of the same branch instruction described above in instruction prefetching of a branch instruction. That is, the branch instruction BC is decoded at time t4, and the address table of the branch instruction is searched, and depending on the presence or absence of the instruction or the prediction of the instruction of the branch instruction flag, the branch instruction B1 on the branch GO side is preempted or the instruction B1 on the branch NOGO side is preempted. Determine whether to prefetch instruction A1. Similarly to the previous time, address generation for prefetching the subsequent instructions A1, A2, and A3 on the branch NOGO side is started at times t2, t3, and t4. At times t6 and t7, generation of addresses for subsequent instructions B1 and B2 or A4 and A5 of instruction prefetching based on prediction is started. At time t7, time t is determined based on the branch condition determination result.
From 8 onwards, processing continues according to the correct instruction processing flow.

この場合分岐命令の出現によるパイプラインの
ロスサイクルは 分岐GOと予測して的中したとき 3サイクル 分岐NOGOと予測して的中したとき
0サイクル 分岐GOと予測して失敗したとき 3サイクル 分岐NOGOと予測して失敗したとき
6サイクル である。従つて、分岐GO率γ=0.5、予測的中率
α=0.8と仮定したとき1分岐命令当りの平均的
なロスサイクルは 3・γ・α+0・(1-γ)・α+3・γ・(1-α) +6・(1−γ)・(1−α)=2.1サイクル を得る。
In this case, the loss cycles in the pipeline due to the appearance of a branch instruction are: 3 cycles when the prediction of branch GO is correct; 3 cycles when the prediction of branch NOGO is correct;
0 cycles: When predicting branch GO and failing 3 cycles: When predicting branch NOGO and failing
It is 6 cycles. Therefore, assuming that the branch GO rate γ = 0.5 and the predicted hit rate α = 0.8, the average loss cycle per branch instruction is 3・γ・α+0・(1-γ)・α+3・γ・(1 -α) +6・(1−γ)・(1−α)=2.1 cycles are obtained.

従つてこの従来の発明は同じ分岐命令の過去の
結果に基づいて予測を行つた場合高い予測的中率
を得るという原理を用いることにより常に分岐
GOと予測する第16図に示す処理に比べ幾分の
改良がみられる。しかしこの改良された発明にお
いてもたとえ予測的中時分岐GOの場合は依然と
して3サイクルのロスサイクルを要することにな
りこれ以上短縮できない。従つて分岐命令が生じ
た場合たとえ予測が的中してもロスサイクルを生
じることになる。
Therefore, this conventional invention uses the principle that a high prediction accuracy rate can be obtained when predictions are made based on past results of the same branch instruction.
There is some improvement compared to the process shown in FIG. 16, which predicts GO. However, even with this improved invention, in the case of predictive intermediate branch GO, three loss cycles are still required and cannot be reduced any further. Therefore, if a branch instruction occurs, a loss cycle will occur even if the prediction is correct.

第18図、第19図、および第20図は本発明
による命令の処理の流れを示している。
18, 19, and 20 show the flow of instruction processing according to the present invention.

本発明における命令の処理単位ICステージは
命令を記憶装置から読出す機能の他に、分岐ヒス
トリテーブルを索引し読出される命令のアドレス
が該分岐ヒストリテーブルに登録されているか否
かを検出し、登録されていれば対応する分岐情報
を読出し、登録されていなければ後続命令の命令
先取りのためのアドレスを生成する機能を有す
る。
In addition to the function of reading instructions from a storage device, the instruction processing unit IC stage in the present invention indexes a branch history table and detects whether the address of the instruction to be read is registered in the branch history table. If it is registered, it reads the corresponding branch information, and if it is not registered, it has a function of generating an address for prefetching a subsequent instruction.

第18図および第19図を参照すると、分岐命
令BCの時刻t1における動作は次のようにして
行なわれる。まず、該分岐命令BCが命令キヤツ
シユメモリから読出されると同時に分岐ヒストリ
テーブルが索引される。該分岐命令BCの命令ア
ドレスが登録されていれば対応する分岐情報が読
出される。該分岐情報を分析した結果、分岐GO
側の予測として該分岐情報中に含まれる分岐先ア
ドレスにより分岐先命令B1の命令先取りを開始
するかもしくは分岐NOGO側の予測として分岐
NOGO側の命令A1の命令アドレスを生成して
命令A1の先取りを開始するかが決定される。以
降時刻t5までは前記分岐命令BCの予測期間で
あり予測側の後続命令が先取りされ時刻t5にお
いて分岐条件が決定される。予測的中時には第1
6図に示すようにパイプラインの流れは乱れを生
ずることなく処理が継続される。予測失敗時には
第19図に示すように時刻t6で前記分岐ヒスト
リテーブルの更新を行つた後に正しい命令の流れ
から命令の取出しを行うように制御される。この
場合分岐命令の出現によるパイプラインのロスサ
イクルは 予測が的中したとき 0サイクル 予測が失敗したとき 5サイクル である。予測的中率αはこの場合分岐方向だけで
なく分岐先アドレスをも予測することから分岐方
向だけの予測に比べ若干低くなるがその割合は
微々たるものである。従つて、予測的中率α=
0.8として1分岐命令当りの平均的なロスサイク
ルは 0・α+5(1−α)=1サイクル となり従来技術に比べて格段に改良される。
Referring to FIGS. 18 and 19, the operation of branch instruction BC at time t1 is performed as follows. First, the branch history table is indexed at the same time as the branch instruction BC is read from the instruction cache memory. If the instruction address of the branch instruction BC is registered, the corresponding branch information is read. As a result of analyzing the branch information, branch GO
Start pre-fetching the branch destination instruction B1 according to the branch destination address included in the branch information as a side prediction, or branch as a branch NOGO side prediction.
It is determined whether to generate an instruction address for the instruction A1 on the NOGO side and start prefetching the instruction A1. The period from then until time t5 is the prediction period of the branch instruction BC, in which the subsequent instruction on the prediction side is preempted and the branch condition is determined at time t5. When the prediction is correct, the first
As shown in FIG. 6, processing continues without any disturbance in the flow of the pipeline. When prediction fails, the branch history table is updated at time t6, as shown in FIG. 19, and then the instruction is taken out from the correct instruction flow. In this case, the pipeline loss cycles due to the appearance of a branch instruction are: 0 cycles when the prediction is correct and 5 cycles when the prediction fails. In this case, since not only the branch direction but also the branch destination address is predicted, the prediction accuracy rate α is slightly lower than when predicting only the branch direction, but the rate is insignificant. Therefore, prediction accuracy α=
Assuming 0.8, the average loss cycle per branch instruction is 0·α+5(1−α)=1 cycle, which is a significant improvement over the conventional technology.

第20図を参照すると、BCT命令の分岐GO予
測が失敗した場合の実行のようすを示しており、
第19図における分岐命令BCと同じように実行
されるが、時刻t6において命令BCTは分岐ヒ
ストリテーブルを更新しないため、正しい命令の
取出しは時刻t6より開始される。即ち、分岐予
測GO失敗時において、BCT命令は、BCT命令
以外の分岐命令よりも1サイクル早く実行され
る。
Referring to FIG. 20, it shows the execution when the branch GO prediction of the BCT instruction fails.
Although it is executed in the same manner as the branch instruction BC in FIG. 19, since the instruction BCT does not update the branch history table at time t6, the extraction of the correct instruction starts from time t6. That is, when branch prediction GO fails, the BCT instruction is executed one cycle earlier than branch instructions other than the BCT instruction.

第21図を参照すると、BCT命令をループ回
数を管理するために使用したループを構成するプ
ログラムの命令の流れが示してある。第21図に
おいて命令BCTは、このループの中を実行して
いる間は、分岐ヒストリテーブルの保持するGO
側の分岐情報に従つて、分岐予測成功でロスサイ
クルなしに実行される。ループを脱出する際の命
令BCTはBCT GO予測失敗で、分岐ヒストリテ
ーブルの更新は行なわずに、すぐ失敗した命令の
取出しが実行される。プログラムの流れによつて
このループに再び入るとき、命令BCTの分岐情
報はGO側の予測を示しているため、ロスサイク
ルなしにループを実行できる。
Referring to FIG. 21, there is shown a flow of instructions of a program forming a loop using the BCT instruction to manage the number of loops. In FIG. 21, while the instruction BCT is being executed in this loop, the instruction BCT uses the GO held in the branch history table.
According to the side branch information, the branch prediction is successful and executed without loss cycles. The instruction BCT when escaping from the loop is a BCT GO prediction failure, and the failed instruction is immediately fetched without updating the branch history table. When this loop is re-entered by the flow of the program, the branch information of the instruction BCT indicates the prediction on the GO side, so the loop can be executed without loss cycles.

本発明を適用しない場合、ループ脱出の際に分
岐ヒストリテーブルの命令BCTの分岐情報を分
岐NOGO側に更新するために1サイクルを失い、
さらに再びループに入り、最初にBCTを実行す
る際にも5サイクルを余分に費す。
If the present invention is not applied, one cycle is lost to update the branch information of the instruction BCT in the branch history table to the branch NOGO side when exiting the loop.
It also takes an extra 5 cycles to enter the loop again and execute BCT for the first time.

この発明では、分岐命令のアドレスと該分岐命
令の分岐先アドレスを含む分岐情報とを対にして
記憶する分岐ヒストリテーブルを命令先取り時に
索引する。このあとで前記分岐先アドレスで次の
命令先取りを行わせしめることにより命令の解読
を行うことなく前記分岐ヒストリテーブルの記述
に従つて命令語を先取りすることができる。
In this invention, a branch history table that stores the address of a branch instruction and branch information including the branch destination address of the branch instruction as a pair is indexed when an instruction is prefetched. Thereafter, by prefetching the next instruction at the branch destination address, the instruction word can be prefetched according to the description in the branch history table without decoding the instruction.

さらに、分岐ヒストリテーブルを、BCT命令
の性質に基づいて、その分岐情報を更新すること
により命令バツフアには命令の実行の経路に従つ
た命令の待行列を形成せしめ、情報処理システム
のパイプライン制御におけるBCT命令の実行を
極めて少ないロスサイクルで行なうことができる
という効果がある。
Furthermore, by updating the branch information in the branch history table based on the properties of the BCT instructions, an instruction queue is formed in the instruction buffer according to the execution path of the instructions, thereby controlling the pipeline of the information processing system. This has the effect that the BCT instruction can be executed with extremely few loss cycles.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の一実施例を示す図、第2図は
第1図における分岐ヒストリテーブル410の詳
細な構成を示す図、第3図は第2図の記憶部50
1および502の記憶形成を示す図、第4図は第
2図のテスト回路503−506の詳細な構成を
示す図、第5図は第1図の命令記憶回路408に
おける命令語の配列を示す図、第6図は第2図の
プライオリテイ回路507の詳細な構成を示す
図、第7図は第1図の分岐情報バツフア413お
よびレジスタ416の格納形式を示す図、第8図
は第1図のレジスタ417−419の格納形式を
示す図、第9図は第1図の予測確認回路420の
詳細な構成を示す図、第10図は第1図の命令記
憶回路408における命令と分岐ヒストリテーブ
ル410における分岐情報との対応関係を説明す
るための図、第11図は第10図のテーブル41
0による命令先取り動作を説明するための図、第
12図は予測失敗時における命令先取り動作開始
までの動作を説明するための図、第13図は
BCT命令の予測GO失敗時における命令先取り動
作開始までの動作を説明するための図、第14図
は第1図の命令先取り制御回路424の詳細な構
成を示す図、第15図は命令の処理の流れの概要
を示す図、第16図および第17図は従来の予測
方式を用いた命令の処理の流れを示す図、第18
図は分岐命令の予測が的中したときの命令の処理
の流れを示す図、第19図は分岐命令の予測が失
敗したときの命令の処理の流れを示す図、第20
図は本発明においてBCT命令の分岐GO予測が失
敗したときの命令の処理の流れを示す図、および
第21図は、BCT命令によつてループを構成す
るプログラムの命令の流れを示す図である。 第1図から第21図において、401……命令
アドレス生成回路、402……命令アドレス変換
回路、403……命令解読回路、404……オペ
ランドアドレス生成回路、405……オペランド
アドレス変換回路、406……オペランド読出し
回路、407……命令実行回路、408……命令
記憶回路、409……命令バツフア、410……
分岐ヒストリテーブル(BHT)、411……命令
アドレスレジスタ(IAR)、412……命令アド
レス加算回路,413……分岐情報バツフア、4
14……命令整列回路、415……分岐情報切換
回路、416……分岐情報レジスタ(QR0)、4
17……分岐情報レジスタ(QR1)、418……
分岐情報レジスタ(QR2)、419……分岐情報
レジスタ(QR3)、420……予測確認回路、4
21……アドレス生成回路、422……選択回
路、423……レジスタ(WR)、424……命
令先取り制御回路、425……フリツプフロツ
プ、501,502……記憶部、503,50
4,505,506……テスト回路、507……
プライオリテイ回路、508……選択回路、50
9……オア回路、601−604……アンド回
路、605−608……オア回路、701……一
致回路、702……大小比較回路、703……ア
ンド回路、801……一致回路、802−803
……フリツプフロツプ、804−807……真偽
回路、808−813……アンド回路、814…
…オア回路、1201……フリツプフロツプ、1
202−1205……真偽回路、1206……ア
ンド回路。
FIG. 1 is a diagram showing an embodiment of the present invention, FIG. 2 is a diagram showing a detailed configuration of the branch history table 410 in FIG. 1, and FIG. 3 is a diagram showing the storage unit 50 in FIG.
1 and 502, FIG. 4 is a diagram showing the detailed configuration of the test circuits 503 to 506 in FIG. 2, and FIG. 5 is a diagram showing the arrangement of instruction words in the instruction storage circuit 408 in FIG. 1. 6 is a diagram showing the detailed configuration of the priority circuit 507 in FIG. 2, FIG. 7 is a diagram showing the storage format of the branch information buffer 413 and register 416 in FIG. 9 is a diagram showing the detailed configuration of the prediction confirmation circuit 420 in FIG. 1, and FIG. 10 is a diagram showing the storage format of the registers 417 to 419 in FIG. A diagram for explaining the correspondence with branch information in the table 410, FIG. 11 is the table 41 in FIG.
12 is a diagram for explaining the instruction prefetching operation by 0, FIG. 12 is a diagram for explaining the operation up to the start of the instruction prefetching operation when prediction fails, and FIG.
14 is a diagram showing the detailed configuration of the instruction prefetch control circuit 424 shown in FIG. 1, and FIG. 15 is a diagram for explaining the operation up to the start of the instruction prefetch operation when the prediction GO of the BCT instruction fails. FIG. 15 is the instruction processing. 16 and 17 are diagrams showing the flow of instruction processing using the conventional prediction method.
Figure 19 shows the flow of instruction processing when branch instruction prediction is successful; Figure 19 shows the flow of instruction processing when branch instruction prediction fails; Figure 20 shows the flow of instruction processing when branch instruction prediction fails;
21 is a diagram showing the flow of instruction processing when branch GO prediction of a BCT instruction fails in the present invention, and FIG. 21 is a diagram showing the flow of instructions of a program that configures a loop using BCT instructions. . 1 to 21, 401...instruction address generation circuit, 402...instruction address translation circuit, 403...instruction decoding circuit, 404...operand address generation circuit, 405...operand address translation circuit, 406... ...Operand reading circuit, 407...Instruction execution circuit, 408...Instruction storage circuit, 409...Instruction buffer, 410...
Branch history table (BHT), 411...Instruction address register (IAR), 412...Instruction address addition circuit, 413...Branch information buffer, 4
14...Instruction alignment circuit, 415...Branch information switching circuit, 416...Branch information register (QR 0 ), 4
17...Branch information register (QR 1 ), 418...
Branch information register ( QR2 ), 419...Branch information register ( QR3 ), 420...Prediction confirmation circuit, 4
21...Address generation circuit, 422...Selection circuit, 423...Register (WR), 424...Instruction prefetch control circuit, 425...Flip-flop, 501, 502...Storage unit, 503, 50
4,505,506...Test circuit, 507...
Priority circuit, 508... Selection circuit, 50
9...OR circuit, 601-604...AND circuit, 605-608...OR circuit, 701...matching circuit, 702...large/small comparison circuit, 703...AND circuit, 801...matching circuit, 802-803
...Flip-flop, 804-807...True/false circuit, 808-813...AND circuit, 814...
...OR circuit, 1201...Flip-flop, 1
202-1205...Truth circuit, 1206...AND circuit.

Claims (1)

【特許請求の範囲】 1 指定された汎用レジスタの保持する計数値を
計数し該計数結果により分岐の有無を決定して計
数分岐命令を実行する情報処理システムにおける
命令先取り装置において、 読み出された命令を順次実行する命令実行手段
と、 分岐命令のアドレスを指定する情報と該分岐命
令の分岐先アドレスを含む分岐情報とを対にして
複数対記憶する分岐ヒストリテーブル手段と、 命令先取り動作を行う際に該命令先取り動作に
おいて先取りされる分岐命令のアドレスを指定す
る情報が前記分岐ヒストリテーブル手段に登録さ
れているか否かを調べる点検手段と、 該点検手段による登録の判明に応答して前記分
岐ヒストリテーブル手段から対応する分岐情報を
読出し該分岐情報に従つて命令先取り動作を継続
せしめるよう制御する命令先取り制御手段と、 分岐命令の実行結果と該分岐命令に対応する前
記分岐ヒストリテーブル手段の前記分岐情報とが
一致するか否かを判別する第1の判別手段と、 該分岐命令が計数分岐命令であるか否かを判別
する第2の判別手段と、 前記命令実行手段で該計数分岐命令が分岐を行
なつたか否かを判別する第3の判別手段と、 前記第1の判別手段における判別結果が一致を
示すとき前記分岐ヒストリテーブル手段の前記分
岐命令に対応する分岐情報の変更を行わない第1
の制御と、前記第1、第2および第3の判別手段
の判別結果に応じて第1の判別結果が不一致を示
しかつ第2の判別結果が計数分岐命令を示しかつ
第3の判別結果が命令実行手段で該計数分岐命令
が分岐を行わなかつたことを示すとき前記分岐ヒ
ストリテーブル手段の該計数分岐命令に対応する
分岐情報の変更を行わない第2の制御と、第1の
判別結果が不一致を示しかつ第2の判別結果が計
数分岐命令でないことを示すとき前記分岐ヒスト
リテーブル手段の該分岐命令に対応する分岐情報
を該分岐命令の実行結果に基づいて更新する第3
の制御と、第1の判別結果が不一致を示しかつ第
2の判別結果が計数分岐命令を示しかつ第3の判
別結果が命令実行手段で該計数分岐命令が分岐を
行なつたことを示すとき前記分岐ヒストリテーブ
ル手段の該計数分岐命令に対応する分岐情報を該
計数分岐命令の実行結果に基づいて更新する第4
の制御とを行なう更新制御手段と を備えたことを特徴とする命令先取り装置。
[Claims] 1. In an instruction prefetch device in an information processing system that counts the count value held in a designated general-purpose register, determines whether or not to branch based on the count result, and executes a count branch instruction, an instruction execution means for sequentially executing instructions; a branch history table means for storing a plurality of pairs of information specifying an address of a branch instruction and branch information including a branch destination address of the branch instruction; and a branch history table means for performing an instruction prefetch operation. checking means for checking whether information specifying the address of a branch instruction to be prefetched in the instruction prefetching operation is registered in the branch history table means; instruction prefetch control means for reading corresponding branch information from the history table means and controlling the instruction prefetch operation to continue in accordance with the branch information; a first determining means for determining whether the branch information matches the branch information, a second determining means for determining whether the branch instruction is a counting branch instruction, and a second determining means for determining whether the branch instruction is a counting branch instruction; a third determining means for determining whether or not the has taken a branch; and when the determination results in the first determining means indicate a match, changing the branch information corresponding to the branch instruction in the branch history table means; Not the first
and a first determination result indicates a mismatch, a second determination result indicates a counting branch instruction, and a third determination result indicates a counting branch instruction according to the determination results of the first, second, and third determination means. A second control that does not change the branch information corresponding to the counted branch instruction in the branch history table means when the instruction execution means indicates that the counted branch instruction did not take a branch, and a first determination result. A third step of updating the branch information corresponding to the branch instruction in the branch history table means based on the execution result of the branch instruction when the second determination result indicates that there is a mismatch and the second determination result indicates that the branch instruction is not a counting branch instruction.
control, when the first determination result indicates a mismatch, the second determination result indicates a counting branch instruction, and the third determination result indicates that the counting branch instruction executed a branch in the instruction execution means. a fourth updating branch information corresponding to the counting branch instruction in the branch history table means based on the execution result of the counting branch instruction;
1. An instruction prefetching device comprising update control means for controlling.
JP2111484A 1984-02-08 1984-02-08 Instruction prefetching device Granted JPS60164842A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2111484A JPS60164842A (en) 1984-02-08 1984-02-08 Instruction prefetching device
US06/699,328 US4764861A (en) 1984-02-08 1985-02-07 Instruction fpefetching device with prediction of a branch destination for each branch count instruction
DE3587811T DE3587811D1 (en) 1984-02-08 1985-02-08 Instruction prefetcher with prediction of branch determination for each branch count instruction.
EP85101351A EP0157125B1 (en) 1984-02-08 1985-02-08 Instruction prefetching device with prediction of a branch destination for each branch count instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2111484A JPS60164842A (en) 1984-02-08 1984-02-08 Instruction prefetching device

Publications (2)

Publication Number Publication Date
JPS60164842A JPS60164842A (en) 1985-08-27
JPH046983B2 true JPH046983B2 (en) 1992-02-07

Family

ID=12045852

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2111484A Granted JPS60164842A (en) 1984-02-08 1984-02-08 Instruction prefetching device

Country Status (1)

Country Link
JP (1) JPS60164842A (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62293434A (en) * 1986-06-12 1987-12-21 Nec Corp Branch destination forecasting controlling system
JP2555664B2 (en) * 1987-01-22 1996-11-20 日本電気株式会社 Branch history table writing control method
JPH0769809B2 (en) * 1988-05-25 1995-07-31 日本電気株式会社 Data processing device
JP2636088B2 (en) * 1991-03-15 1997-07-30 甲府日本電気株式会社 Information processing device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5759253A (en) * 1980-09-29 1982-04-09 Nec Corp Branch instruction prefetch system
JPS5815809A (en) * 1981-07-22 1983-01-29 松下電工株式会社 Hair dryer

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5759253A (en) * 1980-09-29 1982-04-09 Nec Corp Branch instruction prefetch system
JPS5815809A (en) * 1981-07-22 1983-01-29 松下電工株式会社 Hair dryer

Also Published As

Publication number Publication date
JPS60164842A (en) 1985-08-27

Similar Documents

Publication Publication Date Title
US4764861A (en) Instruction fpefetching device with prediction of a branch destination for each branch count instruction
US4725947A (en) Data processor with a branch target instruction storage
US4477872A (en) Decode history table for conditional branch instructions
US4476525A (en) Pipeline-controlled data processing system capable of performing a plurality of instructions simultaneously
US5742782A (en) Processing apparatus for executing a plurality of VLIW threads in parallel
KR100212204B1 (en) Devices that process commands inside the calculator system
EP0021399B1 (en) A method and a machine for multiple instruction execution
US5136696A (en) High-performance pipelined central processor for predicting the occurrence of executing single-cycle instructions and multicycle instructions
EP0394624B1 (en) Multiple sequence processor system
EP0352935B1 (en) Pipelined processor
EP0357188B1 (en) Pipelined processor
WO1987005417A1 (en) Instruction prefetch control apparatus
JPS62221036A (en) Calculator
EP0372751B1 (en) Pipelined data-processing apparatus
US6725365B1 (en) Branching in a computer system
JP3486690B2 (en) Pipeline processor
KR930003124B1 (en) Apparatus for the control of branch instruction in pipeline system
JP3779012B2 (en) Pipelined microprocessor without interruption due to branching and its operating method
JPH046983B2 (en)
JPS5991551A (en) Instruction prefetching device forecasting address to be branched
JPH0695306B2 (en) Instruction prefetching device
JPS6310451B2 (en)
JPS6236258B2 (en)
JPS62159231A (en) Instruction prefetching device
JPH07200406A (en) Cache system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees