JPS62159232A - Instruction prefetching device - Google Patents
Instruction prefetching deviceInfo
- Publication number
- JPS62159232A JPS62159232A JP32586A JP32586A JPS62159232A JP S62159232 A JPS62159232 A JP S62159232A JP 32586 A JP32586 A JP 32586A JP 32586 A JP32586 A JP 32586A JP S62159232 A JPS62159232 A JP S62159232A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- branch
- address
- stage
- circuit
- 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.)
- Pending
Links
- 230000004044 response Effects 0.000 claims abstract description 37
- 230000010365 information processing Effects 0.000 claims description 2
- 238000012790 confirmation Methods 0.000 description 56
- 238000011084 recovery Methods 0.000 description 35
- 238000010586 diagram Methods 0.000 description 19
- 238000006243 chemical reaction Methods 0.000 description 14
- 238000012545 processing Methods 0.000 description 13
- 238000013519 translation Methods 0.000 description 8
- 102100026437 Branched-chain-amino-acid aminotransferase, cytosolic Human genes 0.000 description 4
- 101000766268 Homo sapiens Branched-chain-amino-acid aminotransferase, cytosolic Proteins 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 108010077641 Nogo Proteins Proteins 0.000 description 3
- 102100029831 Reticulon-4 Human genes 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000000034 method Methods 0.000 description 2
- 101100342994 Arabidopsis thaliana IIL1 gene Proteins 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
Landscapes
- Advance Control (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明′は、情?+11処理装置の命令シーケンスのス
テップに含まれる分岐条件判定ステップ実行処理に先立
って判定結果を予測しつつ次の命令の先取りを行なう命
令先取り装置に関する。[Detailed Description of the Invention] [Industrial Field of Application] The present invention' The present invention relates to an instruction prefetching device that prefetches the next instruction while predicting a judgment result prior to execution processing of a branch condition judgment step included in a step of an instruction sequence of a +11 processing device.
〔従来の技術〕 ゛
従来、分岐ヒストリテーブルを用いて分岐予測を行なう
命令先取り装置としては、例えば特開昭59−9155
0号公報に見られる装でか存在する。この従来装置は分
岐命令のアドレスを指定する情報とその分岐命令の分岐
先アドレスを含む分岐情報とを対にして分岐ヒストリテ
ーブルに登録しでおき、命令先取り動作としてキャッシ
ュメモリから命令を取出す時に、先取りする命令のアド
レスが分岐命令のアドレスとして分岐ヒストリテーブル
に登録されているか否かを調べ、登録されていれば対応
する分岐先アドレスを用いて次の命令先取り動作を行な
うよう制御するもので、分岐ヒストリテーブルに登録さ
れた情報が誤っていた場合には、その命令の分岐条件の
判定を行った後に分岐ヒストリテーブルの対応する情報
を更新し、その後に後続の命令の先取りをやり直すよう
構成されている。[Prior Art] ゛In the past, as an instruction prefetch device that performs branch prediction using a branch history table, for example, Japanese Patent Laid-Open No. 59-9155
It exists in the form seen in Publication No. 0. This conventional device registers a pair of information specifying the address of a branch instruction and branch information including the branch destination address of the branch instruction in a branch history table, and when fetching an instruction from the cache memory as an instruction prefetch operation, It checks whether the address of the instruction to be prefetched is registered in the branch history table as the address of a branch instruction, and if it is registered, the next instruction is prefetched using the corresponding branch destination address. If the information registered in the branch history table is incorrect, the branch condition for that instruction is determined, the corresponding information in the branch history table is updated, and then the prefetching of the subsequent instruction is performed again. ing.
前記の従来技術においては、分岐命令の分岐先アドレス
の計算に使用するレジスタの保持する値の更新等により
分岐先アドレスが変更になって、分岐ヒストリテーブル
の保持する情報に含まれる古い分岐先アドレスに従って
命令先取り動作が行なわれてしまった場合、後続の正し
い命令が取出されるのは、誤った分岐情報を持っていた
命令の分岐条件判定ステップの終了後のこととなる。し
かしながら、無条件分岐命令においては、分岐条件判定
ステップを待たずとも、正しい分岐先アドレスさえ求ま
れば、命令の取出しのやり直しは可能である。ところが
、前記従来技術においては、分岐条件判定ステップを終
了しない限り、分岐予測の妥当性を評価できないため、
分岐アドレスが頻繁に変更されるような分岐命令の実行
においては、その処理速度の低下を招くという欠点があ
る。In the above-mentioned conventional technology, the branch destination address is changed due to updating of the value held in the register used to calculate the branch destination address of the branch instruction, and the old branch destination address included in the information held in the branch history table is changed. If an instruction prefetch operation is performed in accordance with the above, the subsequent correct instruction will be taken out only after the branch condition determination step for the instruction having incorrect branch information is completed. However, in the case of an unconditional branch instruction, it is possible to retake the instruction without waiting for the branch condition determination step, as long as the correct branch destination address is found. However, in the prior art, the validity of branch prediction cannot be evaluated unless the branch condition determination step is completed.
Execution of branch instructions whose branch addresses are frequently changed has the disadvantage of slowing down the processing speed.
本発明はこのような従来の欠点を解消したもので、その
目的は、分岐先アドレスの誤った分岐情報に基づく命令
先取りが行なわれた場合、速やかに正しい後続の命令先
取り動作を行なわせることにある。The present invention eliminates such conventional drawbacks, and its purpose is to promptly perform a correct subsequent instruction prefetch operation when an instruction is prefetched based on incorrect branch information of a branch destination address. be.
c問題点を解決するための手段〕
本発明は上記目的を達成するために、情報処理装置にお
ける命令先取り装置において、分岐命令のアドレスを指
定する情報と該分岐命令の分岐先アドレスを含む分岐情
報とを対にして複数対記憶する分岐ヒストリテーブル手
段と、命令先取り動作を行なう際に該命令先取り動作に
おいて先取りされる命令のアドレスを指定する情報が前
記分岐ヒストリテーブル手段に登録されているか否かを
調べる第1の点検手段と、前記先取りされた命令に対応
する分岐情報に含まれる分岐先アドレスを指定する情報
が正しいかどうかを該先取りされた命令の分岐条件の判
定に先立って調べる第2の点検手段と、
前記第1の点検手段による登録の判明に応答して前記分
岐ヒス) IJ子テーブル段から対応する分岐情報を読
出し該分岐情報に従って命令先取り動作を継続せしめる
よう制御し、且つ、前記第1および第2の点検手段の結
果に応答して誤った分岐先アドレスを指定する分岐Mf
報に従って命令先取り動作が行なわれた時には前記先取
りされた命令の実行を待たずに後続の誤った命令先取り
動作を是正せしめるよう制御する命令先取り制御手段と
を備える。Means for Solving Problem c] In order to achieve the above object, the present invention provides an instruction prefetching device in an information processing device that provides branch information that includes information specifying the address of a branch instruction and a branch destination address of the branch instruction. branch history table means for storing a plurality of pairs of instructions; and whether or not information specifying the address of the instruction to be prefetched in the instruction prefetching operation is registered in the branch history table means when performing an instruction prefetching operation. and a second checking means for checking whether information specifying a branch destination address included in branch information corresponding to the prefetched instruction is correct prior to determining the branch condition of the prefetched instruction. control means for reading out corresponding branch information from the IJ child table stage and continuing the instruction prefetching operation in accordance with the branch information in response to the confirmation of registration by the first checking means; a branch Mf that specifies an incorrect branch destination address in response to the results of the first and second checking means;
and an instruction preemption control means for performing control so as to correct a subsequent erroneous instruction prefetching operation without waiting for the execution of the prefetched instruction when the instruction prefetching operation is performed according to the information.
誤った分岐先アドレスを指定する分岐情報に従って命令
先取り動作が行なわれると、第1.第2の点検手段の結
果に応答して、命令先取り制御手段は、先取りされた命
令の分岐条件判定ステップの終了を待たずに後続の誤っ
た命令先取り動作を是正する。When an instruction prefetch operation is performed according to branch information that specifies an incorrect branch destination address, the first . In response to the result of the second checking means, the instruction prefetching control means corrects the subsequent erroneous instruction prefetching operation without waiting for completion of the branch condition determination step of the prefetched instruction.
次に本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.
第1図を参照すると本発明の一実施例は、命令アドレス
生成回路(rA)401、命令アドレス変換回路(IT
)402、命令解読回路(ID)403、オペランドア
ドレス生成回路(OA) 404 、オペランドアドレ
ス変換回路(OT) 405 、オペランド記憶回路を
有するオペランド続出し回路(○C)406、命令実行
回路(EX) 407 、命令記憶回路(I C) 4
08 、命令バッファ409、分岐ヒストリテーブル(
B HT) 410 、命令アドレスレジスタ411、
命令アドレス加算回路412、分岐情報バッファ413
、命令整列回路414、分岐情報切換回路415、分岐
情報レジスタ416,417,418,419,420
、選択回路421,422 、命令先取り制御回路42
3 、OAステージ予/M確認回路424.OTステー
ジ予測確認回路425、OCステージ予測確認回路42
6、EXステージ予7fI116fi L’1回路42
7、命令アドレスリカバレジスフ428、アドレス生成
回路430.431,432゜比較回路433、レジス
タ434,435 、フリツプフロツプ436,437
,438,439,440.441から構成されている
。Referring to FIG. 1, one embodiment of the present invention includes an instruction address generation circuit (rA) 401, an instruction address translation circuit (IT
) 402, instruction decoding circuit (ID) 403, operand address generation circuit (OA) 404, operand address conversion circuit (OT) 405, operand successive output circuit (○C) having an operand storage circuit 406, instruction execution circuit (EX) 407, instruction storage circuit (IC) 4
08, 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 registers 416, 417, 418, 419, 420
, selection circuits 421, 422, instruction prefetch control circuit 42
3. OA stage pre/M confirmation circuit 424. OT stage prediction confirmation circuit 425, OC stage prediction confirmation circuit 42
6, EX stage pre-7fI116fi L'1 circuit 42
7. Instruction address recovery register 428, address generation circuit 430, 431, 432° comparison circuit 433, registers 434, 435, flip-flop 436, 437
, 438, 439, 440.441.
なお、命令先取り制御回路423が命令先取り制御手段
を構成し、OCステージ予測確認回路426が第2の点
検手段*2を構成し、分岐ヒストリテーブル410が分
岐ヒストリテーブル手段及び第1の点検手段*1を構成
する。Note that the instruction prefetch control circuit 423 constitutes an instruction prefetch control means, the OC stage prediction confirmation circuit 426 constitutes a second inspection means*2, and the branch history table 410 constitutes a branch history table means and a first inspection means*. 1.
命令記憶回路408およびオペランド読出し回路406
内のオペランド記憶回路は共に主記憶装置そのものであ
ってもよく、さらに命令記憶回路408が主記憶装置の
命令部の一部の写しである命令キャッシュメモリ、前記
オペランド記憶回路が主記憶装置のオペランド部の一部
の写しであるオペランドキャノシェメモリとして構成し
ても良い。Instruction storage circuit 408 and operand read circuit 406
Both of the operand storage circuits in the main memory may be the main memory itself, and further, the instruction storage circuit 408 may be an instruction cache memory which is a copy of a part of the instruction section of the main memory, and the operand storage circuit may be a main memory operand storage circuit. It may also be configured as an operand cache memory that is a copy of a part of the section.
本発明は前述の命令の処理単位に対応した装置構成を必
ずしも有する必要はなく、例えば命令アドレス生成回路
401 とオペランドアドレス生成回路404.命令ア
ドレス変換回路402とオペランドアドレス変換回路4
05.命令解読回路408とオペランド続出し回路40
6内の記j17回路が共用されたコンピュータシステム
においても適用され得る。The present invention does not necessarily need to have a device configuration corresponding to the above-mentioned instruction processing unit; for example, an instruction address generation circuit 401, an operand address generation circuit 404, etc. Instruction address conversion circuit 402 and operand address conversion circuit 4
05. Instruction decoding circuit 408 and operand successive output circuit 40
The j17 circuit in 6 can also be applied in a shared computer system.
第1図において、分岐ヒストリテーブル(BHT) 4
10は分岐命令のアドレスを指定する情報と該分岐命令
の実行の予測としての分岐成否フラグ(V)と分岐先ア
ドレスとを第3図に示すように対にして記憶している。In Figure 1, branch history table (BHT) 4
10 stores information specifying the address of a branch instruction, a branch success/failure flag (V) as a prediction of execution of the branch instruction, and a branch destination address in pairs as shown in FIG.
命令記憶回路408に対する命令アドレスレジスタ(I
AR)411は、命令読出しのリクエストアドレスを保
持して命令の読出し動作を実行する。An instruction address register (I) for the instruction storage circuit 408
AR) 411 holds an instruction read request address and executes an instruction read operation.
さらに命令アドレスレジスタ(IAR)411は分岐ヒ
ストリテーブル(BHT)410および命令アドレス加
算回路412に信号線101を介して接続されている。Further, an instruction address register (IAR) 411 is connected to a branch history table (BHT) 410 and an instruction address adder circuit 412 via a signal line 101.
レジスタ411の内容は分岐ヒストリテーブル(BHT
)410を索引し、読出されるべき命令のアドレスがそ
れに登録されているか否かを示す信号を信号線106に
出力する。登録されていれば対応する分岐先アドレスが
信号線105に読出される。登録されていなければ命令
アドレス加算回路412により後続の命令語の命令先取
りのためのアドレスが生成される。The contents of register 411 are branch history table (BHT
) 410 and outputs a signal 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 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と仮定したとき単に“rAR
+8”を出力107に生成する回路である。命令バッフ
ァ409は、命令記憶回路408から読出された8By
teの先取り命令語を蓄積し命令処理部への命令の供給
における待ち行列(Queue)を形成する。命令整列
回路414は、命令バッファ409が空のとき信号線1
02を介して命令記憶回路408から読み出される。8
Byteの命令語に対応して、また命令バンファ409
が空でないとき信号線103を介して前記命令バッファ
に貯えられる8Byteの命令語に対応してそれぞれ命
令を抽出して信号vA104を介して命令解読回路40
3に命令を供給する回路である。The instruction address addition circuit 412 simply adds “rAR” when assuming that the instruction word read in one request is 8 bytes.
+8" to the output 107. The instruction buffer 409 is a circuit that generates 8 Bytes read from the instruction storage circuit 408.
The prefetched instruction words of te are accumulated to form a queue for supplying instructions to the instruction processing unit. The instruction alignment circuit 414 outputs signal line 1 when the instruction buffer 409 is empty.
02 from the instruction storage circuit 408. 8
Corresponding to the instruction word of Byte, the instruction buffer 409
When the instruction buffer is not empty, each instruction is extracted corresponding to the 8-byte instruction word stored in the instruction buffer via the signal line 103 and sent to the instruction decoding circuit 40 via the signal vA 104.
This is a circuit that supplies instructions to 3.
命令解読回路403は信号線104を介して命令語が与
えられると、その命令語長を信号線112を介して分岐
情報レジスタ417へ報告するとともに、その命令が分
岐命令(無条件分岐命令9条件分岐命令など分岐動作を
行ない得る命令)であるか否かを信号線113を介して
OAステージ予測確認回路424へ報告し、さらに、そ
の命令が無条件分岐命令であるか否かと、計数分岐命令
(Branch oncoun を命令:以陣BCT命
令と呼ぶ)であるか否かを信号線114を介してレジス
タ435ヘセノトする機能を有する。When the instruction decoding circuit 403 receives an instruction word via the signal line 104, it reports the length of the instruction word to the branch information register 417 via the signal line 112, and also indicates that the instruction is a branch instruction (unconditional branch instruction 9 condition). It reports to the OA stage prediction confirmation circuit 424 via the signal line 113 whether the instruction is an instruction that can perform a branch operation such as a branch instruction, and also reports whether the instruction is an unconditional branch instruction or not, and whether the instruction is a count branch instruction or not. (Branch oncoun is called an instruction: a BCT instruction) or not is sent to the register 435 via the signal line 114.
分岐情報バッファ413は、命令バッファ409に格納
される命令語に対して用意されておりその命令語中に分
岐成功と予測された分岐命令が存在すれば、第7図に示
す該分岐命令の分岐情報を格納する回路であり、分岐命
令のアドレスは信号線101を介して、また分岐情報と
しての分岐先アドレスおよびvビットは分岐ヒストリテ
ーブル(BHT)410から信号線105を介してそれ
ぞれセットされ、分岐成功と予測さた分岐命令が存在し
なければ、■ビットは0に、命令アドレスは信号線lo
tを介してそれぞれセットされる。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. This circuit stores information, and the address of a branch instruction is set via a signal line 101, and the branch destination address and v bit as branch information are set from a branch history table (BHT) 410 via a signal line 105. If there is no branch instruction that is predicted to be a successful branch, the ■ bit is set to 0 and the instruction address is set to signal line lo.
t respectively.
分岐情報切換回路415は、命令バッファ409が空の
とき信号)5101および105を介して与えられる前
記分岐II!ttI13を、そうでないときは分岐情報
バッファ413を介して与えられる前記分岐情報をそれ
ぞれ出力する。The branch information switching circuit 415 receives the branch II! signal via signals 5101 and 105 when the instruction buffer 409 is empty. ttI13 and, if not, the branch information given via the branch information buffer 413, respectively.
レジスタ416 、417および418はそれぞれ分岐
命令の各処理ステージに対応し、第8図に示す分岐情報
を保持する。分岐情報レジスタ419 、420はその
分岐先アドレス部を該分岐命令の実行によって生成され
る実際の分岐先アドレスに置き換えて保持するレジスタ
である。Registers 416, 417 and 418 each correspond to each processing stage of a branch instruction and hold branch information shown in FIG. The branch information registers 419 and 420 are registers that replace and hold the branch destination address part with the actual branch destination address generated by execution of the branch instruction.
アドレス生成回路430,431,432は、それぞれ
分岐情報レジスタ417.418,420に保持される
分岐命令のアドレスと、該分岐命令自身の命令語長とを
加算して分岐N0GO側の命令の命令アドレスを生成す
る。The address generation circuits 430, 431, and 432 add the address of the branch instruction held in the branch information registers 417, 418, and 420, respectively, and the instruction word length of the branch instruction itself to generate the instruction address of the instruction on the branch N0GO side. generate.
オペランドアドレス生成回路404は、命令の指定する
オペランドアドレスを生成するとともに、命令がBCT
命令である場合、そのBCT命令によって指定された汎
用レジスタの保持する計数動作を行なうための値を信号
線120を介して比較回路433へ出力する機能を有す
る。The operand address generation circuit 404 generates an operand address specified by an instruction, and also generates an operand address specified by an instruction.
If it is an instruction, it has a function of outputting a value for performing a counting operation held in a general-purpose register specified by the BCT instruction to the comparison circuit 433 via the signal line 120.
○Aステージ予測確認回路424は、命令解読回路40
3で解読した命令が分岐命令でないのに、対応する分岐
情報が分岐ヒストリテーブルから読出されたか否かを検
出する回路であり、信号線113を介して命令の解読結
果を、信号線115を介して分岐情報レジスタ416の
保持するVビットをそれぞれ受取り、分岐命令でないの
に■ビットが1である時にはOAステージ予測失敗信号
を信号線121を介して命令先取り制御回路423とフ
リップフロップ436へ出力する。○The A stage prediction confirmation circuit 424 is the instruction decoding circuit 40
This circuit detects whether or not the corresponding branch information has been read from the branch history table even though the instruction decoded in step 3 is not a branch instruction. receives the V bit held in the branch information register 416, and outputs an OA stage prediction failure signal to the instruction prefetch control circuit 423 and flip-flop 436 via the signal line 121 when the ■ bit is 1 even though it is not a branch instruction. .
比較回路433は、信号線120を介して与えられる計
数値と値“1”を比較し、計数値が1であれば計数値1
信号を信号線123を介してOTステージ予測確認回路
425へ出力する。The comparison circuit 433 compares the count value given via the signal line 120 with the value "1", and if the count value is 1, the count value is 1.
The signal is output to the OT stage prediction confirmation circuit 425 via the signal line 123.
OTステージ予測確認回路425は、OAステージ予測
確認回路424の出力するOAステージ予測失敗信号を
保持するフリップフロップ436の出力。The OT stage prediction confirmation circuit 425 is the output of a flip-flop 436 that holds the OA stage prediction failure signal output from the OA stage prediction confirmation circuit 424 .
命令が無条件分岐命令であるかBCT命令であるかを保
持するレジスタ435の出力、比較回路433の出力す
る計数(IIL1信号、および分岐情報レジスタ418
の保持する■ビア)より、無条件分岐命令なのに対応す
る分岐情報のVピントが0である時、およびBCT命令
で且つ計数値l信号が出力されない即ち分岐を行なう時
なのに対応する分岐情報のVビットが0である時には、
信号線129を介して命令先取り制御回路423へOT
ステージ予測失敗信号を、信号線130を介してフリッ
プフロップ437へOTステージBHT更新指示信号を
、信号線131を介してフリップフロップ438と選択
回路421へOTステージGo先取り指示信号をそれぞ
れ出力し、BCT命令で且つ計数値l信号が出力された
、即ち、分岐を行なわない時なのに対応する分岐情報の
■ビットが1である時には、信号線129と信号yA1
30へそれぞれOTステージ予測失敗信号とOTステー
ジB !−I T更新指示信号を出力する。The output of the register 435 that holds whether the instruction is an unconditional branch instruction or a BCT instruction, the count output from the comparison circuit 433 (IIL1 signal, and the branch information register 418)
(via held by When the bit is 0,
OT to the instruction prefetch control circuit 423 via the signal line 129
A stage prediction failure signal is outputted to the flip-flop 437 via the signal line 130, an OT stage BHT update instruction signal is outputted to the flip-flop 437, and an OT stage Go preemption instruction signal is outputted to the flip-flop 438 and the selection circuit 421 via the signal line 131. When the instruction is issued and the count value l signal is output, that is, when the branch information is not executed and the corresponding branch information ■ bit is 1, the signal line 129 and the signal yA1 are
30 to OT stage prediction failure signal and OT stage B, respectively! - Outputs an IT update instruction signal.
選択回路・121 は、OTステージ予測確認回路42
5の出力するOTステージGo先取り指示信号がlであ
る時は命令アドレス変換回路402の出力する分岐先ア
ドレスを、0である時はアドレス生成回路431の出力
する分岐N0GO側のアドレスを選択する。The selection circuit 121 is the OT stage prediction confirmation circuit 42
When the OT stage Go prefetch instruction signal outputted by No. 5 is 1, the branch destination address output from the instruction address conversion circuit 402 is selected, and when it is 0, the branch N0GO side address output from the address generation circuit 431 is selected.
OCステージ予測f+1認回路426は、OTステージ
BIT更新指示信号を保持するフリップフロップ437
の出力、OTステージGO先取り指示信号を保持するフ
リップフロップ438の出力、命令アドレス変換回路4
02の出力する分岐先アドレス。The OC stage prediction f+1 recognition circuit 426 includes a flip-flop 437 that holds the OT stage BIT update instruction signal.
output of the flip-flop 438 holding the OT stage GO prefetch instruction signal, the instruction address conversion circuit 4
Branch destination address output by 02.
及び分岐情報レジスタ418の保持する予測された分岐
先アドレスとVビットより、■ビットが1で分岐GOと
予測され、実際の分岐先アドレスと予測された分岐先ア
ドレスが異なっていて更にOTステージ以前で予測の失
敗が検出されていない時には、信号線140を介してO
Cステージ予測失敗信号を命令先取り制御回路423へ
、信号線156を介してフリップフロップ439へOC
ステージBHT更新指示信号を、信号線141を介して
フリップフロップ440へ○CステージGO先取り指示
信号をそれぞれ出力する。From the predicted branch destination address held in the branch information register 418 and the V bit, the ■ bit is 1 and the branch is predicted to GO, and the actual branch destination address and the predicted branch destination address are different, and furthermore, before the OT stage. When no prediction failure is detected in the signal line 140, the O
OC the C stage prediction failure signal to the instruction prefetch control circuit 423 and to the flip-flop 439 via the signal line 156.
A stage BHT update instruction signal and a C stage GO prefetch instruction signal are output to the flip-flop 440 via the signal line 141, respectively.
EXステージ予測確認回路427は、OCステージBH
T更新指示信号を保持するフリップフロップ439の出
力10CステージGO先取り指示信号を保持するフリッ
プフロップ440の出力1分岐情報レジスタ419の保
持する■ビット及び命令実行回路407の出力する分岐
成否信号より、実際の分岐成否とVビットが異なり、且
つ、OCステージ以前の予測失敗の検出にともなう先取
りのやり直しが行なわれていない時には、信号線147
を介して命令先取り制御回路423へEXステージ予測
失敗信号を、また、信号線148を介して同じく命令先
取り制御回路423とフリップフロップ441へEXス
テージBIT更新指示信号を出力する。EX stage prediction confirmation circuit 427 performs OC stage BH
Output 1 of the flip-flop 440 that holds the 10C stage GO prefetching instruction signal of the flip-flop 439 that holds the T update instruction signal 1 The bit held by the branch information register 419 and the branch success/failure signal output from the instruction execution circuit 407 indicate that the actual When the branch success/failure and the V bit are different, and the prefetching is not performed again due to the detection of prediction failure before the OC stage, the signal line 147 is
It outputs an EX stage prediction failure signal to the instruction prefetch control circuit 423 via the signal line 148, and outputs an EX stage BIT update instruction signal to the instruction prefetch control circuit 423 and the flip-flop 441 via the signal line 148.
選択回路422は分岐成否信号線149の状態に応答し
て該信号線の状態が分岐GOを示すとき、信号線152
を介して与えられる分岐情報レジスタ420の保持する
分岐先アドレスを選択し、分岐N0GOを示す時には信
号線153を介して与えられるアドレス生成回路432
の出力を選択し、その出力を信号m155を介してレジ
スタ434と命令アドレスリカバレジスタ428へ供給
する。In response to the state of the branch success/failure signal line 149, the selection circuit 422 selects the signal line 152 when the state of the signal line indicates branch GO.
When selecting the branch destination address held in the branch information register 420 given via the signal line 153 and indicating branch N0GO, the address generation circuit 432 given via the signal line 153
and supplies the output to register 434 and instruction address recovery register 428 via signal m155.
レジスタ434は、分岐予測が失敗した時に、分岐ヒス
トリテーブル(BHT)410を更新するためのもので
あり、命令アドレスリカバレジスタ428は命令アドレ
スレジスタ (IAR)411に分岐ヒストリテーブル
410の内容を更新するだめのライトアドレスがセット
された後に命令先取りのための新たなアドレスを供給す
るためのものである。The register 434 is for updating the branch history table (BHT) 410 when branch prediction fails, and the instruction address recovery register 428 updates the contents of the branch history table 410 in the instruction address register (IAR) 411. This is to supply a new address for instruction prefetching after the invalid write address has been set.
命令先取り制御回路423は、信号線121.129.
140゜147を介してそれぞれ与えられるOA、OT
、OC,EX各ステージの予測失敗信号、及び信号線1
48を介して与えられるEXステージBHT更新指示信
号に基づいて、命令アドレスレジスタ (IAR)41
1の入力と、命令アドレスリカバレジスタ426の入力
とを制御する回路である。The instruction prefetch control circuit 423 connects signal lines 121.129.
OA and OT given through 140° and 147 respectively
, OC, EX each stage prediction failure signal, and signal line 1
Based on the EX stage BHT update instruction signal given via 48, the instruction address register (IAR) 41
1 and the input of the instruction address recovery register 426.
第16図を参照すると、第1図に示す本発明の実施例に
おける命令の処理は、次の8つの処理単位に分けられる
。Referring to FIG. 16, the instruction processing in the embodiment of the present invention shown in FIG. 1 is divided into the following eight processing units.
(IIIAICステージすべき命令アドレス(論理アド
レス)が生成される。(IIIAIC An instruction address (logical address) to be staged is generated.
(21[Tステージ:生成された命令アドレスのアドレ
ス変換が行なわれる。(21 [T stage: Address translation of the generated instruction address is performed.
+311Cステージ:変換された命令の実アドレスで記
憶装置から命令が続出さ
れる。+311C stage: Instructions are successively issued from the storage device using the converted real address of the instruction.
+411Dステージ:続出された命令が解読される。+411D stage: Successive instructions are decoded.
+510Aステージ:解読された命令のオペランドアド
レス(論理アドレス)が
生成される。+510A stage: The operand address (logical address) of the decoded instruction is generated.
(6107ステージ:生成されたオペランドアドレスの
アドレス変換が行なわれ
る。(Stage 6107: Address translation of the generated operand address is performed.
+710Cステージ:変換されたオペランドの実アドレ
スで記憶装置からオペラ
ンドが読出される。+710C stage: The operand is read from storage at the translated operand's real address.
+81EXステージ−命令が実行される。+81EX stage - the instruction is executed.
上述のITステージ及びOTステージのアドレス変換に
おいてアドレス変換バッファを設は必要な変換テーブル
が該アドレス変換バッファに存在すれば上記アドレス変
換処理は高速に実行し得る。If an address translation buffer is provided for the address translation in 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.
また、上述のICステージおよびOCステージの命令お
よびオペランドの読出し動作において主記憶装置のデー
タの一部の写しを保持するキヤ・7シユメモリを設は必
要な命令およびオペランドが該キャッシュメモリに存在
すればICステージおよびOCステージの処理は高速に
行ない得る。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, if the necessary instructions and operands exist in the cache memory. Processing of the IC stage and OC stage can be performed at high speed.
上述のIT、OTおよびIC,QCの各ステージの高速
処理が可能なとき、複数の命令の処理の流れを無駄なく
実行する8段のパイプライン制御が可能である。When each stage of IT, OT, IC, and QC described above is capable of high-speed processing, eight-stage pipeline control is possible to efficiently execute the processing flow of a plurality of instructions.
次に分岐ヒストリテーブル(B HT) 410 、
OA、OT、QC,EX各ステージの予;則確認回路4
24.425,426,427および命令先取り制御回
路423のブロック図とタイムチャートを参照しながら
本実施例の動作を詳細に説明する。Next, branch history table (BHT) 410,
Preliminary rule confirmation circuit 4 for each stage of OA, OT, QC, EX
The operation of this embodiment will be described in detail with reference to block diagrams and time charts of 24, 425, 426, 427 and the instruction prefetch control circuit 423.
第2図を参照すると分岐ヒストリテーブル(BHT)4
10は、ディレクトリ記tα部501、データ記憶部5
02、テスト回路503,504,505,506 、
プライオリティ回路507、レベル選択回PI308、
およびオア回路509を備えている。記憶部501およ
び502は、1回のリクエストに対して命令記憶回路4
08から読出される命令語の単位をブロックの単位とし
、セット数m、レベル数nの記憶部である。Referring to Figure 2, branch history table (BHT) 4
10, a directory tα section 501, a data storage section 5;
02, test circuits 503, 504, 505, 506,
Priority circuit 507, level selection circuit PI308,
and an OR circuit 509. The storage units 501 and 502 store the instruction storage circuit 4 for one request.
The unit of instruction words read from 08 is a block unit, and the storage unit has m sets and n levels.
第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 its 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. ing. The V bit indicates the validity of the word in the corresponding branch history table (BHT) 410 and also functions as a branch success/failure flag as a prediction of execution of the branch instruction.
この分岐ヒストリテーブル(BIT)410への索引は
以下のようなセットアソシアティブ法によって行なわれ
る。Indexing into the branch history table (BIT) 410 is performed by the set associative method as described below.
第2図に示されるテスト回路503,504,505及
び506はテーブル410の各レベルに対応して命令ア
ドレスレジスタ(IAR)411に保持されるリクエス
トアドレスが各レベルのBIT−AAi (iはレベ
ルに対応するサフィクスを示す)に登録されているか否
かを示す信号を信号al130.1131゜1132、
1133に出力する。第4図を参照すると、テスト回路
503,504,505および506のそれぞれは、−
数回路701および大小比較回路702から構成されて
いる。Test circuits 503, 504, 505, and 506 shown in FIG. A signal indicating whether the corresponding suffix is registered in
Output to 1133. Referring to FIG. 4, each of the test circuits 503, 504, 505 and 506 has -
It is composed of a numerical circuit 701 and a magnitude comparison circuit 702.
前記−数回路701では、命令アドレスレジスタ(IA
R)411に保持されるリクエストアドレスの一部JA
R(: 4−17)をセットアドレスとして読出された
記憶部501の各レベルの内容と前記レジスタ411の
内容JAR(:4−17)とが比較され、等しいアドレ
スが存在するか否かを検出する。−数回路701の出力
により命令アドレスレジスタ(IAR)411に保持さ
れるリクエストアドレスで読出されるべき命令語の8B
yteブロツク中にすでに分岐ヒストリテーブル(BH
T)410に登録された分岐命令が存在するか否かが判
明する。しかしリクエストアドレスとそれが読出すべき
分岐命令との対応をとるには上記一致検出のみでは不十
分である。第5図を参照すると、1回のリクエストで続
出される8Byteの命令語のブロック中に2Byte
命令BCO,A、BCI。In the minus number circuit 701, the instruction address register (IA
R) Part of the request address held in 411 JA
The contents of each level of the storage section 501 read with R (: 4-17) as a set address are compared with the contents JAR (: 4-17) of the register 411, and it is detected whether or not an equal address exists. do. - 8B of the instruction word to be read at the request address held in the instruction address register (IAR) 411 by the output of the number circuit 701;
The branch history table (BH
T) 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.
Instruction BCO, A, BCI.
BO2の4個の命令が存在する。命令BCO,BCl、
BO2が共に分岐成功と予測された分岐命令であるとき
には、各々の分岐命令は共にそのアドレスの一部が記憶
部(BHT−AA)501に登録される。このとき他の
分岐命令から命令Aに分岐して命令Aのアドレス<A>
が前記命令語のブロックを読出すためのリクエストアド
レスとして命令アドレスレジスタ(JAR)411に保
持されるときには、分岐ヒストリテーブル(BHT)4
10から読出されるべき分岐命令の情報は命令の実行の
経路から分岐命令BCIの情報でなければならない。There are four instructions of BO2. Instructions BCO, BCl,
When both BO2 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, branch to instruction A from another branch instruction and address <A> of instruction A.
is held in the instruction address register (JAR) 411 as a request address for reading the block of instruction words, the branch history table (BHT) 4
The branch instruction information to be read from 10 must be the information of the branch instruction BCI from the instruction execution path.
従って前記レジスタ(FAR)411に保持されるリク
エストアドレスと前記紀tα部(B I T −AA
i ) 501に保持される分岐命令のアドレスとの関
係が上記の一敗条件とともに次式の関係が成立するとき
、対応するレベルのBHT−HITi信号が生成される
。なお、この信号は線130〜133を介してオア回路
509に与えられ、該B HT HITi信号のオア
信号が線106を介して出力され分岐予測信号(BHT
−HIT信号)となる。Therefore, the request address held in the register (FAR) 411 and the period tα part (B I T -AA
i) When the relationship between the address of the branch instruction held in 501 and the above-mentioned one-lose condition is satisfied, the BHT-HITi signal of the corresponding level is generated. Note that this signal is given to the OR circuit 509 via lines 130 to 133, and the OR signal of the BHT HITi signal is output via the line 106 to generate a branch prediction signal (BHT
-HIT signal).
BIT −HITi = (IAR(:4 17) =
BIIT−AAi(:4−17) )
n (FAR(:29,30) ≦BIT−AAi(:
29.30) )
n B)IT−AAi(V)
再び第4図を参照すると、前記大小比較回路702は、
この条件を実現する回路である。BIT −HITi = (IAR(:4 17) =
BIIT-AAi(:4-17) ) n (FAR(:29,30) ≦BIT-AAi(:
29.30) ) n B) IT-AAi (V) Referring again to FIG. 4, the magnitude comparison circuit 702 is
This is a circuit that realizes this condition.
さらに前記信号BHT−HITiの条件が2個以上のレ
ベルにおいて成立したとき記憶部501の対応するレベ
ル(BHT−AA i)に保持される分岐命令のアドレ
スの8Byteブロツク内アドレスBHT−AA i
(:29.30)の値の最も小さいレベルが選択され
る必要がある。再び第5図を参照すると、命令BCIお
よびBO2の分岐命令関係情報が格納される分岐ヒスト
リテーブル410のレベルで前記信号BHT−H[Ti
条件が共に成立する。このとき命令の実行の経路から命
令BC1に対するレベルが選択される必要がある。Furthermore, when the condition of the signal BHT-HITi is satisfied at two or more levels, the address BHT-AA i in the 8-byte block of the address of the branch instruction held at the corresponding level (BHT-AA i) in the storage unit 501
The level with the smallest value of (:29.30) needs to be selected. Referring again to FIG. 5, the signal BHT-H[Ti
Both conditions hold true. At this time, the level for the instruction BC1 needs to be selected from the instruction execution path.
前記プライオリティ回路507は、前記信号BHT−H
ITiの2個以上の成立に対するものであり、この出力
により記憶部BHT−DA502のセットアドレスI
A R(: 18−28)で示されるエントリの分岐先
アドレスがレベル選択回路508を介して読出される。The priority circuit 507 receives the signal BHT-H.
This is for the establishment of two or more ITi, and this output sets the set address I of the storage unit BHT-DA502.
The branch destination address of the entry indicated by AR (: 18-28) is read out via the level selection circuit 508.
第6図を参照すると、前記プライオリティ回路507は
アンド回路601〜604およびオア回路605〜60
8から構成されている。アンド回路601〜604はQ
+1個並列に配置されている。前記第2図におけるレベ
ル選択回路508のn個のレベルの選択信号は第6図に
おける信号v、、v、、v、、v。Referring to FIG. 6, the priority circuit 507 includes AND circuits 601-604 and OR circuits 605-60.
It consists of 8. AND circuits 601 to 604 are Q
+1 pieces are arranged in parallel. The n level selection signals of the level selection circuit 508 in FIG. 2 are the signals v, , v, , v, , v in FIG.
により以下のように与えられる。is given as follows.
V、ノとき VoL++、 V(ILI
、−、VaL。V, no time VoL++, V(ILI
,-,VaL.
Vo−V、のとき VrLo、 V+L+、
・”、νlL++v、 −v、 −v、cvとき
VzL、o、 VzL+、−、VtLlIVo ’
Vr ・V2 ’ V、(7)とき VxLo、 V
3L、、−、V3L。When Vo-V, VrLo, V+L+,
・”, νlL++v, −v, −v, cv
VzL, o, VzL+, -, VtLlIVo'
Vr ・V2' V, (7) when VxLo, V
3L,,-,V3L.
以上のようにして第2図におけるレベル選択回路508
から読出された分岐情報は第1図の命令記憶回路408
から読出される命令と対応づけることが可能である。As described above, the level selection circuit 508 in FIG.
The branch information read from the instruction storage circuit 408 in FIG.
It is possible to associate the instruction with the instruction read from the .
第9図には、命令記憶回路408における命令と分岐ヒ
ストリテーブル(BIT)410における分岐情報の上
記対応関係が示されている。命令の実行順序が命令AO
,分岐命令BCO,Bl、BC1、B2.B3.BC2
,C1,C2・・・と予測された場合である。なお、<
A>は人命令のアドレスを、BCjは分岐命令をそれぞ
れ示す。FIG. 9 shows the correspondence between instructions in the instruction storage circuit 408 and branch information in the branch history table (BIT) 410. Instruction execution order is instruction AO
, branch instructions BCO, Bl, BC1, B2 . B3. BC2
, C1, C2, and so on. In addition, <
A> indicates the address of the human instruction, and BCj indicates the branch instruction.
第10図を参照すると、第9図に示した分岐ヒストリテ
ーブル(B I T) 410による命令先取り動作は
次のようにされる。リクエストアドレスの命令アドレス
レジスタ411のセットに応答して命令記憶回路408
から命令語が読出され、これと同時にテーブル(BHT
)410が索引される。信号線106を介してBHT−
HIT信号が出力されると記憶部BHT−DA5f)2
の分岐先アドレス〈B1〉がアドレスレジスタ411に
セットされ、次の命令先取りが行なわれる。前記信号線
106を介してBHT−HIT信号が出力されないとき
には命令アドレス加算回路412に命令への8バイト境
界アドレス(人)が与えられ、「8」加算されたアドレ
スが出力され、次の命令先取りが逐次行なわれる。Referring to FIG. 10, the instruction prefetching operation by the branch history table (BIT) 410 shown in FIG. 9 is performed as follows. In response to the setting of the instruction address register 411 of the request address, the instruction storage circuit 408
The instruction word is read from the table (BHT
) 410 are indexed. BHT- via signal line 106
When the HIT signal is output, the storage unit BHT-DA5f)2
The branch destination address <B1> is set in the address register 411, and the next instruction is prefetched. When the BHT-HIT signal is not output through the signal line 106, an 8-byte boundary address (person) to the instruction is given to the instruction address addition circuit 412, and the address to which "8" is added is output, and the next instruction is prefetched. are performed sequentially.
以上の命令の先取りに従えば命令記憶回路408から読
出される命令語は、テーブル(BHT)410の内容に
よる予測に従って順次読出され、命令バッファ409に
は予測された命令の実行順に格納することが可能である
。According to the above instruction prefetch, 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 are stored in the instruction buffer 409 in the predicted execution order of the instructions. It is possible.
このときたとえ信号BHT−HITが出力されても分岐
予測方向と反対側の命令先取り動作を一部付なわせしめ
た後に分岐予測方向の命令先取り動作を行なってもよい
。At this time, even if the signal BHT-HIT is output, the instruction prefetch operation in the branch prediction direction may be performed after a part of the instruction prefetch operation in the opposite direction to the branch prediction direction is performed.
以上のようにして命令先取りされた命令が分岐命令で第
1図の命令整列回路414により命令解読回路403に
導かれたとき同時に該分岐命令に対応する分岐情報が最
初の分岐情報レジスタ416 (QRO)にセットさ
れる。When the instruction prefetched as described above is a branch instruction and guided to the instruction decoding circuit 403 by the instruction alignment circuit 414 in FIG. ) is set.
以降前記分岐命令の処理の進行に伴い、前記分岐情報が
順次第2.第3.第4.第5の分岐情報レジスタ (Q
R1) 417. (QR2) 418. (QR3)
419、 (QR4) 420へと転送される。そして
OA。Thereafter, as the processing of the branch instruction progresses, the branch information is sequentially changed to 2. Third. 4th. Fifth branch information register (Q
R1) 417. (QR2) 418. (QR3)
419, transferred to (QR4) 420. And OA.
OT、 ○C,EX各ステージの予測確認回路424
゜425.426,427によって該分岐命令の実際の
実行処理結果と対応する前記分岐情報とが各ステージ毎
にチェックされる。Prediction confirmation circuit 424 for each stage of OT, ○C, EX
425, 426, and 427, the actual execution result of the branch instruction and the corresponding branch information are checked at each stage.
第11図を参照すると、前記OAステージ予測確認回路
424は、フリップフロップ1101.1102.ノッ
ト回路1103.およびアンド回路1104から構成さ
れている。フリップフロップ1101.1102にはそ
れぞれ信号線113を介して命令解読回路403の出力
する分岐命令を示す信号と、信号線115を介して分岐
情報レジスタ(QRO)416の保持するVビットとが
セントされる。ノット回路1103とアンド回路110
4とによって、フリ、ブフロノプl】01の出力が“0
”で且つフリップフロップ1102の出力が“l゛であ
る時、即ち命令を解読した結果、分岐命令ではない命令
なのに対応する分岐情報が存在し、その分岐情報に従っ
て命令先取りが行なわれた時には、信号線121にOA
ステージ予測失敗信号を出力する。Referring to FIG. 11, the OA stage prediction confirmation circuit 424 includes flip-flops 1101.1102. Knot circuit 1103. and an AND circuit 1104. A signal indicating a branch instruction output from the instruction decoding circuit 403 is sent to flip-flops 1101 and 1102 via a signal line 113, and a V bit held by a branch information register (QRO) 416 is sent via a signal line 115, respectively. Ru. NOT circuit 1103 and AND circuit 110
4, the output of Furi, Bufronopl]01 becomes “0”.
” and the output of the flip-flop 1102 is “l”, that is, as a result of decoding the instruction, there is branch information corresponding to an instruction that is not a branch instruction, and the instruction is prefetched according to the branch information, the signal is OA to line 121
Output stage prediction failure signal.
第12図を参照すると、前記OTステージ予測確認回路
425は、フリップフロップ1201.1202.12
03゜1204と真偽回路1206.1207と、アン
ド回路120B。Referring to FIG. 12, the OT stage prediction confirmation circuit 425 includes flip-flops 1201.1202.12.
03°1204, truth/false circuits 1206, 1207, and AND circuit 120B.
1209.1210.およびオア回路1211.121
2.1213とから構成されている。フリップフロップ
1201.1202には、レジスタ435の保持する無
条件ブランチ命令を示すビットと、BCT命令を示すビ
ットが信号線122を介してそれぞれセットされ、フリ
ップフロップ1203には信号線123を介して比較回
路433の出力する計数値l信号がセントされ、フリッ
プフロップ1204には分岐情報レジスタ(QRI)の
保持するVビットが信号線126を介してセットされ、
オア回路1213には信号線144を介してOAステー
ジ予測41 LW回路424が出力し且つフリップフロ
ップ436に保持されたOAステージ予測失敗信号の出
力が与えられる。真偽回路1206.120?、アンド
回路1208.1209.1210によってフリップフ
ロップ1201.1204の出力がそれぞれ“l”、“
0”すなわち無条件ブランチ命令であるのに対応する分
岐情報が存在しなくて分岐Go側への命令先取りが行な
われなかったときには、アンド回路1208の出力が“
1′になり、フリップフロップ1202.1203゜1
204の出力がそれぞれ′l”、“0”、“0″である
時すなわちBCT命令であってそのBCT命令で指定さ
れた汎用レジスタの保持する計数値が“1”ではなくて
分岐を行なうBCT命令であるのに対応する分岐命令が
存在しな(て分岐Go側への先取り動作が行なわれなか
った時にはアンド回路1209の出力が1″になり、フ
リップフロップ1202.1203.1204の出力が
全て1”の時すな−わちBCT命令であってそのBCT
命令で指定された汎用レジスタの保持する計数値が“1
”であって、分岐を行なわないBCT命令であるのに対
応する分岐情報が存在して分岐GO側へ命令先取り動作
が行なわれた時にはアンド回路1210の出力が1″′
になる。更に、オア回路1211.1212.1213
によって無条件分岐命令あるいは分岐を行なうBCT命
令なのに分岐Go側への命令先取りが行なわれなかった
時には、OTステージGo先取り指示信号が信号線13
1に、OTステージ予測失敗信号が信号線129に、O
TステージBHT更新指示信号が信号線130にそれぞ
れ出力される。又、分岐を行なわないBCT命令なのに
分岐GO側への命令先取りが行なわれた時には、OTス
テージ予測失敗信号とOTステージBHT更新指示信号
とが出力される。なお、OTステージBIT更新指示信
号は、OAステージで予測の失敗が検出され、0’Aス
テ一ジ予測確認回路424より、OAステージ予測失敗
信号がフリップフロップ436にセントされ、その出力
が信号線144を介して与えられた時にも出力される。1209.1210. and OR circuit 1211.121
2.1213. In flip-flops 1201 and 1202, a bit indicating an unconditional branch instruction and a bit indicating a BCT instruction held in the register 435 are set via the signal line 122, respectively, and the flip-flop 1203 has a bit indicating the unconditional branch instruction held by the register 435 via the signal line 123. The count value l signal output from the circuit 433 is sent, and the V bit held in the branch information register (QRI) is set in the flip-flop 1204 via the signal line 126.
The OR circuit 1213 is supplied with the output of the OA stage prediction failure signal output from the OA stage prediction 41 LW circuit 424 and held in the flip-flop 436 via the signal line 144 . True/false circuit 1206.120? , AND circuits 1208, 1209, and 1210 change the outputs of flip-flops 1201, 1204 to “l” and “, respectively.
0", that is, when the corresponding branch information does not exist even though it is an unconditional branch instruction, and the instruction to the branch Go side is not prefetched, the output of the AND circuit 1208 becomes "
1', flip-flop 1202.1203°1
When the outputs of 204 are 'l', '0', and '0', respectively, it is a BCT instruction and the count value held in the general-purpose register specified by the BCT instruction is not '1', and a branch is executed. If there is no corresponding branch instruction (and the prefetch operation to the branch Go side is not performed), the output of the AND circuit 1209 becomes 1'', and the outputs of the flip-flops 1202, 1203, and 1204 all become 1''. 1” - that is, it is a BCT instruction and its BCT
The count value held in the general-purpose register specified by the instruction is “1”
”, and when there is branch information corresponding to a BCT instruction that does not perform a branch and an instruction prefetch operation is performed on the branch GO side, the output of the AND circuit 1210 is 1”
become. Furthermore, OR circuit 1211.1212.1213
When an unconditional branch instruction or a BCT instruction that performs a branch is not prefetched to the branch Go side, the OT stage Go prefetch instruction signal is sent to the signal line 13.
1, the OT stage prediction failure signal is sent to the signal line 129,
T stage BHT update instruction signals are output to signal lines 130, respectively. Furthermore, when a BCT instruction that does not perform a branch is prefetched to the branch GO side, an OT stage prediction failure signal and an OT stage BHT update instruction signal are output. Note that the OT stage BIT update instruction signal is generated when a prediction failure is detected at the OA stage, and the 0'A stage prediction confirmation circuit 424 sends the OA stage prediction failure signal to the flip-flop 436, and its output is sent to the signal line. 144 is also output.
第13図を参照すると前記OCステージ予測確認回路4
26は、レジスタ1301.1302.フリップフロッ
プ1303.不一致を検出する比較回路1306.真偽
回路130?、アンド回路1308およびオア回路13
09.1310より構成されている。レジスタ1301
には、命令アドレス変換回路402より信号線133を
介して与えられる分岐命令の命令語より実際に求められ
た分岐先アドレスがセットされ、同じくレジスタ130
2には、分岐情報レジスタ (QR2) 418より信
号線137を介して与えられる予測された分岐先アドレ
スがセットされる。フリップフロップ1303には同じ
く分岐情報レジスタ(QR2) 418の保持するVビ
ットがセントされ、真偽回路1307とオア回路131
0には、OTステージ予測確認回路425が出力したO
TステージBHT更新指示信号と、OTステージGO先
取り指示信号を受けたフリップフロップ437,438
の出力が、それぞれ信号線157と158を介して与え
られる。比較回路1306と真偽回路1307およびア
ンド回路1308によって、比較回路1306、 フリ
ップフロップ1303の出力、信号線157がそれぞれ
“l”、′l”、“0”、即ち、分岐ヒストリテーブル
に対応する分岐情報が存在し、その分岐情報に従って後
続の命令先取りが行なわれたその命令について、OA、
○Tステージの予測も1認回路で予測の失敗が検出さ
れていなくて、なお且つ、予測された分岐先アドレスが
実際の分岐先アドレスと異なっていた時には、アンド回
路130日の出力が“1”になりOCステージ予測失敗
信号が信号線140に出力される。同時にオア回路13
09、1310によってOCステージBIT更新指示信
号とOCステージGO先取り指示信号がそれぞれ信号&
?1156と141上に出力される。又、OCステージ
BIT更新指示信号とOCステージGO更新指示信号は
、それぞれOTステージ予測確認回路425より出力さ
れるOTステージBIT更新指示信号とOTステージG
O先取り指示信号とを受けたフリップフロップ437,
438の出力が“1”となった時にも出力される。Referring to FIG. 13, the OC stage prediction confirmation circuit 4
26 are registers 1301.1302. Flip-flop 1303. Comparison circuit 1306 for detecting mismatch. Truth/False Circuit 130? , AND circuit 1308 and OR circuit 13
09.1310. register 1301
The branch destination address actually obtained from the instruction word of the branch instruction given from the instruction address conversion circuit 402 via the signal line 133 is set in the register 130.
2 is set with the predicted branch destination address given from the branch information register (QR2) 418 via the signal line 137. Similarly, the V bit held in the branch information register (QR2) 418 is sent to the flip-flop 1303, and the truth/false circuit 1307 and the OR circuit 131 are sent to the flip-flop 1303.
0 is the O output from the OT stage prediction confirmation circuit 425.
Flip-flops 437 and 438 receiving the T stage BHT update instruction signal and the OT stage GO preemption instruction signal
outputs are provided via signal lines 157 and 158, respectively. The comparison circuit 1306, the truth/false circuit 1307, and the AND circuit 1308 cause the comparison circuit 1306, the output of the flip-flop 1303, and the signal line 157 to be set to "l", 'l', and "0", respectively, that is, the branch corresponding to the branch history table. For the instruction for which information exists and the subsequent instruction is prefetched according to the branch information, OA,
○In the prediction of the T stage, if no prediction failure is detected in the first recognition circuit and the predicted branch destination address is different from the actual branch destination address, the output of the AND circuit on the 130th day will be “1”. ”, and an OC stage prediction failure signal is output to the signal line 140. At the same time OR circuit 13
09 and 1310, the OC stage BIT update instruction signal and the OC stage GO preemption instruction signal are respectively
? It is output on 1156 and 141. Further, the OC stage BIT update instruction signal and the OC stage GO update instruction signal are the OT stage BIT update instruction signal and the OT stage G output from the OT stage prediction confirmation circuit 425, respectively.
Flip-flop 437 receiving the O preemption instruction signal;
It is also output when the output of 438 becomes "1".
第14図を参照すると、前記EXステージ予測確認回路
427は、フリップフロツブ1401.真偽回路140
2、1403.1404.論理積の否定を求めるナンド
回路1405.1406.アンド回路1407.140
8.及びオア回路1409から構成されている。真偽回
路1402には、信号線149を介して命令実行回路4
07の出力する分岐成否信号が与えられ、フリップフロ
ップ1401には、分岐情報レジスタ (QR3)41
9の保持する■ビットがセットされ、ナンド回路140
5.1406およびオア回路1409につながる信号線
159には、OCステージBHT更新指示信号を受けた
フリップフロップ439の出力が与えられ、真偽回路1
404には、OCステージGo先取り指示信号を受けた
フリップフロップ440の出力が信号線160を介して
与えられる。前記の真偽回路1402.1403.14
04.ナンド回路1405.1406.アンド回路14
07.1408によって、信号&’1149の分岐成否
信号、フリップフロップ1401の出力、信号線159
.信号線160がそれぞれ1”、“O”、”1”、“1
″、即ち、予測に従って後続の命令の先取りを分岐N0
GO側へ行なったその命令は、実際には分岐GOであり
、分岐成否信号が出力され、更にOCステージまでにそ
の命令についての予測の失敗が検出されておらず或いは
検出されていてもGO側への先取り指示が出力されてい
ないときのみ、アンド回路1407の出力が“1”にな
り、同様に信号線149.フリップフロップ1401の
出力、信号線159.160がそれぞれ“0“、“I”
、“1”、“O“、すなわち、分岐GOと予測され、分
岐Go側へ後続の命令先取りを行なった命令が実際には
分岐N0GOであり、分岐成否信号が出力されなくて且
つoCステージまでにその命令についての予測の失敗が
検出されていないか或いは検出されていても同、時にG
o側への先取り指示が出ている場合のみ、アンド回路1
408の出力が“1′になる。更にオア回路14o9に
よって、OCステージまでに予測の失敗が検出されてい
るか或いは分岐GOと予測された命令が実際には分岐N
0GOであり且つOCステージまでに分岐N0GO側へ
の先取り指示が出力されていない時、および分岐N0G
Oと予測された命令が実際には分岐GOであり且つOC
ステージまでに分岐GO側への先取り指示が出力されて
いない時に、EXステージBHT更新指示信号が信号線
148に出力される。Referring to FIG. 14, the EX stage prediction confirmation circuit 427 operates through flip-flops 1401. Truth/false circuit 140
2, 1403.1404. NAND circuit for negation of logical product 1405.1406. AND circuit 1407.140
8. and an OR circuit 1409. The truth/false circuit 1402 is connected to the instruction execution circuit 4 via a signal line 149.
The branch success/failure signal output from 07 is given to the flip-flop 1401, and the branch information register (QR3) 41
The ■ bit held by 9 is set, and the NAND circuit 140
5.1406 and the signal line 159 connected to the OR circuit 1409 is supplied with the output of the flip-flop 439 that has received the OC stage BHT update instruction signal, and the truth/false circuit 1
The output of the flip-flop 440 that has received the OC stage Go preemption instruction signal is applied to the signal line 404 via the signal line 160. The above truth/false circuit 1402.1403.14
04. NAND circuit 1405.1406. AND circuit 14
07.1408, branch success/failure signal of signal &'1149, output of flip-flop 1401, signal line 159
.. The signal lines 160 are 1", "O", "1", and "1", respectively.
'', that is, branch N0 to prefetch the subsequent instruction according to the prediction.
The instruction sent to the GO side is actually a branch GO, and a branch success/failure signal is output, and even if prediction failure for that instruction is not detected or detected by the OC stage, the GO side Only when a prefetch instruction is not output to the AND circuit 1407, the output of the AND circuit 1407 becomes "1", and the signal line 149. The output of flip-flop 1401 and signal lines 159 and 160 are “0” and “I”, respectively.
, "1", "O", that is, the instruction predicted to be a branch GO and prefetching the subsequent instruction to the branch Go side is actually a branch N0GO, and the branch success/failure signal is not output and the instruction is not executed until the oC stage. Sometimes a prediction failure for that instruction is not detected, or even if it is detected, the G
AND circuit 1 only when there is a preemption instruction to the o side.
The output of 408 becomes "1". Furthermore, the OR circuit 14o9 determines whether a prediction failure has been detected by the OC stage or the instruction predicted as branch GO is actually branch N.
0GO and a preemption instruction to the branch N0GO side has not been output by the OC stage, and the branch N0G
An instruction predicted as O is actually a branch GO and an OC
When a prefetch instruction to the branch GO side has not been output by the stage, an EX stage BHT update instruction signal is output to the signal line 148.
第15図を参照すると、前記命令先取り制御回路423
は、フリップフロップ1501.真偽回路1502゜1
503.1504,1505,1506,1507.7
7ド回路1508.1509゜1510、1511.1
512.1513.1514.1515.1516.1
517.1518とから構成されている。この命令先取
り制御回路423は、OA、OT、QC,EXの各ステ
ージの予測確認回路より出力される予測失敗信号と、E
Xステージ予測確認回路427の出力するEXステージ
BHT更新指示信号、並びに分岐ヒストリテーブル41
0の出力するBHT−H,IT信号に基づいて、命令ア
ドレスレジスフ411の前段にあるセレクタおよび命令
アドレスリカバレジスタ428の前段にあるセレクタの
選択指示信号を出力する。Referring to FIG. 15, the instruction prefetch control circuit 423
is a flip-flop 1501. Truth/false circuit 1502゜1
503.1504, 1505, 1506, 1507.7
7th circuit 1508.1509゜1510, 1511.1
512.1513.1514.1515.1516.1
517.1518. This instruction prefetch control circuit 423 receives the prediction failure signal output from the prediction confirmation circuit of each stage of OA, OT, QC, and EX, and the E
EX stage BHT update instruction signal output from the X stage prediction confirmation circuit 427 and branch history table 41
Based on the BHT-H, IT signal outputted by 0, a selection instruction signal is output for the selector at the stage before the instruction address register 411 and the selector at the stage before the instruction address recovery register 428.
命令先取り制御回路423の入力信号が全て“0“の時
には、命令アドレスレジスタ411の入力セレクタは信
号線107上の命令アドレス加算回路412の出力する
+8された命令アドレスを選択するよう制御され、次の
マシンサイクルには、命令アドレスレジスタ411には
選択された命令アドレス+8がセントされる。信号線1
48.147を介してEXステージ予測確認回路427
よりEXステージBHT更新指示信号とEXステージ予
測失敗信号とが与えられると、命令アドレスリカバレジ
スタ428には命令実行回路407の出力する分岐成否
信号によって制御される選択回路422の出力、即ち実
際の分岐判定を行なった結果分岐Goであれば分岐情報
レジスタ(QR4)の保持する実際に命令語の指示によ
り求められた分岐先アドレスが、又、命令実行回路40
7の分岐判定の結果分岐NOGOであれば、アドレス生
成回路433の出力する分岐N0GO側のアドレスが、
いずれの場合も信号線155を介してセントされ、同時
に命令アドレスレジスタ411には分岐情報レジスタ
(QR4)の保持する分岐命令自身のアドレスが信号線
151を介してセットされる。更にその1マシンサイク
ル後には、命令先取り制御回路423は、入力信号が全
て“0″であれば、EXステージBHT更新指示信号を
1マシンサイクル保持するフリップフロップ1501の
出力によって、命令アドレスレジスタ411には、lマ
シンサイクル前に命令アドレスリカバレジスタ428に
セットされた実際の分岐判定結果による次に実行すべき
命令のアドレスが信号線162を介してセントされるよ
う制御する。When all the input signals of the instruction prefetch control circuit 423 are "0", the input selector of the instruction address register 411 is controlled to select the +8 instruction address output from the instruction address addition circuit 412 on the signal line 107, and the next In the machine cycle, the selected instruction address +8 is written to the instruction address register 411. Signal line 1
EX stage prediction confirmation circuit 427 via 48.147
When the EX stage BHT update instruction signal and the EX stage prediction failure signal are given, the instruction address recovery register 428 receives the output of the selection circuit 422 controlled by the branch success/failure signal output from the instruction execution circuit 407, that is, the actual branch. As a result of the determination, if the branch is Go, the branch destination address actually obtained by the instructions of the instruction word held in the branch information register (QR4) is also transferred to the instruction execution circuit 40.
If the result of branch determination in step 7 is NOGO, the address on the branch NOGO side output by the address generation circuit 433 is
In either case, the command is sent via the signal line 155, and at the same time the instruction address register 411 contains a branch information register.
The address of the branch instruction itself held by (QR4) is set via the signal line 151. Furthermore, one machine cycle later, if all the input signals are "0", the instruction prefetch control circuit 423 stores the EX stage BHT update instruction signal in the instruction address register 411 by the output of the flip-flop 1501 that holds the EX stage BHT update instruction signal for one machine cycle. controls so that the address of the next instruction to be executed based on the actual branch judgment result set in the instruction address recovery register 428 one machine cycle ago is sent via the signal line 162.
信号線147のEXステージ予測失敗信号が“0”の時
、信号線140を介して○Cステージ予測確認回路42
6よりOCステージ予測失敗信号が与えられると、命令
先取り制御回路423は、命令アドレスレジスタ411
に、分岐情報レジスタ(QR3)419の保持するOC
ステージにある命令の命令語より求めた分岐GO側のア
ドレスを信号線143を介してセットするよう制御する
。この時、同時にEXステージBHT更新指示信号も与
えられれば、分岐情報レジスタ (QR3)419の保
持するOCステージにある命令の分岐先アドレスは命令
アドレスリカバレジスタ428にセットされ、かわりに
命令アドレスレジスタ411には分岐情報レジスタ(Q
R4)420の保持するEXステージにある命令の命令
アドレスがセットされ、そのlマシンサイクル後には、
命令先取り制御回路423の全ての入力が0”であれば
命令アドレスリカバレジスタ428に1マシンサイクル
前にセットされた、1マシンサイクル前にはOCステー
ジにあった命令の実際の分岐Go側のアドレスが命令ア
ドレスレジスタ411にセットされるよう制御する。When the EX stage prediction failure signal on the signal line 147 is “0”, the ○C stage prediction confirmation circuit 42 is sent via the signal line 140.
When the OC stage prediction failure signal is given from 6, the instruction prefetch control circuit 423 registers the instruction address register 411.
, the OC held in the branch information register (QR3) 419
Control is performed to set the branch GO side address obtained from the instruction word of the instruction in the stage via the signal line 143. At this time, if the EX stage BHT update instruction signal is also given at the same time, the branch destination address of the instruction in the OC stage held in the branch information register (QR3) 419 is set in the instruction address recovery register 428, and the branch destination address of the instruction in the OC stage held in the branch information register (QR3) 419 is set in the instruction address recovery register 428, contains the branch information register (Q
R4) The instruction address of the instruction in the EX stage held by 420 is set, and after one machine cycle,
If all inputs to the instruction prefetch control circuit 423 are 0'', the actual branch Go side address of the instruction that was set in the instruction address recovery register 428 one machine cycle ago and was in the OC stage one machine cycle ago. is set in the instruction address register 411.
信号線147.140のEX、QC両ステージの予測失
敗信号がともに“0”の時、信号線129を介してOT
ステージ予測確認回路425よりOTステージ予測失敗
信号が与えられると、命令先取り制御回路423は、選
択回路421の出力すなわちOTステージにある命令が
無条件分岐命令か、実際には分岐を行なうBCT命令で
あって対応する分岐情報が分岐ヒストリテーブルに存在
しなくて分岐N0GO側に先取りが行なわれた時には、
命令アドレス変換回路402の出力する分岐GO側のア
ドレスが2.又実際には分岐を行なわないBCT命令で
あって対応する分岐情報が分岐ヒストリテーブルより続
出されて分岐GO側へ後続の命令先取りが行なわれた時
にはアドレス生成回路431の出力する分岐N0GO側
のアドレスが、いずれもOTステージ予測確認回路42
5が信号線131を介して出力するOTステージGo先
取り指示信号の制御によって選択回路421で選択され
たその結果を信号線139を介して命令アドレスレジス
タ411にセットするよう制御する。この時、同時にE
XステージBHT更新指示信号も与えられれば、選択回
路421の出力は、命令アドレスリカバレジスタ428
にセットされ、かわりに命令アドレスレジスタ411に
は分岐情報レジスタ(QR4)420の保持するEXス
テージにある命令の命令アドレスが信号線151を介し
てセットされ、その1マシンサイクル後には、命令先取
り制御回路423の全ての入力が“O”であれば、命令
アドレスリカバレジスタ428に1マシンサイクル前に
セットされた、1マシンサイクル前にはOTステージに
あった無条件分岐命令かBCT命令の後続の命令の先取
りやり直しのためのアドレスが信号線162を介して命
令アドレスレジスタ411にセットされるよう制御する
。When the prediction failure signals of both the EX and QC stages on signal lines 147 and 140 are both “0”, OT is sent via signal line 129.
When an OT stage prediction failure signal is given from the stage prediction confirmation circuit 425, the instruction prefetch control circuit 423 determines whether the output of the selection circuit 421, that is, the instruction in the OT stage, is an unconditional branch instruction or is actually a BCT instruction that performs a branch. When the corresponding branch information does not exist in the branch history table and the branch N0GO side is prefetched,
The branch GO side address output by the instruction address conversion circuit 402 is 2. In addition, when the BCT instruction does not actually perform a branch and the corresponding branch information is successively output from the branch history table and the subsequent instruction is prefetched to the branch GO side, the address on the branch N0GO side output by the address generation circuit 431 is However, in both cases, the OT stage prediction confirmation circuit 42
The result selected by the selection circuit 421 is controlled to be set in the instruction address register 411 via the signal line 139 under the control of the OT stage Go prefetch instruction signal outputted via the signal line 131. At this time, E
If the X stage BHT update instruction signal is also given, the output of the selection circuit 421 is transferred to the instruction address recovery register 428.
Instead, the instruction address of the instruction in the EX stage held in the branch information register (QR4) 420 is set in the instruction address register 411 via the signal line 151, and one machine cycle later, the instruction prefetch control is executed. If all the inputs of the circuit 423 are "O", the instruction address recovery register 428 is set one machine cycle ago, and the unconditional branch instruction or BCT instruction that was in the OT stage one machine cycle ago. Control is performed so that an address for refetching the instruction is set in the instruction address register 411 via the signal line 162.
信号線147.140.129のEX、○C,OTの各
ステージの予測失敗信号が“0”の時、信号線121を
介してOAステージ予測確認回路424よりOAステー
ジ予測失敗信号が与えられると、命令先取り制御回路4
23は、アドレス生成回路430が出力するOAステー
ジにある命令の分岐N0GO側の命令アドレスを信号線
128を介して命令アドレスレジスタ411にセットす
るよう制御する。この時同時に、EXステージBHT更
新指示信号が与えられれば、アドレス生成回路430の
出力は命令アドレスリカバレジスタ428にセットされ
、命令アドレスレジスタ411には、かわりに分岐情報
レジスタ (QR4)420の保持するEXステージに
ある命令の命令アドレスが信号線151を介してセット
され、その1マシンサイクル後には、命令先取り制御回
路423の全ての入力が“0”であれば、lマシンサイ
クル前に命令アドレスリカバレジスタにセットされたア
ドレスが信号線162を介して命令アドレスレジスフ4
11にセットされるよう制御する。When the prediction failure signals of the EX, ○C, and OT stages on the signal lines 147, 140, and 129 are "0," when the OA stage prediction failure signal is given from the OA stage prediction confirmation circuit 424 via the signal line 121, , instruction prefetch control circuit 4
23 controls so that the instruction address on the branch N0GO side of the instruction in the OA stage outputted by the address generation circuit 430 is set in the instruction address register 411 via the signal line 128. At the same time, if the EX stage BHT update instruction signal is given, the output of the address generation circuit 430 is set to the instruction address recovery register 428, and the instruction address register 411 instead stores the output of the branch information register (QR4) 420. The instruction address of the instruction in the EX stage is set via the signal line 151, and one machine cycle later, if all inputs to the instruction prefetch control circuit 423 are "0", the instruction address recovery is performed one machine cycle before. The address set in the register is transferred to the instruction address register 4 via the signal line 162.
control so that it is set to 11.
信号線147.140.129.121のEX、QC,
OT。EX, QC of signal line 147.140.129.121,
O.T.
OAの各ステージの予測失敗信号が全て“O”の時、信
号線106を介して分岐ヒストリテーブル410よりB
HT−HIT信号が与えられると、命令先取り制御回路
423は、分岐ヒストリテーブル410の出力するIC
ステージにある命令の予測された分岐アドレスを信号線
105を介して命令アドレスレジスタ411にセットす
るよう制御する。この時、同時にEXステージBHT更
新指示信号も与えられると、信号線105の分岐ヒスト
リテーブル410より読出された分岐先アドレスは、命
令アドレスリカバレジスタ428にセットされ、命令ア
ドレスレジスタ411には、かわりにEXステージにあ
る命令の命令アドレスが分岐情報レジスタ (QR4)
420より信号線151を介してセ・ノドされ、そのl
マシンサイクル後には、命令先取り制御回路423の全
ての入力が“O”であればlマシンサイクル前にセット
された命令アドレスリカバレジスタ428の内容が命令
アドレスレジスタ411にセットされるよう制御する。When the prediction failure signals of each stage of OA are all “O”, B is sent from the branch history table 410 via the signal line 106.
When the HT-HIT signal is given, the instruction prefetch control circuit 423 selects the IC output from the branch history table 410.
The predicted branch address of the instruction in the stage is controlled to be set in the instruction address register 411 via the signal line 105. At this time, if the EX stage BHT update instruction signal is also given at the same time, the branch destination address read from the branch history table 410 on the signal line 105 is set in the instruction address recovery register 428, and the instruction address register 411 is filled with the branch destination address instead. The instruction address of the instruction in the EX stage is the branch information register (QR4)
420 via the signal line 151, and its l
After a machine cycle, if all inputs to the instruction prefetch control circuit 423 are "O", control is performed so that the contents of the instruction address recovery register 428 that were set one machine cycle ago are set in the instruction address register 411.
信号線147,140,129.121 (7)EX、
QC,OT。Signal line 147, 140, 129.121 (7) EX,
QC, O.T.
OA各ステージの予測失敗信号および信号線106のB
HT−HIT信号が全て“0”の時に信号線148を介
してEXステージ予測確認回路427よりEXステージ
BHT更新指示信号が与えられると、命令先取り制御回
路423は、命令アドレスリカバレジスタ428に信号
線107を介して命令アドレス加算回路412の出力を
セントし、命令アドレスレジスタ411にはEXステー
ジにある命令の命令アドレスを分岐情報レジスタ(QR
4)420より信号線151を介してセントし、その1
マシンサイクル後には、命令先取り制御回路423の全
ての入力が0”であれば、lマシンサイクル前に命令ア
ドレスリカバレジスタ428にセットされたアドレスを
命令アドレスレジスタ411にセットするよう制御する
。Prediction failure signal of each OA stage and B of signal line 106
When the EX stage BHT update instruction signal is given from the EX stage prediction confirmation circuit 427 via the signal line 148 when all the HT-HIT signals are "0", the instruction prefetch control circuit 423 sends the signal line to the instruction address recovery register 428. 107, the output of the instruction address adder circuit 412 is sent to the instruction address register 411, and the instruction address of the instruction in the EX stage is sent to the branch information register (QR).
4) Cent from 420 via signal line 151, part 1
After a machine cycle, if all inputs to the instruction prefetch control circuit 423 are 0'', control is performed so that the address set in the instruction address recovery register 428 one machine cycle ago is set in the instruction address register 411.
次に第1図およびタイムチャートを参照しながら本実施
例の動作を詳細に説明する。Next, the operation of this embodiment will be explained in detail with reference to FIG. 1 and time charts.
第17図は、分岐命令ではない命令A1のアドレスを分
岐命令のアドレスとして指定する誤った分岐情報が分岐
ヒストリテーブル410に存在し、命令先取り制御回路
423が誤った分岐情報に従って命令A1の後続の命令
として命令C1を取出して実行している動作を示すタイ
ムチャートである。FIG. 17 shows that erroneous branch information that specifies the address of instruction A1, which is not a branch instruction, as the address of the branch instruction exists in the branch history table 410, and the instruction prefetch control circuit 423 executes the instruction following instruction A1 according to the erroneous branch information. 3 is a time chart showing an operation in which an instruction C1 is extracted and executed as an instruction.
第1図および第17図を参照すると、マシンサイクル0
の時刻において、分岐命令ではない命令Alのアドレス
くA1〉が命令アドレスレジスタ411にセットされ、
命令AlのIcステージが実行される。アドレス<At
>は信号&i! 101を介して命令記憶回路408へ
与えられ命令語の取出しが行なわれるとともに、分岐ヒ
ストリテーブル410にも与えられ、アドレス<AI>
を分岐命令のアドレスとして指定する分岐情報の取出し
が行なわれる。Referring to FIGS. 1 and 17, machine cycle 0
At time , the address A1 of an instruction Al that is not a branch instruction is set in the instruction address register 411,
The Ic stage of instruction Al is executed. address<At
> is a signal &i! 101 to the instruction storage circuit 408 for fetching the instruction word, and is also provided to the branch history table 410 at the address <AI>
Branch information that specifies the address of the branch instruction is retrieved.
その結果、誤った分岐情報が取出され、BHT−HIT
信号が信号線106上に出力される。このため、命令先
取り制御回路423は、命令アドレスレジスタ411の
入力セレクタに分岐情報より得られた分岐先アドレス〈
C1〉が出力されている信号線105を選択するよう指
示する。As a result, incorrect branch information is retrieved and the BHT-HIT
A signal is output on signal line 106. Therefore, the instruction prefetch control circuit 423 inputs the branch destination address obtained from the branch information to the input selector of the instruction address register 411.
The signal line 105 to which C1> is output is instructed to be selected.
次のマシンサイクル1の時刻においては、誤った分岐情
報による分岐先アドレスくC1〉が命令アドレスレジス
タ411にセットされて、命令CIのICステージが実
行されるとともに、命令AIのIDステージが実行され
る。命令解読回路403は、命令A1が分岐命令ではな
いことから、命令解読結果が分岐命令であることを示す
信号113には“0”を出力して命令AIが分岐命令で
ないことをOAXステージ予測確認回路424通知する
とともに、命令AIの命令語長を分岐1n報レジスタ(
QRl ) 417への信号線112に出力する。同時
に、分岐情報レジスタ(QRO)416に保持された命
令AIのアドレスくA1〉とVビット、分岐先アドレス
〈C1〉のうちVビットが信号線115に出力される。At the time of the next machine cycle 1, the branch destination address C1 due to the incorrect branch information is set in the instruction address register 411, the IC stage of the instruction CI is executed, and the ID stage of the instruction AI is executed. Ru. Since the instruction A1 is not a branch instruction, the instruction decoding circuit 403 outputs "0" to the signal 113 indicating that the instruction decoding result is a branch instruction, and confirms the OAX stage prediction that the instruction AI is not a branch instruction. In addition to notifying the circuit 424, the instruction word length of the instruction AI is sent to the branch 1n report register (
QRl ) 417 to signal line 112 . At the same time, the address A1 of the instruction AI held in the branch information register (QRO) 416, the V bit, and the V bit of the branch destination address C1 are output to the signal line 115.
マシンサイクル2の時刻においては、命令C1のIDス
テージと命令CIの後続の命令C2のICステージが実
行されると共に、命令A1のOAXステージ実行される
。同時にOAXステージ予測確認回路424、前のマシ
ンサイクルで信号線113および115を介して与えら
れた情報より、今OAステージにある命令A1が分岐命
令でないにもかかわらず分岐情報が存在し、分岐Go側
へ後続の命令の先取りを行なったことを示すOAステー
ジ予測失敗信号を信号線121へ出力する。同時にアド
レス生成回路430は、分岐情報レジスタ(QR2)4
18の保持する命令AIのアドレス<AI>と命令A1
の命令語長を加算し、命令A1のN。At the time of machine cycle 2, the ID stage of the instruction C1 and the IC stage of the instruction C2 subsequent to the instruction CI are executed, and the OAX stage of the instruction A1 is executed. At the same time, the OAX stage prediction confirmation circuit 424 determines that branch information exists even though the instruction A1 currently in the OA stage is not a branch instruction, based on the information given via signal lines 113 and 115 in the previous machine cycle. An OA stage prediction failure signal indicating that a subsequent instruction has been prefetched to the signal line 121 is output to the signal line 121. At the same time, the address generation circuit 430 generates a branch information register (QR2) 4.
Address <AI> of instruction AI held by 18 and instruction A1
N of instruction A1.
GO側の後続の命令のアドレスくA2〉を生成し、信号
線128上に出力する。命令先取り制御回路423は、
OAXステージ予測確認回路424出力する信号線12
1のOAステージ予測失敗信号により、命令アドレスレ
ジスタ411の入力セレクタに、信号線128上のOA
Xステージらの命令Atの分岐N0GO側のアドレスく
A2〉を選択するよう指示する。又、OAステージ予測
失敗信号が出力されたことにより、OAXステージり前
のステージにある予測側に後続する命令CI、C2の動
作はすべてキャンセルされる。The address A2> of the subsequent instruction on the GO side is generated and output onto the signal line 128. The instruction prefetch control circuit 423
OAX stage prediction confirmation circuit 424 output signal line 12
1 OA stage prediction failure signal causes the input selector of the instruction address register 411 to receive the OA stage prediction failure signal on the signal line 128.
An instruction is given to select the address A2> on the branch N0GO side of the instruction At of the X stage. Further, since the OA stage prediction failure signal is output, all operations of instructions CI and C2 subsequent to the prediction side in the stage before the OAX stage are canceled.
マシンサイクル3においては、命令AlのOTステージ
が実行され、同時に命令アドレスレジスタ411には命
令A1の後続の命令のアドレス〈A2〉がセントされ、
命令A2のICステージも実行される。フリップフロッ
プ436は、前のマシンサイクルで出力されたOAステ
ージ予測失敗信号を受けてl”にセットされ、今OTス
テージにある命令A1の分岐情報が誤っており、正しく
更新しなければならないことを示す。In machine cycle 3, the OT stage of instruction Al is executed, and at the same time, the address <A2> of the instruction subsequent to instruction A1 is written to the instruction address register 411.
The IC stage of instruction A2 is also executed. Flip-flop 436 is set to l'' in response to the OA stage prediction failure signal output in the previous machine cycle, and indicates that the branch information of instruction A1 currently in the OT stage is incorrect and must be updated correctly. show.
次のマシンサイクル4において、命令A1は○Cステー
ジを実行し、命令A2のIDステージ。In the next machine cycle 4, instruction A1 executes the ○C stage and the ID stage of instruction A2.
命令A2の後続の命令A3のICステージが実行される
。フリップフロップ437には、フリップフロップ43
6を受けて“1″がセットされ、フリップフロップ43
8は“θ′を保持し、合わせて現在OCステージにある
命令A1の分岐情報が誤っており、正しく更新する必要
のあることを並びに命令A1についての予測に従った後
続の命令先取りはキャンセルされて既にN0GO側への
命令先取り動作の実行が改めて行なわれたことを示す。The IC stage of instruction A3 subsequent to instruction A2 is executed. The flip-flop 437 includes the flip-flop 43
6 is received, “1” is set, and the flip-flop 43
8 holds "θ', and also indicates that the branch information of instruction A1 currently in the OC stage is incorrect and needs to be updated correctly, and that the subsequent instruction prefetch according to the prediction for instruction A1 is canceled. This indicates that the instruction prefetch operation to the N0GO side has already been executed anew.
マシンサイクル5においては、命令AIのEXステージ
が実行される。命令実行回路407は命令A1が分岐命
令ではないことから信号線149の分岐成否信号に分岐
N0GOを示す“0”を出力する。このため、選択回路
422は、分岐情報レジスタ(QR4)の保持する命令
AIのアドレス〈A1〉と命令A1の命令語長をアドレ
ス生成回路432で加算した結果得られるアドレスくA
2〉を選択し信号線155上に出力する。また、信号線
151には、命令A1のアドレスくA1〉が出力される
。In machine cycle 5, the EX stage of instruction AI is executed. Since the instruction A1 is not a branch instruction, the instruction execution circuit 407 outputs "0" indicating branch N0GO to the branch success/failure signal on the signal line 149. Therefore, the selection circuit 422 selects the address A obtained by adding the address <A1> of the instruction AI held in the branch information register (QR4) and the instruction word length of the instruction A1 in the address generation circuit 432.
2> is selected and output on the signal line 155. Further, the address A1> of the instruction A1 is output to the signal line 151.
一方フリップフロップ439.440は、フリップフロ
ップ437,438の内容をOCステージ予測確認回路
426を通して受け、それぞれ1″ @ Q 11にセ
ットされる。EXステージ予測確認回路427は、信号
線149の分岐成否信号と、前のマシンサイクルで信号
線146を介して与えられた分岐情報レジスタ(QR3
)419の保持していた命令Atの分岐情報のVビット
、およびフリップフロップ439゜440とから、信号
線14日上のEXステージBHT更新指示信号として“
1″を出力し、信号線147のEXステージ予測失敗信
号には“0”を出力することによって、命令A1につい
ての分岐情報が存在し、その情報に従って分岐Go側へ
後続の命令先取りを行なったにもかかわらず、命令A1
は実際には分岐動作を行なわないこと、しかしながら後
続の誤った分岐先取り動作はキャンセルされて既に分岐
N0GO側への命令取出し動作が行なわれているため、
EXステージでは命令先取りのやり直しを指示する必要
のないことを示すとともに、命令A1についての分岐情
報の更新が必要なことを示す。これを受けて、命令先取
り制御回路423は、命令アドレスレジスタ411の入
力セレクタに対し信号線151上の命令AIのアドレス
〈Al〉を選択するよう指示し、命令アドレスリカバレ
ジスタ428の入力セレクタに対しては、信号線107
上のアドレス<A2>+24を選択するよう指示する。On the other hand, flip-flops 439 and 440 receive the contents of flip-flops 437 and 438 through the OC stage prediction confirmation circuit 426, and are set to 1'' @ Q 11. signal and the branch information register (QR3) provided via signal line 146 in the previous machine cycle.
) 419 and the flip-flops 439 and 440, the EX stage BHT update instruction signal on the signal line 14 is output as "
1" and outputting "0" to the EX stage prediction failure signal on the signal line 147 indicates that branch information regarding instruction A1 exists, and the subsequent instruction is prefetched to the branch Go side according to that information. Nevertheless, instruction A1
does not actually perform a branch operation, however, since the subsequent erroneous branch prefetch operation has been canceled and the instruction fetch operation to the branch N0GO side has already been performed,
The EX stage indicates that there is no need to instruct redoing the instruction prefetch, and also indicates that it is necessary to update the branch information regarding the instruction A1. In response, the instruction prefetch control circuit 423 instructs the input selector of the instruction address register 411 to select the address <Al> of the instruction AI on the signal line 151, and instructs the input selector of the instruction address recovery register 428 to select the address <Al> of the instruction AI on the signal line 151. The signal line 107
Instruct to select the address <A2>+24 above.
もしこの時、命令アドレスレジスタ411の保持するア
ドレス<A2>+16に対応する分岐情報が分岐ヒスト
リテーブルに存在し、BHT−HIT信号が信号線10
6を介して与えられれば、命令先取り制御回路423は
、命令アドレスリカバレジスタ428の入力セレクタに
対しては、信号線105上に出力される1分岐ヒストリ
テーブル410より取出された分岐情報の示す分岐先ア
ドレスを、またOAステージにある命令A2についてO
Aステージ予測確認回路424より信号線121を介し
てOAステージ予測失敗信号が与えられれば信号線12
8上のアドレスを選択するよう指示する。At this time, if branch information corresponding to the address <A2>+16 held by the instruction address register 411 exists in the branch history table, and the BHT-HIT signal is
6, the instruction prefetch control circuit 423 sends the input selector of the instruction address recovery register 428 a branch indicating the branch information retrieved from the branch history table 410 outputted on the signal line 105. The destination address is also O for instruction A2 in the OA stage.
If an OA stage prediction failure signal is given from the A stage prediction confirmation circuit 424 via the signal line 121, the signal line 12
Instruct the user to select the address above 8.
次のマシンサイクル6において、命令A1は、分岐ヒス
トリテーブル410内の命令Alについての分岐情報の
更新を行なうHUステージを実行する。先ず、フリップ
フロップ441は前のマシンサイクルで信号線148上
に出力されたEXステージBHT更新指示信号を受けて
“1”にセットされ、信号線154を介してその出力は
分岐ヒストリテーブル410へ送られる。又、レジスタ
434には、同じく前のマシンサイクルで信号線155
上に出力されていた命令アドレスくA2〉がセットされ
、命令アドレスレジスタ411には、同じく前のマシン
サイクルで信号線151上に出力されていた命令アドレ
スくA1〉が、また命令アドレスリカバレジスタ428
には前のマシンサイクルで信号線107上に出力されて
いたアドレス<A2>+24がそれぞれセントされる。In the next machine cycle 6, instruction A1 executes the HU stage in which the branch information for instruction A1 in branch history table 410 is updated. First, the flip-flop 441 is set to "1" in response to the EX stage BHT update instruction signal output on the signal line 148 in the previous machine cycle, and its output is sent to the branch history table 410 via the signal line 154. It will be done. Also, in the register 434, the signal line 155 is also stored in the previous machine cycle.
The instruction address A2〉 that was output on the signal line 151 in the previous machine cycle is set in the instruction address register 411, and the instruction address A1〉 that was also output on the signal line 151 in the previous machine cycle is also set in the instruction address recovery register 428.
The address <A2>+24, which was output on the signal line 107 in the previous machine cycle, is sent to each of the addresses.
これに応答して分岐ヒストリテーブル410内の命令A
1についての分岐情報の更新が行なわれ、A1について
の分岐情報のvビットがリセットされ、これ以降命令A
Iは分岐命令としては扱われなくなる。一方この時、命
令先取り制御回路423は、命令アドレスレジスタ41
1の入力セレクタに対して、信号線162上に出力され
ている命令アドレスリカバレジスタ428の保持するア
ドレス<A2>+24を選択するよう指示する。In response, instruction A in branch history table 410
The branch information for A1 is updated, the v bit of the branch information for A1 is reset, and from now on the instruction A
I is no longer treated as a branch instruction. On the other hand, at this time, the instruction prefetch control circuit 423 controls the instruction address register 41
The input selector No. 1 is instructed to select the address <A2>+24 held by the instruction address recovery register 428 that is output on the signal line 162.
もしこの時、OTステージにある命令A2について、O
Tステージ予測確認回路425より信号線129を介し
てOTステージ予測失敗信号が与えられれば、命令先取
り制御回路423は、命令アドレスレジスタ411の人
力セレクタに対し信号線139上のアドレスを選択する
ように、又OAステージにある命令A3についてOAス
テージ予測確認回路424より信号線121を介してO
Aステージ予測失敗信号が与えられれば、信号線128
上のアドレスを選択するように指示する。At this time, for instruction A2 in the OT stage, O
When an OT stage prediction failure signal is given from the T stage prediction confirmation circuit 425 via the signal line 129, the instruction prefetch control circuit 423 causes the manual selector of the instruction address register 411 to select the address on the signal line 139. , and the instruction A3 in the OA stage is outputted from the OA stage prediction confirmation circuit 424 via the signal line 121.
If the A stage prediction failure signal is given, signal line 128
Instruct them to select the address above.
マシンサイクル7以降は、命令アドレスレジスフ411
にセントされたアドレス<A2>+24に従って命令先
取り動作が続けられる。After machine cycle 7, the instruction address register 411
The instruction prefetch operation continues according to address <A2>+24, which was sent to <A2>+24.
第18図は、分岐ヒストリテーブル410にVビットが
“l”である対応する分岐情報が存在しなかったBCT
命令あるいは無条件分岐命令である命令B1の実行のよ
うすを示すタイムチャートであり、B1がBCT命令の
場合、命令Blで指定した計数値は“1”ではなくて、
−1する計数動作を行なっても計数結果は“0”とはな
らす゛、実際には分岐を行なうBCT命令の場合を示し
ている。FIG. 18 shows a BCT in which there is no corresponding branch information in which the V bit is “l” in the branch history table 410.
This is a time chart showing the execution of instruction B1, which is an instruction or an unconditional branch instruction. When B1 is a BCT instruction, the count value specified by instruction Bl is not "1", but
Even if a counting operation of -1 is performed, the counting result will not be "0".Actually, this shows the case of a BCT instruction that performs a branch.
第1図および第18図を参照するとマシンサイクル0の
時刻において、BCT命令あるいは無条件分岐命令であ
る命令B1のアドレスくB1〉が命令アドレスレジスタ
411にセットされ、命令B1のICステージが実行さ
れる。アドレスくB1〉は信号101を介して命令記憶
回路408へ与えられ命令語の取出しが行なわれるとと
もに、分岐ヒストリテーブル410に与えられ、命令B
1に対応する分岐情報の取出しが行なわれ、同時に、命
令アドレス加算回路412へも与えられ、アドレスくB
l〉+8が生成される。分岐ヒストリテーブル410に
は命令B1に対応する分岐情報が存在しないため、信号
線106のBHT−HIT信号として“0”を出力する
。これに応答して命令先取り制御回路423は、命令ア
ドレスレジスタ411の入力セレクタに対し、信号線1
07に出力されるアドレスくBl〉+8を選択するよう
指示する。Referring to FIG. 1 and FIG. 18, at the time of machine cycle 0, the address of instruction B1, which is a BCT instruction or an unconditional branch instruction, is set in the instruction address register 411, and the IC stage of instruction B1 is executed. Ru. The address B1> is applied to the instruction storage circuit 408 via the signal 101 to fetch the instruction word, and is also applied to the branch history table 410, where the instruction B1 is
The branch information corresponding to 1 is taken out, and at the same time, it is also given to the instruction address addition circuit 412, and the address
l〉+8 is generated. Since there is no branch information corresponding to instruction B1 in the branch history table 410, “0” is output as the BHT-HIT signal on the signal line 106. In response, the instruction prefetch control circuit 423 sends the signal line 1 to the input selector of the instruction address register 411.
07 to select the address B1>+8.
次のマシンサイクル1の時刻においては、命令アドレス
レジスタ411にはアドレス<31 >+Bがセットさ
れ、命令Blの分岐N0Go側の後続の命令A1のIC
ステージが実行される。同時に、分岐情報レジスタ(Q
RO) 416には、命令BlのアドレスくB1〉とV
ビットとして“0”がセントされ、命令BlのIDステ
ージが実行される。At the time of the next machine cycle 1, the address <31>+B is set in the instruction address register 411, and the IC of the subsequent instruction A1 on the branch N0Go side of the instruction B1 is set.
The stage is executed. At the same time, the branch information register (Q
RO) 416 contains the address B1> and V of the instruction B1.
"0" is written as a bit, and the ID stage of instruction B1 is executed.
命令解読回路403は命令BlがBCT命令であること
を、あるいは無条件分岐命令であることを信号線114
に出力する。The instruction decoding circuit 403 uses a signal line 114 to determine that the instruction Bl is a BCT instruction or an unconditional branch instruction.
Output to.
マシンサイクル2の時刻においては、命令B1のOAス
テージと、命令AIのIDステージ及び命令A1の後続
の命令A2のICステージが実行される。レジスタ43
5は、前のマシンサイクルの信号線114の出力を受け
て、命令BlがBCT命令であることを或いは無条件分
岐命令であることを信号線122上に示す。分岐情報レ
ジスタ(QRl)417には分岐情報レジスタ (QR
O)が前のマシンサイクルで保持していたアドレス<B
1>と“0”であるVビットがセットされ、■ビットは
さらに信号線126に出力される。命令アドレス生成回
路401は、命令B1の分岐先アドレスを生成し、命令
B1がBCT命令である時にはオペランドアドレス生成
回路404より命令B1で指定された計数値を保持する
汎用レジスタの値が信号線120を介して比較回路43
3へ与えられる。比較回路433は与えられた計数値が
“1″でないことを検出して信号線123上の計数値1
信号として“0”を出力する。At the time of machine cycle 2, the OA stage of instruction B1, the ID stage of instruction AI, and the IC stage of instruction A2 subsequent to instruction A1 are executed. register 43
5 indicates on the signal line 122 that the instruction Bl is a BCT instruction or an unconditional branch instruction in response to the output of the signal line 114 of the previous machine cycle. The branch information register (QRl) 417 contains a branch information register (QRl).
address held by O) in the previous machine cycle <B
1> and the V bit which is “0” is set, and the ■ bit is further output to the signal line 126. The instruction address generation circuit 401 generates a branch destination address for the instruction B1, and when the instruction B1 is a BCT instruction, the value of the general-purpose register holding the count value specified by the instruction B1 is output from the operand address generation circuit 404 to the signal line 120. Comparison circuit 43 via
given to 3. The comparison circuit 433 detects that the given count value is not "1" and sets the count value 1 on the signal line 123.
Outputs “0” as a signal.
マシンサイクル3においては、命令B1の○Tステージ
が実行され、命令Blの分岐先アドレスが命令アドレス
変換回路402によって実アドレス〈C1〉に変換され
るとともに、命令B1の分岐N0GO側の後続の命令A
1.A2.A3のOA。In machine cycle 3, the ○T stage of the instruction B1 is executed, the branch destination address of the instruction B1 is converted to the real address <C1> by the instruction address conversion circuit 402, and the subsequent instruction on the branch N0GO side of the instruction B1 is A
1. A2. A3 OA.
ID、ICステージが実行される。OTステージ予測6
1 L’2回路425は、前のマシンサイクルで信号線
122.123.126を介して与えられた情報から、
現在OTステージにある命令が、分岐GoであるBCT
命令であること或いは無条件分岐命令であることにもか
かわらず対応する分岐情報が分岐ヒストリテーブル41
0にヒツトせず、分岐N0GO側へ後続の命令の先取り
が続けられたこと、このため、命令B1の分岐Go側へ
命令の先取りを改めて実行する必要のあること、並びに
命令B1についての分岐情報を正しく更新する必要のあ
ることを示すために、信号線129にOTステージ予測
失敗信号を、信号線130にOTステージBHT更新指
示信号を、また信号線131にOTステージGO先取り
指示信号をそれぞれ出力する。このOTステージGO先
取り指示信号に応答して選択回路421は、信号線13
3に出力される命令Blの分岐先アドレスを選択し、信
号線139上に出力する。命令先取り制御回路423は
、OTステージ予測確認回路425の出力する信号線1
29のOTステージ予測失敗信号により、命令アドレス
レジスタ411の入力セレクタに対して信号線139上
の命令Blの分岐先アドレス〈C1〉を選択するよう指
示する。ID and IC stages are executed. OT stage prediction 6
1 L'2 circuit 425 uses the information given via signal lines 122.123.126 in the previous machine cycle to
BCT where the instruction currently in the OT stage is branch Go
Even though it is an instruction or an unconditional branch instruction, the corresponding branch information is not included in the branch history table 41.
0 was not hit, and the prefetching of subsequent instructions to the branch N0GO side continued. Therefore, it was necessary to execute prefetching of the instruction B1 again to the branch Go side, and branch information regarding instruction B1. In order to indicate that it is necessary to update correctly, an OT stage prediction failure signal is output to the signal line 129, an OT stage BHT update instruction signal is output to the signal line 130, and an OT stage GO preemption instruction signal is output to the signal line 131. do. In response to this OT stage GO preemption instruction signal, the selection circuit 421 selects the signal line 13
The branch destination address of the instruction Bl outputted to the signal line 139 is selected and outputted onto the signal line 139. The instruction prefetch control circuit 423 uses the signal line 1 output from the OT stage prediction confirmation circuit 425.
The OT stage prediction failure signal No. 29 instructs the input selector of the instruction address register 411 to select the branch destination address <C1> of the instruction B1 on the signal line 139.
またOTステージ予測失敗信号が出力されたことにより
、OTステージより前のステージにある分岐N0GO側
に後続する命令AI、A2.A3の動作は全てキャンセ
ルされる。Furthermore, since the OT stage prediction failure signal is output, instructions AI, A2 . All operations of A3 are canceled.
マシンサイクル4においては、命令B1のOCサイクル
が実行され、同時に命令アドレスレジスタ411には命
令B1の分岐先アドレス〈C1〉がセット、アドレスく
C1〉にある命令C1のICステージも実行される。フ
リップフロップ43?、43sは、前のマシンサイクル
で出力されたOTステージBHT更新指示信号とOTス
テージGo先取り指示信号とを受けてどちらも“11に
セットされる。In machine cycle 4, the OC cycle of instruction B1 is executed, and at the same time, the branch destination address <C1> of instruction B1 is set in the instruction address register 411, and the IC stage of instruction C1 at address C1> is also executed. Flip flop 43? , 43s receive the OT stage BHT update instruction signal and the OT stage Go preemption instruction signal output in the previous machine cycle, and are both set to "11".
次のマシンサイクル5においては、命令B1のEXステ
ージが実行される。命令実行回路407は、命令B1が
BCT命令であれば指定された計数動作を行ない、その
結果が“0”ではないことから信号線149の分岐成否
信号に分岐GOを示す“1”を、命令B1が無条件分岐
命令であるときは信号線149の分岐成否信号としてや
はり“1”を出力する。これに応答して選択回路422
は、分岐情報レジスタ(QR4)420の保持する命令
Blの分岐先アドレス〈C1〉を選択し信号線155上
に出力する。同時に信号線151上には、同じく分岐情
報レジスタ(QR4)420の保持する命令B1のアド
レス<31>が出力される。一方フリップフロップ43
9.440は、フリップフロップ437,438の内容
をOCステージ予測確認回路426を通して受け、どち
らも“1″にセットされる。EXステージ予測確認回路
427は、信号線149の分岐成否信号と、前のマシン
サイクルで信号線146を介して与えられた分岐情報レ
ジスタ (QR3) 419の保持していた命令B1の
分岐情報の“0”である■ビット、およびフリップフロ
ップ439,440とから信号線148上のEXステー
ジBHT更新指示信号として“1”を出力し、信号線1
47のEXステージ予測失敗信号には“O”を出力する
ことによって、命令Blについての分岐情報が存在せず
分岐N0GO側へ後続の命令の先取りを行なったにもか
かわらず、命令Blは分岐を行なうこと、しかしながら
後続の分岐N0GO側の命令はキャンセルされて既に分
岐Go側の命令取出しが行なわれているためEXステー
ジでは命令先取りのやり直しを指示する必要のないこと
を示すとともに、命令B1についての分岐情報の更新が
必要なことを示す。これに応答して命令先取り制御回路
423は、命令アドレスレジスタ411の入力セレクタ
に対して信号線151上の命令B1のアドレス〈B1〉
を選択するよう指示し、命令アドレスリカバレジスタ4
28の入力セレクタに対しては信号線107上のアドレ
ス<CI>+16を選択するよう指示する。In the next machine cycle 5, the EX stage of instruction B1 is executed. If the instruction B1 is a BCT instruction, the instruction execution circuit 407 performs the specified counting operation, and since the result is not "0", the instruction execution circuit 407 sets "1" indicating branch GO to the branch success/failure signal on the signal line 149. When B1 is an unconditional branch instruction, "1" is also output as the branch success/failure signal on the signal line 149. In response, the selection circuit 422
selects the branch destination address <C1> of the instruction Bl held in the branch information register (QR4) 420 and outputs it onto the signal line 155. At the same time, the address <31> of the instruction B1 held in the branch information register (QR4) 420 is output onto the signal line 151. On the other hand, flip-flop 43
9.440 receives the contents of flip-flops 437 and 438 through the OC stage prediction confirmation circuit 426, and both are set to "1". The EX stage prediction confirmation circuit 427 receives the branch success/failure signal on the signal line 149 and the branch information of the instruction B1 held in the branch information register (QR3) 419 given via the signal line 146 in the previous machine cycle. "1" is output as the EX stage BHT update instruction signal on the signal line 148 from the ■ bit which is "0" and the flip-flops 439 and 440, and the signal line 1
By outputting "O" to the EX stage prediction failure signal of 47, instruction Bl does not branch even though there is no branch information for instruction Bl and the subsequent instruction is prefetched to the branch N0GO side. However, since the instruction on the subsequent branch N0GO side has been canceled and the instruction on the branch Go side has already been fetched, it is not necessary to instruct the EX stage to redo the instruction prefetch. Indicates that branch information needs to be updated. In response, the instruction prefetch control circuit 423 sends the address of the instruction B1 on the signal line 151 to the input selector of the instruction address register 411.
instruction address recovery register 4.
The input selector 28 is instructed to select the address <CI>+16 on the signal line 107.
もしこの時、命令アドレスレジスタ411の保持するア
ドレス<C1>+8に対して分岐ヒストリテーブル41
0よりBHT−HIT信号が信号線106を介して与え
られれば、命令先取り制御回路423は、命令アドレス
リカバレジスタ428の入力セレクタに対しては信号線
105上の分岐ヒストリテーブル410より取出された
分岐アドレスを選択するよう指示する。At this time, if the address <C1>+8 held in the instruction address register 411 is stored in the branch history table 41
If a BHT-HIT signal from 0 is applied via the signal line 106, the instruction prefetch control circuit 423 selects the branch extracted from the branch history table 410 on the signal line 105 for the input selector of the instruction address recovery register 428. Prompts you to select an address.
次のマシンサイクル6において、命令B1は分岐ヒスト
リテーブル410の更新を行なう)[Uステージを実行
する。レジスタ434には信号vA155上の命令B1
の分岐先アドレス〈C1〉がセットされ、命令アドレス
レジスタ411には信号に% 151上の命令B1のア
ドレスくB1〉が、命令アドレスリカバレジスタ428
には<CI>+16がそれぞれセントされる。一方、フ
リップフロップ441は前のマシンサイクルで信号線1
48上に出力されたEXステージBHT更新指示信号を
受けて“1”にセットされ、その出力は信号線154を
介して分岐ヒストリテーブル410に与えられる。これ
に応答して分岐ヒストリテーブル410には、分岐先ア
ドレスとしくCI〉をもつアドレスくB1〉の分岐情報
が格納され、これ以後、命令Blは分岐先アドレスとし
てくC1〉が予測されるようになる。In the next machine cycle 6, instruction B1 updates the branch history table 410) and executes the U stage. The register 434 contains the instruction B1 on the signal vA155.
The branch destination address <C1> of the instruction address register 411 is set to the signal %151.
<CI>+16 is cented for each. On the other hand, the flip-flop 441 is connected to the signal line 1 in the previous machine cycle.
It is set to "1" in response to the EX stage BHT update instruction signal outputted on 48, and its output is given to branch history table 410 via signal line 154. In response, the branch history table 410 stores the branch information of address B1> with CI> as the branch destination address, and from now on, the instruction Bl is predicted to have C1> as the branch destination address. become.
一方この時命令先取り制御回路423は、命令アドレス
レジスタ411の入力セレクタに対して信号線162上
に出力されている命令アドレスリカバレジスタ428の
保持するアドレス<CI>+16を選択するよう指示す
る。もしこの時、OAステージにある命令CIについて
OAステージ予測確認回路424より信号vA121を
介してOAステージ予測失敗信号が与えられれば、命令
先取り制御回路423は命令アドレスレジスタ411の
入力セレクタに対し信号線128上のアドレスを選択す
るよう指示する。On the other hand, at this time, the instruction prefetch control circuit 423 instructs the input selector of the instruction address register 411 to select the address <CI>+16 held by the instruction address recovery register 428 that is output on the signal line 162. At this time, if an OA stage prediction failure signal is given from the OA stage prediction confirmation circuit 424 via the signal vA121 for the instruction CI in the OA stage, the instruction prefetch control circuit 423 sends a signal line to the input selector of the instruction address register 411. 128 to select an address.
マシンサイクル7以降は命令アドレスレジスタ411に
セットされたアドレス<CI>+16に従って命令先取
り動作が続けられる。From machine cycle 7 onwards, the instruction prefetch operation continues according to the address <CI>+16 set in the instruction address register 411.
第19図は、分岐ヒストリテーブルに対応する分岐情報
が存在するBCT命令BCTIの実行のようすを示すタ
イムチャートであり、命令BCTIで指定した計数値は
“1”であって、−1する計数動作の結果は“O”とな
って実際には分岐を行なわないBCT命令の場合を示し
ている。FIG. 19 is a time chart showing the execution of the BCT instruction BCTI for which there is branch information corresponding to the branch history table. shows the case of a BCT instruction in which the result is "O" and no branch is actually performed.
第1図および第19図を参照すると、マシンサイクル0
の時刻において、命令BCTIのアドレス<BCTI>
が命令アドレスレジスタ411にセットされ、命令BC
TIのICステージが実行される。アドレス<BCTI
>は信号線101を介して命令記憶回路408へ与えら
れ、命令語の取出しが行なわれるとともに分岐ヒストリ
テーブル410に与えられ、命令BCTIについての分
岐情報の取出しが行なわれる。分岐ヒストリテーブル4
10より取出された分岐情報は信号線105上に出力さ
れる。同時にBHT−HIT信号が信号線106上に出
力される。これに応答して命令先取り制御回路423は
、命令アドレスレジスタ411の人力セレクタに対し、
信号線105に出力された命令BCTIの分岐先アドレ
ス<(、l>を選択するよう指示する。Referring to FIGS. 1 and 19, machine cycle 0
At the time of , the address of instruction BCTI <BCTI>
is set in the instruction address register 411, and the instruction BC
The TI's IC stage is executed. address<BCTI
> is applied to the instruction storage circuit 408 via the signal line 101, the instruction word is taken out, and is also given to the branch history table 410, where the branch information about the instruction BCTI is taken out. Branch history table 4
The branch information extracted from 10 is output onto signal line 105. At the same time, a BHT-HIT signal is output onto signal line 106. In response to this, the instruction prefetch control circuit 423 sets the manual selector of the instruction address register 411 to
An instruction is given to select the branch destination address <(, l>) of the instruction BCTI output to the signal line 105.
次のマシンサイクル1の時刻においては、命令BCTI
の分岐先アドレスくC1〉が命令アドレスレジスタ41
1にセントされて、命令C1のICステージが実行され
るとともに、命令BCTIのIDステージが実行される
。命令解読回路403は命令BCTIがBCT命令であ
ることを信号線114に出力すると同時に、信号線11
2上に命令BCTlの命令語長を出力する。At the time of the next machine cycle 1, the instruction BCTI
The branch destination address C1> is the instruction address register 41
1, the IC stage of instruction C1 is executed, and the ID stage of instruction BCTI is executed. The instruction decoding circuit 403 outputs to the signal line 114 that the instruction BCTI is a BCT instruction, and at the same time outputs the signal to the signal line 11.
The instruction word length of instruction BCTl is output on 2.
マシンサイクル2においては、命令BCTIのOAステ
ージと命令CIの10ステージおよび命令C1の後続の
命令C2のICステージが実行される。レジスタ435
は、前のマシンサイクルの信号線114の出力を受けて
、命令BCTIがBCT命令であることを信号線122
上に示す。分岐情報レジスタ (QR1) 417には
、前のマシンサイクルで分岐情報レジスタ(QRO)が
保持していた命令BCTIの分岐情報と命令BCTIの
命令語長がセットされ、信号線126には■ビットが出
力される。命令アドレス生成回路401は命令BCT1
の分岐先アドレスを生成し、オペランドアドレス生成回
路404は命令BCTIで指定された計数値を保持する
汎用レジスタの値を信号線120を介して比較回路43
3に出力する。比較回路433は与えられた計数値が“
1”であることを検出して信号線123に計数値1信号
を出力する。In machine cycle 2, the OA stage of instruction BCTI, the 10th stage of instruction CI, and the IC stage of instruction C2 following instruction C1 are executed. register 435
In response to the output of the signal line 114 of the previous machine cycle, the signal line 122 indicates that the instruction BCTI is a BCT instruction.
Shown above. In the branch information register (QR1) 417, the branch information of the instruction BCTI held in the branch information register (QRO) in the previous machine cycle and the instruction word length of the instruction BCTI are set, and the ■ bit is set in the signal line 126. Output. The instruction address generation circuit 401 generates the instruction BCT1
The operand address generation circuit 404 outputs the value of the general-purpose register holding the count value specified by the instruction BCTI to the comparison circuit 43 via the signal line 120.
Output to 3. The comparison circuit 433 determines that the given count value is “
1'' is detected and a count value 1 signal is output to the signal line 123.
マシンサイクル3においては、命令BCTIのOTステ
ージが実行され、命令BCTIの分岐先アドレスが命令
アドレス変換回路402で実アドレスに変換されるとと
もに、命令C1,C2およびC2の後続の命令C3のO
A、ID、ICステージがそれぞれ実行される。OTス
テージ予測確認回路425は、前のマシンサイクルで信
号線122.123゜126を介して与えられた情報か
ら、OTステージにある命令BCTIが分岐N0GOの
BCT命令であることにもかかわらず命令BCTIの分
岐情報が分岐ヒストリテーブル410にヒントして分岐
GO側へ後続の先取りが行なわれたこと、このため命令
BCTIの分岐N0GO側への後続の命令先取りを改め
て実行する必要のあること、並びに命令BCTIについ
ての分岐情報を正しく更新する必要のあることを示すた
めに、信号線129にOTステージ予測失敗信号を出力
し、信号線130にはOTステージB HT更新指示信
号を出力し、信号線131のOTステージGo先取り指
示信号には“O”を出力する。これに応答して選択回路
421は、アドレス生成回路431が信号線138に出
力する命令BCTIの分岐N0GO側の次の命令のアド
レス<Al>を選択して信号線139上に出力し、命令
先取り制御回路423は、命令アドレスレジスタ411
の入力セレクタに対して信号線139上のアドレスくA
1〉を選択するよう指示する。又、OTステージ予測失
敗信号が出力されたことによ°す、OTステージより前
にある分岐GO側に後続する命令C1,C2,C3の動
作は全てキャンセルされる。In machine cycle 3, the OT stage of the instruction BCTI is executed, and the branch destination address of the instruction BCTI is converted into a real address by the instruction address conversion circuit 402, and the OT stage of the instruction C3 following instructions C1, C2, and C2 is executed.
A, ID, and IC stages are each executed. The OT stage prediction confirmation circuit 425 determines whether the instruction BCTI in the OT stage is a branch N0GO BCT instruction based on the information given via the signal lines 122, 123, or 126 in the previous machine cycle. The branch information hinted in the branch history table 410 that the subsequent prefetching to the branch GO side was performed, and therefore the subsequent prefetching of the instruction BCTI to the branch N0GO side needs to be executed again, and the instruction In order to indicate that the branch information regarding BCTI needs to be updated correctly, an OT stage prediction failure signal is output to the signal line 129, an OT stage B HT update instruction signal is output to the signal line 130, and the OT stage B HT update instruction signal is output to the signal line 131. "O" is output as the OT stage Go preemption instruction signal. In response, the selection circuit 421 selects the address <Al> of the next instruction on the branch N0GO side of the instruction BCTI outputted to the signal line 138 by the address generation circuit 431 and outputs it to the signal line 139, thereby preempting the instruction. The control circuit 423 controls the instruction address register 411
Address A on signal line 139 for the input selector of
Instruct the user to select 1>. Further, due to the output of the OT stage prediction failure signal, the operations of the instructions C1, C2, and C3 subsequent to the branch GO side before the OT stage are all canceled.
マシンサイクル4においては、命令BCTIの0Cサイ
クルが実行され、同時に命令アドレスレジスタ411ニ
は、命令BCTlの分岐N0GO側に後続する命令A1
のアドレスくA1〉がセントされ、命令AIのICステ
ージが実行される。フリップフロップ437.438は
、前のマシンサイクルで出力されたOTステージBHT
更新指示信号とOTステージGO先取り指示信号とを受
けてそれぞれ@1″、10″にセットされる。OCステ
ージ予測確認回路426は、前のマシンサイクルで分岐
情報レジスタ (QR2)418が保持していた命令B
CTIの予測された分岐先アドレス〈C1〉とVビット
を信号線137を介して、又命令BCT1の命令語の指
定により求められた実際の分岐先アドレスを信号線13
3を介して命令アドレス変換回路402からそれぞれ受
は取り、予測された分岐先アドレス〈C1〉が正しいか
どうかの検出を行なう。しかしながらフリップフロップ
437が“1゛にセットされているため、たとえ分岐先
アドレス〈C1〉が正しくなくともOCステージ予測失
敗信号が信号線140に出力されることはなく、OTス
テージで命令BCTIの分岐N0GO側へ先取りをやり
直した動作をキャンセルして分岐GO側への先取りが改
めて始まることはない。In machine cycle 4, the 0C cycle of the instruction BCTI is executed, and at the same time, the instruction address register 4112 is set to the instruction A1 that follows the branch N0GO side of the instruction BCTl.
address A1> is sent, and the IC stage of instruction AI is executed. Flip-flops 437 and 438 output the OT stage BHT in the previous machine cycle.
In response to the update instruction signal and the OT stage GO prefetch instruction signal, they are set to @1'' and 10'', respectively. The OC stage prediction confirmation circuit 426 checks the instruction B held in the branch information register (QR2) 418 in the previous machine cycle.
The predicted branch destination address <C1> of CTI and the V bit are sent via the signal line 137, and the actual branch destination address obtained by the specification of the command word of the instruction BCT1 is sent to the signal line 13.
3 from the instruction address conversion circuit 402, and it is detected whether the predicted branch destination address <C1> is correct. However, since the flip-flop 437 is set to "1", even if the branch destination address <C1> is incorrect, the OC stage prediction failure signal will not be output to the signal line 140, and the branch of the instruction BCTI at the OT stage will not be output. The prefetching to the branch GO side does not start again by canceling the operation of redoing the prefetching to the N0GO side.
次のマシンサイクル5において、命令BCTIのEXス
テージが実行される。命令実行回路407は命令BCT
Iで指定された計数動作を行ない、その結果が“O”に
なることから、信号線149の分岐成否信号に分岐N0
GOを示す“0”を出力する。これに応答して選択回路
422は、アドレス生成回路432の出力する命令BC
TIの分岐N0GO側に後続する命令A1のアドレス<
AI>を選択して信号線155に出力する。同時に信号
線151には分岐情報レジスタ(QR4)420の保持
する命令BCTIのアドレス<BCTI>が出力される
。一方フリップフロップ439.440は、フリップフ
ロップ437,438の内容をoCステージ予測確認回
路426を通して受けそれぞれ“1”、′0”にセット
される。EXステージ予測確認回路427は、信号線1
49の分岐成否信号と、前のマシンサイクルで信号m1
46を介して与えられた分岐情報レジスタ(QR3)
419 (7)保持しティた命令BCTIの分岐ta
ttaの■ビット、およびフリップフロップ439.4
40とから、信号線148のEXステージBHT更新指
示信号として“1”を出力し、信号綿147のEXステ
ージ予測失敗信号として“O”を出力することによって
、命令BCTIの分岐情報に従って分岐GOへ後続の命
令先取りを行なったにもかかわらず、命令BCTIは実
際には分岐N0GOであること、しかしながら後続の誤
った命令先取り動作はキャンセルされて既に分岐NOC
;O側への命令取出し動作が行なわれているためEXス
テージでは命令先取りのやり直しを指示する必要のない
ことを示すと共に、命令BCTIの分岐情報の更新が必
要なことを示す。これを受けて命令先取り制御回路42
3は、命令アドレスレジスタ411の入力セレクタに対
し信号線151上の命令BCT1のアドレス<BCTI
>を選択するよう指示し、命令アドレスリカバレジスタ
428の入力セレクタに対しては信号線107上のアド
レス<AI>+16を選択するよう指示する。もしこの
時、命令アドレスレジスタ411の保持するアドレス<
At>+8に対応する分岐情報が分岐ヒストリテーブル
410に存在してBHT−HIT信号が信号線106を
介して与えられれば、命令先取り制御回路423は、命
令アドレスリカバレジスタ428の入力セレクタに対し
ては信号線105上の分岐ヒストリテーブル410より
取出された分岐情報の示す分岐先アドレスを選択するよ
う指示する。。In the next machine cycle 5, the EX stage of instruction BCTI is executed. The instruction execution circuit 407 executes the instruction BCT
Since the counting operation specified by I is performed and the result is "O", a branch N0 is sent to the branch success/failure signal on the signal line 149.
Outputs “0” indicating GO. In response, the selection circuit 422 selects the command BC output from the address generation circuit 432.
The address of the instruction A1 following the branch N0GO side of TI<
AI> is selected and output to the signal line 155. At the same time, the address <BCTI> of the instruction BCTI held in the branch information register (QR4) 420 is output to the signal line 151. On the other hand, the flip-flops 439 and 440 receive the contents of the flip-flops 437 and 438 through the oC stage prediction confirmation circuit 426 and are set to "1" and '0', respectively.
49 branch success/failure signal and signal m1 in the previous machine cycle.
Branch information register (QR3) given via 46
419 (7) Branch ta of held instruction BCTI
■ bit of tta, and flip-flop 439.4
40, outputs "1" as the EX stage BHT update instruction signal on the signal line 148, and outputs "O" as the EX stage prediction failure signal on the signal line 147, thereby proceeding to the branch GO according to the branch information of the instruction BCTI. Despite prefetching the subsequent instruction, the instruction BCTI is actually a branch N0GO; however, the subsequent erroneous instruction prefetching operation is canceled and the branch N0GO
; Indicates that there is no need to instruct redoing of instruction prefetching in the EX stage because the instruction fetching operation to the O side is being performed, and also indicates that it is necessary to update the branch information of the instruction BCTI. In response to this, the instruction prefetch control circuit 42
3 is the address of the instruction BCT1 on the signal line 151 for the input selector of the instruction address register 411<BCTI
> and instructs the input selector of the instruction address recovery register 428 to select the address <AI>+16 on the signal line 107. At this time, if the address held by the instruction address register 411<
If branch information corresponding to At>+8 exists in the branch history table 410 and the BHT-HIT signal is given via the signal line 106, the instruction prefetch control circuit 423 controls the input selector of the instruction address recovery register 428. instructs to select the branch destination address indicated by the branch information extracted from the branch history table 410 on the signal line 105. .
次のマシンサイクル6において、命令BCT1は分岐ヒ
ストリテーブル410内の命令BCTIについての分岐
情報の更新を行なうHUステージを実行する。命令アド
レスレジスタ411には命令アドレス<BCTI>がセ
ントされ、フリップフロップ441 は荊のマシンサイ
クルで信号線148に出力されたEXステージBHT更
新指示信号を受けて”1″にセットされ、その出力は信
号WA154を介して分岐ヒストリテーブル410に与
えられる。In the next machine cycle 6, instruction BCT1 executes the HU stage in which the branch information for instruction BCTI in branch history table 410 is updated. The instruction address <BCTI> is sent to the instruction address register 411, and the flip-flop 441 is set to "1" in response to the EX stage BHT update instruction signal output to the signal line 148 in the machine cycle of Jing. It is applied to branch history table 410 via signal WA154.
これに応答して分岐ヒストリテーブル410内の命令B
CTIの分岐情報のVビットがリセットされる。一方こ
の時、命令先取り制御回路423は命令アドレスレジス
タ411の入力セレクタに対して信号線162上に出力
されている命令アドレスリカバレジスタ428の保持す
るアドレス<AI>+16を選択するよう指示し、もし
この時、OAステージにある命令A1について、OAス
テージ予測確認回路424より信号線121を介してO
AXステージ予測失敗信号与えられれば、信号に%12
8上のアドレスを選択するように指示する。In response, instruction B in branch history table 410
The V bit of the CTI branch information is reset. On the other hand, at this time, the instruction prefetch control circuit 423 instructs the input selector of the instruction address register 411 to select the address <AI>+16 held by the instruction address recovery register 428 that is output on the signal line 162. At this time, regarding the instruction A1 in the OA stage, the OA stage prediction confirmation circuit 424 sends an output signal via the signal line 121.
Given the AX stage prediction failure signal, %12 to the signal
Instruct the user to select the address above 8.
マシンサイクル7以降は、命令アドレスレジスタ411
にセットされたアドレスに従って命令先取り動作が続け
られる。After machine cycle 7, the instruction address register 411
Instruction prefetch operations continue according to the address set in .
第20図は、分岐ヒストリテーブルに対応する分岐情報
が存在し、分岐Go側へ後続の命令先取り動作が行なわ
れた無条件分岐命令、あるいは実際に分岐Goとなる条
件分岐命令B1の実行のようすを示すタイムチャートで
あり、命令Blに対する分岐情報の示す分岐先アドレス
が実際に命令B1の指定する分岐先アドレスとは異なっ
ていた場合を示している。Figure 20 shows the execution of an unconditional branch instruction for which branch information exists in the branch history table and a subsequent instruction is prefetched to the branch Go side, or a conditional branch instruction B1 that actually becomes a branch Go. This is a time chart showing a case where the branch destination address indicated by the branch information for the instruction B1 is actually different from the branch destination address designated by the instruction B1.
第1図及び第20図を参照するとマシンサイクル0の時
刻において、無条件分岐命令あるいは条件分岐命令であ
る命令B1のアドレス<Bl>が命令アドレスレジスタ
411にセントされて命令B1のICステージが実行さ
れる。アドレス〈B1〉は信号線101を介して命令記
憶回路408に与えられ命令語の取出しが行なわれると
ともに、分岐ヒストリテーブル410にも与えられ、命
令B1に対する分岐情報の取出しが行なわれる。その結
果分岐ヒストリテーブル410は命令B1に対する分岐
情報を取出し、信号線105に分岐先アドレス〈C1〉
を出力するとともに、信号線106にはBHT−HIT
信号を出力する。これに応答して命令先取り制御回路4
23は、命令アドレスレジスタ411の入力セレクタに
対して、予測された分岐先アドレスくC1〉が出力され
ている信号線105を選択するよう指示する。Referring to FIGS. 1 and 20, at the time of machine cycle 0, the address <Bl> of instruction B1, which is an unconditional branch instruction or a conditional branch instruction, is sent to the instruction address register 411, and the IC stage of instruction B1 is executed. be done. The address <B1> is applied to the instruction storage circuit 408 via the signal line 101 to retrieve the instruction word, and is also applied to the branch history table 410 to retrieve the branch information for the instruction B1. As a result, the branch history table 410 takes out the branch information for the instruction B1 and sends the branch destination address <C1> to the signal line 105.
At the same time, BHT-HIT is output on the signal line 106.
Output a signal. In response to this, the instruction prefetch control circuit 4
23 instructs the input selector of the instruction address register 411 to select the signal line 105 to which the predicted branch destination address C1> is output.
次のマシンサイクルlにおいては、予測された分岐先ア
ドレス<C1>が命令アドレスレジスタ411にセント
され、命令C1のICステージが実行されるとともに命
令B1のIDステージが実行される。In the next machine cycle 1, the predicted branch destination address <C1> is written to the instruction address register 411, and the IC stage of the instruction C1 is executed, as well as the ID stage of the instruction B1.
マシンサイクル2において、命令CIのIDステージと
命令C1の後続の命令C2のICステージが実行される
とともに、命令B1の○Aステージが実行され、命令B
1の分岐先アドレスが命令アドレス生成回路401によ
って計算され信号線119上にその論理アドレスが出力
される。In machine cycle 2, the ID stage of the instruction CI and the IC stage of the instruction C2 following the instruction C1 are executed, the ○A stage of the instruction B1 is executed, and the ○A stage of the instruction B1 is executed.
1 branch destination address is calculated by instruction address generation circuit 401 and the logical address is output on signal line 119.
マシンサイクル3においては命令B1のOTステージが
実行され、命令B1の分岐先アドレスが命令アドレス変
換回路402で実アドレスくDl〉に変換され、信号線
133上に出力されるとともに、命令C1,C2,C3
のOA、ID、ICステージがそれぞれ実行される。分
岐情報レジスタ(QR2)41Bには、命令B1の分岐
情報がセットされ、予測された分岐アドレス<CI>と
Vビットが信号線137上に出力される。In machine cycle 3, the OT stage of instruction B1 is executed, and the branch destination address of instruction B1 is converted by the instruction address conversion circuit 402 into a real address Dl>, which is output on the signal line 133, and the branch destination address of instruction B1 is ,C3
The OA, ID, and IC stages of are executed respectively. Branch information of the instruction B1 is set in the branch information register (QR2) 41B, and the predicted branch address <CI> and the V bit are output onto the signal line 137.
マシンサイクル4において、命令Bl、C1゜C2,C
3,C4のOC,OT、OA、ID、ICの各ステージ
がそれぞれ実行される。oCステージ予測確認回路42
6は、前のマシンサイクルで信号線137を介して与え
られた命令Blの予測された分岐先アドレスくC1〉と
Vビットおよび信号線133を介して与えられた命令B
1の命令語によって指定された実際の分岐先アドレスく
Dl〉とを照合し、予測された分岐先アドレス〈C1〉
が誤っていることを検出し、信号線140にocステー
ジ予測失敗信号を出力するとともに、信号線156にO
CステージBHT更新指示信号を、信号線141にはO
CステージGO先取り指示信号をそれぞれ出力する。分
岐情報レジスタ (Q R3)419は前のマシンサイ
クルで信号線133上に出力された命令B1の実際の分
岐先アドレスくDl〉がセットされ、信号線143上に
アドレス<Di>を出力する。命令先取り制御回路42
3は、信号線140のOCステージ予測失敗信号に応答
して、命令アドレスレジスフ411の入力セレクタに対
して信号線143上のアドレス〈Dl〉を選択するよう
指示する。又、OCステージ予測失敗信号が出力された
ことにより、命令B1の分岐情報の示す誤った分岐先ア
ドレスくC1〉に従って先取りされた命令C1,C2,
C3,C4の動作は全てキャンセルされる。In machine cycle 4, instructions Bl, C1°C2, C
3. The OC, OT, OA, ID, and IC stages of C4 are respectively executed. oC stage prediction confirmation circuit 42
6 is the predicted branch destination address C1> of the instruction Bl given via the signal line 137 in the previous machine cycle, the V bit, and the instruction B given via the signal line 133.
The predicted branch destination address <C1> is compared with the actual branch destination address <Dl> specified by instruction word 1.
is detected to be incorrect, outputs an OC stage prediction failure signal to the signal line 140, and outputs an OC stage prediction failure signal to the signal line 156.
The C stage BHT update instruction signal is output to the signal line 141.
Each outputs a C stage GO prefetch instruction signal. The branch information register (QR3) 419 is set with the actual branch destination address <Dl> of the instruction B1 output on the signal line 133 in the previous machine cycle, and outputs the address <Di> on the signal line 143. Instruction prefetch control circuit 42
3 instructs the input selector of the instruction address register 411 to select the address <Dl> on the signal line 143 in response to the OC stage prediction failure signal on the signal line 140. Furthermore, due to the output of the OC stage prediction failure signal, the instructions C1, C2, which were prefetched according to the incorrect branch destination address C1 shown in the branch information of instruction B1,
All operations of C3 and C4 are canceled.
マシンサイクル5においては、命令アドレスレジスタ4
11には命令B1の実際の分岐先アドレスであるアドレ
スくDl〉がセットされて命令D1のICステージが実
行されるとともに、命令B1のEXステージが実行され
る。命令実行回路407は命令81が条件分岐命令であ
れば、命令Blの命令語により指定された分岐条件を判
定して、その結果信号線149の分岐成否信号に分岐G
oを示す“l”を出力し、命令Elが無条件分岐命令で
あればやはり信号線149の分岐成否信号に“l”を出
力する。これに応答して選択回路422は、分岐情報レ
ジスタ(QR4)420の保持する実際の分岐先アドレ
ス<pl>を選択して信号線155上に出力する。又、
信号線151には命令B1のアドレス〈B1〉が出力さ
れる。フリップフロップ439゜440は、前のマシン
サイクルで出力されたoCステージBHT更新指示信号
と、OCステージG。In machine cycle 5, instruction address register 4
Address Dl>, which is the actual branch destination address of the instruction B1, is set in 11, and the IC stage of the instruction D1 is executed, and the EX stage of the instruction B1 is executed. If the instruction 81 is a conditional branch instruction, the instruction execution circuit 407 determines the branch condition specified by the command word of the instruction Bl, and as a result, indicates a branch G to the branch success/failure signal on the signal line 149.
If the instruction El is an unconditional branch instruction, it also outputs "l" to the branch success/failure signal on the signal line 149. In response, the selection circuit 422 selects the actual branch destination address <pl> held in the branch information register (QR4) 420 and outputs it onto the signal line 155. or,
The address <B1> of the instruction B1 is output to the signal line 151. Flip-flops 439 and 440 receive the oC stage BHT update instruction signal output in the previous machine cycle and the OC stage G.
先取り指示信号を受けてどらちも“l”にセノトされる
。EXステージ予測確認回路427は、命令Blに対す
る分岐情報に従って誤った後続の命令の取出しが行なわ
れたが既にキャンセルされて正しい分岐GO側のアドレ
スに従った命令先取りが行なわれており、EXステージ
から命令先取りのやり直しを指示する必要のないこと、
ただし分岐ヒストリテーブル410の命令B1について
の分岐情報は修正する必要のあることを示すために、信
号線147のEXステージ予測失敗信号には“0“を、
信号線148のEXステージBHT更新指示信号には“
1”を出力する。これに応答して命令先取り制御回路4
23は、命令アドレスレジスタ411の入力セレクタに
対し信号線151上の命令B1のアドレスくB1〉を選
択するように、また命令アドレスリカバレジスタ428
の人力セレクタに対し信号線107上のアドレス<DI
>+8を選択するようそれぞれ指示する。もしこの時、
命令アドレスレジスタ411の保持するアドレス<DI
>に対応する分岐情報が分岐ヒストリテーブル410に
存在してBHT−HIT信号が信号線106に出力され
れば、命令アドレスリカバレジスタ428の入力セレク
タに対しては、信号線105上の分岐ヒストリテーブル
410より取出された分岐情報の示す分岐先アドレスを
選択するよう指示する。Upon receiving the preemption instruction signal, both are set to "l". The EX stage prediction confirmation circuit 427 determines that the incorrect subsequent instruction has been fetched according to the branch information for instruction Bl, but it has already been canceled and the instruction has been prefetched according to the correct address on the branch GO side. There is no need to instruct the redo of command preemption;
However, to indicate that the branch information for instruction B1 in the branch history table 410 needs to be corrected, "0" is set to the EX stage prediction failure signal on the signal line 147.
The EX stage BHT update instruction signal on the signal line 148 is “
1". In response, the instruction prefetch control circuit 4
23 is used to select the address B1 of the instruction B1 on the signal line 151 for the input selector of the instruction address register 411, and the instruction address recovery register 428.
Address on signal line 107 for human selector <DI
>+8. If at this time,
Address held by instruction address register 411<DI
If the branch information corresponding to An instruction is given to select the branch destination address indicated by the branch information retrieved from step 410.
次のマシンサイクル6において、命令B1のHUステー
ジが実行され、命令B1に対する分岐情報の更新が行な
われる。命令アドレスレジスタ411には命令Blのア
ドレスくB1〉がセットされ、レジスタ434には命令
B1の正しい分岐先アドレスくDl〉がセットされ、フ
リップフロップ441は前のマシンサイクルで出力され
たEXステージBHT更新指示信号を受け“1”がセッ
トされ、その出力が信号!!jl154を介して分岐ヒ
ストリテーブル410に与えられる。これに応答して分
岐ヒストリテーブル410内の命令Blに対する分岐情
報が分岐先アドレスとしてくDl〉を示すように更新さ
れる。一方この時、命令先取り制御回路423は、命令
アドレスレジスタ411の人力セレクタに対し、命令ア
ドレスリカバレジスタ428の出力を選択するよう指示
する。In the next machine cycle 6, the HU stage of instruction B1 is executed, and the branch information for instruction B1 is updated. The instruction address register 411 is set to the address B1 of the instruction B1, the register 434 is set to the correct branch destination address D1 of the instruction B1, and the flip-flop 441 is set to the EX stage BHT output in the previous machine cycle. “1” is set in response to the update instruction signal, and the output is the signal! ! It is given to the branch history table 410 via jl154. In response, the branch information for the instruction Bl in the branch history table 410 is updated to indicate Dl> as the branch destination address. Meanwhile, at this time, the instruction prefetch control circuit 423 instructs the manual selector of the instruction address register 411 to select the output of the instruction address recovery register 428.
マシンサイクル7において、命令アドレスリカバレジス
タ428に退避していた命令アドレスが命令アドレスレ
ジスタ411にセットされて、以降そのアドレスに従っ
て命令先取り動作が続けられる。In machine cycle 7, the instruction address saved in the instruction address recovery register 428 is set in the instruction address register 411, and thereafter the instruction prefetch operation continues according to that address.
第21図は、分岐ヒストリテーブル410に対応する分
岐情報が存在し分岐Go側へ後続の命令先取り動作が行
なわれた条件分岐命令BC1の実行のようすを示すタイ
ムチャートであり、命令BCIに対する分岐情報の示す
分岐先アドレスは、実際に命令BCIの指定する分岐先
アドレスとは異なっており、さらに条件分岐命令BCI
はその分岐条件を判定した結果分岐N0GOであった場
合を示している。FIG. 21 is a time chart showing the state of execution of a conditional branch instruction BC1 in which there is branch information corresponding to the branch history table 410 and a subsequent instruction prefetch operation is performed on the branch Go side. The branch destination address indicated by is different from the branch destination address actually specified by the instruction BCI, and furthermore, the branch destination address indicated by the conditional branch instruction BCI
indicates a case where the branch condition is determined and the branch is NOGO.
第1図および第21図を参照すると、マシンサイクルO
において、条件分岐命令BCIのアドレス<BCI>が
命令アドレスレジスタ411にセットされ、命令BCI
のICステージが実行される。Referring to FIGS. 1 and 21, the machine cycle O
, the address <BCI> of the conditional branch instruction BCI is set in the instruction address register 411, and the instruction BCI
The following IC stages are executed.
同時に命令BCIの分岐情報が分岐ヒストリテーブル4
10より取出され、予測された分岐先アドレスとして〈
C1〉が信号線105上に出力され、BHT−HIT信
号が信号線106上に出力される。At the same time, the branch information of the instruction BCI is stored in the branch history table 4.
10 and as the predicted branch destination address
C1> is output on the signal line 105, and the BHT-HIT signal is output on the signal line 106.
これに応答して命令先取り制御回路423は、命令アド
レスレジスタ411の入力セレクタに対して、信号線1
05上のアドレス<CI>を選択するよう指示する。In response, the instruction prefetch control circuit 423 sends signal line 1 to the input selector of the instruction address register 411.
Instructs to select address <CI> on 05.
次のマシンサイクル1において、命令B C1の予測さ
れた分岐先アドレスくC1〉が命令アドレスレジスタ4
11にセントされ、命令C1のICステージが実行され
るとともに、命令BCIの10ステージが実行される。In the next machine cycle 1, the predicted branch destination address (C1) of instruction B C1 is stored in the instruction address register 4.
11, the IC stage of instruction C1 is executed, and the 10 stage of instruction BCI is executed.
マシンサイクル2において、命令C1のIDステージと
、命令C1の後続の命令C2のICステージが実行され
ると共に、命令BCIのOAXステージ実行され、命令
BCIの分岐先アドレスが命令アドレス生成回路401
によって計算され、信号線119上にその論理アドレス
が出力される。In machine cycle 2, the ID stage of the instruction C1 and the IC stage of the instruction C2 following the instruction C1 are executed, and the OAX stage of the instruction BCI is executed, and the branch destination address of the instruction BCI is set to the instruction address generation circuit 401.
The logical address is output on signal line 119.
マシンサイクル3においては、命令BCIのOTステー
ジが実行され、命令BCIの分岐先アドレスが命令アド
レス変換回路402によって実アドレスくDl〉に変換
され信号線133上に出力される。同時ニ命令C1,C
2,C3のOA、ID。In machine cycle 3, the OT stage of the instruction BCI is executed, and the branch destination address of the instruction BCI is converted by the instruction address conversion circuit 402 into a real address Dl> and output onto the signal line 133. Simultaneous two instructions C1, C
2, C3 OA, ID.
ICステージもそれぞれ実行される。分岐情報レジスタ
(QR2)418には命令BCIの分岐情報がセットさ
れ予測された分岐先アドレス〈C1〉とVビットが信号
線137上に出力される。Each IC stage is also executed. Branch information of the instruction BCI is set in the branch information register (QR2) 418, and the predicted branch destination address <C1> and the V bit are output onto the signal line 137.
マシンサイクル4においては、命令BCI、C1、C2
,C3,C4のQC,OT、 OA、 10゜Icの
各ステージがそれぞれ実行される。OCステージ予測確
認回路426は、前のマシンサイクルで信号線137を
介して与えられた命令BCIの予測された分岐先アドレ
ス<C1>と■ビット、および信号線133を介して与
えられた命令BC1の命令語によって指定された実際の
分岐先アドレスくDl〉とを照合して、予測された分岐
先アドレス<Clンが誤っていることを検出し、信号線
140にOCステージ予測失敗信号を出力するとともに
、信号線156にOCステージBHT更新指示信号を、
信号線141にはOCステージGO先取り指示信号をそ
れぞれ出力する6分岐情報レジスタ(QR3)419は
、前のマシンサイクルで信号線133に出力されていた
実際の分岐先アドレス〈Dl〉がセットされ、信号線1
43上にそのアドレス〈Dl〉を出力する。命令先取り
制御回路423は信号線140のOCステージ予測失敗
信号に応答して、命令アドレスレジスタ411の入力セ
レクタに対して、信号線143上のアドレス〈Dl〉を
選択するよう指示する。又、OCステージ予測失敗信号
が出力されたことにより命令BCIの分岐情報の示す誤
った分岐先アドレスくC1〉に従って先取りされた命令
C1,C2,C3,C4の動作は全てキャンセルされる
。In machine cycle 4, instructions BCI, C1, C2
, C3, and C4, the QC, OT, OA, and 10°Ic stages are executed, respectively. The OC stage prediction confirmation circuit 426 receives the predicted branch destination address <C1> and ■ bit of the instruction BCI given via the signal line 137 in the previous machine cycle, and the instruction BC1 given via the signal line 133. It compares the predicted branch destination address <Dl> with the actual branch destination address specified by the instruction word, detects that the predicted branch destination address <Cl> is incorrect, and outputs an OC stage prediction failure signal to the signal line 140. At the same time, an OC stage BHT update instruction signal is sent to the signal line 156.
The six branch information registers (QR3) 419, which each output an OC stage GO prefetch instruction signal to the signal line 141, are set with the actual branch destination address <Dl> that was output to the signal line 133 in the previous machine cycle. Signal line 1
The address <Dl> is output on 43. In response to the OC stage prediction failure signal on the signal line 140, the instruction prefetch control circuit 423 instructs the input selector of the instruction address register 411 to select the address <Dl> on the signal line 143. Furthermore, since the OC stage prediction failure signal is output, the operations of the instructions C1, C2, C3, and C4, which were prefetched according to the incorrect branch destination address C1> indicated by the branch information of the instruction BCI, are all canceled.
マシンサイクル5においては、命令アドレスレジスタ4
11には、命令BCIの命令語より求められた分岐先ア
ドレス〈Dl〉がセットされ、命令D1のICステージ
が実行されるとともに、命令BCIのEXステージが実
行される。命令実行回路407は、条件分岐命令BCI
の命令語により指定された分岐条件を判定して、その結
果信号線149の分岐成否信号に分岐N0GOを示す“
0”を出力する。これに応答して選択回路422は、ア
ドレス生成回路432の出力する命令BCIの命令アド
レス<BCI>と命令BCIの命令語長とを加算したア
ドレス<At>を選択し、信号線155上に出力する。In machine cycle 5, instruction address register 4
The branch destination address <Dl> obtained from the instruction word of the instruction BCI is set in 11, and the IC stage of the instruction D1 is executed, and the EX stage of the instruction BCI is executed. The instruction execution circuit 407 executes a conditional branch instruction BCI.
The branch condition specified by the instruction word is determined, and as a result, the branch success/failure signal on the signal line 149 indicates branch N0GO.
0". In response, the selection circuit 422 selects the address <At> which is the sum of the instruction address <BCI> of the instruction BCI output from the address generation circuit 432 and the instruction word length of the instruction BCI, Output on signal line 155.
また、信号線151上には、命令BCIのアドレス<B
CI>が出力される。フリップフロップ439,440
は、前のマシンサイクルで出力されたoCステージBH
T更新指示信号と、OCステージGO先取り指示信号と
を受けて、どちらも“1″にセットされる。EXステー
ジ予測確認回路427は、前のマシンサイクルで信号線
146を介して分岐情報レジスタ (QR3)419の
保持する命令BCIのVビットと、信号線149の分岐
成否信号およびフリップフロップ439.440の出力
を受けて、信号線147のEXステージ予測失敗信号と
信号線148のEXステージBl(T更新指示信号とに
“1”を出力し、命令BCIの分岐情報は誤っており、
既に分岐GO側へ後続する命令の先取りのやり直しが指
示されたが、実際には命令BCIは分岐N0GOであり
、分岐ヒストリテーブル410のBCIに関する分岐情
報を正しく更新するとともに分岐N0GO側に後続する
命令の先取りのやり直しを行なう必要のあることを示す
。これに応答して命令先取り制御回路423は、命令ア
ドレスレジスタ411の入力セレクタに対して信号線1
51上のアドレス<BCI>を選択するように、また命
令アドレスリカバレジスフ428の入力セレクタに対し
ては信号線155上のアドレスくA1〉を選択するよう
にそれぞれ指示する。Further, on the signal line 151, the address of the instruction BCI <B
CI> is output. flip flop 439,440
is the oC stage BH output in the previous machine cycle
Upon receiving the T update instruction signal and the OC stage GO prefetch instruction signal, both are set to "1". The EX stage prediction confirmation circuit 427 receives the V bit of the instruction BCI held in the branch information register (QR3) 419 via the signal line 146 in the previous machine cycle, the branch success/failure signal on the signal line 149, and the output of the flip-flops 439 and 440. Upon receiving the output, "1" is output to the EX stage prediction failure signal on the signal line 147 and the EX stage Bl (T update instruction signal) on the signal line 148, and the branch information of the instruction BCI is incorrect.
Although the prefetching of the subsequent instruction has already been instructed to the branch GO side, the instruction BCI is actually a branch N0GO, so the branch information regarding the BCI in the branch history table 410 is updated correctly, and the subsequent instruction is sent to the branch N0GO side. Indicates that it is necessary to redo the prefetch. In response, the instruction prefetch control circuit 423 sends signal line 1 to the input selector of the instruction address register 411.
51, and the input selector of the instruction address recovery register 428 is instructed to select the address <A1> on the signal line 155.
次のマシンサイクル6において、命令BCLのHUステ
ージが実行され命令BCIに対する分岐情報の更新が行
なわれる。命令アドレスレジスタ411には命令BCI
のアドレス<BCI>がセットされ、命令アドレスリカ
バレジスタ428とレジスタ434には命令BCIの分
岐N0GO側のアドレスくA1〉がセットされる。又、
フリップフロップ441には前のマシンサイクルで出力
されたEXステージBHT史斬新指示信号よって“1″
がセントされ、その出力が信号線154を介して分岐ヒ
ストリテーブル410に与えられる。これに応答して分
岐ヒストリテーブル410内の命令BCIに対する分岐
情報のVビットがリセットされる。一方この時、命令先
取り制御回路423は、命令アドレスレジスタ411の
入力セレクタに対して、命令BCIの分岐N0GO側の
アドレス<AI>を保持する命令アドレスリカバレジス
タ428の出力を選択するように指示する。In the next machine cycle 6, the HU stage of instruction BCL is executed and branch information for instruction BCI is updated. The instruction address register 411 contains the instruction BCI.
The address <BCI> of the instruction BCI is set, and the address <A1> of the branch N0GO side of the instruction BCI is set in the instruction address recovery register 428 and register 434. or,
The flip-flop 441 is set to “1” by the EX stage BHT history innovative instruction signal output in the previous machine cycle.
is sent, and its output is provided to branch history table 410 via signal line 154. In response, the V bit of the branch information for the instruction BCI in the branch history table 410 is reset. Meanwhile, at this time, the instruction prefetch control circuit 423 instructs the input selector of the instruction address register 411 to select the output of the instruction address recovery register 428 that holds the address <AI> on the branch N0GO side of the instruction BCI. .
マシンサイクル7においては、命令アドレスレジスタ4
11にアドレス〈A1〉がセットされ、命令BCIの後
続の命令A1の取出しが行なわれる。In machine cycle 7, instruction address register 4
Address <A1> is set to 11, and instruction A1 subsequent to instruction BCI is fetched.
そして以降、命令アドレスレジスタ411にセットされ
たアドレスに従って命令先取り動作が続けられる。Thereafter, the instruction prefetch operation continues according to the address set in the instruction address register 411.
次に本発明の効果を第20図を参照しながら説明する。 Next, the effects of the present invention will be explained with reference to FIG. 20.
第20図では、無条件分岐命令Blについての分岐ヒス
トリテーブル上の分岐情報に従って後続の命令C1の先
取りを行なったが、分岐情報で指定された分岐先アドレ
スが誤っていた場合を示しており、実際に命令で指定さ
れた分岐先アドレスが求まるとすぐ分岐情報の分岐先ア
ドレスが正しかったかどうかを検査する回路をOCステ
ージに設けたため、分岐先の命令の先取りやり直しは、
命令B1のOCステージで指示され、マシンサイクル5
の時点では正しい後続の命令Diの取出しを行なうIC
ステージが実行されている。この場合誤った分岐情報に
よって失われたロスサイクルは4マシンサイクルである
が、本発明を適用しない従来技術では、正しい後続の命
令DiのICステージが実行されるのは、命令Blにつ
いての分岐ヒストリテーブル上の分岐情報を更新するH
Uステージの後のマシンサイクル7の時となり、6マシ
ンサイクルものロスサイクルを費やしてしまう。FIG. 20 shows a case where the subsequent instruction C1 is prefetched according to the branch information on the branch history table for the unconditional branch instruction B1, but the branch destination address specified by the branch information is incorrect. As soon as the branch destination address specified by the instruction is actually determined, a circuit is installed in the OC stage to check whether the branch destination address in the branch information is correct.
Instructed in the OC stage of instruction B1, machine cycle 5
At the point in time, the IC that takes out the correct subsequent instruction Di
stage is running. In this case, the number of lost cycles due to incorrect branch information is 4 machine cycles, but in the conventional technology to which the present invention is not applied, the IC stage of the correct subsequent instruction Di is executed based on the branch history for instruction Bl. H to update branch information on the table
It is machine cycle 7 after the U stage, and 6 machine cycles are lost.
以上説明したように、分岐先アドレスの誤った分岐情報
をもつ分岐命令の実行にあたって、本発明により、従来
技術に比べ少ないロスサイクルを費やすだけで、正しい
後続の命令先取り動作を行なうことができるという効果
がある。As explained above, when executing a branch instruction with incorrect branch information for a branch destination address, the present invention makes it possible to correctly prefetch the subsequent instruction with fewer loss cycles compared to the conventional technology. effective.
第1図は本発明の一実施例のブロック図、第2図は第1
図の分岐ヒストリテーブル410の実施例のブロック図
、
第3図は第2図の記憶部501および502の記憶形式
を示す図、
第4図は第2図のテスト回路503〜506の実施例の
ブロック図、
第5図は第1図の命令記憶回路408における命令語の
配列の一例を示す図、
第6図は第2図のプライオリティ回路507の実施例の
ブロック図、
第7図は第1図における分岐情報バッファ413゜およ
び分岐情報レジスタ416の格納形式を示す図、第8図
は第1図における分岐情報レジスタ417〜420の格
納形式を示す図、
第9図は第1図の命令記憶回路408における命令語と
分岐ヒストリテーブル410における分岐情報との対応
関係を説明するための図、
第10図は第9図の分岐ヒストリテーブル410による
命令先取り動作を説明するための図、第11図は第1図
のOAステージ予測確認回路424の実施例のブロック
図、
第12図は第1図のOTステージ予測確認回路425の
実施例のブロック図、
第13図は第1図のOCステージ予測確認回路426の
実施例のブロック図、
第14図は第1図のEXステージ予測確認回路427の
実施例のブロック図、
第15図は第1図の命令先取り制御回路423の実施例
のブロック図、
第16図は命令の処理の流れの概要を示す図、第17図
は分岐命令でない命令に対応する分岐情報が分岐ヒスト
リテーブルに登録されていてその誤った分岐情報に従っ
て命令先取りが行なわれた場合の動作を説明するための
タイムチャート、第18図は無条件分岐命令あるいは実
際には分岐を行なうBCT命令の実行において対応する
分岐情報が分岐ヒストリテーブルに登録されていない場
合の動作を説明するためのタイムチャート、第19図は
実際には分岐を行なわないBCT命令に対応する分岐情
報が分岐ヒストリテーブルに登録されていて、その分岐
情報に従って命令先取りが行なわれた場合の動作を説明
するためのタイムチャート、
第20図は無条件分岐命令あるいは実際に分岐を行なう
条件分岐命令に対応する分岐情報が分岐ヒストリ・テー
ブルに登録されていて、その分岐情報に従って命令先取
りを行なったところ、その分岐情報の示す分岐先アドレ
スが誤っていた場合の動作を説明するためのタイムチャ
ートおよび、第21図は実際には分岐を行なわない条件
分岐命令に対応する分岐情報が分岐ヒストリテーブルに
登録されていて、その分岐情報に従って命令先取りを行
なったところ分岐情報の示す分岐情報の示す分岐先アド
レスが誤っていた場合の動作を説明するためのタイムチ
ャートである。
第1図〜第21図において、
401・・・命令アドレス生成回路
402・・・命令アドレス変換回路
403・・・命令解読回路
404・・・オペランドアドレス生成回路405・・・
オペランドアドレス変換回路406・・・オペランド読
出し回路
407・・・命令実行回路、408・・・命令記憶回路
409・・・命令バッファ
410・・・分岐ヒストリテーブル(BHT)411・
・・命令アドレスレジスタ
412・・・命令アドレス加算回路
413・・・分岐情報バッファ、414・・・命令整列
回路415・・・分岐情報切換回路
416・・・分岐情報レジスタ (QRO)417・・
・分岐情報レジスタ(QRI)418・・・分岐情報レ
ジスタ (QR2)419・・・分岐情報レジスタ(Q
R3)420・・・分岐情報レジスタ(QR4)421
.422・・・選択回路、423・・・命令先取り制御
回路424・・・OAステージ予測確認回路425・・
・OTステージ予測確認回路426・・・OCステージ
予測確認回路427・・・EXステージ予測確認回路4
28・・・命令アドレスリカバレジスタ430.431
,432・・・アドレス生成回路433・・・比較回路
、434.435・・・レジスタ436.437.43
8,439,440,441・・・フリップフロップ5
01.502・・・記憶部
503.504,505,506・・・テスト回路50
7・・・プライオリティ回路、508・・・選択回路5
09・・・オア回路、601,602,603.604
・・・アンド回路605.606,607.608・・
・オア回路、701・・・−数回路702・・・大小比
較回路、703・・・アンド回路1101.1102・
・・フリップフロップ1103・・・ノット回路、11
04・・・アンド回路1201.1202.1203.
1204・・・フリップフロップ1206、1207・
・・真偽回路
1208、1209.1210・・・アンド回路121
1.1212.1213・・・オア回路1301、13
02・・・レジスタ、1303・・・フリップフロップ
1306・・・比較回路、1307・・・真偽回路13
08・・・アンド回路、1309.1310・・・オア
回路1401・・・フリップフロップ
1402、1403.1404・・・真偽回路1405
、1406・・・ナンド回路
1407、1408・・・アンド回路、1409・・・
オア回路1501・・・フリップフロップ
1502、1503.1504.1505.1506.
1507・・・真偽回路1508.1509,1510
.1511,1512.1513,1514.1515
,1516゜1517、1518・・・アンド回路。FIG. 1 is a block diagram of one embodiment of the present invention, and FIG. 2 is a block diagram of an embodiment of the present invention.
3 is a diagram showing the storage format of the storage units 501 and 502 in FIG. 2. FIG. 4 is a block diagram of an embodiment of the branch history table 410 in FIG. Block diagram: FIG. 5 is a diagram showing an example of the arrangement of instruction words in the instruction storage circuit 408 of FIG. 1; FIG. 6 is a block diagram of an embodiment of the priority circuit 507 of FIG. 2; 8 is a diagram showing the storage format of the branch information registers 417 to 420 in FIG. 1, and FIG. 9 is a diagram showing the storage format of the branch information register 413 in FIG. 1. FIG. 10 is a diagram for explaining the correspondence between instruction words in the circuit 408 and branch information in the branch history table 410. FIG. 10 is a diagram for explaining the instruction prefetching operation by the branch history table 410 in FIG. 9. FIG. is a block diagram of an embodiment of the OA stage prediction confirmation circuit 424 in FIG. 1, FIG. 12 is a block diagram of an embodiment of the OT stage prediction confirmation circuit 425 in FIG. 1, and FIG. 13 is a block diagram of an embodiment of the OT stage prediction confirmation circuit 425 in FIG. FIG. 14 is a block diagram of an embodiment of the confirmation circuit 426; FIG. 14 is a block diagram of an embodiment of the EX stage prediction confirmation circuit 427 in FIG. 1; FIG. 15 is a block diagram of an embodiment of the instruction prefetch control circuit 423 in FIG. , Figure 16 is a diagram showing an overview of the instruction processing flow, and Figure 17 shows a case where branch information corresponding to an instruction that is not a branch instruction is registered in the branch history table, and the instruction is prefetched according to the incorrect branch information. Figure 18 is a time chart for explaining the operation in the case where the corresponding branch information is not registered in the branch history table in the execution of an unconditional branch instruction or a BCT instruction that actually branches. Figure 19 is a time chart for explaining the operation when branch information corresponding to a BCT instruction that does not actually branch is registered in the branch history table and instructions are prefetched according to the branch information. The time chart in Figure 20 shows that branch information corresponding to an unconditional branch instruction or a conditional branch instruction that actually branches is registered in the branch history table, and when an instruction is prefetched according to the branch information, the branch A time chart for explaining the operation when the branch destination address indicated by the information is incorrect, and FIG. 21 show that branch information corresponding to a conditional branch instruction that does not actually branch is registered in the branch history table. , is a time chart for explaining an operation when an instruction is prefetched according to the branch information and the branch destination address indicated by the branch information is incorrect. 1 to 21, 401...Instruction address generation circuit 402...Instruction address conversion circuit 403...Instruction decoding circuit 404...Operand address generation circuit 405...
Operand address conversion circuit 406... Operand read circuit 407... Instruction execution circuit, 408... Instruction storage circuit 409... Instruction buffer 410... Branch history table (BHT) 411...
...Instruction address register 412...Instruction address addition circuit 413...Branch information buffer, 414...Instruction alignment circuit 415...Branch information switching circuit 416...Branch information register (QRO) 417...
・Branch information register (QRI) 418... Branch information register (QR2) 419... Branch information register (Q
R3) 420...Branch information register (QR4) 421
.. 422... Selection circuit, 423... Instruction prefetch control circuit 424... OA stage prediction confirmation circuit 425...
・OT stage prediction confirmation circuit 426...OC stage prediction confirmation circuit 427...EX stage prediction confirmation circuit 4
28...Instruction address recovery register 430.431
, 432...Address generation circuit 433...Comparison circuit, 434.435...Register 436.437.43
8,439,440,441...Flip-flop 5
01.502... Storage section 503.504, 505, 506... Test circuit 50
7... Priority circuit, 508... Selection circuit 5
09...OR circuit, 601, 602, 603.604
...AND circuit 605.606,607.608...
・OR circuit, 701...-number circuit 702...size comparison circuit, 703...AND circuit 1101.1102・
...Flip-flop 1103...Knot circuit, 11
04...AND circuit 1201.1202.1203.
1204...Flip-flop 1206, 1207.
...Truth circuit 1208, 1209.1210...AND circuit 121
1.1212.1213...OR circuit 1301, 13
02...Register, 1303...Flip-flop 1306...Comparison circuit, 1307...Truth/False circuit 13
08...AND circuit, 1309.1310...OR circuit 1401...flip-flop 1402, 1403.1404...truth circuit 1405
, 1406... NAND circuit 1407, 1408... AND circuit, 1409...
OR circuit 1501...Flip-flop 1502, 1503.1504.1505.1506.
1507...Truth circuit 1508.1509,1510
.. 1511, 1512.1513, 1514.1515
, 1516° 1517, 1518...AND circuit.
Claims (1)
令のアドレスを指定する情報と該分岐命令の分岐先アド
レスを含む分岐情報とを対にして複数対記憶する分岐ヒ
ストリテーブル手段と、命令先取り動作を行なう際に該
命令先取り動作において先取りされる命令のアドレスを
指定する情報が前記分岐ヒストリテーブル手段に登録さ
れているか否かを調べる第1の点検手段と、 前記先取りされた命令に対応する分岐情報に含まれる分
岐先アドレスを指定する情報が正しいかどうかを該先取
りされた命令の分岐条件の判定に先立って調ベる第2の
点検手段と、 前記第1の点検手段による登録の判明に応答して前記分
岐ヒストリテーブル手段から対応する分岐情報を読出し
該分岐情報に従って命令先取り動作を継続せしめるよう
制御し、且つ、前記第1および第2の点検手段の結果に
応答して誤った分岐先アドレスを指定する分岐情報に従
って命令先取り動作が行なわれた時には前記先取りされ
た命令の実行を待たずに後続の誤った命令先取り動作を
是正せしめるよう制御する命令先取り制御手段とを具備
したことを特徴とする命令先取り装置。[Scope of Claims] In an instruction prefetching device in an information processing device, branch history table means stores 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; a first checking means for checking whether information specifying an address of an instruction to be prefetched in the instruction prefetching operation is registered in the branch history table means when performing an instruction prefetching operation; a second checking means for checking whether the information specifying the branch destination address included in the corresponding branch information is correct before determining the branch condition of the prefetched instruction; and registration by the first checking means. control to read corresponding branch information from the branch history table means and continue the instruction prefetching operation according to the branch information in response to the result of the first and second checking means; and instruction prefetch control means for controlling a subsequent erroneous instruction prefetch operation to be corrected without waiting for execution of the prefetched instruction when an instruction prefetch operation is performed in accordance with branch information specifying a branch destination address. An instruction prefetching device characterized by:
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP32586A JPS62159232A (en) | 1986-01-07 | 1986-01-07 | Instruction prefetching device |
EP87100055A EP0229619B1 (en) | 1986-01-07 | 1987-01-05 | Instruction prefetching device comprising a circuit for checking prediction for a branch instruction before the instruction is executed |
US07/000,427 US4853840A (en) | 1986-01-07 | 1987-01-05 | Instruction prefetching device including a circuit for checking prediction of a branch instruction before the instruction is executed |
DE3752100T DE3752100T2 (en) | 1986-01-07 | 1987-01-05 | Instruction prefetcher having a circuit for checking the prediction of a branch instruction before it is executed |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP32586A JPS62159232A (en) | 1986-01-07 | 1986-01-07 | Instruction prefetching device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS62159232A true JPS62159232A (en) | 1987-07-15 |
Family
ID=11470750
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP32586A Pending JPS62159232A (en) | 1986-01-07 | 1986-01-07 | Instruction prefetching device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS62159232A (en) |
-
1986
- 1986-01-07 JP JP32586A patent/JPS62159232A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4827402A (en) | Branch advanced control apparatus for advanced control of a branch instruction in a data processing system | |
US4476525A (en) | Pipeline-controlled data processing system capable of performing a plurality of instructions simultaneously | |
EP0205809B1 (en) | Vector processing | |
CA1324671C (en) | Decoding multiple specifiers in a variable length instruction architecture | |
JPH0283735A (en) | Instruction prefetching device | |
EP0352935B1 (en) | Pipelined processor | |
EP0394624B1 (en) | Multiple sequence processor system | |
JPH0429093B2 (en) | ||
JPS62221036A (en) | Calculator | |
EP0357188B1 (en) | Pipelined processor | |
JPH0562390B2 (en) | ||
EP0094535B1 (en) | Pipe-line data processing system | |
KR930003124B1 (en) | Apparatus for the control of branch instruction in pipeline system | |
JPS62159230A (en) | Instruction prefetching device | |
JPS62159232A (en) | Instruction prefetching device | |
JPH046983B2 (en) | ||
JPH01183737A (en) | Information processor | |
JPS62159231A (en) | Instruction prefetching device | |
JPS62159228A (en) | Instruction prefetching device | |
JPS60175148A (en) | Instruction prefetching device | |
JPS62159233A (en) | Instruction prefetching device | |
JPS62159229A (en) | Instruction prefetching device | |
US6081886A (en) | Holding mechanism for changing operation modes in a pipelined computer | |
JPS5991552A (en) | Instruction prefetch device having set associative type history table | |
JPH0248733A (en) | information processing equipment |