JPS62159230A - Instruction prefetching device - Google Patents

Instruction prefetching device

Info

Publication number
JPS62159230A
JPS62159230A JP32386A JP32386A JPS62159230A JP S62159230 A JPS62159230 A JP S62159230A JP 32386 A JP32386 A JP 32386A JP 32386 A JP32386 A JP 32386A JP S62159230 A JPS62159230 A JP S62159230A
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.)
Granted
Application number
JP32386A
Other languages
Japanese (ja)
Other versions
JPH0695306B2 (en
Inventor
Toshiteru Shibuya
渋谷 俊輝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP61000323A priority Critical patent/JPH0695306B2/en
Priority to DE3752100T priority patent/DE3752100T2/en
Priority to US07/000,427 priority patent/US4853840A/en
Priority to EP87100055A priority patent/EP0229619B1/en
Publication of JPS62159230A publication Critical patent/JPS62159230A/en
Publication of JPH0695306B2 publication Critical patent/JPH0695306B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To perform quickly a correct instruction prefetching action by correcting the following wrong instruction prefetching action before the end of the branch deciding step of an instruction in case a wrong instruction prefetching action is carried out with a branch address. CONSTITUTION:It is checked whether the information designating the address of an instruction to be prefetched is registered to a branch history table 410 or not after the address of an instruction different from a branch instruction is set to an instruction address register 411. If said information is registered to the table 410, an instruction prefetching action is carried out according to the branch information read out of the table 410. While an instruction decoding circuit 403 checks whether the prefetched instruction is equal to a branch instruction or not. If a wrong instruction prefetching action is carried out according to a branching address even though no branch instruction is available, an instruction prefetching control circuit 423 corrects immediately the following wrong instruction prefetching action by means of the estimation failure signal outputted from an operand address OA estimation confirming circuit 424.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、情報処理装置の命令シーケンスのステップに
含まれる分岐条件判定ステップ実行処理に先立って判定
結果を予測しつつ次の命令の先取りを行なう命令先取り
装置に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention predicts the judgment result prior to execution processing of the branch condition judgment step included in the step of the instruction sequence of an information processing device and preempts the next instruction. The present invention relates to an instruction prefetching device.

〔従来の技術〕[Conventional technology]

従来、分岐ヒストリテーブルを用いて分岐予測を行なう
命令先取り装置としては、例えば特開昭59−9155
0号公報に見られる装置が存在する。この従来装置は分
岐命令の7ドレスを指定する情報とその分岐命令の分岐
先アドレスを含む分岐情報とを対にして分岐ヒストリテ
ーブルに登録しておき、命令先取り動作としてキャッシ
ュメモリから命令を取出す時に、先取りする命令のアド
レスが分岐命令のアドレスとして分岐ヒストリテーブル
に登録されているか否かを調べ、登録されていれば対応
する分岐先アドレスを用いて次の命令先取り動作を行な
うよう制御するもので、分岐ヒストリテーブルに登録さ
れた情報が誤っていた場合には、その命令の分岐条件の
判定を行った後に分岐ヒストリテーブルの対応する情報
を更新し、その後に後続の命令の先取りをやり直すよう
構成されている。
Conventionally, as an instruction prefetch device that performs branch prediction using a branch history table, for example, Japanese Patent Laid-Open No. 59-9155
There is a device as seen in Publication No. 0. In this conventional device, information specifying the 7 addresses of a branch instruction and branch information including the branch destination address of the branch instruction are registered as a pair in a branch history table, and when the instruction is fetched 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 corresponding information in the branch history table is updated after determining the branch condition of that instruction, and then the prefetching of the subsequent instruction is re-performed. has been done.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

前記の従来技術においては、頻繁に発生するキャッシュ
メモリの書換え等によって分岐ヒストリテーブルの内容
が古くなって、キャッシュメモリから取出された命令が
分岐命令でないにもかかわらず、その命令のアドレスに
対応する分岐情報が分岐ヒストリテーブルに登録されて
いて、その分岐先アドレスに従って命令の先取り動作が
行なわれてしまった場合、後続の正しい命令が取り出さ
れるのは、誤った分岐情報を持っていた命令の分岐条件
判定ステップが終了した後のこととなり、分岐命令の高
速処理をめざす分岐ヒストリテーブル技術が逆に他の命
令の処理速度の低下を招いてしまうという欠点がある。
In the above-mentioned conventional technology, the contents of the branch history table become outdated due to frequent cache memory rewriting, etc., and even though the instruction fetched from the cache memory is not a branch instruction, the address of the instruction corresponds to that instruction. If branch information is registered in the branch history table and an instruction is prefetched according to the branch destination address, the subsequent correct instruction will be taken from the branch of the instruction that had incorrect branch information. This occurs after the condition determination step has been completed, and the branch history table technique, which aims at high-speed processing of branch instructions, has the disadvantage that it actually causes a decrease in the processing speed of other instructions.

本発明はこのような従来の欠点を解消したもので、その
目的は、分岐命令でない命令に対する分岐情報が分岐ヒ
ストリテーブルに登録されていたため誤った命令先取り
動作が行われた場合、速やかに正しい後続の命令先取り
動作を行ない得るようにすることにある。
The present invention eliminates these conventional drawbacks, and its purpose is to quickly update the correct successor when an incorrect instruction prefetch operation is performed because branch information for instructions that are not branch instructions is registered in the branch history table. The purpose of the present invention is to enable prefetching of instructions.

〔問題点を解決するための手段〕[Means for solving problems]

本発明の命令先取り装置は、上記目的を達成するために
、情報処理装置における命令先取り装置において、 分岐命令のアドレスを指定する情報と該分岐命令の分岐
先アドレスを含む分岐情報とを対にして複数対記憶する
分岐ヒストリテーブル手段と、命令先取り動作を行なう
際に、該命令先取り動作において先取りされる命令のア
ドレスを指定する情報が前記分岐ヒストリテーブル手段
に登録されているか否かを調べる第1の点検手段と、前
記命令先取り動作によって先取りされた命令が分岐命令
であるか否かを調べる第2の点検手段と、 前記第1の点検手段による登録の判明に応答して、前記
分岐ヒストリテーブル手段から対応する分岐情報を読出
し該分岐情報に従って命令先取り動作を継続せしめるよ
う制御し、且つ前記第1および第2の点検手段の結果に
応答して分岐命令でもないのに登録されていた分岐先ア
ドレスに従って誤った命令先取り動作が行なわれた時に
は、前記先取りされた命令の分岐条件判定ステップの終
了を待たずに後続の誤った命令先取り動作を是正せしめ
るよう制御する命令先取り制御手段とを備える。
In order to achieve the above object, the instruction prefetching device of the present invention pairs information specifying the address of a branch instruction with branch information including the branch destination address of the branch instruction in the instruction prefetching device in an information processing device. A branch history table means for storing a plurality of pairs, and a first step 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 instruction prefetched by the instruction prefetching operation is a branch instruction; and a second checking means for checking whether the instruction prefetched by the instruction prefetching operation is a branch instruction; Reads the corresponding branch information from the means, controls to continue the instruction prefetch operation according to the branch information, and in response to the results of the first and second checking means, checks the branch destination that was registered even though it was not a branch instruction. The instruction preemption control means is provided for controlling to correct the subsequent erroneous instruction prefetching operation without waiting for the completion of a branch condition determination step of the prefetched instruction when an erroneous instruction prefetching operation is performed according to an address.

〔作用〕[Effect]

命令先取り動作によって先取りされた命令が分岐命令で
ないにもかかわらず、その命令のアドレスに対応する分
岐情報が分岐ヒストリテーブル手段に登録されていて、
その分岐先アドレスに従って誤った命令先取り動作が行
なわれると、命令先取り制御手段は、命令の分岐条件判
定ステップの終了を待たずに後続の誤った命令先取り動
作を是正する。
Although the instruction prefetched by the instruction prefetch operation is not a branch instruction, branch information corresponding to the address of the instruction is registered in the branch history table means,
If an erroneous instruction prefetching operation is performed according to the branch destination address, the instruction prefetching control means corrects the subsequent erroneous instruction prefetching operation without waiting for the completion of the instruction branch condition determination step.

〔実施例〕〔Example〕

次に本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.

第1図を参照すると本発明の一実施例は、命令アドレス
生成回路(IA)401、命令アドレス変換回路(IT
)402、命令解読回路(ID)403、オペランドア
ドレス生成回路(OA) 404 、オペランドアドレ
ス変換回路(○T) 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、。
Referring to FIG. 1, one embodiment of the present invention includes an instruction address generation circuit (IA) 401, an instruction address translation circuit (IT
) 402, instruction decoding circuit (ID) 403, operand address generation circuit (OA) 404, operand address conversion circuit (○T) 405, operand reading circuit with operand storage circuit (○C) 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.

Aステージ予711!I確認回路424、OTステージ
予測確認回路425、OCステージ予測lit認回路4
26、EXステージ予測確認回路427、命令アドレス
リカバレジスタ428、アドレス生成回路430,43
1,432゜比較回路433、レジスタ434,435
 、フリップフロップ436,437,438,439
,440,441から構成されている。
A stage preparation 711! I confirmation circuit 424, OT stage prediction confirmation circuit 425, OC stage prediction lit confirmation circuit 4
26, EX stage prediction confirmation circuit 427, instruction address recovery register 428, address generation circuit 430, 43
1,432° comparison circuit 433, registers 434, 435
, flip-flops 436, 437, 438, 439
, 440, 441.

なお、分岐ヒストリテーブル410が分岐ヒストリテー
ブル手段及び第1の点検手段*1を構成し、命令解読回
路403が第2の点検手段*2を構成し、命令先取り制
御回路423とOAXステージ予測確認回路424命令
先取り制御手段を構成する。
Note that the branch history table 410 constitutes the branch history table means and the first inspection means *1, the instruction decoding circuit 403 constitutes the second inspection means *2, and the instruction prefetch control circuit 423 and the OAX stage prediction confirmation circuit 424 instruction prefetch control means.

命令記憶回路408およびオペランド読出し回路406
内のオペランド記憶回路は共に主記憶装置そのものであ
ってもよく、さらに命令記憶回路408が主記憶装置の
命令部の一部の写しである命令キャツシュメモリ5前記
オペランド記憶回路が主記憶装置のオペランド部の一部
の写しであるオペランドキャッシュメモリとして構成し
ても良い。
Instruction storage circuit 408 and operand read circuit 406
Both of the operand storage circuits in the instruction cache memory 5 may be the main memory itself, and the instruction storage circuit 408 is a copy of a part of the instruction section of the main memory. It may also be configured as an operand cache memory that is a copy of a portion of the section.

本発明は前述の命令の処理単位に対応した装置構成を必
ずしも有する必要はなく、例えば命令アドレス生成回路
401 とオペランドアドレス生成回路404.命令ア
ドレス変換回路402とオペランドアドレス変換回路4
05.命令記憶回路408とオペランド読出し回路40
6内の記憶回路が共用されたコンビュータンステムにお
いても適用され得る。
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 storage circuit 408 and operand reading circuit 40
The present invention can also be applied to a converter system in which the memory circuits within the 6 are shared.

第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 the instruction read request address and executes the instruction successive output operation.

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

命令アドレス加算回路412は1回のリクエストで読出
される命令語を8Byteと仮定したとき単に“IAR
+8″を出力107に生成する回路である。命令バッフ
ァ409は、命令記憶回路408から読出された8By
teの先取り命令語を蓄積し命令処理部への命令の供給
における待ち行列(Q ueue)を形成する。命令整
列回路414は、命令バッファ409が空のとき信号線
102を介して命令記憶回路408から読み出される。
The instruction address addition circuit 412 simply adds “IAR” when assuming that the instruction word read in one request is 8 bytes.
This is a circuit that generates +8″ as the output 107.
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 is read from the instruction storage circuit 408 via the signal line 102 when the instruction buffer 409 is empty.

8Byteの命令語に対応して、また命令バッファ40
9が空でないとき信号線103を介して前記命令バッフ
ァに貯えられる8Byteの命令語に対応してそれぞれ
命令を抽出して信号線104を介して命令解読回路40
3に命令を供給する回路である。
Corresponding to the 8-byte instruction word, an instruction buffer 40 is also provided.
9 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 line 104.
This is a circuit that supplies instructions to 3.

命令解読回路403は信号線104を介して命令語が与
えられると、その命令語長を信号線112を介して分岐
情報レジスタ417へ報告するとともに、その命令が分
岐命令(無条件分岐命令1条件分岐命令など分岐動作を
行ない得る命令)であるか否かを信号線113を介して
OAXステージ予測確認回路424報告し、さらに、そ
の命令が無条件分岐命令であるか否かと、計数分岐命令
(Branch oncount命令:以降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 1 condition). The OAX stage prediction confirmation circuit 424 reports via the signal line 113 whether the instruction is an instruction that can perform a branch operation such as a branch instruction, and further reports whether the instruction is an unconditional branch instruction or not and whether the instruction is a counting branch instruction ( It has a function of notifying the register 435 via the signal line 114 whether or not it is a branch oncount instruction (hereinafter referred to as a BCT instruction).

分岐情報バッファ413は、命令バッファ409に格納
される命令語に対して用意されておりその命令語中に分
岐成功と予測された分岐命令が存在すれば、第7図に示
す該分岐命令の分岐情報を格納する回路であり、分岐命
令のアドレスは信号線101を介して、また分岐情報と
しての分岐先アドレスおよびVビットは分岐ヒストリテ
ーブル(BHT)410から信号線105を介してそれ
ぞれセントされ、分岐成功と予測さた分岐命令が存在し
なければ、Vビットは0に、命令アドレスは信号線10
1を介してそれぞれセットされる。
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. It is a circuit for storing information, and the address of a branch instruction is sent via a signal line 101, and the branch destination address and V bit as branch information are sent from a branch history table (BHT) 410 via a signal line 105. If there is no branch instruction predicted as a successful branch, the V bit is set to 0 and the instruction address is set to signal line 10.
1 respectively.

分岐情報切換回路415は、命令バッファ409が空の
とき信号線101および105を介して与えられる前記
分岐情報を、そうでないときは分岐情報バッファ413
を介して与えられる前記分岐情報をそれぞれ出力する。
The branch information switching circuit 415 transfers the branch information provided via the signal lines 101 and 105 when the instruction buffer 409 is empty, and transfers the branch information to the branch information buffer 413 when the instruction buffer 409 is empty.
The branch information given through the respective branch information is output.

レジスタ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.

OAステージ予測確認回路424は、命令解読回路40
3で解読した命令が分岐命令でないのに、対応する分岐
情報が分岐ヒストリテーブルから続出されたか否かを検
出する回路であり、信号線113を介して命令の解読結
果を、信号線115を介して分岐情報レジスタ416の
保持する■ビットをそれぞれ受取り、分岐命令でないの
に■ビットが1である時にはOAステージ予測失敗信号
を信号線121を介して命令先取り制御回路423とフ
リップフロップ436へ出力する。
The OA stage prediction confirmation circuit 424 is the instruction decoder circuit 40
This circuit detects whether or not the corresponding branch information has been repeatedly output from the branch history table even though the instruction decoded in step 3 is not a branch instruction. receives the ■ bit held in the branch information register 416, and when the ■ bit is 1 even though it is not a branch instruction, outputs an OA stage prediction failure signal to the instruction prefetch control circuit 423 and flip-flop 436 via the signal line 121. .

比較回路433は、信号線120を介して与えられる計
数値と値“l”を比較し、計数値が1であれば計数値l
信号を信号線123を介してOTステージ予測確認回路
425へ出力する。
The comparison circuit 433 compares the count value given via the signal line 120 with the value "l", and if the count value is 1, the count value l
The signal is output to the OT stage prediction confirmation circuit 425 via the signal line 123.

OTステージ予fill確認回路425は、OAステー
ジ予測確認回路424の出力するOAステージ予測失敗
信号を保持するフリップフロップ436の出力。
The OT stage prefill 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の出力す
る計数値1信号、および分岐情報レジスタ418の保持
するvビットより、無条件分岐命令なのに対応する分岐
情報のVビットがOである時、およびBCT命令で且つ
計数値l信号が出力されない即ち分岐を行なう時なのに
対応する分岐情報の■ビットがOである時には、信号線
129を介して命令先取り制御回路423へ○Tステー
ジ予測失敗信号を、信号線130を介してフリップフロ
ップ437へOTステージBHT更新指示信号を、信号
線131を介してフリップフロップ438と選択回路4
21へOTステージGo先取り指示信号をそれぞれ出力
し、BCT命令で且つ計数値1信号が出力された、即ち
、分岐を行なわない時なのに対応する分岐情報の■ビッ
トが1である時には、信号線129と信号線130へそ
れぞれOTステージ予測失敗信号とOTステージBHT
更新指示信号を出力する。
From the output of the register 435 that holds whether the instruction is an unconditional branch instruction or a BCT instruction, the count value 1 signal output from the comparator circuit 433, and the v bit held by the branch information register 418, even though it is an unconditional branch instruction, When the V bit of the corresponding branch information is O, and when the ■ bit of the corresponding branch information is O even though it is a BCT instruction and the count value l signal is not output, that is, when a branch is executed, ○T stage prediction failure signal to instruction prefetch control circuit 423, OT stage BHT update instruction signal to flip-flop 437 via signal line 130, flip-flop 438 and selection circuit 4 via signal line 131
21, and when the BCT instruction and the count value 1 signal are output, that is, when the corresponding branch information bit is 1 even though no branching is performed, the signal line 129 and the OT stage prediction failure signal and OT stage BHT to the signal line 130, respectively.
Outputs an update instruction signal.

選択回路421は、OTステージ予測確認回路425の
出力する○TステージGo先取り指示信号が1である時
は命令アドレス変換回路402の出力する分岐先アドレ
スを、0である時はアドレス生成回路431の出力する
分岐N0GO側のアドレスを選択する。
The selection circuit 421 selects the branch destination address output from the instruction address conversion circuit 402 when the ○T stage Go prefetch instruction signal output from the OT stage prediction confirmation circuit 425 is 1, and selects the branch destination address output from the instruction address conversion circuit 402 when it is 0. Select the address on the branch N0GO side to output.

oCステージ予測確認回路426は、OTステージBH
T更新指示信号を保持するフリップフロップ437の出
力、OTステージGO先取り指示信号を保持するフリッ
プフロップ438の出力、命令アドレス変換回路402
の出力する分岐先アドレス。
The oC stage prediction confirmation circuit 426
The output of the flip-flop 437 that holds the T update instruction signal, the output of the flip-flop 438 that holds the OT stage GO prefetch instruction signal, and the instruction address conversion circuit 402.
Branch destination address to output.

及び分岐情報レジスタ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の出
力、OCステージGO先取り指示信号を保持するフリッ
プフロップ440の出力1分岐情報レジスタ419の保
持するVビット、及び命令実行回路407の出力する分
岐成否信号より、実際の分岐成否とVビットが異なり、
且つ、OCステージ以前の予測失敗の検出にともなう先
取りのやり直しが行なわれていない時には、信号線14
7を介して命令先取り制御回路423へEXステージ予
測失敗信号を、また、信号vA148を介して同じく命
令先取り制御回路423とフリップフロップ441へE
XステージBHT更新指示信号を出力する。
EX stage prediction confirmation circuit 427 performs OC stage BH
From the output of the flip-flop 439 that holds the T update instruction signal, the output of the flip-flop 440 that holds the OC stage GO prefetch instruction signal, the V bit held by the 1 branch information register 419, and the branch success/failure signal output from the instruction execution circuit 407. , the actual branch success/failure and the V bit are different,
In addition, when the prefetching is not performed again due to the detection of a prediction failure before the OC stage, the signal line 14 is
7 to the instruction prefetch control circuit 423, and also to the instruction prefetch control circuit 423 and flip-flop 441 via the signal vA148.
Outputs an X stage BHT update instruction signal.

選択回路422は分岐成否信号線149の状態に応答し
て該信号線の状態が分岐GOを示すとき、信号線152
を介して与えられる分岐情報レジスタ420の保持する
分岐先アドレスを選択し、分岐N0GOを示す時には信
号線153を介して与えられるアドレス生成回路432
の出力を選択し、その出力を信号線155を介してレジ
スタ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 line 155.

レジスタ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 write address for the instruction has been set.

命令先取り制御回路423ハ、信号m121,129.
140゜147を介してそれぞれ与えられるOA、OT
、OC,EX各ステージの予測失敗信号、及び信号線1
48を介して与えられるEXステージBIT更新指示信
号に基づいて、命令アドレスレジスタ(IAR)411
の入力と、命令アドレスリカバレジスタ426の入力と
を制御する回路である。
Instruction prefetch control circuit 423c, signals m121, 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 BIT update instruction signal given via 48, the instruction address register (IAR) 411
This circuit controls the input of the instruction address recovery register 426 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.

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

+311cステージ:変換された命令の実アドレスで記
憶装置から命令が読出さ れる。
+311c stage: The instruction is read from the storage device at the translated 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.

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

+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ステージの命令お
よびオペランドの続出し動作において主記憶装置のデー
タの一部の写しを保持するキャッシュメモリを設は必要
な命令およびオペランドが該キャッシュメモリに存在す
ればICステージおよびOCステージの処理は高速に行
ない得る。
In addition, in the above-mentioned IC stage and OC stage instruction and operand retrieval operations, a cache memory that holds a copy of part of the data in the main memory is provided, and if the necessary instructions and operands exist in the cache memory, the IC stage Processing of stages and OC stages can be done quickly.

上述(7)IT、OTおよびIC,QC(7)各ステー
ジの高速処理が可能なとき、複数の命令の処理の流れを
無駄なく実行する8段のパイプライン制御が可能である
(7) IT, OT, IC, QC (7) When high-speed processing at each stage is possible, eight-stage pipeline control is possible to efficiently execute the processing flow of multiple instructions.

次に分岐ヒストリテーブル(BHT) 410 、 O
A、OT、QC,EX各ステージの予測確認回路424
.425,426.427および命令先取り制御回路4
23のブロック図とタイムチャートを参照しながら本実
施例の動作を詳細に説明する。
Next, branch history table (BHT) 410, O
Prediction confirmation circuit 424 for each stage of A, OT, QC, EX
.. 425, 426, 427 and instruction prefetch control circuit 4
The operation of this embodiment will be described in detail with reference to the block diagram and time chart of No. 23.

第2図を参照すると分岐ヒストリテーブル(BHT)4
10は、ディレクトリ記憶部501、データ記憶部50
2、テスト回路503,504,505,506 、プ
ライオリティ回路507、レベル選択回路508、およ
びオア回路509を備えている。記憶部501および5
02は、1回のリクエストに対して命令記憶回路408
から続出される命令語の単位をブロックの単位とし、セ
ット数m、レベル数nの記憶部である。
Referring to Figure 2, branch history table (BHT) 4
10, a directory storage section 501, a data storage section 50;
2, test circuits 503, 504, 505, 506, a priority circuit 507, a level selection circuit 508, and an OR circuit 509. Storage units 501 and 5
02 is the instruction storage circuit 408 for one request.
The unit of instruction words successively issued from the block is a unit of block, and the storage unit has m sets and n levels.

第3図を参照すると、記憶部501には分岐命令の命令
アドレスの一部とその内容が有効か否かを示すVビット
が格納され、記憶部502には分岐先アドレスの実アド
レスが格納されている。前記■ピントは対応する分岐ヒ
ストリテーブル(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 ■ pinto indicates the validity of the word in the corresponding branch history table (BHT) 410, and at the same time has the function of 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 、50
5及び506はテーブル410の各レベルに対応して命
令アドレスレジスタ(IAR)411に保持されるリク
エストアドレスが各レベルのBHT−AAi  (iは
レベルに対応するサフィクスを示す)に登録されている
か否かを示す信号を信号線1130.1131゜113
2、1133に出力する。第4図を参照すると、テスト
回路503,504.505および506のそれぞれは
、−数回路701および大小比較回路702から構成さ
れている。
Test circuits 503, 504, 50 shown in FIG.
5 and 506 indicate whether the request address held in the instruction address register (IAR) 411 corresponding to each level of the table 410 is registered in the BHT-AAi (i indicates a suffix corresponding to the level) of each level. The signal indicating the
2, output to 1133. Referring to FIG. 4, each of the test circuits 503, 504, 505, and 506 includes a minus number circuit 701 and a magnitude comparison circuit 702.

前記−数回路701では、命令アドレスレジスフ(IA
R)411に保持されるリクエストアドレスの一部[A
R(: 4−17)をセットアドレスとして続出された
記憶部501の各レベルの内容と前記レジスタ411の
内容IAR(: 4−17)とが比較され、等しいアド
レスが存在するが否かを検出する。−数回路701の出
力により命令アドレスレジスタ(IAR)411に保持
されるリクエストアドレスで続出されるべき命令語の8
Byteブロツク中にすでに分岐ヒストリテーブル(B
HT)4]0に登録された分岐命令が存在するか否かが
判明する。しかしリクエストアドレスとそれが読出すべ
き分岐命令との対応をとるには上記一致検出のみでは不
十分である。第5図を参照すると、1回のリクエストで
読出される8Byteの命令語のブロック中に2Byt
e命令BCO,A、BCI。
The minus number circuit 701 inputs an instruction address register (IA
R) Part of the request address held in 411 [A
The contents of each level of the storage unit 501 successively read out using R (: 4-17) as a set address are compared with the contents IAR (: 4-17) of the register 411, and it is detected whether or not an equal address exists. do. - 8 of the instruction words to be successively issued at the request address held in the instruction address register (IAR) 411 by the output of the number circuit 701;
The branch history table (B
HT)4] It is determined whether or not there is a branch instruction registered in 0. 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.
e-instruction BCO, A, BCI.

BO2の4個の命令が存在する。命令BCO,BCl、
BO2が共に分岐成功と予測された分岐命令であるとき
には、各々の分岐命令は共にそのアドレスの一部が記憶
部(BHT−AA)501に登録される。このとき他の
分岐命令がら命令へに分岐して命令Aのアドレス<A>
が前記命令語のブロックを読出すためのリクエストアド
レスとして命令アドレスレジスタ(IAR)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, other branch instructions branch to the instruction A's address <A>.
is held in the instruction address register (IAR) 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.

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

BIT −HIT+ = (TAR(:4 17) =
 BHT−AAi(:4−17) ) n (IAR(:29,30) ≦B)IT−AAi(
:29,30) ) n BIT−AAi(V) 再び第4図を参照すると、前記大小比較回路702は、
この条件を実現する回路である。
BIT - HIT+ = (TAR(:4 17) =
BHT-AAi(:4-17)) n (IAR(:29,30)≦B)IT-AAi(
:29,30) ) n BIT-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−AAi)に保持される分岐命令のアドレス
の8Byteブロツク内アドレスBHT−AA i  
(:29.30) (7)値の最も小さいレベルが選択
される必要がある。再び第5図を参照すると、命令BC
IおよびBO2の分岐命令関係情報が格納される分岐ヒ
ストリテーブル410のレベルで前記信号BHT−HI
Ti条件が共に成立する。このとき命令の実行の経路か
ら命令BC1に対するレベルが選択される必要がある。
Further, when the condition of the signal BHT-HITi is satisfied at two or more levels, the address BHT-AAi in the 8-byte block of the address of the branch instruction held at the corresponding level (BHT-AAi) in the storage section 501
(:29.30) (7) The level with the smallest value needs to be selected. Referring again to FIG. 5, instruction BC
The signal BHT-HI is set at the level of the branch history table 410 in which branch instruction related information of I and BO2 is stored.
Both Ti conditions are satisfied. At this time, the level for the instruction BC1 needs to be selected from the instruction execution path.

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

第6図を参照すると、前記プライオリティ回路507は
アンド回路601〜604およびオア回路605〜60
8から構成されている。アンド回路601〜604はn
+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 n
+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.

voのとき        V、L、、 V6L、、・
、 V、L、IV、・V、(7)とき      Vル
o、 V+L+、 ・・・、 ll+L−V、・ν+’
vzのとき   VzLo、 VtL+、 −、VzL
、lv、 ・L −Vt −Vsノとき Vtl、+、
 lhL+、 −、VsLl1以上のようにして第2図
におけるレベル選択回路508から読出された分岐情報
は第1図の命令記憶回路408から読出される命令と対
応づけることが可能である。
For vo: V, L,, V6L,...
, V, L, IV, ・V, (7) When Vruo, V+L+, ..., ll+L-V, ・ν+'
When vz VzLo, VtL+, -, VzL
, lv, ・L −Vt −Vs Vtl, +,
lhL+, -, VsLl1 The branch information read from the level selection circuit 508 in FIG. 2 in the above manner can be associated with the instruction read from the instruction storage circuit 408 in FIG.

第9図には、命令記憶回路408における命令と分岐ヒ
ストリテーブル(BHT)410における分岐情報の上
記対応関係が示されている。命令の実行順序が命令AO
,分岐命令BCO,B1.BC1、B2.B3.BC2
,CI、C2・・・と予測された場合である。なお、<
A>はA命令のアドレスを、BCjは分岐命令をそれぞ
れ示す。
FIG. 9 shows the above-mentioned correspondence between instructions in the instruction storage circuit 408 and branch information in the branch history table (BHT) 410. Instruction execution order is instruction AO
, branch instruction BCO, B1. BC1, B2. B3. BC2
, CI, C2... In addition, <
A> indicates the address of the A instruction, and BCj indicates a branch instruction.

第10図を参照すると、第9図に示した分岐ヒストリテ
ーブル(BHT)410による命令先取り動作は次のよ
うにされる。リクエストアドレスの命令アドレスレジス
タ411のセットに応答して命令記憶回路408から命
令語が読出され、これと同時にテーブル(BHT)41
0が索引される。信号線106を介してBIT−HIT
信号が出力されると記憶部BHT−DA502の分岐先
アドレス〈B1〉がアドレスレジスタ411にセントさ
れ、次の命令先取りが行なわれる。前記信号線106を
介してBHT−HIT信号が出力されないときには命令
アドレス加算回路412に命令Aの8バイト境界アドレ
ス(A)が与えられ、「8」加算されたアドレスが出力
され、次の命令先取りが逐次行なわれる。
Referring to FIG. 10, the instruction prefetch operation by the branch history table (BHT) 410 shown in FIG. 9 is performed as follows. In response to the setting of the instruction address register 411 of the request address, an instruction word is read from the instruction storage circuit 408, and at the same time, the table (BHT) 41 is read out.
0 is indexed. BIT-HIT via signal line 106
When the signal is output, the branch destination address <B1> of the storage section BHT-DA 502 is written to the address register 411, and the next instruction is prefetched. When the BHT-HIT signal is not output through the signal line 106, the 8-byte boundary address (A) of the instruction A is given to the instruction address addition circuit 412, and the address added by "8" is output, and the next instruction is prefetched. 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) 41B、 (QR3)
419、 (QR4) 420 ヘと転送される。そし
てOA。
Thereafter, as the processing of the branch instruction progresses, the branch information is sequentially transferred to cylinder 2. Third. Fourth and fifth branch information registers (Q
R1) 417. (QR2) 41B, (QR3)
Transferred to 419, (QR4) 420. And OA.

OT、QC,EX各xテージの予測確認回路424゜4
25、426.427によって該分岐命令の実際の実行
処理結果と対応する前記分岐情報とが各ステージ毎にチ
ェックされる。
Prediction confirmation circuit for each x stage of OT, QC, EX 424゜4
25, 426, and 427, the actual execution processing 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とによって、フリップフロップ1101の出力が“0
”で且つフリップフロップ1102の出力が“1”であ
る時、即ち命令を解読した結果、分岐命令ではない命令
なのに対応する分岐情報が存在し、その分岐情報に従っ
て命令先取りが行なわれた時には、信号線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 outputted from the instruction decoding circuit 403 via a signal line 113 and a V bit held by a branch information register (QRO) 416 are set in flip-flops 1101 and 1102, respectively, via a signal line 115. Ru. NOT circuit 1103 and AND circuit 110
4, the output of the flip-flop 1101 becomes “0”.
” and the output of the flip-flop 1102 is “1”, 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.1
203゜1204と真偽回路1206.1207と、ア
ンド回路1208゜1209.1210.およびオア回
路1211,1212.1213とから構成されている
。フリップフロップ1201.1202には、レジスタ
435の保持する無条件ブランチ命令を示すビットと、
BCT命令を示すビットが信号線122を介してそれぞ
れセットされ、フリップフロップ1203には信号線1
23を介して比較回路433の出力する計数値1信号が
セントされ、フリップフロップ1204には分岐情報レ
ジスタ(QRI)の保持するVビットが信号線126を
介してセットされ、オア回路1213には信号線144
を介してOAステージ予測確認回路424が出力し且つ
フリップフロップ436に保持されたOAステージ予測
失敗信号の出力が与えられる。真偽回路1206.12
07.アンド回路120B、 1209.1210によ
ってフリップフロップ1201、1204の出力がそれ
ぞれ“1”、“0”すなわち無条件ブランチ命令である
のに対応する分岐情報が存在しなくて分岐GO側への命
令先取りが行なわれなかったときには、アンド回路12
0日の出力が“1″になり、フリップフロップ1202
.1203゜1204の出力がそれぞれ“1”、“0”
、“0″である時すなわちBCT命令であってそのBC
T命令で指定された汎用レジスタの保持する計数値が“
1”ではなくて分岐を行なうBCT命令であるのに対応
する分岐命令が存在しなくて分岐GO側への先取り動作
が行なわれなかった時にはアンド回路1209の出力が
“1″になり、フリップフロップ1202.1203.
1204の出力が全て“1”の時すなわちBCT命令で
あってそのBCT命令で指定された汎用レジスタの保持
する計数値が“1”であって、分岐を行なわないBCT
命令であるのに対応する分岐情報が存在して分岐Go側
へ命令先取り動作が行なわれた時にはアンド回路121
0の出力が“1″になる。更に、オア回路1211.1
212.1213によって無条件分岐命令あるいは分岐
を行なうBCT命令なのに分岐GO側への命令先取りが
行なわれなかった時には、OTステージGo先取り指示
信号が信号線131に、OTステージ予測失敗信号が信
号線129に、OTステージBIT更新指示信号が信号
線130にそれぞれ出力される。又、分岐を行なわない
BCT命令なのに分岐GO側への命令先取りが行なわれ
た時には、OTステージ予測失敗信号とOTステージB
IT更新指示信号とが出力される。なお、OTステージ
BIT更新指示信号は、OAステージで予測の失敗が検
出され、OAステージ予測確認回路424より、OAス
テージ予測失敗信号がフリップフロップ436にセット
され、その出力が信号vA144を介して与えられた時
にも出力される。
Referring to FIG. 12, the OT stage prediction confirmation circuit 425 includes flip-flops 1201 and 1202.1.
203°1204, truth/false circuits 1206.1207, and AND circuits 1208°1209.1210. and OR circuits 1211, 1212, and 1213. The flip-flops 1201 and 1202 include a bit indicating an unconditional branch instruction held in the register 435, and
Bits indicating the BCT command are set via signal line 122, and flip-flop 1203 has signal line 1.
The count value 1 signal output from the comparator circuit 433 is sent to the flip-flop 1204 via the signal line 126, and the V bit held by the branch information register (QRI) is set to the flip-flop 1204 via the signal line 126. line 144
The output of the OA stage prediction failure signal output from the OA stage prediction confirmation circuit 424 and held in the flip-flop 436 is provided through the OA stage prediction confirmation circuit 424 and held in the flip-flop 436. Truth/False Circuit 1206.12
07. The AND circuits 120B and 1209 and 1210 cause the outputs of the flip-flops 1201 and 1204 to be "1" and "0", respectively, which means that they are unconditional branch instructions, but there is no corresponding branch information, so the instructions to the branch GO side cannot be prefetched. If not, AND circuit 12
The output on day 0 becomes “1” and the flip-flop 1202
.. The outputs of 1203° and 1204 are “1” and “0” respectively.
, "0", that is, it is a BCT instruction and its BC
The count held by the general-purpose register specified by the T instruction is “
If the BCT instruction is not ``1'' but a branch, but 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 flip-flop 1202.1203.
When all the outputs of 1204 are "1", that is, it is a BCT instruction and the count value held in the general-purpose register specified by the BCT instruction is "1", and the BCT does not branch.
When branch information corresponding to an instruction exists and an instruction prefetch operation is performed on the branch Go side, the AND circuit 121
The output of 0 becomes “1”. Furthermore, OR circuit 1211.1
212.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 131, and the OT stage prediction failure signal is sent to the signal line 129. Then, an OT stage BIT update instruction signal is output to the signal line 130, respectively. Also, 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 B
An IT update instruction signal is output. Note that the OT stage BIT update instruction signal is generated when a prediction failure is detected at the OA stage, and the OA stage prediction confirmation circuit 424 sets an OA stage prediction failure signal in the flip-flop 436, and its output is given via the signal vA144. It is also output when the

第13図を参照すると前記OCステージ予測確認回路4
26は、レジスタ1301 、1302.フリップフロ
ツブ1303.不一致を検出する比較回路1306.真
偽回路1307.アンド回路1308およびオア回路1
309.1310より構成されている。レジスタ130
1には、命令アドレス変換回路402より信号線133
を介して与えられる分岐命令の命令語より実際に求めら
れた分岐先アドレスがセットされ、同じくレジスタ13
02には、分岐情報レジスタ(QR2) 418より信
号線137を介して与えられる予測された分岐先アドレ
スがセットされる。フリップフロップ1303には同じ
く分岐情報レジスタ (QR2) 41Bの保持するV
ビットがセットされ、真偽回路1307とオア回路13
10には、OTステージ予測確認回路425が出力した
OTステージBHT更新指示信号と、OTステージGO
先取り指示信号を受けたフリップフロップ437,43
8の出力が、それぞれ信号線157と158を介して与
えられる。比較回路1306と真偽回路1307および
アンド回路1308によって、比較回路1306、フリ
ップフロップ1303の出力、信号線157がそれぞれ
l″、“1”、”o”、即ち、分岐ヒストリテーブルに
対応する分岐情報が存在し、その分岐情報に従って後続
の命令先取りが行なわれたその命令について、OA、O
Tステージの予測確認回路で予測の失敗が検出されてい
なくて、なお且つ、予測された分岐先アドレスが実際の
分岐先アドレスと異なっていた時には、アンド回路13
08の出力が1”になりOCステージ予測失敗信号が信
号線140に出力される。同時にオア回路1309、1
310によってOCステージBHT更新指示信号とOC
ステージGO先取り指示信号がそれぞれ信号線156と
141上に出力される。又、OCステージBHT更新指
示信号とOCステージGO更新指示信号は、それぞれO
Tステージ予測確認回路425より出力されるOTステ
ージBIT更新指示信号とOTステージGO先取り指示
信号とを受けたフリップフロップ437,438の出力
が11”となった時にも出力される。
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 1307. AND circuit 1308 and OR circuit 1
309.1310. register 130
1, the signal line 133 is connected from the instruction address conversion circuit 402.
The branch destination address actually obtained from the instruction word of the branch instruction given via the register 13 is set.
The predicted branch destination address given from the branch information register (QR2) 418 via the signal line 137 is set in 02. The flip-flop 1303 also contains the V held by the branch information register (QR2) 41B.
The bit is set, and the truth/false circuit 1307 and the OR circuit 13
10, the OT stage BHT update instruction signal outputted by the OT stage prediction confirmation circuit 425 and the OT stage GO
Flip-flops 437 and 43 that received the preemption instruction signal
8 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 respectively output l'', "1", and "o", that is, branch information corresponding to the branch history table. exists and the subsequent instruction is prefetched according to the branch information, OA, O
When the prediction confirmation circuit of the T stage has not detected a prediction failure and the predicted branch destination address is different from the actual branch destination address, the AND circuit 13
08 becomes 1" and an OC stage prediction failure signal is output to the signal line 140. At the same time, the OR circuits 1309 and 1
310, the OC stage BHT update instruction signal and the OC
Stage GO preemption instruction signals are output on signal lines 156 and 141, respectively. Further, the OC stage BHT update instruction signal and the OC stage GO update instruction signal are
It is also output when the outputs of the flip-flops 437 and 438 that receive the OT stage BIT update instruction signal and the OT stage GO prefetch instruction signal output from the T stage prediction confirmation circuit 425 become 11''.

第14図を参照すると、前記EXステージ予測確認回路
427は、フリップフロップ1401.真偽1402、
 1403. 1404,論理積の否定を求めるナンド
回路1405, 1406.アンド回路1407, 1
408,及びオア回路1409から構成されている.真
偽回路1402には、信号線149を介して命令実行回
路407の出力する分岐成否信号が与えられ、フリップ
フロップ1401には、分岐情報レジスタ (QR3)
419の保持するVビットがセットされ、ナンド回路1
405. 1406およびオア回路1409につながる
信号線159には、OCステージBHT更新指示信号を
受けたフリップフロップ439の出力が与えられ、真偽
回路1404には、OCステージGo先取り指示信号を
受けたフリップフロップ440の出力が信号線160を
介して与えられる。前記の真偽回路1402, 140
3, 1404.ナンド回路1405. 1406,ア
ンド回路1407. 1408によって、信号線149
の分岐成否信号,フリ・7プフロ。
Referring to FIG. 14, the EX stage prediction confirmation circuit 427 includes flip-flops 1401. Authenticity 1402,
1403. 1404, NAND circuit for negation of logical product 1405, 1406. AND circuit 1407, 1
408, and an OR circuit 1409. The truth/false circuit 1402 is given a branch success/failure signal output from the instruction execution circuit 407 via a signal line 149, and the flip-flop 1401 has a branch information register (QR3).
The V bit held by 419 is set, and NAND circuit 1
405. 1406 and the signal line 159 connected to the OR circuit 1409 are supplied with the output of the flip-flop 439 that has received the OC stage BHT update instruction signal, and the truth/false circuit 1404 is supplied with the output of the flip-flop 439 that has received the OC stage Go preemption instruction signal. The output of is given via signal line 160. The aforementioned truth/false circuits 1402, 140
3, 1404. NAND circuit 1405. 1406, AND circuit 1407. 1408, signal line 149
Branch success/failure signal, Furi 7 pflo.

プ1401の出力,信号線159,信号線160がそれ
ぞれ“1”、“O”、“1”、“1”、即ち、予測に従
って後続の命令の先取りを分岐N0GO側へ行なったそ
の命令は、実際には分岐Goであり、分岐成否信号が出
力され、更にOCステージまでにその命令についての予
測の失敗が検出されておらず或いは検出されていてもG
o側への先取り指示が出力されていないときのみ、アン
ド回路1407の出力が”1”になり、同様に信号線1
49,フリップフロップ1401の出力.信号&?1L
59,160がそれぞれ“O”、”1”、“1″,“θ
″,すなわち、分岐GOと予測され、分岐GO側へ後続
の命令先取りを行なった命令が実際には分岐N0GOで
あり、分岐成否信号が出力されなくて且つOCステージ
までにその命令についての予測の失敗が検出されていな
いか或いは検出されていても同時にGO側への先取り指
示が出ている場合のみ、アンド回路1408の出力が“
1”になる。更にオア回路14o9によって、OCステ
ージまでに予測の人数が検出されているか或いは分岐G
oと予測された命令が実際には分岐N0GOであり且つ
Ocステージまでに分岐N0GO側への先取り指示が出
力されていない時、および分岐N0GOと予測された命
令が実際には分岐Goであり且つOCステージまでに分
岐GO側への先取り指示が出力されていない時に、EX
ステージBHT更新指示信号が信号線148に出力され
る。
The output of signal line 1401, signal line 159, and signal line 160 are respectively "1", "O", "1", and "1", that is, the instruction that prefetched the subsequent instruction to the branch N0GO side according to the prediction is In reality, the branch is Go, a branch success/failure signal is output, and even if prediction failure for that instruction has not been detected or has been detected by the OC stage, the branch is Go.
Only when the prefetch instruction to the o side is not output, the output of the AND circuit 1407 becomes "1", and similarly the signal line 1
49, output of flip-flop 1401. signal&? 1L
59, 160 are “O”, “1”, “1”, “θ” respectively
'', that is, the instruction that was predicted to be a branch GO and prefetched the subsequent instruction to the branch GO side was actually a branch N0GO, a branch success/failure signal was not output, and the prediction for that instruction was not completed by the OC stage. The output of the AND circuit 1408 is "
1".Furthermore, the OR circuit 14o9 determines whether the predicted number of people has been detected by the OC stage or if the branch G
When an instruction predicted to be a branch N0GO is actually a branch N0GO, and a prefetch instruction to the branch N0GO side has not been output by the Oc stage, and an instruction predicted to be a branch N0GO is actually a branch Go, and When the preemption instruction to the branch GO side has not been output by the OC stage, EX
A stage BHT update instruction signal is output to signal line 148.

第15図を参照するき、前記命令先取り制?11回路4
23は、フリップフロップ1501,真偽回路1502
Referring to FIG. 15, is the command preemption system? 11 circuit 4
23 is a flip-flop 1501 and a truth/false circuit 1502
.

1503、 1504, 1505. 1506. 1
507. 7 7ド回路150B, 1509。
1503, 1504, 1505. 1506. 1
507. 7 7 de circuit 150B, 1509.

1510、 1511. 1512. 1513, 1
514. 1515, 1516. 1517. 15
18とから構成されている。この命令先取り制御回路4
23は、OA,OT.QC,EX(7)各ステー ’;
 (7)予測確認回路より出力される予測失敗信号と、
EXステージ予測確認回路427の出力するEXステー
ジBHT更新指示信号、並びに分岐ヒストリテーブル4
10の出力するBHT−HIT信号に基づいて、命令ア
ドレスレジスタ411の前段にあるセレクタおよび命令
アドレスリカバレジスタ428の前段にあるセレクタの
選択指示信号を出力する。
1510, 1511. 1512. 1513, 1
514. 1515, 1516. 1517. 15
It consists of 18. This instruction prefetch control circuit 4
23 is OA, OT. QC, EX (7) Each stay';
(7) a prediction failure signal output from the prediction confirmation circuit;
EX stage BHT update instruction signal output from EX stage prediction confirmation circuit 427 and branch history table 4
Based on the BHT-HIT signal outputted by 10, 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ステージ予測確認回路42
7よりEXステージBHT更新指示信号とEXステージ
予測失敗信号とが与えられると、命令アドレスリカバレ
ジスタ428には命令実行回路407の出力する分岐成
否信号によって制御される選択回路422の出力,即ち
実際の分岐判定を行なった結果分岐GOであれば分岐情
報レジスタ (QR4)の保持する実際に命令語の指示
により求められた分岐先アドレスが、又、命令実行回路
407の分岐判定の結果分岐NOGOであれば、アドレ
ス生成回路433の出力する分岐N0GO側のアドレス
が、いずれの場合も信号線155を介してセントされ、
同時に命令アドレスレジスタ411には分岐情報レジス
タ (QR4)の保持する分岐命令自身のアドレスが信
号線151を介してセントされる。更にその1マシンサ
イクル後には、命令先取り制御回路423は、入力信号
が全て“O″であれば、EXステージBHT更新指示信
号を1マシンサイクル保持するフリップフロップ150
1の出力によって、命令アドレスレジスタ411には、
lマシンサイクル前に命令アドレスリカバレジスタ42
8にセットされた実際の分岐判定結果による次に実行す
べき命令のアドレスが信号線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 set in the instruction address register 411. Signal line 1
EX stage prediction confirmation circuit 42 via 48 and 147
When the EX stage BHT update instruction signal and the EX stage prediction failure signal are given from 7, 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 If the result of the branch judgment is GO, the branch destination address actually obtained by the instructions of the instruction word held in the branch information register (QR4), and if the result of the branch judgment of the instruction execution circuit 407 is NOGO, the branch destination address held in the branch information register (QR4) is For example, the branch N0GO side address output by the address generation circuit 433 is sent via the signal line 155 in any case,
At the same time, the address of the branch instruction itself held in the branch information register (QR4) is sent to the instruction address register 411 via the signal line 151. Furthermore, one machine cycle later, if all the input signals are "O", the instruction prefetch control circuit 423 switches the flip-flop 150 to hold the EX stage BHT update instruction signal for one machine cycle.
1 output, the instruction address register 411 has the following information:
Instruction address recovery register 42 before l machine cycle
The address of the next instruction to be executed based on the actual branch judgment result set to 8 is controlled to be set via the signal line 162.

信号線147のEXステージ予測失敗信号が“0”の時
、信号線140を介してOCステージ予測確認回路42
6よりoCステージ予測失敗信号が与えられると、命令
先取り制御回路423は、命令アドレスレジスタ411
に、分岐情報レジスタ (QR3)419の保持する○
Cステージにある命令の命令語より求めた分岐GO側の
アドレスを信号線143を介してセットするよう制御す
る。この時、同時にEXステージBHT更新指示信号も
与えられれば、分岐情報レジスタ (QR3) 419
の保持するOCステージにある命令の分岐先アドレスは
命令アドレスリカバレジスタ428にセットされ、かわ
りに命令アドレスレジスタ411には分岐情報レジスタ
(QR4)420の保持するEXステージにある命令の
命令アドレスがセットされ、そのlマシンサイクル後に
は、命令先取り制御回路423の全ての入力が′″0″
であれば命令アドレスリカバレジスタ428に1マシン
サイクル前にセントされた、1マシンサイクル前にはO
Cステージにあった命令の実際の分岐Go側のアドレス
が命令アドレスレジスタ411にセットされるよう制御
する。
When the EX stage prediction failure signal on the signal line 147 is “0”, the OC 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.
○ held in the branch information register (QR3) 419
The branch GO side address obtained from the instruction word of the instruction in the C stage is controlled to be set 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 information register (QR3) 419
The branch destination address of the instruction in the OC stage held by is set in the instruction address recovery register 428, and 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. After one machine cycle, all inputs of the instruction prefetch control circuit 423 become ``0''.
If so, the instruction was sent to the instruction address recovery register 428 one machine cycle ago, and the O
Control is performed so that the actual branch Go side address of the instruction in the C stage is set in the instruction address register 411.

信号線147.140のEX、QC両ステージの予測失
敗信号がともに“O”の時、信号線129を介してOT
ステージ予測確認回路425よりOTステージ予測失敗
信号が与えられると、命令先取り制御回路423は、選
択回路421の出力すなわちOTステージにある命令が
無条件分岐命令か、実際には分岐を行なうBCT命令で
あって対応する分岐情報が分岐ヒストリテーブルに存在
しなくて分岐N0GO側に先取りが行なわれた時には、
命令アドレス変換回路402の出力する分岐GO側のア
ドレスが、又実際には分岐を行なわないBCT命令であ
って対応する分岐情報が分岐ヒストリテーブルより読出
されて分岐GO側へ後続の命令先取りが行なわれた時に
はアドレス生成回路431の出力する分岐N0GO側の
アドレスが、いずれもOTステージ予測確認回路425
が信号線131を介して出力するOTステージGo先取
り指示信号の制御によって選択回路421で選択された
その結果を信号線139を介して命令アドレスレジスタ
411にセットするよう制御する。この時、同時にEX
ステージBHT更新指示信号も与えられれば、選択回路
421の出力は、命令アドレスリカバレジスタ428に
セットされ、かわりに命令アドレスレジスタ411には
分岐情報レジスタ(QR4)420の保持するEXステ
ージにある命令の命令アドレスが信号線151を介して
セットされ、その1マシンサイクル後には、命令先取り
制御回路423の全ての入力が0″であれ、ば、命令ア
ドレスリカバレジスタ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 “O”, 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 also a BCT instruction that does not actually branch, and the corresponding branch information is read from the branch history table and the subsequent instruction is prefetched to the branch GO side. When the branch N0GO side address is output from the address generation circuit 431, the OT stage prediction confirmation circuit 425
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, EX
If the stage BHT update instruction signal is also given, the output of the selection circuit 421 is set in the instruction address recovery register 428, and instead, the output of the selection circuit 421 is set in the instruction address recovery register 428, and instead, the output of the instruction in the EX stage held in the branch information register (QR4) 420 is stored in the instruction address register 411. An instruction address is set via the signal line 151, and one machine cycle later, if all inputs of the instruction prefetch control circuit 423 are 0'', the instruction address recovery register 428 is set one machine cycle earlier. , an address for prefetching an instruction subsequent to the unconditional branch instruction or the BCT instruction that was in the OT stage one machine cycle ago is controlled to be sent to the instruction address register 411 via the signal line 162.

信号線147.140.129のEX、QC,OTの各
ステージの予測失敗信号が“0”の時、信号線121を
介してOAステージ予測確認回路424よりOAステー
ジ予測失敗信号が与えられると、命令先取り制御回路4
23は、アドレス生成回路430が出力するOAステー
ジにある命令の分岐N0GO側の命令アドレスを信号v
A128を介して命令アドレスレジスタ411にセット
するよう制御する。この時同時に、EXステージBHT
更新指示信号が与えられれば、アドレス生成回路430
の出力は命令アドレスリカバレジスタ428にセットさ
れ、命令アドレスレジスタ411には、かわりに分岐情
報レジスタ(QR4)420の保持するEXステージに
ある命令の命令アドレスが信号線151を介してセント
され、その1マシンサイクル後には、命令先取り制御回
路423の全ての入力が“0゛であれば、lマシンサイ
クル前に命令アドレスリカバレジスタにセットされたア
ドレスが信号線162を介して命令アドレスレジスタ4
11にセントされるよう制御する。
When the prediction failure signal of each stage of EX, QC, and OT on the signal line 147.140.129 is “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 is a signal v which indicates the instruction address on the branch N0GO side of the instruction in the OA stage output by the address generation circuit 430.
It is controlled to be set in the instruction address register 411 via A128. At the same time, EX stage BHT
If an update instruction signal is given, the address generation circuit 430
The output of is set in the instruction address recovery register 428, and instead, the instruction address of the instruction in the EX stage held in the branch information register (QR4) 420 is sent to the instruction address register 411 via the signal line 151, and the After one machine cycle, if all inputs of the instruction prefetch control circuit 423 are "0", the address set in the instruction address recovery register one machine cycle ago is transferred to the instruction address register 4 via the signal line 162.
It is controlled so that the number of cents is 11.

信号線147,140,129,121 (7)EX、
 QC,OT。
Signal line 147, 140, 129, 121 (7) EX,
QC, O.T.

OAの各ステージの予測失敗信号が全て“0°の時、信
号線106を介して分岐ヒストリテーブル410よりB
HT−HIT信号が与えられると、命令先取り制御回路
423は、分岐ヒストリテーブル410の出力するIC
ステージにある命令の予測された分岐アドレスを信号線
105を介して命令アドレスレジスタ411にセットす
るよう制御する。この時、同時にEXステージBHT更
新指示信号も与えられると、信号線105の分岐ヒスト
リテーブル410より読出された分岐先アドレスは、命
令アドレスリカバレジスタ428にセットされ、命令ア
ドレスレジスタ411には、かわりにEXステージにあ
る命令の命令アドレスが分岐情報レジスタ (QR4)
420より信号線151を介してセットされ、そのlマ
シンサイクル後には、命令先取り制御回路423の全て
の入力が“O″であれば1マシンサイクル前にセットさ
れた命令アドレスリカバレジスタ428の内容が命令ア
ドレスレジスタ411にセットされるよう制御する。
When the prediction failure signals of each stage of OA are all “0°,” 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 after one machine cycle, if all inputs to the instruction prefetch control circuit 423 are "O", the contents of the instruction address recovery register 428 that was set one machine cycle ago will be set. It is controlled to be set in the instruction address register 411.

信号線147.140.129.121のEX、QC,
OT。
EX, QC of signal line 147.140.129.121,
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の全
ての入力が“01であれば、1マシンサイクル前に命令
アドレスリカバレジスタ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 set, and the instruction address of the instruction in the EX stage is stored in the instruction address register 411 as a branch information register (QR).
4) Set from 420 via signal line 151, part 1
After a machine cycle, if all inputs to the instruction prefetch control circuit 423 are "01," 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図は、分岐命令ではない命令AIのアドレスを分
岐命令のアドレスとして指定する誤った分岐情報が分岐
ヒストリテーブル410に存在し、命令先取り制御回路
423が誤った分岐情報に従って命令A1の後続の命令
として命令C1を取出して実行している動作を示すタイ
ムチャートである。
FIG. 17 shows that erroneous branch information that specifies the address of instruction AI, 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 subsequent 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
の時刻において、分岐命令ではない命令AIのアドレス
<AI>が命令アドレスレジスタ411にセットされ、
命令A1のICステージが実行される。アドレスくA1
〉は信号線101を介して命令記憶回路408へ与えら
れ命令語の取出しが行なわれるとともに、分岐ヒストリ
テーブル410にも与えられ、アドレス<Al>を分岐
命令のアドレスとして指定する分岐情報の取出しが行な
われる。
Referring to FIGS. 1 and 17, machine cycle 0
At time , the address <AI> of an instruction AI that is not a branch instruction is set in the instruction address register 411,
The IC stage of instruction A1 is executed. Address A1
> is given to the instruction storage circuit 408 via the signal line 101 to fetch the instruction word, and is also given to the branch history table 410 to fetch the branch information specifying the address <Al> as the address of the branch instruction. It is done.

その結果、誤った分岐情報が取出され、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にセットされて、命令C1のICステージが実
行されるとともに、命令AIのIDステージが実行され
る。命令解読回路403は、命令AIが分岐命令ではな
いことから、命令解読結果が分岐命令であることを示す
信号113には“θ′を出力して命令AIが分岐命令で
ないことをOAステージ予測確認回路424へ通知する
とともに、命令Alの命令語長を分岐情報レジスタ(Q
R1) 417への信号線112に出力する。同時に、
分岐情報レジスタ(QRO)416に保持された命令A
1のアドレス<、a、1>と■ビット分岐先アドレス<
CI>のうち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 C1 is executed, and the ID stage of the instruction AI is executed. Ru. Since the instruction AI is not a branch instruction, the instruction decoding circuit 403 outputs "θ' to the signal 113 indicating that the instruction decoding result is a branch instruction, and confirms the OA 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 Al is stored in the branch information register (Q
R1) Output to signal line 112 to 417. at the same time,
Instruction A held in branch information register (QRO) 416
1 address <, a, 1> and ■ bit branch destination address <
The V bit of CI> is output to the signal line 115.

マシンサイクル2の時刻においては、命令C1のIDス
テージと命令C1の後続の命令C2のICステージが実
行されると共に、命令A1のOAXステージ実行される
。同時にOAXステージ予測確認回路424、前のマシ
ンサイクルで信号線113および115を介して与えら
れた情報より、今OAステージにある命令A1が分岐命
令でないにもかかわらず分岐情報が存在し、分岐Go側
へ後続の命令の先取りを行なったことを示すOAステー
ジ予測失敗信号を信号線121へ出力する。同時にアド
レス生成回路430は、分岐情報レジスタ(QR2)4
18の保持する命令Alのアドレス<AI>と命令A1
の命令語長を加算し、命令AIのN0GO側の後続の命
令のアドレスくA2〉を生成し、信号線128上に出力
する。命令先取り制御回路423は、OAXステージ予
測確認回路424出力する信号線121のOAステージ
予測失敗信号により、命令アドレスレジスタ411の入
力セレクタに、信号線128上の○Aステージからの命
令A1の分岐N0GO側のアドレス〈A2〉を選択する
よう指示する。又、OAステージ予測失敗信号が出力さ
れたことにより、OAXステージり前のステージにある
予測側に後続する命令CI、C2の動作はすべてキャン
セルされる。
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 C1 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 Al held by 18 and instruction A1
The instruction word length is added to generate the address (A2) of the next instruction on the N0GO side of the instruction AI, and output on the signal line 128. The instruction prefetch control circuit 423 uses the OA stage prediction failure signal on the signal line 121 output from the OAX stage prediction confirmation circuit 424 to input the branch N0GO of the instruction A1 from the ○A stage on the signal line 128 to the input selector of the instruction address register 411. Instruct to select the side address <A2>. 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においては、命令A1のOTステージ
が実行され、同時に命令アドレスレジスタ411には命
令A1の後続の命令のアドレス〈A2〉がセットされ、
命令A2のICステージも実行される。フリップフロッ
プ436は、前のマシンサイクルで出力されたOAステ
ージ予測失敗信号を受けて1”にセットされ、今OTス
テージにある命令A1の分岐情報が誤っており、正しく
更新しなければならないことを示す。
In machine cycle 3, the OT stage of instruction A1 is executed, and at the same time, the address <A2> of the instruction subsequent to instruction A1 is set in the instruction address register 411.
The IC stage of instruction A2 is also executed. Flip-flop 436 is set to 1'' in response to the OA stage prediction failure signal output in the previous machine cycle, indicating that the branch information of instruction A1 currently in the OT stage is incorrect and must be updated correctly. show.

次のマシンサイクル4において、命令A1はOCステー
ジを実行し、命令A2のIDステージ。
In the next machine cycle 4, instruction A1 executes the OC stage and the ID stage of instruction A2.

命令A2のamの命令A3のICステージが実行される
。フリップフロップ437には、フリップフロップ43
6を受けて1ゝがセットされ、フリップフロップ438
は“0”を保持し、合わせて現在OCステージにある命
令A1の分岐情報が誤っており、正しく更新する必要の
あることを並びに命令A1についての予測に従った後続
の命令先取りはキャンセルされて既にN0GO側への命
令先取り動作の実行が改めて行なわれたことを示す。
The IC stage of the am instruction A3 of the instruction A2 is executed. The flip-flop 437 includes the flip-flop 43
6 is received, 1゜ is set, and flip-flop 438
holds "0", indicating that the branch information of instruction A1 currently in the OC stage is incorrect and needs to be updated correctly, and that the prefetching of subsequent instructions according to the prediction for instruction A1 has been canceled. This indicates that the instruction prefetch operation to the N0GO side has already been executed anew.

マシンサイクル5においては、命令A1の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 A1 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を通して受け、それぞれ11″、0”にセントさ
れる。EXステージ予測確認回路427は、信号vA1
49の分岐成否信号と、前のマシンサイクルで信号線1
.46を介して与えられた分岐情報レジスタ(QR3)
419の保持していた命令Atの分岐情報のVビット、
およびフリップフロップ439゜440とから、信号線
148上のEXステージBIT更新指示信号として“1
”を出力し、信号線147のEXステージ予測失敗信号
には“0″を出力することによって、命令A1について
の分岐情報が存在し、その情報に従って分岐Go側へ後
続の命令先取りを行なったにもかかわらず、命令A1は
実際には分岐動作を行なわないこと、しかしながら後続
の誤った分岐先取り動作はキャンセルされて既に分岐N
0GO側への命令取出し動作が行なわれているため、E
Xステージでは命令先取りのやり直しを指示する必要の
ないことを示すとともに、命令AIについての分岐情報
の更新が必要なことを示す、これを受けて、命令先取り
制御回路423は、命令アドレスレジスタ411の入力
セレクタに対し信号線151上の命令A1のアドレスく
A1〉を選択するよう指示し、命令アドレスリカバレジ
スタ428の入力セレクタに対しては、信号線107上
のアドレス<A2>+24を選択するよう指示する。も
しこの時、命令アドレスレジスタ411の保持するアド
レス<A2>+16に対応する分岐情報が分岐ヒストリ
テーブルに存在し、BHT−HIT信号が信号線106
を介して与えられれば、命令先取り制御回路423は、
命令アドレスリカバレジスタ428の入力セレクタに対
しては、信号線105上に出力される1分岐ヒストリテ
ーブル410より取出された分岐情報の示す分岐先アド
レスを、またOAステージにある命令A2についてOA
ステージ予測確認回路424より信号線121を介して
OAステージ予測失敗信号が与えられれば信号線128
上のアドレスを選択するよう指示する。
On the other hand, flip-flops 439 and 440 receive the contents of flip-flops 437 and 438 through OC stage prediction confirmation circuit 426, and are set to 11'' and 0'', respectively. The EX stage prediction confirmation circuit 427 receives the signal vA1
49 branch success/failure signal and signal line 1 in the previous machine cycle.
.. Branch information register (QR3) given via 46
V bit of branch information of instruction At held by 419,
and the flip-flops 439 and 440, as the EX stage BIT update instruction signal on the signal line 148.
” and outputting “0” to the EX stage prediction failure signal on the signal line 147 indicates that branch information regarding instruction A1 exists and that 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, a subsequent erroneous branch prefetch operation is canceled and branch N is already taken.
Since an instruction is being fetched to the 0GO side, E
In the X stage, the instruction prefetch control circuit 423 indicates that there is no need to instruct the instruction prefetch to be redone, and also indicates that it is necessary to update the branch information regarding the instruction AI. The input selector is instructed to select the address <A1> of the instruction A1 on the signal line 151, and the input selector of the instruction address recovery register 428 is instructed to select the address <A2>+24 on the signal line 107. Instruct. 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, the BHT-HIT signal is transmitted to the signal line 106.
If given via the instruction prefetch control circuit 423,
The input selector of the instruction address recovery register 428 receives the branch destination address indicated by the branch information extracted from the 1-branch history table 410 output on the signal line 105, and the OA address for instruction A2 in the OA stage.
If an OA stage prediction failure signal is given from the stage prediction confirmation circuit 424 via the signal line 121, the signal line 128
Instruct them to select the address above.

次のマシンサイクル6において、命令A1は、分岐ヒス
トリテーブル410内の命令A1についての分岐情報の
更新を行なう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 a HU stage that updates the branch information for instruction A1 in branch history table 410. 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 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 set in each of the addresses.

これに応答して分岐ヒストリテーブル410内の命令A
1についての分岐情報の更新が行なわれ、A1について
の分岐情報のVビットがリセットされ、これ以降命令A
1は分岐命令としては扱われなくなる。一方この時、命
令先取り制御回路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
1 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 selects the address on the signal line 139 for the input selector of the instruction address register 411. , 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 set to <A2>+24.

第18図は、分岐ヒストリテーブル410にVビットが
“1”である対応する分岐情報が存在しなかったBCT
命令あるいは無条件分岐命令である命令B1の実行のよ
うすを示すタイムチャートであり、B1がBCT命令の
場合、命令B1で指定した計数値は“l゛ではなくて、
−1する計数動作を行なっても計数結果は“O”とはな
らす°、実際には分岐を行なうBCT命令の場合を示し
ている。
FIG. 18 shows a BCT in which there is no corresponding branch information in which the V bit is “1” 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 B1 is not "1", but
Even if a counting operation of -1 is performed, the counting result will not be "0". This shows the case of a BCT instruction which actually performs a branch.

第1図および第18図を参照するとマシンサイクルOの
時刻において、BCT命令あるいは無条件分岐命令であ
る命令Blのアドレス〈B1〉が命令アドレスレジスタ
411にセットされ、命令B1のICステージが実行さ
れる。アドレス〈B1〉は信号101を介して命令記憶
回路408へ与えられ命令語の取出しが行なわれるとと
もに、分岐ヒストリテーブル410に与えられ、命令B
1に対応する分岐情報の取出しが行なわれ、同時に、命
令アドレス加算回路412へも与えられ、アドレス〈B
l〉+8が生成される。分岐ヒストリテーブル410に
は命令Blに対応する分岐情報が存在しないため、信号
線106のBHT−HIT信号として“0”を出力する
。これに応答して命令先取り制御回路423は、命令ア
ドレスレジスタ411の入力セレクタに対し、信号線1
07に出力されるアドレス〈B1〉+8を選択するよう
指示する。
Referring to FIG. 1 and FIG. 18, at the time of machine cycle O, the address <B1> 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 B
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 <B
l〉+8 is generated. Since there is no branch information corresponding to the instruction Bl 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 address <B1>+8.

次のマシンサイクル1の時刻においては、命令アドレス
レジスタ411にはアドレス<B 1 >+3がセット
され、命令B1の分岐N0GO側の後続の命令A1のI
Cステージが実行される。同時に、分岐情報レジスタ 
(QRO)416には、命令Blのアドレス〈B1〉と
Vビ、トとして“O′″がセントされ、命令B1のID
ステージが実行される。
At the time of the next machine cycle 1, the address <B 1 >+3 is set in the instruction address register 411, and the I of the subsequent instruction A1 on the branch N0GO side of the instruction B1 is set.
C stage is executed. At the same time, the branch information register
In the (QRO) 416, "O'" is written as the address <B1> and Vbit of the instruction B1, and the ID of the instruction B1 is stored.
The stage is executed.

命令解読回路403は命令B1がBCT命令であること
を、あるいは無条件分岐命令であることを信号線114
に出力する。
The instruction decoding circuit 403 uses a signal line 114 to determine that the instruction B1 is a BCT instruction or an unconditional branch instruction.
Output to.

マシンサイクル2の時刻においては、命令B1のOAX
ステージ、命令AlのIDステージ及び命令A1の後続
の命令A2のICステージが実行される。レジスタ43
5は、前のマシンサイクルの信号線114の出力を受け
て、命令B1がBCT命令であることを或いは無条件分
岐命令であることを信号線122上に示す。分岐情報レ
ジスタ(QRl )’ 417には分岐情報レジスタ(
QRO)が前のマシンサイクルで保持していたアドレス
〈B1〉と“0”であるVビットがセットされ、■ビッ
トはさらに信号線126に出力される。命令アドレス生
成回路401は、命令B1の分岐先アドレスを生成し、
命令B1がBCT命令である時にはオペランドアドレス
生成回路404より命令Blで指定された計数値を保持
する汎用レジスタの値が信号線120を介して比較回路
433へ与えられる。比較回路433は与えられた計数
値が“1”でないことを検出して信号線123上の計数
値1信号として“0”を出力する。
At the time of machine cycle 2, OAX of instruction B1
The stages ID stage of instruction Al and IC stage of instruction A2 following instruction A1 are executed. register 43
5 indicates on the signal line 122 that the instruction B1 is a BCT instruction or an unconditional branch instruction in response to the output of the signal line 114 of the previous machine cycle. Branch information register (QRl)' 417 contains a branch information register (QRl)'
The address <B1> held by QRO) in the previous machine cycle and the V bit which is "0" are set, and the ■ bit is further output to the signal line 126. The instruction address generation circuit 401 generates a branch destination address of instruction B1,
When the instruction B1 is a BCT instruction, the operand address generation circuit 404 supplies the value of the general-purpose register holding the count value designated by the instruction B1 to the comparison circuit 433 via the signal line 120. The comparison circuit 433 detects that the applied count value is not "1" and outputs "0" as the count value 1 signal on the signal line 123.

マシンサイクル3においては、命令B1のOTステージ
が実行され、命令B1の分岐先アドレスが命令アドレス
変換回路402によって実アドレスくC1〉に変換され
るとともに、命令B1の分岐N0GO側の後続の命令A
t、A2.A3のOA。
In machine cycle 3, the OT stage of instruction B1 is executed, and the branch destination address of instruction B1 is converted to a real address C1> by the instruction address conversion circuit 402, and the subsequent instruction A on the branch N0GO side of instruction B1 is
t, A2. A3 OA.

ID、ICステージが実行される。OTステージ予測確
認回路425は、前のマシンサイクルで信号線122.
123.126を介して与えられた情報から、現在OT
ステージにある命令が、分岐GOであるBCT命令であ
ること或いは無条件分岐命令であることにもかかわらず
対応する分岐情報が分岐ヒストリテーブル410にヒツ
トせず、分岐N0GO側へ後続の命令の先取りが続けら
れたこと、このため、命令B1の分岐GO側へ命令の先
取りを改めて実行する必要のあること、並びに命令Bl
についての分岐情報を正しく更新する必要のあることを
示すために、信号線129にOTステージ予測失敗信号
を、信号線130にOTステージBHT更新指示信号を
、また信号線131にOTステージG。
ID and IC stages are executed. OT stage prediction confirmation circuit 425 detects signal line 122 .
From the information given via 123.126, the current OT
Even though the instruction in the stage is a BCT instruction that is a branch GO or an unconditional branch instruction, the corresponding branch information does not hit the branch history table 410, and the subsequent instruction is preempted to the branch N0GO side. Therefore, it is necessary to re-execute the instruction prefetch to the branch GO side of instruction B1, and
In order to indicate that it is necessary to correctly update the branch information for the OT stage G, an OT stage prediction failure signal is sent to the signal line 129, an OT stage BHT update instruction signal is sent to the signal line 130, and an OT stage BHT update instruction signal is sent to the signal line 131.

先取り指示信号をそれぞれ出力する。このOTステージ
GO先取り指示信号に応答して選択回路421は、信号
線133に出力される命令B1の分岐先アドレスを選択
し、信号線139上に出力する。命令先取り制御回路4
23は、OTステージ予測確認回路425の出力する信
号線129のOTステージ予測失敗信号により、命令ア
ドレスレジスタ411の入力セレクタに対して信号線1
39上の命令B1の分岐先アドレス〈C1〉を選択する
よう指示する。
Each outputs a prefetch instruction signal. In response to this OT stage GO prefetch instruction signal, the selection circuit 421 selects the branch destination address of the instruction B1 outputted to the signal line 133 and outputs it to the signal line 139. Instruction prefetch control circuit 4
23 indicates that the signal line 1 is sent to the input selector of the instruction address register 411 by the OT stage prediction failure signal on the signal line 129 output from the OT stage prediction confirmation circuit 425.
39 to select the branch destination address <C1> of instruction B1.

また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には命
令Blの分岐先アドレス<CI>がセット、アドレス<
CI>にある命令C1のICステージも実行される。フ
リップフロップ437.438は、前のマシンサイクル
で出力されたOTステージBHT更新指示信号とOTス
テージGo先取り指示信号とを受けてどちらも“1”に
セットされる。
In machine cycle 4, the OC cycle of instruction B1 is executed, and at the same time, the branch destination address <CI> of instruction B1 is set in the instruction address register 411, and the address <CI> is set in the instruction address register 411.
The IC stage of instruction C1 located at CI> is also executed. Flip-flops 437 and 438 receive the OT stage BHT update instruction signal and the OT stage Go prefetch instruction signal output in the previous machine cycle, and both are set to "1".

次のマシンサイクル5においては、命令B1のEXステ
ージが実行される。命令実行回路407は、命令B1が
BCT命令であれば指定された計数動作を行ない、その
結果が0”ではないことから信号線149の分岐成否信
号に分岐GOを示す“1”を、命令B1が無条件分岐命
令であるときは信号線149の分岐成否信号としてやは
り“1”を出力する。これに応答して選択回路422は
、分岐情報レジスタ (QR4)420の保持する命令
B1の分岐先アドレスくC1〉を選択し信号線155上
に出力する。同時に信号線151上には、同じく分岐情
報レジスタ(QR4)420の保持する命令Blのアド
レス〈B1〉が出力される。一方フリ、プフロップ43
9,440は、フリップフロップ437.438の内容
をOCステージ予?jl!l確認回路426を通して受
け、どちらも“1”にセットされる。EXステージ予測
確認回路427は、信号線149の分岐成否信号と、前
のマシンサイクルで信号線146を介して与えられた分
岐情報レジスタ (QR3)419の保持していた命令
B1の分岐情報の“O”である■ビット、およびフリッ
プフロップ439.440とから信号線148上のEX
ステージBHT更新指示信号として“l”を出力し、信
号線147のEXステージ予測失敗信号には“O”を出
力することによって、命令B1についての分岐情報が存
在せず分岐N0GO側へ後続の命令の先取りを行なった
にもかかわらず、命令B1は分岐を行なうこと、しかし
ながら後続の分岐N0CO側の命令はキャンセルされて
既に分岐Go側の命令取出しが行なわれているためEX
ステージでは命令先取りのやり直しを指示する必要のな
いことを示すとともに、命令B1についての分岐情報の
更新が必要なことを示す。これに応答して命令先取り制
御回路423は、命令アドレスレジスタ411の入力セ
レクタに対して信号線151上の命令Blのアドレスく
B1〉を選択するよう指示し、命令アドレスリカバレジ
スタ428の人力セレクタに対しては信号線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, it sets the branch success/failure signal on the signal line 149 to “1” indicating branch GO. When is an unconditional branch instruction, it also outputs “1” as a branch success/failure signal on the signal line 149. In response, the selection circuit 422 selects the branch destination of the instruction B1 held in the branch information register (QR4) 420. The address <C1> is selected and output on the signal line 155. At the same time, the address <B1> of the instruction Bl held in the branch information register (QR4) 420 is also output on the signal line 151. 43
9,440 is the contents of flip-flop 437.438 OC stage prediction? jl! 1 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. 0”, and EX on signal line 148 from flip-flops 439 and 440.
By outputting "l" as the stage BHT update instruction signal and "O" as the EX stage prediction failure signal on the signal line 147, there is no branch information for instruction B1 and the subsequent instruction is directed to the branch N0GO side. However, the instruction on the subsequent branch N0CO side has been canceled and the instruction on the branch Go side has already been fetched, so the instruction B1 executes a branch despite the prefetch of the branch Go side.
This 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 instruction B1. In response, the instruction prefetch control circuit 423 instructs the input selector of the instruction address register 411 to select the address B1 of the instruction B1 on the signal line 151, and the manual selector of the instruction address recovery register 428 is instructed to select address <CI>+16 on 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の更新を行なうHUXステージ実行す
る。レジスタ434には信号vA155上の命令B1の
分岐先アドレスくC1〉がセットされ、命令アドレスレ
ジスタ411には信号線151上の命令B1のアドレス
〈B1>が、命令アドレスリカバレジスタ428には<
CI>+16がそれぞれセットされる。一方、フリップ
フロップ441は前のマシンサイクルで信号線148上
に出力されたEXステージBHT更新指示信号を受けて
“1”にセットされ、その出力は信号線154を介して
分岐ヒストリテーブル410に与えられる。これに応答
して分岐ヒストリテーブル410には、分岐先アドレス
としくC1〉をもつアドレスくB1〉の分岐情報が格納
され、これ以後、命令B1は分岐先アドレスとしてくC
1〉が予測されるようになる。
In the next machine cycle 6, instruction B1 executes a HUX stage in which branch history table 410 is updated. The branch destination address C1 of the instruction B1 on the signal vA155 is set in the register 434, the address C1 of the instruction B1 on the signal line 151 is set in the instruction address register 411, and the address C1 is set in the instruction address recovery register 428.
CI>+16 is set respectively. On the other hand, 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. In response, the branch history table 410 stores branch information for address B1> with C1> as the branch destination address, and from now on, the instruction B1 will be used as the branch destination address C.
1> is now predicted.

一方この時命令先取り制御回路423は、命令アドレス
レジスタ411の人力セレクタに対して信号線162上
に出力されている命令アドレスリカバレジスタ42Bの
保持するアドレス<Ql>+15を選択するよう指示す
る。もしこの時、OAステージにある命令CIについて
OAステージ予測確認回路424より信号線121を介
してOAステージ予測失敗信号が与えられれば、命令先
取り制御回路423は命令アドレスレジスタ411の人
力セレクタに対し信号&112B上のアドレスを選択す
るよう指示する。
On the other hand, at this time, the instruction prefetch control circuit 423 instructs the manual selector of the instruction address register 411 to select the address <Ql>+15 held by the instruction address recovery register 42B 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 line 121 for the instruction CI in the OA stage, the instruction prefetch control circuit 423 sends a signal to the manual selector of the instruction address register 411. &112B to select an address.

マシンサイクル7以降は命令アドレスレジスタ411に
セントされたアドレス<CI>+16に従って命令先取
り動作が続けられる。
From machine cycle 7 onwards, the instruction prefetch operation continues according to the address <CI>+16 written to the instruction address register 411.

第19図は、分岐ヒストリテーブルに対応する分岐情報
が存在するBCT命令BCT1の実行のようすを示すタ
イムチャートであり、命令BCTIで指定した計数値は
°1°であって、−1する計数動作の結果は“O”とな
って実際には分岐を行なわないBCT命令の場合を示し
ている。
FIG. 19 is a time chart showing the execution of the BCT instruction BCT1 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上に出力さ
れる。同時にB)IT−HI T信号が信号線106上
に出力される。これに応答して命令先取り制御回路42
3は、命令アドレスレジスタ411の入力セレクタに対
し、信号線105に出力された命令BCTIの分岐先ア
ドレス〈C1〉を選択するよう指示する。
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, the B) IT-HIT signal is output on the signal line 106. In response to this, the instruction prefetch control circuit 42
3 instructs the input selector of the instruction address register 411 to select the branch destination address <C1> 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
When set to 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のIDステージおよび命令CIの後続の
命令C2のICステージが実行される。レジスタ435
は、前のマシンサイクルの信号線114の出力を受けて
、命令BCTIがBCT命令であることを信号線122
上に示す。分岐情報レジスタ (QR1) 417には
、前のマシンサイクルで分岐情報レジスタ (QRO)
が保持していた命令BCTlの分岐情報と命令BCTI
の命令語長がセットされ、信号線126には■ビットが
出力される。命令アドレス生成回路401は命令BCT
lの分岐先アドレスを生成し、オペランドアドレス生成
回路404は命令BCTIで指定された計数値を保持す
る汎用レジスタの値を信号線120を介して比較回路4
33に出力する。比較回路433は与えられた計数値が
“l”であることを検出して信号線123に計数値1信
号を出力する。
In machine cycle 2, the OA stage of the instruction BCTI, the ID stage of the instruction CI, and the IC stage of the instruction C2 following the instruction CI 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. Branch information register (QR1) 417 contains the branch information register (QRO) in the previous machine cycle.
Branch information of instruction BCTl and instruction BCTI held by
The instruction word length of is set, and the ■ bit is output to the signal line 126. The instruction address generation circuit 401 generates an instruction BCT.
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 4 via the signal line 120.
Output to 33. Comparison circuit 433 detects that the applied count value is "l" and outputs a count value 1 signal to signal line 123.

マシンサイクル3においては、命令BCT100Tステ
ージが実行され、命令BCTIの分岐先アドレスが命令
アドレス変換回路402で実アドレスに変換されるとと
もに、命令CI、C2およびC2の後続の命令C3のO
A、ID、ICステージがそれぞれ実行される。○Tス
テージ予測確認回路425は、前のマシンサイクルで信
号線122,123゜126を介して与えられた情報か
ら、OTステージにある命令BCTIが分岐N0GOの
BCT命令であることにもかかわらず命令BCTIの分
岐情報が分岐ヒストリテーブル410にヒツトして分岐
GO側へ後続の先取りが行なわれたこと、このため命令
BCTIの分岐N0GO側への後続の命令先取りを改め
て実行する必要のあること、並びに命令BCTIについ
ての分岐情報を正しく更新する必要のあることを示すた
めに、信号線129にOTステージ予測失敗信号を出力
し、信号線130には○TステージBHT更新指示信号
を出力し、信号線131の○TステージGO先取り指示
信号には“0′を出力する。これに応答して選択回路4
21は、アドレス生成回路431が信号線138に出力
する命令BCTIの分岐N0GO側の次の命令のアドレ
ス<AI>を選択して信号線139上に出力し、命令先
取り制御回路423は、命令アドレスレジスタ411の
人力セレクタに対して信号線139上のアドレスくA1
〉を選択するよう指示する。又、OTステージ予測失敗
信号が出力されたことにより、OTステージより前にあ
る分岐GO側に後続する命令CI、C2,C3の動作は
全てキャンセルされる。
In machine cycle 3, the instruction BCT100T stage is executed, and the branch destination address of the instruction BCTI is converted to a real address by the instruction address conversion circuit 402, and the O of the instruction C3 following instructions CI, C2, and C2 is
A, ID, and IC stages are each executed. ○The T stage prediction confirmation circuit 425 determines from the information given through the signal lines 122, 123 and 126 in the previous machine cycle that the instruction BCTI in the OT stage is a branch N0GO BCT instruction. The branch information of BCTI has been hit in the branch history table 410, and the subsequent prefetching to the branch GO side has been performed, and therefore, the subsequent prefetching of the instruction BCTI to the branch N0GO side needs to be executed again, and In order to indicate that it is necessary to correctly update the branch information regarding the instruction BCTI, an OT stage prediction failure signal is output to the signal line 129, a ○T stage BHT update instruction signal is output to the signal line 130, and the signal line “0” is output to the ○T stage GO preemption instruction signal of 131. In response, the selection circuit 4
21 selects the address <AI> 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; Address A1 on signal line 139 for the manual selector of register 411
〉. Furthermore, since the OT stage prediction failure signal is output, all operations of instructions CI, C2, and C3 subsequent to the branch GO side before the OT stage are canceled.

マシンサイクル4においては、命令BCTIのoCサイ
クルが実行され、同時に命令アドレスレ“ジスタ411
には、命令BCTIの分岐N0GO側に後続する命令A
lのアドレスくA1〉がセットされ、命令A1のICス
テージが実行される。フリップフロップ437,438
は、前のマシンサイクルで出力されたOTステージBH
T更新指示信号とOTステージGo先取り指示信号とを
受けてそれぞれ“1″、0”にセットされる。OCステ
ージ予測確認回路426は、前のマシンサイクルで分岐
情報レジスタ(QR2) 41Bが保持していた命令B
CTIの予測された分岐先アドレス<C1>と■ビット
を信号線137を介して、又命令BCT1の命令語の指
定により求められた実際の分岐先アドレスを信号線13
3を介して命令アドレス変換回路402からそれぞれ受
は取り、予測された分岐先アドレス〈C1〉が正しいか
どうかの検出を行なう。しかしながらフリップフロップ
437が“1”にセットされているため、たとえ分岐先
アドレス<CI>が正しくなくともOCステージ予測失
敗信号が信号線140に出力されることはなく、OTス
テージで命令BCTIの分岐N0GO側へ先取りをやり
直した動作をキャンセルして分岐GO側への先取りが改
めて始まることはない。
In machine cycle 4, the oC cycle of instruction BCTI is executed, and at the same time the instruction address register 411 is
In this example, the instruction A that follows the branch N0GO side of the instruction BCTI is
The address A1> of the instruction A1 is set, and the IC stage of the instruction A1 is executed. flip flop 437,438
is the OT stage BH output in the previous machine cycle
The OC stage prediction confirmation circuit 426 receives the T update instruction signal and the OT stage Go prefetch instruction signal and sets them to "1" and 0, respectively. Command B
The predicted branch destination address <C1> of CTI and the ■ bit are sent via the signal line 137, and the actual branch destination address determined by the instruction word specification 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 <CI> is incorrect, the OC stage prediction failure signal will not be output to the signal line 140, and the instruction BCTI will be branched at the OT stage. The prefetching to the branch GO side does not start again by canceling the operation of redoing the prefetching to the N0GO side.

次のマシンサイクル5において、命令BCT1のEXス
テージが実行される。命令実行回路407は命令BCT
Iで指定された計数動作を行ない、その結果が“O”に
なることから、信号線149の分岐成否信号に分岐N0
GOを示す“O”を出力する。これに応答して選択回路
422は、アドレス生成回路432の出力する命令BC
TIの分岐N。
In the next machine cycle 5, the EX stage of instruction BCT1 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 “O” indicating GO. In response, the selection circuit 422 selects the command BC output from the address generation circuit 432.
Branch N of TI.

GO側に後続する命令A1のアドレスくA1〉を選択し
て信号線155に出力する。同時に信号線151には分
岐情報レジスタ(QR4)420の保持する命令BCT
Iのアドレス<BCTI>が出力される。一方フリップ
フロップ439,440は、フリップフロップ437.
438の内容をOCステージ予測確認回路426を通し
て受けそれぞれ“1”、“0“にセットされる。EXス
テージ予測確認回路427は、信号線149の分岐成否
信号と、前のマシンサイクルで信号線146を介して与
えられた分岐情報レジス9 (QR3) 419 (7
)保持しティた命令BCTIの分岐情報のVビット、お
よびフリップフロップ439、440とから、信号線1
48のEXステージBHT更新指示信号として“1”を
出力し、信号線147のEXステージ予測失敗信号とし
て“0゛を出力することによって、命令BCTIの分岐
情報に従って分岐Goへ後続の命令先取りを行なったに
もかかわらず、命令BCTIは実際には分岐N0GOで
あること、しかしながら後続の誤った命令先取り動作は
キャンセルされて既に分岐N0GO側への命令取出し動
作が行なわれているためEXステージでは命令先取りの
やり直しを指示する必要のないことを示すと共に、命令
BCTIの分岐情報の更新が必要なことを示す。これを
受けて命令先取り制御回路423は、命令アドレスレジ
スタ411の入力セレクタに対し信号線151上の命令
BCT1のアドレス<BCTI>を選択するよう指示し
、命令アドレスリカバレジスタ428の入力セレクタに
対しては信号線107上のアドレス<At>+16を選
択するよう指示する。もしこの時、命令アドレスレジス
タ411の保持するアドレス<AI>+8に対応する分
岐情報が分岐ヒストリテーブル410に存在してBHT
−HIT信号が信号線106を介して与えられれば、命
令先取り制御回路423は、命令アドレスリカバレジス
タ428の入力セレクタに対しては信号線105上の分
岐ヒストリテーブル410より取出された分岐情報の示
す分岐先アドレスを選択するよう指示する。
The address A1> of the instruction A1 that follows on the GO side is selected and output to the signal line 155. At the same time, the instruction BCT held by the branch information register (QR4) 420 is connected to the signal line 151.
The address of I <BCTI> is output. On the other hand, the flip-flops 439, 440 are the flip-flops 437.
The contents of 438 are received through the OC stage prediction confirmation circuit 426 and are set to "1" and "0", respectively. The EX stage prediction confirmation circuit 427 receives the branch success/failure signal on the signal line 149 and the branch information register 9 (QR3) 419 (7
) from the V bit of the branch information of the held instruction BCTI and the flip-flops 439 and 440, the signal line 1
By outputting "1" as the EX stage BHT update instruction signal on the signal line 148 and "0" as the EX stage prediction failure signal on the signal line 147, the subsequent instruction is prefetched to the branch Go according to the branch information of the instruction BCTI. Despite this, the instruction BCTI is actually a branch N0GO. However, the subsequent erroneous instruction prefetch operation has been canceled and the instruction fetch operation to the branch N0GO side has already been performed, so the instruction prefetch is not performed at the EX stage. This indicates that there is no need to instruct the redo of the instruction BCTI, and also indicates that it is necessary to update the branch information of the instruction BCTI.In response, the instruction prefetch control circuit 423 sends the signal line 151 It instructs to select the address <BCTI> of the above instruction BCT1, and instructs the input selector of the instruction address recovery register 428 to select the address <At>+16 on the signal line 107. The branch information corresponding to the address <AI>+8 held in the address register 411 exists in the branch history table 410, and the BHT
- When the HIT signal is applied via the signal line 106, the instruction prefetch control circuit 423 indicates the branch information retrieved from the branch history table 410 on the signal line 105 to the input selector of the instruction address recovery register 428. Instructs to select a branch destination address.

次のマシンサイクル6において、命令BCTIは分岐ヒ
ストリテーブル410内の命令BCTIについての分岐
情報の更新を行なうHUXステージ実行する。命令アド
レスレジスタ411には命令アドレス<BCTI>がセ
ットされ、フリップフロップ441は前のマシンサイク
ルで信号線148に出力されたEXステージBHT更新
指示信号を受けて“1”にセントされ、その出力は信号
線154を介、して分岐ヒストリテーブル410に与え
られる。
In the next machine cycle 6, instruction BCTI executes a HUX stage that updates the branch information for instruction BCTI in branch history table 410. The instruction address <BCTI> is set in the instruction address register 411, 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 previous machine cycle, and its output is It is applied to branch history table 410 via signal line 154.

これに応答して分岐ヒストリテーブル410内の命令B
CTIの分岐情報のVビットがリセットされる。一方こ
の時、命令先取り制御回路423は命令アドレスレジス
タ411の入力セレクタに対して信号線162上に出力
されている命令アドレスリカバレジスタ428の保持す
るアドレス<AI>+16を選択するよう指示し、もし
この時、OAXステージある命令A1について、OAス
テージ予測確認回路424より信号線121を介してO
AXステージ予測失敗信号与えられれば、信号線128
上のアドレスを選択するように指示する。
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 OAX stage, the OA stage prediction confirmation circuit 424 sends an OAX signal via the signal line 121.
If the AX stage prediction failure signal is given, signal line 128
Instruct them to select the address above.

マシンサイクル7以降は、命令アドレスレジスタ411
にセントされたアドレスに従って命令先取り動作が続け
られる。
After machine cycle 7, the instruction address register 411
Instruction prefetch operations continue according to the address sent to .

第20図は、分岐ヒストリテーブルに対応する分岐情報
が存在し、分岐GO側へ後続の命令先取り動作が行なわ
れた無条件分岐命令、あるいは実際に分岐Goとなる条
件分岐命令Blの実行のようすを示すタイムチャートで
あり、命令B1に対する分岐情報の示す分岐先アドレス
が実際に命令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 Bl 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 instruction B1 is actually different from the branch destination address designated by instruction B1.

第1図及び第20図を参照するとマシンサイクル0の時
刻において、無条件分岐命令あるいは条件分岐命令であ
る命令B1のアドレスくB1〉が命令アドレスレジスタ
411にセットされて命令B1のICステージが実行さ
れる。アドレスくB1〉は信号線101を介して命令記
憶回路408に与えられ命令語の取出しが行なわれると
ともに、分岐ヒストリテーブル410にも与えられ、命
令Blに対する分岐情報の取出しが行なわれる。その結
果分岐ヒストリテーブル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 B1 of instruction B1, which is an unconditional branch instruction or a conditional branch instruction, is set in 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 set in 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において、命令C1のIDステージと
命令C1の後続の命令C2のICステージが実行される
とともに、命令B1のOAステージが実行され、命令B
1の分岐先アドレスが命令アドレス生成回路401によ
って計算され信号vA119上にその論理アドレスが出
力される。
In machine cycle 2, the ID stage of instruction C1 and the IC stage of instruction C2 subsequent to instruction C1 are executed, and the OA stage of instruction B1 is executed.
The branch destination address of 1 is calculated by the instruction address generation circuit 401, and the logical address is outputted on the signal vA119.

マシンサイクル3においては命令B1のOTステージが
実行され、命令B1の分岐先アドレスが命令アドレス変
換回路402で実アドレスくDl〉に変換され、信号線
133上に出力されるとともに、命令C1,C2,C3
のOA、ID、ICステージがそれぞれ実行される。分
岐情報レジスタ (QR2)41Bには、命令B1の分
岐情報がセットされ、予測された分岐アドレス<CI>
と■ビットが信号線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. The branch information register (QR2) 41B is set with the branch information of instruction B1, and the predicted branch address <CI>
and ■ bits are output on the signal line 137.

マシンサイクル4において、命令Bl、  C1゜C2
,C3,C4のQC,OT、 OA、  +D、  I
Cの各ステージがそれぞれ実行される。OCステージ予
測確認回路426は、前のマシンサイクルで信号線13
7を介して与えられた命令B1の予測された分岐先アド
レスくC1〉とVビットおよび信号線133を介して与
えられた命令B1の命令語によって指定された実際の分
岐先アドレスくDl〉とを照合し、予測された分岐先ア
ドレス〈C1〉が誤っていることを検出し、信号線14
0にOCステージ予測失敗信号を出力するとともに、信
号線156にOCステージBIT更新指示信号を、信号
線141にはOCステージGO先取り指示信号をそれぞ
れ出力する0分岐情報レジスタ (Q R3)419は
前のマシンサイクルで信号線133上に出力された命令
B1の実際の分岐先アドレス〈Dl〉がセットされ、信
号wA143上にアドレス〈Dl〉を出力する。命令先
取り制御回路423は、信号線140のOCステージ予
測失敗信号に応答して、命令アドレスレジスタ411の
入力セレクタに対して信号線143上のアドレスくDl
〉を選択するよう指示する。又、OCステージ予測失敗
信号が出力されたことにより、命令B1の分岐情報の示
す誤った分岐先アドレスくC1〉に従って先取りされた
命令C1,C2,C3,C4の動作は全てキャンセルさ
れる。
In machine cycle 4, instructions Bl, C1°C2
, C3, C4 QC, OT, OA, +D, I
Each stage of C is executed respectively. The OC stage prediction confirmation circuit 426 detects the signal line 13 in the previous machine cycle.
The predicted branch destination address (C1) of the instruction B1 given via the signal line 133, the actual branch destination address (Dl) specified by the instruction word of the instruction B1 given via the V bit and the signal line 133, and It is detected that the predicted branch destination address <C1> is incorrect, and the signal line 14
The 0 branch information register (Q R3) 419 outputs an OC stage prediction failure signal to 0, an OC stage BIT update instruction signal to the signal line 156, and an OC stage GO prefetch instruction signal to the signal line 141. The actual branch destination address <Dl> of the instruction B1 outputted on the signal line 133 in the machine cycle is set, and the address <Dl> is outputted on the signal wA143. In response to the OC stage prediction failure signal on the signal line 140, the instruction prefetch control circuit 423 sets the address Dl on the signal line 143 to the input selector of the instruction address register 411.
〉. Further, 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 B1, are all canceled.

マシンサイクル5においては、命令アドレスレジスタ4
11には命令B1の実際の分岐先アドレスであるアドレ
スくDl〉がセットされて命令DIのICステージが実
行されるとともに、命令B1のEXステージが実行され
る。命令実行回路407は命令81が条件分岐命令であ
れば、命令B1の命令語により指定された分岐条件を判
定して、その結果信号線149の分岐成否信号に分岐G
oを示す“1”を出力し、命令B1が無条件分岐命令で
あればやはり信号線149の分岐成否信号に“1”を出
力する。これに応答して選択回路422は、分岐情報レ
ジスタ (QR4)420の保持する実際の分岐先アド
レス<DI>を選択して信号線155上に出力する。又
、信号線151には命令B1のアドレス〈B1〉が出力
される。フリップフロップ439゜440は、前のマシ
ンサイクルで出力されたOCステージBHT更新指示信
号と、OCステージGO先取り指示信号を受けてどらち
も1”にセントされる。EXステージ予測確認回路42
7は、命令B1に対する分岐情報に従って誤った後続の
命令の取出しが行なわれたが既にキャンセルされて正し
い分岐GO側のアドレスに従った命令先取りが行なわれ
ており、EXステージから命令先取りのやり直しを指示
する必要のないこと、ただし分岐ヒストリテーブル41
0の命令B1についての分岐情報は修正する必要のある
ことを示すために、信号線147のEXステージ予測失
敗信号には“O″を、信号線148のEXステージBH
T更新指示信号には“1′を出力する。これに応答して
命令先取り制御回路423は、命令アドレスレジスタ4
11の入力セレクタに対し信号線151上の命令B1の
アドレスくB1〉を選択するように、また命令アドレス
リカバレジスタ428の入力セレクタに対し信号線10
7上のアドレス<Di>+8を選択するようそれぞれ指
示する。もしこの時、命令アドレスレジスフ411の保
持するアドレスくDl〉に対応する分岐情報が分岐ヒス
トリテーブル410に存在してBHT−HIT信号が信
号線106に出力されれば、命令アドレスリカバレジス
タ428の入力セレクタに対しては、信号線105上の
分岐ヒストリテーブル410より取出された分岐情報の
示す分岐先アドレスを選択するよう指示する。
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 DI 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 B1, and as a result indicates the branch success/failure signal on the signal line 149.
If the instruction B1 is an unconditional branch instruction, it also outputs "1" to the branch success/failure signal on the signal line 149. In response, the selection circuit 422 selects the actual branch destination address <DI> held in the branch information register (QR4) 420 and outputs it onto the signal line 155. Further, 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 and the OC stage GO preemption instruction signal output in the previous machine cycle, and both are set to 1''. EX stage prediction confirmation circuit 42
7, an incorrect subsequent instruction was fetched according to the branch information for instruction B1, but it has already been canceled and the instruction prefetch has been performed according to the correct address on the branch GO side, and the instruction prefetch must be re-fetched from the EX stage. Things that do not need to be specified, but branch history table 41
To indicate that the branch information for the instruction B1 of 0 needs to be corrected, the EX stage prediction failure signal on the signal line 147 is set to "O", and the EX stage BH on the signal line 148 is set to "O".
“1” is output as the T update instruction signal. In response, the instruction prefetch control circuit 423 updates the instruction address register 4.
11 to select the address B1> of the instruction B1 on the signal line 151, and the input selector of the instruction address recovery register 428 to the signal line 10.
7 to select address <Di>+8. At this time, if the branch information corresponding to the address Dl held by the instruction address register 411 exists in the branch history table 410 and the BHT-HIT signal is output to the signal line 106, the instruction address recovery register 428 The input selector is instructed to select the branch destination address indicated by the branch information extracted from the branch history table 410 on the signal line 105.

次のマシンサイクル6において、命令BlのHUステー
ジが実行され、命令B1に対する分岐情報の更新が行な
われる。命令アドレスレジスタ411には命令B1のア
ドレスくB1〉がセットされ、レジスタ434には命令
B1の正しい分岐先アドレス〈Dl〉がセントされ、フ
リフプフロップ441は前のマシンサイクルで出力され
たEXステージBHT更新指示信号を受け“1”がセッ
トされ、その出力が信号vA154を介して分岐ヒスト
リテーブル410に与えられる。これに応答して分岐ヒ
ストリテーブル410内の命令B1に対する分岐情報が
分岐先アドレスとして〈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 Dl of the instruction B1, and the flip-flop 441 is set to the EX stage address output in the previous machine cycle. In response to the BHT update instruction signal, "1" is set, and its output is given to the branch history table 410 via the signal vA154. In response, the branch information for instruction B1 in the branch history table 410 is updated to indicate <Dl> as the branch destination address. 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 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側へ後続の命令先取り動作が行
なわれた条件分岐命令BCIの実行のようすを示すタイ
ムチャートであり、命令BCIに対する分岐情報の示す
分岐先アドレスは、実際に命令BCIの指定する分岐先
アドレスとは異なっており、さらに条件分岐命令BCI
はその分岐条件を判定した結果分岐N0GOであった場
合を示している。
FIG. 21 is a time chart showing the execution of a conditional branch instruction BCI 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図を参照すると、マシンサイクル0
において、条件分岐命令BCIのアドレス<BCI>が
命令アドレスレジスタ411にセットされ、命令BCI
のICステージ゛が実行される。
Referring to FIGS. 1 and 21, machine cycle 0
, the address <BCI> of the conditional branch instruction BCI is set in the instruction address register 411, and the instruction BCI
The IC stage is executed.

同時に命令BCIの分岐情報が分岐ヒス) IJ子テー
ブル10より取出され、予測された分岐先アドレスとし
て〈C1〉が信号線105上に出力され、BHT−HI
T信号が信号線106上に出力される。
At the same time, the branch information of the instruction BCI is taken out from the IJ child table 10, and <C1> is output on the signal line 105 as the predicted branch destination address, and the BHT-HI
A T signal is output on 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.
05 to select address <CI>.

次のマシンサイクル1において、命令BCIの予測され
た分岐先アドレスくC1〉が命令アドレスレジスタ41
1にセットされ、命令C1のICステージが実行される
とともに、命令BCIのIDステージが実行される。
In the next machine cycle 1, the predicted branch destination address C1 of the instruction BCI is stored in the instruction address register 41.
Set to 1, the IC stage of instruction C1 is executed, and the ID stage of instruction BCI is executed.

マシンサイクル2において、命令CtのIDステージと
、命令C1の後続の命令C2のICステージが実行され
ると共に、命令BCIのOAステージが実行され、命令
BCIの分岐先アドレスが命令アドレス生成回路401
によって計算され、信号&1119上にその論理アドレ
スが出力される。
In machine cycle 2, the ID stage of the instruction Ct and the IC stage of the instruction C2 following the instruction C1 are executed, and the OA 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.
and outputs its logical address on signal &1119.

マシンサイクル3においては、命令BCIのOTステー
ジが実行され、命令BCIの分岐先アドレスが命令アド
レス変換回路402によって実アドレス〈Dl〉に変換
され信号線133上に出力される。同時に命令C1,C
2,C3のOA、10゜ICステージもそれぞれ実行さ
れる。分岐情報レジスタ(QR2)418には命令BC
Iの分岐情報がセットされ予測された分岐先アドレスく
C1〉とVビットが信号線137上に出力される。
In machine cycle 3, the OT stage of the instruction BCI is executed, and the branch destination address of the instruction BCI is converted into a real address <Dl> by the instruction address conversion circuit 402 and output onto the signal line 133. At the same time, instructions C1 and C
The OA and 10° IC stages of 2 and C3 are also executed, respectively. Branch information register (QR2) 418 contains instruction BC.
The branch information of I is set, and the predicted branch destination address C1> and the V bit are output on the signal line 137.

マシンサイクル4においては、命令BCI、C1、C2
,C3,C4のQC,OT、 OA、  ID。
In machine cycle 4, instructions BCI, C1, C2
, C3, C4 QC, OT, OA, ID.

ICの各ステージがそれぞれ実行される。OCステージ
予測Vf1認回路426は、前のマシンサイクルで信号
!137を介して与えられた命令BCIの予測された分
岐先アドレス〈C1〉とVビット、および信号線133
を介して与えられた命令BCIの命令語によって指定さ
れた実際の分岐先アドレス<DI>とを照合して、予測
された分岐先アドレスくC1〉が誤っていることを検出
し、信号線140にoCステージ予測失敗信号を出力す
るとともに、信号線156にOCステージBHT更新指
示信号を、信号vA141にはOCステージGO先取り
指示信号をそれぞれ出力する。分岐情報レジスタ(QR
3)419は、前のマシンサイクルで信号線133に出
力されていた実際の分岐先アドレス〈Dl〉がセットさ
れ、信号線143上にそのアドレスくDl〉を出力する
。命令先取り制御回路423は信号線140のOCステ
ージ予測失敗信号に応答して、命令アドレスレジスタ4
11の入力セレクタに対して、信号線143上のアドレ
ス〈Dl〉を選択するよう指示する。又、oCステージ
予測失敗信号が出力されたことにより命令BCIの分岐
情報の示す誤った分岐先アドレス〈C1〉に従って先取
りされた命令C1,C2,C3,C4の動作は全てキャ
ンセルされる。
Each stage of the IC is executed individually. The OC stage prediction Vf1 recognition circuit 426 receives the signal! in the previous machine cycle. The predicted branch destination address <C1> of the instruction BCI given via 137, the V bit, and the signal line 133
It compares it with the actual branch destination address <DI> specified by the instruction word of the instruction BCI given via the signal line 140, and detects that the predicted branch destination address <DI> is incorrect. It outputs an oC stage prediction failure signal to the signal line 156, an OC stage BHT update instruction signal to the signal line 156, and an OC stage GO prefetch instruction signal to the signal vA141. Branch information register (QR
3) In 419, the actual branch destination address <Dl> that was output to the signal line 133 in the previous machine cycle is set, and the address <Dl> is output onto the signal line 143. The instruction prefetch control circuit 423 responds to the OC stage prediction failure signal on the signal line 140 to read the instruction address register 4.
The input selector No. 11 is instructed 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 that 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〉がセントされ、命令DlのICステージ
が実行されるとともに、命令BCIのEXステージが実
行される。命令実行回路407は、条件分岐命令BCI
の命令語により指定された分岐条件を判定して、その結
果信号線149の分岐成否信号に分岐N0GOを示す“
0゛を出力する。これに応答して選択回路422は、ア
ドレス生成回路432の出力する命令BCIの命令アド
レス<BCI>と命令BCIの命令語長とを加算したア
ドレス<A1>を選択し、信号&’jl155上に出力
する。また、信号線151上には、命令BCIのアドレ
ス<BCI>が出力される。フリップフロップ439.
440は、前のマシンサイクルで出力されたOCステー
ジBl(T更新指示信号と、OCステージGo先取り指
示信号とを受けて、どちらも“1”にセットされる。E
Xステージ予測確認回路427は、前のマシンサイクル
で信号線146を介して分岐情報レジスタ(QR3)4
19の保持する命令BCIのVビットと、信号線149
の分岐成否信号およびフリップフロップ439.440
の出力を受けて、信号v1147のEXステージ予測失
敗信号と信号線148のEXステージBHT更新指示信
号とに“1゛を出力し、命令BCIの分岐情報は誤って
おり、既に分岐GO側へ後続する命令の先取りのやり直
しが指示されたが、実際には命令BCIは分岐N0GO
であり、分岐ヒストリテーブル410のBCIに関する
分岐情報を正しく更新するとともに分岐N0GO側にa
続する命令の先取りのやり直しを行なう必要のあること
を示す。これに応答して命令先取り制御回路423は、
命令アドレスレジスタ411の入力セレクタに対して信
号線151上のアドレス<BCI>を選択するように、
また命令アドレスリカバレジスタ428の入力セレクタ
に対しては信号線155上のアドレスくA1〉を選択す
るようにそれぞれ指示する。
In machine cycle 5, instruction address register 4
11, the branch destination address Dl> obtained from the instruction word of the instruction BCI is sent, and the IC stage of the instruction Dl 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.
Outputs 0゛. In response, the selection circuit 422 selects the address <A1> that 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, and outputs it on the signal &'jl155. Output. Further, the address <BCI> of the instruction BCI is output onto the signal line 151. flip flop 439.
440 receives the OC stage Bl (T update instruction signal and the OC stage Go preemption instruction signal output in the previous machine cycle, and both are set to "1".E).
The X stage prediction confirmation circuit 427 receives the branch information register (QR3) 4 via the signal line 146 in the previous machine cycle.
The V bit of the instruction BCI held by 19 and the signal line 149
branch success/failure signals and flip-flops 439.440
In response to the output of However, in reality, the instruction BCI is branch N0GO.
, the branch information related to BCI in the branch history table 410 is updated correctly, and the a
Indicates that it is necessary to redo the prefetch of the following instruction. In response to this, the instruction prefetch control circuit 423:
In order to select the address <BCI> on the signal line 151 for the input selector of the instruction address register 411,
The input selectors of the instruction address recovery register 428 are also instructed to select the address A1 on the signal line 155.

次のマシンサイクル6において、命令BCIのHUステ
ージが実行され命令BCIに対する分岐情報の更新が行
なわれる。命令アドレスレジスタ411には命令BCI
のアドレス<BC1>がセットされ、命令アドレスリカ
バレジスタ428とレジスタ434には命令BCIの分
岐N0GO側のアドレス<AI>がセントされる。又、
フリップフロップ441には前のマシンサイクルで出力
されたEXステージBIT更新指示信号によって“1”
がセントされ、その出力が信号線154を介して分岐ヒ
ストリテーブル410に与えられる。これに応答して分
岐ヒストリテーブル410内の命令BCIに対する分岐
情報のVピントがリセットされる。一方この時、命令先
取り制御回路423は、命令アドレスレジスタ411の
入力セレクタに対して、命令BCIの分岐N0GO側の
アドレスくA1〉を保持する命令アドレスリカバレジス
タ428の出力を選択するように指示する。
In the next machine cycle 6, the HU stage of the instruction BCI is executed and the branch information for the instruction BCI is updated. The instruction address register 411 contains the instruction BCI.
The address <BC1> of the instruction BCI is set, and the address <AI> of the branch N0GO side of the instruction BCI is sent to the instruction address recovery register 428 and register 434. or,
The flip-flop 441 is set to “1” by the EX stage BIT update 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 to this, the V pinto 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 A1 on the branch N0GO side of the instruction BCI. .

マシンサイクル7においては、命令アドレスレジスフ4
11にアドレス〈A1〉がセントされ、命令BCIの後
続の命令AIの取出しが行なわれる。
In machine cycle 7, instruction address register 4
The address <A1> is sent to 11, and the instruction AI subsequent to the instruction BCI is fetched.

そして以降、命令アドレスレジスタ411にセットされ
たアドレスに従って命令先取り動作が続けられる。
Thereafter, the instruction prefetch operation continues according to the address set in the instruction address register 411.

〔発明の効果〕〔Effect of the invention〕

次に本発明の効果を第17図を参照しながら説明する。 Next, the effects of the present invention will be explained with reference to FIG. 17.

第17図では、分岐命令ではない命令A1に対応する分
岐情報が分岐ヒストリテーブルより取出されて誤った分
岐情報の示す分岐先アドレスに従って後続の命令の先取
りが行なわれた場合の動作を示しているが、分岐情報が
誤っており、予測が失敗したことは、OAステージに設
けた、命令が分岐情報でないにもかかわらず分岐情報G
こよって分岐GO側に先取りが行なわれたことを検出す
る回路によって、命令A1がOAステージを実行中のマ
シンサイクル2の時点で検出され、次のマシンサイクル
3では正しい後続の命令A2のICステージが実行され
ている。この場合、命令A1に対応する誤った分岐情報
によって失われたロスサイクルは、わずか2マシンサイ
クルである。一方、本発明を適用しない従来技術では、
正しい後続の命令A2のICステージが実行されるのは
命令A1についての分岐ヒストリテーブル上の誤った分
岐情報を更新するHUステージの後のマシンサイクル7
の時となり、6マシンサイクルものロスサイクルを費や
してしまう。
FIG. 17 shows the operation when the branch information corresponding to instruction A1, which is not a branch instruction, is retrieved from the branch history table and the subsequent instruction is prefetched according to the branch destination address indicated by the incorrect branch information. However, the branch information was incorrect and the prediction failed because the branch information G provided in the OA stage was used even though the instruction was not branch information.
Therefore, the circuit that detects prefetching on the branch GO side detects instruction A1 at the time of machine cycle 2 when the OA stage is being executed, and in the next machine cycle 3, the IC stage of the correct subsequent instruction A2 is detected. is being executed. In this case, only two machine cycles are lost due to incorrect branch information corresponding to instruction A1. On the other hand, in the conventional technology to which the present invention is not applied,
The IC stage of the correct successor instruction A2 is executed in machine cycle 7 after the HU stage that updates the incorrect branch information in the branch history table for instruction A1.
, and 6 machine cycles were lost.

以上説明したように、分岐命令でない命令に対応する分
岐情報が分岐ヒストリテーブルに登録されていたため誤
った命令先取り動作が行なわれた場合、本発明によって
、従来技術に比べてはるかに少ないロスサイクルを費や
すだけで正しい後続の命令先取り動作を行なうことがで
きるという効果がある。
As explained above, when an erroneous instruction prefetch operation is performed because branch information corresponding to an instruction that is not a branch instruction is registered in the branch history table, the present invention can reduce lost cycles much less than the conventional technology. The effect is that the correct subsequent instruction prefetch operation can be performed just by spending a certain amount of time.

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

第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・・・分岐情報レジスタ 
(QR3)420・・・分岐情報レジスタ (QR4)
421.422・・・選択回路、423・・・命令先取
り制御回路424・・・OAステージ予測確認回路42
5・・・OTステージ予測確認回路426・・・OCス
テージ予測確認回路427・・・EXステージ予21I
!1li11U2回路428・・・命令アドレスリカバ
レジスタ430.431,432・・・アドレス生成回
路433・・・比較回路、434,435 用レジスタ
436.437,438,439,440,441・・
・フリップフロップ501.502・・・記憶部 503、504 、505.506・・・テスト回路5
07・・・プライオリティ回路、508・・・選択回路
509・・・オア回路、601,602,603,60
4・・・アンド回路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. FIG. 9 is a diagram showing the storage format of the branch information registers 417 to 420 in FIG. 10 is a diagram for explaining the correspondence between the instruction word in the path 408 and the 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 information is 21 is a time chart for explaining the operation when the branch destination address indicated by is incorrect, and FIG. 21 shows that branch information corresponding to a conditional branch instruction that does not actually branch is registered in the branch history table. 12 is a time chart illustrating an operation when an instruction is prefetched according to the branch information, but the branch destination address indicated by the branch information 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 succession 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
(QR3) 420...Branch information register (QR4)
421.422... Selection circuit, 423... Instruction prefetch control circuit 424... OA stage prediction confirmation circuit 42
5...OT stage prediction confirmation circuit 426...OC stage prediction confirmation circuit 427...EX stage prediction 21I
! 1li11U2 circuit 428... Instruction address recovery register 430, 431, 432... Address generation circuit 433... Comparison circuit, 434, 435 register 436, 437, 438, 439, 440, 441...
・Flip-flops 501, 502...Storage units 503, 504, 505, 506...Test circuit 5
07... Priority circuit, 508... Selection circuit 509... OR circuit, 601, 602, 603, 60
4...AND circuit 605, 606, 607, 608-
...OR circuit, 701 ...-number circuit 702 ... magnitude comparison circuit, 703 river AND circuit 1101.1102.
...Flip-flop 1103...Knot circuit, 11
04...AND circuits 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; When performing instruction prefetch operation,
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; a second inspection means for checking whether there is a registration; and a second inspection means for reading out corresponding branch information from the branch history table means in response to the confirmation of registration by the first inspection means, and continuing the instruction prefetching operation according to the branch information. When an erroneous instruction prefetch operation is performed in response to the results of the first and second checking means, the following erroneous instruction is executed without waiting for the determination of the branch condition of the prefetched instruction. An instruction prefetching device comprising: instruction prefetching control means for controlling to correct a prefetching operation.
JP61000323A 1986-01-07 1986-01-07 Instruction prefetching device Expired - Fee Related JPH0695306B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP61000323A JPH0695306B2 (en) 1986-01-07 1986-01-07 Instruction prefetching device
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
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
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

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61000323A JPH0695306B2 (en) 1986-01-07 1986-01-07 Instruction prefetching device

Publications (2)

Publication Number Publication Date
JPS62159230A true JPS62159230A (en) 1987-07-15
JPH0695306B2 JPH0695306B2 (en) 1994-11-24

Family

ID=11470693

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61000323A Expired - Fee Related JPH0695306B2 (en) 1986-01-07 1986-01-07 Instruction prefetching device

Country Status (1)

Country Link
JP (1) JPH0695306B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01321522A (en) * 1988-06-24 1989-12-27 Nec Corp Information processor
JPH01321521A (en) * 1988-06-24 1989-12-27 Nec Corp Information processor
JPH08249181A (en) * 1994-02-04 1996-09-27 Internatl Business Mach Corp <Ibm> Branch forecasting data processor and operating method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56155448A (en) * 1980-05-06 1981-12-01 Nec Corp Information processor
JPS60175148A (en) * 1984-02-21 1985-09-09 Nec Corp Instruction prefetching device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56155448A (en) * 1980-05-06 1981-12-01 Nec Corp Information processor
JPS60175148A (en) * 1984-02-21 1985-09-09 Nec Corp Instruction prefetching device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01321522A (en) * 1988-06-24 1989-12-27 Nec Corp Information processor
JPH01321521A (en) * 1988-06-24 1989-12-27 Nec Corp Information processor
JPH08249181A (en) * 1994-02-04 1996-09-27 Internatl Business Mach Corp <Ibm> Branch forecasting data processor and operating method

Also Published As

Publication number Publication date
JPH0695306B2 (en) 1994-11-24

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
US4853840A (en) Instruction prefetching device including a circuit for checking prediction of a branch instruction before the instruction is executed
US4764861A (en) Instruction fpefetching device with prediction of a branch destination for each branch count instruction
JPH0283735A (en) Instruction prefetching device
CZ93491A3 (en) Digital computer system
EP0352935B1 (en) Pipelined processor
JPH0562390B2 (en)
EP0094535B1 (en) Pipe-line data processing system
EP0742517B1 (en) A program translating apparatus and a processor which achieve high-speed execution of subroutine branch instructions
KR930003124B1 (en) Apparatus for the control of branch instruction in pipeline system
JP2643087B2 (en) Program processing method and computer system
KR100431975B1 (en) Multi-instruction dispatch system for pipelined microprocessors with no branch interruption
JPS62159230A (en) Instruction prefetching device
JPS5991551A (en) Instruction prefetching device forecasting address to be branched
JPS62159231A (en) Instruction prefetching device
JPS62159233A (en) Instruction prefetching device
JPH046983B2 (en)
JPS62159232A (en) Instruction prefetching device
JPS62159229A (en) Instruction prefetching device
JPS62159228A (en) Instruction prefetching device
JPS60175148A (en) Instruction prefetching device
EP0297890B1 (en) Apparatus and method for data induced condition signaling
US6081886A (en) Holding mechanism for changing operation modes in a pipelined computer
JPS5991552A (en) Instruction prefetch device having set associative type history table

Legal Events

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