[go: up one dir, main page]

JP2000056981A - Program conversion device - Google Patents

Program conversion device

Info

Publication number
JP2000056981A
JP2000056981A JP10222657A JP22265798A JP2000056981A JP 2000056981 A JP2000056981 A JP 2000056981A JP 10222657 A JP10222657 A JP 10222657A JP 22265798 A JP22265798 A JP 22265798A JP 2000056981 A JP2000056981 A JP 2000056981A
Authority
JP
Japan
Prior art keywords
intermediate code
program
function
machine language
optimization
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
JP10222657A
Other languages
Japanese (ja)
Inventor
Toshiyuki Sakata
俊幸 坂田
Nobuteru Tominaga
宣輝 富永
Seiichi Urushibara
誠一 漆原
Naosuke Haruna
修介 春名
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP10222657A priority Critical patent/JP2000056981A/en
Publication of JP2000056981A publication Critical patent/JP2000056981A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

(57)【要約】 【課題】 積和演算、飽和演算等の演算を行う機械語命
令列からなるDSP関数を呼び出す旨の記述を含むソー
スプログラムを、効率の良い機械語命令列に変換するプ
ログラム変換装置を提供することを目的とする。 【解決手段】 DSP関数を呼び出す旨のソースプログ
ラム中の記述を、中間コード生成部102はDSP関数
を呼び出す旨の関数呼出の中間コードに変換し、特殊演
算対応表104を参照して特殊演算処理部103は、そ
のDSP関数を呼び出す旨の関数呼出の中間コードを特
殊演算用の中間コードに変換する。この特殊演算用の中
間コードを、中間コード最適化部105は、和や積等の
一般的な演算の中間コードと同等に共通部分式の削除等
の最適化の適用対象とする。中間コード最適化部105
により最適化された中間コードを翻訳部106は機械語
命令列に変換し出力ファイル108に出力する。
(57) [Summary] [PROBLEMS] A program for converting a source program including a description of calling a DSP function consisting of a machine language instruction sequence for performing operations such as a product-sum operation and a saturation operation into an efficient machine language instruction sequence It is an object to provide a conversion device. An intermediate code generation unit converts a description in a source program to call a DSP function into an intermediate code of a function call to call a DSP function, and refers to a special operation correspondence table to perform special operation processing. The unit 103 converts the intermediate code of the function call for calling the DSP function into an intermediate code for a special operation. The intermediate code for the special operation is subjected to optimization, such as deletion of a common subexpression, by the intermediate code optimizing unit 105, similarly to the intermediate code of a general operation such as a sum or a product. Intermediate code optimization unit 105
The translation unit 106 converts the intermediate code optimized according to the above into a machine language instruction sequence and outputs it to the output file 108.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、高級言語で記述さ
れたソースプログラムをプロセッサ用の機械語命令列に
変換するプログラム変換装置に関し、特に積和演算・飽
和演算等の特殊演算を行う関数を呼び出す記述を含むソ
ースプログラムを変換対象とするプログラム変換装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program conversion device for converting a source program described in a high-level language into a machine language instruction sequence for a processor, and more particularly, to a function for performing a special operation such as a product-sum operation or a saturation operation. The present invention relates to a program conversion device that converts a source program including a description to be called into a conversion target.

【0002】[0002]

【従来の技術】近年、画像処理等のマルチメディア処理
を高速に行なうために積和演算、飽和演算等のディジタ
ル信号処理用の命令(以下、DSP命令と呼ぶ。)がマ
イクロプロセッサに搭載されてきている。これらのマイ
クロプロセッサで用いられるソフトウェアは、通常、C
言語、オブジェクト指向言語C++(以下、単に「C+
+言語」という。)等の高級言語で記述されたソースプ
ログラムがプログラム変換装置で機械語命令に翻訳され
ることによって生成される。しかし、上述の高級言語は
DSP命令を想定したものでないため、DSP命令を示
す演算子を備えていない。このため、従来、DSP命令
を使用するには、DSP命令に対応する関数(以下、D
SP関数と呼ぶ。)を機械語命令で作成しておき、高級
言語で記述されたソースプログラム中にそのDSP関数
を呼び出す旨の記述をすることにしていた。なお、関数
を呼び出す旨の記述は、高級言語で記述可能であり、標
準化された高級言語で記述するソースプログラム中にD
SP関数を呼び出す旨の記述を用いることは、各種プロ
セッサに対応するソースプログラムを一本化できる等の
利益をもたらす。
2. Description of the Related Art In recent years, in order to perform multimedia processing such as image processing at high speed, instructions for digital signal processing such as product-sum operation and saturation operation (hereinafter referred to as DSP instructions) have been mounted on microprocessors. ing. The software used in these microprocessors is usually
Language, object-oriented language C ++ (hereinafter simply "C ++
+ Language ”. ) Are generated by being translated into machine language instructions by a program conversion device. However, since the above-mentioned high-level language does not assume a DSP instruction, it does not have an operator indicating the DSP instruction. For this reason, conventionally, to use a DSP instruction, a function corresponding to the DSP instruction (hereinafter referred to as D
Called SP function. ) Is prepared in machine language instructions, and a description that calls the DSP function is made in a source program described in a high-level language. Note that the description to call a function can be described in a high-level language, and D is included in a source program described in a standardized high-level language.
The use of the description for calling the SP function brings benefits such as a single source program corresponding to various processors.

【0003】以下、従来のプログラム変換装置が、図1
に示すソースプログラムを、機械語命令列に変換する動
作を説明する。図1は、DSP関数を呼び出す旨の記述
を含むソースプログラムの例を示す図である。同図に示
すソースプログラムは、C言語で記述されたものであ
り、「_satadd(x,y)」がDSP関数を呼び
出す旨の記述である。なお、このDSP関数は飽和加算
演算を行う関数である。図12は、従来のプログラム変
換装置の機能ブロック図である。入力ファイル901に
は、DSP関数を呼び出す旨の記述が含まれたソースプ
ログラムが格納されている。プログラム変換装置900
は、入力ファイル901に格納されているソースプログ
ラムを読み込み、機械語命令列に翻訳して、出力ファイ
ル907に出力するいわゆるコンパイラであり、中間コ
ード生成部903と、中間コード最適化部904と、翻
訳部905と、DSP関数展開部906とを備える。中
間コード生成部903は、入力ファイル901から読み
込みんだソースプログラムをプログラム変換装置内で使
用する内部表現である中間コードに変換する。この中間
コード生成部903が、図1のソースプログラムを変換
した結果、図2に示す中間コードが生成される。図2
は、図1に示すソースプログラムに対応してプログラム
変換装置により生成される中間コードの例を示す図であ
る。例えば、同図に示す中間コードにおける「tmp=
_satadd(x,y)」、「tmp cmpgt
0」が、図1に示すソースプログラムにおける「_sa
tadd(x,y)>0」に対応している。
[0003] Hereinafter, a conventional program conversion apparatus is shown in FIG.
The operation of converting the source program shown in (1) into a machine language instruction sequence will be described. FIG. 1 is a diagram illustrating an example of a source program including a description that calls a DSP function. The source program shown in the figure is written in the C language, and “_satadd (x, y)” is a description that calls a DSP function. This DSP function is a function for performing a saturation addition operation. FIG. 12 is a functional block diagram of a conventional program conversion device. The input file 901 stores a source program including a description for calling a DSP function. Program conversion device 900
Is a so-called compiler that reads a source program stored in the input file 901, translates the source program into a machine language instruction sequence, and outputs the translated instruction to the output file 907. The intermediate code generation unit 903, the intermediate code optimization unit 904, A translation unit 905 and a DSP function expansion unit 906 are provided. The intermediate code generation unit 903 converts the source program read from the input file 901 into an intermediate code that is an internal representation used in the program conversion device. As a result of the conversion of the source program of FIG. 1 by the intermediate code generation unit 903, the intermediate code shown in FIG. 2 is generated. FIG.
FIG. 3 is a diagram showing an example of an intermediate code generated by the program conversion device corresponding to the source program shown in FIG. For example, in the intermediate code shown in FIG.
_Satadd (x, y) "," tmp cmpgt
0 ”is“ _sa ”in the source program shown in FIG.
tadd (x, y)> 0 ".

【0004】中間コード最適化部904は、中間コード
生成部903で生成した中間コードに対して、関数のイ
ンライン展開、共通部分式の削除、定数伝搬、コピー伝
搬等の最適化を行なう。但し、図2に示す中間コード中
の「_satadd(x,y)」は、DSP関数の呼出
の意味を持つため、複数含まれているにもかかわらず共
通部分式とは扱えず、中間コード最適化部904は、共
通部分式の削除を行わない。ここで、関数のインライン
展開は、関数を呼び出している箇所を関数内容を示す中
間コードに置き換えることであり、これによりサブルー
チンリンケージ及びそれに伴う命令が不要になる。共通
部分式の削除は、部分式が等価な値をもつときに、その
評価を1回行うとその結果を変数に格納し、その後の共
通な部分式をその変数で置き換えることであり、これに
より複数の等価な部分式の評価を1回で済ませることが
できる。定数伝搬は、例えば、定数aを変数vに代入す
るv=aという代入文以後、変数vへの代入が現れるま
でvへの参照を定数aで置き換えることであり、これに
より、式中の変数が定数に置き換えられる場合にはその
部分を翻訳時に計算して、もとの式を計算結果に置き換
えること等が可能になる。また、コピー伝搬は、定数伝
搬における定数を変数に代えたものである。なお、高級
言語で記述されたソースプログラムにおける「x+y」
や「x−y」等の演算子とオペランドは、中間コードに
変換された後も、共通部分式の削除、定数伝搬、コピー
伝搬等の最適化を適用する対象となる。翻訳部905
は、中間コード最適化部904で最適化した中間コード
を機械語命令に翻訳する。この翻訳結果を図13に示
す。
The intermediate code optimizing unit 904 performs optimization on the intermediate code generated by the intermediate code generating unit 903, such as inline expansion of functions, deletion of common sub-expressions, constant propagation, and copy propagation. However, since “_satadd (x, y)” in the intermediate code shown in FIG. 2 has the meaning of calling the DSP function, it cannot be treated as a common sub-expression even though it is included in plurals, and The conversion unit 904 does not delete the common subexpression. Here, the inline expansion of a function is to replace the place where the function is called with an intermediate code indicating the contents of the function, thereby eliminating the need for subroutine linkage and the accompanying instructions. Deletion of a common subexpression means that, when the subexpressions have equivalent values, if the evaluation is performed once, the result is stored in a variable, and the subsequent common subexpressions are replaced with the variable. It is possible to evaluate a plurality of equivalent subexpressions only once. Constant propagation means, for example, after an assignment statement of v = a for assigning a constant a to a variable v, a reference to v is replaced with a constant a until an assignment to the variable v appears, whereby the variable If is replaced by a constant, that part can be calculated at the time of translation, and the original expression can be replaced with the calculation result. In copy propagation, a constant in constant propagation is replaced with a variable. Note that "x + y" in a source program written in a high-level language
Operators and operands such as "x" and "xy" are subject to optimization such as common subexpression elimination, constant propagation, and copy propagation even after being converted to intermediate code. Translator 905
Translates the intermediate code optimized by the intermediate code optimization unit 904 into machine language instructions. This translation result is shown in FIG.

【0005】図13は、従来のプログラム変換装置90
0における翻訳部905の出力の例を示す図である。D
SP関数展開部906は、翻訳部905で翻訳した機械
語命令の中でDSP関数を呼び出すサブルーチンコール
命令を検出し、これを、機械語DSP関数格納ファイル
902に格納されている機械語命令列であるDSP関数
に展開し、出力ファイル907に結果を出力する。DS
P関数展開部906の処理結果を図14に示す。図14
は、従来のプログラム変換装置900におけるDSP関
数展開部906の処理結果の例を示す図である。なお、
図中においては、機械語命令列は、便宜上、アセンブリ
言語のプログラムとして表現している。このように、従
来のプログラム変換装置900は、図1に示すソースプ
ログラムの一部を図14に示す機械語命令列に変換す
る。
FIG. 13 shows a conventional program conversion device 90.
FIG. 10 is a diagram illustrating an example of an output of the translation unit 905 at 0. D
The SP function expansion unit 906 detects a subroutine call instruction that calls the DSP function among the machine language instructions translated by the translation unit 905, and converts this into a machine language instruction sequence stored in the machine language DSP function storage file 902. It is expanded to a certain DSP function and the result is output to the output file 907. DS
FIG. 14 shows the processing result of the P function expansion unit 906. FIG.
9 is a diagram showing an example of a processing result of a DSP function expansion unit 906 in a conventional program conversion device 900. In addition,
In the figure, the machine language instruction sequence is expressed as an assembly language program for convenience. As described above, the conventional program conversion device 900 converts a part of the source program shown in FIG. 1 into a machine language instruction sequence shown in FIG.

【0006】[0006]

【発明が解決しようとする課題】従来のプログラム変換
装置は、DSP関数が機械語命令で記述されており中間
コード段階ではインライン展開ができないため、ソース
プログラムが機械語命令に翻訳された後にDSP関数の
インライン展開を行う(図13、図14参照)。このた
め、ソースプログラムにおけるDSP関数を呼び出す旨
の記述については、中間コードに変換した後も中間コー
ド最適化部904における最適化の対象とならないた
め、ソースプログラムを効率の良い機械語命令列に変換
することができないという問題がある。そこで、本発明
は、このような問題点に鑑みてなされたものであって、
DSP関数を呼び出す旨の記述を含むソースプログラム
を、効率の良い機械語命令列に変換するプログラム変換
装置を提供することを目的とする。
In the conventional program conversion device, the DSP function is described in machine language instructions and cannot be expanded inline at the intermediate code stage. Therefore, the DSP function is not translated after the source program is translated into machine language instructions. (See FIGS. 13 and 14). For this reason, the description of calling the DSP function in the source program is not subject to optimization by the intermediate code optimization unit 904 even after the conversion into the intermediate code, so that the source program is converted into an efficient machine instruction sequence. There is a problem that you can not. Therefore, the present invention has been made in view of such problems,
It is an object of the present invention to provide a program conversion device for converting a source program including a description for calling a DSP function into an efficient machine language instruction sequence.

【0007】[0007]

【課題を解決するための手段】上記課題を解決するため
に、本発明に係るプログラム変換装置は、高級言語にお
ける算術演算の演算子とオペランドとからなる記述を適
用対象とする最適化を行い高級言語で記述されたソース
プログラムをプロセッサ用の機械語命令列に変換するプ
ログラム変換装置であって、引数を渡して所定関数名の
関数を呼び出す旨の前記ソースプログラム中の特定関数
呼出記述について最適化の適用の面において、当該引数
をオペランドと同等に扱い、当該特定関数呼出記述を、
オペランドと当該オペランドに算術演算を行う演算子と
の組と同等に扱うことにより、前記ソースプログラムを
最適化された機械語命令列に変換することを特徴とす
る。即ち、本発明は、特殊演算を行う機械語命令列から
なる関数を呼び出す旨の特定関数呼出記述が、関数呼出
の形式をとりつつも、その内容は算術演算であることに
着目したものであり、本発明に係るプログラム変換装置
は、特定関数呼出記述を和や積等の通常の演算と同等に
共通部分式削除等の最適化の適用対象とするので、特定
関数呼出記述を含むソースプログラムを実行効率の良い
機械語命令列に変換することができる。
In order to solve the above-mentioned problems, a program conversion apparatus according to the present invention performs optimization for applying a description including an operator and an operand of an arithmetic operation in a high-level language to a high-level language. What is claimed is: 1. A program conversion device for converting a source program described in a language into a machine language instruction sequence for a processor, and optimizing a specific function call description in the source program to call a function having a predetermined function name by passing an argument. In terms of application of, the argument is treated the same as an operand, and the specific function call description is
The source program is converted into an optimized machine language instruction sequence by treating the same as a set of an operand and an operator performing an arithmetic operation on the operand. That is, the present invention focuses on the fact that a specific function call description for calling a function consisting of a machine language instruction sequence for performing a special operation is in the form of a function call, but the content is an arithmetic operation. Since the program conversion device according to the present invention applies a specific function call description to optimization such as common subexpression elimination as well as ordinary operations such as sum and product, a source program including a specific function call description It can be converted into a machine language instruction sequence with high execution efficiency.

【0008】[0008]

【発明の実施の形態】以下、本発明の実施の形態に係る
プログラム変換装置について、図面を用いて説明する。 <構成>図3は、本発明の実施の形態に係るプログラム
変換装置100の機能ブロック図である。なお、図3に
は入力ファイル101、出力ファイル108も併せて記
載している。ここで、入力ファイル101は、DSP関
数を呼び出す旨の記述を含むC言語のソースプログラム
を格納している。また、出力ファイル108は、プログ
ラム変換装置100により、入力ファイル101に格納
されたソースプログラムの翻訳結果である機械語命令列
が格納されるファイルである。プログラム変換装置10
0は、コンピュータに備えられたメモリに格納されたプ
ログラムがCPUにより実行されることで、ソースプロ
グラムを機械語命令列に翻訳(変換)する動作を行うい
わゆるコンパイラであり、機能的には、中間コード生成
部102、特殊演算処理部103、特殊演算対応表10
4、中間コード最適化部105、翻訳部106及び機械
語変換表107から構成される。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a program conversion device according to an embodiment of the present invention will be described with reference to the drawings. <Structure> FIG. 3 is a functional block diagram of the program conversion device 100 according to the embodiment of the present invention. FIG. 3 also shows the input file 101 and the output file 108. Here, the input file 101 stores a C-language source program including a description to call the DSP function. The output file 108 is a file in which the program conversion device 100 stores a machine language instruction sequence as a translation result of the source program stored in the input file 101. Program conversion device 10
Reference numeral 0 denotes a so-called compiler that translates (converts) a source program into a machine language instruction sequence by executing a program stored in a memory provided in a computer by a CPU. Code generation unit 102, special operation processing unit 103, special operation correspondence table 10
4. An intermediate code optimization unit 105, a translation unit 106, and a machine language conversion table 107.

【0009】ここで、ソースプログラムを機械語命令列
に翻訳するとは、ソースプログラムに基づいて、当該ソ
ースプログラムに記述された処理内容をプロセッサに実
行させるための機械語命令列を生成することをいう。中
間コード生成部102は、入力ファイル101に格納さ
れているソースプログラムをメモリに読み込み、このソ
ースプログラムをプログラム変換装置内で使用する内部
表現である中間コードに変換する。即ち、中間コード生
成部102は、ソースプログラムに基づいて中間コード
を生成する。なお、中間コード生成部102は、上述し
た従来のプログラム変換装置900における中間コード
生成部903と同等である。特殊演算処理部103は、
後述する特殊演算対応表104を参照することにより、
DSP関数呼出の中間コードの変換処理を行う。即ち、
特殊演算処理部103は、中間コード生成部102によ
り生成された中間コードの中から、DSP関数を呼び出
す旨の中間コードを検出して、これを特殊演算用の中間
コードに変換する。中間コード最適化部105は、特殊
演算処理部103の処理結果である中間コードに対し
て、関数のインライン展開、共通部分式の削除、定数伝
搬、コピー伝搬等の最適化を行なう。翻訳部106は、
後述する機械語変換表107を参照することにより、中
間コード最適化部105によって最適化された中間コー
ドを機械語命令に翻訳し、出力ファイル108に出力す
る。
Here, translating a source program into a machine language instruction sequence means generating a machine language instruction sequence for causing a processor to execute the processing content described in the source program based on the source program. . The intermediate code generation unit 102 reads a source program stored in the input file 101 into a memory, and converts the source program into an intermediate code which is an internal representation used in the program conversion device. That is, the intermediate code generation unit 102 generates an intermediate code based on the source program. Note that the intermediate code generation unit 102 is equivalent to the intermediate code generation unit 903 in the conventional program conversion device 900 described above. The special operation processing unit 103
By referring to the special operation correspondence table 104 described later,
The conversion process of the intermediate code of the DSP function call is performed. That is,
The special operation processing unit 103 detects an intermediate code for calling the DSP function from the intermediate codes generated by the intermediate code generation unit 102, and converts this to an intermediate code for a special operation. The intermediate code optimization unit 105 performs optimization such as inline expansion of a function, deletion of a common subexpression, constant propagation, copy propagation, and the like, on the intermediate code that is the processing result of the special operation processing unit 103. The translation unit 106
By referring to a later-described machine language conversion table 107, the intermediate code optimized by the intermediate code optimizing unit 105 is translated into a machine language instruction and output to the output file.

【0010】<特殊演算対応表>図4は、特殊演算対応
表104の内容を示す図である。特殊演算対応表104
には、DSP関数を呼び出す旨の中間コードと、それに
対応する特殊演算用の中間コードとの組が複数記憶され
ている。同図中の「_satadd(x,y)」等のよ
うなDSP関数を呼び出す旨の中間コードは、一般の関
数を呼び出す旨の中間コードと形式上は同一である。特
殊演算処理部103は、関数呼出の中間コードを、特殊
演算対応表104に当該中間コードが記憶されているか
否かにより、DSP関数を呼び出す旨の中間コードであ
るか一般の関数を呼び出す旨の中間コードであるかを判
断する。この特殊演算対応表104に記憶されているD
SP関数に関する情報は、ソースプログラム作成者に認
識されている必要がある。但し、このDSP関数に関す
る情報を共通して備えるソースプログラム開発支援ツー
ル等によって、プログラム作成者の認識負担を軽減する
等していてもよい。ここでは、ソースプログラムにおい
てDSP命令を使う場合は、特殊演算対応表104に記
憶されている関数名の関数を呼び出す旨の記述を行うと
いう取り決めに従ってソースプログラムが作成されてい
るものとする。同図中の「x satadd y」等の
ような特殊演算用の中間コードは、従来のプログラム変
換装置では用いられていなかった新たな中間コードであ
る。ここで、「satadd」は飽和加算演算を示し、
例えば、xとyの和を表す一般的な中間コード「x a
dd y」における「add」のように、演算子の意味
を有する中間コードである。また、「x satadd
y」における「x」と「y」とは演算子に対するオペ
ランドの意味を有する。なお、「x addy」はソー
スプログラムにおける「x+y」を中間コードで表現し
たものである。また、「satsub」は飽和減算演算
を示し、「satmul」は飽和乗算演算を示してい
る。
<Special Operation Correspondence Table> FIG. 4 is a diagram showing the contents of the special operation correspondence table 104. Special calculation correspondence table 104
Stores a plurality of sets of an intermediate code for calling a DSP function and a corresponding special operation intermediate code. An intermediate code for calling a DSP function such as “_satadd (x, y)” in the drawing is identical in form to an intermediate code for calling a general function. The special operation processing unit 103 determines whether the intermediate code for calling a function is an intermediate code for calling a DSP function or a general function based on whether or not the intermediate code is stored in the special operation correspondence table 104. Determine whether the code is an intermediate code. The D stored in the special operation correspondence table 104
Information about the SP function needs to be known to the source program creator. However, the recognition load on the program creator may be reduced by a source program development support tool or the like which has information on the DSP function in common. Here, when a DSP instruction is used in the source program, it is assumed that the source program has been created in accordance with a rule that a function to call a function having a function name stored in the special operation correspondence table 104 is described. An intermediate code for a special operation, such as “x sataddy” in the figure, is a new intermediate code that has not been used in the conventional program conversion device. Here, “satadd” indicates a saturation addition operation,
For example, a general intermediate code “x a
This is an intermediate code having the meaning of an operator, such as “add” in “ddy”. Also, "x satadd
"x" and "y" in "y" have the meaning of an operand for an operator. Note that “x addy” represents “x + y” in the source program as an intermediate code. “Satsub” indicates a saturation subtraction operation, and “satmul” indicates a saturation multiplication operation.

【0011】このように、特殊演算用の中間コードは、
演算子とオペランドとの意味を有する中間コードである
ため、その意味が中間コード最適化部105により参照
され、最適化の適用の面において、高級言語における通
常の演算子を中間コードに変換したものと同等に扱われ
る。なお、特殊演算対応表104におけるx、y等は、
変数名そのものを特定したものではなく、それぞれ第1
引数、第2引数を表現したものである。従って、引数
は、いかなる変数名であっても、いかなる値のものであ
ってもよい。例えば、この特殊演算対応表104に従え
ば、「_satadd(y,2)」を「y satad
d 2」に変換することができる。また、中間コード段
階での最適化において、演算子及びオペランドからなる
式については共通部分式の削除の対象となり得、また、
オペランドについては定数伝搬、コピー伝搬の対象とな
り得る。
As described above, the intermediate code for special operation is
Since the intermediate code has the meaning of an operator and an operand, the meaning is referred to by the intermediate code optimization unit 105, and in terms of application of optimization, a normal operator in a high-level language is converted to an intermediate code. Is treated the same as Note that x, y, and the like in the special operation correspondence table 104 are as follows:
The variable names themselves are not specified,
It represents the argument and the second argument. Thus, the argument can be any variable name or any value. For example, according to the special operation correspondence table 104, “_satadd (y, 2)” is changed to “y satadd”.
d2 ". Also, in the optimization at the intermediate code stage, an expression consisting of an operator and an operand may be subject to common subexpression elimination,
Operands can be subject to constant propagation and copy propagation.

【0012】<機械語変換表>図5は、機械語変換表1
07の内容を示す図である。なお、同図中においては、
機械語命令は、便宜上、ニモニックコードで表現してい
る。機械語変換表107には、中間コードと、それに対
応する1又は複数の機械語命令との組が複数記憶されて
いる。例えば、「satadd」という特殊演算用の中
間コードは、「sadd」という飽和加算命令と対応づ
けられており、「satsub」という特殊演算用の中
間コードは、「ssub」という飽和減算命令と対応づ
けられている。ここで、機械語命令である「sadd」
や「ssub」は、プログラム変換装置100の対象と
するプロセッサが解読実行可能な命令である。この機械
語変換表107において、特殊演算用の中間コードと機
械語命令との対応関係以外の情報は、一般のプログラム
変換装置において中間コードから機械語命令に変換する
ために用いられる情報と同様である。
<Machine Language Conversion Table> FIG. 5 shows a machine language conversion table 1.
It is a figure which shows the content of 07. In the figure,
The machine language instruction is represented by a mnemonic code for convenience. The machine language conversion table 107 stores a plurality of sets of intermediate codes and one or more machine language instructions corresponding to the intermediate codes. For example, the intermediate code for special operation “saddd” is associated with the saturated addition instruction “sadd”, and the intermediate code for special operation “satsub” is associated with the saturated subtraction instruction “sssub”. Have been. Here, the machine language instruction “sadd”
And "ssub" are instructions that can be decoded and executed by the processor targeted by the program conversion device 100. In the machine language conversion table 107, information other than the correspondence between the special operation intermediate code and the machine language instruction is the same as the information used to convert the intermediate code to the machine language instruction in a general program conversion device. is there.

【0013】<動作>以下、上述の構成を備えるプログ
ラム変換装置100の動作について、図1に示すソース
プログラムを変換対象とした場合を例にして説明する。
図6は、プログラム変換装置100の動作を示すフロー
チャートである。中間コード生成部102は、入力ファ
イル101に格納されているソースプログラム(図1参
照)をメモリに読み込み(ステップS210)、ソース
プログラムに基づき中間コードをメモリ中に生成する
(ステップS220)。生成された中間コードは図2に
示すものとなる。図2に示す中間コードの意味は以下の
通りである。「tmp=_satadd(x,y)」
は、変数xとyの値を引数として、関数名が_sata
ddである関数の呼び出しを行ない、結果を一時変数t
mpに代入する中間コードである。「tmp cmpg
t 0」は、一時変数tmpが定数0より大きいか否か
を判定する中間コードである。「jmp_false
Label1」は、判定結果が偽ならラベルLabel
1に分岐する条件分岐の中間コードである。「a=_s
atadd(x,y)」は、変数xとyの値を引数とし
て、関数_sataddの呼び出しを行ない、結果を変
数aに代入する中間コードである。「Label1」
は、分岐先のラベルを示す中間コードである。中間コー
ド生成部102により中間コードが生成された後、特殊
演算処理部103は、DSP関数呼出の中間コードの変
換処理を行う(ステップS230)。
<Operation> The operation of the program conversion apparatus 100 having the above-described configuration will be described below by taking as an example a case where the source program shown in FIG. 1 is to be converted.
FIG. 6 is a flowchart showing the operation of the program conversion device 100. The intermediate code generation unit 102 reads a source program (see FIG. 1) stored in the input file 101 into a memory (Step S210), and generates an intermediate code in the memory based on the source program (Step S220). The generated intermediate code is as shown in FIG. The meaning of the intermediate code shown in FIG. 2 is as follows. "Tmp = _satadd (x, y)"
Is a function whose name is _sat
dd is called and the result is stored in a temporary variable t
This is an intermediate code to be assigned to mp. "Tmp cmpg
“t 0” is an intermediate code for determining whether or not the temporary variable tmp is larger than the constant 0. "Jmp_false
"Label1" is the label Label if the judgment result is false.
This is an intermediate code of a conditional branch that branches to 1. "A = _s
“attadd (x, y)” is an intermediate code that calls the function _satadd using the values of the variables x and y as arguments and substitutes the result into the variable a. "Label1"
Is an intermediate code indicating the label of the branch destination. After the intermediate code is generated by the intermediate code generation unit 102, the special operation processing unit 103 performs a conversion process of the intermediate code of the DSP function call (step S230).

【0014】以下、図7及び図8を用いてDSP関数呼
出の中間コードの変換処理について詳細に説明する。図
7は、特殊演算処理部103の行うDSP関数呼出の中
間コードの変換処理を示すフローチャートである。特殊
演算処理部103は、中間コード生成部102により生
成された中間コード(図2参照)の中から、関数呼出の
中間コードを検索する(ステップS231)。関数呼出
の中間コードが検出できなければ(ステップS23
2)、DSP関数呼出の中間コードの変換処理は終了
し、関数呼出の中間コードが検出できれば(ステップS
232)、特殊演算処理部103は、それがDSP関数
呼出の中間コードであるか判定する(ステップS23
3)。関数呼出の中間コードが、DSP関数呼出の中間
コードであるかの判定は(ステップS233)、その関
数呼出の中間コードが特殊演算対応表104に記憶され
ている中間コードであるか否かによって行う。例えば、
図2に示す中間コードのうちの関数呼出の中間コード
「_satadd(x,y)」は、特殊演算対応表10
4に記憶されているものであるため(図4参照)、特殊
演算処理部103により、DSP関数呼出の中間コード
であると判定される。ステップS233における判定の
結果、ステップS232において検出した関数呼出の中
間コードはDSP関数呼出の中間コードでないと判定し
た場合には、特殊演算処理部103は、ステップS23
1に戻り、中間コード生成部102により生成された中
間コードの中から他の関数呼出の中間コードの検索を行
う。また、ステップS233における判定の結果、DS
P関数呼出の中間コードであると判定した場合には、特
殊演算処理部103は、特殊演算対応表104を参照す
ることにより、DSP関数呼出の中間コードと対応する
特殊演算用の中間コードを得て(図4参照)、これを生
成し、DSP関数呼出の中間コードと置き換え(ステッ
プS234)、ステップS231の処理に戻る。例え
ば、「_satadd(x,y)」は、「x sata
dd y」に置き換えられる。
Hereinafter, the conversion process of the intermediate code of the DSP function call will be described in detail with reference to FIG. 7 and FIG. FIG. 7 is a flowchart showing the conversion process of the intermediate code of the DSP function call performed by the special operation processing unit 103. The special operation processing unit 103 searches the intermediate code (see FIG. 2) generated by the intermediate code generation unit 102 for an intermediate code for a function call (step S231). If the intermediate code of the function call cannot be detected (step S23)
2), the conversion process of the DSP function call intermediate code is completed, and if the function call intermediate code can be detected (step S)
232), the special operation processing unit 103 determines whether it is an intermediate code of a DSP function call (step S23).
3). Whether the intermediate code of the function call is the intermediate code of the DSP function call (step S233) is determined by whether or not the intermediate code of the function call is the intermediate code stored in the special operation correspondence table 104. . For example,
The intermediate code “_satadd (x, y)” of the function call among the intermediate codes shown in FIG.
4 (see FIG. 4), the special operation processing unit 103 determines that the code is an intermediate code of a DSP function call. If it is determined in step S233 that the intermediate code of the function call detected in step S232 is not the intermediate code of the DSP function call, the special operation processing unit 103 proceeds to step S23.
Returning to step 1, the intermediate code generated by the intermediate code generator 102 is searched for an intermediate code for another function call. Also, as a result of the determination in step S233, DS
If it is determined that the intermediate code is a P function call intermediate code, the special operation processing unit 103 refers to the special operation correspondence table 104 to obtain a special operation intermediate code corresponding to the DSP function call intermediate code. (Refer to FIG. 4), and is generated, replaced with the intermediate code of the DSP function call (step S234), and the process returns to step S231. For example, “_satadd (x, y)” becomes “x
dd y ”.

【0015】このような、特殊演算処理部103による
DSP関数呼出の中間コードの変換処理がなされた結果
として、図2に示す中間コードは、図8に示す中間コー
ドに変換される。図8は、特殊演算処理部103により
変換された後の中間コードの例を示す図である。同図に
示すように、特殊演算処理部103によって、図2に示
す中間コード「tmp=_satadd(x,y)」、
「a=_satadd(x,y)」は、それぞれ「tm
p=x satadd y」、「a=x satadd
y」に置き換えられている。即ち、引数を渡して関数
_sataddを呼び出す旨の情報を有する関数呼出の
中間コードが、sataddという演算子とオペランド
とである旨の情報を有する特殊演算用の中間コードに置
き換えられたのである。以下、再び、図6のフローチャ
ートに基づく説明に戻る。特殊演算処理部103により
DSP関数呼出の中間コードの変換処理(ステップS2
30)がなされたメモリ中の中間コードに対して、中間
コード最適化部105は、最適化を行う(ステップS2
40)。即ち、中間コード最適化部105は、関数のイ
ンライン展開、共通部分式の削除、定数伝搬、コピー伝
搬等の最適化を行なう。ここで、図8に示す中間コード
「x satadd y」における「satadd」等
の演算子の意味を有する中間コードは、共通部分式の削
除の対象となり、中間コード最適化部105は、「a=
x satadd y」を「a=tmp」に置き換え
る。なお、オペランドの意味を有する中間コードは、定
数伝搬、コピー伝搬の対象となる。また、最適化の過程
において、飽和加算等の特殊演算用の中間コードは、そ
のオペランドが定数となれば、その特殊演算用の中間コ
ードによる演算を計算してしまい、もとの特殊演算用の
中間コードをその計算結果で置き換えることができる。
「x satadd y」は、高級言語における「x+
y」を変換した中間コード「x add y」と、最適
化の適用対象という面においては全く同等に扱われる。
As a result of the conversion processing of the DSP function call intermediate code by the special operation processing unit 103, the intermediate code shown in FIG. 2 is converted into the intermediate code shown in FIG. FIG. 8 is a diagram illustrating an example of the intermediate code after the conversion by the special operation processing unit 103. As shown in the figure, the special operation processing unit 103 outputs the intermediate code “tmp = _satadd (x, y)” shown in FIG.
“A = _satadd (x, y)” is “tm
p = x satadd y "," a = x satadd
y ". That is, the intermediate code of the function call having the information of calling the function _satadd by passing the argument has been replaced with the intermediate code for the special operation having the information of the operator called satadd and the operand. Hereinafter, the description returns to the flowchart based on FIG. The conversion processing of the intermediate code of the DSP function call (step S2)
The intermediate code optimizing unit 105 performs optimization on the intermediate code in the memory that has been subjected to (30) (step S2).
40). That is, the intermediate code optimization unit 105 performs optimization such as inline expansion of a function, deletion of a common subexpression, constant propagation, and copy propagation. Here, the intermediate code having the meaning of the operator such as “satadd” in the intermediate code “x satadd y” shown in FIG. 8 is to be deleted from the common subexpression, and the intermediate code optimizing unit 105 sets “a =
“x satadd y” is replaced with “a = tmp”. The intermediate code having the meaning of the operand is subject to constant propagation and copy propagation. In the process of optimization, the intermediate code for a special operation such as saturation addition, if its operand is a constant, calculates the operation using the intermediate code for the special operation, and the original special operation The intermediate code can be replaced by the calculation result.
“X satadd y” is “x +
The intermediate code “x add y” obtained by converting “y” is treated exactly the same in terms of the optimization target.

【0016】中間コード最適化部105による処理結果
を図9に示す。図9は、図8に示す中間コードに対する
中間コード最適化部105による処理結果を示す図であ
る。中間コード最適化部105により最適化がなされた
後、翻訳部106は、機械語変換表107を参照しつつ
中間コードを機械語命令列に変換し(ステップS25
0)、機械語命令列を出力ファイル108に出力する
(ステップS260)。例えば、特殊演算処理部103
によって生成された「satadd」という中間コード
は、翻訳部106によって「sadd」という飽和加算
命令に変換される。図10は、図9に示す中間コードを
翻訳部106で機械語命令列に変換した結果を示す図で
ある。なお、機械語命令列は、便宜上、アセンブリ言語
のプログラムとして表現している。図10に示す機械語
命令の意味は以下の通りである。「mov (x),R
3」は、変数xの値をレジスタR3にロードする。「m
ov (y),R4」は、変数yの値をレジスタR4に
ロードする。「sadd R3,R4」は、レジスタR
3の値とレジスタR4の値を飽和加算し、結果をレジス
タR4に格納する。「cmp R4,0」は、レジスタ
R4の値と定数0を比較する。「blt Lab1」
は、比較結果により条件分岐する。「mov R4,
(a)」は、レジスタR4の値を変数aにストアする。
「Lab1:」は、分岐命令の飛び先ラベルである。こ
のように、プログラム変換装置100は、ソースプログ
ラム中のDSP関数を呼び出す旨の記述を、関数呼出の
中間コードに変換した後に、最適化の面で演算子を示す
中間コードと同様に扱える形式の特殊演算命令用の中間
コードに変換し、その後、中間コード段階で最適化を行
って、機械語命令列に翻訳する。
FIG. 9 shows the processing result of the intermediate code optimizing unit 105. FIG. 9 is a diagram illustrating a processing result of the intermediate code illustrated in FIG. 8 by the intermediate code optimization unit 105. After the optimization by the intermediate code optimization unit 105, the translation unit 106 converts the intermediate code into a machine language instruction sequence while referring to the machine language conversion table 107 (step S25).
0), and outputs the machine language instruction sequence to the output file 108 (step S260). For example, the special operation processing unit 103
The intermediate code “satadd” generated by the above is converted by the translating unit 106 into a saturated addition instruction “sadd”. FIG. 10 is a diagram illustrating a result of converting the intermediate code illustrated in FIG. 9 into a machine language instruction sequence by the translating unit 106. Note that the machine language instruction sequence is expressed as an assembly language program for convenience. The meanings of the machine language instructions shown in FIG. 10 are as follows. "Mov (x), R
"3" loads the value of the variable x into the register R3. "M
ov (y), R4 "loads the value of the variable y into the register R4. “Sadd R3, R4” is the register R
3 and the value of the register R4 are saturated and the result is stored in the register R4. “Cmp R4,0” compares the value of the register R4 with the constant 0. "Blt Lab1"
Is conditionally branched depending on the comparison result. "Mov R4
"(A)" stores the value of the register R4 in the variable a.
"Lab1:" is a jump destination label of a branch instruction. As described above, the program conversion device 100 converts the description of calling the DSP function in the source program into the intermediate code of the function call, and then treats the description in the same manner as the intermediate code indicating the operator in terms of optimization. It is converted into an intermediate code for a special operation instruction, and then optimized at the intermediate code stage and translated into a machine language instruction sequence.

【0017】<考察>本発明の実施の形態に係るプログ
ラム変換装置100の処理結果(図10)を、従来のプ
ログラム変換装置900の処理結果(図14)と比較し
て説明する。両者の前提となる状態は、図2に示す中間
コードである。プログラム変換装置100は、「sad
d」を1つ生成しているが(図10参照)、従来のプロ
グラム変換装置900は、「sadd」を2つ生成して
いる(図14参照)。この差異は、関数呼び出しの中間
コード「_satadd(x,y)」を、プログラム変
換装置900を共通部分式の削除という最適化の対象と
しないが、プログラム変換装置100では共通部分式の
削除という最適化の対象とすることによるものである。
また、従来のプログラム変換装置900の処理結果に
は、「mov R1,R3」、「mov R2,R4」
というレジスタR1及びR2の待避のためのコードが含
まれている。これは、従来のプログラム変換装置900
が、「_satadd(x,y)」を機械語命令列に翻
訳する場合に、関数呼び出しにおける引数受渡しで使用
するレジスタは常にR1及びR2と決められているため
に、レジスタR1及びR2がすでに使用されているとき
には、関数呼び出しの前にレジスタR1及びR2を退避
するコードを生成してしまうことによる。これに対し、
プログラム変換装置100では、図2に示す「_sat
add(x,y)」を中間コード段階で「x sata
dd y」に変換した後に機械語命令に翻訳するので、
関数呼出に関連したレジスタについての制約を受けず、
レジスタR3及びR4を使用することができ、このため
レジスタR1及びR2の待避等のコードを生成しない。
このように、図10、図14に示す機械語命令列を比較
すれば、本発明に係るプログラム変換装置が生成した機
械語命令列の方が、従来のプログラム変換装置が生成し
た機械語命令列よりも、効率の良いものであることは明
らかである。
<Consideration> The processing result of the program conversion device 100 according to the embodiment of the present invention (FIG. 10) will be described in comparison with the processing result of the conventional program conversion device 900 (FIG. 14). The precondition for both is the intermediate code shown in FIG. The program conversion device 100 reads “sad
Although one “d” is generated (see FIG. 10), the conventional program conversion device 900 generates two “sadd” (see FIG. 14). This difference is caused by the fact that the intermediate code “_satadd (x, y)” of the function call is not subject to optimization of the program conversion device 900 to delete the common sub-expression, but the program conversion device 100 does not This is due to the subject of the conversion.
The processing results of the conventional program conversion device 900 include “mov R1, R3”, “mov R2, R4”.
For saving the registers R1 and R2. This is because the conventional program conversion device 900
However, when translating “_satadd (x, y)” into a machine language instruction sequence, the registers used for the argument passing in the function call are always determined to be R1 and R2, so the registers R1 and R2 are already used. If so, a code for saving the registers R1 and R2 is generated before the function call. In contrast,
In the program conversion device 100, "_sat" shown in FIG.
add (x, y) "at the intermediate code stage to" x data
dd y ”and then translate it into machine language instructions.
Not subject to restrictions on registers associated with function calls,
The registers R3 and R4 can be used, so that no code is generated for saving the registers R1 and R2.
As described above, comparing the machine language instruction sequences shown in FIGS. 10 and 14, the machine language instruction sequence generated by the program conversion device according to the present invention is better than the machine language instruction sequence generated by the conventional program conversion device. Clearly, it is more efficient.

【0018】以上、本発明に係るプログラム変換装置に
ついて、実施形態に基づいて説明したが、本発明はこれ
ら実施形態に限られないことは勿論である。即ち、 (1)実施の形態では、プログラム変換装置が対象とす
るプロセッサの命令セットに「sadd」という飽和加
算命令が含まれていることを前提として、特殊演算処理
部103によって生成された「satadd」という中
間コードは、翻訳部106によって「sadd」という
飽和加算命令に変換されることとしたが、プロセッサの
命令セットに飽和加算命令等のDSP命令が含まれてい
なくてもよい。この場合には、機械語変換表107に
は、飽和加算命令と等価な動作を実現するような複数の
機械語命令と、「satadd」という中間コードとを
対応づけておき、翻訳部106はこれを参照して「sa
tadd」を複数の機械語命令列に変換することにな
る。
As described above, the program conversion device according to the present invention has been described based on the embodiments. However, it goes without saying that the present invention is not limited to these embodiments. That is, (1) In the embodiment, assuming that the instruction set of the processor targeted by the program conversion device includes a saturated addition instruction “sadd”, the “saddd” generated by the special operation processing unit 103 is assumed. Is translated by the translator 106 into a saturated addition instruction “sadd”, but the instruction set of the processor may not include a DSP instruction such as a saturation addition instruction. In this case, the machine language conversion table 107 associates a plurality of machine language instructions that realize an operation equivalent to a saturation addition instruction with an intermediate code “satadd”, and the translating unit 106 With reference to "sa
“tadd” is converted into a plurality of machine language instruction sequences.

【0019】(2)実施の形態では、プログラム変換装
置は、ソースプログラムを機械語命令列に翻訳すること
としたが、この機械語命令列に翻訳とは、これと同等の
アセンブリ言語プログラムに翻訳することを含むもので
あり、プログラム変換装置がアセンブリ言語プログラム
を出力するものであってもよい。この場合は、このアセ
ンブリ言語のプログラムはいわゆるアセンブラオプティ
マイザ等に入力され、さらに最適化された機械語命令列
に変換され得る。
(2) In the embodiment, the program conversion device translates the source program into a machine language instruction sequence. However, the translation into the machine language instruction sequence means translation into an equivalent assembly language program. The program conversion device may output an assembly language program. In this case, the assembly language program can be input to a so-called assembler optimizer or the like, and further converted to an optimized machine language instruction sequence.

【0020】(3)実施の形態では、特殊演算処理部1
03によって生成された「x satadd y」等の
特殊演算用の中間コードは、演算子とオペランドとの意
味を有する中間コードであるため、その意味が中間コー
ド最適化部105により参照され、最適化の適用の面に
おいて、高級言語における通常の演算子を中間コードに
変換したものと同等に扱われることとしたが、中間コー
ドに演算子とオペランドの意味をもたせる方法は、一定
書式の中間コードを用いることに限定されることはな
い。即ち、中間コード最適化部105が演算子である中
間コードを列挙した表を参照することにより、最適化の
適用の可否を判断するものであるならば、この表に特殊
演算用の中間コードを追加するような方法であってもよ
い。また、中間コード最適化部105が特殊演算対応表
104を参照することにより、特殊演算対応表104に
含まれている中間コードを演算子の中間コードと同等に
扱うことにしてもよい。
(3) In the embodiment, the special operation processing unit 1
03 is an intermediate code having a meaning of an operator and an operand, the meaning of which is referred to by the intermediate code optimizing unit 105 and the optimization is performed. In terms of the application of, it was decided that ordinary operators in high-level languages were treated as equivalent to those converted to intermediate code. It is not limited to use. That is, if the intermediate code optimizing unit 105 determines whether or not to apply the optimization by referring to the table listing the intermediate codes as the operators, the intermediate code for the special operation is included in this table. It may be a method of adding. In addition, the intermediate code optimization unit 105 may refer to the special operation correspondence table 104 so that the intermediate code included in the special operation correspondence table 104 is handled in the same manner as the intermediate code of the operator.

【0021】(4)実施の形態では、特殊演算対応表1
04は、予め完成したものとしてプログラム変換装置1
00に備えられているとしたが、特殊演算対応表104
は、外部のファイルに格納された所定の情報に基づきプ
ログラム変換装置100によって生成されることとして
もよい。従って、実施の形態では、ソースプログラムに
おいてDSP命令を使う場合は、特殊演算対応表104
に記憶されている関数名の関数を呼び出す旨の記述を行
うという取り決めに従ってソースプログラムが作成され
ているものという前提をおいたが、逆に、ソースプログ
ラム中でDSP命令を使うために、引数を渡してある関
数名の関数を呼び出す旨の記述をしたならば、その引数
と関数名とに関する情報をファイルに格納してプログラ
ム変換装置100に供給することとしてもよい。この場
合、供給されたファイルを参照してプログラム変換装置
100は、特殊演算対応表104を作成する。
(4) In the embodiment, the special operation correspondence table 1
04 is a program conversion device 1
00, but the special operation correspondence table 104
May be generated by the program conversion device 100 based on predetermined information stored in an external file. Therefore, in the embodiment, when the DSP instruction is used in the source program, the special operation correspondence table 104
It is assumed that the source program is created in accordance with the convention that the function with the function name stored in the source program is described. However, in order to use the DSP instruction in the source program, After the description that the function having the passed function name is to be called is described, information regarding the argument and the function name may be stored in a file and supplied to the program conversion device 100. In this case, the program conversion device 100 creates the special operation correspondence table 104 with reference to the supplied file.

【0022】(5)実施の形態における機械語変換表1
07には、例えば、「satadd」という特殊演算用
の中間コードが「sadd」という飽和加算命令と対応
づけられているように、中間コードと機械語命令とが対
応づけられていることとしたが、従来のプログラム変換
装置と同等レベルの一般的な中間コードと機械語命令と
の対応関係を除く、特殊演算用の中間コードと機械語命
令との対応関係に関する情報は、外部のファイルに格納
された所定の情報に基づきプログラム変換装置100に
よって生成されることとしてもよい。例えば、DSP関
数を呼び出す旨のソースプログラム中の記述を手掛かり
とし、DSP関数の本体である機械語プログラムモジュ
ールが格納されているファイルを参照することにより、
当該DSP関数に関する中間コードの変換結果となる機
械語命令を特定することとしてもよい。また、プログラ
ム変換装置100は、機械語変換表107を複数備えて
切り替えて用いることにすれば、複数の異なるプロセッ
サに対応する機械語命令列を出力することができる。
(5) Machine language conversion table 1 in the embodiment
07, for example, the intermediate code and the machine language instruction are associated with each other such that the intermediate code for special operation "saddadd" is associated with the saturation addition instruction "sadd". Except for the correspondence between general intermediate codes and machine instructions at the same level as the conventional program converter, information on the correspondence between intermediate codes for special operations and machine instructions is stored in an external file. Alternatively, it may be generated by the program conversion device 100 based on the predetermined information. For example, by using the description in the source program to call the DSP function as a clue and referring to the file storing the machine language program module that is the main body of the DSP function,
A machine language instruction that is a conversion result of the intermediate code related to the DSP function may be specified. In addition, if the program conversion device 100 is provided with a plurality of machine language conversion tables 107 and switches between them, it can output a machine language instruction sequence corresponding to a plurality of different processors.

【0023】(6)実施の形態では、特殊演算処理を行
なうDSP関数を一般の関数と同様の呼出記述をもって
記述したソースプログラムを変換対象としたが、DSP
関数が、C++言語の多重定義演算子として定義されて
いるようなソースプログラムを変換対象とすることもで
きる。多重定義演算子は本質的に関数と同等であり、第
1次的には関数を呼び出す旨の中間コードに変換される
ものだからである。なお、多重定義演算子を用いるとプ
ログラムの可読性は高まる。ちなみに、図1に示したソ
ースプログラムをC++言語の多重定義演算子を用いて
記述した例を図11に示す。
(6) In the embodiment, the source program in which the DSP function for performing the special operation processing is described with the same call description as the general function is the conversion target.
A source program whose function is defined as an overloaded operator in the C ++ language can be converted. This is because an overloaded operator is essentially equivalent to a function, and is primarily converted to an intermediate code for calling the function. Note that the use of the overloaded operator increases the readability of the program. Incidentally, FIG. 11 shows an example in which the source program shown in FIG. 1 is described using the overloaded operator of the C ++ language.

【0024】(7)実施の形態では、中間コードが演算
子又はオペランドの意味を有するものであれば、中間コ
ード最適化部105はその中間コードを共通部分式の削
除等の最適化の対象とすることとしたが、この中間コー
ド段階における最適化と同様のことを、中間コードを機
械語命令列に翻訳した後に、中間コードに関する全ての
情報を利用することにより行うこととしてもよい。
(7) In the embodiment, if the intermediate code has the meaning of an operator or an operand, the intermediate code optimizing unit 105 sets the intermediate code as an object of optimization such as deletion of a common subexpression. However, the same operation as the optimization at the intermediate code stage may be performed by translating the intermediate code into a machine language instruction sequence and using all information on the intermediate code.

【0025】(8)実施の形態におけるプログラム変換
装置の処理手順(図6、図7のフローチャートの手順
等)を機械語プログラムにより実現し、これを記録媒体
に記録して流通・販売の対象にしても良い。このような
記録媒体には、ICカード、光ディスク、フレキシブル
ディスク、ROM等があるが、これらに記録された機械
語プログラムは、汎用のコンピュータにインストールさ
れることにより利用に供される。即ち、汎用のコンピュ
ータは、インストールした上記機械語プログラムを逐次
実行して、実施の形態に示したようなプログラム変換装
置を実現する。また、汎用のコンピュータに上述のプロ
グラム変換装置の処理手順を実行させるためのコンピュ
ータプログラムは、ハードディスク等の記録媒体及び通
信回線等を介してオンラインで流通させ頒布することも
できる。
(8) The processing procedure of the program conversion device according to the embodiment (the procedure of the flowcharts in FIGS. 6 and 7) is realized by a machine language program, and this is recorded on a recording medium and made available for distribution and sale. May be. Such a recording medium includes an IC card, an optical disk, a flexible disk, a ROM, and the like. The machine language program recorded on these is used by being installed in a general-purpose computer. That is, the general-purpose computer sequentially executes the installed machine language programs to realize the program conversion device as described in the embodiment. In addition, a computer program for causing a general-purpose computer to execute the processing procedure of the above-described program conversion device can be distributed online and distributed via a recording medium such as a hard disk, a communication line, or the like.

【0026】[0026]

【発明の効果】以上の説明から明らかなように、本発明
に係るプログラム変換装置は、高級言語における算術演
算の演算子とオペランドとからなる記述を適用対象とす
る最適化を行い高級言語で記述されたソースプログラム
をプロセッサ用の機械語命令列に変換するプログラム変
換装置であって、引数を渡して所定関数名の関数を呼び
出す旨の前記ソースプログラム中の特定関数呼出記述に
ついて最適化の適用の面において、当該引数をオペラン
ドと同等に扱い、当該特定関数呼出記述を、オペランド
と当該オペランドに算術演算を行う演算子との組と同等
に扱うことにより、前記ソースプログラムを最適化され
た機械語命令列に変換することを特徴とする。これによ
り、引数を渡してDSP関数を呼び出す旨のソースプロ
グラム中の記述を、単なる関数呼出としてではなく、高
級言語で記述可能な「x+y」等の演算子及びオペラン
ドと同等に最適化適用対象とするため、DSP関数の処
理内容が演算であるという特質を生かした最適化が行え
る。従って、本発明に係るプログラム変換装置は、DS
P関数を呼び出す旨の記述を通常の関数呼出と同様に扱
う従来のプログラム変換装置と比べて、DSP関数を呼
び出す旨の記述を含むソースプログラムを実行効率の良
い機械語命令列に変換することができる。
As is apparent from the above description, the program conversion device according to the present invention performs optimization for a description including an operator and an operand of an arithmetic operation in a high-level language, and describes the high-level language. A program conversion device for converting the source program into a machine language instruction sequence for a processor, the method including applying an optimization to a specific function call description in the source program to call a function having a predetermined function name by passing an argument. In the aspect, by treating the argument equivalent to an operand and treating the specific function call description equivalent to a set of an operand and an operator performing an arithmetic operation on the operand, the source program is optimized. It is characterized by conversion into an instruction sequence. As a result, the description in the source program indicating that the DSP function is to be called by passing the argument is not simply a function call, but is equivalent to an optimization target such as "x + y" or an operator and an operand that can be described in a high-level language. Therefore, optimization can be performed taking advantage of the characteristic that the processing content of the DSP function is an operation. Therefore, the program conversion device according to the present invention has a DS
Compared to a conventional program conversion device that handles a description of calling a P function in the same way as a normal function call, it is possible to convert a source program including a description of calling a DSP function into a machine language instruction sequence with high execution efficiency. it can.

【0027】ここで、前記プログラム変換装置は、前記
特定関数呼出記述を、最適化を行うに際し算術演算の演
算子とオペランドとであると扱われるべき特性を有する
中間コードに変換する変換手段と、前記ソースプログラ
ム中における前記特定関数呼出記述以外の部分を中間コ
ードに変換する一般変換手段と、前記変換手段及び前記
一般変換手段による変換により生じた中間コードに基づ
いて最適化を行うことにより最適化された中間コードを
生成する最適化手段と、前記最適化手段により生成され
た中間コードを機械語命令列に変換する機械語変換手段
とを備えることとすることができる。これにより、引数
を渡してDSP関数を呼び出す旨のソースプログラム中
の記述に基づいて、演算子とオペランドとを意味する情
報を有する特殊演算用の中間コードを生成するので、演
算子又はオペランドであることに基づいて適用すること
が可能となる中間コード段階での最適化が、特殊演算用
の中間コードに適用することができる。従って、本発明
に係るプログラム変換装置は、従来のプログラム変換装
置と比べて、DSP関数を呼び出す旨の記述を含むソー
スプログラムを、一層最適化された中間コードに変換す
ることができる。また、一般に、関数呼出の中間コード
を機械語命令に翻訳する場合、引数及び戻り値の受渡し
に使用するレジスタが予め決められている。このため、
DSP関数呼出の中間コードのままでは、機械語命令に
翻訳する段階で、レジスタ割り付けに制限が生じてしま
うが、本発明に係るプログラム変換装置では、この関数
呼出の中間コードを特殊演算用の中間コードに変換する
ため、機械語命令への翻訳段階でもレジスタ割り付けの
制限を受けず最適なレジスタ割り付けが行える。
Here, the program conversion device converts the specific function call description into an intermediate code having characteristics to be treated as an operator and an operand of an arithmetic operation when performing optimization. General conversion means for converting a part other than the specific function call description in the source program into intermediate code, and optimization by performing optimization based on the conversion means and the intermediate code generated by the conversion by the general conversion means Optimizing means for generating the generated intermediate code, and machine language converting means for converting the intermediate code generated by the optimizing means into a machine language instruction sequence. Thereby, an intermediate code for a special operation having information meaning an operator and an operand is generated based on the description in the source program that the DSP function is to be called by passing the argument. The optimization at the intermediate code stage, which can be applied based on the above, can be applied to the intermediate code for special operation. Therefore, the program conversion device according to the present invention can convert a source program including a description for calling a DSP function into a more optimized intermediate code as compared with the conventional program conversion device. In general, when translating an intermediate code of a function call into a machine language instruction, a register used for passing arguments and a return value is predetermined. For this reason,
If the intermediate code of the DSP function call is left as it is, there will be a restriction on register allocation at the stage of translating into a machine language instruction. However, the program conversion device according to the present invention converts the intermediate code of the function call into an intermediate Since it is converted into a code, optimal register allocation can be performed without being restricted by register allocation even at the stage of translation into machine language instructions.

【0028】また、前記変換手段は、引数を渡して所定
の関数名の関数を呼び出す旨の情報を含む中間コードA
と、最適化を行うに際し算術演算の演算子とオペランド
とであると扱われるべき特性を有する中間コードBとを
対応づけた対応関係情報を予め記憶する対応表記憶部
と、前記ソースプログラム中における関数を呼び出す旨
の記述を、関数を呼び出す旨の情報と呼び出す関数の関
数名を示す情報とを含む中間コードに変換する第1次変
換部と、前記対応表記憶部に記憶されている前記対応関
係情報を参照し、前記第1次変換部による変換により生
じた中間コードが、引数を渡して所定の関数名の関数を
呼び出す旨の情報を含む中間コードAであったときに
は、当該中間コードを、これに対応する中間コードBに
変換する第2次変換部とを有し、前記最適化手段は、算
術演算の演算子とオペランドとについての中間コードを
最適化の適用対象とするものであり、算術演算の演算子
とオペランドとであると扱われるべき特性を有する中間
コードを、算術演算の演算子とオペランドとについての
中間コードと同等な最適化の適用対象として最適化を行
うこととすることもできる。これにより、本発明に係る
プログラム変換装置は、DSP関数を呼び出す旨の情報
を含む中間コードとこれを変換した後の中間コードとの
対応関係を予め記憶し、これを参照して、中間コードの
変換を行うものであるため、この記憶内容を追加更新す
れば、多様なDSP関数の呼出記述を、最適化の適用の
面で演算と同様に扱うことができるようになる。
Further, the conversion means includes an intermediate code A including information indicating that a function having a predetermined function name is to be called by passing an argument.
And a correspondence table storage unit that stores in advance correspondence information in which an intermediate code B having a characteristic to be treated as an operator of an arithmetic operation and an operand when performing optimization is stored. A primary conversion unit for converting a description of calling a function into an intermediate code including information indicating that the function is to be called and information indicating a function name of the function to be called, and a correspondence table stored in the correspondence table storage unit Referring to the relation information, if the intermediate code generated by the conversion by the primary conversion unit is the intermediate code A including information indicating that a function having a predetermined function name is to be passed by passing an argument, the intermediate code is referred to as an intermediate code. , A secondary conversion unit for converting the intermediate code into a corresponding intermediate code B, and the optimizing means sets the intermediate code for the operator and the operand of the arithmetic operation to the optimization target. And optimizes an intermediate code having characteristics that should be treated as an arithmetic operator and an operand, as a target to which the same optimization as the intermediate code for the arithmetic operator and the operand is applied. It can also be. Thereby, the program conversion device according to the present invention stores in advance the correspondence between the intermediate code including the information indicating that the DSP function is to be called and the converted intermediate code, and refers to this to refer to the intermediate code. Since conversion is performed, if this storage content is additionally updated, various DSP function call descriptions can be handled in the same way as operations in terms of application of optimization.

【0029】また、前記所定の関数名の関数は、積和演
算及び飽和演算を含むディジタル信号処理用の演算のい
ずれかを実行することを処理内容とする関数であり、前
記プロセッサは、ディジタル信号処理用の演算命令を解
読し実行することができるものであり、前記機械語変換
手段は、中間コードBをディジタル信号処理用の演算命
令に変換することとすることもできる。また、前記最適
化手段によりなされる最適化は、共通部分式の削除、定
数伝搬、又はコピー伝搬を含むこととすることもでき
る。これにより、プログラム作成者は、積和演算、飽和
演算等のディジタル信号処理用の演算命令を解読実行可
能なプロセッサに対応して、これらの演算を実行させる
ようなプログラムを作成するに当たり、記述容易性、移
植容易性等に鑑みプログラムを高級言語で記述しても、
効率の良いコードを得ることができる。即ち、ディジタ
ル信号処理用の演算命令を、所定の関数の呼出の形式で
記述することにより、通常の演算と同様に共通部分式の
削除、定数伝搬、コピー伝搬等の最適化が行われ、効率
の良い機械語命令列に変換されることが保証される。
Further, the function having the predetermined function name is a function whose processing content is to execute any one of digital signal processing operations including a product-sum operation and a saturation operation. The machine language conversion means can decode and execute a processing operation instruction, and the machine language conversion means can convert the intermediate code B into a digital signal processing operation instruction. Further, the optimization performed by the optimizing means may include deletion of a common sub-expression, constant propagation, or copy propagation. In this way, the program creator can easily write a program to execute a digital signal processing operation instruction such as a product-sum operation or a saturation operation in response to a processor capable of decoding and executing the operation. Even if the program is written in a high-level language in consideration of portability, portability, etc.,
You can get efficient code. That is, by describing the operation instruction for digital signal processing in the form of calling a predetermined function, optimization such as deletion of common sub-expressions, constant propagation, copy propagation, etc. is performed in the same manner as in normal operation, and efficiency is improved. It is guaranteed to be converted into a good machine language instruction sequence.

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

【図1】DSP関数を呼び出す旨の記述を含むソースプ
ログラムの例を示す図である。
FIG. 1 is a diagram showing an example of a source program including a description for calling a DSP function.

【図2】図1に示すソースプログラムに対応してプログ
ラム変換装置により生成される中間コードの例を示す図
である。
FIG. 2 is a diagram showing an example of an intermediate code generated by a program conversion device corresponding to the source program shown in FIG.

【図3】本発明の実施の形態に係るプログラム変換装置
100の機能ブロック図である。
FIG. 3 is a functional block diagram of the program conversion device 100 according to the embodiment of the present invention.

【図4】特殊演算対応表104の内容を示す図である。FIG. 4 is a diagram showing the contents of a special operation correspondence table 104;

【図5】機械語変換表107の内容を示す図である。FIG. 5 is a diagram showing the contents of a machine language conversion table 107;

【図6】プログラム変換装置100の動作を示すフロー
チャートである。
FIG. 6 is a flowchart showing an operation of the program conversion device 100.

【図7】特殊演算処理部103の行うDSP関数呼出の
中間コードの変換処理を示すフローチャートである。
FIG. 7 is a flowchart showing a conversion process of an intermediate code of a DSP function call performed by the special operation processing unit 103;

【図8】特殊演算処理部103により変換された後の中
間コードの例を示す図である。
FIG. 8 is a diagram illustrating an example of an intermediate code after being converted by a special operation processing unit 103;

【図9】図8に示す中間コードに対する中間コード最適
化部105による処理結果を示す図である。
9 is a diagram illustrating a processing result of the intermediate code illustrated in FIG. 8 by the intermediate code optimization unit 105. FIG.

【図10】図9に示す中間コードを翻訳部106で機械
語命令列に変換した結果を示す図である。
FIG. 10 is a diagram showing a result of converting the intermediate code shown in FIG. 9 into a machine language instruction sequence by a translating unit 106.

【図11】図1に示したソースプログラムをC++言語
の多重定義演算子を用いて記述した例を示す図である。
11 is a diagram showing an example in which the source program shown in FIG. 1 is described using a C ++ language overloaded operator.

【図12】従来のプログラム変換装置の機能ブロック図
である。
FIG. 12 is a functional block diagram of a conventional program conversion device.

【図13】従来のプログラム変換装置900における翻
訳部905の出力の例を示す図である。
FIG. 13 is a diagram showing an example of an output of a translation unit 905 in a conventional program conversion device 900.

【図14】従来のプログラム変換装置900におけるD
SP関数展開部906の処理結果の例を示す図である。
FIG. 14 is a diagram showing D in a conventional program conversion device 900;
FIG. 14 is a diagram illustrating an example of a processing result of an SP function expanding unit 906.

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

100 プログラム変換装置 101 入力ファイル 102 中間コード生成部 103 特殊演算処理部 104 特殊演算対応表 105 中間コード最適化部 106 翻訳部 107 機械語変換表 108 出力ファイル 900 プログラム変換装置 901 入力ファイル 902 機械語DSP関数格納ファイル 903 中間コード生成部 904 中間コード最適化部 905 翻訳部 906 DSP関数展開部 907 出力ファイル REFERENCE SIGNS LIST 100 program conversion device 101 input file 102 intermediate code generation unit 103 special operation processing unit 104 special operation correspondence table 105 intermediate code optimization unit 106 translation unit 107 machine language conversion table 108 output file 900 program conversion device 901 input file 902 machine language DSP Function storage file 903 Intermediate code generator 904 Intermediate code optimizer 905 Translator 906 DSP function expander 907 Output file

───────────────────────────────────────────────────── フロントページの続き (72)発明者 漆原 誠一 大阪府門真市大字門真1006番地 松下電器 産業株式会社内 (72)発明者 春名 修介 大阪府門真市大字門真1006番地 松下電器 産業株式会社内 Fターム(参考) 5B081 AA06 AA09 CC16 CC22 CC28 CC41  ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Seiichi Urushibara 1006 Kazuma Kadoma, Osaka Pref. Matsushita Electric Industrial Co., Ltd. Terms (reference) 5B081 AA06 AA09 CC16 CC22 CC28 CC41

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 高級言語における算術演算の演算子とオ
ペランドとからなる記述を適用対象とする最適化を行い
高級言語で記述されたソースプログラムをプロセッサ用
の機械語命令列に変換するプログラム変換装置であっ
て、 引数を渡して所定関数名の関数を呼び出す旨の前記ソー
スプログラム中の特定関数呼出記述について最適化の適
用の面において、当該引数をオペランドと同等に扱い、
当該特定関数呼出記述を、オペランドと当該オペランド
に算術演算を行う演算子との組と同等に扱うことによ
り、前記ソースプログラムを最適化された機械語命令列
に変換することを特徴とするプログラム変換装置。
1. A program conversion device for optimizing a description of an arithmetic operation operator and an operand in a high-level language as an application object and converting a source program described in the high-level language into a machine language instruction sequence for a processor. In the application of optimization for a specific function call description in the source program that calls a function of a predetermined function name by passing an argument, treat the argument in the same manner as an operand,
Converting the source program into an optimized machine language instruction sequence by treating the specific function call description as equivalent to a set of an operand and an operator performing an arithmetic operation on the operand apparatus.
【請求項2】 前記プログラム変換装置は、 前記特定関数呼出記述を、最適化を行うに際し算術演算
の演算子とオペランドとであると扱われるべき特性を有
する中間コードに変換する変換手段と、 前記ソースプログラム中における前記特定関数呼出記述
以外の部分を中間コードに変換する一般変換手段と、 前記変換手段及び前記一般変換手段による変換により生
じた中間コードに基づいて最適化を行うことにより最適
化された中間コードを生成する最適化手段と、 前記最適化手段により生成された中間コードを機械語命
令列に変換する機械語変換手段とを備えることを特徴と
する請求項1記載のプログラム変換装置。
2. The program conversion device, wherein the conversion unit converts the specific function call description into an intermediate code having characteristics to be treated as an operator and an operand of an arithmetic operation when performing optimization. General conversion means for converting a part other than the specific function call description in the source program into intermediate code; and optimization by performing optimization based on the intermediate code generated by the conversion by the conversion means and the general conversion means. 2. The program conversion device according to claim 1, further comprising: an optimization unit configured to generate the intermediate code, and a machine language conversion unit configured to convert the intermediate code generated by the optimization unit into a machine language instruction sequence.
【請求項3】 前記変換手段は、 引数を渡して所定の関数名の関数を呼び出す旨の情報を
含む中間コードAと、最適化を行うに際し算術演算の演
算子とオペランドとであると扱われるべき特性を有する
中間コードBとを対応づけた対応関係情報を予め記憶す
る対応表記憶部と、 前記ソースプログラム中における関数を呼び出す旨の記
述を、関数を呼び出す旨の情報と呼び出す関数の関数名
を示す情報とを含む中間コードに変換する第1次変換部
と、 前記対応表記憶部に記憶されている前記対応関係情報を
参照し、前記第1次変換部による変換により生じた中間
コードが、引数を渡して所定の関数名の関数を呼び出す
旨の情報を含む中間コードAであったときには、当該中
間コードを、これに対応する中間コードBに変換する第
2次変換部とを有し、 前記最適化手段は、算術演算の演算子とオペランドとに
ついての中間コードを最適化の適用対象とするものであ
り、算術演算の演算子とオペランドとであると扱われる
べき特性を有する中間コードを、算術演算の演算子とオ
ペランドとについての中間コードと同等な最適化の適用
対象として最適化を行うことを特徴とする請求項2記載
のプログラム変換装置。
3. The conversion means is treated as an intermediate code A including information indicating that a function having a predetermined function name is called by passing an argument, and an operator and an operand of an arithmetic operation in performing optimization. A correspondence table storage unit that stores in advance correspondence relation information in which an intermediate code B having a power characteristic is associated; information that calls a function in the source program; A primary conversion unit that converts the intermediate code into an intermediate code that includes information indicating the following. The intermediate code generated by the conversion by the primary conversion unit is referred to by referring to the correspondence information stored in the correspondence table storage unit. When the intermediate code A includes information indicating that a function having a predetermined function name is to be called by passing an argument, a secondary conversion unit that converts the intermediate code into an intermediate code B corresponding thereto is provided. Wherein the optimizing means applies an intermediate code for an operator and an operand of an arithmetic operation to an optimization target, and has a property to be treated as an operator and an operand of the arithmetic operation. 3. The program conversion device according to claim 2, wherein the intermediate code is optimized by applying the same optimization to the intermediate code as to the operators and operands of the arithmetic operation.
【請求項4】 前記所定の関数名の関数は、積和演算及
び飽和演算を含むディジタル信号処理用の演算のいずれ
かを実行することを処理内容とする関数であり、 前記プロセッサは、ディジタル信号処理用の演算命令を
解読し実行することができるものであり、 前記機械語変換手段は、中間コードBをディジタル信号
処理用の演算命令に変換することを特徴とする請求項3
記載のプログラム変換装置。
4. The function having the predetermined function name is a function whose processing content is to execute any one of digital signal processing operations including a product-sum operation and a saturation operation. 4. A processing instruction capable of decoding and executing a processing operation instruction, wherein the machine language conversion means converts the intermediate code B into an operation instruction for digital signal processing.
The program conversion device according to the above.
【請求項5】 前記最適化手段によりなされる最適化
は、共通部分式の削除、定数伝搬、又はコピー伝搬を含
むことを特徴とする請求項2〜4のいずれか1項に記載
のプログラム変換装置。
5. The program conversion according to claim 2, wherein the optimization performed by the optimizing means includes common sub-expression elimination, constant propagation, or copy propagation. apparatus.
【請求項6】 高級言語における算術演算の演算子とオ
ペランドとからなる記述を適用対象とする最適化を行い
高級言語で記述されたソースプログラムをプロセッサ用
の機械語命令列に変換するプログラム変換処理を、コン
ピュータに実行させるための制御プログラムを記録した
記録媒体であって、 前記プログラム変換処理は、引数を渡して所定関数名の
関数を呼び出す旨の前記ソースプログラム中の特定関数
呼出記述について最適化の適用の面において、当該引数
をオペランドと同等に扱い、当該特定関数呼出記述を、
オペランドと当該オペランドに算術演算を行う演算子と
の組と同等に扱うことにより、前記ソースプログラムを
最適化された機械語命令列に変換する処理であることを
特徴とする記録媒体。
6. A program conversion process for optimizing a description made up of an arithmetic operation operator and an operand in a high-level language as an object to convert a source program described in the high-level language into a machine language instruction sequence for a processor. Is a recording medium recording a control program for causing a computer to execute, wherein the program conversion process optimizes a specific function call description in the source program to call a function having a predetermined function name by passing an argument. In terms of application of, the argument is treated the same as an operand, and the specific function call description is
A recording medium for converting the source program into an optimized machine language instruction sequence by treating the same as a set of an operand and an operator performing an arithmetic operation on the operand.
JP10222657A 1998-08-06 1998-08-06 Program conversion device Pending JP2000056981A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10222657A JP2000056981A (en) 1998-08-06 1998-08-06 Program conversion device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10222657A JP2000056981A (en) 1998-08-06 1998-08-06 Program conversion device

Publications (1)

Publication Number Publication Date
JP2000056981A true JP2000056981A (en) 2000-02-25

Family

ID=16785893

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10222657A Pending JP2000056981A (en) 1998-08-06 1998-08-06 Program conversion device

Country Status (1)

Country Link
JP (1) JP2000056981A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7284241B2 (en) 2002-08-02 2007-10-16 Matsushita Electric Industrial Co., Ltd. Compiler, compiler apparatus and compilation method
US7350165B2 (en) 2004-03-29 2008-03-25 Matsushita Electric Industrial Co., Ltd. Compiler
JP2009037626A (en) * 2008-09-04 2009-02-19 Panasonic Corp compiler
US11886839B2 (en) 2020-01-07 2024-01-30 Fujitsu Limited Non-transitory computer-readable recording medium, function generation method, and information processing device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7284241B2 (en) 2002-08-02 2007-10-16 Matsushita Electric Industrial Co., Ltd. Compiler, compiler apparatus and compilation method
US8151254B2 (en) 2002-08-02 2012-04-03 Panasonic Corporation Compiler, compiler apparatus and compilation method
US7350165B2 (en) 2004-03-29 2008-03-25 Matsushita Electric Industrial Co., Ltd. Compiler
JP2009037626A (en) * 2008-09-04 2009-02-19 Panasonic Corp compiler
US11886839B2 (en) 2020-01-07 2024-01-30 Fujitsu Limited Non-transitory computer-readable recording medium, function generation method, and information processing device

Similar Documents

Publication Publication Date Title
US6738967B1 (en) Compiling for multiple virtual machines targeting different processor architectures
EP0806725B1 (en) Method and apparatus for early insertion of assembler code for optimization
JP4118456B2 (en) Program language processing system, code optimization method, and machine-readable storage medium
JP2002534735A (en) Generate a compiled program for an interpretive runtime environment
US8291397B2 (en) Compiler optimized function variants for use when return codes are ignored
KR20010086159A (en) Method for platform specific efficiency enhancement of java programs and software product therefor
JP2003196106A (en) Program conversion method, computer system and program
US6301652B1 (en) Instruction cache alignment mechanism for branch targets based on predicted execution frequencies
JPH0926884A (en) Method and apparatus for making required flow information usable during task requiring binary information
Araujo et al. Challenges in code generation for embedded processors
CN114237612B (en) Program code compiling method and device, electronic equipment and storage medium
US20050235270A1 (en) Method and apparatus for generating code for scheduling the execution of binary code
JP2000056981A (en) Program conversion device
KR100345401B1 (en) Method and apparatus for binary program translation
Leupers Compiler optimization for media processors
Sagonas et al. All you wanted to know about the HiPE compiler: (but might have been afraid to ask)
US20040045018A1 (en) Using address space bridge in postoptimizer to route indirect calls at runtime
KR0169909B1 (en) Method for designing assembly code generator for target processor
JP3542538B2 (en) Program optimization processing device and program optimization method
Ben Asher et al. The effect of unrolling and inlining for Python bytecode optimizations
JP2009181558A (en) Program converter
JPH0689187A (en) Inline expansion optimization method
Alex Matrix Multiplication is Almost All You Need
Canedo et al. Compiling for reduced bit-width queue processors
JP2003067195A (en) Optimization compile method and optimization compile device