JPS5991552A - Instruction prefetch device having set associative type history table - Google Patents

Instruction prefetch device having set associative type history table

Info

Publication number
JPS5991552A
JPS5991552A JP57201557A JP20155782A JPS5991552A JP S5991552 A JPS5991552 A JP S5991552A JP 57201557 A JP57201557 A JP 57201557A JP 20155782 A JP20155782 A JP 20155782A JP S5991552 A JPS5991552 A JP S5991552A
Authority
JP
Japan
Prior art keywords
instruction
branch
address
circuit
prediction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP57201557A
Other languages
Japanese (ja)
Other versions
JPS6310451B2 (en
Inventor
Toshiteru Shibuya
渋谷 俊輝
Shuichi Hanatani
花谷 修一
Masanobu Akagi
赤木 正信
Koemon Nigo
仁後 公衛門
Ritsuo Sugaya
菅谷 律雄
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
NEC Corp
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 NEC Corp, Nippon Electric Co Ltd filed Critical NEC Corp
Priority to JP57201557A priority Critical patent/JPS5991552A/en
Priority to EP83111451A priority patent/EP0109655B1/en
Priority to DE8383111451T priority patent/DE3382350D1/en
Publication of JPS5991552A publication Critical patent/JPS5991552A/en
Publication of JPS6310451B2 publication Critical patent/JPS6310451B2/ja
Priority to US07/286,021 priority patent/US4984154A/en
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3802Instruction prefetching
    • G06F9/3804Instruction prefetching for branches, e.g. hedging, branch folding
    • G06F9/3806Instruction prefetching for branches, e.g. hedging, branch folding using address prediction, e.g. return stack, branch history buffer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)

Abstract

PURPOSE:To forecast an address to be branched with a comparatively high hit rate by using a set associative type history table to control preferch, in an information processing device. CONSTITUTION:A directory storage part 501 in a branch history table 410 stores a part of the instruction address of a branch instruction and V bits indicating whether the contents of the part are effective or not and a data storage part 502 stores the real address of an address to be branched. The contents of respective levels of the storage part 501 read out by regarding a part of a request address in an instruction address register 411 as a setting address are compared with a part of the contents of the register 411 and whether these contents coincide with each other or not is detected by test circuits 503-506 or the like. At the time of coincidence, a branch forecasting signal 106 with a corresponding level is generated, and if the coincidence of two or more parts is formed, a priority circuit 507 selects a signal with a lower level to read out the address to be branched stored in a storage part 502 through a selecting circuit 508.

Description

【発明の詳細な説明】 発明の属する技術分野 本発明はデータ処理システムの命令シーケンスのステッ
プに含まれる分岐条件判定ステップ実行処理に先立って
判定結果を予測しつつ次の命令の先取シを行なうセット
アソシアティブ型分岐ヒストリーテーブルを有する命令
先取シ装置に関する。
DETAILED DESCRIPTION OF THE INVENTION Technical Field The present invention relates to a set for preempting the next instruction while predicting the judgment result prior to execution of a branch condition judgment step included in a step of an instruction sequence of a data processing system. The present invention relates to an instruction prefetching device having an associative branch history table.

従来技術 少なくとも1個の分岐命令を含む命令群が記憶装置に命
令シーケンスの形で格納されているデータ処理システム
においては、このような命令シーケンスの実行は1次の
ように行なわれる。
BACKGROUND OF THE INVENTION 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, execution of such an instruction sequence is performed in the following manner.

まず、前記記憶装置の分岐元アドレスに分岐命令が格納
される。次に、この分岐命令に引き続いて実行される命
令が先取りされる。このあと、分岐命令が実行され、こ
の実行結果によシ次に実行される命令が明らかになる。
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.

このようなシステムは米国特許4,2CQ927号に提
案されている。しかし、このシステムでは、分岐命令先
取シ制御において実行結果の判別時まで命令先取り制御
を停止させると、処理の迅速化が妨げられる。
Such a system is proposed in US Pat. No. 4,2CQ927. However, in this system, if the branch instruction preemption 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 preempted 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. In the first prediction method, the branch destination direction of all branch instructions is predicted to be either the successful side or the unsuccessful side.

他の1つの予測方式では、過去の事実に基づいて分岐先
方向を予測する。すなわち、同じ分岐命令の過去の実行
結果において分岐先がすでに明らかにされているという
事実を用いてこの結果に基づいて予測を行なうことによ
り予測的中率を高めている。このような予測方式の代表
例が特開昭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. A typical example of such a prediction method is shown in Japanese Patent Laid-Open No. 57-76638.

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

この欠点を除去する予測方式が特開昭57−59253
号公報に示されている。この方式では主記憶装置の命令
部の写しである命令キャッシュメモリのブロックに対応
して該ブロック中に含まれる分岐命令の分岐先アドレス
を、該ブロックの次にフェッチされるべきブロックのア
ドレスとして記憶手段に保持している。命令先取り動作
において、命令キャッジ−メモリへのアクセスと同時に
前記記憶手段をアクセスして前記分岐先アドレスを読出
し、読み出された分岐先アドレスにより先取シすべき命
令のアドレスを決定している点において、この方式は上
述の従来の3つの予測方式と異なシ処理の迅速化に有効
である。しかし、この方式では、命令キャッジ−メモリ
のブロック対応で予測するため、該ブロックに分岐命令
が複数個存在するときには、そのそれぞれの分岐命令に
対応して予測を行なうことができない。この結果、精度
の粗い予測的中率しか得られないという欠点がある。
A prediction method that eliminates this drawback is disclosed in Japanese Patent Application Laid-Open No. 57-59253.
It is shown in the publication No. In this method, the branch destination address of the branch instruction contained in the block of the instruction cache memory, which is a copy of the instruction part of the main memory, is stored as the address of the block to be fetched next after the block. Holds on to means. In the instruction prefetching operation, the storage means is accessed simultaneously with the access to the instruction cache memory 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 above-mentioned three conventional prediction methods and is effective in speeding up processing. However, in this method, prediction is made in correspondence between the instruction cache and the memory block, so when a plurality of branch instructions exist in the block, prediction cannot be made corresponding to 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 present invention to provide an instruction preemption device having a set ancillary type branch history table which eliminates the above-mentioned drawbacks.

発明の構成 本発明のセットアンシアティブ型分岐ヒストリテーブル
を有する命令先取装置は、分岐命令のアドレスの一部を
保持するディレクトリ記憶部と、前記保持されたアドレ
スに対応して、前記保持されたアドレスの分岐命令の分
岐先アドレスを指定する情報を含む分岐情報が格納され
るように構成されたデータ記憶部とを含む、セットアソ
シアティブ型メモリで構成された分岐ヒストリテーブル
手段と、 命令先取p動作の際に、該命令先取動作において、先取
シされるべき分岐命令のアドレスを指定する情報が前記
分岐ヒストリテーブル手段に登録きれているか否かを調
べる点検手段と、該点検手段によシ前記分岐ヒストリテ
ーブル手段に、前記先取シされるべき分岐命令のアドレ
スを指定する情報が登録されていると判明したときに、
該分岐ヒストリテーブル手段から前記先取シされるべき
分岐命令に対応する分岐情報を読出し、該分岐情報に従
い次の命令先取り動作を開始するように制御する命令先
取り制御手段とを備えている。
Structure of the Invention The instruction prefetching device having a set-unsociative type branch history table of the present invention includes a directory storage section that holds a part of the address of a branch instruction, and a directory storage section that holds a part of the address of a branch instruction, and a directory storage section that holds a part of the address of a branch instruction, and branch history table means constituted by a set associative type memory, including a data storage section configured to store branch information including information specifying a branch destination address of a branch instruction; In the instruction prefetching operation, checking means for checking whether information specifying the address of the branch instruction to be preempted has been registered in the branch history table means; When it is found that information specifying the address of the branch instruction to be preempted is registered in the table means,
The instruction prefetch control means reads branch information corresponding to the branch instruction to be preempted from the branch history table means and controls to start the next instruction prefetch operation according to the branch information.

発明の原理と作用 本発明の特徴は分岐命令の実行における分岐方向に加え
て分岐先アドレスがその同じ分岐命令の過去の結果の把
握により比較的高い的中率で予測可能であるという事実
に基づいて装置が動作することにある。
Principle and operation of the invention The feature of the present invention is based on 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 by understanding the past results of the same branch instruction. The purpose is for the device to operate according to the conditions.

発明の実施例 次に、本発明の一実施例を図面を参照して詳細に説明す
る。第1図を参照すると、本発明の一実施例は、命令ア
ドレス生成回路401、命令アドレス変換回路402、
命令解読回路4o3、オペランドアドレス生成回路40
4 オペランドアドレス変換回路405、オペランド記
憶回路を有するオペランド読出し回路4o6、命令実行
回路407、命令記憶回路408、命令バッファ409
、分岐ヒストリテーブル(BHT)410.命令アドレ
スレジスタ411、命令アドレス加算回路412分岐情
報バッファ413、命令整列回路414、分岐情報切換
回路415、分岐情報レジスタ416゜417.418
.および419、予測確認回路42o1アドレス生成回
路421、選択回路422、レジスタ423、命令先取
シ制御回路424、およびフリップ70ツブ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 includes an instruction address generation circuit 401, an instruction address conversion circuit 402,
Instruction decoding circuit 4o3, operand address generation circuit 40
4 Operand address conversion circuit 405, operand reading circuit 4o6 having operand storage circuit, instruction execution circuit 407, instruction storage circuit 408, instruction buffer 409
, branch history table (BHT) 410. Instruction address register 411, instruction address addition circuit 412, branch information buffer 413, instruction alignment circuit 414, branch information switching circuit 415, branch information register 416°417.418
.. and 419, a prediction confirmation circuit 42o1, an address generation circuit 421, a selection circuit 422, a register 423, an instruction prefetch control circuit 424, and a flip 70 tube 425.

命令記憶回路408およびオペランド読出し回路406
内のオペランド記憶回路はともに主記憶装置そのもので
あってもよく、さらに命令記憶回路408が主記憶装置
の命令部の一部の写しである命令キャッジ−メモ1ハ 
前記オペランド記憶回路が主記憶装置のオペランド部の
一部の写しであるオペランドキャッジ−メモリとして構
成されうる。
Instruction storage circuit 408 and operand read circuit 406
Both operand storage circuits in the main memory may be the main memory itself, and the instruction storage circuit 408 may be an instruction cache-memo 1 block which 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 main memory.

本発明は、前述の命令の処理単位に対応した装置構成を
必ずしも有する必要はなく、例えば命令アドレス生成回
路401とオペランドアドレス生成回路404、命令ア
ドレス変換回路402とヤオペランドアドレス変換回路
405、命令記憶回路408とヨオベランド読出し回路
406内の記憶回路が共用されたコンビーータシステム
においても適用され得る。前記分岐ヒストリチー プル
(BHT) 410は分岐命令のアドレスを指定する情
報と該分岐命令の実行の予測としての分岐否フラグと分
岐先アドレスを第3図に示すように対にして記憶してい
る。前記命令記憶回路408に対する前記命令アドレス
レジスタ(IAR)411は、命令読出しのリクエスト
アドレスヲ保持して命令の読出し動作を実行する。さら
に前記命令アドレスレジスタ411(IAR)は、分岐
ヒストリテーブル410(B)(T)および命令アドレ
ス加算回路412に、信号線101を介して接続されて
いる。前記レジスタ411の内容は該分岐ヒストリテー
ブル410 (BAT )を索引し、読出されるべき命
令のアドレスがそれに登録されているか否かを示す信号
を信号線106に出力する。登録されていれば、対応す
る分岐先アドレレスが信号線105に読出される。登録
されていなければ、前記命令アドレス加算回路412に
よシ、後続の命令語の命令先取シのだめのアドレスが生
成される。前記命令アドレス加算回路412は 1回の
リクエストで読出される命令語を8Byteと仮定した
とき単に“IAR+8”を出力107融成する回路であ
る。前記命令バッファ409は、命令記憶回路408か
ら読出された3Byteの先取シ命令語を蓄積し、命令
処理部への命令の供給における待行列(QLlef)を
形成する。前記命令整列回路414は、命令バッファ4
09が空のとき信号線102を介して、命令記憶回路4
08から読出される8Byteの命令語に応答して前記
命令バッファ409が空でないとき、信号線103を介
して前記命令バッファに貯えられる8Byteの命令語
に応答して命令を抽出して信号線104を介して命令解
読回路403に命令を供給する回路である。前記分岐情
報バッファ413は、前記命令バッファ409に格納さ
れる命令語に対応して用意されており、その命令語中に
分岐成功と予測された分岐命令が存在すれば、第7図に
示す該分岐命令の分岐情報を格納する回路であり、分岐
命令のアドレスは信号線101を介して、また、分岐情
報としての分岐先アドレスおよびVビットは、分岐ヒス
トリテーブル410(BHT)から信号線105を介し
てそれぞれセットされる。前記分岐情報切替回路415
は、れる前記分岐情報をそれぞれ出力する。前記レジス
タ416,417、および418はそれぞれ分岐命令の
命令解読、命令アドレス生成、アドレス変換の各処理ス
テージに対応し、その分岐情報を保持する。前記分岐情
報レジスタ419はその分岐先アドレス部を該分岐命令
の実行によって生成される実際の分岐先アドレスに置き
換えて保持するレジスタである。前記予測確認回路42
0は分岐命令の実行によって生成される実際の分岐命令
の生成結果と、前記分岐情報レジスタ418に保持され
る該分岐命令の予測情報との一致をとる回路である。前
記アドレス生成回路421は前記分岐情報レジスタ41
9に保持される分岐命令のアドレスと該分岐命令1牙の
命令語長とを加算し分岐N0GO側の命令の命令アドレ
スを生成する。前記選択回路422は分岐命令の成否信
号線111の状態に応答して該信号線の状態が分岐GO
を示すとき線115を介して与えられる前記分岐情報レ
ジスタ419に保持される分岐先アドレス部の出力を選
択し、前記線の状態が分岐N0GOを示すとき線116
を介して与えられる前記アドレス生成回路421の出力
を選択し、信号線113を介して該選択回路422の出
力をレジスタ423に供給する。前記レジスタ423は
分岐命令の予測が失敗したとき、分岐ヒストリラープル
410 (BHT)を更新するだめのものであシ、さら
に信号線117を介して命令アドレスレジスタ411 
(IAR)に命令先取シのだめの新たなアドレスを供給
する。前記命令先取り制御回路424は線106を介し
て分岐ヒストリテーブル410(BHT)から与えられ
る分岐予測信号および予測確認回路から線112を介し
て与えられる予測成否信号に基づいて命令アドレスレジ
スタ411 (IAR)の入力を制御する回路である。
The present invention does not necessarily need to 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 402, an operand address conversion circuit 405, and an instruction memory. The present invention can also be applied to a conbeater system in which the memory circuits in the circuit 408 and the Yooverand readout circuit 406 are shared. The branch history tree (BHT) 410 stores information specifying the address of a branch instruction, a branch no flag as a prediction of execution of the branch instruction, and a branch destination address in pairs as shown in FIG. The instruction address register (IAR) 411 for the instruction storage circuit 408 holds an instruction read request address and executes an instruction read operation. Furthermore, the instruction address register 411 (IAR) is connected to branch history tables 410 (B) (T) and an instruction address addition circuit 412 via a signal line 101. The contents of the register 411 are indexed into the branch history table 410 (BAT) and a signal is output to the signal line 106 indicating whether the address of the instruction to be read is registered therein. If registered, the corresponding branch destination address is read out onto the signal line 105. If it is not registered, the instruction address addition circuit 412 generates an address for the instruction preemption of the subsequent instruction word. The instruction address addition circuit 412 is a circuit that simply outputs "IAR+8" 107 when it is assumed that the instruction word read in one request is 8 bytes. The instruction buffer 409 stores a 3-byte preemption instruction word read from the instruction storage circuit 408, and forms a queue (QLlef) for supplying instructions to the instruction processing section. The instruction alignment circuit 414 includes an instruction buffer 4
When 09 is empty, the instruction storage circuit 4
When the instruction buffer 409 is not empty in response to the 8-byte instruction word read from the signal line 103, the instruction is extracted in response to the 8-byte instruction word stored in the instruction buffer via the signal line 103. This circuit supplies instructions to the instruction decoding circuit 403 via the instruction decoding circuit 403. The branch information buffer 413 is prepared corresponding to the instruction word stored in the instruction buffer 409, and if there is a branch instruction predicted to be a successful branch among the instruction words, the branch information buffer 413 is prepared in accordance with the instruction word stored in the instruction buffer 409. This is a circuit that stores branch information of a branch instruction, and the address of the branch instruction is sent via the signal line 101, and the branch destination address and V bit as branch information are sent via the signal line 105 from the branch history table 410 (BHT). Each is set via the The branch information switching circuit 415
outputs the branch information 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 419 is a register that replaces the branch destination address field with an actual branch destination address generated by executing the branch instruction. The prediction confirmation circuit 42
0 is a circuit that matches the actual branch instruction generation result generated by the execution of the branch instruction with the prediction information of the branch instruction held in the branch information register 418. The address generation circuit 421 is connected to the branch information register 41.
The address of the branch instruction held in 9 and the instruction word length of the branch instruction 1 are added to generate the instruction address of the instruction on the branch N0GO side. The selection circuit 422 responds to the state of the branch instruction success/failure signal line 111 to determine whether the state of the signal line is branch GO.
When the state of the line indicates branch N0GO, the output of the branch destination address field held in the branch information register 419 given via line 115 is selected, and when the state of the line indicates branch N0GO, line 116 is selected.
The output of the address generation circuit 421 given via the signal line 113 is selected, and the output of the selection circuit 422 is supplied to the register 423 via the signal line 113. The register 423 is used to update the branch history pull 410 (BHT) when prediction of a branch instruction fails, and is also used to update the branch history pull 410 (BHT) via the signal line 117 to the instruction address register 411.
(IAR) with a new address for instruction preemption. 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(BUT)前記予
測確認回路420および前記命令先取多制御回路424
の詳細なブロック図とタイムチャートを参照しながら、
本実施例の動作を詳細に説明する。
Next, the branch history table 410 (BUT), the prediction confirmation circuit 420 and the instruction prefetch control circuit 424
While referring to the detailed block diagram and time chart of
The operation of this embodiment will be explained in detail.

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

第3図を参照すると、記憶部501には分岐命令の命令
アドレスの一部とその内容が有効か否かを示すVビット
が格納され記憶部502には、分岐先アドレスの実アド
レスが格納されている。
Referring to FIG. 3, a part of the instruction address of a branch instruction and the V bit indicating whether or not the contents are valid are stored in the storage unit 501, and a real address of the branch destination address is stored in the storage unit 502. ing.

前記Vビットは対応する分岐ヒストリテーブル(BHT
)410のワードの有効性を示すと同時に該分岐命令の
実行の予測としての分岐成否フラグの機能を有する。
The V bit is stored in the corresponding branch history table (BHT
) 410 and has the function of 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 using the set associative method as described below.

第5図に示される前記テスト回路503,504505
、および506はテーブル410の各レベルに対応して
命令アドレスレジスタ411(IAR)に保持されるリ
クエストアドレスが各レベルのBHT AA4 (tは
レベルに対応するサフィクスを示す)に登録されている
か否かを示す信号を信号線130,131,132,1
33に出力する。
The test circuits 503, 504505 shown in FIG.
, and 506 indicates whether the request address held in the instruction address register 411 (IAR) corresponding to each level of the table 410 is registered in the BHT AA4 of each level (t indicates a suffix corresponding to the level). The signal indicating
Output to 33.

第4図を参照すると前記テスト回路503 、504 
Referring to FIG. 4, the test circuits 503 and 504
.

505および506のそれぞれは、一致回路701およ
び大小比較回路702から構成される装置前記比較回路
701では、命令アドレスレジスタ(I1%)411に
保持されるリクエストアドレスの一部IAR(:18−
28)をセットアドレスとして読出された記憶部501
の各レベルの内容とを与開H五前記レジスタ411の内
容IAR(:4−17)とが比較され1等しいアドレス
が存在するが否かを検出する。該一致回路701の出力
にょシ命令アドレスレジスタ(IAR)411に保持さ
れるリクエストアドレスで読出されるべき命令語の8B
yteブロツク中に、すでに分岐ヒストリテーブル(B
HT)410に登録された分岐命令が存在するか否かが
判明する。しかし、リクエストアドレスとそれが読出す
べき分岐命令との対応をとるには上記一致検出のみでは
不十分である。
Each of 505 and 506 is a device composed of a match circuit 701 and a magnitude comparison circuit 702.
28) is read as the set address in the storage unit 501
The content of each level is compared with the content IAR (:4-17) of the register 411 to detect whether an address equal to 1 exists. The output of the matching circuit 701 is 8B of the instruction word to be read at the request address held in the instruction address register (IAR) 411.
In the yte block, the branch history table (B
It is determined whether there is a branch instruction registered in HT) 410. However, the above-mentioned coincidence detection alone is insufficient to establish a correspondence between the request address and the branch instruction from which it should be read.

第5図を参照すると、1回のリクエストで読出される8
Byteの命令語のブロック中に2Byte命令BOO
,A、BOl、BO2の4個の命令が存在する。命令B
C!0.BOI、BO2がともに分岐成功と予測された
分岐命令であるときには各々の分岐命令はともにそのア
ドレスの一部が記憶部(BHT−AA)501に登録さ
れる。このとき他の分岐命令から命令Aに分岐して命令
Aのアドレス<A>が前記命令語のブロックを読出すた
めのリクエストアドレスとして命令アドレスレジスタ(
IAR)411に保持されるときには、分岐ヒストリテ
ーブル(BHT)410から読出されるべき分岐命令の
情報は命令の実行の経路から、分岐命令BC1の情報で
なければならない。
Referring to Figure 5, 8 is read in one request.
2 Byte instruction BOO in a block of Byte instruction word
, A, BOl, and BO2 exist. Command B
C! 0. When both BOI and BO2 are branch instructions predicted to be successful, 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, the address <A> of instruction A is the instruction address register (
IAR) 411, the branch instruction information to be read from the branch history table (BHT) 410 must be the information of the branch instruction BC1 from the instruction execution path.

従って、前記レジスタ(IAR)411に保持されるリ
クエストアドレスと前記記憶部(BH’I”−AAi)
501に保持される分岐命令のアドレスとの関係が、上
記の一致条件とともに次の関係が成立するとき対応する
レベルのBHT−HITi信号が生成される。この信号
は線130−133を介して第3回路509に与えられ
、該BHT−HITi信号のオア信号が線106を介し
て出力され分岐予測信号(BHT−HIT信号)となる
Therefore, the request address held in the register (IAR) 411 and the storage unit (BH'I"-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 a corresponding level is generated. This signal is applied to the third 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 signal).

BHT−HIT i =  (I皿(: 4−17)=
BHT−AAi (:4−17 ) )凸(1鉦(:2
9,30 )窃府−益i(:29,30))凸BHT−
AAi (V) 再び第4図を参照すると、前記大小比較回路は、この条
件を実現する回路である。さらに、前記信号BHT−H
ITiの条件が2ヶ以上のレベルにおいて成立したとき
記憶部501の対応するレベル(BHT−AAi )に
保持される分岐命令のアドレスの8Byteブロツク内
アドレスBHT−AAi(:29,30)の値の最きも
小さいレベルが選択される必要がある。
BHT-HIT i = (I plate (: 4-17) =
BHT-AAi (:4-17) ) Convex (1 gong (:2
9,30) Theft-benefit i (:29,30)) Convex BHT-
AAi (V) Referring again to FIG. 4, the magnitude comparison circuit is a circuit that realizes this condition. Furthermore, the signal BHT-H
When the condition of ITi is satisfied at two or more levels, the value of the address BHT-AAi (:29, 30) in the 8-byte block of the address of the branch instruction held in the corresponding level (BHT-AAi) of the storage unit 501 is The smallest level should be selected.

再び第5図を参照すると、命令BOI  およびBO2
の分岐命令関係情報が格納される分岐ヒストリテーブル
410のレベルで、前記信号BHT−HIT i条件が
共に成立する。このとき命令の実行の経路から命令BO
Iに対するレベルが選択される必要がある。前記プライ
オリティ回路507は、前記信号BHT−HITiの2
ヶ以上の成立に対するものであり、この出力によシ記憶
部BHT−DA502のセットアドレスIAR(:18
−28)で示されるエントリの分岐先アドレスがレベル
選択回路508を介して読出される。
Referring again to FIG. 5, instructions BOI and BO2
The signal BHT-HIT i conditions are both satisfied at the level of the branch history table 410 in which branch instruction related information is stored. At this time, from the instruction execution path to the instruction BO
A level for I needs to be selected. The priority circuit 507 selects two of the signals BHT-HITi.
This output corresponds to the set address IAR(:18) of the storage unit BHT-DA502.
The branch destination address of the entry indicated by -28) is read out via the level selection circuit 508.

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

VOのとき    VOLO+■0”1 + ””””
”” + voL、。
When VO VOLO+■0”1 + “”””
"" + voL,.

Vo・VtノトキVII’02VIL1+””・・””
”+VIIaVo・V?v2(7)トキV2LO,V2
L1.−・−・・−・−−−−・、V2I41VO°■
1・v2°VaノトキV3IJOIV3L1+ −−+
 VaLn以上のようにして、第2図におけるレベル選
択回路508から読出された分岐情報は第1図の命令記
憶回路408から読出される命令と、対応づけることが
可能である。
Vo/Vt Notoki VII'02VIL1+""...""
”+VIIaVo・V?v2 (7) Toki V2LO, V2
L1. −・−・・−・−−−・、V2I41VO°■
1・v2°Va notoki V3IJOIV3L1+ --+
VaLn As described above, the branch information read from the level selection circuit 508 in FIG. 2 can be associated with the instruction read from the instruction storage circuit 408 in FIG. 1.

第9図には、命令記憶回路408における命令と分岐ヒ
ストリテーブル(BHT)410における分岐情報の上
記対応関係が示されている。命令の実行順序が命令Ao
分岐命令BCo、B□、BCl、B2゜B3、BO2、
B3、BO2、C11C2・・・・・・・・・と予測さ
れた場合である。なお、〈A〉は人命令のアドレスを、
BOjは分岐命令をそれぞれ示す。
FIG. 9 shows the above-mentioned correspondence between instructions in the instruction storage circuit 408 and branch information in the branch history table (BHT) 410. Instruction execution order is instruction Ao
Branch instructions BCo, B□, BCl, B2゜B3, BO2,
This is a case where B3, BO2, C11C2...... is predicted. In addition, <A> is the address of the human command,
BOj indicates a branch instruction.

第10図を参照すると、前記第9図に示した分岐ヒスト
リテーブルBHT410による命令先取り動作は次のよ
うにされる。リクエストアドレスの命令アドレスレジス
タ411のセットに応答して命令記憶回路408から命
令語が読出され、これと同時にテーブルBHT410が
索引される。
Referring to FIG. 10, the instruction prefetching operation by the branch history table BHT 410 shown in FIG. 9 is performed as follows. An instruction word is read from the instruction storage circuit 408 in response to the request address being set in the instruction address register 411, and at the same time, the table BHT 410 is indexed.

信号線106を介してBHT−1−IIT信号が出力さ
れると記憶部BHT−DA502の分岐先アドレス〈B
1〉がアドレスレジスタ411にセットされ、命令先取
りが行われる。前記信号線106を介してBHT−HI
 T信号が出力されないときには、命だアドレスが出力
され、次の命令先取シが逐次性われる。
When the BHT-1-IIT signal is output via the signal line 106, the branch destination address <B
1> is set in the address register 411, and the instruction is prefetched. BHT-HI via the signal line 106
When the T signal is not output, the current address is output, and the next instruction is preempted sequentially.

以上の命令の先取シに従えば、命令記憶回路408から
読出される命令語は、テーブルBHT410の内容によ
る予測に従って順次読出され、命令バッファ409には
予測された命令の実行順に格納することが可能である。
According to the above instruction prefetching scheme, the instruction words read from the instruction storage circuit 408 are read out sequentially according to the prediction based on the contents of the table BHT 410, and can be stored in the instruction buffer 409 in the predicted execution order of the instructions. It is.

このとき、たとえ信号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 partially performing the instruction prefetching operation on the side opposite to the branch prediction direction.

以上のようにして命令先取シされた命令が分岐命令で第
1図の命令整列回路414によバ命令解読回路403に
導かれたとき同時に該分岐命令に対応する分岐情報が最
初の分岐情報レジスタ416(QR・0)にセットされ
る。
When the instruction preempted as described above is a branch instruction and is guided to the instruction decoding circuit 403 by the instruction alignment circuit 414 of FIG. 1, the branch information corresponding to the branch instruction is transferred to the first branch information register. It is set to 416 (QR・0).

以降前記分岐命令の進行に伴い、前記命令解読、アドレ
ス変換に対応して前記分岐情報が第2および第3の分岐
情報レジスタ417(QRl)および418(CaB6
)に転送される。そして、前記分岐命令の実行によって
生成される実際の分岐命令の生成結果と前記分岐情報レ
ジスタ418(QR2)に保持される該分岐命令の予測
情報との一致が予測確認回路420によりチェックされ
る。
Thereafter, as the branch instruction progresses, the branch information is stored in the second and third branch information registers 417 (QRl) and 418 (CaB6) corresponding to the instruction decoding and address conversion.
) will be forwarded to. Then, the prediction confirmation circuit 420 checks whether the actual branch instruction generation result generated by executing the branch instruction matches the prediction information of the branch instruction held in the branch information register 418 (QR2).

第8図を参照すると、前記予測確認回路・12゜は比較
回路801、フリップ70ツブ802および803、ア
ンド回路804−806、真偽回路807および808
、およびオア回路809から構成されている。前記比較
回路801には、分岐命令の実行によυ生成された分岐
先アドレスの実アドレスが命令アドレス変換回路402
から信号線109を介して与えられるとともに、分岐情
報レジスタ418(QR2)から予測された分岐先が線
108を介して与えられる。前記比較回路801では両
者の一致、不一致が判定される。判定結果と前記レジス
タ418から線108を介して与えられるVピットがア
ンド回路806に与えられる。 論理結果により分岐G
Oと予測されたときこの事実を示す信号がフリ、プフロ
ップ802にセットされる。このフリップフロップ80
2の出力がfl”で実際の分岐命令を実行した結果が分
岐N0GOであればアンド回路805から予測GO失敗
信号123が生成される。前記フリップフロップ801
の出力が°1”で、分岐命令の実行結果がGOであれば
アンド回路808から予測N0GO失敗信号125が生
成される。さらに該信号124と前記予測Go失敗信号
123との論理和がオア回路809から予測失敗信号1
12として生成される。
Referring to FIG. 8, the prediction confirmation circuit 12° is a comparison circuit 801, flip 70 knobs 802 and 803, AND circuits 804-806, and truth/false circuits 807 and 808.
, and an OR circuit 809. The comparison circuit 801 stores the real address of the branch destination address υ generated by the execution of the branch instruction in the instruction address conversion circuit 402.
is given via signal line 109, and the branch destination predicted from branch information register 418 (QR2) is given via line 108. The comparison circuit 801 determines whether the two match or do not match. The determination result and the V pit provided from the register 418 via the line 108 are provided to an AND circuit 806. Branch G depending on logical result
When an O is predicted, a signal indicating this fact is set in the flip-flop 802. This flip flop 80
If the output of 2 is "fl" and the result of executing the actual branch instruction is branch N0GO, a predicted GO failure signal 123 is generated from the AND circuit 805.The flip-flop 801
If the output of the branch instruction is "°1" and the execution result of the branch instruction is GO, a predicted N0GO failure signal 125 is generated from the AND circuit 808.Furthermore, the logical sum of the signal 124 and the predicted Go failure signal 123 is generated by an OR circuit. Prediction failure signal 1 from 809
12.

第1図および第11図を参照すると、分岐情報レジスタ
419(QR3)の分岐先アドレス部には、前記命令ア
ドレス変換回路402から新たに生成される分岐先アド
レスがセットされる。また、前記分岐情報レジスタ41
9(Qft3)の分岐命令BC1のアドレス部の内容と
該分岐命令BC1自身の命令語長部の内容とがアドレス
生成回路421により加算され分岐N0GO9tlの命
令の命令アドレスが生成される。
Referring to FIGS. 1 and 11, 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 (QR3). In addition, the branch information register 41
The address generation circuit 421 adds the contents of the address field of the branch instruction BC1 of 9 (Qft3) and the contents of the instruction word length field of the branch instruction BC1 itself to generate the instruction address of the instruction of the branch NOGO9tl.

そして分岐命令BC1の実際の実行によシ、分岐GOな
らば前記分岐情報レジスタ419(Ql−B3)から線
115を介して与えられる分岐先アドレス部の出力〈D
l〉が分岐N0GOならば線116を介して与えられる
前記アドレス生成回路421の出力〈B2〉が選択回路
422によシ選択される。前記分岐命令BOIの予測失
敗信号112が予測確認回路421から該選択回路42
2の出力〈Dl〉が線113を介してレジスタ423(
WR)にセットされる。
Then, when the branch instruction BC1 is actually executed, if the branch is GO, the output of the branch destination address field <D
If l> is a branch N0GO, the output <B2> of the address generation circuit 421 provided via the line 116 is selected by the selection circuit 422. The prediction failure signal 112 of the branch instruction BOI is sent from the prediction confirmation circuit 421 to the selection circuit 42.
The output <Dl> of 2 is sent to the register 423 (
WR).

一方、分岐情報レジスタ419(QIR3)の分岐命令
のアドレス<BOI>は信号線114を介して命令アド
レスレジスタ411(IAR)にセットされる。このア
ドレスは該分岐命令に対応する分岐ヒストリテーブル4
10(LIHT)の更新のため線101を介して該テー
ブル410にライトアドレスとして供給きれる。前記予
測失敗信号112の出力かフリップフロップ425に与
えられ、この出力が指示パルスとして線119を介して
テーブル401に与えられる。この出力に応答して分岐
命令の次の命令先取シ時のための分岐予測情報の更新が
行なわれる。この更新は、本芙施例では予測N0GOの
失敗のとき、前記レジスタ423(WR)に保持される
新たな分岐先アドレスで行なわれ、予測Go失敗のとき
はvビットをリセットするように行われるが分岐予測情
報の更新に寂けるアルゴリズムを用いて他の方法により
行なって追上つかえない。予測失敗しだとき予測側に後
続する命令の動作はすべてキャンセルされ、前記レジス
タ423(WR)に保持される新たなリクエストアドレ
スが分岐ヒストリテーブル410(BHT)の更新後に
命令アドレスレジスタ411 (IAR)に供給され改
めて命令の取出しが開始される。
On the other hand, the branch instruction address <BOI> of the branch information register 419 (QIR3) is set to the instruction address register 411 (IAR) via the signal line 114. This address is the branch history table 4 corresponding to the branch instruction.
10 (LIHT) can be supplied as a write address to the table 410 via line 101 for updating. The output of the prediction failure signal 112 is provided to a flip-flop 425, and this output is provided to the table 401 via line 119 as an instruction pulse. In response to this output, branch prediction information for the next instruction preemption of the branch instruction is updated. In this embodiment, when predicted N0GO fails, this update is performed with a new branch destination address held in the register 423 (WR), and when predicted Go fails, the v bit is reset. However, it is not possible to catch up by using other methods to update the branch prediction information. When a prediction fails, all operations of instructions following the prediction side are canceled, and the new request address held in the register 423 (WR) is updated to the instruction address register 411 (IAR) after updating the branch history table 410 (BHT). is supplied to the CPU, and command retrieval is started again.

思 第1υ目を参照すると、前記命令先取り制御回路424
はフリップフロップ1201、真偽回路1202−12
04およびアンド回路1205から構成されている。前
記フリップフロップ1201は前記予測失敗信号112
を1マシンサイクル保持するだめの7リツプフロツプで
ある。この回路424の出力はアドレスレジスタ411
の前段にあるセレクタの選択指示信号となる。この選択
指示信号は、前記命令アドレス加算回路412の出力、
前記レジスタ423の出力、前記テーブル410の出力
、および分岐情報レジスタ419の出力のうちのどれを
選択するかを指示するだめの信号でめる。なお、この命
令先取り制御回路424の制御により分岐予測が的中し
たときには後述する第16図の命令処理が行なわれ、分
岐予測が失敗したときには後述する第17図の命令処理
が行なわれる。前記命令アドレス加算回路11は線10
6を介してBHT−1−LIT信号が出力されないとき
分岐N0GO側の命令の先取りを行うだめのアドレス生
成を行う。このときアドレスは実アドレスで加算が行わ
れるために、例えば、ページングを行うコンピュータシ
ステムにおいて前記アドレス加算がページ境界を越えた
場合アドレス変換を改めてやり厘す必要が生じる。この
ために、前記命令アドレス加算回路11にページ境界越
え検出回路を設は該検出回路によυページ境界越えが生
じた場合、信号線Lllによシ命令アドレス生成回路1
を起動し、命令先取シ動作を改めて命令アドレス生成回
路(IA)401および命令アドレス変換回路(IT)
402から行うように制御すればよい。
Referring to the first υth instruction, the instruction prefetch control circuit 424
is a flip-flop 1201, a truth/false circuit 1202-12
04 and an AND circuit 1205. The flip-flop 1201 receives the prediction failure signal 112.
It is a 7 lip-flop that can hold 1 machine cycle. The output of this circuit 424 is the address register 411
This is the selection instruction signal for the selector in the previous stage. This selection instruction signal is the output of the instruction address addition circuit 412,
A signal is provided to instruct which one of the output of the register 423, the output of the table 410, and the output of the branch information register 419 is selected. Under the control of the instruction prefetch control circuit 424, when the branch prediction is successful, the instruction processing shown in FIG. 16, which will be described later, is performed, and when the branch prediction fails, the instruction processing shown in FIG. 17, which will be described later, is performed. The instruction address addition circuit 11 is connected to the line 10.
When the BHT-1-LIT signal is not output through 6, an address is generated to prefetch the instruction on the branch N0GO side. 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. For this purpose, a page boundary crossing detection circuit is provided in the instruction address addition circuit 11. When the page boundary crossing occurs due to the detection circuit, the instruction address generation circuit 1
The instruction address generation circuit (IA) 401 and the instruction address conversion circuit (IT) restart the instruction preemption operation.
Control may be performed starting from step 402.

ここで、問題となるのはあらたに分岐ヒストリテーブル
BH’f”410に前記命令アドレス情報を登録すると
き既存のどの部分に格納された命令アドレス情報を追い
出すかである。
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 BH'f'' 410.

この方法としては使われた順序、すなわち最も古く使わ
れたものから順に追い出す法LRU(Least &c
ontly Used )情報が入った順序すなわち、
最も古く入ったものから順に追い出す方法FIFO(F
irst In First Out )等があるがど
ちらを用いてもよい。
This method uses LRU (Least &c
only Used) The order in which the information was entered, i.e.
FIFO (F
irst In First Out), but either one may be used.

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

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

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

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

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

(4)If)ステージ:読出された命令が解読される。(4) If) 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)00ステージ:変換されたオペランドの実アドレ
スで記憶装置からオペランドが読出される。
(7) 00 stage: The operand is read from the storage device at the converted real address of the operand.

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

上述のITステージおよびOTステージのアドレス変換
において、アドレス変換バッファを設は必要な変換テー
ブルが該アドレス変換バッファに存在すれば上記アドレ
ス変換処理は高速に実行し得る。また、上述のICステ
ージおよびOCステージの命令およびオペランドの読出
し動作において主記憶装置のデータの一部の写しを保持
するキャッジ−メモリを設は必要な命令およびオペラン
ドが該キャッジ−メモリに存在すれはICステージおよ
びOCステージの処理は高速に行いうる。情報処理シス
テムは上述の各処理単位に対応したリリースを必ずしも
有する必要はない。しかし、説明の簡単のためにここで
は各処理単位にその機能を果す回路かめうものとする。
In the address translation of the IT stage and the OT stage described above, if an address translation buffer is provided and a necessary translation table exists in the address translation buffer, the address translation process can be executed at high speed. In addition, in the above-mentioned IC stage and OC stage instruction and operand read operations, a cache memory that holds a copy of part of the data in the main memory is provided, unless the necessary instructions and operands are present in the cache memory. Processing of the IC stage and OC stage can be performed at high speed. The information processing system does not necessarily have to have a release corresponding to each of the above-mentioned processing units. However, for the sake of simplicity, each processing unit is assumed to have a circuit that performs its function.

上述のIT 、 OTおよび10.00の各ステージの
高速処理が可能なとキ複数の命令の処理の流れを無駄な
く実行する8段のパイプライン制御が可能である。
The high-speed processing of the IT, OT, and 10.00 stages described above makes it possible to perform eight-stage pipeline control that efficiently executes the processing flow of multiple instructions.

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

第14図は分岐命令の命令先取りにお(八で、前述のす
べての分岐’oo’であると予測した場合の命令の処理
の流れを示す。すなわち、命令A−Qは分岐命令BOの
分岐条件を決定する命令で該分岐条件は命令AQの実行
給茶、すなわち、時刻t7において決定される。分岐命
令BOは時刻t4において解読されると命令アドレスの
生成回路を用いて、分岐先命令B1のアドレスを生成し
、以後B1命令を先取りするように動作する。
FIG. 14 shows the flow of instruction processing when all the branches mentioned above are predicted to be 'oo' in instruction prefetching of a branch instruction (in step 8). In other words, instructions A-Q are This is an instruction that determines the condition, and the branch condition is determined when the instruction AQ is executed, that is, at time t7.When the branch instruction BO is decoded at time t4, it uses the instruction address generation circuit to generate the branch destination instruction B1. , and thereafter operates to prefetch the B1 instruction.

時刻t2.t3.およびt4には分岐N0GO側の後 
  −続命令AI、A2.およびA3の命令先取シのた
めのアドレス生成が開始される。時刻t6およびt7に
は予測動作としての分岐GO側の後続命令B2およびB
3の命令先取シ動作が開始される。時刻t7において分
岐条件の判定結果により、時刻t8以降は正しい命令の
処理の流れに従って処理が継続される。
Time t2. t3. and after the branch N0GO side at t4.
-Continuation instruction AI, A2. Then, address generation for instruction preemption of A3 is started. At times t6 and t7, subsequent instructions B2 and B on the branch GO side as predicted operations are executed.
The instruction preemption 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サイクル予測失敗(
分岐N0GO)のとき 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 incorrect (branch GO).
When branching (NOGO), it takes 3 cycles.

分岐GO率γ 予測的中率αとしたとき、この場合γ=
αでめり、予測的中率は5分5分である。従ってr−α
=05であシ1分岐命令当シ平均的なロスサイクルは 3×γ+3×(1−γ)=3サイクル である。
Branch GO rate γ When predicted accuracy rate α, in this case γ=
With α, the prediction accuracy is 5 minutes and 5 minutes. Therefore r-α
=05, and the average loss cycle for one branch instruction is 3×γ+3×(1−γ)=3 cycles.

一方第15図は分岐命令の命令先取シにおいて、前述の
同じ分岐命令の過去の結果に基づいて予測を行った場合
の命令の処理の流れで示す。
On the other hand, FIG. 15 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.

すなわち、分岐命令BCは、時刻t4において解読され
るとともに分岐命令のアドレステーブルを探索しその有
無によるか、もしくは分岐指示フラグの指示の予測によ
ハ分岐Go側の命令B1を先取りするか分岐N0GO側
の命令A1を先取りするかを決定する。前回と同様に時
刻t2.t3およびt4には分岐N0GO側の後続命令
へ1.A2.およびA3の命令先取シのだめのアドレス
生成が開始される。時刻t6およびt7には予測による
命令先取りの後続命令B1およびB2もしくはA4およ
びA5の命令のアドレス生成が開始される。時刻t7に
おいて分岐条件の判定結果により時刻t8以降は正しい
命令の処理の流れに従って処理が継続される。この場合
、分岐命令の出現によるパイプラインのロスサイクルは 分岐GOと予測して失敗したとき  3サイクル分岐N
0(K)と予測して失敗したとき  6サイクルである
。従って、分岐Go率γ=0.5  予測的中率α=0
8と仮定したとき1分岐命令当シの平均的なロスサイク
ルは 3・γ・α十〇・(1−γ)・α+3γ(1−α)+6
(1−γ)(1−α)=21サイクル を得る。
That is, the branch instruction BC is decoded at time t4, and the address table of the branch instruction is searched to determine whether it exists or not, or whether the instruction B1 on the branch Go side is preempted based on the prediction of the branch instruction flag, or whether the branch instruction B1 on the branch Go side is preempted or the branch N0 GO is executed. It is determined whether to pre-fetch the side instruction A1. Same as last time, time t2. At t3 and t4, 1. A2. Then, generation of a preemptive address for instruction A3 is started. 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. Based on the branch condition determination result at time t7, processing continues from time t8 onwards according to the correct instruction processing flow. In this case, when the pipeline loss cycle due to the appearance of a branch instruction is predicted to be a branch GO and fails, 3 cycles branch N
When the prediction is 0(K) and it fails, it is 6 cycles. Therefore, branch Go rate γ = 0.5 Prediction accuracy rate α = 0
8, the average loss cycle for one branch instruction is 3・γ・α10・(1−γ)・α+3γ(1−α)+6
We get (1-γ)(1-α)=21 cycles.

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

従って、分岐命令が生じた場合たとえ予測が的中しても
ロスサイクルを生じることになる。
Therefore, if a branch instruction occurs, a loss cycle will occur even if the prediction is correct.

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

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

第16図および第17図を参照すると、分岐命令BOの
時刻t1における動作は次のようにして行なわれる。ま
ず、該分岐命令Beが命令キャッジ−メモリから読出さ
れると同時に分岐ヒストリテーブルが索引される。該分
岐命令BOの命令アドレスが登録されていれば対応する
分岐情報が読出される。該分岐情報と分析した結果、分
岐GO側の予測として該分岐情報中に含まれる分岐先ア
ドレスにより分岐先命令B1の命令先取りを開始するか
、もしくは分岐N 0()(J側の予測として分岐N0
GO側の命令A1の命令アドレスを生成して命令A1の
先取シを開始するかが決定される。以降時刻t5jでは
前記分岐命令BCの予測期間であシ予測側の後続命令が
先取シされ時刻t5において分岐条件が決定される。予
測的中時には第16図に示すようにパイプラインの流れ
は乱れを生することなく処理が継続される。予測失敗時
には第17図に示すようにt6時刻で前記分岐ヒストリ
テーブルの更新を行った後に正しい命令の流れから命令
の取出しを行うように制御される。この場合、分岐命令
の出現によるパイプラインのロスサイクルは 予測が的中したとき   Oサイクル 予測が失敗したとき   5サイクル である。予測的中率αはこの場合分岐方向だけでなく分
岐先アドレスをも予測することから分岐方向だけの予測
に比べ若干低くなるが、その割合は微々たるものでるる
。従って、予測的中率α=08として1分岐命令当りの
平均的なロスサイクルは 0・α+5・(1−α)=1サイクル となり従来技術に比べて格段に改良される。
Referring to FIGS. 16 and 17, the operation of branch instruction BO at time t1 is performed as follows. First, the branch history table is indexed at the same time as the branch instruction Be is read from the instruction cache memory. If the instruction address of the branch instruction BO is registered, the corresponding branch information is read. As a result of the analysis with this branch information, the instruction prefetch of the branch destination instruction B1 is started based on the branch destination address included in the branch information as a prediction on the branch GO side, or the branch N0() (branch as a prediction on the J side) N0
It is determined whether to generate an instruction address for the instruction A1 on the GO side and start prefetching the instruction A1. Thereafter, at time t5j, a subsequent instruction on the prediction side is preempted during the prediction period of the branch instruction BC, and the branch condition is determined at time t5. When the prediction is correct, the processing continues without any disturbance in the flow of the pipeline, as shown in FIG. When prediction fails, the branch history table is updated at time t6, as shown in FIG. 17, 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 O 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 ratio is insignificant. Therefore, assuming the prediction accuracy rate α=08, the average loss cycle per branch instruction is 0·α+5·(1−α)=1 cycle, which is a significant improvement over the prior art.

この発明では、分岐命令のアドレスと該分岐命令のアド
レスと該分岐命令の分岐先アドレスを含む分岐情報とを
対にして記憶する分岐ヒストリテーブルを命令先取り時
に索引する。このあとで前記分岐先アドレスで次の命令
先取を行わせしめることによシ、命令の解読を行うこと
なく前記分岐ヒストリテーブルの記述に従って命令語を
先取シすることができる。このことによシ該分岐ヒスト
リテーブルの記述が正しい場合に限シ命令バッファには
、命令の実行の経路に従った命令の待行列を形成せしめ
、情報処理システムのパイプライン制御における分岐命
令の実行ioスサイクルをともなうことなく行なうこと
ができるという効果がある。
In this invention, a branch history table that stores the address of a branch instruction and branch information including the address of the branch instruction and the branch destination address of the branch instruction as a pair is indexed when an instruction is prefetched. By subsequently causing the next instruction to be prefetched at the branch destination address, the instruction word can be prefetched according to the description in the branch history table without decoding the instruction. As a result, only when the description in the branch history table is correct, a queue of instructions is formed in the instruction buffer according to the instruction execution path, and branch instructions are executed in pipeline control of the information processing system. This has the advantage that it can be performed without an IO cycle.

さらに本発明では、分岐命令のアドレスと該分岐命令の
分岐先アドレスを指定する情報を含む分岐情報を対にし
て複数対記憶する分岐ヒストリテーブルをセットアソミ
アティプ型メモリで構成することによシ犬容量のメモリ
からなる分岐ビストリテーブルを実現することができる
という効果がある。
Furthermore, in the present invention, a branch history table that stores a plurality of pairs of branch information including the address of a branch instruction and information specifying the branch destination address of the branch instruction is configured with a set assomiasi type memory. This has the advantage that it is possible to realize a branch bistry table consisting of a memory with a large capacity.

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

第1図は本発明の一実施例を示す図、第2図は分岐ヒス
トリテーブルの詳細な構成を示す図、第3図は第2図の
記憶部501および601の記憶形式を示す図、第4図
は第2図のテスト回路503−506の詳細な構成を示
す図、第5図は命令語の構成を示す図、第6図は第2図
のプライオリティ回路507の詳細な構成を示す図、第
7図は第」図のレジスタ417−419の格納形式を示
す図、第8図は第1図の予測確認回路420の詳細な構
成を示す図、第9図は第1図の命令記憶回路408にお
ける命令と分岐ヒストリテーブル410における分岐情
報との対応関係を説明するだめの図、第10図は第9図
のテーブル410による命令先取シ動作を説明するだめ
の図、第11図は予測失敗時における命令先取り動作開
始までの動作を説明するための図、第12図は第1図の
命令先取り制御回路の詳細な構成を示す図、第13図は
命令の処理の流れの概要を示す図、第14図および第1
5図は従来の予測方式を用いた命令の処理の流れを示す
図、第16図は本発明において、分岐命令の予測が的中
したときの命令の処理の流れを示す図、および第17図
は本発明に2いて分岐命令の予測が失敗したときの命令
の処理の流れを示す図である。 第1図から第17図において、401・・・命令アドレ
ス生成回路、402・・・命令アドレス変換回路、40
3・・・命令解読回路、404・・・オペランドアドレ
ス生成回路、405・・・オペランドアドレス変換回路
、406・・・オペランド読出し回路、407・・・命
令実行回路、408・・・命令記憶回路、409・・・
命令バッファ、410・・・分岐ヒストリテーブル’(
BHT)、411・・・命令アドレスレジスタ(IAR
)、412・・・命令アドレス加算回路、413・・・
分岐情報バッファ、414・・・命令整列回路、415
・・・分岐情報切換回路、416・・・分岐情報レジス
タ(Qao)、417・・・分岐情報レジスタ(QRt
)、418・・・分岐情報レジスタ(QR2)、419
・・・分岐情報レジスタ(QR3)、420・・・予測
確認回路、421・・・アドレス生成回路、422・・
・選択回路、423・・・レジスタ(VvR)、424
・・・命令先取り制御回路、425・・・フリップフロ
ップ、501.502・・・記憶部、503,504,
505,506・・・テスト回路、507・・・プライ
オリティ回路、508・・・選択回路、509・・・オ
ア回路。 代理人 弁理士  内 原   晋 41 402     口 第1f 図 第12図 第13 l2I) l fol it l l2I ta1tφ1む1t1
呑71t−a+第14図 1folix 乙21t31 t41び1h177It
a1to  tt  t2  /:、3  t4ts 
 tbX″−\ 8/   Af 1i21t311−411−51  を乙’j7’ L
8’「[ ローS 第17 図
FIG. 1 is a diagram showing an embodiment of the present invention, FIG. 2 is a diagram showing the detailed structure of a branch history table, FIG. 3 is a diagram showing the storage format of the storage units 501 and 601 in FIG. 4 shows a detailed configuration of the test circuits 503-506 in FIG. 2, FIG. 5 shows a command word configuration, and FIG. 6 shows a detailed configuration of the priority circuit 507 in FIG. 2. , FIG. 7 is a diagram showing the storage format of the registers 417 to 419 in FIG. 1, FIG. 8 is a diagram showing the detailed configuration of the prediction confirmation circuit 420 in FIG. FIG. 10 is a diagram for explaining the correspondence between instructions in the circuit 408 and branch information in the branch history table 410. FIG. 10 is a diagram for explaining the instruction preemption operation by the table 410 in FIG. 9. FIG. 11 is a diagram for explaining the prediction. 12 is a diagram showing the detailed configuration of the instruction prefetch control circuit in FIG. 1. FIG. 13 is an overview of the instruction processing flow. Figures 14 and 1
FIG. 5 is a diagram showing the flow of instruction processing using the conventional prediction method, FIG. 16 is a diagram showing the flow of instruction processing when the prediction of a branch instruction is correct in the present invention, and FIG. FIG. 2 is a diagram showing the flow of instruction processing when prediction of a branch instruction fails in accordance with the second embodiment of the present invention. 1 to 17, 401...instruction address generation circuit, 402...instruction address conversion circuit, 40
3... Instruction decoding circuit, 404... Operand address generation circuit, 405... Operand address conversion 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, 414...Instruction alignment circuit, 415
... Branch information switching circuit, 416... Branch information register (Qao), 417... Branch information register (QRt
), 418...Branch information register (QR2), 419
...Branch information register (QR3), 420...Prediction confirmation circuit, 421...Address generation circuit, 422...
・Selection circuit, 423...Register (VvR), 424
...Instruction prefetch control circuit, 425...Flip-flop, 501.502...Storage unit, 503, 504,
505, 506... Test circuit, 507... Priority circuit, 508... Selection circuit, 509... OR circuit. Agent Patent Attorney Susumu Uchihara 41 402 Mouth 1f Figure 12 Figure 13 l2I) l fol it l l2I ta1tφ1mm1t1
Drink 71t-a + Fig. 14 1folix Otsu 21t31 t41 and 1h177It
a1to tt t2 /:, 3 t4ts
tbX″-\ 8/ Af 1i21t311-411-51 Otsu'j7' L
8' ``[ Low S Figure 17

Claims (1)

【特許請求の範囲】 分岐命令のアドレスを指定する情報と、該分岐先アドレ
スを指定する情報を含む分岐情報とを対にして複数対記
憶する分岐ヒストリテーブル手段と、 命令先取多動作の際に該命令先取多動作において先取シ
されるべき分岐命令のアドレスを指定する情報が前記分
岐ヒストリテーブル手段に登録されているか否かを調べ
る点検手段と、この点検手段による前記登録の判明に応
答して該分岐ヒストリテーブル手段から前記先取シされ
るべき分岐命令に対応する分岐情報を読み出し該分岐情
報に従い、次の命令先取り動作を開始するように制御す
る制御手段と、 アドレス空間上のブロックを単位とし、あらかじめ定め
たセット数およびあらかじめ定めたレベル数を有し、分
岐命令の命令アドレスの一部を保持するディレクトリ記
憶手段と、前記ディレクトリ記憶手段の記憶内容に対応
する分岐情報を格納するデータ記憶手段とを備えたこと
を特徴とするセットアソシアティブ型分岐ヒストリテー
ブルを有する命令先取シ装置。
[Scope of Claims] Branch history table means for storing a plurality of pairs of information specifying the address of a branch instruction and branch information including information specifying the branch destination address; Checking means for checking whether information specifying the address of a branch instruction to be preempted in the instruction prefetching multiple operation is registered in the branch history table means, and in response to the confirmation of the registration by the checking means. control means for reading out branch information corresponding to the branch instruction to be preempted from the branch history table means and controlling to start the next instruction prefetching operation according to the branch information; , a directory storage means that has a predetermined number of sets and a predetermined number of levels and holds a part of instruction addresses of branch instructions, and a data storage means that stores branch information corresponding to the storage contents of the directory storage means. An instruction prefetching device having a set associative branch history table.
JP57201557A 1982-11-17 1982-11-17 Instruction prefetch device having set associative type history table Granted JPS5991552A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP57201557A JPS5991552A (en) 1982-11-17 1982-11-17 Instruction prefetch device having set associative type history table
EP83111451A EP0109655B1 (en) 1982-11-17 1983-11-15 Instruction prefetching device with prediction of a branch destination address
DE8383111451T DE3382350D1 (en) 1982-11-17 1983-11-15 ARRANGEMENT FOR RETRIEVING COMMANDS PREDICTING A BRANCH TARGET ADDRESS.
US07/286,021 US4984154A (en) 1982-11-17 1988-12-19 Instruction prefetching device with prediction of a branch destination address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57201557A JPS5991552A (en) 1982-11-17 1982-11-17 Instruction prefetch device having set associative type history table

Publications (2)

Publication Number Publication Date
JPS5991552A true JPS5991552A (en) 1984-05-26
JPS6310451B2 JPS6310451B2 (en) 1988-03-07

Family

ID=16443018

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57201557A Granted JPS5991552A (en) 1982-11-17 1982-11-17 Instruction prefetch device having set associative type history table

Country Status (1)

Country Link
JP (1) JPS5991552A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6324421A (en) * 1986-07-17 1988-02-01 Nec Corp Information processor
DE4034009A1 (en) * 1989-10-26 1991-05-02 Hitachi Ltd COMMAND RETRIEVEMENT METHOD

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5022384A (en) * 1973-06-29 1975-03-10
JPS5599655A (en) * 1979-01-26 1980-07-29 Tetsunori Nishimoto Branch control unit
JPS5759253A (en) * 1980-09-29 1982-04-09 Nec Corp Branch instruction prefetch system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5022384A (en) * 1973-06-29 1975-03-10
JPS5599655A (en) * 1979-01-26 1980-07-29 Tetsunori Nishimoto Branch control unit
JPS5759253A (en) * 1980-09-29 1982-04-09 Nec Corp Branch instruction prefetch system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6324421A (en) * 1986-07-17 1988-02-01 Nec Corp Information processor
DE4034009A1 (en) * 1989-10-26 1991-05-02 Hitachi Ltd COMMAND RETRIEVEMENT METHOD

Also Published As

Publication number Publication date
JPS6310451B2 (en) 1988-03-07

Similar Documents

Publication Publication Date Title
US4764861A (en) Instruction fpefetching device with prediction of a branch destination for each branch count instruction
US4827402A (en) Branch advanced control apparatus for advanced control of a branch instruction in a data processing system
EP0109655B1 (en) Instruction prefetching device with prediction of a branch destination address
JP2746549B2 (en) Computer system and operation method thereof
US4881170A (en) Instruction prefetch control apparatus
US4477872A (en) Decode history table for conditional branch instructions
US5297281A (en) Multiple sequence processor system
KR19990087940A (en) A method and system for fetching noncontiguous instructions in a single clock cycle
JPS6125169B2 (en)
JP3794918B2 (en) Branch prediction that classifies branch prediction types using return selection bits
JPH08320788A (en) Pipeline system processor
KR930003124B1 (en) Apparatus for the control of branch instruction in pipeline system
US6920549B1 (en) Branch history information writing delay using counter to avoid conflict with instruction fetching
KR100431975B1 (en) Multi-instruction dispatch system for pipelined microprocessors with no branch interruption
JPS5991551A (en) Instruction prefetching device forecasting address to be branched
US6532534B1 (en) Information processing apparatus provided with branch history with plurality of designation ways
JPS5991552A (en) Instruction prefetch device having set associative type history table
JPH046983B2 (en)
JPS6236258B2 (en)
JPS5991554A (en) Instruction prefetch device forecasting branch direction
JPH0695306B2 (en) Instruction prefetching device
JPH07200406A (en) Cache system
JPS60175148A (en) Instruction prefetching device
JP2542565B2 (en) Branch predictive control method
JPS5991553A (en) Instruction prefetch device having real address branching history table