JPH0235349B2 - RUUPUNAIHAIRETSUSHORIBEKUTORUKASHORIHOSHIKI - Google Patents

RUUPUNAIHAIRETSUSHORIBEKUTORUKASHORIHOSHIKI

Info

Publication number
JPH0235349B2
JPH0235349B2 JP12417583A JP12417583A JPH0235349B2 JP H0235349 B2 JPH0235349 B2 JP H0235349B2 JP 12417583 A JP12417583 A JP 12417583A JP 12417583 A JP12417583 A JP 12417583A JP H0235349 B2 JPH0235349 B2 JP H0235349B2
Authority
JP
Japan
Prior art keywords
subscript
vector
expression
instructions
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP12417583A
Other languages
Japanese (ja)
Other versions
JPS6015772A (en
Inventor
Hirobumi Yamada
Fumio Isobe
Hiroshi Nakada
Shinya Miura
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP12417583A priority Critical patent/JPH0235349B2/en
Publication of JPS6015772A publication Critical patent/JPS6015772A/en
Publication of JPH0235349B2 publication Critical patent/JPH0235349B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/80Architectures of general purpose stored program computers comprising an array of processing units with common control, e.g. single instruction multiple data processors
    • G06F15/8053Vector processors

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Complex Calculations (AREA)

Description

【発明の詳細な説明】 (A) 発明の技術分野 本発明はループ内配列処理ベクトル化処理方
式、特に配列を用いている高級言語を、ベクトル
処理装置で実行される機械語に変換するにあたつ
て、変換結果の実行を高速化するベクトライズを
促進させたループ内配列処理ベクトル化処理方式
に関するものである。
[Detailed Description of the Invention] (A) Technical Field of the Invention The present invention relates to an in-loop array processing vectorization processing method, particularly for converting a high-level language using arrays into machine language executed on a vector processing device. The present invention relates to an in-loop array processing vectorization processing method that promotes vectorization that speeds up the execution of conversion results.

(B) 技術の背景と問題点 複数個のデータに共通の処理手続が施される場
合に、それらを並列に実行処理するいわゆるベク
トル処理装置が用いられている。例えば、
FORTRAN等の高級言語でプログラムを作成す
る場合には、プログラム作成者は、ベクトル処理
装置によつて、そのプログラムが実行されること
を何んら意識する必要はなく、その高級言語を機
械語に変換するときに、いわゆるコンパイラが、
可能なものについてベクトル命令を生成する。ベ
クトル命令に変換できるものが多ければ多いほ
ど、並列処理により、実行が高速化されることに
なる。
(B) Technical Background and Problems When common processing procedures are applied to multiple pieces of data, so-called vector processing devices are used that execute the procedures in parallel. for example,
When creating a program in a high-level language such as FORTRAN, the program creator does not need to be aware that the program will be executed by a vector processing device; the program creator converts the high-level language into machine language. When converting, the so-called compiler,
Generate vector instructions for what is possible. The more things that can be converted into vector instructions, the faster the execution will be due to parallel processing.

第1図は一般的なベクトル命令生成についての
説明図、第2図は従来技術の問題点説明図を示
す。
FIG. 1 is an explanatory diagram of general vector instruction generation, and FIG. 2 is an explanatory diagram of problems in the prior art.

例えばカード・リード1から入力された被翻訳
命令群4において、高級言語の文は、制御変数
iを1から10まで変化させつつ、文までの命令
文を10回繰り返すことを指示するものである。文
は、配列Bのデータを配列Cのデータとの和
を、配列Aに格納すべきことを示す。制御変数i
が、配列A,B,Cの添字として用いられてい
る、翻訳処理装置2は、被翻訳命令群4を機械語
に展開するにあたつて、図示の如き中間表現5を
考慮したうえで、機械語命令群6に示されるよう
な機械語命令を生成する。命令は、配列Bのデ
ータを第0ベクトル・レジスタにロードするベク
トル命令である。命令は、配列Cのデータを第
1ベクトル・レジスタにロードする命令である。
命令は、第0ベクトル・レジスタと第1ベクト
ル・レジスタの和を、第2ベクトル・レジスタに
格納する命令である。命令は第2ベクトル・レ
ジスタの内容を配列Aにストアする命令である。
これらの命令は、実際には、2進のコードで与え
られる。翻訳処理装置2は、機械語命令群6を生
成して、例えば磁気デイスク装置3に格納する。
このようにベクトル命令に展開することにより、
通常であれば10回処理を繰り返すべきところを、
1回の並列処理で実行できるようになる。
For example, in the translated command group 4 input from the card reader 1, the high-level language sentence instructs to repeat the command sentences up to the sentence 10 times while changing the control variable i from 1 to 10. . The statement indicates that the sum of the data in array B and the data in array C should be stored in array A. control variable i
are used as subscripts of arrays A, B, and C. When expanding the translated instruction group 4 into machine language, the translation processing device 2 considers the intermediate representation 5 as shown in the figure, and Machine language instructions as shown in machine language instruction group 6 are generated. The instruction is a vector instruction that loads the data of array B into the 0th vector register. The instruction is an instruction that loads the data of array C into the first vector register.
The instruction is an instruction to store the sum of the 0th vector register and the first vector register in the second vector register. The instruction is an instruction to store the contents of the second vector register into array A.
These instructions are actually given in binary code. The translation processing device 2 generates a machine language instruction group 6 and stores it in the magnetic disk device 3, for example.
By expanding into vector instructions like this,
Normally, the process should be repeated 10 times, but
It can be executed in one parallel process.

第1図に示したベクトル化処理は、常に可能で
あるわけではない。例えば、第2図イ図示の如
き、被翻訳命令群4の場合、配列データ7―1に
対して、該命令群を逐次処理により、正しく実行
したとすると、結果は、配列データ7―2の如く
になる。しかし、ベクトル化して処理してしまう
と、結果は配列データ7―3の如くになるので、
誤つたデータとなる。すなわち、このような場
合、ベクトライズはできないこととなる。これ
は、配列の代入文において、右辺および左辺の添
字によつて示されるデータ群に重なり関係が生じ
ることに起因する。このことから、従来、例えば
第2図ロ図示の被翻訳命令群4の場合、代入文
において、右辺の配列に添字として用いられてい
る変数Lが、左辺の添字として用いられている制
御変数iに対して、どのような関係にあるが不明
であり、配列の重複関係を認知できないため、ベ
クトル化することができなかつた。
The vectorization process shown in FIG. 1 is not always possible. For example, in the case of the translated instruction group 4 as shown in FIG. It becomes like this. However, if you convert it into a vector and process it, the result will be like array data 7-3, so
This will result in incorrect data. That is, in such a case, vectorization cannot be performed. This is because, in an array assignment statement, there is an overlapping relationship between the data groups indicated by the subscripts on the right and left sides. From this, conventionally, for example, in the case of the translated instruction group 4 shown in FIG. However, it is unclear what kind of relationship there is, and the overlapping relationship of the arrays cannot be recognized, so it was not possible to vectorize them.

(C) 発明の目的と構成 本発明は上記問題点の解決を図り、ループ中の
配列の添字式中の変数を、ループの制御変数また
は定数を含むような変数の定義式で置き換えるこ
とにより、配列間の関係を明確にし、ベクトライ
ズを促進させて、高速で実速されるオブジエクト
を生成することを目的としている。そのため、本
発明のループ内配列処理ベクトル化処理方式は、
複数個のデータを並列処理するベクトル命令を実
行するベクトル・ユニツトと、スカラ・データを
処理するスカラ命令を実行するスカラ・ユニツト
とをそなえたベクトル処理装置における機械語命
令への翻訳処理装置において、繰り返し実行され
る形で表わされた被翻訳命令群に現われる配列の
添字であつて、動作不明な変数を含む添字を捜し
出す添字走査手段と、上記動作不明な変数を定義
する式を捜し出す定義式走査手段と、該定義式走
査手段によつて捜し出された式の定義内容を、上
記添字における動作不明な変数を置き換える形
で、該添字情報中に組込む添字式組込み手段と、
該添字式組込み手段によつて生成された新たな添
字情報にもとづいて、その動作範囲を調ることに
より、ベクトル化の可否を判定する判定手段と、
該判定手段の判定結果に従つて上記ベクトル命令
を生成するベクトル命令生成処理部とをそなえた
ことを特徴としている。以下図面を参照しつつ説
明する。
(C) Object and structure of the invention The present invention aims to solve the above-mentioned problems, and by replacing variables in the subscript expression of the array in the loop with the definition expression of the variable that includes the control variable or constant of the loop, The purpose is to clarify the relationship between arrays, promote vectorization, and generate objects that can be executed at high speed. Therefore, the in-loop array processing vectorization processing method of the present invention is
In a translation processing device into machine language instructions in a vector processing device equipped with a vector unit that executes a vector instruction that processes multiple pieces of data in parallel, and a scalar unit that executes a scalar instruction that processes scalar data, A subscript scanning means that searches for a subscript of an array that appears in a group of translated instructions expressed in a form that is repeatedly executed and that includes a variable whose behavior is unknown, and a definition expression that searches for an expression that defines the variable whose behavior is unknown. a scanning means, and a subscript expression incorporating means for incorporating the definition content of the expression found by the definition expression scanning means into the subscript information in a form that replaces a variable whose operation is unknown in the subscript;
determining means for determining whether vectorization is possible by examining the operating range based on the new subscript information generated by the subscript expression incorporating means;
The present invention is characterized by comprising a vector instruction generation processing section that generates the vector instruction according to the determination result of the determination means. This will be explained below with reference to the drawings.

(D) 発明の実施例 第3図は本発明の一実施例構成、第4図は本発
明の一実施例処理説明図、第5図は本発明の具体
的な一実施例処理態様の説明図を示す。
(D) Embodiments of the Invention Fig. 3 shows the configuration of an embodiment of the invention, Fig. 4 is an explanatory diagram of processing of an embodiment of the invention, and Fig. 5 shows an explanation of a specific processing mode of an embodiment of the invention. Show the diagram.

第3図において、符号2および3は第1図に対
応し、10はベクトル処理装置、11はベクト
ル・ユニツト、12はスカラ・ユニツト、22は
主記憶装置、23はチヤネル装置、24はオブジ
エクト・モジユール、25はソース・モジユー
ル、30は構文解析部、31は添字走査部、32
は定義式走査部、33は添字式組込み部、34は
ベクトル化可否判定部、35はベクトル命令生成
部、36はスカラ命令生成部を表わす。
In FIG. 3, numerals 2 and 3 correspond to those in FIG. 1, 10 is a vector processing device, 11 is a vector unit, 12 is a scalar unit, 22 is a main storage device, 23 is a channel device, and 24 is an object processor. module, 25 is a source module, 30 is a parsing unit, 31 is a subscript scanning unit, 32
33 is a definition formula scanning unit, 33 is a subscript formula embedding unit, 34 is a vectorization possibility determining unit, 35 is a vector instruction generation unit, and 36 is a scalar instruction generation unit.

翻訳処理装置2は、逐次命令をフエツチして実
行する装置であつて、例えばFORTRAN等の高
級言語で記述された被翻訳命令群からなるソー
ス・モジユール25を入力し、2進の機械語命令
に変換して、オブジエクト・モジユール24を例
えば磁気デイスク装置3に出力する装置である。
翻訳処理装置2は、ベクトル処理装置10と同じ
装置であつてもよく、また他の処理装置であつて
もよい。
The translation processing device 2 is a device that fetches and executes sequential instructions, and inputs a source module 25 consisting of a group of instructions to be translated written in a high-level language such as FORTRAN, and converts it into binary machine language instructions. This is a device that converts the object module 24 and outputs it to, for example, the magnetic disk device 3.
The translation processing device 2 may be the same device as the vector processing device 10, or may be another processing device.

ベクトル処理装置10は、通常のスカラ命令と
複数個のデータを並列に同時に処理するベクトル
命令とを処理する装置であり、ベクトル・ユニツ
ト11とスカラ・ユニツト12とからなる。スカ
ラ・ユニツト12は、バツフア・ストレージ19
と汎用レジスタおよび浮動小数点レジスタ20と
スカラ演算器21とからなり、主記憶装置22上
のデータをレジスタ20にロードし、スカラ演算
器21により、スカラ命令を逐次処理する。ベク
トル・ユニツト11は、主記憶装置22からフエ
ツチした命令がベクトル命令であるときに起動さ
れる。複数本のロード/ストアのパイプライン1
3,13′を有し、例えば32語×1ビツトからな
る256個のマスク・レジスタ14と32語×64ビツ
トからなる256個のベクトル・レジスタ14′とを
有している。マスク回路15は、例えば
FORTRANプログラムにおけるIF文を含んだ手
続きなどもベクトル化対象とするために、その条
件の真となるデータを指示するものである。加
算/論理演算器16、乗算器17および除算器1
8は、それぞれ、ベクトル命令によつて、ベクト
ル・レジスタ14′のデータ群を並列処理する。
一度に大量のデータを同時に処理するので、高速
なデータ処理が可能である。主記憶装置22に
は、予めチヤネル装置23を経由して、ベクトル
命令を含むオブジエクト・モジユール24もしく
はそれを編集したロード・モジユールが、ロード
されるようになつている。
The vector processing device 10 is a device that processes normal scalar instructions and vector instructions that process multiple pieces of data simultaneously in parallel, and is composed of a vector unit 11 and a scalar unit 12. Scalar unit 12 is buffer storage 19
, a general-purpose register, a floating point register 20, and a scalar arithmetic unit 21. Data on a main memory 22 is loaded into the register 20, and the scalar arithmetic unit 21 sequentially processes scalar instructions. Vector unit 11 is activated when the instruction fetched from main memory 22 is a vector instruction. Multiple load/store pipeline 1
For example, it has 256 mask registers 14 consisting of 32 words x 1 bit and 256 vector registers 14' consisting of 32 words x 64 bits. The mask circuit 15 is, for example,
In order to include procedures that include IF statements in FORTRAN programs as vectorization targets, it indicates the data for which the condition is true. Addition/logic operator 16, multiplier 17 and divider 1
8 process data groups in the vector register 14' in parallel using vector instructions.
Since large amounts of data are processed simultaneously, high-speed data processing is possible. An object module 24 including a vector instruction or a load module edited therefrom is loaded in advance into the main storage device 22 via a channel device 23.

上記の如きベクトル処理装置10の構成によ
り、それによつて実行される命令には、同じ処理
内容であれば、できるだけベクトル命令が多く用
いられていたほうが望ましい。そのため、本発明
に係る翻訳処理装置2は、特に次のような構成を
有している。
Due to the configuration of the vector processing device 10 as described above, it is desirable that as many vector instructions as possible be used as the instructions executed by the vector processing device 10, as long as the processing contents are the same. Therefore, the translation processing device 2 according to the present invention particularly has the following configuration.

構文解析部30は、ソース・モジユール25の
被翻訳対象について、そのシンタツクスを解析す
るものである。添字走査部31は、添字式内の変
数で動きの不明なものを捜し出す処理を行うもの
である。なお、添字は、複数個のデータからなる
配列内における位置を示すものと考えてよい。添
字走査部31は、特に配列の添字のうち、その文
を含む全ループの制御変数以外の変数を処理対象
とする。ここでループは、例えばFORTRANの
DO文による繰り返し処理される命令群であり、
処理変数は、そのループの繰り返し回数に依存し
た値をもつ変数をいう。
The syntax analysis unit 30 analyzes the syntax of the source module 25 to be translated. The subscript scanning unit 31 performs a process of searching for variables in the subscript expression whose movements are unknown. Note that the subscript may be considered to indicate a position within an array consisting of a plurality of pieces of data. The subscript scanning unit 31 particularly processes variables other than the control variables of all loops including that statement among the subscripts of the array. Here the loop is for example FORTRAN's
A group of instructions that are repeatedly processed by DO statements,
A processing variable is a variable whose value depends on the number of repetitions of the loop.

定義式走査部32は、添字走査部31が捜し出
した処理対象の変数が、どのような変数または定
数によつて、予め定められるかを示す定義式を、
以下の所定の範囲から捜し出す処理を実行するも
のである。式の走査の対象となるブロツクは、上
記処理対象の変数の出現したブロツク、次に、上
記処理対象の変数の出現したループ内で、出現し
たブロツクまでのパス上において必ず通過するブ
ロツク、および上記処理対象の変数の出現したル
ープの初期設定ブロツクである。なお、ブロツク
は翻訳の処理単位であつて、処理の流れがユニー
クに定まる部分をいう。
The definition expression scanning unit 32 scans a definition expression indicating in advance by what kind of variable or constant the variable to be processed that has been found by the subscript scanning unit 31 is determined.
It executes the following search process from a predetermined range. The blocks to be scanned by the expression are the block where the variable to be processed appears, then the block that must be passed on the path to the block where the variable to be processed appears in the loop, and the block where the variable to be processed appears. This is the initialization block of the loop in which the variable to be processed appears. Note that a block is a processing unit of translation, and refers to a part where the flow of processing is uniquely determined.

添字式組込み部33は、定義式走査部32が捜
し出した式を、当該添字式に組込んで、処理対象
の変数を他の変数または定数に置き換える処理を
行うものである。変数を定義する式が、定数のみ
の式の場合、処理対象の文を含むループの制御変
数のうち、いずれか1つを含む式である場合、式
中に処理対象の変数が現われていない式である場
合に組込みを行う。例えば、ループの制御変数が
iおよびJであつて、配列Aの代入文が、 A(J)=A(i+K) で与えられている場合に、同じブロツク内におい
て、変数Kが、 K=J+10 で定義されているとすると、上記代入文は、添字
式組込み部33によつて、 A(J)=A(i+J+10) と置き換えられる。
The subscript expression incorporation section 33 performs processing of incorporating the expression found by the definition expression scanning section 32 into the subscript expression, and replacing the variable to be processed with another variable or constant. If the expression that defines the variable is an expression that contains only constants, if it is an expression that includes one of the control variables of the loop that includes the statement to be processed, or if the variable to be processed does not appear in the expression If so, perform the embedding. For example, if the control variables of a loop are i and J, and the assignment statement for array A is given as A(J)=A(i+K), then within the same block, variable K is given as K=J+10 If it is defined as A(J)=A(i+J+10), the above assignment statement is replaced by the subscript expression embedding unit 33 as A(J)=A(i+J+10).

ベクトル化可否判定部34は、添字組込み部3
3による組込み処理が終了した後に、配列代入式
の右辺と左辺とに現われる添字式を比較し、重な
り関係があるかどうかによつて、ベクトル化でき
るかどうかを決定するものである。配列名が異な
る場合には、その部分は重なりが生じないものと
されるが、代入データに重なりが生じる場合であ
つても、データを後方から前方へ移動させて代入
する場合のように、ベクトル化して処理するとき
と、逐次処理するときとの処理結果が等しくなる
場合には、ベクトル化可能と判断する。
The vectorization possibility determination unit 34 includes the subscript incorporation unit 3
After the embedding process in step 3 is completed, the subscript expressions appearing on the right and left sides of the array assignment expression are compared, and it is determined whether vectorization is possible depending on whether there is an overlapping relationship. If the array names are different, it is assumed that the parts do not overlap, but even if there is overlap in the assigned data, vector If the processing results are the same when processing by converting into vectors and when processing sequentially, it is determined that vectorization is possible.

ベクトル命令生成部35は、ベクトル化可否判
定部34がベクトル化可能と判定した文につい
て、ベクトル命令からなるオブジエクトを生成す
るものであり、スカラ命令生成部36は、ベクト
ル化できないものについて、スカラ命令に展開す
る処理を実行するものである。
The vector instruction generation unit 35 generates an object consisting of vector instructions for a sentence that the vectorization possibility determination unit 34 has determined can be vectorized, and the scalar instruction generation unit 36 generates an object consisting of a vector instruction for a sentence that cannot be vectorized. It executes the process of expanding into

上記構成により、翻訳処理装置2は、例えば第
4図図示の如く処理する。なお、本発明に関連し
た処理を中心に説明するが、他の処理について
は、従来と同様であると考えてよい。まず、第4
図図示処理40によつて、添字情報を作成する。
ソース中の添字式どおりのものが抽出される。次
に処理41により、構造解析を所定の文法に従つ
て行う。次に処理42の判定により、全テキスト
についての処理終了が確認されるまで、処理43
から処理50までを繰り返す。処理43によつ
て、添字式内の変数の中で動きの不明なものを捜
す。動作不明な添字があれば、処理44によつ
て、同一ブロツクB1において、処理対象の添字
に用いられている変数を定義する式を捜す。処理
45の判定により、見つかれば、処理49へ移
る。処理46では、処理対象の変数Kが出現した
DOループにおいて、必ず通過するブロツク、例
えばB2,B3について、定義式をさがす。枝分
れするブロツクB4,B5は、必ず通過するとは
限らないので、サーチ対象から外す。処理47に
より、見つかれば、処理49へ移る。処理48で
は、初期設定ブロツクB6,B7などの、処理対
象の変数が出現したDOループの外部に、定義式
があるかどうかを捜す。
With the above configuration, the translation processing device 2 performs processing as shown in FIG. 4, for example. Note that although the processing related to the present invention will be mainly described, other processing may be considered to be the same as the conventional processing. First, the fourth
Subscript information is created by the diagram illustrating process 40.
The subscript expression in the source is extracted. Next, in process 41, structural analysis is performed according to a predetermined grammar. Next, the process 43
to process 50 are repeated. Process 43 searches for variables in the subscript expression whose movement is unknown. If there is a subscript whose behavior is unknown, a process 44 searches for an expression that defines a variable used in the subscript to be processed in the same block B1. As a result of the determination in process 45, if it is found, the process moves to process 49. In process 46, the variable K to be processed appears
In the DO loop, search for defining expressions for blocks that must pass, such as B2 and B3. Since branching blocks B4 and B5 are not necessarily passed through, they are excluded from the search target. If it is found in process 47, the process moves to process 49. In process 48, a search is made to see if there is a definition expression outside the DO loop in which the variable to be processed appears, such as in initialization blocks B6 and B7.

処理49の判定において、定義式が見つからな
かつたと判定された場合、および見つかつても組
込み条件に合致しない判定された場合には、動作
不明な変数はそのままの形で、処理42に戻り、
次のテキストについての処理に移る。組込みが可
能であれば、処理50により、定義式を組込ん
で、変数をループの制御変数のような動きのわか
るものに置き換える。その後、処理42へ制御を
移す。
In the judgment of process 49, if it is determined that the definition expression is not found, or if it is determined that even if it is found, it is determined that it does not match the built-in condition, the process returns to process 42 with the variable whose behavior is unknown as it is,
Move on to processing the next text. If it is possible to incorporate it, in step 50, the definition expression is incorporated and the variable is replaced with something whose behavior is known, such as a control variable for a loop. Thereafter, control is transferred to process 42.

処理43以下の処理を全テキストについて行つ
た後は、処理51へ移る。処理51では、添字の
重なり関係をチエツクする。処理52による判定
によつて、ベクトル化が可能であることがわかれ
ば、処理53により、ベクトル命令に展開する。
ベクトル化できない場合には、処理54によつ
て、通常のスカラ命令によりオブジエクトを生成
する。次に処理55によつて、全テキストについ
ての機械語への翻訳が終了したかどうかを判定
し、まだの場合には、次のテキスト内容につい
て、処理51から処理54までを繰り返す。
After processing 43 and subsequent steps are performed on all texts, the process moves to step 51. In process 51, the overlapping relationship of subscripts is checked. If it is determined by the process 52 that vectorization is possible, the process 53 expands it to a vector instruction.
If vectorization is not possible, a process 54 generates an object using a normal scalar instruction. Next, in process 55, it is determined whether the translation of all texts into machine language has been completed, and if not, processes 51 to 54 are repeated for the next text content.

次に、第5図を参照し、具体例に従つて処理態
様を説明する。例えば、第5図イ図示の如き被翻
訳命令群4が与えられたとする。文S1,S3,
S5,S6は、それぞれ右辺の式の値を左辺の変
数に代入することを指示する代入文である。特
に、文S6については、配列データが扱われてい
る。文S2およびS4は、いわゆるDOループを
指示する文であり、文S7までの命令文を繰り返
し実行すべきことを示す。ループ制御変数Jおよ
びLについての多重ループになつている。
Next, the processing mode will be explained according to a specific example with reference to FIG. For example, assume that a group of instructions to be translated 4 as shown in FIG. 5A is given. Sentences S1, S3,
S5 and S6 are assignment statements that respectively instruct to assign the value of the expression on the right side to the variable on the left side. In particular, for sentence S6, array data is handled. Statements S2 and S4 are statements that instruct a so-called DO loop, and indicate that the command statements up to statement S7 should be repeatedly executed. There are multiple loops for loop control variables J and L.

添字走査部31は、被翻訳命令群4から、配列
の添字であつて、動作不明な変数を含むものを捜
し出す。この例の場合、文S6に配列があり、そ
の添字情報は、第5図ロ図示の如くになつてお
り、添字と添字との関係は明確であるが、添
字と添字との関係が不明な状態となつてい
る。なお、配列Aについては、代入される配列B
とは別の配列であるため、ベクトル化の可否に影
響を与えない。従来、このような動作不明な添字
,の関係があるとき、ベクトル化できないも
のとされていた。本発明の場合、以下のように添
字関係を明確にし、ベクトル化が促進される。
The subscript scanning unit 31 searches the group of translated instructions 4 for subscripts of arrays that include variables whose behavior is unknown. In this example, there is an array in sentence S6, and its subscript information is as shown in Figure 5B, and the relationship between subscripts is clear, but the relationship between subscripts is unclear. It has become a state. Note that for array A, array B to be assigned
Since it is a different array from , it does not affect whether or not it can be vectorized. Conventionally, when there is a relationship between subscripts whose behavior is unknown, it has been thought that vectorization cannot be performed. In the case of the present invention, vectorization is promoted by clarifying the subscript relationship as follows.

定義式走査部32は、動作不明な変数iBおよ
びiAについての定義式を捜し出す。この例の場
合、文S3と文S5とが見つけ出される。添字式
組込み部33は、文S3と文S5によつて与えら
れた定義式を、添字情報に組込む。これによつ
て、文S6についての添字情報は、第5図ハ図示
の如く添字′,′,′に置き換えられること
になる。
The definition formula scanning unit 32 searches for definition formulas for variables iB and iA whose operations are unknown. In this example, sentences S3 and S5 are found. The subscript expression incorporation unit 33 incorporates the definition expressions given by statements S3 and S5 into subscript information. As a result, the subscript information regarding the sentence S6 is replaced with the subscripts ',',' as shown in FIG.

ここで、添字の関係をチエツクすると、左辺と
右辺の第1項とは、完全に同じ添字であるので、
ベクトル化にあたつて問題はない。添字′と添
字′との関係は、ループ制御変数LおよびJの
動作範囲を調べることによつて明らかにされる。
すなわち、文S4によつて、 1≦L≦J 0≦L−1≦J−1 が得られ、これから N≧N−L+1≧N−J+1 であることがわかる。従つて、添字の関係は、第
5図ニ図示のようになり、添字′が少なくとも
「N−J+1」より大となるため、重ならないこ
とがわかる。これにより、被翻訳命令群4に現わ
れるループ内配列についてのベクトル化が可能と
なる。
Here, if you check the relationship of subscripts, the first term on the left side and the right side have exactly the same subscript, so
There are no problems with vectorization. The relationship between the subscripts ' and ' is clarified by examining the operating ranges of the loop control variables L and J.
That is, from the sentence S4, 1≦L≦J 0≦L−1≦J−1 is obtained, and from this it can be seen that N≧NL+1≧N−J+1. Therefore, the relationship between the subscripts is as shown in FIG. 5D, and since the subscript ' is at least larger than "N-J+1", it can be seen that they do not overlap. This makes it possible to vectorize the in-loop array appearing in the group of instructions to be translated 4.

(E) 発明の効果 以上説明した如く本発明によれば、ベクトル化
率を高めることができ、従来ベクトル化不可であ
つた部分が、ベクトル化されることにより、生成
されるオブジエクトの実行性能が向上する。
(E) Effects of the Invention As explained above, according to the present invention, the vectorization rate can be increased, and parts that could not be vectorized in the past are vectorized, thereby improving the execution performance of the generated objects. improves.

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

第1図は一般的なベクトル命令生成についての
説明図、第2図は従来技術の問題点説明図、第3
図は本発明の一実施例構成、第4図は本発明の一
実施例処理説明図、第5図は本発明の具体的な一
実施例処理態様の説明図を示す。 図中、2は翻訳処理装置、4は被翻訳命令群、
10はベクトル処理装置、11はベクトル・ユニ
ツト、12はスカラ・ユニツト、22は主記憶装
置、23はチヤネル装置、24はオブジエクト・
モジユール、25はソース・モジユール、30は
構文解析部、31は添字走査部、32は定義式走
査部、33は添字式組込み部、34はベクトル化
可否判定部、35はベクトル命令生成部、36は
スカラ命令生成部を表わす。
Fig. 1 is an explanatory diagram of general vector instruction generation, Fig. 2 is an explanatory diagram of problems in the conventional technology, and Fig. 3 is an explanatory diagram of general vector instruction generation.
The figure shows the configuration of an embodiment of the present invention, FIG. 4 is an explanatory diagram of processing of an embodiment of the invention, and FIG. 5 is an explanatory diagram of a specific processing aspect of an embodiment of the invention. In the figure, 2 is a translation processing device, 4 is a group of instructions to be translated,
10 is a vector processing device, 11 is a vector unit, 12 is a scalar unit, 22 is a main storage device, 23 is a channel device, and 24 is an object processor.
25 is a source module, 30 is a syntax analysis unit, 31 is a subscript scanning unit, 32 is a definition expression scanning unit, 33 is a subscript expression embedding unit, 34 is a vectorization possibility determination unit, 35 is a vector instruction generation unit, 36 represents a scalar instruction generator.

Claims (1)

【特許請求の範囲】 1 複数個のデータを並列処理するベクトル命令
を実行するベクトル・ユニツトと、スカラ・デー
タを処理するスカラ命令を実行するスカラ・ユニ
ツトとをそなえたベクトル処理装置における機械
語命令への翻訳処理装置において、 繰り返し実行される形で表わされた被翻訳命令
群に現われる配列の添字であつて、動作不明な変
数を含む添字を捜し出す添字走査手段と、 上記動作不明な変数を定義する式を捜し出す定
義式走査手段と、 該定義式走査手段によつて捜し出された式の定
義内容を、上記添字における動作不明な変数を置
き換える形で、該添字情報中に組込む添字式組込
み手段と、 該添字式組込み手段によつて生成された新たな
添字情報にもとづいて、その動作範囲を調べるこ
とにより、ベクトル化の可否を判定する判定手段
と、 該判定手段の判定結果に従つて上記ベクトル命
令を生成するベクトル命令生成処理部とをそなえ
たことを特徴とするループ内配列処理ベクトル化
処理方式。
[Claims] 1. Machine language instructions in a vector processing device equipped with a vector unit that executes vector instructions that process multiple pieces of data in parallel and a scalar unit that executes scalar instructions that process scalar data. a subscript scanning means for searching a subscript of an array appearing in a group of translated instructions expressed in a repeatedly executed form that includes a variable whose operation is unknown; A definition expression scanning means for searching for a defined expression; and a subscript expression embedding method for incorporating the definition content of the expression found by the definition expression scanning means into the subscript information in the form of replacing a variable whose behavior is unknown in the above subscript. means, determining means for determining whether vectorization is possible by examining the operating range based on the new subscript information generated by the subscript expression incorporating means; and according to the determination result of the determining means. An in-loop array processing vectorization processing method, comprising: a vector instruction generation processing section that generates the vector instruction described above.
JP12417583A 1983-07-08 1983-07-08 RUUPUNAIHAIRETSUSHORIBEKUTORUKASHORIHOSHIKI Expired - Lifetime JPH0235349B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12417583A JPH0235349B2 (en) 1983-07-08 1983-07-08 RUUPUNAIHAIRETSUSHORIBEKUTORUKASHORIHOSHIKI

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12417583A JPH0235349B2 (en) 1983-07-08 1983-07-08 RUUPUNAIHAIRETSUSHORIBEKUTORUKASHORIHOSHIKI

Publications (2)

Publication Number Publication Date
JPS6015772A JPS6015772A (en) 1985-01-26
JPH0235349B2 true JPH0235349B2 (en) 1990-08-09

Family

ID=14878822

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12417583A Expired - Lifetime JPH0235349B2 (en) 1983-07-08 1983-07-08 RUUPUNAIHAIRETSUSHORIBEKUTORUKASHORIHOSHIKI

Country Status (1)

Country Link
JP (1) JPH0235349B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5969364U (en) * 1982-11-01 1984-05-11 旭化成株式会社 Floating prevention structure for underground boxes
JP2555011B2 (en) * 1985-08-27 1996-11-20 富士通株式会社 Vector data processing method
JPH0795274B2 (en) * 1986-09-19 1995-10-11 株式会社日立製作所 Array subscript analysis method

Also Published As

Publication number Publication date
JPS6015772A (en) 1985-01-26

Similar Documents

Publication Publication Date Title
US6113650A (en) Compiler for optimization in generating instruction sequence and compiling method
Agerwala Microprogram optimization: A survey
JPS6312029A (en) Information processor
Graham Bounded context translation
US5359539A (en) Logic design system and circuit transformation rule compiler
JPH0235349B2 (en) RUUPUNAIHAIRETSUSHORIBEKUTORUKASHORIHOSHIKI
KR0125605B1 (en) Method and device for verifying operation of machine language program
JP2002527816A (en) Program optimization apparatus and method
JPH07141192A (en) Translating processing
JP7506718B2 (en) Processor and program for controlling pipeline processing based on jump instructions
Tomita et al. A computer with low-level parallelism QA-2: its applications to 3-D graphics and Prolog/Lisp machines
WO2024029174A1 (en) Processor for controlling pipeline processing based on jump instruction, and program storage medium
JPH02176938A (en) Machine language instruction optimizing system
Marks Compilation to compact code
Kumar et al. Revolutionizing Compilation: Lexical Analysis Approaches for Parallel Multi-Core Processing
JPH05189243A (en) Compiling processor for operation with condition
JPH0950429A (en) Pointer vectorization system in compiler
JPH11195011A (en) Language translation processor, language translation processing method and record medium recording language translation processing program
JPH05204705A (en) Processing method for detecting undefined parameter
JP5169322B2 (en) Variable optimization apparatus, variable optimization program, compiler, variable optimization method, and compilation method
JPS62165268A (en) Vector compile processing system
JP2024061528A (en) Processor, program and method for executing conditional jump instructions using indirect addressing method
JP2001043209A (en) Multiple nest loop program compile system
JP2539070B2 (en) Compiler processor
JPH10275087A (en) Compiling device