JPH05313910A - Machine word instruction generating system - Google Patents

Machine word instruction generating system

Info

Publication number
JPH05313910A
JPH05313910A JP11943592A JP11943592A JPH05313910A JP H05313910 A JPH05313910 A JP H05313910A JP 11943592 A JP11943592 A JP 11943592A JP 11943592 A JP11943592 A JP 11943592A JP H05313910 A JPH05313910 A JP H05313910A
Authority
JP
Japan
Prior art keywords
inline
machine language
language instruction
system function
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.)
Withdrawn
Application number
JP11943592A
Other languages
Japanese (ja)
Inventor
Haruto Hirozawa
治人 廣澤
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.)
KOBE NIPPON DENKI SOFTWARE KK
NEC Software Kobe Ltd
Original Assignee
KOBE NIPPON DENKI SOFTWARE KK
NEC Software Kobe 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 KOBE NIPPON DENKI SOFTWARE KK, NEC Software Kobe Ltd filed Critical KOBE NIPPON DENKI SOFTWARE KK
Priority to JP11943592A priority Critical patent/JPH05313910A/en
Publication of JPH05313910A publication Critical patent/JPH05313910A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To improve the executing speed of a system function by performing no evolution of a machine word instruction train which calls out the system function and by evolving the processing to be carried out by the function system with the machine word instruction train. CONSTITUTION:A machine word instruction generating system consists of a compiler control means 1 which controls an entire compiler, an in-line decision processing means 2, an in-line enable system function name list table 3, the in-line deciding result addition information 4, an in-line evolution processing means 5, and a machine word instruction train table 6. The means 2 compares an inputted function calling function name with the table 3 and sets the in-line unable information to the information 4 it the inputted function name is contained in the table 3. Then, the means 2 transfers its control to the syntactic meaning analyzing result output processing. As a result, an object having a high executing speed can be obtained.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、ソースプログラムをコ
ンパイルする際の機械語命令生成方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a machine language instruction generation system for compiling a source program.

【0002】[0002]

【従来の技術】従来の機械語命令生成方式では、システ
ム関数が、独立したコンパイルユニット単位でプログラ
マに提供されており、システム関数の実行が、関数呼び
出しの機械語命令列によって行われている。
2. Description of the Related Art In a conventional machine language instruction generation system, a system function is provided to a programmer in a unit of an independent compilation unit, and the system function is executed by a machine language instruction string of a function call.

【0003】[0003]

【発明が解決しようとする課題】上述した従来の機械語
命令生成方式は、システム関数の呼び出しに伴う機械語
命令列が必要であり、しかも、システム関数内では、シ
ステム関数に渡されるあらゆる引数に対して処理を行っ
ているので、システム関数に渡される引数に対する処理
を区別するための判定処理を行わなければならないな
ど、システム関数の実行時に、実質的な実行には、直接
関係のない命令を必要としており、実行速度の高いオブ
ジェクトを生成することができないという欠点を有して
いる。
The above-mentioned conventional machine language instruction generation method requires a machine language instruction sequence associated with the call of a system function, and furthermore, within the system function, all arguments passed to the system function are used. Since it is performing processing for the system function, the judgment processing for distinguishing the processing for the argument passed to the system function must be performed. It has the drawback that it cannot generate an object that is required and has a high execution speed.

【0004】[0004]

【課題を解決するための手段】本発明の機械語命令生成
方式は、ソースプログラムを読み込んで目的プログラム
を出力するコンパイラの機械語命令生成方式において、
プログラマに提供しているシステム関数を呼び出す機械
語命令を展開せずに、システム関数で行うべき処理を関
数呼び出しの代わりに機械語命令列でインライン展開す
るために、インライン展開を行うか否かを判断するイン
ライン判定処理手段と、インライン展開可能なシステム
関数名一覧テーブルと、前記インライン判定処理手段に
よるインライン展開を行うか否かの判断結果を保持する
インライン判定結果付加情報と、前記インライン判定結
果付加情報によりインライン用機械語命令列の展開を行
うインライン展開処理手段と、前記インライン展開処理
手段によって最適な機械語命令列を展開するための機械
語命令列テーブルとを備えて構成されている。
A machine language instruction generation system of the present invention is a machine language instruction generation system of a compiler which reads a source program and outputs an object program,
Whether or not to perform inline expansion so that the processing to be performed by the system function is expanded inline with the machine language instruction string instead of the function call without expanding the machine language instruction that calls the system function provided to the programmer. In-line determination processing means for determining, in-line expandable system function name list table, in-line determination result additional information holding a determination result of whether or not to perform in-line expansion by the in-line determination processing means, and in-line determination result addition It is configured to include an inline expansion processing means for expanding an inline machine language instruction string by information and a machine language instruction string table for expanding an optimum machine language instruction string by the inline expansion processing means.

【0005】[0005]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。図1は、本発明の機械語命令生成方式の一
実施例を示すブロック図である。図1に示すように、本
実施例は、コンパイラ全体を管理するコンパイラ制御手
段1,インライン判定処理手段2,インライン可能なシ
ステム関数名一覧テーブル3,インライン判定結果付加
情報4,インライン展開処理手段5,機械語命令列テー
ブル6から構成されている。
Embodiments of the present invention will now be described with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a machine language instruction generation system of the present invention. As shown in FIG. 1, in this embodiment, compiler control means 1 for managing the entire compiler 1, inline determination processing means 2, inlineable system function name list table 3, inline determination result additional information 4, inline expansion processing means 5 are provided. , A machine language instruction sequence table 6.

【0006】図2は、インライン可能なシステム関数名
一覧テーブル3の一例を示す図である。図2に示すよう
に、インライン可能なシステム関数名一覧テーブル3
は、インラインが行える関数名(1),(2),……
(n)を含んでいる。
FIG. 2 is a diagram showing an example of a system function name list table 3 that can be inlined. As shown in FIG. 2, inline system function name list table 3
Is a function name that can be inlined (1), (2), ...
(N) is included.

【0007】図3は、インライン判定結果付加情報4の
一例を示す図である。図3に示すように、インライン判
定結果付加情報4は、インラインを行うか否かの判定結
果を含んでおり、従来のテキスト情報に付加されてい
る。
FIG. 3 is a diagram showing an example of the inline determination result additional information 4. As shown in FIG. 3, the inline determination result additional information 4 includes a determination result of whether to perform inline and is added to the conventional text information.

【0008】図4は、機械語命令列テーブル6の一例を
示す図である。図4に示すように、機械語命令列テーブ
ル6は、インラインを行うシステム関数名、引数の条件
数、引数の条件、展開する機械語命令列から構成されて
いる。
FIG. 4 is a diagram showing an example of the machine language instruction sequence table 6. As shown in FIG. 4, the machine language instruction sequence table 6 is composed of a system function name to be inlined, a condition number of arguments, a condition of arguments, and a machine language instruction sequence to be expanded.

【0009】図5は、本実施例の処理の一例を示す流れ
図である。図5に示すように、本実施例は、ソース入力
構文意味解析処理7で、ソースプログラムファイル8か
らソースプログラムを読み込む。ソース入力ファイル終
了判定処理9で、ソースプログラムが存在するか否かを
判断する処理を行い、存在しないときには、構文意味解
析結果入力処理10に制御を移す。ソースプログラムが
存在するときには、関数呼び出し判定処理11で、入力
したソースプログラムが関数呼び出しか否かの判定を行
い、関数呼び出しであれば、制御をインライン判定処理
手段2に移す。
FIG. 5 is a flow chart showing an example of the processing of this embodiment. As shown in FIG. 5, in this embodiment, the source input syntactic and semantic analysis process 7 reads the source program from the source program file 8. In the source input file end determination process 9, a process of determining whether or not the source program exists is performed. When the source program does not exist, the control is transferred to the syntactic and semantic analysis result input process 10. When the source program exists, the function call determination processing 11 determines whether or not the input source program is a function call. If it is a function call, the control is transferred to the inline determination processing means 2.

【0010】関数呼び出しでない場合には、構文意味解
析結果出力処理12で、構文意味解析結果ファイル13
に、構文意味解析結果を出力して、ソース入力構文意味
解析処理7に制御を移す。インライン判定処理手段2で
は、入力した関数呼び出しの関数名とインライン可能な
システム関数名一覧テーブル3とを比較し、その結果、
インライン可能なシステム関数名一覧テーブル3に、入
力関数名が存在するときには、インライン不可の情報を
インライン判定結果付加情報4に設定して、制御を構文
意味解析結果出力処理12に移す。
If it is not a function call, in the syntactic and semantic analysis result output processing 12, the syntactic and semantic analysis result file 13 is output.
Then, the result of the syntactic and semantic analysis is output, and the control is transferred to the source input syntactic and semantic analysis processing 7. The inline determination processing means 2 compares the input function name of the function call with the inlineable system function name list table 3, and as a result,
When there is an input function name in the inline-capable system function name list table 3, the inline-disabled information is set in the inline determination result additional information 4, and the control is transferred to the syntactic and semantic analysis result output process 12.

【0011】構文意味解析結果入力処理10では、構文
意味解析結果ファイル13から構文意味解析結果を読み
込む。構文意味解析結果ファイル終了判定処理14で
は、構文意味解析結果が存在するか否かを判断する処理
を行ない、構文意味解析結果が存在する時には、機械語
展開処理15に制御を移す。機械語展開処理15では、
インライン関数判定処理16で、入力した構文意味解析
結果が、関数呼び出しでしかもインライン判定結果付加
情報4がインライン可か不可かの判断を行い、関数呼び
出しでしかもインライン判定結果付加情報4がインライ
ン可の情報である場合には、インライン展開処理手段5
に制御を移す。
In the syntactic and semantic analysis result input processing 10, the syntactic and semantic analysis result is read from the syntactic and semantic analysis result file 13. In the syntactic / semantic analysis result file end determination process 14, a process of determining whether or not a syntactic / semantic analysis result exists, and when the syntactic / semantic analysis result exists, control is transferred to the machine language expansion process 15. In the machine language expansion processing 15,
In the inline function determination processing 16, it is determined whether the input syntactic and semantic analysis result is a function call and the inline determination result additional information 4 is inline enabled or disabled, and the function call is performed and the inline determination result additional information 4 is inline enabled. If it is information, the inline expansion processing means 5
Transfer control to.

【0012】関数呼び出しでないとき、あるいは関数呼
び出しでインライン判定結果付加情報4がインライン不
可の情報であるときには、機械語展開出力処理17に制
御を移す。インライン展開処理手段5では、入力した関
数呼び出しの関数名及び引数の条件から、機械語命令列
テーブル6のなかから最適な機械語命令列を探し、機械
語展開出力処理17に制御を移す。機械語展開出力処理
17では、機械語展開ファイル18に機械語命令を出力
したのちに、制御を構文意味解析結果ファイル入力処理
10に戻す。構文意味解析結果ファイル判定処理14
で、構文意味解析結果が存在しない時には、処理を終了
する。
If it is not a function call or if the inline determination result additional information 4 is a function call and inline incapable information, control is transferred to the machine language expansion output processing 17. The inline expansion processing means 5 searches the machine language instruction string table 6 for an optimum machine language instruction string based on the input function name and argument condition, and transfers control to the machine language expansion output processing 17. In the machine language expansion output process 17, after outputting the machine language command to the machine language expansion file 18, the control is returned to the syntactic and semantic analysis result file input process 10. Syntax semantic analysis result file judgment processing 14
Then, when the syntactic and semantic analysis result does not exist, the processing ends.

【0013】図6は、インライン判定処理手段2の処理
の一例を示す流れ図である。図6に示すように、インラ
イン判定処理手段2は、インライン可能なシステム関数
名一覧テーブル3よりインライン可能なシステム関数名
を得る処理2−1を行う。その結果に対する処理2−2
で、インライン可能なシステム関数名が存在したときに
は、入力関数名と一致するかどうかを判断する処理2−
3を行い、一致したときには、さらにインライン展開を
行なうべきか否かの判断2−4を行い、インライン展開
するときには、インライン判定結果付加情報4に、イン
ライン可の情報を設定し、インライン判定結果付加情報
4を従来のテキストに付加(2−5)して処理を終了す
る。
FIG. 6 is a flow chart showing an example of processing of the inline determination processing means 2. As shown in FIG. 6, the inline determination processing means 2 performs processing 2-1 for obtaining inlineable system function names from the inlineable system function name list table 3. Process 2-2 for the result
Then, if there is a system function name that can be inlined, the process of determining whether it matches the input function name 2-
3 is performed, and if they match, a determination 2-4 is made as to whether or not further inline expansion should be performed. When inline expansion is performed, inline determination result addition information 4 is set to inline enabled information, and inline determination result addition is performed. The information 4 is added to the conventional text (2-5), and the process ends.

【0014】インライン展開を行わないときには、イン
ライン判定結果付加情報4にインライン不可の情報を設
定し、インライン判定結果付加情報4を従来のテキスト
に付加(2−6)して処理を終了する。また、入力関数
名と一致しないときには、インライン可能なシステム関
数名一覧テーブル3よりインライン展開可能なシステム
関数名を得る処理2−1に制御を戻す。また、インライ
ン展開可能なシステム関数名が存在しなくなったときに
は、インライン判定結果付加情報4に、インライン不可
の情報を設定し、インライン判定結果付加情報4を従来
のテキストに付加して処理を終了する。
When the inline expansion is not performed, the inline determination result additional information 4 is set to the inline-disabled information, the inline determination result additional information 4 is added to the conventional text (2-6), and the process is terminated. If the input function name does not match, the control is returned to the process 2-1 for obtaining the inline expandable system function name from the inline expandable system function name list table 3. When the system function name that can be expanded inline does not exist, the inline determination result additional information 4 is set to the information that cannot be inlined, the inline determination result additional information 4 is added to the conventional text, and the process ends. .

【0015】図7は、インライン展開処理手段5の処理
の一例を示す流れ図である。インライン展開処理手段5
は、機械語命令列テーブル6より、インライン展開を行
うシステム関数名を得る処理5−1を行う。その結果
で、インラインを行うシステム関数名と入力関数名とが
一致するか否かの判断5−2を行い、一致しないときに
は、5−1に戻って機械語命令列テーブル6より、次の
インラインを行うシステム関数名を得たのちに、制御を
5−2に戻す。
FIG. 7 is a flow chart showing an example of the processing of the inline expansion processing means 5. Inline expansion processing means 5
Performs a process 5-1 for obtaining a system function name for inline expansion from the machine language instruction sequence table 6. Based on the result, a judgment 5-2 is made as to whether or not the system function name to be inlined and the input function name match. If they do not match, the process returns to 5-1 and the machine language instruction sequence table 6 indicates that the next inline After obtaining the name of the system function for performing the above, the control is returned to 5-2.

【0016】一致したときには、機械語命令列テーブル
6より、引数の条件を得る処理5−3を行い、入力引数
の条件と一致するか否かの判断5−4を行い、入力引数
と機械語命令列を展開するための引数の条件とが、一致
したときには、その機械語命令列の情報を保持したまま
処理を終了する。入力引数と機械語命令列を展開するた
めの条件とが一致しないときには、機械語命令列テーブ
ル6の引数の条件数の間、機械語命令列テーブル6より
引数の条件を得る処理5−3および機械語命令列を展開
するための条件と入力引数とが一致するか否かの判断処
理5−4を一致するまで繰り返す。
When they match, the processing 5-3 for obtaining the condition of the argument from the machine language instruction sequence table 6 is performed, and the judgment 5-4 of whether or not it matches the condition of the input argument is performed. When the condition of the argument for expanding the instruction sequence matches, the processing is terminated while holding the information of the machine language instruction sequence. When the input argument and the condition for expanding the machine language instruction sequence do not match, during the number of conditions of the arguments of the machine language instruction sequence table 6, processing 5-3 for obtaining the condition of the argument from the machine language instruction sequence table 6 and The determination process 5-4 for determining whether the condition for expanding the machine language instruction sequence and the input argument match is repeated until they match.

【0017】[0017]

【発明の効果】以上説明したように、本発明の機械語命
令生成方式は、システム関数の実行に際して、システム
関数を呼び出す機械語命令列の展開を行わずに、システ
ム関数で行うべき処理を機械語命令列で展開することに
より、実行速度の向上を目的とした関数呼び出しの際の
最適な機械語命令列を生成することができるという効果
を有している。
As described above, according to the machine language instruction generation method of the present invention, when a system function is executed, the processing to be performed by the system function is executed without expanding the machine language instruction sequence that calls the system function. The expansion by the word instruction sequence has an effect that an optimum machine language instruction sequence at the time of function call for the purpose of improving the execution speed can be generated.

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

【図1】本発明の機械語命令生成方式の一実施例を示す
ブロック図である。
FIG. 1 is a block diagram showing an embodiment of a machine language instruction generation system of the present invention.

【図2】インライン可能なシステム関数名一覧テーブル
3の一例を示す図である。
FIG. 2 is a diagram showing an example of a system function name list table 3 that can be inlined.

【図3】インライン判定結果付加情報4の一例を示す図
である。
FIG. 3 is a diagram showing an example of inline determination result additional information 4.

【図4】機械語命令テーブル6の一例を示す図である。FIG. 4 is a diagram showing an example of a machine language instruction table 6.

【図5】本実施例の処理の一例を示す流れ図である。FIG. 5 is a flowchart showing an example of processing of this embodiment.

【図6】インライン判定処理手段2の処理の一例を示す
流れ図である。
FIG. 6 is a flowchart showing an example of processing of the inline determination processing means 2.

【図7】インライン展開処理手段5の処理の一例を示す
流れ図である。
FIG. 7 is a flowchart showing an example of processing of the inline expansion processing means 5.

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

1 コンパイラ制御手段 2 インライン判定処理手段 3 インライン可能なシステム関数名一覧テーブル 4 インライン判定結果付加情報 5 インライン展開処理手段 6 機械語命令列テーブル 1 Compiler Control Means 2 Inline Judgment Processing Means 3 Inline System Function Name List Table 4 Inline Judgment Result Additional Information 5 Inline Expansion Processing Means 6 Machine Language Instruction Sequence Table

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 ソースプログラムを読み込んで目的プロ
グラムを出力するコンパイラの機械語命令生成方式にお
いて、 プログラマに提供しているシステム関数を呼び出す機械
語命令を展開せずに、システム関数で行うべき処理を関
数呼び出しの代わりに機械語命令列でインライン展開す
るために、インライン展開を行うか否かを判断するイン
ライン判定処理手段と、 インライン展開可能なシステム関数名一覧テーブルと、 前記インライン判定処理手段によるインライン展開を行
うか否かの判断結果を保持するインライン判定結果付加
情報と、 前記インライン判定結果付加情報によりインライン用機
械語命令列の展開を行うインライン展開処理手段と、 前記インライン展開処理手段によって最適な機械語命令
列を展開するための機械語命令列テーブルとを備えるこ
とを特徴とする機械語命令生成方式。
1. In a machine language instruction generation method of a compiler that reads a source program and outputs a target program, processing to be performed by a system function without expanding a machine language instruction that calls a system function provided to a programmer is performed. In order to perform inline expansion with a machine language instruction sequence instead of function call, an inline determination processing unit that determines whether to perform inline expansion, a system function name list table that can be expanded inline, and an inline by the inline determination processing unit. Inline determination result additional information holding a determination result of whether or not to perform expansion, inline expansion processing means for expanding an inline machine language instruction sequence by the inline determination result additional information, optimal by the inline expansion processing means Machine language instruction sequence for expanding the machine language instruction sequence Machine language instructions generation method characterized by comprising the Buru.
JP11943592A 1992-05-13 1992-05-13 Machine word instruction generating system Withdrawn JPH05313910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11943592A JPH05313910A (en) 1992-05-13 1992-05-13 Machine word instruction generating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11943592A JPH05313910A (en) 1992-05-13 1992-05-13 Machine word instruction generating system

Publications (1)

Publication Number Publication Date
JPH05313910A true JPH05313910A (en) 1993-11-26

Family

ID=14761356

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11943592A Withdrawn JPH05313910A (en) 1992-05-13 1992-05-13 Machine word instruction generating system

Country Status (1)

Country Link
JP (1) JPH05313910A (en)

Similar Documents

Publication Publication Date Title
JPH07105012A (en) Compiling processing system for language processing program
JP2001184218A (en) Optimization method in compile of mpi program
JPH05313910A (en) Machine word instruction generating system
JPH10187461A (en) Language processing system
JPS5922140A (en) Interactive compiling system
JP2585793B2 (en) Compiler system
JPH0411888B2 (en)
JPH0210429A (en) Program structure processing system
JP3323147B2 (en) Compiling device, compiling method, and recording medium recording compiler program
JPH0573335A (en) Automatic in-line development system for program
JPH03144830A (en) Parallel processing system
JP2748582B2 (en) Compile processing unit
JPH04343140A (en) Parallelized processing system
JPH0659933A (en) Code converter
JPH11195011A (en) Language translation processor, language translation processing method and record medium recording language translation processing program
JP2001125793A (en) Compiler system, compile method and recording medium
JPH0254368A (en) Translation control system for mechanical translation
JPH06242958A (en) Compilation system
JPH05100866A (en) Compile/link system
JPH04364537A (en) Method, device, and compiler for optimizing program for parallel process
JPH0561687A (en) Processing system for compiler
KR950015127A (en) CHILL Separate Compilation Method
JP2000222218A (en) Compiling device and record medium
JPH11306150A (en) Compile processing system, method therefor and computer-readable recording medium recorded with compiler program
JPH06103079A (en) Compile system

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990803