JPH11120166A - Vectorization device and storage medium - Google Patents

Vectorization device and storage medium

Info

Publication number
JPH11120166A
JPH11120166A JP9287442A JP28744297A JPH11120166A JP H11120166 A JPH11120166 A JP H11120166A JP 9287442 A JP9287442 A JP 9287442A JP 28744297 A JP28744297 A JP 28744297A JP H11120166 A JPH11120166 A JP H11120166A
Authority
JP
Japan
Prior art keywords
clause
sentence
statement
source program
replaced
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
JP9287442A
Other languages
Japanese (ja)
Inventor
Hiroko Iida
浩子 飯田
Motoyuki Suzuki
基之 鈴木
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 JP9287442A priority Critical patent/JPH11120166A/en
Publication of JPH11120166A publication Critical patent/JPH11120166A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To vectorize a processing for finding a maximum value and a minimum value and to perform acceleration by replacing if sentence/then node/else node for enabling the vectorization of a loop sentence in a source program or a sentence replaced from the source program with if sentence/then node. SOLUTION: A loop sentence vectorization processing means 5 judges whether or not the sentence for substituting the same value to the if sentence/then node/ else node and a then node or the else node is present in a loop based on the result of morpheme analysis and syntax analysis in the source program 1 or the sentence replaced from the source program 1. In the case of judging that it is present by the judgement, the if sentence/then node/else node is replaced with the if sentence/then node. Thus, the processing for finding the maximum value and the minimum value is vectorized and the acceleration is performed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、ソースプログラム
あるいはソースプログラムから置き換えた文のベクトル
化を可能にするベクトル化装置および記録媒体に関する
ものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a vectorization apparatus and a recording medium which enable vectorization of a source program or a sentence replaced from a source program.

【0002】[0002]

【従来の技術】従来、例えばC言語で最大値あるいは最
小値を求める場合、ループ中に三項演算子(?:)で書
かれる条件式が図5の(a)の(1)に示すように使っ
ている。この図5の(a)の(1)の三項演算子は、図
5の(b)の(1)’に示すように、if文/then
節/else節の形に置き換え、図5の(c)に示すよ
うな中間テキストイメージにすることができる。
2. Description of the Related Art Conventionally, for example, when a maximum value or a minimum value is obtained in C language, a conditional expression written by a ternary operator (? :) in a loop is as shown in (1) of FIG. We use for. The ternary operator of (1) in FIG. 5A is represented by an if statement / then as shown in (1) ′ of FIG. 5B.
It can be replaced with a clause / else clause to provide an intermediate text image as shown in FIG.

【0003】しかし、このif文/then節/els
e節が存在するとベクトル化して高速化を図ることがで
きない。以下簡単に説明する。図5は、従来技術の説明
図を示す。
However, this if sentence / then clause / els
If the e-node is present, it cannot be speeded up by vectorization. This will be briefly described below. FIG. 5 shows an explanatory diagram of the prior art.

【0004】図5の(a)は、C言語で最大値を求める
ソースプログラムの例を示す。ここでは、i=0、1、
2・・・9までの10回繰り返し、l[i]という配列
中の値を順次取り出してそのうちの最大値を求めるため
のソースプログラムであって、(1)の部分が三項演算
子と呼ばれるものである。
FIG. 5A shows an example of a source program for finding the maximum value in C language. Here, i = 0, 1,
This is a source program for retrieving values in an array of l [i] sequentially and obtaining the maximum value among them by repeating 10 times from 2 to 9. The part (1) is called a ternary operator. Things.

【0005】図5の(b)は、図5の(a)の(1)の
三項演算子の部分を(1)’のif文/then節/e
lse節に置き換えた後のソースプログラムを示す。図
5の(c)は、図5の(b)のソースプログラムを形態
素解析/構文解析して内部の中間言語に変換した後のイ
メージを示す。ここでは、図5の(b)の(1)’のi
f文/then節/else節が図示の(1)’’のよ
うに内部の中間言語に変換されている。
FIG. 5 (b) shows the part of the ternary operator of (1) of FIG. 5 (a) as an if statement / then clause / e of (1) '.
Here is the source program after it has been replaced with the 1se clause. FIG. 5C shows an image after the source program of FIG. 5B has been converted into an internal intermediate language by morphological analysis / syntax analysis. Here, i of (1) ′ in FIG.
The f-sentence / then-clause / else-clause is converted into an internal intermediate language as shown in (1) '' in the figure.

【0006】[0006]

【発明が解決しようとする課題】上述したようにソース
プロラムのループ中に三項演算子があるとこれがif文
/then節/else節と置き換えできるがこのif
文/then節/else節ではベクトル化できなく、
高速化が図れないという問題があった。
As described above, if there is a ternary operator in the loop of the source program, this can be replaced with an if statement / then clause / else clause.
Sentence / then clause / else clause cannot be vectorized,
There was a problem that high speed could not be achieved.

【0007】本発明は、これらの問題を解決するため、
ソースプログラムあるいはソースプログラムから置き換
えた文を解析してループ中にif文がありかつ回避分岐
/正規分岐で同じ値を代入すると判明したときにif文
/then節に置換してベクトル化可能にして高速化を
図ることを目的としている。
[0007] The present invention solves these problems,
The source program or a statement replaced from the source program is analyzed, and if it is found that there is an if statement in the loop and the same value is substituted in the avoidance branch / normal branch, the statement is replaced with an if statement / then clause to enable vectorization. The purpose is to increase the speed.

【0008】[0008]

【課題を解決するための手段】図1を参照して課題を解
決するための手段を説明する。図1において、ソースプ
ログラム1は、コンパイル対象のソースプログラムであ
って、ここでは、ベクトル化対象のソースプログラムで
ある。
Means for solving the problem will be described with reference to FIG. In FIG. 1, a source program 1 is a source program to be compiled, and here is a source program to be vectorized.

【0009】ループ文ベクトル化処理手段5は、ソース
プログラム1あるいはソースプログラムから置き換えた
文中のループ文のベクトル化可能にするためのif文/
then節/else節をif文/then節に置換す
るものである。
The loop statement vectorization processing means 5 includes an if statement / vector for enabling a loop statement in a source program 1 or a statement replaced from the source program to be vectorized.
It replaces the then clause / else clause with the if sentence / then clause.

【0010】次に、動作を説明する。ループ文ベクトル
化処理手段5がソースプログラム1あるいはソースプロ
グラム1から置き換えた文を解析してループ中にif文
/then節/else節があり、かつthen節ある
いはelse節に同じ値を代入する文があるか否かを判
定し、ありと判定された場合にif文/then節/e
lse節をif文/then節に置換するようにしてい
る。
Next, the operation will be described. The loop statement vectorization processing means 5 analyzes the source program 1 or a statement replaced from the source program 1, and includes a if statement / then clause / else clause in the loop and substitutes the same value in the then clause or else clause. It is determined whether or not there is, and if it is determined that there is, if statement / then clause / e
The "lse" clause is replaced with the "if" / then clause.

【0011】この際、if文/then節/else節
として最大値あるいは最小値を求めるときに使用するi
f文/then節/else節を見つけるようにしてい
る。従って、ソースプログラム1あるいはソースプログ
ラム1から置き換えた文を解析してループ中にif文が
ありかつ回避分岐/正規分岐で同じ値を代入すると判明
したときにif文/then節/else節をif文/
then節に置換してベクトル化できるようにすること
が可能となる。
[0011] At this time, i used when obtaining the maximum value or the minimum value as an if sentence / then clause / else clause.
It tries to find f sentence / then clause / else clause. Therefore, if the source program 1 or a statement replaced from the source program 1 is analyzed and an if statement is found in the loop and it is determined that the same value is substituted in the avoidance branch / normal branch, the if statement / then clause / else clause is replaced with the if statement. Sentence/
It becomes possible to perform vectorization by replacing with a then clause.

【0012】[0012]

【発明の実施の形態】次に、図1から図4を用いて本発
明の実施の形態および動作を順次詳細に説明する。ここ
で、図示外の記録媒体あるいは外部記憶装置であるハー
ドディスク装置などから読み出したプログラム、あるい
はセンタの外部記憶装置から回線を介して転送を受けた
プログラムを主記憶にローディングして起動し、以下に
説明する各種処理を実行するようにしている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, embodiments and operations of the present invention will be sequentially described in detail with reference to FIGS. Here, a program read from a recording medium (not shown) or a hard disk device as an external storage device, or a program transferred from an external storage device of the center via a line is loaded into the main storage and started up. Various processes to be described are executed.

【0013】図1は、本発明のシステム構成図を示す。
図1において、ソースプログラム1は、コンパイル対象
のソースプログラムであって、ここでは、ベクトル化対
象のソースプログラムであり、例えば後述する図4の
(a)のC言語のソースプログラムである。
FIG. 1 shows a system configuration diagram of the present invention.
In FIG. 1, a source program 1 is a source program to be compiled, and here is a source program to be vectorized, for example, a C language source program in FIG.

【0014】処理装置2は、プログラムに従い各種処理
を行うものであって、ここでは、図示のように、プログ
ラム入力手段3、ベクトル化処理手段4、ベクトル化最
適手段9、オブジェクト生成手段10などから構成され
るものである。
The processing device 2 performs various processes in accordance with a program. As shown in FIG. 1, the processing device 2 includes a program input unit 3, a vectorization processing unit 4, a vectorization optimization unit 9, an object generation unit 10, and the like. It is composed.

【0015】プログラム入力手段3は、ソースプログラ
ム1を取り込むものである。ベクトル化処理手段4は、
プログラム入力手段3によって取り込んだソースプログ
ラム1について形態素解析、構文解析などを行った後、
ベクトル化処理を行うものであって、ここでは、ループ
文ベクトル化処理手段5などから構成されるものであ
る。
The program input means 3 takes in the source program 1. The vectorization processing means 4
After performing morphological analysis and syntax analysis on the source program 1 captured by the program input means 3,
It performs vectorization processing, and in this case, is composed of loop statement vectorization processing means 5 and the like.

【0016】ループ文ベクトル化処理手段5は、ソース
プログラム1あるいはソースプログラム1から置き換え
た文について、形態素解析および構文解析された結果を
もとに、ループ文のベクトル化可能にするためのif文
/then節/else節をif文/then節に置換
するものであって、ここでは、最大値/最小値認識手段
6、最大値/最小値確定手段7、およびループ構成変更
手段8などから構成されるものである。
The loop statement vectorization processing means 5 generates an if statement for enabling the vectorization of a loop statement based on the result of morphological analysis and syntax analysis of the source program 1 or the statement replaced from the source program 1. It replaces the / then clause / else clause with an if sentence / then clause, and here is composed of a maximum value / minimum value recognition means 6, a maximum value / minimum value determination means 7, a loop configuration change means 8, and the like. Is what is done.

【0017】最大値/最小値認識手段6は、ソースプロ
グラム1のループ文(例えばFOR文)中の最大値ある
いは最小値を求める部分を解析して見つけるものである
(図2のS1参照)。
The maximum value / minimum value recognizing means 6 analyzes and finds a part for obtaining the maximum value or the minimum value in a loop statement (for example, a FOR statement) of the source program 1 (see S1 in FIG. 2).

【0018】最大値/最小値確定手段7は、最大値/最
小値認識手段6によって見つけたループ中の最大値ある
いは最小値を求める部分について、所定の条件を満たし
ているか否かを判定して確定するものである(図2のS
1ないしS3参照)。
The maximum value / minimum value determination means 7 determines whether or not a portion for finding the maximum value or the minimum value in the loop found by the maximum value / minimum value recognition means 6 satisfies a predetermined condition. (S in FIG. 2)
1 to S3).

【0019】ループ構成変更手段8は、最大値/最小値
確定手段7によって所定の条件を満たしていると確定さ
れたときに、if文/then節/else節をif文
/then節に置換してベクトル化可能にするものであ
る(図2のS4参照)。
When the maximum / minimum value determining means 7 determines that the predetermined condition is satisfied, the loop configuration changing means 8 replaces the if sentence / then clause / else clause with the if sentence / then clause. To enable vectorization (see S4 in FIG. 2).

【0020】ベクトル化最適手段9は、ベクトル化処理
手段4によってベクトル化された後にベクトル化の最適
化を行うものである。オブジェクト生成手段10は、ベ
クトル化最適手段9によってベクトル化の最適化が行わ
れた後、実行可能形式のオブジェクト11を生成するも
のである。
The vectorization optimizing means 9 optimizes the vectorization after the vectorization by the vectorization processing means 4. The object generation unit 10 generates an object 11 in an executable format after the optimization of the vectorization is performed by the vectorization optimization unit 9.

【0021】オブジェクト11は、実行可能形式のオブ
ジェクト(ロードモジュール)である。次に、図2のフ
ローチャートに示す順序に従い、図1の本発明のループ
文ベクトル化処理手段5の動作を詳細に説明する。
The object 11 is an executable object (load module). Next, the operation of the loop statement vectorization processing means 5 of the present invention of FIG. 1 will be described in detail according to the order shown in the flowchart of FIG.

【0022】図2は、本発明の動作説明フローチャート
を示す。図2において、S1は、ループ中に最大値/最
小値を求めている部分(文)があるか判別する。YES
の場合、例えば後述する図4の(a)中の(1)の三項
演算子による最大値を求める部分(文)があるのでYE
Sとなり、S2に進む。S1のNOの場合には、ループ
中に最大値あるいは最小値を求めている部分ガ無いと判
明したので、終了する。
FIG. 2 is a flowchart illustrating the operation of the present invention. In FIG. 2, S1 determines whether there is a part (sentence) for which the maximum value / minimum value is found in the loop. YES
In the case of, for example, there is a part (sentence) for obtaining the maximum value by the ternary operator of (1) in FIG.
It becomes S, and it proceeds to S2. In the case of NO in S1, it is determined that there is no part for which the maximum value or the minimum value is found in the loop, and the processing is ended.

【0023】S2は、回避分岐命令(回避分岐ルート)
あるいは正規命令(正規ルート)のどちらかに同じ値を
代入する(j=j;)が現れているか判別する。YES
の場合、例えば後述する図4の(b)の(1)’のth
en節のMOVE j,jがありYESとなり、S3に
進む。S2のNOの場合には、回避分岐命令(回避分岐
ルート)あるいは正規命令(正規ルート)のどちらかに
同じ値を代入する(j=j;)が現れていないと判明し
たので、終了する。
S2 is a bypass branch instruction (a bypass branch route)
Alternatively, it is determined whether the same value (j = j;) is assigned to one of the regular instructions (regular route). YES
In the case of, for example, th of (1) ′ in FIG.
There is MOVE j, j in the en clause, and the result is YES, and the process proceeds to S3. In the case of NO in S2, it is determined that the same value is not assigned (j = j;) to either the avoidance branch instruction (the avoidance branch route) or the normal instruction (the normal route), and the process ends.

【0024】S3は、正規ルートにgoto言(got
o文)が現れているか判別する。YESの場合、例えば
後述する図4の(b)のthen節中のGOTO #3
がありYESとなり、S4に進む。S3のNOの場合に
は、正規ルートにgoto言(goto文)が現れてい
ないと判明したので、終了する。
In step S3, the normal route is referred to as a goto statement (got
o statement) appears. In the case of YES, for example, GOTO # 3 in the then clause of FIG.
YES, and the process proceeds to S4. In the case of NO in S3, it is determined that the goto statement (goto sentence) does not appear on the regular route, and the process ends.

【0025】S4は、ループ中のif文/then節/
else節の構造を、if文/then節の構造に変更
する。これは、例えば後述する図3の(b)のif文/
then節/else節の構造を、図3の(c)のif
文/then節の構造に変更し、ベクトル化可能にす
る。
In step S4, if statement / then clause /
The structure of the else clause is changed to the structure of an if sentence / then clause. This corresponds to, for example, an if sentence /
The structure of the then / else clause is shown in FIG.
The structure is changed to a sentence / then clause to enable vectorization.

【0026】以上によって、例えば後述する図4の
(a)のソースプログラム1中にS1の最大値/最小値
を求める部分(文)があり、かつS2の回避分岐ルート
(回避分岐命令)あるいは正規ルート(正規分岐命令)
があり、かつS3の正規ルートにgoto文がある場合
に、S4のループ中のif文/then節/else節
をif文/else節に変更してベクトル化できるよう
に変更することが可能となる。
As described above, for example, in the source program 1 of FIG. 4A described later, there is a part (statement) for obtaining the maximum value / minimum value of S1 and the avoidance branch route (avoidance branch instruction) of S2 or the normal Route (normal branch instruction)
And if there is a goto statement in the regular route of S3, it is possible to change the if statement / then clause / else clause in the loop of S4 to an if statement / else clause so that it can be vectorized. Become.

【0027】図3は、本発明の概念説明図を示す。図3
の(a)は、ソースイメージ(変更前)を示す。これ
は、図4の(a)のソースプログラム中の三項演算子を
if文/then節/else節によって置き換えた後
のソースプログラムであって、図示のように、if文、
then節、else節から構成されるものである。
FIG. 3 is a conceptual explanatory diagram of the present invention. FIG.
(A) shows a source image (before change). This is a source program after the ternary operator in the source program of FIG. 4A is replaced by an if statement / then clause / else clause.
It consists of a then clause and an else clause.

【0028】図3の(a)において、S11は、回避分
岐命令があり、真のときはラベル#2のS14に分岐
し、偽のときはS12に進む。ここで、回避分岐命令
は、“[j]がl[i]より小さい場合に分岐先(#
2)へ飛ぶ”という命令であって、具体的には後述する
図4の(b)のif文の記述した文“BL #2,j,
T2”である。
In FIG. 3A, in S11, there is an avoidance branch instruction, and when true, the flow branches to S14 of label # 2, and when false, the flow proceeds to S12. Here, the avoidance branch instruction is a branch destination (#) when "[j] is smaller than l [i].
2). Specifically, the statement “BL # 2, j,
T2 ".

【0029】S12は、S11の偽の場合に実行し、
[j]を[j]に代入する。S13は、分岐先(#3)
へ飛ぶ。S14は、S11の真のときの分岐先(#2)
であって、l[i]を[j]に代入する。
S12 is executed when S11 is false,
[J] is substituted for [j]. S13 is the branch destination (# 3)
Fly to. S14 is the branch destination when S11 is true (# 2)
And substitute l [i] for [j].

【0030】S15は、S13の分岐先(#3)であっ
て、i=i+1する。S16は、終わりでないか判別す
る。真の場合には、S11に戻り繰り返す。偽の場合に
は、終了する。
S15 is the branch destination (# 3) of S13, where i = i + 1. In step S16, it is determined whether or not the processing is over. If true, return to S11 and repeat. If false, end.

【0031】以上のように、ソースイメージ(変更前)
は、後述する図4の(a)のソースプログラム1の
(1)の三項演算子の部分をif文/then節/el
se節に置き換え、既述した図2のS1ないしS3の条
件を満たす(S1の最大値を求める、S2の回避分岐ル
ート(回避分岐命令)があり、S3の正規ルートにgo
to言(goto文)があり)ので、図2のS4の変換
を行い、図3の(b)のソースイメージ(変換後)に置
換(if文/then節/else節をif文/the
n節に置換)する。
As described above, the source image (before the change)
Converts the part of the ternary operator of (1) of the source program 1 of FIG.
2 and satisfying the conditions of S1 to S3 in FIG. 2 described above (there is an avoidance branch route (avoidance branch instruction) of S2 for obtaining the maximum value of S1, and
(there is a to statement (goto statement)), so the conversion of S4 in FIG. 2 is performed, and the source image (after conversion) in FIG. 3B is replaced (the if statement / then clause / else clause is replaced with the if sentence / the
(Replace with clause n).

【0032】図3の(b)は、ソースイメージ(変換
後)を示す。これは、図3の(a)のソースイメージ
(変換前)が既述した図2のS1ないしS3の条件を満
たすので、図2のS4の置換を行ったものである。図3
の(b)において、S21は、回避分岐命令があり、真
のときはラベル#3のS23に分岐し、偽のときはS2
2に進む。ここで、回避分岐命令は、“[j]がl
[i]より大きい場合に分岐先(#3)へ飛ぶ”という
命令であって、具体的には後述する図4の(c)のif
文の記述した文“BGL #3,j,T2”である。
FIG. 3B shows a source image (after conversion). Since the source image (before conversion) of FIG. 3A satisfies the conditions of S1 to S3 of FIG. 2 described above, S4 of FIG. 2 is replaced. FIG.
In (b) of (a), in S21, there is an avoidance branch instruction, and when true, the flow branches to S23 of label # 3, and when false, S2
Proceed to 2. Here, the avoidance branch instruction is “[j] is l
If the value is larger than [i], the instruction jumps to the branch destination (# 3). "
The sentence is a sentence “BGL # 3, j, T2”.

【0033】S22は、S21の偽の場合に実行し、l
[i]を[j]に代入する。S23は、S21の真の場
合およびS22の次に実行し、i=i+1する。S24
は、終わりでないか判別する。真の場合には、S21に
戻り繰り返す。偽の場合には、終了する。
S22 is executed when the result of S21 is false.
[I] is substituted for [j]. S23 is executed when S21 is true and after S22, and i = i + 1. S24
Determines whether it is the end. If true, return to S21 and repeat. If false, end.

【0034】以上のように、ソースイメージ(変更後)
は、後述する図4の(b)のソースプログラム1の
(1)’のif文/then節/else節をif/t
hen節に置換したものである。この際、ソースイメー
ジ(変更後)のS21の回避分岐命令は“[j]がl
[i]より大きい場合に分岐先(#3)へ飛ぶ”が、ソ
ースイメージ(変更前)のS11の回避分岐命令は
“[j]がl[i]より小さい場合に分岐先(#2)へ
飛ぶ”というのと異なるようにし、その結果として図3
の(b)のS12の“[j]を[j]に代入する”を削
除し、if文/then節に置換できたものである(具
体的には図4の(b)、(c)を比較して参照)。
As described above, the source image (after the change)
Is the if statement / then clause / else clause of (1) ′ of the source program 1 of FIG.
hen clause. At this time, the avoidance branch instruction in S21 of the source image (after the change) is “[j] is l
"If the value is greater than [i], jump to branch destination (# 3)", but the avoidance branch instruction of S11 of the source image (before change) is "Branch destination (# 2) if [j] is less than l [i]. To "fly to". As a result, FIG.
(B) in step S12, "substitute [j] for [j]" was deleted and replaced with an if sentence / then clause (specifically, (b) and (c) in FIG. 4). Comparison).

【0035】図4は、本発明の実施例を示す。図4の
(a)は、C言語のソースイメージ例を示す。ここで
は、(1)の部分が三項演算子により最大値を求める文
である。この(1)の文は、if文/then節/el
se節で置き換えると、図4の(b)の(1)’の文と
なる。
FIG. 4 shows an embodiment of the present invention. FIG. 4A shows an example of a C language source image. Here, the part (1) is a sentence for obtaining the maximum value by the ternary operator. This sentence of (1) is an if sentence / then clause / el
When replaced with the se clause, the sentence of (1) ′ in FIG. 4B is obtained.

【0036】図4の(b)は、図4の(a)の(1)の
部分をif文/then節/else節で置き換えた後
のソースイメージ(変更前)を示す。ここで、(1)’
は、図4の(a)の(1)の文に対応している。
FIG. 4B shows a source image (before change) after the part (1) in FIG. 4A is replaced with an if sentence / then clause / else clause. Where (1) '
Corresponds to the sentence (1) in FIG.

【0037】図4の(c)は、図4の(b)のソースイ
メージ(変更前)の(1)’のif文/then節/e
lse節を、if文/then節に置換した後のソース
イメージ(変更後)を示す。ここで、(1)’’の部分
のif文/then節は、図4の(b)の(1)’のi
f文/then節/else節を置換したものである。
FIG. 4C shows the if statement / then clause / e of (1) ′ in the source image (before change) of FIG. 4B.
This shows the source image (after change) after replacing the “lse” clause with the “if” / then clause. Here, the if sentence / then clause of (1) ″ is the i statement of (1) ′ in (b) of FIG.
It replaces the f-sentence / then-else / else clause.

【0038】尚、図4の(b)、(c)は等価の文であ
って、T1、T3は配列から最大値を求める対象の値を
読み出すためのアドレスを求めて格納するためのテンポ
ラリメモリである。T2はT1あるいはT3のアドレス
によって読み出した最大値を求める対象の値を格納する
テンポラリメモリである。iはループ変数であり、jは
現在の最大値を保持する変数である。#2、#3はジャ
ンプ先のラベルである。MULTは乗算命令、LOAD
はロード命令、BLは回避分岐命令(図3の(a)のS
11)、MOVEは代入命令、GOTOは分岐命令、B
LTは分岐命令、BGLは回避分岐命令(図3の(c)
のS21)をそれぞれ表す。これら各命令の単独の動作
は、C言語としてそれぞれ公知のものである。
4 (b) and 4 (c) are equivalent sentences, and T1 and T3 are temporary memories for obtaining and storing an address for reading a value for which a maximum value is to be obtained from an array. It is. T2 is a temporary memory for storing a value for which a maximum value read at the address of T1 or T3 is to be obtained. i is a loop variable, and j is a variable holding the current maximum value. # 2 and # 3 are jump destination labels. MULT is a multiplication instruction, LOAD
Is a load instruction, and BL is an avoidance branch instruction (S in FIG.
11), MOVE is an assignment instruction, GOTO is a branch instruction, B
LT is a branch instruction, and BGL is an avoidance branch instruction ((c) in FIG. 3).
S21). The independent operation of each of these instructions is known as C language.

【0039】[0039]

【発明の効果】以上説明したように、本発明によれば、
ソースプログラム1あるいはソースプログラム1から置
き換えた文を解析してループ中にif文がありかつ回避
分岐/正規分岐で同じ値を代入すると判明したときにi
f文/then節/else節をif文/then節に
置換する構成を採用しているため、ソースプログラム1
あるいはソースプログラムから置き換えた文のループ中
にif文/then節/else節があっても所定の条
件を満たす場合にif文/then節に置換でき、ベク
トル化することが可能となり、その結果、最大値や最小
値を求める処理のベクトル化を行って高速化を図ること
が可能となった。
As described above, according to the present invention,
The source program 1 or a statement replaced from the source program 1 is analyzed, and if it is found that there is an if statement in the loop and the same value is substituted in the avoidance branch / normal branch, i
Since the f statement / then clause / else clause is replaced with the if statement / then clause, the source program 1
Alternatively, even if an if-statement / then-clause / else-clause is present in a loop of a statement replaced from the source program, it can be replaced with an if-statement / then-clause if a predetermined condition is satisfied, and can be vectorized. Vectorization of the processing for obtaining the maximum value and the minimum value has been made possible, thereby achieving high speed.

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

【図1】本発明のシステム構成図である。FIG. 1 is a system configuration diagram of the present invention.

【図2】本発明の動作説明フローチャートである。FIG. 2 is a flowchart illustrating the operation of the present invention.

【図3】本発明の概念説明図である。FIG. 3 is a conceptual explanatory diagram of the present invention.

【図4】本発明の実施例である。FIG. 4 is an embodiment of the present invention.

【図5】従来技術の説明図である。FIG. 5 is an explanatory diagram of a conventional technique.

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

1:ソースプログラム 2:処理装置 3:プログラム入力手段 4:ベクトル化処理手段 5:ループ文ベクトル化処理手段 6:最大値/最小値認識手段 7:最大値/最小値確定手段 8:ループ構成変更手段 1: Source program 2: Processing device 3: Program input means 4: Vectorization processing means 5: Loop statement vectorization processing means 6: Maximum / minimum value recognition means 7: Maximum / minimum value determination means 8: Loop configuration change means

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】ソースプログラムあるいはソースプログラ
ムから置き換えた文のベクトル化を可能にするベクトル
化装置において、 上記ソースプログラムあるいはソースプログラムから置
き換えた文を解析してループ中にif文/then節/
else節があり、かつthen節あるいはelse節
に同じ値を代入する文があるか否かを判定する手段と、 上記ありと判定された場合に、上記if文/then節
/else節をif文/then節に置換する手段とを
備えたことを特徴とするベクトル化装置。
1. A vectorization apparatus for vectorizing a source program or a sentence replaced from a source program, wherein the sentence replaced from the source program or the source program is analyzed and an if statement / then clause /
means for determining whether there is an else clause and whether there is a statement that substitutes the same value in the then clause or else clause, and when it is determined that the above statement is present, the if statement / then clause / else clause is replaced by an if statement / Then clause.
【請求項2】上記if文/then節/else節とし
て最大値あるいは最小値を求めるときに使用するif文
/then節/else節としたことを特徴とする請求
項1記載のベクトル化装置。
2. The vectorization apparatus according to claim 1, wherein said if sentence / then clause / else clause is an if sentence / then clause / else clause used when obtaining a maximum value or a minimum value.
【請求項3】上記ソースプログラムあるいはソースプロ
グラムから置き換えた文を解析してループ中にif文/
then節/else節があり、かつthen節あるい
はelse節に同じ値を代入する文があるか否かを判定
する手段と、 上記ありと判定された場合に、上記if文/then節
/else節をif文/then節に置換する手段とし
て機能させるプログラムを記録したコンピュータ読み取
り可能な記録媒体。
3. The program according to claim 1, wherein the source program or a statement replaced from the source program is analyzed and an if statement /
means for determining whether there is a then / else clause and whether there is a statement that substitutes the same value in the then or else clause, and when it is determined that the statement exists, the if statement / then clause / else clause And a computer-readable recording medium storing a program that functions as a unit that replaces a sentence with an if sentence / then clause.
JP9287442A 1997-10-20 1997-10-20 Vectorization device and storage medium Pending JPH11120166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9287442A JPH11120166A (en) 1997-10-20 1997-10-20 Vectorization device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9287442A JPH11120166A (en) 1997-10-20 1997-10-20 Vectorization device and storage medium

Publications (1)

Publication Number Publication Date
JPH11120166A true JPH11120166A (en) 1999-04-30

Family

ID=17717385

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9287442A Pending JPH11120166A (en) 1997-10-20 1997-10-20 Vectorization device and storage medium

Country Status (1)

Country Link
JP (1) JPH11120166A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023139706A1 (en) * 2022-01-19 2023-07-27 日本電気株式会社 Processing device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05120323A (en) * 1991-10-28 1993-05-18 Nec Software Ltd System for optimizing vector calculation under if sentence

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05120323A (en) * 1991-10-28 1993-05-18 Nec Software Ltd System for optimizing vector calculation under if sentence

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SXシステムソフトウェア SUPER-UX FORTRAN90/SXプログラミングの手引 初版, JPNX006025976, 28 February 1995 (1995-02-28), JP, pages 57 - 66, ISSN: 0000746993 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023139706A1 (en) * 2022-01-19 2023-07-27 日本電気株式会社 Processing device

Similar Documents

Publication Publication Date Title
US9916145B2 (en) Utilizing special purpose elements to implement a FSM
JP2755154B2 (en) Program conversion processing device and program conversion processing method
US5652898A (en) Dictionary memory for text processing using word frequency and word recency occurrence information
US9786272B2 (en) Decoder for searching a digraph and generating a lattice, decoding method, and computer program product
CN110764744A (en) Intermediate representation generation method and device for neural network computation
US7917899B2 (en) Program development apparatus, method for developing a program, and a computer program product for executing an application for a program development apparatus
JPH0782544B2 (en) DP matching method and apparatus using multi-template
CN113508385B (en) Method and system for formal language processing using subroutine graph
CN116627429A (en) Assembly code generation method and device, electronic equipment and storage medium
KR102405578B1 (en) Context-Aware Cross-Sentence Relation Extraction Apparatus with Knowledge Graph, and Method Thereof
JPH11120166A (en) Vectorization device and storage medium
US4989162A (en) Method of using an accuracy valve in a conflict resolution of a forward inference
KR20080045545A (en) Method of pre-processing conditional region
Neto et al. Adaptive automata for syntax learning
JP2011113147A (en) Source analysis program, preprocessor, lexer and syntax tree analysis program
JPS6349856A (en) Generation of adjacent building data base
US11861171B2 (en) High-throughput regular expression processing with capture using an integrated circuit
US20230342304A1 (en) High-throughput regular expression processing with path priorities using an integrated circuit
KR102207775B1 (en) Method for Static Analysis based on Data Dependence on Data Plane Towards Network Switch Parallelization, and Parallelization Apparatus using the same
Beaudou et al. Complexity of conjunctive regular path query homomorphisms
JP2005234800A (en) Example machine translation device and example translation computer program, example retrieval device and example retrieval computer program
JPH11195011A (en) Language translation processor, language translation processing method and record medium recording language translation processing program
JPS5833775A (en) Compiling system for conditional statement for vector processor
CN114385242A (en) Method and device for taking over MIPS (Mobile industry processor System) architecture assembly instruction
CN117931204A (en) Method and apparatus for implementing built-in function API translations across ISAs

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060126

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060207

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060620