JP2814683B2 - Instruction processing unit - Google Patents

Instruction processing unit

Info

Publication number
JP2814683B2
JP2814683B2 JP9810290A JP9810290A JP2814683B2 JP 2814683 B2 JP2814683 B2 JP 2814683B2 JP 9810290 A JP9810290 A JP 9810290A JP 9810290 A JP9810290 A JP 9810290A JP 2814683 B2 JP2814683 B2 JP 2814683B2
Authority
JP
Japan
Prior art keywords
instruction
flag
register
execution result
branch
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
JP9810290A
Other languages
Japanese (ja)
Other versions
JPH03218524A (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.)
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 JP9810290A priority Critical patent/JP2814683B2/en
Publication of JPH03218524A publication Critical patent/JPH03218524A/en
Application granted granted Critical
Publication of JP2814683B2 publication Critical patent/JP2814683B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、分岐予測先の命令の実行結果を使用してさ
らにその先の命令の処理を行う命令処理装置に関するも
のである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an instruction processing apparatus that uses an execution result of an instruction at a branch prediction destination to process an instruction further ahead.

(従来の技術) 従来の命令処理装置では、分岐予測先の命令をフェッ
チ、デコードするもの(例えば、IBM360/91命令処理装
置:D.W.Andreson,F.J.Sparacio,F.M.Tomasulo:“The IB
M System/360 Model 91:Machine Philosophy and Instr
uction Handling",IBM Hounal of Research & Develop
ment,pp.8−24,No.1,Mol.1,Jan.1967.)や分岐先が確定
していなくてもオペランドが揃った命令は実行するがそ
の実行結果は他の命令のソースオペランドにはならない
もの(例えば、「新風」命令処理装置:久我、村上、富
田:“「新風」プロセッサの高速化メカニズム”、情報
処理学会第37回全国大会講演論文集、4N−2,1988.)が
ある。これらの命令処理装置は、第16図に示すように、
命令記憶手段10、レジスタ書込み予約手段20、命令発行
手段40′,オペランドアクセス制御手段50,命令実行手
段60,分岐予測先命令実行結果格納手段70′及びレジス
タ80を備えているが、後述の本願装置の分岐予測先命令
実行結果格納手段からオペランド読出しをする手段を備
えていない。
(Prior Art) A conventional instruction processor fetches and decodes an instruction at a branch prediction destination (for example, IBM360 / 91 instruction processor: DWAndreson, FJSparacio, FMTomasulo: “The IB
M System / 360 Model 91: Machine Philosophy and Instr
uction Handling ", IBM Hounal of Research & Develop
ment, pp. 8-24, No. 1, Mol. 1, Jan. 1967.) and instructions with all operands are executed even if the branch destination is not determined, but the execution result is the source operand of another instruction. What does not work (for example, "Shinkaze" instruction processor: Kuga, Murakami, Tomita: "High speed mechanism of" Shinkaze "processor", Proc. Of the 37th Annual Conference of IPSJ, 4N-2, 1988.) These instruction processors are, as shown in FIG.
An instruction storage means 10, a register write reservation means 20, an instruction issuing means 40 ', an operand access control means 50, an instruction execution means 60, a branch prediction destination instruction execution result storage means 70', and a register 80 are provided. There is no means for reading the operand from the branch prediction destination instruction execution result storage means of the apparatus.

(発明が解決しようとする課題) しかしながら、従来の命令処理装置では、予測した分
岐先の命令実行は命令発行前の前処理のみであったり、
予測先の命令を実行してもこの実行結果を使用する命令
は分岐先が確定するまでは実行されなかった。このよう
な制約を加えることは、本来実行可能な命令を待たせる
ことになり、性能低下を及ぼすという問題点があった。
(Problems to be Solved by the Invention) However, in the conventional instruction processing device, the execution of the instruction at the predicted branch destination is only the pre-processing before issuing the instruction,
Even if the instruction at the prediction destination is executed, the instruction using the execution result is not executed until the branch destination is determined. There is a problem that adding such a constraint causes an executable instruction to wait, thereby deteriorating performance.

本発明の目的は、このような従来の問題点を除去し
て、分岐予測先の命令の実行結果を使用してさらにその
先の命令の処理を行う命令処理装置を提供することにあ
る。
SUMMARY OF THE INVENTION An object of the present invention is to provide an instruction processing apparatus that eliminates such a conventional problem and uses the execution result of an instruction at a branch prediction destination to further process the next instruction.

(課題を解決するための手段) 前述の問題点を解決するために本願第1の発明は; 分岐命令による分岐先の確定を待たずに分岐先アドレ
スを分岐予測方式において、処理すべき命令を記憶する
第1の手段と、命令の実行結果を書き込むレジスタとい
う第2の手段と、第1の手段より得られた命令が実行結
果として行なうレジスタへの書込みをあらかじめ予約す
る第3の手段と、第3の手段により予約された命令を保
持し、命令を発行する第4の手段と、第4の手段により
発行された命令を実行する第5の手段と、第5の手段と
第2の手段との間に配置される、予測されていながら確
定していない分岐先にある命令による実行結果を一時的
に保持する第6の手段と、第6の手段により保持された
実行結果を第2の手段へ転送する第7の手段と、第6の
手段により保持された実行結果を第4の手段がオペラン
ドとして読み出す第8の手段と、第2の手段により保持
された実行結果を第4の手段がオペランドとして読み出
す第9の手段とを備え、さらに第4の手段は、分岐先未
確定の分岐命令以前の命令系列保持する第10の手段と、
第10の手段に保持された命令と第3の手段により予約さ
れた命令を第5の手段に発行する第11の手段と、第3の
手段によるレジスタ書込み予約を受取り、第11の手段が
行う命令発行の履歴情報を受取り、第5の手段による分
岐先確定情報を受け取ることにより、第11の手段が行う
オペランドアクセスに対して、制御を加える第12の手段
を備え、予測された確定前の分岐先の命令の実行結果を
使用してさらにその先の命令の処理を行うことを特徴と
する。
(Means for Solving the Problems) In order to solve the above-mentioned problems, a first invention of the present application is provided: a branch destination address is determined by an instruction to be processed in a branch prediction method without waiting for a branch destination being determined by a branch instruction. First means for storing, second means of a register for writing an execution result of an instruction, third means for pre-reserving writing to a register to be executed by the instruction obtained by the first means as an execution result, Fourth means for holding an instruction reserved by the third means and issuing the instruction, fifth means for executing the instruction issued by the fourth means, fifth means and second means A means for temporarily storing an execution result of an instruction at a branch destination which has been predicted but not determined, and a second means for storing an execution result held by the sixth means. A seventh means for transferring to the means; Eighth means in which the fourth means reads the execution result held by the sixth means as an operand, and ninth means in which the fourth means reads the execution result held by the second means as an operand. A fourth means for holding an instruction sequence before a branch instruction whose branch destination is undetermined;
The eleventh means for issuing the instruction held by the tenth means and the instruction reserved by the third means to the fifth means, and receiving the register write reservation by the third means, and performing the eleventh means A twelfth means for controlling the operand access performed by the eleventh means by receiving instruction issue history information and receiving branch destination determination information by the fifth means, It is characterized in that the processing of the further instruction is performed using the execution result of the instruction of the branch destination.

また本願第2の発明は; 前記第10の手段を2つ以上備え、第3の手段により予
約された命令を、分岐命令を区切りとして複数の第10の
手段に対して、順次振り分けることを特徴とする。
Further, the second invention of the present application is characterized by comprising two or more of the tenth means, and sequentially allocating instructions reserved by the third means to a plurality of the tenth means with a branch instruction as a delimiter. And

また本願第3の発明は; 前記第2の手段と第6の手段と第7の手段と第8の手
段と第9の手段との代わりに、第2の手段と第9の手段
の組を2つ以上と、その複数の第2の手段に保持されて
いる値を互いに転送する手段とを備え、予測されていな
がら確定していない分岐先にある命令による実行結果
を、複数の第2の手段のいずれかに保持することを特徴
とする。
In addition, the third invention of the present application is a combination of the second means and the ninth means, instead of the second means, the sixth means, the seventh means, the eighth means and the ninth means. Means for transferring the values held in the plurality of second means to each other, and executing an execution result of an instruction at a branch destination which is predicted but not determined by a plurality of second means. It is characterized in that it is held in any of the means.

また本願第4の発明は; 前記第11の手段を2つ以上備えることにより、複数の
命令を同時に発行することを可能とすることを特徴とす
る。
A fourth invention of the present application is characterized in that: by providing two or more of the eleventh means, it is possible to issue a plurality of instructions simultaneously.

(作用) このような手段をとることによって、分岐命令以前の
命令系列と予測された分岐先の命令系列を可能な限り同
時に実行しながら、予測された確定前の分岐先の命令に
よる実行結果であってもオペランドとして使用すること
を可能とする。これにより、分岐命令の確定待ちによる
命令実行開始の遅延を抑えることができ、高速な処理を
可能とする。
(Operation) By taking such a means, while executing the instruction sequence before the branch instruction and the instruction sequence at the predicted branch destination at the same time as much as possible, the execution result by the predicted instruction at the branch destination before the decision is confirmed. Even if it is, it can be used as an operand. As a result, it is possible to suppress the delay of the instruction execution start due to the waiting for the determination of the branch instruction, thereby enabling high-speed processing.

(実施例) 第1図は本発明の一実施例を示す装置構成図である。
図中10は処理すべき命令を記憶する命令記憶手段であ
る。20は命令記憶手段10より得た命令が実行結果として
行うレジスタへの書込みをあらかじめ予約するレジスタ
書込み予約手段である。30はレジスタ書込み予約手段20
により処理された命令を複数保持できる先入れ先出し機
能を持つ命令保持手段であり、分岐先が確定し、実行さ
れることが確定している命令系列を保持する。40は命令
保持手段により保持された命令、もしくはレジスタ書込
み予約手段20により処理された、実行が確定していない
命令を発行する命令発行手段である。50は命令発行手段
40が行うオペランドアクセスに対し制御を加えるオペラ
ンドアクセス制御手段である。60は命令発行手段40によ
り発行された命令を実行する命令実行手段である。70は
命令実行手段60から出力される結果の内、実行が確定し
ていない命令による実行結果を一時的に保持する分岐予
測先命令実行結果格納手段である。80は命令実行手段60
から出力される結果の内、実行が確定している命令によ
る実行結果を保持するレジスタである。
(Embodiment) FIG. 1 is an apparatus configuration diagram showing an embodiment of the present invention.
In the figure, reference numeral 10 denotes an instruction storage means for storing an instruction to be processed. Reference numeral 20 denotes a register write reservation unit that reserves, in advance, writing to a register performed by the instruction obtained from the instruction storage unit 10 as an execution result. 30 is a register write reservation means 20
Is an instruction holding unit having a first-in first-out function capable of holding a plurality of instructions processed by the above, and holds an instruction sequence whose branch destination is determined and which is determined to be executed. Reference numeral 40 denotes an instruction issuing means for issuing an instruction held by the instruction holding means or an instruction which has been processed by the register write reservation means 20 and whose execution has not been determined. 50 is instruction issuing means
This is an operand access control means for adding control to the operand access performed by 40. Reference numeral 60 denotes an instruction executing means for executing the instruction issued by the instruction issuing means 40. Reference numeral 70 denotes a branch prediction destination instruction execution result storage unit that temporarily holds an execution result of an instruction whose execution has not been determined among the results output from the instruction execution unit 60. 80 is the instruction execution means 60
Is a register for holding an execution result of an instruction whose execution has been determined, among the results output from.

第2図はオペランドアクセス制御手段50の要部を示し
たものである。510はレジスタ書込み予約手段20により
設定されるレジスタを書込み履歴フラグであり、命令分
岐から次の分岐命令までを一つブロックとを考え、過去
から現在を通してブロック内で該レジスタに対して書込
み予約があったどうかを示す。520はレジスタ書込み予
約手段20により設定されるレジスタ書込み予約済フラグ
であり、現時点でブロック内で該レジスタに対して書込
み予約がされているかどうかを示す。530は命令発行手
段40により設定される命令発行済フラグであり、現時点
でブロック内で該レジスタに対して書込み予約をしてい
る命令が発行されているかでうかを示す。レジスタ書込
み履歴フラグ510、レジスタ書込み予約済フラグ520、命
令発行済フラグ530は同一の形式で、第3図に示すよう
に、レジスタの各要素に対応するフラグを持ち、さらに
確定している命令用と確定していない命令用との2種類
のフラグセットを備える。この2種類のフラグレジスタ
を区別するため、A側、B側という用語を用いる。命令
分岐から次の命令分岐までの一つのブロックには、A側
かB側のどちらか一方が割り当てられる。この割り当て
該ブロックに含まれる全命令の終了時に解放され、次の
ブロックに割り当てることができるようになる。540は
レジスタ書込み履歴フラグ510、レジスタ書込み予約済
フラグ520、命令発行済フラグ530における2種類のフラ
グセットの内、どちら側が確定している命令用であるか
を示す確定命令系列フラグである。すなわち、現在実行
中のA側かB側のどちら側が実行が確定している命令系
列なのかを示す。これにより、該ブロックが割り当てら
れている側が、確定命令系列540が規定する側と一致し
ていれば該ブロックの実行は確定しているものと判定す
ることができる。550は命令発行手段40が行なうオペラ
ンドアクセスに対して情報を与えるオペランド読出し判
定回路であり、オペランド読出しを分岐予測先命令実行
結果格納手段70とレジスタ80のどちらかから行うという
読出し元の情報と、読出しを行って良いかという読出し
可否の情報とを、レジスタ書込み履歴フラグ510、レジ
スタ書込み予約済フラグ520、命令発行済フラグ530、確
定命令系列フラグ540による値から作成する。この読出
し情報の判定流れ図を第4図に示す。第4図において、
レジスタ書込み履歴フラグ510をWH、レジスタ書込み予
約済フラグ520をWB、命令発行済フラグ530をIB、確定命
令系列フラグ540をFP、該ブロック側をBlk、該ブロック
の反対側をrBlk、判定する該レジスタ番号をRegで表
す。特に、レジスタ書込み履歴フラグ510、レジスタ書
込み予約済フラグ520、命令発行済フラグ530について
は、例えば、「レジスタ書込み予約済フラグ520の、該
ブロック側のフラグセットの、該レジスタ番号が示すフ
ラグ」を、WB(Blk,Reg)という形で表す。
FIG. 2 shows a main part of the operand access control means 50. Reference numeral 510 denotes a register set by the register write reservation means 20 as a write history flag, which considers a block from an instruction branch to the next branch instruction as one block. Indicates whether there was. Reference numeral 520 denotes a register write reserved flag which is set by the register write reservation means 20 and indicates whether or not a write reservation has been made for the register in the block at the present time. Reference numeral 530 denotes an instruction issued flag set by the instruction issuing means 40, and indicates whether or not an instruction which is currently reserved for writing to the register in the block is issued. The register write history flag 510, the register write reserved flag 520, and the instruction issued flag 530 have the same format and have flags corresponding to each element of the register, as shown in FIG. And two types of flag sets for instructions not determined. In order to distinguish the two types of flag registers, the terms A side and B side are used. One block from the A side or the B side is assigned to one block from the instruction branch to the next instruction branch. This allocation is released at the end of all instructions included in the block, and can be allocated to the next block. Reference numeral 540 denotes a finalized instruction sequence flag indicating which side of the two types of flag sets, the register write history flag 510, the register write reserved flag 520, and the instruction issued flag 530, is for which instruction is finalized. In other words, it indicates which side of the currently executed A or B side is the instruction sequence whose execution has been determined. Thus, if the side to which the block is assigned matches the side specified by the fixed instruction sequence 540, it can be determined that the execution of the block is fixed. Reference numeral 550 denotes an operand read determination circuit that gives information to operand access performed by the instruction issuing means 40, and information of a read source that performs operand read from either the branch prediction destination instruction execution result storage means 70 or the register 80; Information on whether or not reading is permitted is created from the values of the register write history flag 510, the register write reserved flag 520, the instruction issued flag 530, and the fixed instruction sequence flag 540. FIG. 4 shows a flowchart for determining the read information. In FIG.
The register write history flag 510 is set to WH, the register write reserved flag 520 is set to WB, the instruction issued flag 530 is set to IB, the fixed instruction sequence flag 540 is set to FP, the block side is Blk, and the other side of the block is rBlk. The register number is represented by Reg. In particular, for the register write history flag 510, the register write reserved flag 520, and the instruction issued flag 530, for example, the "flag indicated by the register number of the flag set on the block side of the register write reserved flag 520" , WB (Blk, Reg).

以上のような構成の命令処理装置において、本発明の
内容を説明するために、まず実行されることが確定して
いる命令を処理する際の動作を説明する。命令は命令記
憶手段10から読み出され、その命令が実行結果として行
うレジスタへの書込みを、レジスタ書込み予約手段20に
より予約する。レジスタ書込みの予約の予約操作では、
レジスタ書込み履歴フラグ510とレジスタ書込み予約済
フラグ520の両方に対して、該ブロック側フラグセット
の該書込みレジスタ番号の示すフラグを設定する。ここ
で設定されたフラグの内、レジスタ書込み履歴フラグ51
0は該ブロックの終了時、すなわち次の分岐命令までの
全命令が終了した時点で解除され、レジスタ書込み予約
済フラグ520は該命令が終了した時点で解除される。レ
ジスタ書込み予約手段20により予約が完了した命令は、
命令保持手段30に保持され、命令発行を待つ。命令保持
手段30に保持されていた命令は、命令発行手段40におい
てオペランドアクセスを行ない、これに成功したものは
命令実行手段60に転送される。ここで行われるオペラン
ドアクセスにあたって、読出しに関する情報を、オペラ
ンドアクセス制御手段50より受け取る。このときオペラ
ンドアクセス制御手段50では、第4図の流れ図に沿って
判定が下される。まず、該ブロックと確定命令系列フラ
グ540の比較が行われ(ステップ101)、これが一致して
いることから、該ブロックは実行されることが確定して
いることがわかる。そして、命令発行済フラグ530の該
ブロック側フラグセットの該読出しレジスタ番号の示す
フラグを判定し(ステップ102)、このフラグが解除さ
れた状態であれば、レジスタ80への該オペランドアクセ
スを許可する。命令発行手段40から命令を発行すると同
時に、命令発行済フラグ530の該ブロック側フラグセッ
トの該書込みレジスタ番号の示すフラグを設定する。命
令発行手段40から発行された命令は命令実行手段60にお
いて該命令が規定する動作を行ない、その実行結果を生
成する。命令実行手段60において生成された実行結果
は、レジスタ80に格納され、実行を終了する。命令の実
行終了時には、レジスタ書込み予約済フラグ520と命令
発行済フラグ530の両方に対して、該ブロック側フラグ
セットの該書込みレジスタ番号の示すフラグを解除す
る。
In order to explain the contents of the present invention in the instruction processing device having the above-described configuration, first, an operation when processing an instruction that is determined to be executed will be described. The instruction is read from the instruction storage means 10, and writing to the register performed by the instruction as an execution result is reserved by the register write reservation means 20. In the reservation operation of register write reservation,
For both the register write history flag 510 and the register write reserved flag 520, the flag indicated by the write register number in the block side flag set is set. Of the flags set here, the register write history flag 51
0 is released at the end of the block, that is, when all instructions up to the next branch instruction are completed, and the register write reserved flag 520 is released when the instruction is completed. The instruction whose reservation has been completed by the register write reservation means 20 is
The instruction is held in the instruction holding means 30 and waits for an instruction to be issued. The instruction held in the instruction holding means 30 is accessed by the instruction issuing means 40 for operand access, and a successful instruction is transferred to the instruction executing means 60. In the operand access performed here, information on reading is received from the operand access control means 50. At this time, the operand access control means 50 makes a determination according to the flowchart of FIG. First, the block is compared with the determined instruction sequence flag 540 (step 101), and since they match, it is known that the block is determined to be executed. Then, the flag indicated by the read register number of the block side flag set of the instruction issued flag 530 is determined (step 102). If the flag is released, the operand access to the register 80 is permitted. . At the same time as issuing the instruction from the instruction issuing means 40, the flag indicated by the write register number in the block side flag set of the instruction issued flag 530 is set. The instruction issued from the instruction issuing means 40 performs the operation specified by the instruction in the instruction executing means 60, and generates an execution result. The execution result generated by the instruction execution means 60 is stored in the register 80, and the execution ends. At the end of the execution of the instruction, the flag indicated by the write register number in the block side flag set is canceled for both the register write reserved flag 520 and the instruction issued flag 530.

次に、分岐予測機構により予測された、実行が確定し
ていない命令を実行する場合の動作について説明する。
命令は命令記憶手段10さら読み出され、その命令が実行
結果として行うレジスタへの書込みを、レジスタ書込み
予約手段20により予約する。レジスタ書込みの予約操作
では、レジスタ書込み履歴フラグ510とレジスタ書込み
予約済フラグ520の両方に対して、該ブロック側の該書
込みレジスタ番号の示すフラグを設定する。ここで設定
されたフラグの内、レジスタ書込み履歴フラグ510は次
の分岐命令までの全命令が終了した時点で解除され、レ
ジスタ書込み予約済フラグ520は該命令が終了した時点
で解除される。レジスタ書込み予約手段20により予約が
完了した命令は、命令発行手段40においてオペランドア
クセスを行ない、これに成功したものは命令実行手段60
に転送される。ここで行われるオペランドアクセスにあ
たって、オペランド読出しを分岐予測先命令実行結果格
納手段70とレジスタ80のどちらから行うかという読出し
元の情報と、読出しを行って良いかという読出し可否の
情報とを、オペランドアクセス制御手段50より受け取
る。このときオペランドアクセス制御手段50では、第4
図の流れ図に沿って判定が下される。まず、該ブロック
と確定命令系列フラグ540の比較が行われ(ステップ10
1)、これが一致していないことから、該ブロックは実
行されることが確定しないことがわかる。次にレジスタ
書込み履歴フラグ510の該ブロック側フラグセットの該
読出しレジスタ番号の示すフラグを判定し(ステップ10
3)、このフラグが解除された状態であればオペランド
アクセスをレジスタ80から、設定された状態であればオ
ペランドアクセスを分岐予測先命令実行結果格納手段70
から行うように、命令発行手段40に伝える。さらにこの
オペランド読出し元情報を元に、オペランドアクセス制
御手段50が命令発行手段40に対して伝える、オペランド
アクセス許可情報を作成する。すなわち、もしレジスタ
80から読み出す場合であれば、レジスタ書込み予約済フ
ラグ520の該ブロックの反対側のフラグセットの該読出
しレジスタ番号の示すフラグを判定し(ステップ10
4)、このフラグが解除された状態であればレジスタ80
への該オペランドアクセスを許可する。もし、分岐予測
先命令実行結果格納手段70から読み出す場合であれば、
命令発行済フラグ530の該ブロック側フラグセットの該
レジスタ番号の示すフラグを判定し(ステップ105)、
このフラグが解除された状態であれば分岐予測先命令実
行結果格納手段70への該オペランドアクセスを許可す
る。命令発行手段40から命令を発行すると同時に、命令
発行済フラグ530の該ブロック側フラグセットの該書込
みレジスタ番号の示すフラグを設定する。命令発行手段
40から発行された命令は命令実行手段60において該命令
が規定する動作を行ない、その実行結果を生成する。命
令実行手段60において生成された実行結果は、分岐予測
先命令実行結果格納手段70に一時的に保持される。この
時点でとりあえず命令は終了したものとみなされ、レジ
スタ書込み予約済フラグ520と命令発行済フラグ530の両
方に対して、該ブロック側の該書込みレジスタ番号の示
すフラグを解除する。
Next, an operation in the case of executing an instruction whose execution has not been determined and predicted by the branch prediction mechanism will be described.
The instruction is read from the instruction storage means 10, and writing to the register performed by the instruction as an execution result is reserved by the register write reservation means 20. In the register write reservation operation, the flag indicating the write register number on the block side is set in both the register write history flag 510 and the register write reserved flag 520. Of the flags set here, the register write history flag 510 is released when all instructions up to the next branch instruction are completed, and the register write reserved flag 520 is released when the instruction is completed. The instruction whose reservation has been completed by the register write reservation unit 20 performs operand access in the instruction issuing unit 40, and the instruction execution unit 60
Is forwarded to In the operand access performed here, information of a read source indicating whether the operand is read from the branch prediction destination instruction execution result storage means 70 or the register 80 and information of whether or not the read can be read are stored in the operand. Received from access control means 50. At this time, the fourth operand access control means 50
The determination is made according to the flowchart in the figure. First, the block is compared with the fixed instruction sequence flag 540 (step 10).
1) Since this does not match, it can be seen that the block is not determined to be executed. Next, the flag indicated by the read register number of the block side flag set of the register write history flag 510 is determined (step 10).
3) If the flag is cleared, the operand access is performed from the register 80 if the flag is cleared, and if the flag is set, the operand access is performed from the branch prediction destination instruction execution result storage means 70.
To the instruction issuing means 40. Further, based on the operand read source information, the operand access control unit 50 creates operand access permission information to be transmitted to the instruction issuing unit 40. That is, if the register
In the case of reading from the block 80, the flag indicated by the read register number in the flag set opposite to the block of the register write reserved flag 520 is determined (step 10).
4) If this flag is cleared, register 80
Access to the operand. If reading from the branch prediction destination instruction execution result storage means 70,
A flag indicated by the register number of the block side flag set of the instruction issued flag 530 is determined (step 105).
If this flag is released, access to the branch prediction target instruction execution result storage means 70 is permitted. At the same time as issuing the instruction from the instruction issuing means 40, the flag indicated by the write register number in the block side flag set of the instruction issued flag 530 is set. Instruction issuing means
The instruction issued from 40 performs the operation specified by the instruction in the instruction executing means 60, and generates an execution result. The execution result generated by the instruction execution means 60 is temporarily stored in the branch prediction destination instruction execution result storage means 70. At this point, it is considered that the instruction has been completed, and the flag indicated by the write register number on the block side is released for both the register write reserved flag 520 and the instruction issued flag 530.

次に、分岐命令による分岐先が確定し、予測した分岐
先と一致していた時の動作を説明する。分岐命令の分岐
先が確定したら、その分岐命令以前の命令の実行終了を
待った後、分岐予測先命令実行結果格納手段70に一時的
に保持されていた実行結果をレジスタ80に転送する。す
べての転送が終了後、分岐予測先命令実行結果格納手段
70の全要素を解除する。レジスタ書込み履歴フラグ510
では、確定命令系列フラグ540が規定するフラグセット
を全要素解除する。その後、確定命令系列フラグ540を
反転させる。
Next, the operation when the branch destination by the branch instruction is determined and coincides with the predicted branch destination will be described. When the branch destination of the branch instruction is determined, the execution result temporarily stored in the branch prediction target instruction execution result storage means 70 is transferred to the register 80 after the execution of the instruction before the branch instruction is completed. After all transfers are completed, branch prediction destination instruction execution result storage means
Unlock all 70 elements. Register write history flag 510
Then, all the elements of the flag set defined by the fixed instruction sequence flag 540 are released. After that, the fixed instruction sequence flag 540 is inverted.

次に、分岐命令による分岐先が確定したが、予測した
分岐先と一致せず、分岐予測が失敗した時の動作を説明
する。分岐予測失敗を検知すると、分岐予測失敗した先
の命令の命令記憶手段10からの投入を停止し、命令実行
手段40にすでに投入されている分岐予測失敗した先の命
令の実行の終了を待ち、分岐予測先命令実行結果格納手
段70の全要素を解除する。レジスタ書込み履歴フラグ51
0、レジスタ書込み予約済フラグ520、命令発行済フラグ
530の全てにおいて、確定命令系列フラグ540が規定する
側の逆側のフラグセットを全要素解除する命令記憶10か
らは確定した分岐先の命令を投入し、実行が確定した命
令として実行を続行する。
Next, the operation when the branch destination is determined by the branch instruction but does not match the predicted branch destination and the branch prediction fails will be described. When the branch prediction failure is detected, the instruction from the instruction storage unit 10 of the instruction of the branch prediction failure is stopped, and the execution of the instruction of the branch prediction failure already input to the instruction execution unit 40 is terminated. All elements of the branch prediction destination instruction execution result storage means 70 are released. Register write history flag 51
0, Register write reserved flag 520, Instruction issued flag
In all of 530, the determined branch destination instruction is input from the instruction storage 10 for releasing all elements of the flag set on the side opposite to the side defined by the determined instruction series flag 540, and execution is continued as an instruction whose execution is determined. .

次に第5図に示すプログラムにおいて動作例を説明す
る。プログラム中の分岐命令については分岐を起こさな
い方に予測されているものとする。また、確定命令系列
フラグ540は初期値としてA側を指示するものとする。
つまり、最初に投入される命令から次の分岐命令まで
は、レジスタ書込み履歴フラグ510、レジスタ書込み予
約済フラグ520、命令発行済フラグ530におけるA、B2種
類のフラグセットの内、A側を使用する。まず第1サイ
クルでは命令(1)が命令記憶10から読み出されて、レ
ジスタ書込み予約手段20を通じて、命令(1)の書込み
レジスタr2に対応した、レジスタ書込み履歴フラグ510
とレジスタ書込み予約済フラグ520の両者のA側の2番
のフラグをONにする。第2サイクルでは命令(2)が命
令記憶手段10から読み出されて、レジスタ書込み予約手
段20を通じて、命令(2)の書込みレジスタr4に対応し
た、レジスタ書込み履歴フラグ510とレジスタ書込み予
約済フラグ520の両者のA側の4番のフラグをONにす
る。それと同時に、命令(1)が命令保持手段30により
保持される。第3サイクルでは、命令(3)が命令記憶
手段10から読み出されるが、命令(3)はレジスタ書込
みがないので、レジスタ書込み予約手段20は書込み予約
はしない。それと同時に命令(2)が命令保持手段30に
より保持される。それと同時に命令発行手段40において
命令(1)がオペランドr0とr1を読み出し、命令を発行
する。この時、命令発行済フラグのA側の0番と1番フ
ラグをチェックし、共にOFFであるのでオペランドアク
セスは成功する。命令発行時には、命令(1)の書込み
レジスタr2に対応した、命令発行済フラグ530の両者の
A側の2番のフラグをONにする。第4サイクルでは、命
令(4)が命令記憶手段10から読み出されて、レジスタ
書込み予約手段20を通じて、命令(4)の書込みレジス
タr5に対応した、レジスタ書込み履歴フラグ510とレジ
スタ書込み予約済フラグ520の両者のB側の5番のフラ
グをONにする。それと同時に命令(3)が命令保持手段
30により保持される。それと同時に命令発行手段40にお
いて命令(2)がオペランドr2とr3を読み出そうとする
が、命令発行済フラグのA側の2番のフラグがONになっ
ているため、オペランドアクセスは失敗し、命令発行手
段40に留まる。第4サイクルにおけるスナップショット
を第6図に示す。
Next, an operation example of the program shown in FIG. 5 will be described. It is assumed that the branch instruction in the program is predicted to be the one that does not cause a branch. Also, it is assumed that the fixed instruction series flag 540 indicates the A side as an initial value.
That is, from the first instruction to the next branch instruction, the A side is used from among the two flag sets of A and B in the register write history flag 510, the register write reserved flag 520, and the instruction issued flag 530. . First, in the first cycle, the instruction (1) is read from the instruction storage 10, and the register write history flag 510 corresponding to the write register r2 of the instruction (1) is read through the register write reservation means 20.
And the second flag on the A side of both the register write reserved flag 520 is turned ON. In the second cycle, the instruction (2) is read from the instruction storage means 10 and is passed through the register write reservation means 20 to the register write history flag 510 and the register write reserved flag 520 corresponding to the write register r4 of the instruction (2). The flag No. 4 on the A side of both is turned ON. At the same time, the instruction (1) is held by the instruction holding means 30. In the third cycle, the instruction (3) is read from the instruction storage means 10, but since the instruction (3) has no register write, the register write reservation means 20 does not make a write reservation. At the same time, the instruction (2) is held by the instruction holding means 30. At the same time, in the instruction issuing means 40, the instruction (1) reads the operands r0 and r1 and issues the instruction. At this time, the 0th and 1st flags on the A side of the instruction issued flag are checked, and since both are OFF, the operand access succeeds. When the instruction is issued, the second flag on the A side of both the instruction issued flags 530 corresponding to the write register r2 of the instruction (1) is turned ON. In the fourth cycle, the instruction (4) is read from the instruction storage means 10 and is passed through the register write reservation means 20 to the register write history flag 510 and the register write reserved flag corresponding to the write register r5 of the instruction (4). Turn on the No. 5 flag on the B side of both 520s. At the same time, the instruction (3) is the instruction holding means.
Held by 30. At the same time, the instruction (2) tries to read the operands r2 and r3 in the instruction issuing means 40, but the operand access fails because the second flag on the A side of the instruction issued flag is ON. Stay in the instruction issuing means 40. FIG. 6 shows a snapshot in the fourth cycle.

第5サイクルでは、命令(1)は演算実行を続け、命
令(2)は命令発行手段40に、命令(3)は命令保持手
段30に保持され続ける。命令(5)が命令記憶手段10か
ら読み出されて、レジスタ書込み予約手段20を通じて、
命令(5)の書込みレジスタr6に対応した、レジスタ書
込み履歴フラグ510とレジスタ書込み予約済フラグ520の
両者のB側の6番のフラグをONにする。命令(4)は、
まず命令(4)の読出しレジスタr0、r3に対応した、レ
ジスタ書込み履歴フラグ510のB側の0番と3番を判定
し、共にOFFであるので共にレジスタ80からオペランド
を読み出すことになる。そして、レジスタ書込み予約済
フラグ520のA側の0番と3番を判定し、共にOFFである
のでオペランドアクセスは成功し、命令発行手段40から
命令(4)が発行される。第6のサイクルでは命令
(6)が命令記憶手段10から投入される。それと同時に
命令発行手段40において命令(5)がオペランドr2とr3
を読み出そうとするが、命令発行済フラグのA側の2番
のフラグがONになっているため、オペランドアクセスは
失敗し、命令発行手段40に留まる。第7サイクルでは命
令(7)が命令記憶手段10から投入されようとするが、
レジスタ書込み予約手段20に命令(6)が留まっている
ため、投入できない。第8サイクルでは変化がない。第
8サイクルにおけるスナップショットを第7図に示す。
In the fifth cycle, the instruction (1) continues to execute the operation, the instruction (2) is kept in the instruction issuing means 40, and the instruction (3) is kept in the instruction holding means 30. The instruction (5) is read from the instruction storage means 10 and passed through the register write reservation means 20.
The B-side No. 6 flag of both the register write history flag 510 and the register write reserved flag 520 corresponding to the write register r6 of the instruction (5) is turned ON. Instruction (4) is
First, the numbers 0 and 3 on the B side of the register write history flag 510 corresponding to the read registers r0 and r3 of the instruction (4) are determined, and since both are OFF, the operand is read from the register 80. Then, No. 0 and No. 3 on the A side of the register write reserved flag 520 are determined. Since both are OFF, the operand access succeeds and the instruction issuing means 40 issues the instruction (4). In the sixth cycle, the instruction (6) is input from the instruction storage means 10. At the same time, in the instruction issuing means 40, the instruction (5) is changed to the operands r2 and r3.
However, since the second flag on the A side of the instruction issued flag is ON, the operand access fails and the instruction issuing means 40 remains. In the seventh cycle, the instruction (7) is about to be input from the instruction storage means 10, but
Since the instruction (6) remains in the register write reservation means 20, it cannot be input. There is no change in the eighth cycle. FIG. 7 shows a snapshot in the eighth cycle.

第9サイクルでは命令(1)の実行結果のレジスタ80
への書込みが起こり、レジスタ書込み予約済フラグ520
と命令発行済フラグのA側の2番をOFFにする。これに
より、命令発行済フラグのA側の2番がOFFになるのを
待っていた、命令発行手段40にある命令(2)と命令
(5)の両者のオペランドアクセスが成功するが、本実
施例では同時には1つの命令しか発行できない構成にな
っているため、確定系列側の命令(2)のみが発行され
る。第10サイクルでは命令(3)の発行が試みられる
が、命令(2)によって命令発行済フラグのA側の4番
がONにされているためオペランドアクセスに失敗し、命
令発行手段40に留まる。また第10サイクルでは前サイク
ルに保留された命令(5)の発行が行われる。これによ
って、第11サイクルでは命令(6)が命令発行手段40
に、命令(7)がレジスタ書込み予約手段20に進む。ま
た、命令(4)の実行結果の分岐予測先命令実行結果格
納手段70への書込みが起こり、レジスタ書込み予約済フ
ラグ520と命令発行済フラグ530のB側の5番をOFFにす
る。これにより、以下のように命令発行手段40にある命
令(6)にオペランドアクセスが成功し、命令(6)が
発行される。すなわち、レジスタ書込み履歴フラグ510
のB側の5番がONになっているため、オペランド読出し
分岐予測先命令実行結果格納手段70からであることがわ
かり、命令発行済フラグ530のB側の5番がOFFになった
ことによりオペランドアクセスが許可されたことにな
る。第11サイクルにおけるスナップショットを第8図に
示す。
In the ninth cycle, the register 80 of the execution result of the instruction (1) is used.
Write to register, register write reserved flag 520
And the 2nd on the A side of the instruction issued flag is turned off. As a result, the operand access of both the instruction (2) and the instruction (5) in the instruction issuing means 40, which has been waiting for the instruction issued flag 2 on the A side to be turned off, succeeds. In the example, since only one instruction can be issued at a time, only the instruction (2) on the definite series side is issued. In the tenth cycle, issuance of the instruction (3) is attempted, but operand access fails because instruction # 2 of the instruction issued flag is turned ON by the instruction (2), and the instruction remains in the instruction issuing means 40. In the tenth cycle, the instruction (5) held in the previous cycle is issued. As a result, in the eleventh cycle, the instruction (6) is
Then, the instruction (7) proceeds to the register write reservation means 20. Further, the execution result of the instruction (4) is written into the branch prediction destination instruction execution result storage means 70, and the register write reserved flag 520 and the instruction issued flag 530 on the B side are turned off. As a result, the operand access to the instruction (6) in the instruction issuing means 40 succeeds as described below, and the instruction (6) is issued. That is, the register write history flag 510
Is turned on from the B-side No. 5 of the operand read, and it is known from the operand read branch prediction destination instruction execution result storage means 70 that the B-side No. 5 of the instruction issued flag 530 is turned off. Operand access is permitted. FIG. 8 shows a snapshot in the eleventh cycle.

第12サイクルから第14サイクルの間は変化が起こらな
い。第15サイクルでは命令(2)の実行結果のレジスタ
80への書込みが起こり、レジスタ書込み予約済フラグ52
0と命令発行済フラグ530のA側の4番をOFFにする。こ
れにより、命令発行済フラグのA側の4番がOFFになる
のを待っていた、命令発行手段40にある命令(3)が発
行される。第16サイクルでは命令(2)の、そして第17
サイクルでは命令(6)の実行結果の分岐予測先命令実
行結果格納手段70への書込みが起こり、レジスタ書込み
予約済フラグ520と命令発行済フラグ530のB側の6番と
7番をOFFにする。これにより、第17サイクルでは、命
令発行済フラグのB側の7番がOFFになるのを待ってい
た、命令発行手段40にある命令(7)が発行される。第
18サイクルでは変化がない。第19サイクルでは、命令
(3)の実行が終了し、予測した分岐先に確定するの
で、分岐予測先命令実行結果格納手段70からレジスタ80
への転送を行う。このとき分岐予測先命令実行結果格納
手段70内には、命令(4),(5),(6)による実行
結果r5,r6,r7があり、転送はこの3つについて行われ
る。転送後、分岐予測先命令実行結果格納手段70は解除
される。そして、レジスタ書込み履歴フラグのA側を全
要素解除し、確定命令系列フラグ540の規定する値をA
側からB側に反転する。これにより、次の第20サイクル
ではA側が新たに使用できるようになるので命令(8)
が命令記憶10から投入される。第20サイクルにおけるス
ナップショットを第9図に示す。
No change occurs between the 12th and 14th cycles. In the 15th cycle, the register of the execution result of instruction (2)
A write to 80 occurs and the register write reserved flag 52
0 and the instruction issue flag 530 on the A side 4 are turned off. As a result, the instruction (3) in the instruction issuing means 40, which has been waiting for the A-side No. 4 of the instruction issued flag being turned OFF, is issued. In the 16th cycle, the instruction (2) and the 17th cycle
In the cycle, the execution result of the instruction (6) is written into the branch prediction destination instruction execution result storage means 70, and the register write reserved flag 520 and the instruction issued flag 530 on the B side are turned OFF. . Thus, in the seventeenth cycle, the instruction (7) in the instruction issuing means 40, which has been waiting for the B-side of the instruction issued flag to be turned off, is issued. No.
There is no change in 18 cycles. In the nineteenth cycle, the execution of the instruction (3) is completed and the predicted branch destination is determined.
Transfer to. At this time, in the branch prediction destination instruction execution result storage means 70, there are execution results r5, r6, and r7 by the instructions (4), (5), and (6), and the transfer is performed for these three. After the transfer, the branch prediction destination instruction execution result storage means 70 is released. Then, all elements of the register write history flag A are released, and the value specified by the fixed instruction sequence flag 540 is changed to A.
From the side to the B side. As a result, the A side can be newly used in the next 20th cycle.
Is input from the instruction memory 10. FIG. 9 shows a snapshot in the 20th cycle.

第21サイクルでは、命令(7)の実行が終了し、予測
した分岐先に確定する。但し、このとき分岐予測先命令
実行結果格納手段70内には書込みが起きていないので、
分岐予測先命令実行結果格納手段70からレジスタ80への
転送は行われない。そして、レジスタ書込み履歴フラグ
のB側を全要素解除し、確定命令系列フラグ540の規定
する値をB側からA側に反転する。命令(8)は第21サ
イクルで発行され、第26サイクルで終了し、プログラム
が終了する。プラグラムの開始から終了までのタイムチ
ャートを第10図に示す。
In the 21st cycle, the execution of the instruction (7) ends, and the predicted branch destination is determined. However, at this time, since no writing has occurred in the branch prediction destination instruction execution result storage means 70,
The transfer from the branch prediction destination instruction execution result storage means 70 to the register 80 is not performed. Then, all elements on the B side of the register write history flag are released, and the value specified by the fixed instruction sequence flag 540 is inverted from the B side to the A side. The instruction (8) is issued in the 21st cycle, ends in the 26th cycle, and the program ends. A time chart from the start to the end of the program is shown in FIG.

以上、本願発明による命令処理装置において、命令の
処理過程について説明した。
In the foregoing, the instruction processing process in the instruction processing device according to the present invention has been described.

次に、第1図の1つの命令保持手段30の代わりに2つ
の命令保持手段31,32を使用した場合の本発明の他の一
実施例を第11図により説明する。
Next, another embodiment of the present invention in which two instruction holding units 31, 32 are used instead of one instruction holding unit 30 in FIG. 1 will be described with reference to FIG.

第11図は、本発明による命令処理装置の一実施例であ
る。図において2つの命令保持手段31,32を備えている
以外は、前述した第1図の本発明による命令処理装置の
実施例と同じ構成となっている。本構成では、レジスタ
書込み予約手段20により予約が完了した命令は、分岐命
令を区切りとして、命令保持手段AもしくはBに保持さ
れる。例えば、初めに命令保持手段Aに保持されていっ
た命令系列では、分岐命令の次の命令以降を命令保持手
段Bに保持し、またその次の分岐命令の次の命令以降を
命令保持手段Aに保持していく。これにより、第5図の
プログラムの例では、命令(7)は第10サイクルまで命
令記憶10から投入できなかったが、命令保持手段を2つ
使用した本発明では第6サイクルにおいて投入が可能と
なる。レジスタを2つ使用した場合の本発明のさらに他
の一実施例を第12図により説明する。
FIG. 11 shows an embodiment of the instruction processing apparatus according to the present invention. In the drawing, the configuration is the same as that of the above-described embodiment of the instruction processing apparatus according to the present invention shown in FIG. 1 except that two instruction holding units 31 and 32 are provided. In this configuration, an instruction whose reservation has been completed by the register write reservation unit 20 is held in the instruction holding unit A or B with a branch instruction as a delimiter. For example, in the instruction sequence initially held in the instruction holding unit A, the instruction following the branch instruction is stored in the instruction holding unit B, and the instruction following the next branch instruction is stored in the instruction holding unit A. To keep. Thus, in the example of the program shown in FIG. 5, the instruction (7) could not be issued from the instruction storage 10 until the tenth cycle, but in the present invention using two instruction holding means, it can be issued in the sixth cycle. Become. Still another embodiment of the present invention when two registers are used will be described with reference to FIG.

第12図の本発明の命令処理装置は2つのレジスタ81,8
2とその間の転送手段90を備えており、分岐予測先命令
実行結果格納手段70が省かれている以外は、前述した第
1図の本発明による命令処理装置の実施例と同じ構成と
なっている。本構成では、命令実行手段60にて得られた
結果は、確定している系列に属する命令による結果であ
れはレジスタA,Bの両者に書込むが、確定していない系
列による結果であれば、分岐命令を区切りとして、レジ
スタAもしくはBのいずれかに保持される。例えば、あ
る確定していない命令系列による結果をレジスタAに保
持していった場合には、先行する分岐予測が成功してこ
の命令系列が確定した瞬間からこの系列による結果をレ
ジスタA,Bの両者に書込む。そして、分岐命令の次の命
令以降の結果は実行が確定するまでレジスタBだけに保
持し、その命令系列が確定した瞬間からその系列による
結果をレジスタA,Bの両者に書込む。またその次の分岐
命令の次の命令以降の結果を実行が確定するまではレジ
スタAに保持していき、以下これを繰り返す。レジスタ
間転送手段90では、レジスタ書込み済フラグという前述
の第3図の形式のプラグレジスタを備え、上記の動作手
順中で片方のレジスタにのみ結果が書き込まれた場合に
は、該当する側(すなわち、レジスタAならA側、レジ
スタBならB側)の該レジスタ番号のレジスタ書込み済
フラグをONにする。そして、その命令系列の実行可否を
決定する分岐命令が予測成功側に分岐した時点で、レジ
スタ書込み済フラグがONとなっている該ブロック側の該
レジスタ番号のレジスタを、反対側の同一レジスタ番号
に複写する。レジスタ書込み済フラグは、この複写後OF
Fとする。また、逆に予測失敗側に分岐した場合には、
レジスタ書込み済フラグがONとなっている該ブロック側
の反対側の該レジスタ番号のレジスタを、レジスタ書込
み済フラグがONとなっている該ブロック側の同一レジス
タ番号に複写する。レジスタ書込み済フラグは、この複
写後OFFとする。これにより、分岐予測先の実行結果を
分岐先が確定する前に片側のレジスタに書込み、分岐成
功時にはその結果を反対側に複写し、分岐予測失敗時に
はその反対側の値を複写してくることにより元の値を復
元することができる。
The instruction processing apparatus according to the present invention shown in FIG.
2 and a transfer means 90 between them, except that the branch prediction destination instruction execution result storage means 70 is omitted, and has the same configuration as that of the above-described embodiment of the instruction processing apparatus according to the present invention shown in FIG. I have. In this configuration, the result obtained by the instruction execution means 60 is written in both the registers A and B if the result is due to the instruction belonging to the determined series, but if the result is based on the undetermined series. Are held in either the register A or the register B with the branch instruction as a delimiter. For example, when the result of a certain undetermined instruction sequence is held in the register A, the result of this sequence is stored in the registers A and B from the moment when the preceding branch prediction is successful and the instruction sequence is determined. Write to both. Then, the result after the instruction following the branch instruction is held only in the register B until the execution is determined, and the result of the instruction sequence is written into both the registers A and B from the moment the instruction sequence is determined. The result after the next instruction following the next branch instruction is held in the register A until execution is determined, and this is repeated thereafter. The inter-register transfer means 90 is provided with a plug register of the format shown in FIG. 3 called a register written flag, and when the result is written into only one of the registers in the above operation procedure, the corresponding side (ie, Then, the register write completion flag of the register number of the register A is turned ON. When the branch instruction that determines whether or not the instruction sequence can be executed branches to the successful prediction side, the register of the register number of the block whose register write completion flag is ON is replaced with the same register number of the opposite side. Copy to The register write completion flag is
F. On the other hand, when branching to the prediction failure side,
The register of the register number on the opposite side of the block whose register write completion flag is ON is copied to the same register number of the block side whose register write completion flag is ON. The register write completion flag is turned OFF after the copying. As a result, the execution result of the branch prediction destination is written to one register before the branch destination is determined, and when the branch is successful, the result is copied to the other side, and when the branch prediction fails, the value on the other side is copied. Restores the original value.

第12図の実施例における、レジスタ読出しの可否と、
いずれのレジスタから読出すべきかの判断を決定する流
れ図を第13図に示す。使用する記号は第4図と同様であ
る。
In the embodiment of FIG. 12, whether or not register reading is possible,
FIG. 13 shows a flowchart for determining which register should be read. The symbols used are the same as in FIG.

次に第12図の実施例における動作を、前述の第5図に
示すプログラムにおいて説明する。前述の第1図の場合
に比べて、オペランド読出しと実行結果書込みの動作だ
けが異なるため、この部分についてのみ説明する。ま
ず、命令(1)は確定系列側であり(第13図、ステップ
201)、r2の書込みをする命令が実行中ではない(ステ
ップ204)ので、第13図の流れ図に従いA側のr2を第3
サイクルで読出すことが可能である。また、命令(1)
は書込み時には確定系列であるので両側のレジスタに書
き込む。次の命令(2)はやはり確定系列側であるの
で、第13図の流れ図に従い該ブロック側、すなわちA側
のレジスタからオペランド読出しをする。この際、先行
する命令(1)が、既にr2の書込みを予約している(す
なわち、IB(Blk,Reg)がON)ため、命令(1)が終了
する第9サイクルまでオペランド読出しが保留される。
命令(5)は命令(2)と同じくr2を読み出そうとする
が、確定していない系列側であり(第13図、ステップ20
1)、該ブロックによるr2への書込みがされていない
(ステップ202)ため、該ブロックの反対側、すなわち
A側のレジスタからオペランド読出しを試みる。ところ
が命令(1)がすでにr2の書込みを予約している(ステ
ップ203)ため、命令(1)が終了するまでオペランド
読出しが保留される(第9サイクルでは命令(2)が発
行されるため、命令(5)の発行は第10サイクル)。ま
た、命令(5)は書込み時にも確定していない系列側で
あるため、該ブロック側、すなわちB側のレジスタにの
み結果の書込みをする。その他の命令についても同様の
動作をする。
Next, the operation of the embodiment shown in FIG. 12 will be described with reference to the program shown in FIG. Only the operations of operand reading and execution result writing are different from those in the case of FIG. 1 described above, so only this part will be described. First, the instruction (1) is on the definite series side (FIG. 13, step
201), since the instruction for writing r2 is not being executed (step 204), the r2 on the A side is changed to the third according to the flow chart of FIG.
It is possible to read in a cycle. The instruction (1)
Is written in the registers on both sides since it is a definite series at the time of writing. Since the next instruction (2) is also on the definite sequence side, the operand is read from the register on the block side, that is, the A side according to the flowchart of FIG. At this time, since the preceding instruction (1) has already reserved the writing of r2 (that is, IB (Blk, Reg) is ON), the operand reading is suspended until the ninth cycle at which the instruction (1) ends. You.
The instruction (5) attempts to read r2 in the same manner as the instruction (2), but is on the undetermined side (FIG. 13, step 20).
1) Since the block has not been written to r2 (step 202), an attempt is made to read the operand from the other side of the block, that is, the register on the A side. However, since instruction (1) has already reserved writing of r2 (step 203), operand reading is suspended until instruction (1) ends (in the ninth cycle, instruction (2) is issued. Instruction (5) is issued in the tenth cycle). Further, since the instruction (5) is a sequence side that has not been determined at the time of writing, the result is written only to the block side, that is, the register on the B side. Similar operations are performed for other instructions.

次に、命令発行手段を2つ使用した場合の一実施例を
第14図、第15図により説明する。第14図は、本発明によ
る命令処理装置の一実施例である。図において、2つの
命令発行手段41,42を備え、複数命令を同時発行可能と
しており、これに対処するためにオペランドアクセス制
御手段150、命令実行手段160、分岐予測先命令実行結果
格納手段170、レジスタ180が同時アクセス可能な構成に
なっている以外は、前述した第1図の本発明による命令
処理装置の実施例と同じ構成となっている。また第15図
はオペランドアクセス制御手段150の要部を示したもの
である。図において、各フラグが同時アクセス可能にな
り、オペランド読出し判定回路を2つ備えている以外
は、前述した第2図と同じ構成となっている。
Next, an embodiment in which two instruction issuing means are used will be described with reference to FIGS. 14 and 15. FIG. FIG. 14 shows an embodiment of the instruction processing apparatus according to the present invention. In the figure, two instruction issuing means 41 and 42 are provided, and a plurality of instructions can be issued simultaneously. To cope with this, operand access control means 150, instruction execution means 160, branch prediction destination instruction execution result storage means 170, The configuration is the same as that of the above-described embodiment of the instruction processing apparatus according to the present invention shown in FIG. FIG. 15 shows a main part of the operand access control means 150. In the figure, the configuration is the same as that of FIG. 2 except that each flag can be accessed simultaneously and two operand read determination circuits are provided.

次に第14図の実施例における動作を、前述の第5図に
示すプログラムにおいて説明する。前述の第1図の場合
に比べ、命令発行手段の動作タイミングだけが異なるた
め、この部分についてのみ説明する。第9サイクルでは
命令(1)の実行結果のレジスタ80への書込みが起こ
り、レジスタ書込み予約済フラグ520と命令発行済フラ
グのA側の2番をOFFにする。これにより、命令発行済
フラグのA側の2番OFFになるのを待っていた、命令発
行手段にある命令(2)と命令(5)の両者のオペラン
ドアクセスが成功する。第1図の実施例では同時には1
つの命令しか発行できない構成になっているため、確定
系列側の命令(2)のみが発行されたが、第14図による
実施例では命令発行手段を2つ備えて2命令同時発行可
能であるため、第9サイクルに命令(2)と命令(5)
の両者を発行する。他の命令の動作については第1図の
実施例の場合と同じである。
Next, the operation of the embodiment shown in FIG. 14 will be described with reference to the program shown in FIG. Only the operation timing of the instruction issuing means differs from the case of FIG. 1 described above, so only this part will be described. In the ninth cycle, the execution result of the instruction (1) is written to the register 80, and the register write reserved flag 520 and the instruction issue completed flag A side are turned off. As a result, operand access of both the instruction (2) and the instruction (5) in the instruction issuing means, which has been waiting for the instruction issued flag to be turned off on the second side of the A side, succeeds. In the embodiment of FIG.
Since only one instruction can be issued, only the instruction (2) on the fixed sequence side is issued. However, in the embodiment shown in FIG. 14, since two instruction issuing means are provided and two instructions can be issued simultaneously. , Instruction (2) and instruction (5) in the ninth cycle
Issue both. The operation of other instructions is the same as in the embodiment of FIG.

なお、第11図、第12図、第14図の各実施例について
は、これらを適宜組み合わせて命令処理装置を構成して
もよい。すなわち、複数の命令保持手段A,B、レジスタ
A,B及び命令発行手段A,Bのうちの少なくとも2つの手段
を含むように命令処理装置を構成してもよい。
Note that, in each of the embodiments of FIGS. 11, 12, and 14, the instruction processing device may be configured by appropriately combining them. That is, a plurality of instruction holding units A and B, registers
The instruction processing device may be configured to include at least two of A and B and instruction issuing means A and B.

(発明の効果) 以上の説明で明らかなように、この発明によると分岐
命令以前の命令系列と予測された分岐先の命令系列を可
能な限り同時に実行しながら、予測された確定前の分岐
先の命令による実行結果であってもオペランドとして使
用することが可能となり、分岐命令の確定待ちによる命
令実行開始の遅延を抑えることができ、高速な処理を行
うことができる。
(Effects of the Invention) As is apparent from the above description, according to the present invention, the instruction sequence before the branch instruction and the instruction sequence at the predicted branch destination are executed as simultaneously as possible, while the predicted branch destination before the decision is made. Can be used as an operand even if the execution result of the instruction is not used, the delay of the instruction execution start due to the waiting for the determination of the branch instruction can be suppressed, and high-speed processing can be performed.

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

第1図は本発明の一実施例を示す装置図、第2図は第1
図のオペランドアクセス制御手段の一実施例を示す図、
第3図は第2図のレジスタ書込み履歴フラグ、レジスタ
書込み予約済フラグ、命令発行済フラグ、第12図のレジ
スタ間転送手段のレジスタ書込み済フラグの構成を示す
図である。第4図は第1図のオペランドアクセス制御手
段における読出し許可判定のための流れ図である。第5
図は動作例を示すために用いたプログラムである。第6,
7,8,9図はそれぞれ第5図によるプログラム動作例の第
4,8,11,20サイクルのスナップショットである。第10図
は第5図によるプログラム動作例のタイムチャートであ
る。第11図は本願の第2の発明の一実施例を示す装置図
である。第12図は本願の第3の発明の一実施例を示す装
置図である。第13図は第12図のオペランドアクセス制御
手段における読出し許可判定のための流れ図である。第
14図は本願の第4の発明の一実施例を示す装置図であ
り、第15図は第14図のオペランドアクセス制御手段の一
実施例を示す図であり、第16図は従来の技術による装置
図である。 図において、 10は命令記憶手段、20はレジスタ書込み予約手段、30,3
1,32は命令保持手段、40,41,42は命令発行手段、50はオ
ペランドアクセス制御手段、60は命令実行手段、70は分
岐予測先命令実行結果格納手段、80,81,82はレジスタ、
90はレジスタ間転送手段、150はオペランドアクセス制
御手段、160は命令実行手段、170は分岐予測先命令実行
結果格納手段、180はレジスタ、510はレジスタ書込み履
歴フラグ、520はレジスタ書込み予約済フラグ、530は命
令発行済フラグ、540は確定命令系列フラグ、550はオペ
ランド読出し判定回路、561は分岐命令の分岐情報を伝
える信号線、562は各命令の終了を伝える信号線、563は
命令のレジスタへの書込み予約情報を伝える信号線、56
4は各命令の発行情報を伝える信号線、565はオペランド
読出しの可否を伝える信号線、1510はレジスタ書込み履
歴フラグ、1520はレジスタ書込み予約済フラグ、1530は
命令発行済フラグ、1540は確定命令系列フラグである。
FIG. 1 is an apparatus diagram showing an embodiment of the present invention, and FIG.
FIG. 3 is a diagram showing an embodiment of the operand access control means in the figure;
FIG. 3 is a diagram showing a configuration of a register write history flag, a register write reserved flag, an instruction issued flag of FIG. 2, and a register write completed flag of the inter-register transfer means of FIG. FIG. 4 is a flow chart for determining read permission in the operand access control means of FIG. Fifth
The figure shows a program used to show an operation example. Sixth,
Figures 7, 8, and 9 are the program operation examples shown in Figure 5 respectively.
It is a snapshot of 4,8,11,20 cycles. FIG. 10 is a time chart of an example of the program operation according to FIG. FIG. 11 is an apparatus diagram showing an embodiment of the second invention of the present application. FIG. 12 is an apparatus diagram showing an embodiment of the third invention of the present application. FIG. 13 is a flow chart for determining read permission in the operand access control means of FIG. No.
FIG. 14 is an apparatus diagram showing an embodiment of the fourth invention of the present application, FIG. 15 is a diagram showing an embodiment of the operand access control means of FIG. 14, and FIG. FIG. In the figure, 10 is instruction storage means, 20 is register write reservation means, 30, 3
1, 32 are instruction holding means, 40, 41, 42 are instruction issuing means, 50 is operand access control means, 60 is instruction execution means, 70 is branch prediction destination instruction execution result storage means, 80, 81, 82 are registers,
90 is an inter-register transfer unit, 150 is an operand access control unit, 160 is an instruction execution unit, 170 is a branch prediction destination instruction execution result storage unit, 180 is a register, 510 is a register write history flag, 520 is a register write reserved flag, 530 is an instruction issued flag, 540 is a definite instruction sequence flag, 550 is an operand read determination circuit, 561 is a signal line that transmits branch information of a branch instruction, 562 is a signal line that transmits the end of each instruction, and 563 is an instruction register. 56, a signal line for transmitting write reservation information of
4 is a signal line for transmitting the issue information of each instruction, 565 is a signal line for transmitting whether the operand can be read, 1510 is a register write history flag, 1520 is a register write reserved flag, 1530 is an instruction issued flag, and 1540 is a definite instruction sequence. This is a flag.

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】分岐命令による分岐先の確定を待たずに分
岐先アドレスを予測する分岐予測方式において、処理す
べき命令を記憶する第1の手段と、命令の実行結果を書
き込むレジスタという第2の手段と、前記第1の手段よ
り得られた命令が実行結果として行うレジスタへの書込
みをあらかじめ予約する第3の手段と、前記第3の手段
により予約された命令を保持し、命令を発行する第4の
手段と、前記第4の手段により発行された命令を実行す
る第5の手段と、前記第5の手段と前記第2の手段との
間に配置される、予測されていながら確定していない分
岐先にある命令による実行結果を一時的に保持する第6
の手段と、前記第6の手段により保持された実行結果を
前記第2の手段へ転送する第7の手段と、前記第6の手
段により保持された実行結果を前記第4の手段がオペラ
ンドとして読み出す第8の手段と、前記第2の手段によ
り保持された実行結果を前記第4の手段がオペランドと
して読み出す第9の手段とを備え、さらに前記第4の手
段は、分岐先未確定の分岐命令以前の命令系列を保持す
る第10の手段と、前記第10の手段に保持された命令と前
記第3の手段により予約された命令を前記第5の手段に
発行する第11の手段と、前記第3の手段によるレジスタ
書込み予約と前記第11の手段が行なう命令発行の履歴情
報と前記第5の手段による分岐先確定情報とを受け取る
ことにより、前記第11の手段が行なうオペランドアクセ
スに対して、制御を加える第12の手段を備え、予測され
た確定前の分岐先の命令の実行結果を使用してさらにそ
の先の命令の処理を行うことを特徴とする命令処理装
置。
In a branch prediction method for predicting a branch destination address without waiting for a branch destination to be determined by a branch instruction, a first means for storing an instruction to be processed and a register for writing an execution result of the instruction. Means, a third means for reserving in advance a write to a register performed by the instruction obtained by the first means as an execution result, and holding the instruction reserved by the third means and issuing the instruction. Fourth means for executing, instructions for executing an instruction issued by the fourth means, and a predicted and fixed state disposed between the fifth means and the second means. Temporarily holds the execution result of the instruction at the branch destination that has not been taken
Means, the seventh means for transferring the execution result held by the sixth means to the second means, and the fourth means transfers the execution result held by the sixth means as an operand. Eighth means for reading, and ninth means for the fourth means to read the execution result held by the second means as an operand, wherein the fourth means further comprises: Tenth means for holding an instruction sequence before an instruction, eleventh means for issuing the instruction held by the tenth means and the instruction reserved by the third means to the fifth means, By receiving the register write reservation by the third means, the history information of the instruction issuance performed by the eleventh means, and the branch destination determination information by the fifth means, the operand access performed by the eleventh means is Control An instruction processing apparatus comprising: a twelfth means for obtaining a predicted instruction and executing a further instruction using a predicted execution result of the instruction at a branch destination before the determination.
【請求項2】前記第10の手段を2つ以上備え、前記第3
の手段により予約された命令を、分岐命令を区切りとし
て複数の第10の手段に対して、順次振り分けることを特
徴とする特許請求の範囲第1項記載の命令処理装置。
2. The apparatus according to claim 1, further comprising at least two of said tenth means,
2. The instruction processing apparatus according to claim 1, wherein instructions reserved by said means are sequentially distributed to a plurality of tenth means with a branch instruction as a delimiter.
【請求項3】前記第2の手段と第6の手段と第7の手段
と第8の手段と第9の手段との代わりに、第2の手段と
第9の手段の組を2つ以上と、その複数の第2の手段に
保持されている値を互いに転送する手段とを備え、予測
されていながら確定していない分岐先にある命令による
実行結果を、複数の第2の手段のいずれかに保持するこ
とを特徴とする特許請求の範囲第1項記載の命令処理装
置。
3. In place of the second means, the sixth means, the seventh means, the eighth means and the ninth means, two or more sets of the second means and the ninth means are provided. And means for transferring the values held in the plurality of second means to each other, and executing an execution result of an instruction at a branch destination which is predicted but not determined by any of the plurality of second means. 2. The instruction processing device according to claim 1, wherein the instruction processing device stores the instruction.
【請求項4】前記第11の手段を2つ以上備えることによ
り、複数の命令を同時に発行することを可能とすること
を特徴とする特許請求の範囲第1項記載の命令処理装
置。
4. The instruction processing apparatus according to claim 1, wherein a plurality of instructions are issued simultaneously by providing two or more of said eleventh means.
JP9810290A 1989-11-08 1990-04-13 Instruction processing unit Expired - Lifetime JP2814683B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9810290A JP2814683B2 (en) 1989-11-08 1990-04-13 Instruction processing unit

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP1-288832 1989-11-08
JP28883289 1989-11-08
JP9810290A JP2814683B2 (en) 1989-11-08 1990-04-13 Instruction processing unit

Publications (2)

Publication Number Publication Date
JPH03218524A JPH03218524A (en) 1991-09-26
JP2814683B2 true JP2814683B2 (en) 1998-10-27

Family

ID=26439306

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9810290A Expired - Lifetime JP2814683B2 (en) 1989-11-08 1990-04-13 Instruction processing unit

Country Status (1)

Country Link
JP (1) JP2814683B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ATE200357T1 (en) 1991-07-08 2001-04-15 Seiko Epson Corp RISC PROCESSOR WITH STRETCHABLE ARCHITECTURE
JP3637920B2 (en) 1992-05-01 2005-04-13 セイコーエプソン株式会社 System and method for retirement of instructions in a superscaler microprocessor

Also Published As

Publication number Publication date
JPH03218524A (en) 1991-09-26

Similar Documents

Publication Publication Date Title
EP0087978B1 (en) Information processing unit
US5341482A (en) Method for synchronization of arithmetic exceptions in central processing units having pipelined execution units simultaneously executing instructions
JP2818249B2 (en) Electronic computer
JPS61107434A (en) Data processor
JPH0242569A (en) Context switching method and apparatus used for vector processing system
JPH04275628A (en) Arithmetic processor
JPH0545985B2 (en)
US6108771A (en) Register renaming with a pool of physical registers
JPH0348537B2 (en)
JP3721780B2 (en) Data processing apparatus having a plurality of pipeline processing mechanisms
JPS63317828A (en) Reading control system for microcode
JPS62115542A (en) Information processor
JP2814683B2 (en) Instruction processing unit
CA1304823C (en) Apparatus and method for synchronization of arithmetic exceptions in central processing units having pipelined execution units simultaneously executing instructions
JP2894438B2 (en) Pipeline processing equipment
IE79236B1 (en) Apparatus and method for recovering from page faults in vector data processing operations
EP0573071A2 (en) A microprocessor
JPS5890247A (en) Pipeline controlling system of information processor
JP2552738B2 (en) Data processing device
JPS6120893B2 (en)
JP2906799B2 (en) Information processing device
JP3123946B2 (en) Microcomputer
JPH0769825B2 (en) Parallel processor
JPH10283178A (en) Method and system for issuing instruction
JPS6149695B2 (en)

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 9

Free format text: PAYMENT UNTIL: 20070814

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080814

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080814

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090814

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090814

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20100814

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100814

Year of fee payment: 12