JPS6058489B2 - Branch instruction advance control method - Google Patents

Branch instruction advance control method

Info

Publication number
JPS6058489B2
JPS6058489B2 JP10592880A JP10592880A JPS6058489B2 JP S6058489 B2 JPS6058489 B2 JP S6058489B2 JP 10592880 A JP10592880 A JP 10592880A JP 10592880 A JP10592880 A JP 10592880A JP S6058489 B2 JPS6058489 B2 JP S6058489B2
Authority
JP
Japan
Prior art keywords
instruction
branch
register
state
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
JP10592880A
Other languages
Japanese (ja)
Other versions
JPS5731050A (en
Inventor
和之 清水
芳之 水島
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP10592880A priority Critical patent/JPS6058489B2/en
Publication of JPS5731050A publication Critical patent/JPS5731050A/en
Publication of JPS6058489B2 publication Critical patent/JPS6058489B2/en
Expired legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3842Speculative instruction execution
    • G06F9/3846Speculative instruction execution using static prediction, e.g. branch taken strategy

Description

【発明の詳細な説明】 本発明は情報処理装置に関し、特に、1つまたは複数
の命令バッファレジスタと、該命命バッファレジスタの
どの位置から命令を取り出オベきかを指示するポインタ
を有し、該ポインタで指示された位置から命令を順次取
り出して処理を行なう情報処理装置における分岐命令の
先行制御に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an information processing device, and in particular, it has one or more instruction buffer registers and a pointer that indicates from which position in the instruction buffer registers an instruction is to be taken out and placed; The present invention relates to advance control of branch instructions in an information processing device that sequentially fetches and processes instructions from a position indicated by the pointer.

第1図に代表的な分岐命令の形式を示す。 FIG. 1 shows the format of a typical branch instruction.

図中、OPは、命令の動作コードを示し、マスクフィー
ルドM1は分岐条件を示す。 分岐先アドレスは、(X
2)十(B2)+D2の和によつて求められる。
In the figure, OP indicates the operation code of the instruction, and mask field M1 indicates the branch condition. The branch destination address is (X
2) Calculated by the sum of 10(B2)+D2.

()は、レジスタの;内容を示す。 第2図aは、パイ
プライン制御方式における従来の分岐命令の動作を示し
、第2図a(7)D、R、A、B、、B2、E、、E。
、CK、Wは、それぞれパイプラインの各ステートを示
しており、2サイクル毎に異なつた命令がパイプライン
に入る事が出来、そして複数の命令を平行処理出来るよ
うにされている。 Dは、命令の解読(デコード)を行
なうステート、Rはオペランドアドレスを求めるための
イン゜デツクスX2、ベースB2の各レジスタ読み出し
ステート、Aは読み出されたレジスタの内容から(X2
)+(B2)+D2の論理演算を行ない、記憶装置にア
クセスするためのアドレスを求めるステート、B、、B
2は、求められたアドレスを使つて記憶装置にアクセス
するステートである。
() indicates the contents of the register. FIG. 2a shows the operation of a conventional branch instruction in the pipeline control system, and FIG. 2a (7) D, R, A, B, , B2, E, , E.
, CK, and W indicate each state of the pipeline, and a different instruction can enter the pipeline every two cycles, and a plurality of instructions can be processed in parallel. D is the state for decoding the instruction, R is the state for reading the registers of index X2 and base B2 to find the operand address, and A is the state for reading (
) + (B2) + D2, and the state B, , B performs the logical operation to obtain the address for accessing the storage device.
2 is a state in which the storage device is accessed using the obtained address.

ただし、分岐命令の場合のB。ステートは、分岐決定を
行なうステートでもある。E、、E2は、求められたオ
ペランドデータを使つて演算を行なうステート、CKは
データのチェックを行なうステート、Wは、各種レジス
タに書き込みを行なうステートである。 従来は、分岐
先命令の取り出しを、分岐命令のD、R、A、B、、B
2のステートの中で行ない、分岐先命令を命令バッファ
に取り込むのがE、ステートであるため、第2図aに示
すように分岐命令から分岐先命令までの間隔は5サイク
ルであつた。
However, B in the case of a branch instruction. A state is also a state that makes a branch decision. E, , E2 are states in which operations are performed using the obtained operand data, CK is a state in which data is checked, and W is a state in which writing is performed in various registers. Conventionally, the branch destination instruction is retrieved using the branch instructions D, R, A, B, .
Since it is the E state that takes the branch destination instruction into the instruction buffer, the interval from the branch instruction to the branch destination instruction is five cycles, as shown in FIG. 2A.

本発明は分岐命令の性能を高めるため、命令バッファの
中の命令先頭位置を示す指標を各々の命令バッファに対
応して持ち、現在の命令位置から数命令後の命令を解読
して、分岐命令であつた場合、分岐先命令を先取りする
ことにより、分岐命令を高速に処理することを目的とす
る。
In order to improve the performance of branch instructions, the present invention has an index indicating the leading position of an instruction in the instruction buffer corresponding to each instruction buffer, decodes the instruction several instructions after the current instruction position, and reads the branch instruction. , the purpose is to process the branch instruction at high speed by prefetching the branch destination instruction.

そして、そのため本発明は1つまたは複数の命令バッフ
ァレジスタと、該命令バッファレジスタのどの位置から
命令を取り出すべきかを指示するポインタを有し、該ポ
インタで指示された位置から命令を順次取り出して処理
を行なう情報処理装置において、上記各命令バッファレ
ジスタ内の命令の先頭位置を示す命令バッファレジスタ
内命令位置フラグと、後続命令の先頭位置を示す後続命
令位置フラグをもうけ、命令語を記憶部より読出すごと
に少なくとも該読出された命令語の一部のビットのデコ
ード結果と、当該時点の後続命令位置フラグの値と、す
でにセットされている命令バッファレジスタ内命令位置
フラグの状況によつて新たな命令語中の命令先頭位置を
検出し、対応する命令バッファレジスタの命令バッファ
レジスタ内命令位置フラグをセットするとともに、上記
ポインタと上記バッファレジスタ内命令位置フラグの値
によつて上記ポインタが指示する現取り出し中の命令の
次命令または数命令後の命令を先取り出ししてデコード
し、該先行取り出しした命令が分岐命令の場合はさらに
その分岐先アドレスを計算し、分岐先アドレスから命令
を先行読出しするようにしたことを特徴とする。以下、
本発明を図面により説明する。
Therefore, the present invention has one or more instruction buffer registers and a pointer that indicates from which position in the instruction buffer register an instruction should be taken out, and sequentially takes out instructions from the position indicated by the pointer. The information processing device that performs the processing has an instruction position flag in the instruction buffer register that indicates the starting position of the instruction in each of the above instruction buffer registers, and a subsequent instruction position flag that indicates the starting position of the subsequent instruction, and stores the instruction word from the storage unit. Each time it is read, a new instruction is generated based on the decoding result of at least some bits of the read instruction word, the value of the subsequent instruction position flag at that time, and the status of the instruction position flag in the instruction buffer register that has already been set. The instruction start position in the instruction word is detected, and the instruction position flag in the instruction buffer register of the corresponding instruction buffer register is set, and the pointer is pointed by the value of the above pointer and the instruction position flag in the buffer register. Pre-fetch and decode the next instruction or several instructions after the instruction currently being fetched, and if the pre-fetched instruction is a branch instruction, further calculate the branch destination address, and pre-read the instruction from the branch destination address. It is characterized by being made to do. below,
The present invention will be explained with reference to the drawings.

第2図bは本発明における分岐命令の動作を示す図であ
り、図中、分岐先命令の先取りシーケンスにおけるDP
ステートは分岐先命令の先取りのための分岐命令解読ス
テート、RPステートは分.岐先命令のアドレスを求め
るためのインデックス、ベースレジスタの読み出しステ
ート、iはアドレス発生ステート、Bl,B2は、記憶
装置からの読み出しステートである。
FIG. 2b is a diagram showing the operation of a branch instruction in the present invention.
The state is the branch instruction decoding state for prefetching the branch destination instruction, and the RP state is the branch instruction decoding state for prefetching the branch destination instruction. The index for determining the address of the branch destination instruction, the read state of the base register, i is the address generation state, and B1 and B2 are the read states from the storage device.

第2図bに示すように、現在の命令位置が命令0であり
、命令0から・数命令後の命令が、分岐命令であつた場
合、命令0の1サイクル後に、分岐命令の先取りのため
にDPステートを始める。DPステートで解読された分
岐命令が、分岐しない分岐命令である場合(その命令自
身が無効である場合など)には、RPステートには進ま
ない。それ以外の場合、RP,l,Bl,B2と進め分
岐先命令を先取りしておく。この場合、前後の命令、命
令0〜3には、何等影響を及ぼさない。第3図により後
述するように、4つの命令バッファレジスタIWR,I
WRC,IBRl,n3ROがもうけられており、この
先取り動作以前に取り込んでおいた第3図の命令バッフ
ァレジスタIWRの内容は、IWRCに退避させておく
。続いて先取りした分岐命令をIWRに取り込む。
As shown in FIG. 2b, if the current instruction position is instruction 0 and the instruction several instructions after instruction 0 is a branch instruction, one cycle after instruction 0, the prefetch of the branch instruction is performed. DP state begins. If the branch instruction decoded in the DP state is a branch instruction that does not branch (such as when the instruction itself is invalid), the process does not proceed to the RP state. In other cases, advance to RP, l, Bl, B2 and prefetch the branch destination instruction. In this case, the preceding and succeeding instructions, instructions 0 to 3, are not affected in any way. As described later in FIG. 3, four instruction buffer registers IWR, I
WRC, IBR1, and n3RO are created, and the contents of the instruction buffer register IWR shown in FIG. 3, which were taken in before this prefetching operation, are saved in IWRC. Subsequently, the prefetched branch instruction is taken into the IWR.

従つて分岐命令に後続する命令は、IWRClIBRl
,IBROに入つており、先取した分岐先命令は■WR
に入つている事になる。分岐命令を実行する時、先取り
した分岐先命令が有効であれば、分岐命令の後続命令3
の1サイクル後に分岐先命令を始める。
Therefore, the instruction following the branch instruction is IWRClIBRl
, is in IBRO, and the prefetched branch destination instruction is ■WR
This means that it is included in the . When executing a branch instruction, if the prefetched branch destination instruction is valid, the instruction 3 following the branch instruction
The branch destination instruction begins one cycle after.

そして分岐命令の八ステートで処理装置内の分岐条件と
M1フィールドを比較し、分岐するか否かを決定する。
従がつて分岐を判断するB2ステートまでは、1サイク
ル毎に命令を実行することになる。B2ステートで分岐
判断が決定すれば、分岐判断に従がつて分岐先の命令ま
たは命令3のいずれかをキャンセルし、以後残つた片方
の命令を続行する。さらに本発明では分岐命令が無条件
分岐であれば、或いは分岐することがRステートで判定
できる場合には分岐命令の2サイクル後に、分岐先命令
を開始する。(第2図C参照)以上述べた分岐先命令の
先取り動作を行なうことによつて従来5サイクルかかつ
ていた分岐命令が2サイクルに短縮出来る。
Then, in the eight states of the branch instruction, the branch condition within the processing unit and the M1 field are compared to determine whether or not to branch.
Therefore, until the B2 state where a branch is determined, instructions are executed every cycle. If a branch decision is made in the B2 state, either the branch destination instruction or instruction 3 is canceled in accordance with the branch decision, and the remaining instruction is continued. Furthermore, in the present invention, if the branch instruction is an unconditional branch, or if branching can be determined from the R state, the branch destination instruction is started two cycles after the branch instruction. (See FIG. 2C) By performing the above-described prefetching of the branch destination instruction, the conventional branch instruction, which used to take five cycles, can be shortened to two cycles.

さらに、先取りした分岐先命令が、有効である場合には
、分岐命令における分岐先アドレス発生ステート(第2
図b(7)Aステート)において分岐命令により示され
る分岐先アドレス(X2)+(B2)+D2にさらに先
取りされた分岐命令長Lを加えて次の命令取り出しを行
なう。
Furthermore, if the prefetched branch destination instruction is valid, the branch destination address generation state (second
In FIG. b (7) A state), the next instruction is taken out by adding the prefetched branch instruction length L to the branch destination address (X2)+(B2)+D2 indicated by the branch instruction.

実際にはRステートでD2+LをやつておいてAステー
トで(X2)及び(B2)と加算する。このことは、分
岐後の命令が命令バッファに大量に入つていることにな
る。命令処理を間断なく行なう事が出来る。次に、第3
図は第2図bに示すタイムチャートを実行するための本
発明による実施例の命令パンファ部のブロック図であり
、図中、1〜4は各々8バイト長の命令バッファレジス
タ、5〜8は4つの命令バッファレジスタ内の命令位置
を示すフラグ(IPF)で1命令バッファレジスタに対
して4つのフラグを持つものである。
Actually, D2+L is created in the R state and added to (X2) and (B2) in the A state. This means that a large number of instructions after the branch are stored in the instruction buffer. Instructions can be processed without interruption. Next, the third
The figure is a block diagram of the instruction breadthreader section of the embodiment according to the present invention for executing the time chart shown in FIG. The flags (IPF) indicate the instruction positions in the four instruction buffer registers, and there are four flags for one instruction buffer register.

フラグ5が命令バッファレジスタIWRlに、フラグ6
が命令バッファレジスタIWRC2に、フラグ7が命令
バッファレジスタIBRlに、フラグ8が命令バッファ
レジスタIBROにそれぞれ対応する。9は次に記憶装
置から読出してくる8バイトに対して命令の先頭位置を
予想するフラグ(NEXTIPF)である。
Flag 5 is stored in instruction buffer register IWRl, flag 6 is stored in instruction buffer register IWRl.
corresponds to instruction buffer register IWRC2, flag 7 corresponds to instruction buffer register IBRl, and flag 8 corresponds to instruction buffer register IBRO. 9 is a flag (NEXTIPF) for predicting the leading position of the instruction for the next 8 bytes to be read from the storage device.

10〜12は4つの命令バッファレジスタのどの位置か
ら命令を取り出すかを指示するポインタ(NSIP)で
あり、このポインタは1つの命令をバイブラインに入れ
るたびに、さらに次の命令を選択するために移行してい
く。
10 to 12 are pointers (NSIP) that indicate from which position in the four instruction buffer registers the instruction is taken out, and each time one instruction is placed in the vibe line, the pointer is used to select the next instruction. It will transition.

13は後続命令先頭位置検出回路、14は命令位置検出
回路、15は命令選択発生回路、16はセレクタ、18
は命令レジスタ、17はデコーダである。
13 is a subsequent instruction head position detection circuit, 14 is an instruction position detection circuit, 15 is an instruction selection generation circuit, 16 is a selector, and 18
is an instruction register, and 17 is a decoder.

まず、記憶装置からIWRlに入力された8バイトのデ
ータを2バイト単位に区切り、各2バイトの先頭の2ビ
ットとNEXTIPF9の値とを命令位置検出回路14
に入力し命令の位置を検出し、IPF5のIpl2〜I
pl5にセットする。
First, the 8-byte data input to IWRl from the storage device is divided into 2-byte units, and the first 2 bits of each 2-byte and the value of NEXTIPF9 are sent to the instruction position detection circuit 14.
, detect the position of the command, and input the Ipl2 to I of IPF5.
Set to pl5.

この場合、NEXTIPF9は最初Nl2のポインタが
セットされている。2バイト単位で区切つたのは、命令
の最小長が2バイトであるためであり、各2バイトの先
頭の2ビットを識別するのは各命令中の先頭位置にある
0Pコードの最初の2ビットにより命令長が識別される
ためである。
In this case, the pointer Nl2 is initially set in NEXTIPF9. The reason why the instruction is divided into 2-byte units is because the minimum length of an instruction is 2 bytes, and the first 2 bits of each 2-byte are identified by the first 2 bits of the 0P code at the beginning position of each instruction. This is because the instruction length is identified.

このようにして、例えば、IWRlに2バイト長の命令
が4個人力されれば】Pl2〜1p15はすべて“1゛
となり、IWRlに4バイト長の命令が2個人力されれ
ば1p12とFpl4が“1゛となりIWRlに2バイ
ト長の命令が1個と6バイト長の命令が1個人力されれ
ばIpl2とIpl3が゜“1゛となる。NEXTIP
F9は次に1WR1に読出してくる命令の先頭位置を示
すものてあり、IPF5内の1P12〜1p15と現在
のIWRlの上記各2ビットによつて作成される。
In this way, for example, if four 2-byte length instructions are input to IWRl, Pl2 to 1p15 will all become "1", and if two 4-byte length instructions are input to IWRl, 1p12 and Fpl4 will be If one 2-byte long instruction and one 6-byte long instruction are input to IWRl, Ipl2 and Ipl3 become ``1''. NEXTIP
F9 indicates the head position of the next instruction to be read to 1WR1, and is created by the above two bits of 1P12 to 1p15 in IPF5 and the current IWR1.

例えば、IPF5内のIpl4が“゜1゛、Ipl5が
゜゜0゛で、かつ、Ipl4に対応するIWRl内の2
ビットが当該命令が6バイト長であることを示している
とき、後続命令先頭位置検出回路13の制御により、N
EXTIPF9においてはNl3が6゜1゛にセットさ
れる。つまり、この例ではIWRlに、Ipl4に対応
する位置から4バイト分の命令が入力されているが、残
りの2バイトは次の記憶装置からの読出しでIpl2に
対応する位置にセットされるとともに、その次の命令は
Ipl3に対応する位置から始まることを示している。
IPF5内のIpl2〜Ipl5は、■IRlの内容が
■IRC2およびIBRl、IBROとシフトす・るの
に同期して、IPF6、IPF7、IPF8へシフトし
ていく。したがつて、■PF5〜8は4つの命令バッフ
ァレジスタ内のそれぞれの命令位置を示していることに
なる。通常、命令を実行する場合には、実行すべき命令
はNSIPlO〜12に示される命令バッファレジスタ
IWR,IWRC,IBRl,IBROのいずれかの位
置からセレクタ16を通して選択される。
For example, Ipl4 in IPF5 is "゜1゛", Ipl5 is "゜゜0゛", and 2 in IWRl corresponding to Ipl4 is
When the bit indicates that the instruction is 6 bytes long, the following instruction start position detection circuit 13 controls the N
In EXTIPF9, Nl3 is set to 6°1°. In other words, in this example, 4 bytes worth of instructions are input to IWRl from the position corresponding to Ipl4, but the remaining 2 bytes are set to the position corresponding to Ipl2 in the next read from the storage device, and It shows that the next instruction starts from the position corresponding to Ipl3.
Ipl2 to Ipl5 in IPF5 shift to IPF6, IPF7, and IPF8 in synchronization with the contents of ■IRl shifting to ■IRC2, IBR1, and IBRO. Therefore, PF5 to PF8 indicate the respective instruction positions in the four instruction buffer registers. Normally, when an instruction is to be executed, the instruction to be executed is selected through the selector 16 from one of the positions of the instruction buffer registers IWR, IWRC, IBRl, and IBRO shown in NSIPlO-12.

セレクタ16はNSIPlO〜12を入力とする命令選
択発生回路15により制御される。この選択動作は2サ
イクル毎に行なわれ、選択された命令は順次バイブライ
ンに入れられ、第2図b図示のDステートより処理が開
始される。一方、分岐先命令を先取りする場合において
は、NSIPlO〜12とともにIPF5〜8の内容を
命令選択発生回路15に入力し、セレクタ16を通して
命令バッファから命令を選択し、デコーダ17に入力し
、分岐可能な命令かどうかを解析する。
The selector 16 is controlled by an instruction selection generation circuit 15 which receives NSIPlO-12 as input. This selection operation is performed every two cycles, and the selected instructions are sequentially put into the vibe line, and processing starts from the D state shown in FIG. 2B. On the other hand, when a branch destination instruction is prefetched, the contents of IPF5 to 8 are inputted to the instruction selection generation circuit 15 along with NSIPlO to 12, the instruction is selected from the instruction buffer through the selector 16, and inputted to the decoder 17, and branching is possible. Analyze whether it is a valid instruction.

そして、分岐可能な命令であつた場合、2サイクルの間
隙をぬつて、第2図b図示のDPステートより命令デコ
ードを始め、分岐先アドレスを計算して、記憶装置に対
して命令取り出しを行なう。これらの動作を行なうこと
により分岐先命令の先取りを高速に行なうことが可能と
なる。ここで、分岐命令の中には、例えはブランチ・オ
ン・カウント命令の如き命令がある。即ち該命令の処理
のたびに上記M1で指示される分岐条件指示レジスタ■
の内容を1−1Jしてゆき、該減算結果が値ROョのと
きに分岐成功として分岐先アドレスの命令を実行する命
令がある。このような分岐命令の場合、上記分岐条件指
示レジスタの内容を予め調べJ1ョてあれば分岐成功で
あることが、わざわざ1−1Jしなくても判断すること
が可能となる。そして前述の命令先取り機能と組合わせ
れば、持ち時間を与えることなく通常の命令の場合と同
様に無駄なく次命令の実行に入ることが可能となる。但
し、一般に上述のインデクス・レジスタXR、ベース・
レジスタBRlおよび分岐条件指示レジスタMRは汎用
レジスタ群中にもうけられている。
If the instruction is a branchable instruction, instruction decoding is started from the DP state shown in FIG. . By performing these operations, it becomes possible to prefetch a branch destination instruction at high speed. Here, among the branch instructions, there is an instruction such as a branch on count instruction. That is, each time the instruction is processed, the branch condition instruction register ■ specified by the above M1
There is an instruction that increments the contents of 1-1J, and when the result of the subtraction is the value RO, the branch is considered successful and the instruction at the branch destination address is executed. In the case of such a branch instruction, by checking the contents of the branch condition instruction register in advance and checking J1, it is possible to determine that the branch is successful without going to the trouble of 1-1J. When combined with the above-mentioned instruction prefetch function, it becomes possible to start executing the next instruction without wasting any time, just as in the case of a normal instruction. However, in general, the above-mentioned index register XR, base register
Register BRl and branch condition instruction register MR are provided in the general-purpose register group.

従来の大型計算機ではアドレス計算用に2ボート、演算
用に2ボート合計4ボートの同様読出しが可能となつて
いるがそれぞれは専用化されているのでアドレス計算用
にXR,BRを読出しているRステートにおいてさらに
分岐条件チェック用にMRを同時読出しすることは不可
能である。しかし、汎用レジスタのボート数を増すか、
又は特願昭54−95727号にて提案した如く2ボー
ト汎用レジスタを2組設け、両者に同一内容を格納する
ように制御することにより、.Rステートにおいて?の
チェックが可能である。さらに後述の如く、分岐先命令
の先取りシーケンスDP,RP,i・・・・・・で求め
られた分岐先命令のアドレスを先取りアドレスレジスタ
TARに保持しておき、これに該分岐先命令の語長、あ
るいは一回の先取り語長Lを加えることで分岐先命令に
後続する命令のアドレスを求めるようにすれば、分岐命
令のRステートでは分岐先命令アドレスのBR,XRを
読出す必要がなくなるので、上記の如くの特殊な構成に
しなくても、MRの読出しが可能になる。
In conventional large-scale computers, it is possible to read out a total of 4 ports, 2 ports for address calculation and 2 ports for calculation, but since each port is dedicated, XR and BR are read for address calculation. It is not possible to simultaneously read the MR for branch condition checking in the state. However, if you increase the number of general-purpose register votes,
Alternatively, as proposed in Japanese Patent Application No. 54-95727, by providing two sets of 2-port general-purpose registers and controlling them so that the same contents are stored in both. In R-state? It is possible to check. Further, as described later, the address of the branch destination instruction obtained by the prefetch sequence DP, RP, i... of the branch destination instruction is held in the prefetch address register TAR, and the word of the branch destination instruction is stored in the prefetch address register TAR. If the address of the instruction that follows the branch destination instruction is determined by adding the length or one lookahead word length L, there is no need to read the BR and XR of the branch destination instruction address in the R state of the branch instruction. Therefore, the MR can be read without the special configuration as described above.

このように分岐命令のRステートで分岐が確定できる場
合、もしくはDステートですでに無条件分岐と判つた場
合には、Bl,B2ステートを持つことなく直ちに分岐
先命令を実行することができる。
In this way, if the branch can be determined in the R state of the branch instruction, or if the D state is already determined to be an unconditional branch, the branch destination instruction can be immediately executed without having the B1 and B2 states.

次に、第4図は、本発明による実施例の命令バッファ部
と実効アドレス計算部のブロック図であり、命令を命令
バッファに取込んでから実行アドレスを求めるまてを図
示したものである。
Next, FIG. 4 is a block diagram of an instruction buffer section and an effective address calculation section of an embodiment according to the present invention, illustrating the process from taking an instruction into the instruction buffer to finding an execution address.

第4図においては、第3図において図示した各種ポイン
タ、フラグ等を省略している。第4図において、第3図
と同一番号のものは同一物、20はバイブライン、21
はデコーダ、22は汎用レジスタ、23はインデツクレ
ジスタ(XR)、24はベースレジスタ(BR)、25
はデイスプレートレジスタ(DR)、26はアドレス計
算加算器、27は実効アドレスレジスタ28は先取アド
レスレジスタ(TAR)、29はセレクタである。第1
図に示す命令の0P部は命令レジスタ18内のAOに入
り、以下同様に、M1はA1に、X2はA2にB2はA
3に、D2はA4に入る。X2,B2で示されるレジス
タを各々汎用レジスタ22から読み出し、それぞれXR
23,BR24に入力し、またD2は直接A4からDR
25に入力し、アドレス計算加算器26により加算する
ことにより、実効アドレスが得られる。アドレス計算加
算器26から出力された実効アドレスは記憶装置へ送ら
れ、命令の先行読出しが行なわれる。本発明の一実施例
においては、分岐先命令の先取りシーケンスDP,RP
,i・・・・・・において上述の如くアドレス計算加算
器26で求めたアドレスをTAR28に保持しておき、
分岐命令2のR,Aステートではこの(TAR)とLと
を加算して分岐先に後続するアドレスを求める。
In FIG. 4, various pointers, flags, etc. illustrated in FIG. 3 are omitted. In Figure 4, the same numbers as in Figure 3 are the same, 20 is the vibe line, 21
is a decoder, 22 is a general-purpose register, 23 is an index register (XR), 24 is a base register (BR), 25
26 is a display plate register (DR), 26 is an address calculation adder, 27 is an effective address register 28 is a pre-fetch address register (TAR), and 29 is a selector. 1st
The 0P part of the instruction shown in the figure is stored in AO in the instruction register 18, and similarly, M1 is stored in A1, X2 is stored in A2, B2 is stored in A0, and so on.
3, D2 enters A4. Read the registers indicated by X2 and B2 from the general-purpose register 22, and
23, input to BR24, and D2 directly from A4 to DR
25 and is added by an address calculation adder 26 to obtain an effective address. The effective address output from the address calculation adder 26 is sent to the storage device, and advance reading of the instruction is performed. In one embodiment of the present invention, the prefetch sequence DP, RP of the branch target instruction
, i..., the address calculated by the address calculation adder 26 as described above is held in the TAR 28,
In the R and A states of branch instruction 2, this (TAR) and L are added to obtain the address following the branch destination.

従つてこのときXR,BRの読出しは不要なので、A1
レジスタの指示によつて汎用レジスタ22から分岐条件
指示レジスタ■を読出し、その内容がRlJか否かをチ
ェックするJlJであれば分岐条件成立とみなして直ち
に第3図のNSIPlOのビット8に゜゜1゛を立て、
分岐先命令3をIWRlより読出す。RlJてなければ
分岐命令2を後続する命令を先取りレジスタ2〜4中か
ら読出す。尚、分岐条件不成立の場合には上記(TAR
)+Lのアドレスの先取りは不要であることはいうまで
もない。
Therefore, it is not necessary to read XR and BR at this time, so A1
Read the branch condition instruction register ■ from the general-purpose register 22 according to the register instruction, and check whether the contents are RlJ or not. If it is JlJ, it is assumed that the branch condition has been met, and the bit 8 of NSIPlO in FIG. 3 is immediately set to ゜゜1. stand up,
Read branch destination instruction 3 from IWRl. If RlJ is not present, the instruction following branch instruction 2 is read from prefetch registers 2-4. In addition, if the branch condition is not satisfied, the above (TAR
It goes without saying that there is no need to prefetch the address of )+L.

上記したように、本発明によれば、命令バッファ内の現
在の命令位置から数命令後の命令を解読して分岐命令て
あつた場合には、分岐先命令を先取りし、また分岐条件
が早くに判明する場合には直ちに分岐先へ分岐するよう
にしたのて、従来方式と比較して分岐命令を高速に処理
することができ、情報処理装置の性能向上を計ることが
てきる。
As described above, according to the present invention, when a branch instruction is generated by decoding an instruction several instructions after the current instruction position in the instruction buffer, the branch destination instruction is prefetched, and the branch condition is set early. By immediately branching to the branch destination when a branch instruction is found, the branch instruction can be processed at a higher speed than in the conventional method, and the performance of the information processing device can be improved.

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

第1図は分岐命令の形式を示す図、第2図aは従来の分
岐命令の動作を示す図、第2図bは本発明における分岐
命令の動作を示す図、第3図は本発明による実施例の命
令バッファ部のブロック図、第4図は本発明による実施
例の命令バッファ部と実効アドレス計算部のブロック図
てある。
FIG. 1 is a diagram showing the format of a branch instruction, FIG. 2a is a diagram showing the operation of a conventional branch instruction, FIG. 2b is a diagram showing the operation of a branch instruction according to the present invention, and FIG. 3 is a diagram according to the present invention. FIG. 4 is a block diagram of an instruction buffer section and an effective address calculation section of an embodiment according to the present invention.

Claims (1)

【特許請求の範囲】[Claims] 1 複数の命令先取バッファレジスタを有し、所定サイ
クル数毎に順次命令を上記バッファレジスタより取出し
て実行開始し、上記命令バッファレジスタ中に分岐命令
の存在を検知すると、上記所定サイクル数の間のサイク
ルを利用して分岐先命令の先取りを行うシステムにおい
て、該分岐命令の実行過程における分岐先アドレス計算
ステート又は、それ以前に分岐条件の成立が確定した場
合には、該分岐命令から上記所定サイクル数後に上記先
取りした分岐先命令の実行を開始することを特徴とする
分岐命令先行制御方式。
1 It has a plurality of instruction prefetch buffer registers, and when instructions are sequentially taken out from the buffer registers every predetermined number of cycles and executed, and when the presence of a branch instruction is detected in the instruction buffer register, In a system that uses cycles to prefetch a branch destination instruction, if the branch destination address calculation state during the execution process of the branch instruction or the establishment of the branch condition is established before that, the predetermined cycle from the branch instruction A branch instruction advance control method characterized in that execution of the prefetched branch destination instruction is started after a few seconds.
JP10592880A 1980-07-31 1980-07-31 Branch instruction advance control method Expired JPS6058489B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10592880A JPS6058489B2 (en) 1980-07-31 1980-07-31 Branch instruction advance control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10592880A JPS6058489B2 (en) 1980-07-31 1980-07-31 Branch instruction advance control method

Publications (2)

Publication Number Publication Date
JPS5731050A JPS5731050A (en) 1982-02-19
JPS6058489B2 true JPS6058489B2 (en) 1985-12-20

Family

ID=14420511

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10592880A Expired JPS6058489B2 (en) 1980-07-31 1980-07-31 Branch instruction advance control method

Country Status (1)

Country Link
JP (1) JPS6058489B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60105050A (en) * 1983-11-11 1985-06-10 Fujitsu Ltd Pipeline control system

Also Published As

Publication number Publication date
JPS5731050A (en) 1982-02-19

Similar Documents

Publication Publication Date Title
US4827402A (en) Branch advanced control apparatus for advanced control of a branch instruction in a data processing system
JP2746549B2 (en) Computer system and operation method thereof
JP2875909B2 (en) Parallel processing unit
CA1204219A (en) Method and apparatus for prefetching instructions
US4476525A (en) Pipeline-controlled data processing system capable of performing a plurality of instructions simultaneously
JP3182438B2 (en) Data processor
JPH0460720A (en) Control system for condition branching instruction
KR930003124B1 (en) Apparatus for the control of branch instruction in pipeline system
JPS634208B2 (en)
JPH0743648B2 (en) Information processing equipment
JPS6058489B2 (en) Branch instruction advance control method
JPS586972B2 (en) information processing equipment
JPS6411973B2 (en)
JP2812610B2 (en) Pipeline control method
JP2944563B2 (en) Pipeline type information processing device
JP2778610B2 (en) Pipeline operation control method and system
JP3558481B2 (en) Data processing device
JP2503223B2 (en) Prior control method
JP3523407B2 (en) Information processing equipment
JPH02254541A (en) Control system for conditional branch instruction
JPH01271842A (en) Information processor
JPH024011B2 (en)
JPS60179844A (en) Instruction rereading control system
JPH0774992B2 (en) Data processing device
JPS6047618B2 (en) information processing equipment