JPH0315771B2 - - Google Patents

Info

Publication number
JPH0315771B2
JPH0315771B2 JP56047482A JP4748281A JPH0315771B2 JP H0315771 B2 JPH0315771 B2 JP H0315771B2 JP 56047482 A JP56047482 A JP 56047482A JP 4748281 A JP4748281 A JP 4748281A JP H0315771 B2 JPH0315771 B2 JP H0315771B2
Authority
JP
Japan
Prior art keywords
instruction
address
register
pointer
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP56047482A
Other languages
Japanese (ja)
Other versions
JPS57162032A (en
Inventor
Yoshihiro Mizushima
Kazuyuki Shimizu
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 JP4748281A priority Critical patent/JPS57162032A/en
Publication of JPS57162032A publication Critical patent/JPS57162032A/en
Publication of JPH0315771B2 publication Critical patent/JPH0315771B2/ja
Granted legal-status Critical Current

Links

Classifications

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

Description

【発明の詳細な説明】 本発明は電子計算機等における命令先行制御方
式に係り、特に複数の命令を同時並行処理するこ
とができるパイプライン先行制御方式をとる処理
装置におけるブランチ連係(BRANCH AND
LINK)命令の先行制御に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an instruction advance control method in electronic computers, etc., and in particular to branch linkage (BRANCH AND
This relates to advance control of LINK) instructions.

一般に電子計算機等によるデータ処理や計算処
理において、プログラム命令の実行速度を高速化
するために、先行制御方式がとられているが、特
に科学計算等の莫大な情報量を処理するために複
数の命令を同時並行処理するパイプライン先行制
御方式が用いられている。
Generally, in data processing and calculation processing using electronic computers, etc., a proactive control method is used to speed up the execution speed of program instructions. A pipeline advance control method is used in which instructions are processed in parallel.

通常このパイプライン先行制御方式において
は、1命令の実行サイクルを複数のサイクルに分
割し、その複数のサイクルの先頭から数サイクル
の処理が進むと、次の命令と並行して処理可能と
しているものであるが、比較的頻繁に使われる命
令としてその実行対象となる命令中にブランチ
(分岐)処理とその分岐した後の処理後に分岐前
の次命令に戻るためのブランチ連係命令(BAL)
がある。このブランチ連係命令(BRANCH
AND LINK)の実行において連係情報として現
プログラム状態語PSWからの情報(更新された
次の命令アドレス命令長コード(ILC)、条件コ
ード(CC)、プログラムマスクビビツトなど)を
命令で指定された汎用レジスタ(GPR)に格納
することを行なうが、連係情報の一部である“更
新された次の命令アドレス”は、ブランチ連係命
令の次の命令アドレスを示さなければならない。
しかし先行制御を行なつているため命令アドレス
レジスタ(IAR)は、現在実行中の命令アドレス
よりも数命令先を示しているので先行する命令長
だけ、修正しなければならない。このためブラン
チ連係命令全体の実行サイクルが長くなつてい
た。
Normally, in this pipeline advance control method, the execution cycle of one instruction is divided into multiple cycles, and after several cycles of processing have progressed from the beginning of the multiple cycles, it is possible to process the next instruction in parallel. However, as an instruction that is used relatively frequently, there is a branch linking instruction (BAL) that returns to the next instruction before the branch after branch processing during the instruction to be executed and the processing after the branch.
There is. This branch linkage instruction (BRANCH
AND LINK), information from the current program status word PSW (updated next instruction address instruction length code (ILC), condition code (CC), program mask bit, etc.) is specified by the instruction as linkage information. Although storing in the general purpose register (GPR) is performed, the "updated next instruction address" that is part of the linkage information must indicate the next instruction address of the branch linkage instruction.
However, since advance control is being performed, the instruction address register (IAR) indicates several instructions ahead of the instruction address currently being executed, so the length of the preceding instruction must be corrected. For this reason, the execution cycle of the whole branch linking instruction becomes long.

本発明は、上記連係情報の発生を早くし、ブラ
ンチ連係命令の実行サイクルを短縮させることを
目的としたものである。
An object of the present invention is to speed up the generation of the linkage information and shorten the execution cycle of branch linkage instructions.

上記目的を達成する為に、本発明は、複数の領
域に区分けされた命令先取りバツフア(IBR)を
複数個と、前記命令先取りバツフア(IBR)に対
応して設けられた前記複数の領域毎に命令の記憶
状態を示すポインタ(NSIP)を有すると供に、
前記命令先取りバツフアに命令がパイプラインに
先行して格納され、前記命令先取りバツフアに先
行して格納された命令アドレスを保持する命令ア
ドレスレジスタ(IAR)を有するパイプライン制
御計算機に於いて、前記領域内の命令がパイプラ
イン内に取り込まれた時に前記ポインタ
(NSIP)の値を更新し、且つ前記ポインタ
(NSIP)の値を前記命令読出しのための先行し
た命令アドレスを示す命令アドレスレジスタ
(IAR)の値と同期して更新せしめ、前記命令先
取りバツフア(IBR)からパイプライン内に取り
込まれた命令が、ブランチ・アンド・リンク命令
(BAL)である場合には、パイプライン内に次命
令を取り込まず且つ、前記ポインタ(NSIP)の
値を更新せず、先行した命令アドレスレジスタ
(IAR)の値より、ポインタ(NSIP)の値から
求めた命令先取りバツフア(IBR)内にある残り
バイト数を減算して戻り先アドレスを算出してか
らポインタ(NSIP)の更新を実行することを特
徴とする。
In order to achieve the above object, the present invention includes a plurality of instruction prefetch buffers (IBR) divided into a plurality of areas, and a plurality of instruction prefetch buffers (IBR) provided for each of the plurality of areas. In addition to having a pointer (NSIP) that indicates the storage state of the instruction,
In the pipeline control computer, an instruction is stored in the instruction prefetch buffer in advance of the pipeline, and the pipeline control computer has an instruction address register (IAR) that holds an instruction address stored in the instruction prefetch buffer in advance of the pipeline. an instruction address register (IAR) that updates the value of the pointer (NSIP) when the instruction in the instruction is taken into the pipeline, and that indicates the preceding instruction address for reading the instruction; If the instruction fetched into the pipeline from the instruction prefetch buffer (IBR) is a branch-and-link instruction (BAL), the next instruction is fetched into the pipeline. Also, without updating the value of the pointer (NSIP), subtract the remaining number of bytes in the instruction prefetch buffer (IBR) obtained from the value of the pointer (NSIP) from the value of the preceding instruction address register (IAR). The feature is that the pointer (NSIP) is updated after calculating the return destination address.

以下本発明を実施例によつて詳細に説明する。 The present invention will be explained in detail below with reference to Examples.

第1図は本発明の背景となる命令制御の説明図
である。図において、MEMはメモリ装置側を、
CPUは処理装置側を示し、メモリMEMには、複
数の命令群1〜7、1′〜3′やデータ(図示して
いない)が格納されている。処理装置CPUには、
現在の命令実行状況を示す現プログラム状態語
PSWを格納するレジスタ、パイプライン先行制
御を行なうために命令を保持する命令バツフアレ
ジスタIBR、複数の命令を並行処理するパイプラ
インPL、演算ユニツトALU、インデツクスレジ
スタX、ベースレジスタB、汎用レジスタGPR
等を備えている。現プログラム状態語PSWには、
次に実行すべき命令のアドレスを示す命令アドレ
スレジスタIAR、その命令の命令長コードICL
(例えば2byte命令、4byte命令等)、実行中の命令
の結果による条件コードCC、プログラムマスク
ビツトPMBなどから構成されている。この構成
において、例えば実行中の命令を(1)とすると、命
令バツフアレジスタIBRに先行制御として数ステ
ツプの命令が格納される(本例では命令(1)〜(4)が
格納されている)。そして現プログラム状態語
PSWの命令アドレスは矢線10で示すアドレス
a5を指示している。
FIG. 1 is an explanatory diagram of command control which is the background of the present invention. In the figure, MEM refers to the memory device side,
The CPU indicates the processing device side, and the memory MEM stores a plurality of instruction groups 1 to 7, 1' to 3' and data (not shown). The processing unit CPU includes
Current program status word indicating current instruction execution status
Register that stores PSW, instruction buffer register IBR that holds instructions for pipeline advance control, pipeline PL that processes multiple instructions in parallel, arithmetic unit ALU, index register X, base register B, general-purpose register GPR
etc. The current program state word PSW contains
Instruction address register IAR indicating the address of the next instruction to be executed, instruction length code ICL of that instruction
(for example, 2-byte instructions, 4-byte instructions, etc.), a condition code CC based on the result of the instruction being executed, a program mask bit PMB, etc. In this configuration, for example, if the instruction being executed is (1), several steps of instructions are stored in the instruction buffer register IBR as advance control (in this example, instructions (1) to (4) are stored). ). and the current program state word
The PSW instruction address is the address indicated by arrow 10
a 5 is indicated.

ここで命令が本発明に係るブランチ連係命令
BALであるとし、その分岐先が命令(1)′以降であ
るときに後述する如く、現プログラム状態語の命
令アドレスIARを矢線11で示すアドレスb1に変
更する処理、分岐した後に再び実行中の命令(1)の
次命令(2)に戻るための次命令2のアドレスa2を汎
用レジスタGPR等に格納する処理が必要となる。
Here, the instruction is a branch linkage instruction according to the present invention.
BAL, and when the branch destination is after instruction (1)', the process of changing the instruction address IAR of the current program state word to address b 1 shown by arrow 11, as described later, is executed again after branching. It is necessary to store the address a2 of the next instruction 2 in a general-purpose register GPR or the like in order to return to the instruction (2) following the instruction (1) in the instruction.

第2図はこのブランチ連係命令の構成例(1)及び
汎用レジスタに格納される次命令アドレス等の構
成例2を示す。図において、ブランチ連係命令1
は命令機能を示すオペランド部OP、汎用レジス
タ番号を指定する第1オペランド部R1、第2オ
ペランド部としてインデツクスレジスタ番号を示
す番号指定X2、ベースレジスタ番号を示す番号
指定B2、番地指定用D2から成り、メモリ装置内
のデータと処理装置内のレジスタ内容との演算を
行なう通称RX命令で構成されて、分岐先のアド
レスをインデツクスレジスタXの内容とベースレ
ジスタBの内容と固定値D2によりメモリの一番
地を指定可能とする。即ち分岐先の命令アドレス
を第1図の演算ユニツトで算出し、現プログラム
状態語PSWの命令アドレスレジスタの内容を更
新可能とする。一方次命令アドレス(分岐前のブ
ランチ連係命令の次命令アドレス)は、現プログ
ラム状態語の命令アドレス(例えば第1図のa5
から命令バツフアレジスタの命令数(2〜4の3
命令)を減算することにより求められ命令長コー
ドICL、条件コードCC、プログラムマスクビツ
トMASKとともに汎用レジスタ2に格納される。
普通の処理命令は第3図に示す如く、複数の命令
を同時並行して実行されていく。即ち第3図にお
いて、先に説明したように、各命令31〜35が
それぞれ複数の処理サイクルで処理される。D〜
Wは各サイクルでの各ステート(状態)を示し、
Dは命令の解読(デコード)を行なうステート、
Rはオペランドアドレスを求めるためのレジスタ
読み出しステート、A,Bは読み出されたレジス
タの内容から記憶装置にアクセスするためのオペ
ランドアドレスを発生し、メモリアクセスユニツ
トに対し、アクセス要求を出すステート、B2
求められたアドレスを使つて記憶装置にアクセス
するステート、E1,E2は読み出されたオペラン
ドデータを使つて演算を行なうステート、ストア
命令の場合は記憶装置にオペランドデータを格納
するステート、CKはデータのチエツクを行なう
ステート、Wは演算の行なわれた結果を各種レジ
スタに書き込みを行なうステートである。そして
各サイクル中2サイクル毎に異つた命令がパイプ
ラインに入る事が出来、図中のt方向、即ち時間
の経過方向にDステート、Rステートの2サイク
ル処理後に次命令が並行処理される。
FIG. 2 shows a configuration example (1) of this branch link instruction and a configuration example 2 of the next instruction address etc. stored in the general-purpose register. In the figure, branch linkage instruction 1
The operand part OP indicates the instruction function, the first operand part R1 specifies the general-purpose register number, the second operand part is the number specification X 2 indicating the index register number, the number specification B 2 indicating the base register number, and the address specification. D 2 , it consists of a so-called RX instruction that performs operations on data in the memory device and register contents in the processing device, and sets the branch destination address to the contents of index register X, base register B, and a fixed value. D 2 allows you to specify the first location in memory. That is, the instruction address of the branch destination is calculated by the arithmetic unit shown in FIG. 1, and the contents of the instruction address register of the current program state word PSW can be updated. On the other hand, the next instruction address (the next instruction address of the branch linked instruction before branching) is the instruction address of the current program state word (for example, a 5 in Figure 1).
From the number of instructions in the instruction buffer register (3 of 2 to 4)
instruction) and is stored in the general-purpose register 2 along with the instruction length code ICL, condition code CC, and program mask bit MASK.
As shown in FIG. 3, ordinary processing instructions are executed in parallel. That is, in FIG. 3, each of the instructions 31 to 35 is processed in a plurality of processing cycles, as described above. D~
W indicates each state in each cycle,
D is a state where instructions are decoded;
R is a register read state for obtaining an operand address, A and B are states for generating an operand address for accessing a storage device from the contents of the read register and issuing an access request to the memory access unit, and B 2 is the state in which the storage device is accessed using the obtained address, E 1 and E 2 are the states in which the operation is performed using the read operand data, and in the case of a store instruction, the state in which the operand data is stored in the storage device. , CK is a state in which data is checked, and W is a state in which the results of operations are written into various registers. A different instruction can enter the pipeline every two cycles in each cycle, and the next instruction is processed in parallel after two cycles of D state and R state are processed in the t direction in the figure, that is, in the time elapsed direction.

しかし、かかる先行制御の下にブランチ連係命
令の場合には先に説明したように、現処理命令の
次命令アドレスを算出しあらかじめ汎用レジスタ
に格納しておかなければならない。この制御を第
4図の従来のブランチ連係命令の動作制御図によ
り説明する。第4図において、A1は先行制御で
先に実行している命令の処理ステートを示し、ブ
ランチ連係命令BALが命令A1のDステート、R
ステートの2サイクル実行後、先行してパイプラ
インPLに入力されたことを示す。ここでブラン
チ連係命令BALはデコードステートD、レジス
タ読出しステートRでブランチ連係命令であるこ
とが解決されて、第2図で説明した如く、次命令
アドレスの算出のために(1)〜(3)の3フローに展開
して実行される。
However, in the case of a branch-linked instruction under such advance control, the next instruction address of the currently processed instruction must be calculated and stored in a general-purpose register in advance, as described above. This control will be explained with reference to FIG. 4, which is an operation control diagram of a conventional branch linkage instruction. In FIG. 4, A1 indicates the processing state of the instruction that is executed first in advance control, and the branch linked instruction BAL is the D state of instruction A1, and the R
Indicates that the state is input to the pipeline PL in advance after two cycles of execution. Here, it is determined that the branch link instruction BAL is a branch link instruction in the decode state D and the register read state R, and as explained in FIG. The process is expanded into three flows and executed.

(1)のフローはブランチ先の命令アドレスを求め
て、ブランチ先命令を記憶装置から取り出すフロ
ーで、(2)のフローはダミーフロー、(3)のフローで
連係情報を求め、演算ユニツトを経由して命令で
指定された汎用レジスタ(GPR)に書き込む動
作を行なう。“更新された次の命令アドレス”を
求める方法として従来は(3)のフローで示すように
先行した命令アドレスを示す命令アドレスレジス
タ(IAR)から何バイト先行しているかを示すカ
ウンタ(HCTR)の値を引きそれにブランチ連
係命令自身の命令長を加えることによつて求めて
いた。即ち、ブランチ連係命令が実行されると、
それ以前の命令で例えば汎用レジスタGPRA、
GPRBの内容がベースレジスタBR、インデツク
スレジスタXRに格納されているので、ブランチ
連係命令の第2オペランド部分の固定値D2をデ
イスプレイスメントレジスタDRに格納し、分岐
先の実効アドレス発生アダーEAGで各レジスタ
の内容を加算することにより分岐先の命令アドレ
スを出力する。この分岐先の命令アドレスは実効
アドレスレジスタEAR、ワークアドレスレジス
タへと送られるとともにメモリアクセスユニツト
MAUへ分岐先命令アドレスを送出し、メモリ装
置からの該当のアドレスの命令を受け取つて命令
ワードレジスタへ格納される。次に現プログラム
状態語PSWにより、ブランチ連係命令の次命令
アドレスを算出するためにダミーフロー(2)を設け
ていた。A/Wはサイクルを遅らせるための底ち
ステート(Wait State)である。
Flow (1) is a flow to find the branch destination instruction address and retrieve the branch destination instruction from the storage device, flow (2) is a dummy flow, and flow (3) is a flow to find linkage information and take it through the arithmetic unit. and writes to the general-purpose register (GPR) specified by the instruction. Conventionally, as a method for determining the "updated next instruction address," as shown in flow (3), a counter (HCTR) that indicates how many bytes precedes the instruction address register (IAR) that indicates the previous instruction address is used. It was calculated by subtracting the value and adding to it the instruction length of the branch linking instruction itself. That is, when a branch linkage instruction is executed,
For example, general purpose register GPRA,
Since the contents of GPRB are stored in the base register BR and index register The branch destination instruction address is output by adding the contents of each register. The instruction address of this branch destination is sent to the effective address register EAR and the work address register, as well as to the memory access unit.
It sends the branch destination instruction address to the MAU, receives the instruction at the corresponding address from the memory device, and stores it in the instruction word register. Next, a dummy flow (2) is provided to calculate the next instruction address of the branch link instruction using the current program state word PSW. A/W is a bottom state (Wait State) for delaying the cycle.

次のフロー(3)のIARは命令取り出しを行なうの
に使われるレジスタで最後に取り出された命令群
の先頭アドレスを示しており、現在実行中の命令
アドレスよりも先行したアドレスを示している
(第1図参照)。HCTRは、この先行した命令ア
ドレスと現在実行中の命令アドレスとの差を保持
しているカウンタでIAR−HCTRが現在実行中
の命令アドレスである。
The IAR in the next flow (3) is a register used to fetch instructions and indicates the start address of the last instruction group fetched, and indicates an address that precedes the address of the instruction currently being executed ( (See Figure 1). HCTR is a counter that holds the difference between the preceding instruction address and the currently executing instruction address, and IAR-HCTR is the currently executing instruction address.

HCTRは命令の終了時点でその命令長(ILC)
だけ減算されるようになつており、ブランチ連係
命令で、次のアドレスを求める場合、この減算さ
れたHCTRを使うため前の命令においてHCTR
が更新されるまでフロー(3)を遅らせていた。そし
てフロー(3)で現プラグラム状態語PSWの命令ア
ドレス(即ち、先行した命令アドレスを示す)の
命令アドレスレジスタIAR、ブランチ連係命令の
命令長BLを格納したコンスタントレジスタKR、
更新されたハーフワードカウンタHCTRの内容
を格納したデイスプレスメントレジスタDRによ
り実効アドレス発生アダ−EAGを介してその出
力を実行アドレスレジスタEAR、ワークアドレ
スレジスタWAR、第2オペランドレジスタ2Rへ
順次移される。
HCTR is the instruction length (ILC) at the end of the instruction.
When calculating the next address with a branch link instruction, this subtracted HCTR is used, so the HCTR of the previous instruction is
Flow (3) was delayed until it was updated. Then, in flow (3), the instruction address register IAR of the instruction address of the current program state word PSW (that is, indicating the preceding instruction address), the constant register KR storing the instruction length BL of the branch linking instruction,
The displacement register DR, which stores the updated contents of the halfword counter HCTR, sequentially transfers its output to the execution address register EAR, work address register WAR, and second operand register 2R via the effective address generation adder EAG.

この第2オペランドレジスタ2Rには現プログ
ラム状態語PSWのILC、CC、MASKの制御情報
も入力されて演算ユニツトALU内をシストして
汎用レジスタGPRに格納されていた。ここで一
番の問題となるのは、ハーフワードカウンタ
HCTRの更新待ち、即ち先の命令の命令長の減
算処理が終るまでフロー(3)に移れないことであ
る。従がつてブランチ先の命令を開始するのが遅
くなり、ブランチ連係命令の性能を悪くする要因
となつていた。
Control information for ILC, CC, and MASK of the current program status word PSW is also input to the second operand register 2R, and is stored in the general-purpose register GPR after being stored in the arithmetic unit ALU. The biggest problem here is the halfword counter
The problem is that it is not possible to proceed to flow (3) until the HCTR is updated, that is, the instruction length subtraction process of the previous instruction is completed. As a result, the start of the branch destination instruction is delayed, which is a factor that deteriorates the performance of branch linking instructions.

本発明においては、従来の方法とは全く違う手
段で命令アドレスを発生することによつてブラン
チ連係命令の処理速度、性能の向上を計るように
したものである。
In the present invention, the processing speed and performance of branch-linked instructions are improved by generating instruction addresses by means completely different from conventional methods.

第5図は、本発明の一実施例である先行制御方
式の命令バツフアレジスタの構成図である。図に
おいて、IBR1〜IBR3は命令バツフアレジスタで
各バツフアレジスタは8バイト構成のものを示
す。NSIP0−3、NSIP4−7、NSIP8−11は各
バツフアレジスタの各2バイトに対応させて、例
えば1ビツト単位の指示ポインタを示す。
FIG. 5 is a diagram showing the structure of an instruction buffer register of the advance control system according to an embodiment of the present invention. In the figure, IBR1 to IBR3 are instruction buffer registers, and each buffer register has an 8-byte configuration. NSIP0-3, NSIP4-7, and NSIP8-11 correspond to each 2 bytes of each buffer register and indicate, for example, instruction pointers in units of 1 bit.

SECは選択回路でポインタNSIP0−11で制御
されパイプラインPLに入力される。そして、複
数の命令バツフアレジスタIBR1〜IBR3に対し
各々2バイト単位にポインタ(NSIP)を持た
せ、このポインタは命令バツフアの内容が命令バ
ツフアレジスタ3→2→1とシフトするのに同期
してシフトするようにしておく。命令バツフアレ
ジスタ内の命令がパイプラインに取り込まれたな
らば、前記ポインタNSIPが次の命令の先頭に移
る様に構成されている。
SEC is a selection circuit controlled by pointers NSIP0-11 and input to the pipeline PL. Then, a pointer (NSIP) is provided in 2-byte units for each of the multiple instruction buffer registers IBR 1 to IBR 3 , and this pointer is used to shift the contents of the instruction buffer register from instruction buffer register 3 to 2 to 1. Make sure to shift in sync. When the instruction in the instruction buffer register is taken into the pipeline, the pointer NSIP is configured to move to the beginning of the next instruction.

つまり、選択回路SECは、NSIP0−11を入力
し、前記ポインタが“1”になつているもの、即
ち、ポインタが“1”に対応する位置の命令バツ
フアレジスタIBRから命令をパイプラインPLに
取り込む。そして、前記命令がパイプラインPL
に取り込まれたら、パイプラインPLかの制御信
号により、前記ポインタNSIPが次の命令の先頭
に移る。
In other words, the selection circuit SEC inputs NSIP0-11 and transfers the instruction from the instruction buffer register IBR whose pointer is set to "1", that is, the instruction buffer register IBR located at the position corresponding to the pointer "1", to the pipeline PL. take in. And the said instruction is pipeline PL
When the command is fetched into the instruction, the control signal from the pipeline PL moves the pointer NSIP to the beginning of the next instruction.

本発明の主なる特徴は、従来使つていた
HCTRの代わりにこのポインタを使つて先行し
た命令のアドレスと現在実行中の命令アドレスと
の差を求め、これを先行した命令アドレス
(IAR)から引くことによつて、ブランチ連係命
令(ブランチ・アンド・リンク命令(BAL))の
後続の命令アドレスを求めようとしたものであ
る。
The main feature of the present invention is that
This pointer is used instead of the HCTR to determine the difference between the address of the previous instruction and the address of the currently executing instruction, and this is subtracted from the previous instruction address (IAR). - An attempt was made to find the instruction address following the link instruction (BAL).

具体的には、IARは最後に取り出された命令バ
ツフア群の先頭を示している。このIARの値から
命令バツフアレジスタIBR1〜IBR3にある。バイ
ト数から既にパイプラインに取り込まれたバイト
数を除いた残りのバイト数を引けば、後続の命令
の先頭アドレスを求めることを出来るのである。
(上記演算については、後述する。) この演算の最中には、パイプラインに後続の命
令を入力しない。又、ポインタNSIPの更新を停
止する。即ち、前記命令先取りバツフア(IBR)
からパイプライン内に取り込まれた命令が、ブラ
ンチ・アンド・リンク命令(BAL)である場合
には、次命令を次サイクルで前記命令先取りバツ
フアレジスタに取り込まず、先行した命令アドレ
ス(IAR)の値よりポインタ(NSIP)の値から
求めた命令バツフアレジスタIBR1〜IBR3内にあ
る残りバイト数を減算して戻り先アドレスを算出
してからポインタの更新を実行するのである。
Specifically, IAR indicates the beginning of the last instruction buffer group. The value of this IAR is stored in instruction buffer registers IBR 1 to IBR 3 . By subtracting the number of bytes remaining after subtracting the number of bytes already taken into the pipeline from the number of bytes, the start address of the subsequent instruction can be found.
(The above operation will be described later.) During this operation, no subsequent instructions are input to the pipeline. Also, update of the pointer NSIP is stopped. That is, the instruction prefetch buffer (IBR)
If the instruction fetched into the pipeline is a branch-and-link instruction (BAL), the next instruction is not fetched into the instruction prefetch buffer register in the next cycle, and the previous instruction address (IAR) is The pointer is updated after calculating the return destination address by subtracting the remaining number of bytes in the instruction buffer registers IBR 1 to IBR 3 obtained from the value of the pointer (NSIP).

パイプラインPLに命令が取り込まれた際に、
命令のオペコードをデコードするが、そのデコー
ド処理により、命令がBAL命令かどうかが判る。
その結果によつて、パイプラインPLから、ポイ
ンタNSIPへの制御信号を停止すれば、ポインタ
は更新されない。
When an instruction is fetched into the pipeline PL,
The instruction's opcode is decoded, and the decoding process determines whether the instruction is a BAL instruction or not.
Depending on the result, if the control signal from the pipeline PL to the pointer NSIP is stopped, the pointer will not be updated.

一例を述べると、命令バツフアレジスタのバイ
ト数を各々8バイトとし、後述のブランチ連係命
令のアドレス修正値を発生する時点において
(B1ステート)、もしポインタの値が2であつた
とすると(この時、ポインタは既にブランチ連係
命令の次の命令を指している)、既にパイプライ
ンに取り込まれたバイト数は4バイトである。従
がつて命令バツフアレジスタIBR1〜3上にある
残りのバイト数は、16−4=12バイトということ
になる。この値を、IARから引けばブランチ連係
命令に後続する命令の先頭アドレスを求めること
が出来。IAR−12の演算は演算ユニツトを使つて
行なう。
To give an example, if the number of bytes in each instruction buffer register is 8 bytes, and the pointer value is 2 at the time when the address correction value of the branch linking instruction described below is generated (B1 state), (at this time , the pointer is already pointing to the next instruction after the branch-linked instruction), and the number of bytes already taken into the pipeline is 4 bytes. Therefore, the remaining number of bytes in the instruction buffer registers IBR1-3 is 16-4=12 bytes. By subtracting this value from IAR, you can find the start address of the instruction following the branch-linked instruction. IAR-12 operations are performed using an arithmetic unit.

この本発明のブランチ連係命令における先行制
御方式を第6図で説明する。第6図は本発明の先
行制御方式の動作制御の説明図である。図におい
て第4図に用いた符号と同じものは同一物を示
す。従来の制御(第4図)と異なるのは、ブラン
チ連係命令の次命令アドレスを求める所にある。
The advance control system for branch linkage instructions of the present invention will be explained with reference to FIG. FIG. 6 is an explanatory diagram of operation control using the advance control method of the present invention. In the figures, the same reference numerals as those used in FIG. 4 indicate the same parts. The difference from the conventional control (FIG. 4) is that the next instruction address of the branch linked instruction is determined.

第5図で説明したポインタ(NSPI)によりバ
ツフアレジスタIBRにある実行時の命令の位置情
報(即ちポインタ(NSPI)値)アドレス修正値
回路に入力し、該回路減算すべき命令のバイト数
(あるいはワード数)を第1オペランドレジスタ
1Rへ出力し、一方現プログラム状態語PSWの先
行した命令アドレスの格納されている命令アドレ
スレジスタIAR、命令語長ILC、条件コードCC、
マスクビツトMASK等を第2オペランドレジス
タ2Rへ格納する。この命令サイクルは先のカウ
ンタ(HCTR)により命令実行終了時まで待つ
ことなく、ポインタNSIPの制御でどの時点でも
アドレスの補正値を発生可能とし、従来の方式の
如くダミーフローは必要なくなる。そして演算ユ
ニツトでは、IAR−アドレス修正値の演算を行な
い結果を結果レジスタ(RR)に出力し、その値
を第2図イで示すR1部で示されるレジスタに書
き込む。
Using the pointer (NSPI) explained in FIG. 5, the position information of the instruction at the time of execution (i.e., the pointer (NSPI) value) in the buffer register IBR is input to the address correction value circuit, and the number of bytes of the instruction to be subtracted ( or the number of words) in the first operand register.
1R, and instruction address register IAR, which stores the instruction address preceding the current program status word PSW, instruction word length ILC, condition code CC,
Store the mask bit MASK etc. to the second operand register 2R. In this instruction cycle, the address correction value can be generated at any time under the control of the pointer NSIP without having to wait until the end of instruction execution using the previous counter (HCTR), eliminating the need for a dummy flow as in the conventional system. Then, the arithmetic unit performs the IAR-address correction value operation, outputs the result to the result register (RR), and writes the value to the register indicated by the R1 section shown in FIG. 2A.

以上の動作を行なうことにより従来3フロー必
要としていたものが、1フローで出来、本実施例
ではサイクル数も3サイクル短縮することが出来
る。
By performing the above operations, what conventionally required three flows can be done in one flow, and in this embodiment, the number of cycles can also be shortened by three cycles.

以上説明したように、本発明によれば複数の命
令を同時に並行的に処理する先行制御方式におい
て、複数の命令バツフアレジスタとその命令を取
り出す指示ポインタにより、ブランチ連係情報の
一部である命令アドレスを容易に求めることがで
き、且つ命令実行速度を高速とできる。従つて計
算機の処理速度向上が図れ、情報処理等にきわめ
て有益であり、計算機の大型化つまり情報量拡大
も図れる。
As explained above, according to the present invention, in the advance control method that processes multiple instructions simultaneously and in parallel, instructions that are part of branch linkage information are The address can be easily determined and the instruction execution speed can be increased. Therefore, the processing speed of the computer can be improved, which is extremely useful for information processing, etc., and the computer can be made larger, ie, the amount of information can be expanded.

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

第1図は本発明の背景となる命令制御の説明
図、第2図は一例としてのブランチ連係命令の構
成図イと汎用レジスタの構成図ロ、第3図はパイ
プライン先行制御の一例を示す説明図、第4図は
従来のブランチ連係命令の動作制御図、第5図は
本発明の先行制御方式の命令バツフアレジスタの
構成図、第6図は本発明の先行制御方式の動作制
御の説明図である。 IBR:命令バツフアレジスタ、NSIP:指示ポ
インタ、SEL:選択回路、PL:パイプライン。
FIG. 1 is an explanatory diagram of instruction control that is the background of the present invention, FIG. 2 is a block diagram of a branch-linked instruction as an example, and block diagram B of a general-purpose register, and FIG. 3 is an example of pipeline advance control. 4 is an operational control diagram of a conventional branch linkage instruction, FIG. 5 is a configuration diagram of an instruction buffer register in the advance control method of the present invention, and FIG. 6 is a diagram of operation control in the advance control method of the present invention. It is an explanatory diagram. IBR: Instruction buffer register, NSIP: Instruction pointer, SEL: Selection circuit, PL: Pipeline.

Claims (1)

【特許請求の範囲】 1 複数の領域に区分けされた命令先取りバツフ
ア(IBR)を複数個と、前記命令先取りバツフア
(IBR)に対応して設けられた前記複数の領域毎
に命令の記憶状態を示すポインタ(NSIP)を有
すると供に、前記命令先取りバツフアに命令がパ
イプラインに先行して格納され、前記命令先取り
バツフアに先行して格納された命令アドレスを保
持する命令アドレスレジスタ(IAR)を有するパ
イプライン制御計算機に於いて、 前記領域内の命令がパイプライン内に取り込ま
れた時に前記ポインタ(NSIP)の値を更新し、
且つ前記ポインタ(NSIP)の値を前記命令読出
しのための先行した命令アドレスを示す命令アド
レスレジスタ(IAR)の値と同期して更新せし
め、 前記命令先取りバツフア(IBR)からパイプラ
イン内に取り込まれた命令が、ブランチ・アン
ド・リンク命令(BAL)である場合には、パイ
プライン内に次命令を取り込まず且つ、前記ポイ
ンタ(NSIP)の値を更新せず、先行した命令ア
ドレスレジスタ(IAR)の値より、ポインタ
(NSIP)の値から求めた命令先取りバツフア
(IBR)内にある残りバイト数を減算して戻り先
アドレスを算出してからポインタ(NSIP)の更
新を実行することを特徴とする先行制御方式。
[Claims] 1. A plurality of instruction prefetch buffers (IBR) divided into a plurality of areas, and a memory state of instructions for each of the plurality of areas provided corresponding to the instruction prefetch buffers (IBR). an instruction address register (IAR) that holds an instruction address stored in the instruction prefetch buffer in advance of the pipeline, and an instruction address stored in the instruction prefetch buffer in advance of the pipeline; A pipeline control computer having: updates the value of the pointer (NSIP) when an instruction in the area is taken into the pipeline;
The value of the pointer (NSIP) is updated in synchronization with the value of the instruction address register (IAR) indicating the preceding instruction address for reading the instruction, and the value of the pointer (NSIP) is updated in synchronization with the value of the instruction address register (IAR) indicating the preceding instruction address for reading the instruction, and the value of the pointer (NSIP) is updated in synchronization with the value of the instruction address register (IAR) indicating the preceding instruction address for reading the instruction. If the instruction is a branch-and-link instruction (BAL), the next instruction is not taken into the pipeline, the value of the pointer (NSIP) is not updated, and the previous instruction address register (IAR) is The feature is that the return destination address is calculated by subtracting the number of remaining bytes in the instruction prefetch buffer (IBR) obtained from the value of the pointer (NSIP) from the value of the pointer (NSIP), and then the pointer (NSIP) is updated. Advance control method.
JP4748281A 1981-03-31 1981-03-31 Advance controlling system Granted JPS57162032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4748281A JPS57162032A (en) 1981-03-31 1981-03-31 Advance controlling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4748281A JPS57162032A (en) 1981-03-31 1981-03-31 Advance controlling system

Publications (2)

Publication Number Publication Date
JPS57162032A JPS57162032A (en) 1982-10-05
JPH0315771B2 true JPH0315771B2 (en) 1991-03-01

Family

ID=12776343

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4748281A Granted JPS57162032A (en) 1981-03-31 1981-03-31 Advance controlling system

Country Status (1)

Country Link
JP (1) JPS57162032A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5576446A (en) * 1978-12-06 1980-06-09 Toshiba Corp Pre-fetch control system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5576446A (en) * 1978-12-06 1980-06-09 Toshiba Corp Pre-fetch control system

Also Published As

Publication number Publication date
JPS57162032A (en) 1982-10-05

Similar Documents

Publication Publication Date Title
US4725947A (en) Data processor with a branch target instruction storage
JP3105960B2 (en) A method of operating data in a register with a simplified instruction set processor
JP2951064B2 (en) Method of operating a pipeline processor and pipeline processor
JP3187090B2 (en) Byte comparison operation method for high performance processor
JP3055980B2 (en) Method for ensuring data integrity in a multiprocessor or pipeline processor system
US4827402A (en) Branch advanced control apparatus for advanced control of a branch instruction in a data processing system
JPH06110685A (en) Branch estimating method in high-performance processor
JP3182438B2 (en) Data processor
US4541047A (en) Pipelined data processing system
KR100303712B1 (en) Method and apparatus for an address pipeline in a pipelined machine
JP3599499B2 (en) Central processing unit
US6016544A (en) Apparatus and method for tracking changes in address size and for different size retranslate second instruction with an indicator from address size
JPH0315771B2 (en)
JPH02214937A (en) Data processor
JPS6284340A (en) Data processor
JPS60129839A (en) Information processor
JP2503223B2 (en) Prior control method
JPH01187634A (en) Information processing device
JPS6411973B2 (en)
JPH01255933A (en) Sweeping-out control system
JPH02254541A (en) Control system for conditional branch instruction
JPS586972B2 (en) information processing equipment
JPS6047618B2 (en) information processing equipment
JPS61273637A (en) Information processor
JPH06301538A (en) Condition branch instruction processor