JPH05173781A - Information processor provided with function for executing plural instructions in parallel - Google Patents

Information processor provided with function for executing plural instructions in parallel

Info

Publication number
JPH05173781A
JPH05173781A JP33673991A JP33673991A JPH05173781A JP H05173781 A JPH05173781 A JP H05173781A JP 33673991 A JP33673991 A JP 33673991A JP 33673991 A JP33673991 A JP 33673991A JP H05173781 A JPH05173781 A JP H05173781A
Authority
JP
Japan
Prior art keywords
instruction
register
instructions
decoder
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP33673991A
Other languages
Japanese (ja)
Other versions
JP3015565B2 (en
Inventor
Hatsuo Shirokura
初雄 白倉
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP3336739A priority Critical patent/JP3015565B2/en
Publication of JPH05173781A publication Critical patent/JPH05173781A/en
Application granted granted Critical
Publication of JP3015565B2 publication Critical patent/JP3015565B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To execute plural instructions by sufficiently effectively utilizing parallel executing ability provided in the device without improving a software containing instruction sequences in register depending relation even in the case of such a software. CONSTITUTION:A decoder 3 is provided to detect instructions in the register depending relation concerning a register in a general register group 51 from the instruction sequences stored in an instruction queue 2 and to change a corresponding register designating part in that instruction so as to designate a temporary register in a temporary register group 52. The information of registers before and after the change due to the decoder 3 are registered on a replacement table 6. The decoder 3 decodes the instruction sequences after the register designating part is changed, and the relevant instruction is executed by activating an execution unit in a parallel execution part 4. According to the replacement table 6, a data matching guarantee circuit 7 writes the contents of the temporary register back to the original general register after the execution due to the parallel execution part 4.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、複数命令の並列実行
機能を持つ情報処理装置に係り、特にレジスタ依存関係
のある複数の命令の並列実行方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information processing apparatus having a parallel execution function for a plurality of instructions, and more particularly to a parallel execution system for a plurality of instructions having register dependence.

【0002】[0002]

【従来の技術】既存のソフトウェアを高速に実行する情
報処理装置として、命令の実行ユニットを複数備え、ソ
フトウェア内の命令列のうち複数の命令を同時(並列)
に(同じサイクル内で)実行し、1サイクルに要する時
間を短縮せずに(即ちクロックの周波数を上げずに)済
ませる、スーパースカラ型計算機で代表される情報処理
装置が知られている。
2. Description of the Related Art As an information processing apparatus for executing existing software at high speed, a plurality of instruction execution units are provided, and a plurality of instructions in an instruction sequence in the software are simultaneously (parallel) processed.
There is known an information processing apparatus represented by a superscalar type computer that is executed (in the same cycle) without shortening the time required for one cycle (that is, without increasing the clock frequency).

【0003】上記した複数命令の並列実行機能を持つ情
報処理装置では、1サイクルで実行可能な最大命令数以
上の命令を保持したキューから、同時に実行しても1つ
ずつ逐次実行した場合と結果が変わらない命令を取出
し、実行するようになっていた。
In the above-described information processing apparatus having a parallel execution function of a plurality of instructions, from the queue holding the maximum number of instructions that can be executed in one cycle, even if they are executed simultaneously, one by one It was supposed to take out the same command and execute it.

【0004】もし、キューに入った命令のうちデータの
依存関係のあるものは同時に実行できない。例えば、あ
る命令#1の出力データが別の命令#2の入力データと
なる場合、この命令#1,#2は同時に実行できず、無
理に実行した場合には、その結果は命令#1を実行して
から命令#2を実行した場合と食い違ってしまう。
If there are data dependencies among the queued instructions, they cannot be executed at the same time. For example, if the output data of a certain instruction # 1 becomes the input data of another instruction # 2, these instructions # 1 and # 2 cannot be executed at the same time, and if they are forcibly executed, the result will be the instruction # 1. It will be different from the case where the instruction # 2 is executed after the execution.

【0005】また、データの依存関係がなくても、レジ
スタに依存関係があれば、該当する命令は全て同時には
実行できないのが普通である。例えば、命令#3がある
レジスタの保持データを用い、別の命令#4が同じレジ
スタにデータを書込む場合には、命令#3,#4は、両
データに依存関係がないにも拘らず、同時に実行できな
い。これは、命令#3で用いようとするデータのレジス
タに命令#4で値が書込まれるためである。
Even if there is no data dependency, if the registers have a dependency, it is normal that all the corresponding instructions cannot be executed at the same time. For example, if the instruction # 3 uses the data held in one register and another instruction # 4 writes the data in the same register, the instructions # 3 and # 4 have no dependency on both data, , Can't run at the same time. This is because the value is written in the register of the data to be used in the instruction # 3 by the instruction # 4.

【0006】このようなレジスタ依存を無くすには、互
いに異なるレジスタを用いればよい。しかし、既存のソ
フトウェア(プログラム)でレジスタ依存のある命令列
を持つ場合には、そのソフトウェアを書換えなければな
らず、極めて煩雑である。また、新規に作成するソフト
ウェアでも、命令語中のレジスタ指定フィールドのサイ
ズの関係で指定可能なレジスタ数が制限されるため、そ
のレジスタ数より多いデータ数を扱う場合には、互いに
依存しないデータを同じレジスタで用いる可能性が大き
い。つまり、命令語中でアクセス対象として指定可能な
レジスタ数、言い替えればソフトウェアから認識できる
レジスタ数が同じなら、実行ユニットを増やしてもレジ
スタ依存による性能低下を減らすことはできず、ソフト
ウェアから認識できるレジスタの数を増やして対処しよ
うとすると、既存のソフトウェアを書き直さなければな
らない。
In order to eliminate such register dependence, different registers may be used. However, if existing software (program) has an instruction sequence that has register dependence, that software must be rewritten, which is extremely complicated. In addition, even with newly created software, the number of registers that can be specified is limited due to the size of the register specification field in the instruction word. It is likely to be used in the same register. In other words, if the number of registers that can be specified as access targets in an instruction word, in other words, the number of registers that can be recognized by software is the same, the performance degradation due to register dependence cannot be reduced even if the number of execution units is increased, and the number of registers that can be recognized by software is increased. To deal with increasing the number of, you have to rewrite the existing software.

【0007】[0007]

【発明が解決しようとする課題】上記したように、複数
命令の並列実行機能を持つ従来の情報処理装置では、互
いにレジスタ依存関係のある命令列は同時に実行できな
いために、1つずつ逐次実行しなければならず、並列実
行機能を最大限に生かすことができないという問題があ
り、これを解決するためには、ソフトウェアを改造して
レジスタ依存のないように命令列を並べる、あるいは並
べ替えなければならず、多くの人手と費用を要するとい
う問題があった。
As described above, in the conventional information processing apparatus having the parallel execution function of a plurality of instructions, the instruction sequences having the register dependency relationship cannot be executed at the same time. There is a problem that the parallel execution function cannot be used to the maximum extent, and in order to solve this problem, software must be modified to arrange the instruction sequence so that it does not depend on registers, or to rearrange the instruction sequence. However, there is a problem that it requires a lot of manpower and cost.

【0008】この発明は上記事情に鑑みてなされたもの
でその目的は、レジスタ依存関係のある命令列を含むソ
フトウェアでも、そのソフトウェアを改造することな
く、装置が持つ複数命令の並列実行能力を十分に生かし
て実行できる情報処理装置を提供することにある。
The present invention has been made in view of the above circumstances, and it is an object of the present invention to achieve a sufficient parallel execution capability of a plurality of instructions possessed by a device without modifying the software even if the software includes an instruction sequence having a register dependency relationship. It is to provide an information processing device that can be utilized by being utilized.

【0009】[0009]

【課題を解決するための手段】この発明は、命令の実行
ユニットを複数備え、複数命令の並列実行が可能な情報
処理装置において、命令語で指定可能な複数の第1のレ
ジスタと、この第1のレジスタの代用として一時的に使
用される少なくとも1つの第2のレジスタと、実行すべ
き命令列の中から、前記第1のレジスタについてレジス
タ依存関係のある命令を検出し、その命令の指定する前
記第1のレジスタを前記第2のレジスタに一時的に置換
える手段とを備え、レジスタ依存関係のある複数の命令
を、前記第2のレジスタの使用により並列に実行するよ
うにしたことを特徴とするものである。
According to the present invention, in an information processing apparatus having a plurality of instruction execution units and capable of executing a plurality of instructions in parallel, a plurality of first registers which can be designated by an instruction word, and a plurality of first registers. An instruction having a register dependency relationship with respect to the first register is detected from at least one second register temporarily used as a substitute for the one register and an instruction sequence to be executed, and the instruction is designated. Means for temporarily replacing the first register with the second register, and executing a plurality of instructions having register dependence by using the second register in parallel. It is a feature.

【0010】[0010]

【作用】上記の構成においては、同一の第1のレジスタ
指定に起因するレジスタ依存関係のある命令について
は、その命令の指定する第1のレジスタに代えて、命令
語の指定対象外となる第2のレジスタ(一時レジスタ)
が一時的に割当てられる。この第2のレジスタの割当て
により、レジスタ依存関係が解除されるため、命令語で
指定されていた第1のレジスタのみ用いたのでは、レジ
スタ依存関係のせいで並列に複数の命令を実行できない
ようなソフトウェアでも、装置が持つ複数命令の並列実
行能力を十分に生かして実行でき、性能向上を図ること
が可能となる
In the above structure, for instructions having register dependence due to the same first register designation, the first register designated by the instruction is replaced with the instruction not designated by the instruction word. 2nd register (temporary register)
Are temporarily assigned. By allocating the second register, the register dependency is canceled. Therefore, if only the first register designated by the instruction word is used, it is impossible to execute a plurality of instructions in parallel due to the register dependency. Software can be executed by making full use of the parallel execution capability of multiple instructions of the device, and performance can be improved.

【0011】。..

【実施例】図1はこの発明の一実施例に係る複数命令の
並列実行機能を持つ情報処理装置の構成を示すブロック
図である。
1 is a block diagram showing the configuration of an information processing apparatus having a parallel execution function of a plurality of instructions according to an embodiment of the present invention.

【0012】図1において、1はプログラム、データ等
が格納されるメモリ、2はメモリ1からフェッチされた
命令をそのフェッチ順の並びで保持するための命令キュ
ーである。この命令キュー2は、後述する並列実行部4
で同時に実行可能な最大命令数以上の命令を保持可能な
構造となっている。命令キュー2内に保持された命令
は、実行されると、同キュー2から除かれる。
In FIG. 1, 1 is a memory for storing programs, data and the like, and 2 is an instruction queue for holding the instructions fetched from the memory 1 in the order of the fetch order. The instruction queue 2 includes a parallel execution unit 4 described later.
It has a structure that can hold more than the maximum number of instructions that can be executed simultaneously. The instruction held in the instruction queue 2 is removed from the queue 2 when it is executed.

【0013】なお、メモリ1と命令キュー2との間にキ
ャッシュメモリ(あるいは命令キャッシュ)を設け、キ
ャッシュメモリからフェッチされた命令が命令キュー2
に格納されるものであってもよい。
A cache memory (or an instruction cache) is provided between the memory 1 and the instruction queue 2 so that the instruction fetched from the cache memory can be stored in the instruction queue 2
May be stored in.

【0014】3は命令キュー2から命令を順に取出して
デコード処理を行うデコーダである。このデコーダ3
は、複数命令の並列(同時)実行のために、対象命令の
データ依存関係、レジスタ依存関係を調べる周知の機能
の他に、レジスタ依存関係のある命令については、その
命令で指定するレジスタを後述する一時レジスタに置換
える制御を行う。
Reference numeral 3 is a decoder for sequentially fetching instructions from the instruction queue 2 and performing a decoding process. This decoder 3
For parallel (simultaneous) execution of multiple instructions, in addition to the well-known function of checking the data dependency and register dependency of the target instruction, for the instructions with register dependency, the register specified by the instruction will be described later. Control to replace with a temporary register.

【0015】4はデコーダ3による複数の命令について
のデコード結果を受けて、複数命令を並列に実行するた
めの並列実行部である。並列実行部4は、デコーダ3か
ら与えられる各命令毎のデコード結果をもとに、対応す
る命令実行をそれぞれ独立に行うための複数の実行ユニ
ット4-1,4-2,4-3…を持つ。
Reference numeral 4 is a parallel execution unit for receiving a decoding result of a plurality of instructions by the decoder 3 and executing the plurality of instructions in parallel. The parallel execution unit 4 has a plurality of execution units 4-1, 4-2, 4-3, ... For independently executing the corresponding instruction based on the decoding result of each instruction given from the decoder 3. To have.

【0016】5は並列実行部4(内の実行ユニット4-
1,4-2,4-3…等)により操作されるデータを保持す
るためのレジスタ部である。レジスタ部5は、本装置上
で動くソフトウェアで認識される(即ち命令語のソース
またはデスティネーションレジスタ指定フィールドで指
定可能な)複数の一般レジスタ(レジスタA,B,C,
D…で表現)からなる一般レジスタ群51と、上記ソフ
トウェアから認識されない複数の一時レジスタ(レジス
タα,β…で表現)からなる一時レジスタ群52とによ
り構成される。
Reference numeral 5 denotes a parallel execution unit 4 (execution unit 4-
1, 4-2, 4-3, etc.) is a register unit for holding data to be operated. The register unit 5 includes a plurality of general registers (registers A, B, C, which can be designated by a source or destination register designation field of an instruction word) recognized by software running on the device.
A general register group 51 composed of D ...) and a temporary register group 52 composed of a plurality of temporary registers (represented by registers .alpha., .Beta.) That are not recognized by the software.

【0017】6は複数のエントリを持つ置換えテーブル
である。この置換えテーブル6の各エントリは、デコー
ダ3による置換えの対象となったレジスタ部5内の一般
レジスタのレジスタ名(レジスタ番号)と、この一般レ
ジスタに代えて用いられたレジスタ部5内の一時レジス
タのレジスタ名(レジスタ番号)と、該当エントリの情
報が有効であるか否かを示す有効フラグ(Vフラグ)の
各設定フィールドからなる。
Reference numeral 6 is a replacement table having a plurality of entries. Each entry of the replacement table 6 includes a register name (register number) of a general register in the register unit 5 to be replaced by the decoder 3 and a temporary register in the register unit 5 used in place of the general register. Register name (register number) and a setting field of a valid flag (V flag) indicating whether or not the information of the corresponding entry is valid.

【0018】7はデータ整合保証回路である。データ整
合保証回路7は、レジスタ部5内の一時レジスタの内容
を置換えテーブル6で示される置換えの対象となった一
般レジスタに書き戻すことで、データの整合性を保証す
る。次に、図1の構成の動作を、命令キュー2にフェッ
チされた命令列が図2(a)のようになっている場合を
例に、説明する。
Reference numeral 7 is a data matching guarantee circuit. The data matching guarantee circuit 7 guarantees the data consistency by writing back the contents of the temporary register in the register unit 5 to the general register which is the target of the replacement shown in the replacement table 6. Next, the operation of the configuration of FIG. 1 will be described by taking the case where the instruction string fetched in the instruction queue 2 is as shown in FIG.

【0019】なお、図2において、“add A,B,
A”で示される命令#1は、レジスタAとレジスタBの
両内容の和をレジスタAに格納することを指示する命令
であり、“and A,D,D”で示される命令#2
は、レジスタAとレジスタDの両内容をANDした結果
をレジスタDに格納することを指示する命令である。ま
た、“or C,E,A”で示される命令#3は、レジ
スタCとレジスタEの両内容をORした結果をレジスタ
Aに格納することを指示する命令であり、“sub
A,C,A”で示される命令#4は、レジスタAとレジ
スタCの両内容の差をレジスタAに格納することを指示
する命令である。
In FIG. 2, "add A, B,
The instruction # 1 indicated by "A" is an instruction to store the sum of the contents of both registers A and B in the register A, and the instruction # 2 indicated by "and A, D, D".
Is an instruction to store the result of ANDing the contents of both registers A and D in register D. The instruction # 3 indicated by "or C, E, A" is an instruction to store the result of ORing the contents of both the register C and the register E in the register A, and "sub C".
Instruction # 4 indicated by A, C, A ″ is an instruction to store in register A the difference between the contents of register A and register C.

【0020】今、図示せぬ命令フェッチ機構によってメ
モリ1から命令キュー2に命令列がフェッチされた結
果、サイクルT0 の開始時において、命令キュー2の内
容が図2(a)に示すようになっているものとする。こ
こで、命令キュー2内の命令列の並び順は、メモリ1か
らのフェッチ順であり、1命令ずつ順に実行されるもの
として作成された命令の順である。
As a result of fetching an instruction string from the memory 1 to the instruction queue 2 by an instruction fetch mechanism (not shown), the contents of the instruction queue 2 are as shown in FIG. 2 (a) at the start of the cycle T0. It is assumed that Here, the order of the instruction sequence in the instruction queue 2 is the order of fetching from the memory 1, that is, the order of instructions created as being executed one instruction at a time.

【0021】さて、図2(a)に示す命令キュー2内の
命令列を従来方式で実行するには、図3(b)に示すよ
うに4サイクルを要し、同時実行は不可能である。その
理由は次の通りである。
Now, in order to execute the instruction sequence in the instruction queue 2 shown in FIG. 2A by the conventional method, it takes four cycles as shown in FIG. 3B, and simultaneous execution is impossible. .. The reason is as follows.

【0022】第1に、命令#2で用いる演算データの一
方はレジスタAに入っているが、このレジスタAの値は
命令#1(add命令)が実行されないと定まらないた
めである。即ち命令#1と命令#2との間にデータ依存
関係があるためである。
First, one of the operation data used in the instruction # 2 is stored in the register A, but the value of the register A cannot be determined unless the instruction # 1 (add instruction) is executed. That is, there is a data dependency between the instruction # 1 and the instruction # 2.

【0023】第2に、命令#3(or命令)でOR結果
を書込むレジスタAには、命令#1,#2(and命
令)で用いる演算データが入っているため、命令#1,
#2が実行されてから命令#3を実行しないと、命令#
1,#2で用いるレジスタAのデータが、命令#3で書
換えられてしまう可能性があるためである。即ち、命令
#1,#2と命令#3との間にレジスタ依存関係がある
ためである。
Secondly, since the register A for writing the OR result by the instruction # 3 (or instruction) contains the operation data used by the instructions # 1 and # 2 (and instruction), the instruction # 1,
If the instruction # 3 is not executed after # 2 is executed, the instruction #
This is because the data of the register A used in 1 and # 2 may be rewritten by the instruction # 3. That is, there is a register dependency between the instructions # 1 and # 2 and the instruction # 3.

【0024】第3に、命令#4(sub命令)で用いる
レジスタAの値は、命令#3(or命令)が実行されな
いと定まらないためである。即ち命令#3と命令#4と
の間にデータ依存関係があるためである。
Thirdly, the value of the register A used in the instruction # 4 (sub instruction) is not determined unless the instruction # 3 (or instruction) is executed. That is, there is a data dependency between the instruction # 3 and the instruction # 4.

【0025】これに対して本実施例では、図2(a)に
示す命令キュー2内の命令列を、後述するレジスタ置換
えで図2(b)に示すように変更することにより、図3
(a)に示すように2サイクルで実行することができ
る。この動作につき、図4のフローチャートを参照して
詳述する。
On the other hand, in the present embodiment, the instruction sequence in the instruction queue 2 shown in FIG. 2A is changed by register replacement described later as shown in FIG.
It can be executed in two cycles as shown in (a). This operation will be described in detail with reference to the flowchart of FIG.

【0026】サイクルT0 においてデコーダ3は、命令
キュー2内の先頭の命令(#1)と2番目の命令(#
2)を比較してその依存関係を調べ、後の命令(#2)
が先の命令(#1)に対してデータ依存またはレジスタ
依存の関係にあるか否かをチェックする(ステップS
1)。もし、依存関係が存在しない場合には、デコーダ
3は、両命令を次のサイクル(第1サイクル)T1 で同
時に実行することを決定する(ステップS2)。
In the cycle T0, the decoder 3 has the first instruction (# 1) and the second instruction (# 1) in the instruction queue 2.
2) is compared to check the dependency, and the subsequent instruction (# 2)
Check whether the above instruction (# 1) is data-dependent or register-dependent (step S).
1). If there is no dependency, the decoder 3 determines to execute both instructions simultaneously in the next cycle (first cycle) T1 (step S2).

【0027】これに対し、図2(a)の例のように、先
の命令#1と後の命令#2との間に依存関係(ここでは
データ依存関係)のある場合には、デコーダ3は、依存
のあるレジスタ(ここではレジスタA)を後の命令#2
がソース指定しているか否かをチェックする(ステップ
S3)。
On the other hand, as in the example of FIG. 2A, when there is a dependency relationship (here, data dependency relationship) between the preceding instruction # 1 and the subsequent instruction # 2, the decoder 3 Sends the dependent instruction (register A in this case) to the subsequent instruction # 2.
It is checked whether or not the source has been designated (step S3).

【0028】図2(a)の例のように、先の命令#1と
の間で依存関係のあるレジスタ(A)を後の命令#2で
ソース指定している場合には、デコーダ3は、先の命令
#1については次の第1サイクルT1 で実行し、後の命
令#2については更に次の第2サイクルT2 で実行する
ことを決定し、その旨を内部記憶する(ステップS
4)。実際には、第1サイクルT1 で実行する命令の命
令キュー2内位置を示す情報を内部記憶、あるいは第1
サイクルT1 で実行する命令の命令キュー2内位置に固
有の例えばフラグビットをオンすればよい。
When the source of the register (A) having a dependency relationship with the preceding instruction # 1 is designated by the succeeding instruction # 2 as in the example of FIG. , The previous instruction # 1 is executed in the next first cycle T1, and the subsequent instruction # 2 is executed in the next second cycle T2, which is internally stored (step S
4). Actually, the information indicating the position in the instruction queue 2 of the instruction to be executed in the first cycle T1 is internally stored, or
For example, a flag bit unique to the position in the instruction queue 2 of the instruction executed in the cycle T1 may be turned on.

【0029】次にデコーダ3は、命令キュー2内の3番
目の命令(#3)と先行命令(#2)とについて、上記
ステップS1を実行し、命令#3が命令#2に対してデ
ータ依存またはレジスタ依存の関係にあるか否かをチェ
ックする。
Next, the decoder 3 executes the above step S1 for the third instruction (# 3) and the preceding instruction (# 2) in the instruction queue 2, and the instruction # 3 sends data to the instruction # 2. Check if there is a dependency or register dependency relationship.

【0030】もし、図2(a)の例のように、命令#2
と命令#3との間に依存関係(ここではレジスタ依存関
係)があり、且つ依存のあるレジスタ(A)を後の命令
#3でソース指定してない場合(ステップS3のNO判
定時)には、デコーダ3は、その命令#3以降の命令キ
ュー2内の命令のレジスタA指定部分を全て(ここでは
命令#3のデスティネーションレジスタA指定部分と、
命令#4のソース並びにデスティネーションレジスタA
指定部分)、一時レジスタ群52内の任意の一時レジス
タ、例えば一時レジスタαの指定に置換える(ステップ
S5)。このときの命令キュー2の内容を、図2(b)
に示す。
If, as in the example of FIG. 2A, instruction # 2
And the instruction # 3 have a dependency relationship (here, a register dependency relationship) and the source of the dependent register (A) is not specified in the subsequent instruction # 3 (when NO is determined in step S3). Means that the decoder 3 executes all the register A designated parts of the instructions in the instruction queue 2 after the instruction # 3 (here, the destination register A designated part of the instruction # 3,
Instruction # 4 source and destination register A
The designated portion) is replaced with the designation of an arbitrary temporary register in the temporary register group 52, for example, the temporary register α (step S5). The contents of the instruction queue 2 at this time are shown in FIG.
Shown in.

【0031】次にデコーダ3は、命令キュー2内の第1
サイクルT1 での実行が決定された命令#1と(レジス
タAからレジスタαへの置換えが施された)命令#3と
を比較してその依存関係を調べ、命令#3が命令#1に
対してデータ依存またはレジスタ依存の関係にあるか否
かをチェックする(ステップS1)。
Next, the decoder 3 operates the first queue in the instruction queue 2.
The instruction # 1 determined to be executed in the cycle T1 is compared with the instruction # 3 (which has been replaced by the register A to the register α) to check the dependency, and the instruction # 3 is compared with the instruction # 1. It is checked whether or not there is a data-dependent or register-dependent relationship (step S1).

【0032】図2(b)の例のように、命令#1と命令
#3との間に依存関係が存在しない場合には、デコーダ
3は、命令#3を命令#1と同じ第1サイクルT1 で同
時に実行することを決定し、その旨を内部記憶する(ス
テップS2)。
When there is no dependency between the instruction # 1 and the instruction # 3 as in the example of FIG. 2B, the decoder 3 sets the instruction # 3 to the same first cycle as the instruction # 1. At T1, it is decided to execute them simultaneously, and that effect is internally stored (step S2).

【0033】次にデコーダ3は、命令キュー2内の命令
#1と(命令#3の次の命令であって、レジスタAから
レジスタαへの置換えが施された)命令#4とを比較し
てその依存関係を調べ、命令#4が命令#1に対してデ
ータ依存またはレジスタ依存の関係にあるか否かをチェ
ックする(ステップS1)。
Next, the decoder 3 compares the instruction # 1 in the instruction queue 2 with the instruction # 4 (the instruction next to the instruction # 3, in which the register A is replaced with the register α). The dependency relationship is checked by checking whether instruction # 4 has a data-dependent or register-dependent relationship with instruction # 1 (step S1).

【0034】図2(b)の例のように、命令#1と命令
#4との間に依存関係が存在しない場合には、デコーダ
3は、命令#4を命令#1と同じ第1サイクルT1 で同
時に実行することを決定し、その旨を内部記憶する(ス
テップS2)。
When there is no dependency between the instruction # 1 and the instruction # 4 as in the example of FIG. 2B, the decoder 3 sets the instruction # 4 to the same first cycle as the instruction # 1. At T1, it is decided to execute them simultaneously, and that effect is internally stored (step S2).

【0035】次にデコーダ3は、命令キュー2内の上記
レジスタ置換え後の命令#3と命令#4とを比較してそ
の依存関係を調べ、命令#4が命令#3に対してデータ
依存またはレジスタ依存の関係にあるか否かをチェック
する(ステップS1)。
Next, the decoder 3 compares the instruction # 3 after the register replacement in the instruction queue 2 with the instruction # 4 to check the dependency, and the instruction # 4 determines whether the instruction # 3 is data-dependent or not. It is checked whether there is a register-dependent relationship (step S1).

【0036】図2(b)の例のように、命令#3と命令
#4との間に依存関係が存在し、且つ依存のあるレジス
タ(α)を後の命令#4でソース指定している場合(ス
テップS3のYES判定時)には、デコーダ3は、先の
命令#3については第1サイクルT1 で実行し、後の命
令#4については次の第2サイクルT2 で実行すること
を決定し、その旨を内部記憶する(ステップS4)。こ
れにより、命令#4の実行サイクルをT1 とする先の決
定内容が解除される。
As shown in the example of FIG. 2B, there is a dependency between the instruction # 3 and the instruction # 4, and the source of the dependent register (α) is designated by the subsequent instruction # 4. If YES (determined as YES in step S3), the decoder 3 executes the previous instruction # 3 in the first cycle T1 and the subsequent instruction # 4 in the next second cycle T2. The determination is made and the effect is internally stored (step S4). As a result, the contents of the decision that the execution cycle of the instruction # 4 is T1 are canceled.

【0037】デコーダ3は、命令キュー2内の最後の命
令#3,#4の比較によりその実行サイクルを決定する
と、第1サイクルT1 で実行すべき命令、即ち命令#
1,#3を命令キュー2から取出してデコードし、命令
#1,#3のデコード結果を並列実行部4内の実行ユニ
ット4-i,4-j(i,jは1,2,3…のうちの互いに
異なる値)に渡して、次の第1サイクルT1 において該
当する命令を実行させる(ステップS6)。またデコー
ダ3は、現サイクル(T0 )の最後に、上記の処理にお
いて置換えの対象となったレジスタAと置換えに用いた
レジスタαのレジスタ名(レジスタ番号)の対を置換え
テーブル6内の空きエントリに登録し、Vフラグをオン
する(ステップS7)。
When the decoder 3 determines the execution cycle by comparing the last instructions # 3 and # 4 in the instruction queue 2, the instruction to be executed in the first cycle T1, that is, the instruction #
1, # 3 are fetched from the instruction queue 2 and decoded, and the decoding results of the instructions # 1, # 3 are executed by the execution units 4-i, 4-j in the parallel execution unit 4 (i, j are 1, 2, 3 ... , Which are different from each other) to execute the corresponding instruction in the next first cycle T1 (step S6). At the end of the current cycle (T0), the decoder 3 replaces a pair of the register A (register number) used for the replacement and the register name (register number) used for the replacement in the above process with an empty entry in the replacement table 6. And the V flag is turned on (step S7).

【0038】さてデコーダ3から並列実行部4内の実行
ユニット4-i,4-jに命令#1,#3のデコード結果が
渡されると、第1サイクルT1 において、実行ユニット
4-iでは、命令#1(add命令)の指定するレジスタ
A,Bの両内容を加算し、その加算結果を一般レジスタ
群51内のレジスタAに格納する動作が行われる。ま
た、実行ユニット4-jでは、命令#3(or命令)の指
定するレジスタC,Eの両内容をORし、そのOR結果
を一時レジスタ群52内のレジスタαに格納する動作が
行われる。デコーダ3により命令キュー3から命令#
1,#3が取出されると、後続の命令が命令キュー2に
フェッチされる。
Now, when the decoding results of the instructions # 1 and # 3 are passed from the decoder 3 to the execution units 4-i and 4-j in the parallel execution unit 4, in the first cycle T1, the execution unit 4-i An operation is performed in which the contents of both the registers A and B designated by the instruction # 1 (add instruction) are added and the addition result is stored in the register A in the general register group 51. In the execution unit 4-j, the contents of both the registers C and E designated by the instruction # 3 (or instruction) are ORed, and the OR result is stored in the register α in the temporary register group 52. Instruction # from instruction queue 3 by decoder 3
When 1 and # 3 are fetched, subsequent instructions are fetched in the instruction queue 2.

【0039】デコーダ3は、命令#1,#3が同時に実
行されるサイクルT1 において、その際に命令キュー2
に格納されている命令列(ここでは、命令#2,#4を
含む命令列)に対して、図4のフローチャートで示され
る上記(した命令#1〜#4に対するの)と同様の動作
を行う。但し、命令#4より後の命令中にレジスタA指
定部分が存在すれば、置換えテーブルに6に従ってレジ
スタα指定に置換えられる。
In the cycle T1 in which the instructions # 1 and # 3 are simultaneously executed, the decoder 3 executes the instruction queue 2 at that time.
The same operation as the above (for the executed instructions # 1 to # 4) shown in the flowchart of FIG. 4 is performed on the instruction series stored in (in this case, the instruction series including the instructions # 2 and # 4). To do. However, if the register A designated portion exists in the instruction after the instruction # 4, it is replaced with the register α designated according to 6 in the replacement table.

【0040】ここでは、命令#4より後の命令中にレジ
スタA指定部分が存在せず、各命令間にデータまたはレ
ジスタ依存関係が存在しないものとすると、デコーダ3
は、命令#2,#4(を含む命令列)を次のサイクル
(第2サイクルT2 )において同時に実行可能であるも
のと判断する。この場合、デコーダ3は、命令#2,#
4(を含む命令列)を命令キュー2から取出してデコー
ドし、そのデコード結果を並列実行部4内の実行ユニッ
トに渡して、次の第2サイクルT2 において該当する命
令を実行させる。
Here, if it is assumed that there is no register A designated portion in the instructions after the instruction # 4 and there is no data or register dependency between the instructions, the decoder 3
Determines that the instructions # 2 and # 4 (including the instruction sequence) can be simultaneously executed in the next cycle (second cycle T2). In this case, the decoder 3 uses the instructions # 2, #
4 (including the instruction string) is fetched from the instruction queue 2 and decoded, and the decoding result is passed to the execution unit in the parallel execution section 4 to execute the corresponding instruction in the next second cycle T2.

【0041】この結果、命令#2,#4のデコード結果
が実行ユニット4-s,4-t(s,tは1,2,3…のう
ちの互いに異なる値)に渡された場合であれば、実行ユ
ニット4-sでは、命令#2(and命令)の指定するレ
ジスタA,Dの両内容をANDし、そのAND結果を一
般レジスタ群51内のレジスタDに格納する動作が行わ
れる。また、実行ユニット4-tでは、命令#4(sub
命令)の指定するレジスタα,Cの両内容の減算を行
い。その減算結果を一時レジスタ群52内のレジスタα
に格納する動作が行われる。
As a result, even if the decoding results of the instructions # 2 and # 4 are passed to the execution units 4-s and 4-t (s and t are different values among 1, 2, 3 ...) For example, the execution unit 4-s performs an operation of ANDing both contents of the registers A and D designated by the instruction # 2 (and instruction) and storing the ANDed result in the register D in the general register group 51. In the execution unit 4-t, the instruction # 4 (sub
The contents of both registers α and C specified by (instruction) are subtracted. The subtraction result is stored in the register α in the temporary register group 52.
The operation of storing in.

【0042】データ整合保証回路7は、並列実行部4内
の実行ユニット4-1,4-2,4-3…によるレジスタ部5
に対するアクセスを監視している。データ整合保証回路
7は、置換えテーブル6内でVフラグがオン状態にある
エントリに登録されているレジスタ、即ちレジスタA,
αへのアクセスが実行されないサイクル(例えば第3サ
イクルT3 )を検出すると、一時レジスタαの内容を一
般レジスタAに書き戻す。そしてデータ整合保証回路7
は、置換えテーブル6内のVフラグをオフする。
The data matching assurance circuit 7 includes a register unit 5 composed of execution units 4-1, 4-2, 4-3 ... In the parallel execution unit 4.
Are watching for access to. The data matching assurance circuit 7 uses the register registered in the entry in which the V flag is ON in the replacement table 6, that is, the register A,
When a cycle in which access to α is not executed (for example, the third cycle T3) is detected, the contents of the temporary register α are written back to the general register A. And the data matching assurance circuit 7
Turns off the V flag in the replacement table 6.

【0043】このように本実施例によれば、命令間にあ
るレジスタ依存等のために、従来であれば4サイクルを
要していた図2(a)の命令列を、図2(b)のように
レジスタ置換えを行うことにで、2サイクルで実行する
ことができる。即ち本実施例によれば、レジスタ依存関
係のある命令の指定する一般レジスタを一時レジスタに
一時的に置換える(代用する)ことにより、レジスタ依
存関係のために複数の実行ユニット4-iによる命令の同
時実行を妨げることが防止でき、性能向上が図れる。
As described above, according to the present embodiment, the instruction sequence of FIG. 2A, which conventionally required four cycles due to register dependence between instructions and the like, is changed from the instruction sequence of FIG. By performing register replacement as described above, it is possible to execute in two cycles. That is, according to the present embodiment, by temporarily replacing (substituting) the general register designated by the instruction having the register dependency with the temporary register, the instructions by the plurality of execution units 4-i due to the register dependency. It is possible to prevent the simultaneous execution of and to improve the performance.

【0044】なお、一時レジスタは必ずしも複数設ける
必要はない。また、本実施例のように複数の一時レジス
タを設けた場合には、各々の一時レジスタを別々の一般
レジスタの代用とすることも可能である。また、同一の
一時レジスタを多重に代用することも可能である。
It is not always necessary to provide a plurality of temporary registers. When a plurality of temporary registers are provided as in this embodiment, each temporary register can be used as a substitute for a different general register. It is also possible to use the same temporary register multiple times.

【0045】[0045]

【発明の効果】以上詳述したようにこの発明によれば、
レジスタ依存関係のある命令の指定する一般レジスタ
(第1のレジスタ)を一時レジスタ(第2のレジスタ)
に一時的に置換えることにより、レジスタ依存関係のあ
る命令列を含むソフトウェアでも、そのソフトウェアを
改造することなく、装置が持つ複数命令の並列実行能力
を十分に生かして実行でき、性能向上を図ることができ
る。
As described in detail above, according to the present invention,
A general register (first register) designated by an instruction having a register dependency is a temporary register (second register)
By temporarily substituting in, even software that includes a sequence of instructions that has a register dependency can be executed by fully utilizing the parallel execution capability of multiple instructions of the device without modifying the software, aiming to improve performance. be able to.

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

【図1】この発明の一実施例に係る複数命令の並列実行
機能を持つ情報処理装置の構成を示すブロック図。
FIG. 1 is a block diagram showing the configuration of an information processing apparatus having a parallel execution function of a plurality of instructions according to an embodiment of the present invention.

【図2】命令キュー2に格納された命令列を、レジスタ
置換え後の命令列と対比して示す図。
FIG. 2 is a diagram showing an instruction sequence stored in an instruction queue 2 in comparison with an instruction sequence after register replacement.

【図3】図2の命令列の実行順序を、従来方式による場
合と対比して示す図。
FIG. 3 is a diagram showing the execution order of the instruction sequence in FIG. 2 in comparison with the case of a conventional method.

【図4】動作を説明するためのフローチャート。FIG. 4 is a flowchart for explaining the operation.

【符号の説明】[Explanation of symbols]

2…命令キュー、3…デコーダ(置換え手段)、4…並
列実行部、4-1,4-2,4-3…実行ユニット、5…レジ
スタ部、6…置換えテーブル、7…データ整合保証回
路、51…一般レジスタ群(第1のレジスタの群)、5
2…一時レジスタ群(第2のレジスタの群)。
2 ... Instruction queue, 3 ... Decoder (replacement means), 4 ... Parallel execution unit, 4-1, 4-2, 4-3 ... Execution unit, 5 ... Register unit, 6 ... Replacement table, 7 ... Data matching guarantee circuit , 51 ... General register group (first register group), 5
2 ... Temporary register group (second register group).

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 命令の実行ユニットを複数備え、複数命
令の並列実行が可能な情報処理装置において、 命令語で指定可能な複数の第1のレジスタと、 この第1のレジスタの代用として一時的に使用される少
なくとも1つの第2のレジスタと、 実行すべき命令列の中から、前記第1のレジスタについ
てレジスタ依存関係のある命令を検出し、その命令の指
定する前記第1のレジスタを前記第2のレジスタに一時
的に置換える手段とを具備し、 レジスタ依存関係のある複数の命令を、前記第2のレジ
スタの使用により並列に実行するようにしたことを特徴
とする情報処理装置。
1. An information processing apparatus comprising a plurality of instruction execution units and capable of executing a plurality of instructions in parallel: a plurality of first registers that can be designated by instruction words; and a temporary register as a substitute for the first registers. Detecting at least one second register used for the instruction and an instruction string to be executed for an instruction having a register dependency relationship with respect to the first register, and setting the first register designated by the instruction to the instruction. An information processing apparatus, comprising: means for temporarily replacing the second register, wherein a plurality of instructions having a register dependency are executed in parallel by using the second register.
JP3336739A 1991-12-19 1991-12-19 Information processing device with parallel execution function for multiple instructions Expired - Fee Related JP3015565B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3336739A JP3015565B2 (en) 1991-12-19 1991-12-19 Information processing device with parallel execution function for multiple instructions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3336739A JP3015565B2 (en) 1991-12-19 1991-12-19 Information processing device with parallel execution function for multiple instructions

Publications (2)

Publication Number Publication Date
JPH05173781A true JPH05173781A (en) 1993-07-13
JP3015565B2 JP3015565B2 (en) 2000-03-06

Family

ID=18302278

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3336739A Expired - Fee Related JP3015565B2 (en) 1991-12-19 1991-12-19 Information processing device with parallel execution function for multiple instructions

Country Status (1)

Country Link
JP (1) JP3015565B2 (en)

Also Published As

Publication number Publication date
JP3015565B2 (en) 2000-03-06

Similar Documents

Publication Publication Date Title
JP2937485B2 (en) Method and apparatus for detecting and executing traps in a superscalar processor
JP2938426B2 (en) Method and apparatus for detecting and recovering interference between out-of-order load and store instructions
JP3014773B2 (en) Processor architecture
US6493820B2 (en) Processor having multiple program counters and trace buffers outside an execution pipeline
US6081887A (en) System for passing an index value with each prediction in forward direction to enable truth predictor to associate truth value with particular branch instruction
EP0394624B1 (en) Multiple sequence processor system
JP3154660B2 (en) Method and system for temporarily buffering condition register data
US6772317B2 (en) Method and apparatus for optimizing load memory accesses
US6338134B1 (en) Method and system in a superscalar data processing system for the efficient processing of an instruction by moving only pointers to data
US5761467A (en) System for committing execution results when branch conditions coincide with predetermined commit conditions specified in the instruction field
JPH0682320B2 (en) Data processing device
TWI836108B (en) Data structure relinquishing
JPH09152973A (en) Method and device for support of speculative execution of count / link register change instruction
US5943494A (en) Method and system for processing multiple branch instructions that write to count and link registers
US6484256B1 (en) Apparatus and method of branch prediction utilizing a comparison of a branch history table to an aliasing table
US5745780A (en) Method and apparatus for source lookup within a central processing unit
US5841999A (en) Information handling system having a register remap structure using a content addressable table
US5784606A (en) Method and system in a superscalar data processing system for the efficient handling of exceptions
JP3015565B2 (en) Information processing device with parallel execution function for multiple instructions
JP2894438B2 (en) Pipeline processing equipment
JP2904624B2 (en) Parallel processing unit
JP2569867B2 (en) Effective Address Precalculation Pipeline Microprocessor
US20050033942A1 (en) Distribution of architectural state information in a processor across multiple pipeline stages
JPH0814792B2 (en) Data processing device
JPH10254698A (en) Information processor

Legal Events

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