JPH05127904A - Information processing device and code generation device - Google Patents

Information processing device and code generation device

Info

Publication number
JPH05127904A
JPH05127904A JP3288790A JP28879091A JPH05127904A JP H05127904 A JPH05127904 A JP H05127904A JP 3288790 A JP3288790 A JP 3288790A JP 28879091 A JP28879091 A JP 28879091A JP H05127904 A JPH05127904 A JP H05127904A
Authority
JP
Japan
Prior art keywords
instruction
priority
processing unit
loop
stream
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.)
Pending
Application number
JP3288790A
Other languages
Japanese (ja)
Inventor
Minoo Abe
美乃夫 安部
Hiroaki Hirata
博章 平田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP3288790A priority Critical patent/JPH05127904A/en
Publication of JPH05127904A publication Critical patent/JPH05127904A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

(57)【要約】 【目的】 ループの終了条件の判定が処理しているデー
タに依存していて、どの繰り返しを実行した時に終了条
件を満たすかが、あらかじめわからないループを並列に
実行できる情報処理装置と、上記ループをその情報処理
装置で実行できるオブジェクトコードに変換するコード
生成装置を提供する。 【構成】 並列に実行中の命令処理装置で一番若い繰り
返しを実行している命令処理装置に優先権を持たせ、メ
モリへのデータ転送や、ループ終了時に終了条件を検出
した命令処理装置以外の命令処理装置での処理の中断
を、上記優先権を持っている命令処理装置に限定するこ
とで、どの命令処理装置がループの終了条件を検出して
も処理の追い越しが起こらず、逐次的に実行した場合と
同じ動作を行なうことを保証して、上記ループの並列実
行を行なう。
(57) [Summary] [Purpose] Information processing that allows loops to be executed in parallel that does not know in advance which end condition will be satisfied when the determination of the end condition of the loop depends on the data being processed. (EN) An apparatus and a code generation apparatus for converting the above loop into an object code that can be executed by the information processing apparatus. [Configuration] Other than the instruction processing device that gives the priority to the instruction processing device that is executing the youngest iteration among the instruction processing devices that are executing in parallel and transfers data to the memory or detects the end condition at the end of the loop By limiting the interruption of the processing in the instruction processing device of the above to the instruction processing device having the above priority, even if any instruction processing device detects the end condition of the loop, overtaking of the process does not occur, The above-mentioned loop is executed in parallel while guaranteeing that the same operation as that of the above is executed.

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 for shortening instruction execution time by issuing instructions of a plurality of instruction streams in parallel.

【0002】[0002]

【従来の技術】近年、情報処理装置は、命令を並列処理
することで命令実行の高速化が追求されている。現在の
汎用計算機のアーキテクチャ上の定義は、暗黙の内に、
命令実行の逐次性を含んでいる。しかし、何年も前に、
高性能逐次マシンの設計者は、命令を並列実行すること
がマシンの性能向上に有用であるということを認識して
いた。この方向に沿う最初の試みは、命令処理のパイプ
ライン化である。初期のパイプライン化マシンでは、論
理的インタロック(例えば、N番目の命令の入力情報が
N−1番目の命令の実行によって生成されること)によ
り、サイクル毎に1つの命令を実行するという論理的な
限界よりも相当低い性能で動作していた。この問題はR
ISCプロセッサの登場によりほぼ解決されてきてい
る。すなわち、RISCプロセッサでは、サイクル毎に
実行する命令数はほぼ1であり、高速化の限界に近づい
ている。MIPS社のR2000/3000は、パイプ
ライン化された高性能RISCプロセッサの例である。
さらに性能向上を図るためには、もはやパイプライン化
技術のみに頼ることは不可能である。
2. Description of the Related Art In recent years, information processing apparatuses have been sought to speed up instruction execution by processing instructions in parallel. The architectural definition of the current general-purpose computer is implicitly
It includes the sequentiality of instruction execution. But many years ago,
Designers of high performance serial machines have recognized that executing instructions in parallel is useful for improving machine performance. The first attempt along this direction is instruction processing pipelining. In early pipelined machines, a logical interlock (e.g., the input information of the Nth instruction was generated by the execution of the N-1th instruction) was used to execute one instruction per cycle. It was operating at a performance considerably lower than the normal limit. This problem is R
Almost solved by the advent of the ISC processor. That is, in the RISC processor, the number of instructions executed in each cycle is almost one, which is nearing the limit of speeding up. The MIPS R2000 / 3000 is an example of a high performance pipelined RISC processor.
In order to further improve performance, it is no longer possible to rely solely on pipeline technology.

【0003】そこで、設計者は、演算ユニットなどを増
加させるという施策をとることができ、これにより、サ
イクル毎に複数の命令を発行することが可能となる。こ
の性能の向上に対して支払われる代償はハードウェアの
追加であり、これには、機能ユニットの増加のみなら
ず、アーキテクチャが要求する命令実行の論理的逐次性
を維持するための制御の複雑さの増大も含まれる。イン
テル社の80960CAはそのようなスーパスカラ技術
を用いた最初の商用マイクロプロセッサである。
Therefore, the designer can take a measure to increase the number of arithmetic units and the like, which makes it possible to issue a plurality of instructions for each cycle. The price to pay for this performance increase is the addition of hardware, which not only adds more functional units, but also the control complexity to maintain the logical sequentiality of instruction execution required by the architecture. Increase is also included. The Intel 80960CA is the first commercial microprocessor to use such superscalar technology.

【0004】しかし、複数の処理ユニットを内蔵し、並
列に実行する命令数を増やせば性能が上がるとは限らな
い。普通のアプリケーションを考えると、やはり論理的
なインタロックに起因して、並列に実行できるのはせい
ぜい2〜3個の処理といわれる。命令の並列実行の可能
性には自ずと限界がある(例えば、「日経エレクトロニ
クス」第487号191〜200ページ)。この問題
は、命令実行レベルで利用する命令ストリームが1つで
あり、命令間に依存関係が存在することにより発生す
る。そこで、並列発行する命令を複数の命令ストリーム
に求め、命令レベルの並列性を増すことにより、高スル
ープットを実現する情報処理装置が提案されている(例
えば、特開平3−134882号公報)。さらに、単一
のプログラムの実行を高速化する手法として、ループの
各繰り返しをそれぞれ異なるストリームとして並列に実
行する方法が提案されている。
However, the performance is not always improved by incorporating a plurality of processing units and increasing the number of instructions to be executed in parallel. Considering an ordinary application, it is said that only a few processes can be executed in parallel due to the logical interlock. The possibility of parallel execution of instructions is naturally limited (for example, "Nikkei Electronics", No. 487, pages 191 to 200). This problem occurs because there is one instruction stream used at the instruction execution level and there is a dependency between instructions. Therefore, an information processing apparatus has been proposed which realizes high throughput by obtaining instructions to be issued in parallel from a plurality of instruction streams and increasing instruction level parallelism (for example, Japanese Patent Laid-Open No. 3-134882). Furthermore, as a method of speeding up the execution of a single program, a method of executing each iteration of the loop in parallel as different streams has been proposed.

【0005】以下図面を参照して上記のループの並列実
行について説明する。図8は高級プログラミング言語で
記述したループの一例である。ここで変数iがループの
制御変数と呼ばれるもので、この例ではiの値が1ずつ
増えながらループが実行される。81はループの終了条
件を記述したもので、変数iの値が10000未満であ
る間、82の部分で示されるループの繰り返しの本体の
部分(以下ではループのボディと呼ぶ)が実行される。
また、図9は複数の命令処理部を持つ情報処理装置の一
例である。この例では命令処理部の数を4としている。
91から94までがそれぞれ命令処理部で、内部には命
令ストリームからの命令を解釈・実行するためにコンテ
クストを保持するプログラムカウンタやレジスタなどが
含まれる。この情報処理装置を用いて上記のループを並
列に実行するには、4つの命令処理部でそれぞれループ
の4分の1ずつを実行すればよい。このときのループの
分割のしかたにはいくつかの方法がある。
The parallel execution of the above loop will be described below with reference to the drawings. FIG. 8 shows an example of a loop written in a high level programming language. Here, the variable i is called a control variable of the loop, and in this example, the loop is executed while the value of i is increased by one. Reference numeral 81 describes a loop end condition, and while the value of the variable i is less than 10000, the loop main body portion (hereinafter referred to as the loop body) indicated by the portion 82 is executed.
Further, FIG. 9 is an example of an information processing apparatus having a plurality of instruction processing units. In this example, the number of instruction processing units is four.
Reference numerals 91 to 94 each denote an instruction processing unit, which internally includes a program counter and a register that hold a context for interpreting and executing an instruction from an instruction stream. In order to execute the above loops in parallel by using this information processing apparatus, it is sufficient that four instruction processing units each execute one quarter of the loop. There are several methods for dividing the loop at this time.

【0006】たとえば、命令処理部91がi=0、4、
…、9996のときのループのボディを実行し、命令処
理部92がi=1、5、…、9997のときのループの
ボディを実行するというように命令処理部の数に応じ
て、制御変数の初期値と増分を決定することによりルー
プを分割する方法がある。このとき各命令処理部が実行
する命令を図10に示す。101が命令処理部91が処
理する命令ストリーム、102が命令処理部92が処理
する命令ストリーム、103が命令処理部93が処理す
る命令ストリーム、104が命令処理部94が処理する
命令ストリームの例である。このように一つのループを
複数の命令処理部で並列に実行することにより処理時間
の短縮を図ることができる。
For example, the instruction processing unit 91 uses i = 0, 4,
, 9996 executes the body of the loop, and the instruction processing unit 92 executes the body of the loop when i = 1, 5, ..., 9997, and so on. There is a way to split the loop by determining the initial value of and the increment. FIG. 10 shows an instruction executed by each instruction processing unit at this time. In the example, 101 is an instruction stream processed by the instruction processing unit 91, 102 is an instruction stream processed by the instruction processing unit 92, 103 is an instruction stream processed by the instruction processing unit 93, and 104 is an instruction stream processed by the instruction processing unit 94. is there. As described above, the processing time can be shortened by executing one loop in parallel by the plurality of instruction processing units.

【0007】[0007]

【発明が解決しようとする課題】しかしながら上記のよ
うなループの並列処理は、ループ終了条件の判定が処理
しているデータに依存していて、ループ終了の判定が各
ストリームで独立に行なえないような場合には適用でき
ない。図4がこのようなループの例である。この例で
は、変数ptrの値が前回のループの実行で設定されて
おり、n−1回目のループの実行が終了するまでn回目
のループを実行できない。さらに、ループの終了条件が
リスト構造のデータを順にたどっていくことでしか判定
できないので、複数のストリームで実行した場合、終了
条件を検出できるストリームは一つしか存在しない。従
って従来の並列情報処理装置では、図4に示すようなル
ープは並列処理を行なうことができない。
However, the parallel processing of the loop as described above depends on the data being processed in the judgment of the loop end condition, and the judgment of the loop end cannot be made independently in each stream. Not applicable in all cases. FIG. 4 is an example of such a loop. In this example, the value of the variable ptr is set in the previous execution of the loop, and the nth loop cannot be executed until the execution of the (n-1) th loop is completed. Further, since the end condition of the loop can be determined only by sequentially tracing the data of the list structure, when executed by a plurality of streams, only one stream can detect the end condition. Therefore, in the conventional parallel information processing apparatus, a loop as shown in FIG. 4 cannot perform parallel processing.

【0008】[0008]

【課題を解決するための手段】第1の発明(請求項1)
の情報処理装置は、P個(Pは2以上)の命令ストリー
ムからの命令を同時に処理する並列情報処理装置におい
て、n番(1≦n≦P)の命令ストリームの命令を処理
する命令処理部から、n+1番(ただしn=Pのときは
1番)の命令ストリームの命令を処理する命令処理部に
対し、データを転送するためのキューを持つことを特徴
としている。
[Means for Solving the Problems] First invention (Claim 1)
Information processing apparatus is a parallel information processing apparatus that simultaneously processes instructions from P (P is 2 or more) instruction streams, and an instruction processing unit that processes instructions of an n-th (1 ≦ n ≦ P) instruction stream. Therefore, it is characterized by having a queue for transferring data to the instruction processing unit that processes the instruction of the n + 1th instruction stream (however, the first instruction stream when n = P).

【0009】第2の発明(請求項2)の情報処理装置
は、P個(Pは2以上)の命令ストリームからの命令を
同時に処理する並列情報処理装置において、n番(1≦
n≦P)の命令ストリームの命令を処理する命令処理部
から、そのn番の命令ストリームの処理を実行するのに
必要なコンテクストを、他のP−1個の命令処理部に対
してコピーする、コンテクスト・コピー機構を持つこと
を特徴としている。
The information processing apparatus of the second invention (claim 2) is a parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams.
The context necessary for executing the processing of the nth instruction stream is copied from the instruction processing unit that processes the instruction stream of n ≦ P) to the other P−1 instruction processing units. , And has a context copy mechanism.

【0010】第3の発明(請求項3)の情報処理装置
は、P個(Pは2以上)の命令ストリームからの命令を
同時に処理する並列情報処理装置において、n番(1≦
n≦P)の命令ストリームの命令を処理する命令処理部
が、他のP−1個の命令処理部に対して、優先権を持つ
ことを示す優先権表示機構と、上記優先権表示機構によ
って上記命令処理部が優先権を持っていると示された場
合に限って、その優先権をn+1番(ただしn=Pのと
きは1番)の命令ストリームの命令を処理する命令処理
部に対応する優先権表示機構に移動し、優先権を持って
いない場合は、優先権が得られるまで上記命令処理部の
処理を停止させ、優先権が得られてからその優先権をn
+1番(ただしn=Pのときは1番)の命令ストリーム
の命令を処理する命令処理部に対応する優先権表示機構
に移動する、条件付き優先権移動機構を持つことを特徴
としている。
An information processing apparatus according to a third aspect of the present invention (claim 3) is a parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams.
(n ≦ P) The instruction processing unit for processing the instruction stream has a priority display mechanism indicating that it has priority over the other P−1 instruction processing units, and the priority display mechanism described above. Only when it is indicated that the instruction processing unit has the priority right, the priority processing unit corresponds to the instruction processing unit that processes the instruction of the n + 1th instruction stream (however, when n = P, the first instruction stream). If there is no priority right, the processing of the instruction processing unit is stopped until the priority right is obtained, and the priority right is given after the priority right is obtained.
It is characterized by having a conditional priority moving mechanism that moves to a priority display mechanism corresponding to an instruction processing unit that processes an instruction of an instruction stream of +1 (however, it is first when n = P).

【0011】第4の発明(請求項4)の情報処理装置
は、P個(Pは2以上)の命令ストリームからの命令を
同時に処理する並列情報処理装置において、n番(1≦
n≦P)の命令ストリームの命令を処理する命令処理部
が、第3の発明の優先権表示機構によって優先権を持っ
ていると示された場合に限って、他のP−1個の命令処
理部で実行中の命令ストリームの処理を中断させ、優先
権を持っていない場合は、優先権が得られるまで上記命
令処理部の処理を停止させ、優先権が得られてから他の
P−1個の命令処理部で実行中の命令ストリームの処理
を中断させる、条件付き命令ストリーム中断機構を持つ
ことを特徴としている。
An information processing apparatus according to a fourth invention (claim 4) is a parallel information processing apparatus which simultaneously processes instructions from P (P is 2 or more) instruction streams.
Only when the instruction processing unit for processing the instructions of the instruction stream of n ≦ P) is shown to have the priority by the priority display mechanism of the third invention, other P-1 instructions When the processing of the instruction stream being executed in the processing unit is interrupted and the priority is not granted, the processing of the instruction processing unit is stopped until the priority is obtained, and after the priority is obtained, another P- It is characterized by having a conditional instruction stream interruption mechanism for interrupting the processing of the instruction stream being executed by one instruction processing unit.

【0012】第5の発明(請求項5)の情報処理装置
は、P個(Pは2以上)の命令ストリームからの命令を
同時に処理する並列情報処理装置において、n番(1≦
n≦P)の命令ストリームの命令を処理する命令処理部
が、第3の発明優先権表示機構によって優先権を持って
いると示された場合に限って、メモリへのデータ転送を
実行し、優先権を持っていない場合は、優先権が得られ
るまで上記命令処理部の処理を停止させ、優先権が得ら
れてからメモリへのデータ転送を実行する、条件付きデ
ータ転送機構を持つことを特徴としている。
An information processing apparatus according to a fifth aspect of the present invention is a parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams.
(n ≦ P) The instruction processing unit for processing the instruction stream executes the data transfer to the memory only when it is indicated by the third invention priority display mechanism that the instruction processing unit has the priority. If you do not have the priority right, you should have a conditional data transfer mechanism that stops the processing of the above instruction processing unit until the priority right is obtained and executes data transfer to the memory after the priority right is obtained. It has a feature.

【0013】第6の発明(請求項6)の情報処理装置
は、P個(Pは2以上)の命令ストリームからの命令を
同時に処理する並列情報処理装置において、第1の発明
のキュー、第2の発明のコンテクスト・コピー機構、第
3の発明の優先権表示機構と条件付き優先権移動機構、
第4の発明の条件付き命令ストリーム中断機構、第5の
発明の条件付きデータ転送機構を持つことを特徴として
いる。
An information processing apparatus according to a sixth invention (claim 6) is a parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams. A context copy mechanism of the second invention, a priority display mechanism and a conditional priority transfer mechanism of the third invention,
It is characterized by having the conditional instruction stream interruption mechanism of the fourth invention and the conditional data transfer mechanism of the fifth invention.

【0014】第1の発明(請求項7)のコード生成装置
は、高級プログラミング言語で記述された原始プログラ
ムを入力として目的プログラムを生成するコンパイラに
採用されるコード生成装置であって、ループを検出し、
そのループの各繰り返しを別々のスレッドとして複数の
命令処理部で並列に実行される命令列として目的プログ
ラムを生成するスレッド生成部と、ループ中に前回の繰
り返し実行中に設定された変数の値を現在の繰り返し実
行中に使用していることを検出する依存検出部と、前記
依存検出部によって検出された依存のある変数を第1の
発明のキューを通じて前の繰り返しを実行する命令処理
部から受け取る命令を生成する依存変数受理命令生成部
と、前記依存検出部によって検出された依存のある変数
を前記キューを通じて次の繰り返しを実行する命令処理
部に送出する命令を生成する依存変数送出命令生成部
と、1回の繰り返しが終了した時点で第3の発明の優先
権移動機構を用いて次の繰り返しを実行する命令処理部
に優先権を移動する命令を生成する優先権移動命令生成
部と、ループ終了条件を満たしループの繰り返しの実行
を終了した場合に実行される命令として第4の発明に示
した命令ストリーム中断機構を用いて、ループ終了条件
を満たした命令ストリーム以外の命令ストリームの実行
を中断する命令を生成するストリーム中断命令生成部か
らなることを特徴としている。
A code generating apparatus according to a first aspect of the present invention (claim 7) is a code generating apparatus employed in a compiler for generating a target program by using a source program written in a high-level programming language as an input, and detecting a loop. Then
Each iteration of the loop is treated as a separate thread by the thread generator that generates the target program as an instruction string that is executed in parallel by multiple instruction processors, and the value of the variable set during the previous iteration during the loop. A dependency detection unit that detects the use during the current iterative execution, and a dependent variable detected by the dependency detection unit are received from the instruction processing unit that executes the previous iteration through the queue of the first invention. A dependent variable acceptance command generation unit that generates a command, and a dependence variable transmission command generation unit that generates a command to transmit a variable having a dependency detected by the dependence detection unit to the command processing unit that executes the next iteration through the queue. When one iteration is completed, the priority is moved to the instruction processing unit that executes the next iteration by using the priority moving mechanism of the third invention. Using the priority transfer instruction generating unit that generates an instruction and the instruction stream interruption mechanism shown in the fourth invention as an instruction executed when the loop end condition is satisfied and the execution of the loop iteration is ended. It is characterized by comprising a stream interruption instruction generation unit for generating an instruction for interrupting the execution of an instruction stream other than the instruction stream satisfying the above condition.

【0015】第2の発明(請求項8)のコード生成装置
は、高級プログラミング言語で記述された原始プログラ
ムを入力として目的プログラムを生成するコンパイラに
採用される第1の発明のコード生成装置に、ループの各
繰り返しの実行で計算される値で、最終の繰り返しの実
行で計算された値がループの終了後に使用されているこ
とを検出するループ外使用変数検出部と、上記ループ外
使用変数検出部で検出された変数のメモリへの転送に第
5の発明の条件付きデータ転送機構を用いる命令を生成
する条件付きデータ転送命令生成部とをさらに有するこ
とを特徴としている。
A code generating apparatus according to a second invention (claim 8) is the code generating apparatus according to the first invention, which is adopted in a compiler for generating a target program by inputting a source program written in a high-level programming language. Out-of-loop used variable detection part that detects that the value calculated in the execution of the last iteration is used after the end of the loop, with the value calculated in each execution of the loop. And a conditional data transfer instruction generating section for generating an instruction using the conditional data transfer mechanism of the fifth invention for transferring the variable detected by the section to the memory.

【0016】[0016]

【作用】第1の発明の情報処理装置は、ループの各繰り
返し間に依存のある変数を、キューを介して次の繰り返
しを実行する命令処理部に転送することとなる。また、
第2の発明の情報処理装置は、ループの実行を開始する
前に、コンテクスト・コピー機構によりループの並列実
行に必要なコンテクストを他の命令処理部にコピーする
こととなる。第3の発明の情報処理装置は、まず、1回
目のループを実行する命令処理部に優先権を持たせてお
き、1回目の繰り返しの処理が終った時点で、順次、優
先権を次の繰り返しを行なっている命令処理部に移動す
ることにより、並列に実行中のループの各繰り返しの
内、常に一番若い繰り返しを行なっている命令処理部が
優先権を持つこととなる。
According to the first aspect of the invention, the information processing apparatus transfers variables that are dependent on each iteration of the loop to the instruction processing unit that executes the next iteration via the queue. Also,
The information processing apparatus of the second invention copies the context required for parallel execution of the loop to another instruction processing unit by the context copy mechanism before starting the execution of the loop. In the information processing apparatus according to the third aspect of the present invention, first, the instruction processing unit that executes the first loop is given priority, and when the processing of the first iteration is completed, the priority is sequentially changed to the next priority. By moving to the instruction processing unit that is performing the iteration, the instruction processing unit that is always performing the youngest iteration among the respective iterations of the loops being executed in parallel has the priority.

【0017】第4の発明の情報処理装置は、命令処理部
でループの終了条件を満たした場合、その命令処理部が
他の命令処理部での処理を中断しようとすることを許
し、さらにその中断は、その命令処理部が優先権を得て
から完了するものとすることで、終了条件を満たす繰り
返しの実行は、それよりも若い繰り返しの実行がすべて
終了した後に完了されることとなる。
The information processing apparatus according to the fourth aspect of the invention, when the instruction processing unit satisfies the loop termination condition, allows the instruction processing unit to interrupt the processing in another instruction processing unit, and further It is assumed that the interruption is completed after the instruction processing unit obtains the priority, so that the repeated execution satisfying the end condition is completed after all the younger executed executions are completed.

【0018】第5の発明の情報処理装置は、ループ中に
ループ終了後に使用される変数があった場合、その変数
のメモリへの転送は、その命令処理部が優先権を得られ
るまで待ってから行なうので、メモリへのデータ転送は
若い繰り返しを行なっている命令処理部から順に行なわ
れることになり、ループ終了後には最後の繰り返しで転
送されたデータがメモリ中に存在することとなる。
In the information processing apparatus of the fifth invention, when there is a variable used in the loop after the loop ends, the variable is transferred to the memory by waiting until the instruction processing unit gets the priority. Since the data is transferred to the memory, the data is transferred to the memory in order from the instruction processing unit that is performing the young iteration, and after the end of the loop, the data transferred in the last iteration is present in the memory.

【0019】第6の発明は上記した第1から第5の発明
の構成要件の組合せにより、従来の情報処理装置では並
列実行不可能な、例えば、図4に示したようなループを
並列に実行することとなる。
A sixth aspect of the present invention is a parallel execution of a loop, such as that shown in FIG. 4, which cannot be executed in parallel by a conventional information processing apparatus, due to the combination of the constituent features of the first to fifth inventions. Will be done.

【0020】第1の発明のコード生成装置は、ループを
並列に実行される複数のストリームに分割し、ループ間
にまたがる変数の依存検出を行なって、命令処理部間転
送命令を生成し、また、1回の繰り返しが終了した時点
で次の繰り返しを行なっている命令処理部に優先権を移
動する命令を生成し、さらに、ループ終了後に、ループ
終了条件を検出した命令処理部が他の命令処理部の処理
を中断するための命令を生成することにより、第6の発
明の情報処理装置で実行可能なオブジェクトコードを生
成することとなる。
The code generation device of the first invention divides the loop into a plurality of streams to be executed in parallel, performs dependency detection of variables across the loops, generates transfer instructions between instruction processing units, and At the end of one iteration, an instruction to move the priority right to the instruction processing unit that is performing the next iteration is generated, and after the loop ends, the instruction processing unit that detects the loop end condition is another instruction. By generating the instruction for interrupting the processing of the processing unit, the object code executable by the information processing apparatus of the sixth invention is generated.

【0021】第2の発明のコード生成装置は、上記第1
の発明のコード生成装置の動作に加えて、ループ中で設
定されている変数でループ終了後も使用される変数を検
出し、その変数のメモリへの転送命令として第5の発明
の条件付きデータ転送機構を用いる命令を生成すること
となる。
The code generating device of the second invention is the code generating device of the first invention.
In addition to the operation of the code generation device of the invention of claim 5, a variable that is used even after the end of the loop is detected in the variable set in the loop, and the conditional data of the fifth invention is used as a transfer instruction of the variable to the memory. An instruction that uses the transfer mechanism will be generated.

【0022】[0022]

【実施例】以下本発明の一実施例について図面を参照し
ながら説明する。図1は本発明の第1の実施例における
情報処理装置の構成を示すブロック図である。本実施例
では複数ある命令処理部の数を4として説明を行なう。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of the information processing apparatus in the first embodiment of the present invention. In this embodiment, the description will be given assuming that the number of plural instruction processing units is four.

【0023】図1において、1から4はP個(Pは2以
上)の命令ストリームからの命令を同時に処理するため
の命令処理部、5から8はn番(1≦n≦P)の命令ス
トリームの命令を処理する命令処理部から、n+1番
(ただしn=Pのときは1番)の命令ストリームの命令
を処理する命令処理部に対し、データを転送するための
キュー、9はn番(1≦n≦P)の命令ストリームの命
令を処理する命令処理部から、そのn番の命令ストリー
ムの処理を実行するのに必要なコンテクストを、他のP
−1個の命令処理部に対してコピーする、コンテクスト
・コピー機構である。
In FIG. 1, 1 to 4 are instruction processing units for simultaneously processing instructions from P (P is 2 or more) instruction streams, and 5 to 8 are nth (1≤n≤P) instructions. A queue for transferring data from an instruction processing unit that processes an instruction of a stream to an instruction processing unit that processes an instruction of an n + 1th instruction stream (however, 1 when n = P), 9 is an nth instruction From the instruction processing unit that processes the instruction of the instruction stream of (1 ≦ n ≦ P), the context necessary for executing the processing of the nth instruction stream is set to another P
-1 is a context copy mechanism for copying to one instruction processing unit.

【0024】10から13は、各命令処理部に対応した
idレジスタ、14から17はn番(1≦n≦P)の命
令ストリームの命令を処理する命令処理部が、他のP−
1個の命令処理部に対して、優先権を持つことを示す優
先権表示機構、18から21は前記優先権表示機構によ
って前記命令処理部が優先権を持っていると示された場
合に限って、その優先権をn+1番(ただしn=Pのと
きは1番)の命令ストリームの命令を処理する命令処理
部に対応する優先権表示機構に移動し、優先権を持って
いない場合は、優先権が得られるまで上記命令処理部の
処理を停止させ、優先権が得られてからその優先権を、
n+1番(ただしn=Pのときは1番)の命令ストリー
ムの命令を処理する命令処理部に対応する優先権表示機
構に移動する条件付き優先権移動機構である。
10 to 13 are id registers corresponding to the respective instruction processing units, and 14 to 17 are instruction processing units for processing the instructions of the nth (1≤n≤P) instruction stream, and the other P-
A priority display mechanism indicating that one instruction processing unit has a priority right, and reference numerals 18 to 21 only when the instruction processing unit indicates that the instruction processing unit has a priority right. Then, the priority is moved to the priority display mechanism corresponding to the instruction processing unit that processes the instruction of the instruction stream of n + 1th (however, when n = P) instruction stream, and if there is no priority, The processing of the instruction processing unit is stopped until the priority is obtained, and after the priority is obtained, the priority is
This is a conditional priority moving mechanism that moves to the priority display mechanism corresponding to the instruction processing unit that processes the instruction of the n + 1th instruction stream (where n is the first instruction when n = P).

【0025】22から25は優先権表示機構によって優
先権を持っていると示された場合に限って、他のP−1
個の命令処理部で実行中の命令ストリームの処理を中断
させ、優先権を持っていない場合は、優先権が得られる
まで上記命令処理部の処理を停止させ、優先権が得られ
てから他のP−1個の命令処理部で実行中の命令ストリ
ームの処理を中断させる条件付き命令ストリーム中断機
構、26から29はn番(1≦n≦P)の命令ストリー
ムの命令を処理する命令処理部が、優先権表示機構によ
って優先権を持っていると示された場合に限って、メモ
リへのデータ転送を実行し、優先権を持っていない場合
は、優先権が得られるまで上記命令処理部の処理を停止
させ、優先権が得られてからメモリへのデータ転送を実
行する条件付きデータ転送機構である。
22 to 25 are the other P-1s only when the priority display mechanism indicates that they have priority.
If the instruction stream being executed by each instruction processing unit is interrupted and the user does not have the priority right, the processing of the instruction processing unit is stopped until the priority right is obtained, and after the priority right is obtained, Conditional instruction stream interruption mechanism for interrupting the processing of the instruction stream being executed by P-1 instruction processing units, and 26 to 29 are instruction processing for processing instructions of the nth (1 ≦ n ≦ P) instruction stream Part performs data transfer to the memory only when the priority display mechanism indicates that it has the priority, and if it does not have the priority, the above instruction processing is performed until the priority is obtained. This is a conditional data transfer mechanism that stops the processing of the unit and executes the data transfer to the memory after the priority is obtained.

【0026】なお、命令処理部1から4で、それぞれ独
立の命令ストリームからの命令を解読・実行できる。各
命令処理部は、実行中のプログラムのコンテクストを保
持するプログラムカウンタやレジスタを備えている。キ
ュー5から8は各命令処理部の間に位置し、たとえば、
命令処理部1がキュー5に書き込んだデータを命令処理
部2がキュー5から読み出すことができる構成になって
いる。キュー5から8には内部に既にデータが格納され
ていることを示すレディフラグを持ち、空のキューから
データを読み出そうとした命令処理部は、キューにデー
タが書き込まれるまでインターロックする。
The instruction processing units 1 to 4 can decode and execute the instructions from the independent instruction streams. Each instruction processing unit includes a program counter and a register for holding the context of the program being executed. Queues 5 to 8 are located between the instruction processing units, and, for example,
The instruction processing unit 2 can read the data written in the queue 5 by the instruction processing unit 1 from the queue 5. The queues 5 to 8 each have a ready flag indicating that the data is already stored therein, and the instruction processing unit that attempts to read the data from the empty queue interlocks until the data is written in the queue.

【0027】コンテクスト・コピー機構9は、ある命令
処理部に備えられているプログラムカウンタやレジスタ
などのコンテクスト情報を、他の命令処理部のプログラ
ムカウンタやレジスタにコピーする。この際、コピー元
の命令処理部と、コピー先の命令処理部を区別するため
のidを、各命令処理部10から13に対応したidレ
ジスタに設定する。優先権表示機構は4つの命令処理部
のどれが優先権を持つかを示している。条件付き優先権
移動機構18から21は、優先権を持っている命令処理
部から優先権移動の指示があった場合に、隣の命令処理
部に対応する優先権表示機構に優先権を移動する。も
し、優先権を持たない命令処理部が優先権移動の指示を
出した場合は、優先権が得られるまでその命令処理部の
処理はインターロックされ、優先権が得られた時点で処
理が再開されて、優先権が移動される。
The context copy mechanism 9 copies context information such as a program counter and a register provided in a certain instruction processing unit to a program counter and a register in another instruction processing unit. At this time, an id for distinguishing the copy source instruction processing unit and the copy destination instruction processing unit is set in the id registers corresponding to the instruction processing units 10 to 13. The priority display mechanism indicates which of the four instruction processing units has the priority. The conditional priority moving mechanisms 18 to 21 move the priority to the priority display mechanism corresponding to the adjacent instruction processing unit when the instruction processing unit having the priority gives an instruction to move the priority. .. If the instruction processing unit that does not have priority issues an instruction to move the priority, the processing of the instruction processing unit is interlocked until the priority is obtained, and the process is restarted when the priority is obtained. Then, the priority is transferred.

【0028】条件付き命令ストリーム中断機構22から
25は、優先権を持っている命令処理部が命令処理を中
断する指示を行なった場合に、他の命令処理部で実行中
の処理を即座に中断させる。もし、優先権を持たない命
令処理部が命令処理の中断を指示した場合は、優先権が
得られるまでその命令処理部の処理がインターロックさ
れ、優先権が得られた時点で処理が再開され、他の命令
処理部での処理を中断させる。条件付きデータ転送機構
26から29は、優先権を持っている命令処理部がデー
タ転送を指示した場合に、メモリへのデータ転送を実行
する。もし、優先権を持たない命令処理部がデータ転送
を指示した場合には、優先権が得られるまでその命令処
理部の処理がインターロックされ、優先権が得られた時
点で処理が再開されメモリへのデータ転送を実行する。
The conditional instruction stream interruption mechanisms 22 to 25 immediately interrupt the processing being executed by another instruction processing unit when the instruction processing unit having the priority gives an instruction to interrupt the instruction processing. Let If an instruction processing unit that does not have priority orders to suspend instruction processing, the processing of that instruction processing unit is interlocked until the priority is obtained, and the process is restarted when the priority is obtained. , The processing in other instruction processing units is interrupted. The conditional data transfer mechanisms 26 to 29 execute the data transfer to the memory when the instruction processing unit having the priority has instructed the data transfer. If an instruction processing unit that does not have priority orders data transfer, the processing of that instruction processing unit is interlocked until the priority is obtained, and when the priority is obtained, the process is restarted and the memory is restarted. Data transfer to.

【0029】図4は本実施例の情報処理装置で並列実行
されるループを高級言語で記述したものであり、図5は
実際に実行されるオブジェクトコードである。図4に示
した高級言語から、図5に示したオブジェクトコードへ
の変換については、第2の実施例の説明のときに詳述す
る。ここでは図5を用いて第1の実施例の動作の説明を
行なう。
FIG. 4 shows a loop executed in parallel in the information processing apparatus of this embodiment in a high-level language, and FIG. 5 shows object code actually executed. The conversion from the high-level language shown in FIG. 4 to the object code shown in FIG. 5 will be described in detail when the second embodiment is described. Here, the operation of the first embodiment will be described with reference to FIG.

【0030】ループの処理を開始するまでは、オブジェ
クトコードはいずれかの命令処理部で逐次的に実行され
ている。ここでは説明のために命令処理部1で処理が実
行されていたものとする。ループの処理が開始される
と、命令処理部1で1、5、…回目の繰り返し、命令処
理部2で2、6、…回目の繰り返し、命令処理部3で
3、7、…回目の繰り返し、命令処理部4で4、8、…
回目の繰り返しが実行される。 まず、命令処理部1が
51のload命令を実行し、変数ptrの値が初期化
される。次に52で一つの命令ストリームの部分のqi
nit命令を実行すると、全てのキューが初期化され内
容が空になる。次にfork命令を実行することで命令
処理部1のコンテクストが他の命令処理部にコンテクス
ト・コピー機構9を使ってコピーされる。さらに、コン
テクストのコピー元とコピー先の命令処理部を区別する
ために、idレジスタ10から13に違った値が設定さ
れる。
Until the processing of the loop is started, the object code is sequentially executed by any of the instruction processing units. Here, for the sake of explanation, it is assumed that the processing is executed by the instruction processing unit 1. When the processing of the loop is started, the instruction processing unit 1 repeats the 1st, 5th, ... th iteration, the instruction processing unit 2 repeats the 2,6, ... th iteration, the instruction processing unit 3 repeats the 3,7, ... th iteration. , The instruction processing unit 4, 4, 8, ...
The second iteration is executed. First, the instruction processing unit 1 executes the load instruction 51, and the value of the variable ptr is initialized. Next, at 52, qi of a part of one instruction stream
When the nit instruction is executed, all queues are initialized and the contents become empty. Next, by executing the fork instruction, the context of the instruction processing unit 1 is copied to another instruction processing unit by using the context copy mechanism 9. Further, different values are set in the id registers 10 to 13 in order to distinguish the copy source and copy destination instruction processing units.

【0031】本実施例では、コピー元の命令処理部のi
dレジスタ10には0が、コピー先の命令処理部のid
レジスタ11から13には0以外の値が設定される。ま
た、このとき同時に優先権が命令処理部1に対応する優
先権表示機構14に設定される。命令処理部1は1回目
の繰り返しを実行する時のみ、キュー8から値を取り込
んで処理する代わりに、初期値をもとに処理を行なうの
で、53の部分の命令を実行してラベルLstartに
分岐する。ここでgetid命令は、各命令処理部に対
応するidレジスタから値を取り出してレジスタに設定
する命令である。 他の命令処理部は、idレジスタの
内容が0ではないので分岐せずに、54の命令を実行す
る。54の命令は、それぞれの命令処理部が対応するキ
ューから値を取り出してオフセットを加えてレジスタに
ロードする命令で、変数ptrの新しい値がレジスタに
設定される。もし、まだキューに値が書き込まれていな
ければその時点で命令実行が中断し、キューに値が書き
込まれるのを待つことになる。 1回目のループを実行
している命令処理部1とキューから値を読み出すことの
できた命令処理部は、55の命令を実行し、ループの終
了条件が満たされているかどうかのチェックを行なう。
1回目のループを実行している命令処理部1は、命令5
1で設定された初期値がループの終了条件を満たしてい
るかどうかをチェックし、他の命令処理部は命令54の
実行でレジスタにロードされた値が終了条件を満たして
いるかどうかをチェックする。もし、終了条件をみたし
ている値を検出した命令処理部があれば、その命令処理
部はラベルLexitに分岐する。 終了条件が満たさ
れていない場合は、各命令処理部は分岐を行なわずに、
命令56を実行し、依存のある変数ptrの新しい値を
キューに書き込む。キューにデータが書き込まれるのを
待っていた命令処理部は、この書き込みによって処理を
再開する。たとえば、命令処理部2がキュー5からデー
タを取り出す時点で止まっていたとすると、命令処理部
1がデータをキュー5に書き込むことによって、命令処
理部2の処理が再開し、命令処理部1が書き込んだデー
タを取り出すことになる。
In this embodiment, i of the instruction processing unit of the copy source is
In the d register 10, 0 is the id of the copy destination instruction processing unit.
A value other than 0 is set in the registers 11 to 13. At the same time, the priority is set in the priority display mechanism 14 corresponding to the instruction processing unit 1. The instruction processing unit 1 performs the processing based on the initial value instead of fetching the value from the queue 8 and processing it only when executing the first iteration. Therefore, the instruction of the portion 53 is executed to label Lstart. Branch off. Here, the getid instruction is an instruction for fetching a value from the id register corresponding to each instruction processing unit and setting it in the register. The other instruction processing unit executes the instruction of 54 without branching because the content of the id register is not 0. The instruction 54 is an instruction for each instruction processing unit to take a value from the corresponding queue, add an offset and load the value into a register, and a new value of the variable ptr is set in the register. If the value is not yet written in the queue, the instruction execution is interrupted at that point and the value is written in the queue. The instruction processing unit 1 executing the first loop and the instruction processing unit that has been able to read the value from the queue execute the instruction 55 and check whether the loop termination condition is satisfied.
The instruction processing unit 1 executing the first loop executes the instruction 5
It is checked whether the initial value set in 1 satisfies the end condition of the loop, and the other instruction processing unit checks whether the value loaded in the register by the execution of the instruction 54 satisfies the end condition. If there is an instruction processing unit that has detected a value satisfying the end condition, the instruction processing unit branches to the label Lexit. If the end condition is not satisfied, each instruction processing unit does not branch and
Execute instruction 56 to write the new value of the dependent variable ptr to the queue. The instruction processing unit waiting for the data to be written in the queue restarts the processing by this writing. For example, if the instruction processing unit 2 is stopped at the time of fetching data from the queue 5, the instruction processing unit 1 writes the data to the queue 5, whereby the processing of the instruction processing unit 2 is restarted and the instruction processing unit 1 writes the data. However, the data will be retrieved.

【0032】次に各命令処理部はループのボディ部の命
令57を実行する。57の命令の処理が終了した命令処
理部は、優先権移動のための命令58を実行する。この
命令の実行により、ループを1回実行するたびに次の繰
り返しを実行している命令処理部に優先権が移動するこ
とになる。次に各命令処理部は命令59を実行してラベ
ルLoopに分岐する。以後は命令処理部1を含めて、
すべての命令処理部が上記の処理を並列に繰り返し行な
う。
Next, each instruction processing unit executes the instruction 57 in the body of the loop. The command processing unit that has finished processing the command 57 executes the command 58 for priority transfer. By executing this instruction, each time the loop is executed once, the priority is transferred to the instruction processing unit executing the next iteration. Next, each instruction processing unit executes the instruction 59 and branches to the label Loop. After that, including the instruction processing unit 1,
All instruction processing units repeat the above processing in parallel.

【0033】この時の実行の様子を図2に示す。依存の
ある変数ptrが各繰り返しの早い段階で次の繰り返し
を実行する命令処理部にキューを通じて転送されるの
で、ループのボディ部の実行を並列に行なうことができ
る。ループの終了条件を検出し、ラベルLexitに分
岐した命令処理部は、命令510を実行して、他の命令
処理部で実行されている命令ストリームの処理を中断
し、以降の実行を再び逐次的に行う。この様子を図3に
示す。ここで、優先権はループの処理が終了した時点で
ループ終了条件を検出した命令処理部が、それ以前の繰
り返しを実行している命令処理部の処理を追い越さない
ことを保証するために使用される。これを以下に説明す
る。
The state of execution at this time is shown in FIG. Since the dependent variable ptr is transferred through the queue to the instruction processing unit that executes the next iteration at an early stage of each iteration, the execution of the body portion of the loop can be performed in parallel. The instruction processing unit that detects the end condition of the loop and branches to the label Lexit executes the instruction 510 to interrupt the processing of the instruction stream being executed by another instruction processing unit, and the subsequent execution is performed again sequentially. To do. This state is shown in FIG. Here, the priority is used to guarantee that the instruction processing unit that detects the loop end condition at the time when the processing of the loop ends does not overtake the processing of the instruction processing unit executing the previous iteration. It This will be explained below.

【0034】今、命令処理部3がループの終了条件を検
出し、ラベルLexitに分岐したとする。命令処理部
3は命令510を実行して、他の命令処理部の実行を中
断させようとする。条件付き命令ストリーム中断機構5
3は、命令処理部3が優先権を持つまで待ち、優先権を
得てから、他の命令処理部の命令の処理を中断する。命
令処理部3が命令510を実行した時点で、命令処理部
2は命令処理部3が終了条件を検出した繰り返しの一つ
前の繰り返しを、まだ実行しているとしても、優先権は
若い繰り返しを実行している命令処理部が、その繰り返
しの実行を終了した時点で、次の繰り返しを実行する命
令処理部に渡されるので、命令処理部2の処理が終了す
るまでは、命令処理部3が優先権を持つことはない。し
たがって、命令処理部3が優先権を得た時点で、命令処
理部3で終了条件を検出した繰り返し以前の繰り返しの
実行は終了していることが保証される。優先権の移動自
体も条件付き優先権移動機構によって移動されるので、
ただ一つの優先権がループの各繰り返しの終了に応じて
順次命令処理部を移っていくことになる。
It is assumed that the instruction processing unit 3 now detects the loop end condition and branches to the label Lexit. The instruction processing unit 3 executes the instruction 510 and tries to interrupt the execution of the other instruction processing units. Conditional instruction stream interruption mechanism 5
3 waits until the instruction processing unit 3 has the priority right, and after obtaining the priority right, interrupts the processing of the instructions of the other instruction processing units. At the time when the instruction processing unit 3 executes the instruction 510, the instruction processing unit 2 has a younger priority even if it is still executing the previous iteration of the iteration in which the instruction processing unit 3 detected the end condition. The instruction processing unit that is executing the iteration is passed to the instruction processing unit that executes the next iteration when the execution of the iteration is completed. Therefore, the instruction processing unit 3 is executed until the processing of the instruction processing unit 2 is completed. Have no priority. Therefore, when the instruction processing unit 3 obtains the priority, it is guaranteed that the execution of the iteration before the iteration in which the termination condition is detected by the instruction processing unit 3 is finished. Since the transfer of priority itself is also moved by the conditional priority transfer mechanism,
Only one priority will move sequentially through the instruction processor as each iteration of the loop ends.

【0035】次に、条件付きデータ転送機構の働きにつ
いて説明する。図4に示したループで変数tmpの値を
ループ終了後に使用していたとすると、ループ終了後の
変数tmpの値はループの終了条件を満たした繰り返し
の直前の繰り返しで計算された変数tmpの値でなくて
はいけない。そこで、この変数tmpの値をメモリに書
き戻すところに条件付きデータ転送機構を用いる命令を
使用しておけば、優先権を持った命令処理部がメモリへ
のデータ転送を行うことになり、上記の中断処理の説明
と同様に、メモリに転送されているデータは実行された
最終の繰り返しの実行によるものとなる。
Next, the function of the conditional data transfer mechanism will be described. If the value of the variable tmp is used after the loop ends in the loop shown in FIG. 4, the value of the variable tmp after the end of the loop is the value of the variable tmp calculated in the iteration immediately before the iteration that satisfies the loop end condition. Must be. Therefore, if an instruction using a conditional data transfer mechanism is used to write the value of the variable tmp back to the memory, the instruction processing unit having priority will transfer the data to the memory. Similar to the description of the interruption processing of (1), the data transferred to the memory is due to the execution of the final iteration.

【0036】以上のように本実施例によれば、n番(1
≦n≦4、以下同じ)の命令ストリームの命令を処理す
る命令処理部から、n+1番(ただしn=Pのときは1
番、以下同じ)の命令ストリームの命令を処理する命令
処理部に対し、データを転送するためのキューと、n番
の命令ストリームの命令を処理する命令処理部から、そ
のn番の命令ストリームの処理を実行するのに必要なコ
ンテクストを、他の3個の命令処理部に対してコピーす
る、コンテクスト・コピー機構と、n番の命令ストリー
ムの命令を処理する命令処理部が、他の3個の命令処理
部に対して、優先権を持つことを示す優先権表示機構
と、前記優先権表示機構によって前記命令処理部が優先
権を持っていると示された場合に限って、その優先権を
n+1番の命令ストリームの命令を処理する命令処理部
に対応する優先権表示機構に移動し、優先権を持ってい
ない場合は、優先権が得られるまで上記命令処理部の処
理を停止させ、優先権が得られてからその優先権をn+
1番の命令ストリームの命令を処理する命令処理部に対
応する優先権表示機構に移動する、条件付き優先権移動
機構と、n番の命令ストリームの命令を処理する命令処
理部が、上記優先権表示機構によって優先権を持ってい
ると示された場合に限って、他の3個の命令処理部で実
行中の命令ストリームの処理を中断させ、優先権を持っ
ていない場合は、優先権が得られるまで上記命令処理部
の処理を停止させ、優先権が得られてから他の3個の命
令処理部で実行中の命令ストリームの処理を中断させ
る、条件付き命令ストリーム中断機構と、n番の命令ス
トリームの命令を処理する命令処理部が、上記優先権表
示機構によって優先権を持っていると示された場合に限
って、メモリへのデータ転送を実行し、優先権を持って
いない場合は、優先権が得られるまで上記命令処理部の
処理を停止させ、優先権が得られてからメモリへのデー
タ転送を実行する、条件付きデータ転送機構とを設ける
ことにより、ループを並列化して実行でき、実行速度を
向上させることができる。
As described above, according to this embodiment, the nth (1
From the instruction processing unit that processes the instruction of the instruction stream of ≦ n ≦ 4, the same applies hereinafter, n + 1 (1 when n = P)
No., the same shall apply hereinafter) to the instruction processing unit for processing the instructions of the instruction stream, and the queue for transferring the data and the instruction processing unit for processing the instructions of the nth instruction stream, The context copy mechanism that copies the context necessary for executing the processing to the other three instruction processing units and the instruction processing unit that processes the instruction of the nth instruction stream are the other three. To the instruction processing unit of FIG. 2 only if the priority display mechanism indicating that the instruction processing unit has priority and the instruction processing unit indicates that the instruction processing unit has priority. To the priority display mechanism corresponding to the instruction processing unit that processes the instruction of the n + 1th instruction stream, and if it does not have the priority, the processing of the instruction processing unit is stopped until the priority is obtained, priority n + its priority from been obtained
The conditional priority moving mechanism that moves to the priority display mechanism corresponding to the instruction processing unit that processes the instruction stream of the first instruction stream, and the instruction processing unit that processes the instruction of the nth instruction stream are Only when the display mechanism indicates that it has the priority, the processing of the instruction stream being executed by the other three instruction processing units is interrupted, and when the priority is not given, the priority is changed. A conditional instruction stream interruption mechanism for stopping the processing of the instruction processing unit until it is obtained, and interrupting the processing of the instruction stream being executed by the other three instruction processing units after the priority is obtained; When the instruction processing unit that processes the instruction stream of the instruction executes the data transfer to the memory and does not have the priority, only when the priority display mechanism indicates that the instruction processing unit has the priority. Is preferred By executing the conditional data transfer mechanism that suspends the processing of the instruction processing unit until the priority is obtained and executes the data transfer to the memory after the priority is obtained, the loop can be executed in parallel and executed. The speed can be improved.

【0037】なお、本実施例では各命令処理装置が物理
的に複数ある場合について述べたが、特開平3−134
882号公報に示されたような論理的な複数の命令処理
装置で複数の命令ストリームの命令を並列に処理する情
報処理装置で構成してもよい。 次に、本発明の第2の
実施例のコード生成装置について、図面を参照しながら
説明する。図6は本発明の第2の実施例におけるコンパ
イラのコード生成装置のブロック図で、このコード生成
装置は、スレッド生成部61と、依存検出部62と、依
存変数受理命令生成部63と、依存変数送出命令生成部
64と、優先権移動命令生成部65と、ストリーム中断
命令生成部66とにより構成されている。 スレッド生
成部61では、ループを検出し、そのループの各繰り返
しを別々のスレッドとして複数の命令処理部で並列に実
行される命令列として目的プログラムを生成する。依存
検出部62では、ループ中に前回の繰り返し実行中に設
定された変数の値を現在の繰り返し実行中に使用してい
ることを検出する。ループ中断検出部63では、繰り返
し実行中に設定された変数の値に応じてループからの飛
び出しを行う命令が存在することを検出する。依存変数
受理命令生成部63は、依存検出部62によって検出さ
れた依存のある変数を、第1の実施例に記載のキューを
通じて前の繰り返しを実行する命令処理部から受け取る
命令を生成する。依存変数送出命令生成部64は、依存
検出部62によって検出された依存のある変数を前記キ
ューを通じて次の繰り返しを実行する命令処理部に送出
する命令を生成する。
In this embodiment, the case where each instruction processing device is physically plural is described.
It may be configured by an information processing device that processes instructions of a plurality of instruction streams in parallel by a plurality of logical instruction processing devices as disclosed in Japanese Patent No. 882. Next, a code generation device according to a second embodiment of the present invention will be described with reference to the drawings. FIG. 6 is a block diagram of a code generation device of a compiler according to the second exemplary embodiment of the present invention. This code generation device includes a thread generation unit 61, a dependency detection unit 62, a dependent variable acceptance instruction generation unit 63, and a dependency The variable transmission command generation unit 64, the priority transfer command generation unit 65, and the stream interruption command generation unit 66 are configured. The thread generation unit 61 detects a loop, and generates each object program as an instruction string that is executed in parallel by a plurality of instruction processing units as a separate thread for each iteration of the loop. The dependency detection unit 62 detects that the value of the variable set during the previous repeated execution is being used during the loop during the current repeated execution. The loop break detection unit 63 detects that there is an instruction to jump out of the loop according to the value of the variable set during the repeated execution. The dependent variable acceptance instruction generator 63 generates an instruction to receive the dependent variable detected by the dependency detector 62 from the instruction processor that executes the previous iteration through the queue described in the first embodiment. The dependent variable sending command generating unit 64 generates a command for sending the dependent variable detected by the dependency detecting unit 62 to the command processing unit executing the next iteration through the queue.

【0038】優先権移動命令生成部65は、1回の繰り
返しが終了した時点で第1の実施例に記載の優先権移動
機構を用いて、次の繰り返しを実行する命令処理部に優
先権を移動する命令を生成する。ストリーム中断命令生
成部66は、ループ終了条件を満たし、ループの繰り返
しの実行を終了した場合に実行される命令として、第1
の実施例に示した命令ストリーム中断機構を用いて、ル
ープ終了条件を満たした命令ストリーム以外の命令スト
リームの実行を中断する命令を生成する。
The priority transfer instruction generation unit 65 uses the priority transfer mechanism described in the first embodiment at the end of one iteration to give priority to the instruction processing unit that executes the next iteration. Generate a move instruction. The stream interruption instruction generation unit 66 determines whether the first instruction is executed when the loop end condition is satisfied and the loop execution is ended.
Using the instruction stream interruption mechanism shown in the embodiment, an instruction for interrupting the execution of an instruction stream other than the instruction stream satisfying the loop end condition is generated.

【0039】図4は本実施例のコード生成装置で処理す
るループを高級言語で記述したものである。図5はこの
ループを本実施例のコード生成装置で生成したオブジェ
クトコードである。以下、このループをもとに、コード
生成装置の動作を説明する。スレッド生成部61はルー
プを検出すると、これを複数の命令処理部で並列に実行
するために、ループとキューの初期化を行い、他の命令
処理部で実行を開始するためのコンテクスト・コピーを
行う命令51、52を生成する。さらにループの繰り返
しの1回目だけに必要となる命令53を生成する。依存
変数受理命令生成部63は、依存変数検出部62で検出
された変数ptrをキューから取り出してレジスタに格
納する命令54を生成する。また、依存変数送出命令生
成部64は、上記変数ptrの新しい値をキューに書き
込む命令56を生成する。優先権移動命令生成部65は
ループのボディーの命令列57の後ろに優先権移動命令
58を生成する。また、ストリーム中断命令生成部66
は、ループ終了後に実行される命令の先頭にストリーム
中断命令510を生成する。
FIG. 4 describes a loop processed by the code generation device of this embodiment in a high-level language. FIG. 5 shows the object code generated by the code generation device of this embodiment for this loop. The operation of the code generator will be described below based on this loop. When the thread generation unit 61 detects a loop, the loop and the queue are initialized in order to execute the loops in parallel in the plurality of instruction processing units, and a context copy for starting the execution in another instruction processing unit is generated. Instructions 51 and 52 to be executed are generated. Further, the instruction 53 required only for the first iteration of the loop is generated. The dependent variable acceptance instruction generation unit 63 generates an instruction 54 for taking out the variable ptr detected by the dependent variable detection unit 62 from the queue and storing it in a register. In addition, the dependent variable transmission instruction generation unit 64 generates the instruction 56 for writing the new value of the variable ptr in the queue. The priority move instruction generation unit 65 generates a priority move instruction 58 after the instruction string 57 of the body of the loop. Also, the stream interruption instruction generation unit 66
Generates a stream interruption instruction 510 at the beginning of the instruction executed after the loop ends.

【0040】以上のように本実施例によれば、コード生
成装置にループを検出し、そのループの各繰り返しを別
々のスレッドとして複数の命令処理部で並列に実行され
る命令列として目的プログラムを生成するスレッド生成
部と、ループ中に前回の繰り返し実行中に設定された変
数の値を現在の繰り返し実行中に使用していることを検
出する依存検出部と、前記依存検出部によって検出され
た依存のある変数を第1の実施例に記載のキューを通じ
て、前の繰り返しを実行する命令処理部から受け取る命
令を生成する依存変数受理命令生成部と、前記依存検出
部によって検出された依存のある変数を前記キューを通
じて次の繰り返しを実行する命令処理部に送出する命令
を生成する依存変数送出命令生成部と、1回の繰り返し
が終了した時点で第1の実施例に記載の優先権移動機構
を用いて次の繰り返しを実行する命令処理部に優先権を
移動する命令を生成する優先権移動命令生成部と、ルー
プ終了条件を満たしループの繰り返しの実行を終了した
場合に実行される命令として第1の実施例に示した命令
ストリーム中断機構を用いて、ループ終了条件を満たし
た命令ストリーム以外の命令ストリームの実行を中断す
る命令を生成するストリーム中断命令生成部を設けるこ
とにより、第1の実施例に記載の情報処理装置で、並列
に実行可能なループのオブジェクトコードを生成するこ
とができる。
As described above, according to this embodiment, the code generation device detects a loop, and each iteration of the loop is treated as a separate thread and the target program is stored as an instruction string to be executed in parallel by a plurality of instruction processing units. A thread generation unit that generates a thread, a dependency detection unit that detects that the value of the variable set during the previous iteration of the loop is being used during the current iteration, and the dependency detection unit that detects the dependency Through the queue described in the first embodiment, the dependent variables are generated by the dependent variable acceptance instruction generation unit that generates an instruction to be received from the instruction processing unit that executes the previous iteration, and there is the dependency detected by the dependency detection unit. A dependent variable sending command generation unit that generates a command to send a variable to the command processing unit that executes the next iteration through the queue, and at the end of one iteration The priority transfer instruction generating unit that generates an instruction to transfer the priority to the instruction processing unit that executes the next iteration using the priority transfer mechanism described in the first embodiment; Using the instruction stream interruption mechanism shown in the first embodiment as an instruction to be executed when execution is terminated, a stream interruption for generating an instruction for interrupting execution of an instruction stream other than the instruction stream satisfying the loop end condition By providing the instruction generation unit, the information processing apparatus according to the first embodiment can generate the object code of the loop that can be executed in parallel.

【0041】以下、本発明の第3の実施例のコード生成
装置について、図面を参照しながら説明する。図7は本
発明の第3の実施例におけるコンパイラのコード生成装
置のブロック図で、このコード生成装置は、スレッド生
成部61と、依存検出部62と、ループ中断検出部63
と、依存変数受理命令生成部63と、依存変数送出命令
生成部64と、優先権移動命令生成部65と、ストリー
ム中断命令生成部66と、ループ外使用変数検出部71
と条件付きデータ転送命令生成部72とにより構成され
ている。ループ外使用変数検出部71では、ループの各
繰り返しの実行で計算される値で、最終の繰り返しの実
行で計算された値がループの終了後に使用されているこ
とを検出する。条件付きデータ転送命令生成部72は、
ループ外使用変数検出部71で検出された変数のメモリ
への転送に第1の実施例に記載の条件付きデータ転送機
構を用いる命令を生成する。
A code generator according to the third embodiment of the present invention will be described below with reference to the drawings. FIG. 7 is a block diagram of a code generation device of a compiler according to the third embodiment of the present invention. This code generation device includes a thread generation unit 61, a dependency detection unit 62, and a loop break detection unit 63.
, A dependent variable acceptance command generation unit 63, a dependent variable transmission command generation unit 64, a priority transfer command generation unit 65, a stream interruption command generation unit 66, and a variable used outside loop detection unit 71.
And a conditional data transfer instruction generator 72. The out-of-loop use variable detection unit 71 detects that the value calculated in the execution of each iteration of the loop is the value calculated in the execution of the final iteration that is used after the end of the loop. The conditional data transfer instruction generation unit 72
An instruction is generated that uses the conditional data transfer mechanism described in the first embodiment to transfer the variable detected by the out-of-loop use variable detection unit 71 to the memory.

【0042】図4を用いて本実施例の動作の説明を行
う。図4における変数tmpがループ終了後に使用され
ていることをループ外使用変数検出部71で検出し、検
出された変数tmpをメモリに格納する命令として条件
付きデータ転送機構を用いる命令を条件付きデータ転送
命令生成部72が生成する。以上のように本実施例によ
れば、コード生成装置にループを検出し、そのループの
各繰り返しを別々のスレッドとして複数の命令処理部で
並列に実行される命令列として目的プログラムを生成す
るスレッド生成部と、ループ中に前回の繰り返し実行中
に設定された変数の値を現在の繰り返し実行中に使用し
ていることを検出する依存検出部と、前記依存検出部に
よって検出された依存のある変数を第1の実施例に記載
のキューを通じて前の繰り返しを実行する命令処理部か
ら受け取る命令を生成する依存変数受理命令生成部と、
前記依存検出部によって検出された依存のある変数を前
記キューを通じて次の繰り返しを実行する命令処理部に
送出する命令を生成する依存変数送出命令生成部と、1
回の繰り返しが終了した時点で第1の実施例に記載の優
先権移動機構を用いて次の繰り返しを実行する命令処理
部に優先権を移動する命令を生成する優先権移動命令生
成部と、ループ終了条件を満たしループの繰り返しの実
行を終了した場合に実行される命令として第1の実施例
に示した命令ストリーム中断機構を用いて、ループ終了
条件を満たした命令ストリーム以外の命令ストリームの
実行を中断する命令を生成するストリーム中断命令生成
部と、ループの各繰り返しの実行で計算される値で、最
終の繰り返しの実行で計算された値がループの終了後に
使用されていることを検出するループ外使用変数検出部
と、上記ループ外使用変数検出部で検出された変数のメ
モリへの転送に第1の実施例に記載の条件付きデータ転
送機構を用いる命令を生成する条件付きデータ転送命令
生成部を設けることにより、第1の実施例に記載の情報
処理装置で、並列に実行可能なループのオブジェクトコ
ードを生成することができる。
The operation of this embodiment will be described with reference to FIG. The outside-loop use variable detection unit 71 detects that the variable tmp in FIG. 4 is used after the end of the loop, and stores the detected variable tmp in the memory as an instruction using the conditional data transfer mechanism. The transfer command generation unit 72 generates the transfer command. As described above, according to the present embodiment, a thread that detects a loop in the code generation device and generates the target program as an instruction sequence that is executed in parallel by a plurality of instruction processing units as each thread of each iteration of the loop. There is a generation unit, a dependency detection unit that detects that the value of the variable set during the previous iteration is being used during the current iteration, and a dependency detected by the dependency detection unit. A dependent variable acceptance instruction generator that generates an instruction to receive a variable from an instruction processor that executes the previous iteration through the queue described in the first embodiment;
A dependent variable sending command generation unit for generating a command for sending the dependent variable detected by the dependence detection unit to the command processing unit executing the next iteration through the queue;
A priority move instruction generation unit that generates an instruction to move the priority to an instruction processing unit that executes the next iteration by using the priority movement mechanism described in the first embodiment at the end of the repetition of the number of times; Execution of an instruction stream other than the instruction stream satisfying the loop end condition by using the instruction stream interruption mechanism shown in the first embodiment as the instruction executed when the loop end condition is satisfied and the execution of the loop iteration is ended. Detects that the value calculated in the execution of each iteration of the loop is used after the end of the loop, with the stream interruption instruction generator that generates the instruction to interrupt An instruction to use the variable outside the loop detection unit and the conditional data transfer mechanism described in the first embodiment for transferring the variable detected by the variable outside the loop detection unit to the memory. By providing a conditional data transfer instruction generator that generates, in the information processing apparatus according to the first embodiment, it is possible to generate an object code executable loop in parallel.

【0043】[0043]

【発明の効果】以上のように本発明は、ループの終了条
件がデータに依存していて従来の並列情報処理装置では
並列実行できないループに対して、依存のある変数を各
繰り返しを処理する命令処理部の間に設けたキューを用
いることで転送し、また、優先権を用いて終了条件を満
たした繰り返しを実行した命令処理部の実行が、他のま
だ繰り返しの実行を行っている命令処理部の処理を追い
越さないことを保証することによって、生成されたオブ
ジェクトコードの並列実行を可能とする情報処理装置
と、並列実行可能なオブジェクトコードを生成するコー
ド生成装置とを提供するもので、並列実行可能なループ
の種類の範囲を拡大し、プログラムの実行効率の向上に
大きく寄与することができる。
As described above, according to the present invention, an instruction for processing each iteration of a dependent variable for a loop that cannot be executed in parallel by a conventional parallel information processing apparatus because the loop end condition depends on data. Execution of the instruction processing unit that transfers using the queue provided between the processing units and that executes the iteration that satisfies the end condition using the priority is executed by another instruction processing that is still executing the iteration. By providing an information processing apparatus that enables parallel execution of generated object code by guaranteeing that it does not overtake the processing of a unit, and a code generation apparatus that generates parallel executable object code, The range of types of loops that can be executed can be expanded, and this can greatly contribute to the improvement of program execution efficiency.

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

【図1】本発明の第1の実施例における情報処理装置の
ブロック図
FIG. 1 is a block diagram of an information processing apparatus according to a first embodiment of the present invention.

【図2】ループを実行中の模式図[Fig. 2] Schematic diagram of executing a loop

【図3】ループ終了時の模式図[Fig. 3] Schematic diagram at the end of the loop

【図4】ループを高級言語で記述したプログラムを示す
FIG. 4 is a diagram showing a program in which a loop is written in a high level language.

【図5】図4のループを本発明の第2の実施例で示した
コード生成装置で処理したオブジェクトコードを示す図
FIG. 5 is a diagram showing an object code obtained by processing the loop of FIG. 4 by the code generation device shown in the second embodiment of the present invention.

【図6】本発明の第2の実施例におけるコード生成装置
のブロック図
FIG. 6 is a block diagram of a code generation device according to a second exemplary embodiment of the present invention.

【図7】本発明の第3の実施例におけるコード生成装置
のブロック図
FIG. 7 is a block diagram of a code generation device according to a third embodiment of the present invention.

【図8】高級プログラミング言語で記述したループの一
例を示す図
FIG. 8 is a diagram showing an example of a loop written in a high-level programming language.

【図9】複数の命令処理部を持つ情報処理装置の一例を
示すブロック図
FIG. 9 is a block diagram showing an example of an information processing apparatus having a plurality of instruction processing units.

【図10】図8のループを図9の情報処理装置で実行す
る場合の命令ストリームを示す図
10 is a diagram showing an instruction stream when the loop of FIG. 8 is executed by the information processing apparatus of FIG.

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

1〜4 命令処理部 5〜8 キュー 9 コンテクスト・コピー機構 10〜13 idレジスタ 14〜17 優先権表示機構 18〜21 条件付き優先権移動機構 22〜25 条件付き命令ストリーム中断機構 26〜29 条件付きデータ転送機構 51 初期化命令 52 複数スレッド化命令群 53 コピー元判定命令群 54 キューからデータを取り出す命令 55 終了条件判定命令群 56 キューへデータを書き出す命令 57 ループのボディ 58 優先権移動命令 59 ジャンプ命令 510 中断命令 61 スレッド生成部 62 依存検出部 63 依存変数受理命令生成部 64 依存変数送出命令生成部 65 優先権移動命令生成部 66 ストリーム中断命令生成部 71 ループ外使用変数検出部 72 条件付きデータ転送命令生成部 81 ループの終了条件 82 ループのボディ 91〜94 命令処理部 101 命令処理部91で処理される命令ストリーム 102 命令処理部92で処理される命令ストリーム 103 命令処理部93で処理される命令ストリーム 104 命令処理部94で処理される命令ストリーム 1 to 4 instruction processing unit 5 to 8 queue 9 context copy mechanism 10 to 13 id register 14 to 17 priority display mechanism 18 to 21 conditional priority moving mechanism 22 to 25 conditional instruction stream interruption mechanism 26 to 29 conditional Data transfer mechanism 51 Initialization instruction 52 Multi-threaded instruction group 53 Copy source determination instruction group 54 Instruction for fetching data from queue 55 End condition determination instruction group 56 Instruction for writing data to queue 57 Loop body 58 Priority move instruction 59 Jump Instruction 510 Interruption instruction 61 Thread generation unit 62 Dependence detection unit 63 Dependent variable acceptance instruction generation unit 64 Dependent variable transmission instruction generation unit 65 Priority transfer instruction generation unit 66 Stream interruption instruction generation unit 71 Loop outside used variable detection unit 72 Conditional data Transfer command generation part 81 Termination of loop 82 loop body 91-94 instruction processing unit 101 instruction stream processed by instruction processing unit 91 instruction stream processed by instruction processing unit 92 103 instruction stream processed by instruction processing unit 93 104 processed by instruction processing unit 94 Instruction stream

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 P個(Pは2以上)の命令ストリームか
らの命令を同時に処理する並列情報処理装置であって、
n番(1≦n≦P)の命令ストリームの命令を処理する
命令処理部から、n+1番(ただしn=Pのときは1
番)の命令ストリームの命令を処理する命令処理部に対
し、データを転送するためのキューを持つことを特徴と
する情報処理装置。
1. A parallel information processing apparatus for simultaneously processing instructions from P (where P is 2 or more) instruction streams,
From the instruction processing unit that processes the instruction of the nth (1 ≦ n ≦ P) instruction stream, the n + 1th instruction (1 when n = P
An information processing device having a queue for transferring data to an instruction processing unit for processing an instruction of the instruction stream No.).
【請求項2】 P個(Pは2以上)の命令ストリームか
らの命令を同時に処理する並列情報処理装置であって、
n番(1≦n≦P)の命令ストリームの命令を処理する
命令処理部から、そのn番の命令ストリームの処理を実
行するのに必要なコンテクストを、他のP−1個の命令
処理部に対してコピーする、コンテクスト・コピー機構
を持つことを特徴とする情報処理装置。
2. A parallel information processing apparatus for simultaneously processing instructions from P (where P is 2 or more) instruction streams,
From the instruction processing unit that processes the instruction of the n-th (1 ≦ n ≦ P) instruction stream, the context necessary to execute the processing of the n-th instruction stream is set to the other P−1 instruction processing units. An information processing device having a context copy mechanism for copying to and from.
【請求項3】 P個(Pは2以上)の命令ストリームか
らの命令を同時に処理する並列情報処理装置であって、
n番(1≦n≦P)の命令ストリームの命令を処理する
命令処理部が、他のP−1個の命令処理部に対して、優
先権を持つことを示す優先権表示機構と、前記優先権表
示機構によって前記命令処理部が優先権を持っていると
示された場合に限って、その優先権をn+1番(ただし
n=Pのときは1番)の命令ストリームの命令を処理す
る命令処理部に対応する優先権表示機構に移動し、優先
権を持っていない場合は、優先権が得られるまで上記命
令処理部の処理を停止させ、優先権が得られてからその
優先権をn+1番(ただしn=Pのときは1番)の命令
ストリームの命令を処理する命令処理部に対応する優先
権表示機構に移動する、条件付き優先権移動機構を持つ
ことを特徴とする情報処理装置。
3. A parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams,
an instruction processing unit that processes an instruction of an n-th (1 ≦ n ≦ P) instruction stream has a priority display mechanism that indicates that it has priority over the other P−1 instruction processing units; Only when the instruction display unit indicates that the instruction processing unit has the priority right, the instruction is processed in the instruction stream of the n + 1th instruction stream (however, when n = P, the first instruction stream). Move to the priority display mechanism corresponding to the instruction processing unit, if you do not have the priority right, stop the processing of the above instruction processing unit until the priority right is obtained, and after the priority right is obtained, change the priority right. Information processing characterized by having a conditional priority transfer mechanism that moves to a priority display mechanism corresponding to an instruction processing unit that processes an instruction of an n + 1th instruction stream (however, 1 when n = P) apparatus.
【請求項4】 P個(Pは2以上)の命令ストリームか
らの命令を同時に処理する並列情報処理装置であって、
n番(1≦n≦P)の命令ストリームの命令を処理する
命令処理部が、請求項3記載の優先権表示機構によって
優先権を持っていると示された場合に限って、他のP−
1個の命令処理部で実行中の命令ストリームの処理を中
断させ、優先権を持っていない場合は、優先権が得られ
るまで上記命令処理部の処理を停止させ、優先権が得ら
れてから他のP−1個の命令処理部で実行中の命令スト
リームの処理を中断させる、条件付き命令ストリーム中
断機構を持つことを特徴とする情報処理装置。
4. A parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams,
Only when the instruction processing unit that processes the instruction of the n-th (1 ≦ n ≦ P) instruction stream is indicated as having the priority by the priority display mechanism according to claim 3, another P −
When the processing of the instruction stream being executed by one instruction processing unit is interrupted and the priority is not granted, the processing of the instruction processing unit is stopped until the priority is obtained, and then the priority is obtained. An information processing apparatus having a conditional instruction stream interruption mechanism for interrupting the processing of an instruction stream being executed by other P-1 instruction processing units.
【請求項5】 P個(Pは2以上)の命令ストリームか
らの命令を同時に処理する並列情報処理装置であって、
n番(1≦n≦P)の命令ストリームの命令を処理する
命令処理部が、請求項3記載の優先権表示機構によって
優先権を持っていると示された場合に限って、メモリへ
のデータ転送を実行し、優先権を持っていない場合は、
優先権が得られるまで上記命令処理部の処理を停止さ
せ、優先権が得られてからメモリへのデータ転送を実行
する、条件付きデータ転送機構を持つことを特徴とする
情報処理装置。
5. A parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams,
Only when the instruction processing unit for processing the instruction of the n-th (1 ≦ n ≦ P) instruction stream is shown to have the priority by the priority display mechanism according to claim 3, If you perform a data transfer and do not have priority,
An information processing apparatus having a conditional data transfer mechanism that suspends the processing of the instruction processing unit until the priority is obtained and executes the data transfer to the memory after the priority is obtained.
【請求項6】 P個(Pは2以上)の命令ストリームか
らの命令を同時に処理する並列情報処理装置であって、
上記請求項1に記載したキュー、請求項2に記載したコ
ンテクスト・コピー機構、請求項3に記載した優先権表
示機構と条件付き優先権移動機構、請求項4に記載した
条件付き命令ストリーム中断機構、請求項5に記載した
条件付きデータ転送機構を持つことを特徴とする情報処
理装置。
6. A parallel information processing apparatus for simultaneously processing instructions from P (P is 2 or more) instruction streams,
The queue described in claim 1, the context copy mechanism described in claim 2, the priority display mechanism and the conditional priority transfer mechanism described in claim 3, and the conditional instruction stream interruption mechanism described in claim 4. An information processing apparatus having the conditional data transfer mechanism according to claim 5.
【請求項7】 高級プログラミング言語で記述された原
始プログラムを入力として目的プログラムを生成するコ
ンパイラに採用されるコード生成装置であって、ループ
を検出し、そのループの各繰り返しを別々のスレッドと
して複数の命令処理部で並列に実行される命令列として
目的プログラムを生成するスレッド生成部と、ループ中
に前回の繰り返し実行中に設定された変数の値を現在の
繰り返し実行中に使用していることを検出する依存検出
部と、前記依存検出部によって検出された依存のある変
数を請求項1記載のキューを通じて前の繰り返しを実行
する命令処理部から受け取る命令を生成する依存変数受
理命令生成部と、前記依存検出部によって検出された依
存のある変数を請求項1記載のキューを通じて次の繰り
返しを実行する命令処理部に送出する命令を生成する依
存変数送出命令生成部と、1回の繰り返しが終了した時
点で請求項3記載の優先権移動機構を用いて次の繰り返
しを実行する命令処理部に優先権を移動する命令を生成
する優先権移動命令生成部と、ループ終了条件を満たし
ループの繰り返しの実行を終了した場合に実行される命
令として請求項4に示した命令ストリーム中断機構を用
いて、ループ終了条件を満たした命令ストリーム以外の
命令ストリームの実行を中断する命令を生成するストリ
ーム中断命令生成部からなるコード生成装置。
7. A code generator used in a compiler that generates a target program using a source program written in a high-level programming language as an input, wherein a loop is detected and each iteration of the loop is divided into a plurality of separate threads. The thread generation unit that generates the target program as an instruction string that is executed in parallel in the instruction processing unit and the value of the variable that was set during the previous iteration during the loop are used during the current iteration. And a dependency variable acceptance instruction generator that generates an instruction to receive a variable having a dependency detected by the dependency detector from the instruction processor that executes the previous iteration through the queue according to claim 1. An instruction for executing the next iteration through the queue according to claim 1 for a variable having a dependency detected by the dependency detector. A priority variable is given to a dependent variable transmission command generation unit that generates a command to be transmitted to the processing unit, and an instruction processing unit that executes the next iteration by using the priority moving mechanism according to claim 3 when one iteration is completed. A priority movement instruction generation unit for generating an instruction for moving a loop, and an instruction stream interruption mechanism according to claim 4 as an instruction to be executed when a loop end condition is satisfied and execution of loop iteration is completed, A code generation device including a stream interruption instruction generation unit that generates an instruction for interrupting execution of an instruction stream other than an instruction stream that satisfies an end condition.
【請求項8】 高級プログラミング言語で記述された原
始プログラムを入力として目的プログラムを生成するコ
ンパイラに採用されるコード生成装置であって、ループ
の各繰り返しの実行で計算される値で、最終の繰り返し
の実行で計算された値がループの終了後に使用されてい
ることを検出するループ外使用変数検出部と、上記ルー
プ外使用変数検出部で検出された変数のメモリへの転送
に請求項5記載の条件付きデータ転送機構を用いる命令
を生成する条件付きデータ転送命令生成部を有する請求
項7記載のコード生成装置。
8. A code generator used in a compiler that generates a target program using a source program written in a high-level programming language as an input, the value being calculated in each iteration of a loop, and the final iteration. 6. An out-of-loop use variable detection unit that detects that the value calculated by the execution of [1] is used after the end of the loop, and a variable detected by the outside-loop use variable detection unit is transferred to a memory. 8. The code generation device according to claim 7, further comprising a conditional data transfer instruction generation unit that generates an instruction using the conditional data transfer mechanism of.
JP3288790A 1991-11-05 1991-11-05 Information processing device and code generation device Pending JPH05127904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3288790A JPH05127904A (en) 1991-11-05 1991-11-05 Information processing device and code generation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3288790A JPH05127904A (en) 1991-11-05 1991-11-05 Information processing device and code generation device

Publications (1)

Publication Number Publication Date
JPH05127904A true JPH05127904A (en) 1993-05-25

Family

ID=17734759

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3288790A Pending JPH05127904A (en) 1991-11-05 1991-11-05 Information processing device and code generation device

Country Status (1)

Country Link
JP (1) JPH05127904A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012093488A1 (en) 2011-01-07 2012-07-12 富士通株式会社 Scheduling method, and multi-core processor system
JP2014146355A (en) * 2007-06-04 2014-08-14 Microsoft Corp Parallelization of sequential framework using transaction
EP3792762A1 (en) 2019-09-05 2021-03-17 Fujitsu Limited Approximate computing parallelization circuit, approximate computing parallelization method, and parallel information processing device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014146355A (en) * 2007-06-04 2014-08-14 Microsoft Corp Parallelization of sequential framework using transaction
WO2012093488A1 (en) 2011-01-07 2012-07-12 富士通株式会社 Scheduling method, and multi-core processor system
US9367459B2 (en) 2011-01-07 2016-06-14 Fujitsu Limited Scheduling method and multi-core processor system
EP3792762A1 (en) 2019-09-05 2021-03-17 Fujitsu Limited Approximate computing parallelization circuit, approximate computing parallelization method, and parallel information processing device
US11144317B2 (en) 2019-09-05 2021-10-12 Fujitsu Limited AC parallelization circuit, AC parallelization method, and parallel information processing device

Similar Documents

Publication Publication Date Title
US5854934A (en) Optimizing compiler having data cache prefetch spreading
JP3575617B2 (en) Computer system
JP2928695B2 (en) Multi-thread microprocessor using static interleave and instruction thread execution method in system including the same
US5710902A (en) Instruction dependency chain indentifier
EP2680132B1 (en) Staged loop instructions
US7366874B2 (en) Apparatus and method for dispatching very long instruction word having variable length
US5519864A (en) Method and apparatus for scheduling the dispatch of instructions from a reservation station
JP3093639B2 (en) Method and system for tracking resource allocation in a processor
US5421020A (en) Counter register implementation for speculative execution of branch on count instructions
EP0813145B1 (en) Pipelined instruction dispatch unit in a superscalar processor
JPH0766329B2 (en) Information processing equipment
JP2000020326A (en) Device for inheriting registered contents is processor
US11416261B2 (en) Group load register of a graph streaming processor
KR100316710B1 (en) Method and Apparatus for Instruction issuing in Out-of-Order for Parallel Processor
EP0482200B1 (en) Interrupt processing system
EP1444571B1 (en) Hidden job start preparation in an instruction-parallel processor system
JP2006313422A (en) Calculation processing device and method for executing data transfer processing
JPH07104784B2 (en) Digital data processor
US8447961B2 (en) Mechanism for efficient implementation of software pipelined loops in VLIW processors
US11481223B2 (en) Reducing operations of sum-of-multiply-accumulate (SOMAC) instructions
US6115807A (en) Static instruction decoder utilizing a circular queue to decode instructions and select instructions to be issued
JPH05127904A (en) Information processing device and code generation device
US5623685A (en) Vector register validity indication to handle out-of-order element arrival for a vector computer with variable memory latency
JP2928684B2 (en) VLIW type arithmetic processing unit
JP5104862B2 (en) Instruction execution control device and instruction execution control method