JPH01180637A - Estimating system for instruction part - Google Patents

Estimating system for instruction part

Info

Publication number
JPH01180637A
JPH01180637A JP428788A JP428788A JPH01180637A JP H01180637 A JPH01180637 A JP H01180637A JP 428788 A JP428788 A JP 428788A JP 428788 A JP428788 A JP 428788A JP H01180637 A JPH01180637 A JP H01180637A
Authority
JP
Japan
Prior art keywords
data
instruction part
position information
program
instruction
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
JP428788A
Other languages
Japanese (ja)
Inventor
Hiroyuki Kon
近 浩幸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP428788A priority Critical patent/JPH01180637A/en
Publication of JPH01180637A publication Critical patent/JPH01180637A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To improve the executing efficiency of an object program by adding position information in accordance with the position of data when a data part is allocated on a desired device type forming an object in approximation of data and estimating an instruction part based on the position information. CONSTITUTION:A front end part 2 is started by a source program 1 and then produces an intermediate language 4. In this case, the position information is added to the operand of the data on the language 4 via a relative position deciding means 3. When a back end part 5 is started, the language 4 is supplied. An instruction part estimating means 6 is started based on the position information added to the language 4. Thus the part 6 estimates an optimum instruction part and at the same time produces an object program 7. Therefore, the estimating accuracy is improved for the instruction part and the waste of a branch system object is reduced. Then the scale of the program 7 is reduced and the program executing efficiency is improved.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は命令部を予測する方式に関し、特にコンパイラ
の目的プログラム生成過程におけるブランチ系の最適化
方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method for predicting an instruction part, and more particularly to a method for optimizing a branch system in the target program generation process of a compiler.

(従来の技術) 従来、命令部を予測する際にオブジェクトコードを生成
するときには、次のパルスで生成すれるデータ接近用の
オブジェクトがわからないため、そのオブジェクトコー
ドで生成される可能性のある命令数の最大値で当該オブ
ジェクトを予測しなければならなかった。
(Prior art) Conventionally, when generating an object code when predicting an instruction part, the data access object to be generated in the next pulse is not known, so the number of instructions that may be generated by the object code is not known. had to predict the object with the maximum value of .

(発明が解決しようとする課題) 上述した従来の命令部予測方式では、命令部を大きめに
予測しているため、ブランチ系の命令を生成するときに
無駄なオブジェクトを生成することが多くなり、目的プ
ログラムが大きくなって、そのプログラムの実行時効率
を低下させると云う欠点がある。
(Problems to be Solved by the Invention) In the conventional instruction part prediction method described above, since the instruction part is predicted to be large, unnecessary objects are often generated when branch-related instructions are generated. This has the disadvantage that the target program becomes large and the execution efficiency of the program decreases.

本発明の目的は、データ接近においてオブジェクトを構
成する目的機種上でデータ部を割付ける際にデータの位
置に応じて位置情報を付加し、付加された位置情報をも
とく命令部を予測することにより上記欠点を除去し、目
的プログラムの実行時に効率を低下させることがないよ
うに構成した命令部予測方式を提供することにある。
An object of the present invention is to add position information according to the position of data when allocating a data part on a target model that constitutes an object in data access, and to predict a command part based on the added position information. It is an object of the present invention to provide an instruction part prediction method that eliminates the above-mentioned drawbacks and is configured so as not to reduce efficiency when executing a target program.

(課題を解決するための手段) 本発明による命令部予測方式は相対位置判別手段と、命
令部予測手段とを具備して構成したものである。
(Means for Solving the Problems) The instruction part prediction method according to the present invention is configured to include a relative position determination means and an instruction part prediction means.

相対位置判別手段は、データ接近においてオブジェクト
を構成する目的機種上でデータ部を割付ける際に、デー
タの位置により位置情報を付加するためのものである。
The relative position determination means is for adding position information based on the position of data when allocating a data section on a target model constituting an object in data approach.

命令部予測手段は、相対位置判別手段により付加された
位置情報をもとにして命令部を予測するためのものであ
る。
The command part prediction means is for predicting the command part based on the position information added by the relative position determining means.

(実施例) 次に、本発明について図面を参照して説明する。(Example) Next, the present invention will be explained with reference to the drawings.

第1図は、本発明による命令部予測方式の一実施例を示
すブロック図である。第1図において、1は入力となる
ソースプログラム、2はフロントエンド部、3は相対位
置判別手段、4はフロントエンド部2によって生成され
た中間言語、5はバックエンド部、6は命令部予測手段
、7はバックエンド部5によって生成された目的プログ
ラムである。フロントエンド部2は相対位置判別手段3
を含み、バックエンド部5は命令部予測手段6を含むも
のである。
FIG. 1 is a block diagram showing an embodiment of an instruction part prediction method according to the present invention. In FIG. 1, 1 is an input source program, 2 is a front-end section, 3 is a relative position determination means, 4 is an intermediate language generated by the front-end section 2, 5 is a back-end section, and 6 is an instruction part prediction. Means 7 is an object program generated by the back end section 5. The front end section 2 is a relative position determining means 3
The back end section 5 includes an instruction section prediction means 6.

一般にソースプログラム1を入力して翻訳し、目的プロ
グラム7を生成するコンパイラは、大きく分けて2つの
部分から成立っている。ひとつはソースプログラム1を
入力し、それを翻訳し易い形式の中間言語4に変換する
フロントエンド部2であり、他は中間言語4を入力し、
機種依存の情報を付加して目的プログラム7を生成する
バックエンド部5である。第1図の実施例圧おいて、フ
ロントエンド部2とバックエンド部5とはコンパイラを
形成している。
In general, a compiler that inputs a source program 1, translates it, and generates a target program 7 is roughly divided into two parts. One is a front end unit 2 that inputs the source program 1 and converts it into an intermediate language 4 in a format that is easy to translate; the other inputs the intermediate language 4,
This is a back-end unit 5 that generates a target program 7 by adding model-dependent information. In the embodiment shown in FIG. 1, the front end section 2 and the back end section 5 form a compiler.

第1図においてソースプログラム1を用いてフロントエ
ンド部2を起動すると、フロントエンド部2は中間言語
4を生成する。この際、相対位置判別手段3により中間
言語4のデータのオペランドに位置情報を付加する。
In FIG. 1, when the front end section 2 is activated using the source program 1, the front end section 2 generates an intermediate language 4. At this time, position information is added to the operand of the data of the intermediate language 4 by the relative position determination means 3.

次ニバックエンド部5が起動されると、中間言語4が入
力される。そこで、中間言語4のなかに付加されている
位置情報をもとに命令部予測手段6が起動され、最適な
命令部の予測を行いながら目的プログラム7を生成する
Next, when the backend section 5 is activated, the intermediate language 4 is input. Therefore, the instruction part prediction means 6 is activated based on the position information added to the intermediate language 4, and generates the target program 7 while predicting the optimum instruction part.

以上が、第1図の概略である。The above is the outline of FIG.

第2図は第1図の相対位置判別手段3の動作を示すフロ
ーチャートであり、第3図は第1図の命令部予測手段6
の動作を示すフローチャートである。
2 is a flowchart showing the operation of the relative position determining means 3 of FIG. 1, and FIG. 3 is a flowchart showing the operation of the relative position determining means 3 of FIG.
3 is a flowchart showing the operation of FIG.

次に、相対位置判別手段3および命令部予測手段6につ
いて、第2図および第3図を参照して詳細罠説明する。
Next, the relative position determining means 3 and the command part predicting means 6 will be explained in detail with reference to FIGS. 2 and 3.

第2図においてソースプログラム1を入力し、当該ソー
スプログラム中のデータ定義の割付け (を行うとき、
当該データのアドレスがその目的機種上で使用可能なデ
ィスプレイスメントより大きいか否かを第1ステツプで
比較する。上記データのアドレスが上記ディスプレイス
メントより大きいとき、当該データのオペランドに位置
情報を付加して中間言語4を生成する。
In Figure 2, when inputting source program 1 and assigning data definitions in the source program,
In the first step, it is compared whether the address of the data is larger than the displacement available on the target model. When the address of the data is larger than the displacement, position information is added to the operand of the data to generate intermediate language 4.

第3図において中間言語を入力し、第1ステツプで当該
データのオペランドにある位置情報を取込む。第2ステ
ツプでは上記位置情報の有無を判別し、第3ステツプに
入る。第3ステツプにおいて、位置情報が存在するとき
にはデータ接近用の命令が生成されるため、それを含め
て命令部を予測する。位置情報が存在しないときにはデ
ータ接近用の命令が生成されないため、このデータ接近
用の命令を含めずに命令部ピ予測して目的プログラムを
生成する。
In FIG. 3, the intermediate language is input, and the position information in the operand of the data is fetched in the first step. In the second step, the presence or absence of the above position information is determined, and the process proceeds to the third step. In the third step, since a data access command is generated when position information exists, the command part is predicted including this command. When position information does not exist, no instruction for data access is generated, so the target program is generated by predicting the instruction part without including this instruction for data access.

第1図〜第3図により命令部の予測がより正確となり、
効率のよい目的プログラム7が生成される。
The prediction of the instruction part becomes more accurate according to FIGS. 1 to 3,
An efficient target program 7 is generated.

(発明の効果) 以上説明したように本発明は、データ接近においてオブ
ジェクトを構成する目的機種上でデータ部を割付ける際
にデータの位置に応じて位を情報を付加し、付加された
位置情報をもとに命令部を予測することにより、命令部
の予測が正確になり、ブランチ系のオブジェクトが効率
よくなるため実行時効率が向上し、生成された目的プロ
グラムが小さくなると云う効果がある。
(Effects of the Invention) As explained above, the present invention adds position information according to the position of data when allocating a data section on a target model that constitutes an object in data access, and adds position information to the added position information. By predicting the instruction part based on the instruction part, the prediction of the instruction part becomes accurate, the branch-related objects become more efficient, the runtime efficiency improves, and the generated target program becomes smaller.

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

第1図は、本発明による命令部予測方式の一実施例を示
すブロック図である。 第2図は、第1図の相対位置判別手段の処理例を示すフ
ローチャートである。 第3図は、第1図の命令部予測手段の処理例を示すフロ
ーチャートである。 1・・・ソースプログラム 2・・・フロントエンド部 3・・・相対位置判別手段 4・・・中間言語 5・・・バックエンド部 6・・・命令部予測手段 7・・・目的プログラム 特許出願人  日本電気株式会社 代理人 弁理士 井 ノ ロ    壽才1図
FIG. 1 is a block diagram showing an embodiment of an instruction part prediction method according to the present invention. FIG. 2 is a flowchart showing a processing example of the relative position determining means of FIG. 1. FIG. 3 is a flowchart showing a processing example of the instruction part prediction means of FIG. 1...Source program 2...Front end section 3...Relative position determination means 4...Intermediate language 5...Back end section 6...Instruction part prediction means 7...Target program patent application Person NEC Co., Ltd. agent Patent attorney Inoro Jusai Figure 1

Claims (1)

【特許請求の範囲】[Claims]  データ接近においてオブジェクトを構成する目的機種
上でデータ部を割付ける際に前記データの位置により位
置情報を付加するための相対位置判別手段と、前記相対
位置判別手段により付加された位置情報をもとにして命
令部を予測するための命令部予測手段とを具備して構成
したことを特徴とする命令部予測方式。
Relative position determination means for adding position information based on the position of the data when allocating the data section on the target model constituting the object in data approach; An instruction part prediction method comprising: an instruction part prediction means for predicting an instruction part.
JP428788A 1988-01-12 1988-01-12 Estimating system for instruction part Pending JPH01180637A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP428788A JPH01180637A (en) 1988-01-12 1988-01-12 Estimating system for instruction part

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP428788A JPH01180637A (en) 1988-01-12 1988-01-12 Estimating system for instruction part

Publications (1)

Publication Number Publication Date
JPH01180637A true JPH01180637A (en) 1989-07-18

Family

ID=11580311

Family Applications (1)

Application Number Title Priority Date Filing Date
JP428788A Pending JPH01180637A (en) 1988-01-12 1988-01-12 Estimating system for instruction part

Country Status (1)

Country Link
JP (1) JPH01180637A (en)

Similar Documents

Publication Publication Date Title
EP0646864A1 (en) Optimising compiler
JPH1097430A (en) Method and system for inserting assembly code routine into source code routine for optimization
US8752056B2 (en) Running native code across single or multi-core hybrid processor achitecture
JP2001166947A (en) Compile processing system
US6425124B1 (en) Resource allocation device for reducing the size and run time of a machine language program
JPH10293692A (en) Data prefetch method for multiple loop, processor and program generating method
US6134708A (en) Program compilation execution system
JPH01180637A (en) Estimating system for instruction part
JP3049814B2 (en) Microcomputer language processor
JP3840149B2 (en) Compiler, arithmetic processing system, and arithmetic processing method
JPH01118931A (en) Program conversion system
JPH06202875A (en) Compiler for attaining optimization with in-line expansion
JPH01100633A (en) Purpose program generating system
JP3206535B2 (en) Measured value display method of performance measurement tool
JPH07105013A (en) Register allocation system
JPS6155738A (en) Determining system of operation mode
JP2003067195A (en) Optimization compile method and optimization compile device
JPH0795273B2 (en) Partial expansion processing method of sum calculation in compiler
JPH0573335A (en) Automatic in-line development system for program
JPH0337726A (en) Case statement optimizing system
JPH0792757B2 (en) Optimal data allocation method
JPH0383140A (en) Arithmetic formula expanding system
JPH04320535A (en) Program forming device
JPH02146688A (en) Hash collision evading system in data driven microprocessor
JPS62182843A (en) Fast compiling/linking system