JPH04220727A - Vectorization processing system - Google Patents

Vectorization processing system

Info

Publication number
JPH04220727A
JPH04220727A JP40518290A JP40518290A JPH04220727A JP H04220727 A JPH04220727 A JP H04220727A JP 40518290 A JP40518290 A JP 40518290A JP 40518290 A JP40518290 A JP 40518290A JP H04220727 A JPH04220727 A JP H04220727A
Authority
JP
Japan
Prior art keywords
character
intermediate text
parallel
vectorization
assignment statement
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
JP40518290A
Other languages
Japanese (ja)
Inventor
Osamu Nakanoya
仲野谷修
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 Solution Innovators Ltd
Original Assignee
NEC Solution Innovators 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 NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP40518290A priority Critical patent/JPH04220727A/en
Publication of JPH04220727A publication Critical patent/JPH04220727A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the program execution time of a vector processor by vectorizing a character substitute statement which are not vectorized before. CONSTITUTION:A compiler 2 consists of a syntax analysis part 22 and a code generation part 23. A vectoization part 22 is equipped with a condition decision part 221 which decides whether or not the character substitute statement meet conditions of parallel execution and a loop constitution part 222 which regards the character substitute statement meeting the conditions as an array of integer types and makes the substitute statement into a loop, which is executed by the repetition of each element of the array of integer types, to constitute a 2nd intermediate text 25. Consequently, the character substitute statement can be vectorized so that a source program is processed in a parallel executable state.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

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

【0002】0002

【従来の技術】従来、ベクトル演算機能を有するベクト
ルプロセッサには、文字型演算を直接実行するベクトル
命令は備えられていない。このため、文字代入文は、ベ
クトル化の対象から外されており、その部分はスカラ命
令によって実行されていた。
2. Description of the Related Art Conventionally, vector processors having vector operation functions are not equipped with vector instructions for directly executing character operations. For this reason, character assignment statements are excluded from vectorization, and those portions are executed using scalar instructions.

【0003】0003

【発明が解決しようとする課題】ベクトル演算機能を有
するベクトルプロセッサにおいては、一般に、目的プロ
グラムのうちのベクトル命令によって実行される部分の
割合を大きくすればするほど、実行時間を短縮すること
ができる。ところが、上述の従来技術では、文字代入文
は、ベクトル化できず、スカラ命令で実行されるため実
行時間を短縮できないという欠点がある。
[Problem to be Solved by the Invention] In a vector processor having a vector operation function, the execution time can generally be reduced as the proportion of the part of the target program that is executed by vector instructions is increased. . However, in the above-mentioned conventional technology, character assignment statements cannot be vectorized and are executed using scalar instructions, so there is a drawback that execution time cannot be shortened.

【0004】また、文字代入文を人手によって並列実行
に適合するように書き直すことによりベクトル化するこ
とも可能であるが、書き直し可能な文字代入文の発見や
プログラムの書き直しに多大な時間を必要とし、更に書
き直し時に誤りを生むおそれがあるという欠点がある。
[0004]Also, it is possible to vectorize character assignment statements by manually rewriting them to suit parallel execution, but it takes a lot of time to find rewriteable character assignment statements and rewrite the program. , there is a further drawback that there is a risk of errors occurring during rewriting.

【0005】[0005]

【課題を解決するための手段】本発明は、ベクトル演算
機能を有するベクトルプロセッサに対して、高級言語で
書かれたソースプログラムを読み込み、構文解析を行っ
て第1の中間テキストを構成する構文解析部と、前記第
1の中間テキストから並列実行可能部分の認識を行いか
つ第2の中間テキストを生成するベクトル化部と、前記
第2の中間テキストから目的プログラムを生成して出力
するコード生成部から構成されたコンパイラのベクトル
化処理方式において、前記ベクトル化部は、文字代入文
について並列実行可能な条件を満足するかどうかを判定
する条件判定部と、前記条件判定部で並列実行可能と判
定された文字代入文について、文字型要素を整数型の配
列とみなし、かつ代入文を整数型の配列の1要素毎の繰
り返しで実行するループとして前記第2の中間テキスト
を構成することにより、文字代入文をベクトル化するル
ープ構成部を備えることを特徴とするものである。
[Means for Solving the Problems] The present invention provides a syntactic analysis method that reads a source program written in a high-level language into a vector processor having a vector calculation function, performs syntactic analysis, and constructs a first intermediate text. a vectorization unit that recognizes a parallel executable portion from the first intermediate text and generates a second intermediate text; and a code generation unit that generates and outputs a target program from the second intermediate text. In the compiler vectorization processing method, the vectorization unit includes a condition determination unit that determines whether a character assignment statement satisfies a condition that can be executed in parallel, and a condition determination unit that determines that parallel execution is possible. Regarding the character assignment statement, the character type element is regarded as an integer type array, and the second intermediate text is constructed as a loop that executes the assignment statement by repeating each element of the integer type array. The present invention is characterized in that it includes a loop component that vectorizes an assignment statement.

【0006】[0006]

【実施例】次に本発明について図面を参照して詳細に説
明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be explained in detail with reference to the drawings.

【0007】図1は、本発明の一実施例に使用するコン
パイラの機能ブロック図である。図中、コンパイラ2は
、高級言語で書かれたソースプログラム1を読み込み、
構文解析を行って第1の中間テキスト24を生成する構
文解析部21と、第1の中間テキスト24から並列実行
可能部分の認識を行いかつ第2の中間テキスト25を生
成するベクトル化部22と、第2の中間テキスト25か
ら目的プログラム3を生成して出力するコード生成部2
3から構成されており、更に、上記ベクトル化部22は
、文字代入文に対して並列実行可能な条件を満足するか
どうかを判定する条件判定部221と、上記条件判定部
221で並列実行可能と判定された文字代入文について
、文字型要素を整数型の配列とみなし、かつ代入文を整
数型の配列の1要素毎の繰り返しで実行するループとし
て第2の中間テキスト25を構成するループ構成部22
2とを備えている。
FIG. 1 is a functional block diagram of a compiler used in one embodiment of the present invention. In the figure, a compiler 2 reads a source program 1 written in a high-level language,
a syntactic analysis unit 21 that performs syntactic analysis to generate a first intermediate text 24; a vectorization unit 22 that recognizes parallel executable portions from the first intermediate text 24 and generates a second intermediate text 25; , a code generation unit 2 that generates and outputs the target program 3 from the second intermediate text 25;
The vectorization unit 22 further includes a condition determination unit 221 that determines whether a character assignment statement satisfies a condition that can be executed in parallel, and a condition determination unit 221 that allows parallel execution. For the character assignment statement determined to be, the second intermediate text 25 is configured as a loop that regards the character type element as an integer type array and executes the assignment statement by repeating each element of the integer type array. Part 22
2.

【0008】コンパイラ2内の構文解析部21は、ソー
スプログラム1を読み込み第1の中間テキスト24を生
成する。例えば、図2のソースプログラムに対して図3
の第1の中間テキストを生成する。ベクトル化部22は
、第1の中間テキストから並列実行可能部分の認識を行
い、かつ並列実行可能部分に対して第1の中間テキスト
を変更した図4のような第2の中間テキスト25を生成
する。コード生成部23は、第2の中間テキストから目
的プログラム3を生成して出力する。
A syntax analysis unit 21 in the compiler 2 reads the source program 1 and generates a first intermediate text 24 . For example, for the source program in Figure 2,
A first intermediate text is generated. The vectorization unit 22 recognizes the parallel executable portion from the first intermediate text, and generates a second intermediate text 25 as shown in FIG. 4 in which the first intermediate text is changed for the parallel executable portion. do. The code generation unit 23 generates and outputs the target program 3 from the second intermediate text.

【0009】ベクトル演算機能を備えるベクトルプロセ
ッサに対するコンパイラは、図1のような構成をしてお
り、与えられたソースプログラムを可能な限り並列実行
可能な形で目的プログラムに変換することが望まれる。 しかし、図5のようなソースプログラムが与えられたと
すると、これは、文字代入文であるため、並列実行不可
としてスカラ命令による順次実行を余儀なくされていた
A compiler for a vector processor equipped with a vector calculation function has a configuration as shown in FIG. 1, and is desired to convert a given source program into a target program in a form that can be executed in parallel as much as possible. However, given a source program as shown in FIG. 5, since it is a character assignment statement, it cannot be executed in parallel and must be executed sequentially using scalar instructions.

【0010】本発明においては、図5のような文字代入
文を含むソースプログラムが与えられた場合においても
、文字型要素を整数型の配列とみなし、かつ代入文を整
数型の配列の1要素毎の繰り返しで実行するループとす
ることにより、並列実行可能な形で処理するようにして
いる。例えば、図5にソースプログラムでは、図6に示
すように、文字型変数CH1*256とCH2*256
を整数型配列IA(64)とIB(64)とみなし、か
つ代入文をIA(I),IB(I)を含む繰り返し数6
4のループとすることにより、この文字代入文がベクト
ル長64で並列実行可能となる。
In the present invention, even when a source program including a character assignment statement as shown in FIG. By creating a loop that executes each iteration, processing can be executed in parallel. For example, in the source program shown in Figure 5, as shown in Figure 6, character type variables CH1*256 and CH2*256
are assumed to be integer type arrays IA(64) and IB(64), and the assignment statement includes IA(I) and IB(I) with a repetition count of 6.
By creating a loop of 4, this character assignment statement can be executed in parallel with a vector length of 64.

【0011】図5のソースプログラムから図7に示す第
1の中間テキストが得られ、ベクトル化部22に入力さ
れ、文字代入文が認識されると、条件判定部221は次
の処理を行う。
When the first intermediate text shown in FIG. 7 is obtained from the source program shown in FIG. 5 and input to the vectorization section 22 and the character assignment statement is recognized, the condition determination section 221 performs the following processing.

【0012】(1) 文字代入文に対する第1の中間テ
キストから、左辺と右辺の文字型要素の長さを取り出す
(1) Extract the lengths of the character type elements on the left and right sides from the first intermediate text for the character assignment statement.

【0013】(2) 左辺と右辺の文字型要素の長さが
等しく、かつその長さが整数型要素の1要素の長さで割
り切れれば並列実行可能と判定する。長さが上記条件を
満たさなければ並列実行不可と判定する。本実施例では
、整数型要素の1要素の長さを4と仮定している。
(2) If the lengths of the character type elements on the left and right sides are equal and the length is divisible by the length of one integer type element, it is determined that parallel execution is possible. If the length does not satisfy the above conditions, it is determined that parallel execution is not possible. In this embodiment, it is assumed that the length of one integer type element is 4.

【0014】条件判定部221で並列実行可能と判定さ
れた文字代入文に対して、ループ構成部222は次の処
理を行う。
For the character assignment statement determined by the condition determination unit 221 to be executable in parallel, the loop configuration unit 222 performs the following processing.

【0015】(1) 各文字型要素について整数型配列
を作成し、文字型要素と置き換える。ここで作成する整
数型配列の次元数は文字型要素の次元数+1であり、そ
の追加する次元の寸法は文字型要素の長さ/整数型要素
の1要素の長さである。本実施例では、整数型配列の次
元数は1、寸法は64となる。
(1) Create an integer type array for each character type element and replace it with the character type element. The number of dimensions of the integer type array created here is the number of dimensions of the character type element + 1, and the dimension of the added dimension is the length of the character type element/the length of one element of the integer type element. In this embodiment, the number of dimensions of the integer type array is 1 and the size is 64.

【0016】(2) ベクトル長が文字型要素の長さ/
整数型要素の1要素の長さになるように図8に示す第2
の中間テキストを構成する。本実施例では、ベクトル長
64となる。
(2) The vector length is the length of the character type element/
The second part shown in Figure 8 is set to have the length of one integer type element.
Construct intermediate text. In this embodiment, the vector length is 64.

【0017】以上のようにして、本発明においては、文
字代入文をベクトル化することができる。
As described above, according to the present invention, a character assignment statement can be vectorized.

【0018】[0018]

【発明の効果】以上説明したように、本発明では、従来
ベクトル化していなかった文字代入文をベクトル化する
ため、ベクトルプロセッサにおいてプログラムの実行時
間を短縮するという効果がある。
As described above, the present invention has the effect of reducing the program execution time in a vector processor because character assignment statements that have not been vectorized in the past are vectorized.

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

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

【図2】図2中のソースプログラムの一例を示す図であ
る。
FIG. 2 is a diagram showing an example of the source program in FIG. 2;

【図3】図2のソースプログラムがコンパイラに処理さ
れる様態を示す説明図である。
FIG. 3 is an explanatory diagram showing how the source program in FIG. 2 is processed by a compiler.

【図4】図2のソースプログラムがコンパイラに処理さ
れる様態を示す説明図である。
FIG. 4 is an explanatory diagram showing how the source program in FIG. 2 is processed by a compiler.

【図5】図2中のソースプログラムの他の例を示す図で
ある。
FIG. 5 is a diagram showing another example of the source program in FIG. 2;

【図6】図5のソースプログラムを変形することで文字
代入文を並列実行可能にできることを示す図である。
6 is a diagram showing that character assignment statements can be executed in parallel by modifying the source program of FIG. 5; FIG.

【図7】図5のソースプログラムに対する第1の中間テ
キストを示す図である。
FIG. 7 shows a first intermediate text for the source program of FIG. 5;

【図8】図5のソースプログラムに対する第2の中間テ
キストを示す図である。
FIG. 8 is a diagram showing a second intermediate text for the source program of FIG. 5;

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

1    ソースプログラム 2    コンパイラ 3    目的プログラム 21    構文解析部 22    ベクトル化部 23    コード生成部 24    第1の中間テキスト 25    第2の中間テキスト 221    条件判定部 222    ループ構成部 1 Source program 2 Compiler 3. Purpose program 21 Syntax analysis section 22 Vectorization section 23 Code generation section 24 First intermediate text 25 Second intermediate text 221 Condition judgment section 222 Loop component

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  ベクトル演算機能を有するベクトルプ
ロセッサに対して、高級言語で書かれたソースプログラ
ムを読み込み、構文解析を行って第1の中間テキストを
構成する構文解析部と、前記第1の中間テキストから並
列実行可能部分の認識を行いかつ第2の中間テキストを
生成するベクトル化部と、前記第2の中間テキストから
目的プログラムを生成して出力するコード生成部から構
成されたコンパイラのベクトル化処理方式において、前
記ベクトル化部は、文字代入文について並列実行可能な
条件を満足するかどうかを判定する条件判定部と、前記
条件判定部で並列実行可能と判定された文字代入文につ
いて、文字型要素を整数型の配列とみなし、かつ代入文
を整数型の配列の1要素毎の繰り返しで実行するループ
として前記第2の中間テキストを構成することにより、
文字代入文をベクトル化するループ構成部を備えること
を特徴とするベクトル化処理方式。
1. A vector processor having a vector calculation function, comprising: a syntax analysis unit that reads a source program written in a high-level language and performs syntax analysis to construct a first intermediate text; A vectorization compiler comprising a vectorization unit that recognizes parallel executable parts from text and generates a second intermediate text, and a code generation unit that generates and outputs a target program from the second intermediate text. In the processing method, the vectorization unit includes a condition determination unit that determines whether a character assignment statement satisfies a condition that can be executed in parallel, and a character assignment statement determined by the condition determination unit to be able to be executed in parallel. By regarding the type elements as an integer type array and configuring the second intermediate text as a loop that executes the assignment statement repeatedly for each element of the integer type array,
A vectorization processing method characterized by comprising a loop component that vectorizes a character assignment statement.
JP40518290A 1990-12-21 1990-12-21 Vectorization processing system Pending JPH04220727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP40518290A JPH04220727A (en) 1990-12-21 1990-12-21 Vectorization processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP40518290A JPH04220727A (en) 1990-12-21 1990-12-21 Vectorization processing system

Publications (1)

Publication Number Publication Date
JPH04220727A true JPH04220727A (en) 1992-08-11

Family

ID=18514809

Family Applications (1)

Application Number Title Priority Date Filing Date
JP40518290A Pending JPH04220727A (en) 1990-12-21 1990-12-21 Vectorization processing system

Country Status (1)

Country Link
JP (1) JPH04220727A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0895957A (en) * 1994-09-21 1996-04-12 Nec Software Ltd Vectorization processing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0895957A (en) * 1994-09-21 1996-04-12 Nec Software Ltd Vectorization processing method

Similar Documents

Publication Publication Date Title
JPH0795274B2 (en) Array subscript analysis method
Walsh et al. Paragen: a novel technique for the autoparallelisation of sequential programs using gp
JPH05189472A (en) Vectorization processing system for compiler
JPH11167492A (en) Array summary analyzing method for loop containing skip-out sentence
JPH04220727A (en) Vectorization processing system
JPH0540780A (en) Vectorizing processing system
JP2956591B2 (en) Method and apparatus for parallelizing a loop having a conditional jump out of the loop
JPH09282173A (en) Static analysis method for program
JPH0895957A (en) Vectorization processing method
Rus et al. An algebraic language processing environment
JPH06290206A (en) Vectorization systen
JPH0497484A (en) Vectorization processing system for compiler
JPS6358574A (en) Vector transformation processing system
JPH0512033A (en) Parallel compiling system
JP2801193B2 (en) Vectorization processing device for induction variables
JPH04295960A (en) Vectorize processing system for compiler
JPH0269867A (en) Vectorizing system
JP2870218B2 (en) Parallel execution instruction sequence generation method
JPH04343140A (en) Parallelized processing system
JPH05120323A (en) System for optimizing vector calculation under if sentence
JPS61285544A (en) Program executing method
JPH06266561A (en) Method and system for inspecting type of program
JPH05257707A (en) Compiling system
JPH04163631A (en) Compiler
van Eijk Systematically Constructing a CCS Interpreter