JPH0417469B2 - - Google Patents

Info

Publication number
JPH0417469B2
JPH0417469B2 JP17871884A JP17871884A JPH0417469B2 JP H0417469 B2 JPH0417469 B2 JP H0417469B2 JP 17871884 A JP17871884 A JP 17871884A JP 17871884 A JP17871884 A JP 17871884A JP H0417469 B2 JPH0417469 B2 JP H0417469B2
Authority
JP
Japan
Prior art keywords
function
vectorization
vector
relay
compiler
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
Application number
JP17871884A
Other languages
Japanese (ja)
Other versions
JPS6155778A (en
Inventor
Akikazu Abe
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP17871884A priority Critical patent/JPS6155778A/en
Publication of JPS6155778A publication Critical patent/JPS6155778A/en
Publication of JPH0417469B2 publication Critical patent/JPH0417469B2/ja
Granted 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

【発明の詳細な説明】 発明の目的 産業上の利用分野 本発明は、ベクトル化処理方式に関するもので
ある。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application of the Invention The present invention relates to a vectorization processing method.

従来の技術 近年、科学技術計算用等の超高速コンピユータ
ーとして、並列パイプライン処理方式を用いたベ
クトル・プロセツサに本来の高速性を発揮させる
には、極力高いベクトル化率を達成できるような
ベクトル・コンパイラが必要になる。
Conventional technology In recent years, in order to make vector processors using parallel pipeline processing realize their true high speed as ultra-high-speed computers for scientific and technical calculations, vector processors that can achieve as high a vectorization rate as possible have been developed. A compiler is required.

従来技術の問題点 従来、コンパイラ言語で組まれたソース・プロ
グラム中に関数引用を含むループが存在すると、
そのループ全体のベクトル化は、次のような場合
を除き不可能となり、ベクトル化率を低下させる
一因となつていた。
Problems with conventional technology Conventionally, if a loop containing a function reference exists in a source program written in a compiler language,
Vectorization of the entire loop becomes impossible except in the following cases, which is one of the causes of a decrease in the vectorization rate.

(1) その関数の処理手続きをベクトル処理可能な
形式でそのループ処理手続中に展開できる場
合。
(1) When the processing procedure of the function can be expanded into the loop processing procedure in a vector-processable format.

(2) その関数に対して、ベクトル・レジスタまた
はメモリを介してベクトルの長さに対応す組の
引数データと、対応の関数値を受渡す関数処理
手続き(ベクトル版の関数)がシステム側に用
意されている場合。
(2) The system side has a function processing procedure (vector version of the function) that passes a set of argument data corresponding to the length of the vector and the corresponding function value to the function via a vector register or memory. If available.

(3) その関数に対する上記(2)のベクトル版関数が
利用者によつて用意され、しかもそれがコンパ
イラに知らされている場合。
(3) When a vector version of the function described in (2) above is prepared by the user and this is known to the compiler.

利用者が定義した関数の引用を含むループにつ
いては、上記(3)の条件を満たさせることによつて
ベクトル化が可能になる。しかし、この条件を実
現するためには、関数処理手続をアセンブリ言語
で記述しなければならない場合が多く、利用者の
負担が過大になるという問題がある。
Loops that include references to functions defined by users can be vectorized by satisfying the condition (3) above. However, in order to realize this condition, it is often necessary to write function processing procedures in assembly language, which poses a problem of placing an excessive burden on the user.

発明の構成 問題点を解決するための手段 上記従来技術の問題点を解決するための本発明
は外部から指定されたスカラ関数を、入力された
引数データベクトル配列内の要素で繰返し呼出
し、対応するスカラ関数を受ける処理を繰り返し
呼出すことにより関数値ベクトルを生成する中継
ベクトル化機能を有するシステムと:高級言語で
記述されたソース・プログラム内の関数引用を含
むループ部分に対しては、プログラム実行時にお
いて前記中継ベクトル化機能を呼出す段階を含む
ように、目的プログラムを生成するコンパイラと
を備えるように構成されている。
Means for Solving the Problems in the Structure of the Invention The present invention for solving the problems in the prior art described above repeatedly calls a scalar function specified from the outside with elements in an input argument data vector array, and performs corresponding operations. A system that has a relay vectorization function that generates a function value vector by repeatedly calling a process that receives a scalar function: For loop parts that include function references in a source program written in a high-level language, and a compiler that generates a target program, including the step of calling the relay vectorization function at the step of calling the relay vectorization function.

以下本発明の作用を実施例によつて詳細に説明
する。
The effects of the present invention will be explained in detail below using examples.

実施例 第1図は、本発明の一実施例に使用するコンパ
イラの機能ブロツク図である。
Embodiment FIG. 1 is a functional block diagram of a compiler used in an embodiment of the present invention.

コンパイラ2内のソース解析部21は、供給さ
れたソースプログラムを解析し、ベクトル化処理
部分をベクトル化処理部22に渡し、他の部分を
非ベクトル化処理部27に渡す。この際、ソース
解析部21は、ベクトル化処理部分のうちループ
内に関数引用を含む部分については、これを第1
のベクトル化処理部26に渡す。一方、ソース解
析部21は、ベクトル化処理部分のうち関数の引
用がない部分や、関数の引用があつてもベクトル
版の関数が定義されている等の理由により従来の
方式でベクトル化処理を行う部分については、こ
れを第2のベクトル化処理部25に渡す。
The source analysis unit 21 in the compiler 2 analyzes the supplied source program, passes the vectorization processing part to the vectorization processing unit 22, and passes the other part to the non-vectorization processing unit 27. At this time, the source analysis unit 21 converts the vectorization processing part that includes a function quotation in the loop into the first
It is passed to the vectorization processing unit 26. On the other hand, the source analysis unit 21 performs vectorization processing using the conventional method due to reasons such as parts in which there are no function citations in the vectorization processing portion, or vector version functions are defined even if there are function citations. The portion to be processed is passed to the second vectorization processing unit 25.

第2図は、上述したループ内に関数引用を含む
プログラム部分の一例を、ソース・プログラム言
語としてFORTPANを使用した場合について示
している。このプログラム部分(いわゆるDOル
ープ)は、「配列A、B、X、Y、Zのi番目の
要素Ai、Bi、Xi、Yi、Ziについて、AiとBiの積
を計算し、この積を引数データとして利用者が定
義した関数FUNCを呼出してこの引数データに
対応した関数値を得、得られた関数値とZiの積を
計算し、この積にYiを加算し、この加算結果を
Xiに格納する」という処理を1番目の要素から
200番目の要素まで繰り返し行うという処理手順
を記述している。
FIG. 2 shows an example of a program portion including a function reference in the above-mentioned loop when FORTPAN is used as the source programming language. This program part (so-called DO loop) says, ``For the i-th elements Ai, Bi, Xi, Yi, and Zi of arrays A, B, X, Y, and Z, calculate the product of Ai and Bi, and use this product as an argument. Call the function FUNC defined by the user as data to obtain the function value corresponding to this argument data, calculate the product of the obtained function value and Zi, add Yi to this product, and add the result of this addition.
"Storing to Xi" process starting from the first element.
The processing procedure is described to repeat until the 200th element.

上述のようなループ内に関数引用を含むプログ
ラム部分を受取つた第1のベクトル化処理部26
は、これをベクトル化するための中間テキスト3
を生成する。
A first vectorization processing unit 26 that receives a program portion including a function reference in a loop as described above.
is the intermediate text 3 to vectorize this
generate.

第3図は、第2図のDOループに基づいて生成
された中間テキスト3の一例を示している。この
中間テキスト3において、Vteoはベクトルの長さ
を格納するレジスタ又はメモリ、vt1〜vt8はベ
クトルの要素を保持するレジスタ又はメモリであ
る。
FIG. 3 shows an example of intermediate text 3 generated based on the DO loop shown in FIG. In this intermediate text 3, V teo is a register or memory that stores the length of a vector, and vt1 to vt8 are registers or memories that hold vector elements.

中間テキスト3のステツプ(1)においてベクトル
長が設定される。ステツプ(2)においてレジスタvt
1に配列Aの要素が格納され、ステツプ(3)におい
てレジスタvt1に配列Bの要素が格納され、ステ
ツプ(4)においてレジスタvt1とvt2内の各要素間
の積が計算される。次のステツプ(5)において、第
4図に示すような構成の中継ベクトル機能
(「VECT」)が、関数名FUNCとレジスタvt3の
内容を引数として呼出され、中継ベクトル化機能
VECTから受けたvt3に対する関数値がレジスタ
vt4に格納される。
In step (1) of intermediate text 3, the vector length is set. In step (2) register vt
1 stores the elements of array A, in step (3) the elements of array B are stored in register vt1, and in step (4) the product between each element in registers vt1 and vt2 is calculated. In the next step (5), the relay vector function ("VECT") configured as shown in Figure 4 is called with the function name FUNC and the contents of register vt3 as arguments, and the relay vectorization function
Function value for vt3 received from VECT is registered
Stored in vt4.

上記中継ベクトル化機能VECTにおいて、引数
データ・ベクトル(配列)12内のa1,a2……ao
は、それぞれ第3図のレジスタvt3から次々に受
取つた引数データ(Ai・Bi)である。関数呼出
し部13は、指定された関数名FUNCで特定さ
れるスカラー関数を、引数データ・ベクトルの各
要素aiによつて繰り返し呼出し、対応のスカラー
関数値fiを受取る。このスカラー関数値f1,f
2……fnを要素とする関数値ベクトル(配列)1
4が生成される。
In the above relay vectorization function VECT, a 1 , a 2 ...a o in the argument data vector (array) 12
are the argument data (Ai and Bi) received one after another from the register vt3 in FIG. 3, respectively. The function calling unit 13 repeatedly calls the scalar function specified by the specified function name FUNC using each element ai of the argument data vector, and receives the corresponding scalar function value fi. This scalar function value f1, f
2...Function value vector (array) 1 with fn as an element
4 is generated.

再び第3図の中間テキストにもどると、上記中
継ベクトル化機能VECTで生成された関数値ベク
トルf1,f2……fnは、第3図のステツプ(5)に
おいてレジスタvt4に格納される。次のステツプ
(6)において、レジスタvt5に配列Zの各要素が格
納され、ステツプ(7)においてレジスタvt4の内容
とレジスタvt5の内容の積が計算され、この計算
結果がレジスタvt6に格納される。ステツプ(8)に
おいてレジスタvt7に配列Yのの要素が格納さ
れ、ステツプ(9)においてvt7とvt6の各要素間の
加算が行われ、この加算結果がレジスタvt8に格
納される。最後に、上記レジスタvt8の内容であ
る配列間の演算結果が、Xに格納される。
Returning again to the intermediate text in FIG. 3, the function value vectors f1, f2, . next step
In step (6), each element of array Z is stored in register vt5, and in step (7), the product of the contents of register vt4 and register vt5 is calculated, and the result of this calculation is stored in register vt6. In step (8), the elements of array Y are stored in register vt7, and in step (9), addition is performed between each element of vt7 and vt6, and the result of this addition is stored in register vt8. Finally, the result of the operation between the arrays, which is the contents of the register vt8, is stored in X.

上述のような中間テキスト3は、中間テキスト
最適化部23において、周知の最適化処理が施さ
れたのち、目的プログラム生成部24に渡され、
目的プログラム4が生成される。この目的プログ
ラムは、ベクトル演算機能と、中継ベクトル化機
能と、この中継ベクトル化機能から呼出されるサ
ブルーチン等のスカラー関数を備える処理システ
ムにおいて実行される。
The intermediate text 3 as described above is subjected to well-known optimization processing in the intermediate text optimization section 23, and then passed to the target program generation section 24,
A target program 4 is generated. This object program is executed in a processing system that includes a vector calculation function, a relay vectorization function, and scalar functions such as subroutines called from the relay vectorization function.

上述の中継ベクトル化機能は第4図に示すよう
に究めて簡易なものであり、容易に構成できる。
The relay vectorization function described above is extremely simple, as shown in FIG. 4, and can be easily constructed.

また、中継ベクトル機能を呼出す代りに、これ
を第3図の中間テキスト中に展開する構成として
もよい。
Also, instead of calling the relay vector function, it may be expanded into the intermediate text shown in FIG. 3.

なお、中継ベクトル化機能から呼出されるスカ
ラー関数はベクトル化処理専用のものである必要
はなく、コンパイラ言語で記述された通常のプロ
グラムであつてよい。
Note that the scalar function called from the relay vectorization function does not need to be dedicated to vectorization processing, and may be a normal program written in a compiler language.

コンパイラのソース解析部において、関数引用
を含むループを検出する構成を例示したが、ソー
ス解析部ではループのみを検出し、このループに
おける関数引用の有無をベクトル化処理部で検出
する構成としてもよい。
Although we have shown an example of a configuration in which the source analysis section of the compiler detects loops that include function references, it is also possible to have a configuration in which the source analysis section only detects loops and the vectorization processing section detects whether or not there are function references in these loops. .

発明の効果 以上詳細に説明したように、本発明は、システ
ムに受取つたベクトル引数データの各成分につい
てスカラー関数処理機能を繰り返し呼出すことに
より関数値ベクトルを生成する中継ベクトル化機
能を付加すると共に、高級言語で記述されたソー
ス・プログラム内の関数引用ループ部分に対し、
プログラム実行時において前記中継ベクトル化機
能を呼出す段階を含むように、目的プログラムを
生成するコンパイラとを備える構成であるから、
汎用のベクトル版関数が用意されたと同様の結果
となり、ベクトル化率が大幅に向上するという効
果が奏される。
Effects of the Invention As described in detail above, the present invention adds a relay vectorization function that generates a function value vector by repeatedly calling a scalar function processing function for each component of vector argument data received by the system, and For the function reference loop part in a source program written in a high-level language,
Since the configuration includes a compiler that generates a target program so as to include a step of calling the relay vectorization function at the time of program execution,
The result is the same as if a general-purpose vector version function were prepared, and the vectorization rate is significantly improved.

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

第1図は、本発明の一実施例に使用するコンパ
イラの機能ブロツク図、第2図は高級言語で記述
された関数引用を含むループの例を示す図、第3
図はコンパイラのベクトル化処理部で生成される
中間テキストの一例を示す図、第4図は中継ベク
トル化機能の構成の一例を示す図である。 1……ソース・プログラム、2……コンパイ
ラ、3……中間テキスト、4……目的プログラ
ム、21……ソース解析部、22,25,26…
…ベクトル化処理部、23……中間テキスト最適
化部、24……目的プログラム生成部、27……
非ベクトル化処理部。
FIG. 1 is a functional block diagram of a compiler used in an embodiment of the present invention, FIG. 2 is a diagram showing an example of a loop containing a function reference written in a high-level language, and FIG.
The figure shows an example of intermediate text generated by the vectorization processing section of the compiler, and FIG. 4 is a diagram showing an example of the configuration of the relay vectorization function. 1... Source program, 2... Compiler, 3... Intermediate text, 4... Target program, 21... Source analysis section, 22, 25, 26...
...Vectorization processing unit, 23...Intermediate text optimization unit, 24...Target program generation unit, 27...
Non-vectorization processing section.

Claims (1)

【特許請求の範囲】 1 外部から指定されたスカラ関数を、入力され
た引数データベクトル配列内の要素で繰返し呼出
し、対応するスカラ関数を受ける処理を操り返し
呼出すことにより対応のスカラ関数値の配列から
成る関数値ベクトルを生成する中継ベクトル化機
能を有するシステムと、 コンパイル方式の高級言語で記述されたプログ
ラム内の関数引用を含むループ部分に対しては、
プログラム実行時において前記中継ベクトル化機
能を呼出す段階を含むように、目的プログラムを
生成するコンパイラとを備えたことを特徴とする
ベクトル化処理方式。
[Scope of Claims] 1. A scalar function specified from the outside is repeatedly called with an element in an input argument data vector array, and a corresponding scalar function value array is created by repeatedly calling a process that receives the corresponding scalar function. For systems that have a relay vectorization function that generates function value vectors consisting of
1. A vectorization processing method, comprising: a compiler that generates a target program so as to include the step of calling the relay vectorization function during program execution.
JP17871884A 1984-08-28 1984-08-28 Vector processing system Granted JPS6155778A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17871884A JPS6155778A (en) 1984-08-28 1984-08-28 Vector processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17871884A JPS6155778A (en) 1984-08-28 1984-08-28 Vector processing system

Publications (2)

Publication Number Publication Date
JPS6155778A JPS6155778A (en) 1986-03-20
JPH0417469B2 true JPH0417469B2 (en) 1992-03-26

Family

ID=16053346

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17871884A Granted JPS6155778A (en) 1984-08-28 1984-08-28 Vector processing system

Country Status (1)

Country Link
JP (1) JPS6155778A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA1304938C (en) * 1987-03-19 1992-07-14 Tsugio Kawahara Display apparatus for an automatic vending machine

Also Published As

Publication number Publication date
JPS6155778A (en) 1986-03-20

Similar Documents

Publication Publication Date Title
EP0474425B1 (en) Arrangement for efficiently transferring program execution between subprograms
JPH0527143B2 (en)
US5757685A (en) Data processing system capable of processing long word data
JPH07200312A (en) Digital data processing system and error processing method
JPH0417469B2 (en)
US5586320A (en) High speed synchronous processing system for executing parallel processing of programs having loops
JPS581246A (en) Controlling system for order of instruction processing
JPS58178464A (en) Parallel arithmetic processing unit
US11416261B2 (en) Group load register of a graph streaming processor
JP3278441B2 (en) Vector processing equipment
JPH0222418B2 (en)
JPS60178539A (en) By-pass control system of information processor
JPS59223846A (en) Arithmetic processor
JPH0241562A (en) Dividing and processing system for vector arithmetic string
JP3072772B2 (en) Compiling device
JPH04135245A (en) Compiling processing system
JPS6028014B2 (en) microprocessor
JPS60220468A (en) Vector arithmetic control system
JPS59218567A (en) Address overlap checking system
JPH04140851A (en) Diagnostic system for information processor
JPH0343865A (en) Vector data processor
JPH0320864A (en) Information processor having vector instruction set for fuzzy calculation
JPS6257028A (en) Branch control system in information processor of pipeline control
JPS6116111B2 (en)
JPS59220844A (en) Instruction reexecution control system