JPH0357022A - Arithmetic processing system - Google Patents

Arithmetic processing system

Info

Publication number
JPH0357022A
JPH0357022A JP19136389A JP19136389A JPH0357022A JP H0357022 A JPH0357022 A JP H0357022A JP 19136389 A JP19136389 A JP 19136389A JP 19136389 A JP19136389 A JP 19136389A JP H0357022 A JPH0357022 A JP H0357022A
Authority
JP
Japan
Prior art keywords
operation mode
arithmetic
type
binary
types
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
JP19136389A
Other languages
Japanese (ja)
Inventor
Kazuko Kadoi
角井 和子
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 JP19136389A priority Critical patent/JPH0357022A/en
Publication of JPH0357022A publication Critical patent/JPH0357022A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To shorten the execution time by determining the operation mode in each intermediate word of an arithmetic formula and determining one operation mode for the arithmetic formula. CONSTITUTION:At the time of recognizing the arithmetic formula, which has operands of respective types to have plural types as the whole, in a source program from a source file 4, a compiler 1 starts an operation mode determining means 2. This means 2 recognizes types of individual operands of the arithmetic formula and determines the binary or decimal operation mode in accordance with the combination of these types at the time of executing the arithmetic system and outputs this operation mode before outputting an intermediate word to an intermediate word file 5. When an object generating means 3 is started, the operation mode of the arithmetic formula is recognized by the intermediate word file 5 and generates an object for type conversion, which adapts operands which do not accord with this operation mode to this operation mode, and an object for operation and outputs them to an object file 6. Thus, the execution time is shortened.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は複数の型を持つ言語の言語処理プロセッサーに
おけるオブジェクト生成方式に関し,特に複数の型を持
った算術式の演算処理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an object generation method in a language processor for a language having multiple types, and more particularly to an arithmetic processing method for arithmetic expressions having multiple types.

〔従来の技術〕[Conventional technology]

従来,この種の演算処理方式では,ソースプログラムに
記述されたー算術命令は,中間語においては複数の2項
演算と転記命令に分解され,2項演算形式の中間語のオ
ペランドの型が2コとも2進型の場合は演算モードを2
進型とし,それ以外の場合は10進型としている。そし
て,演算モードと違うオペランドに対して演算モードを
合わせるために.演算モードと同じ型に変換するオブジ
ェクトを出力する。これらの演算モードの決定と型変換
の処理を各中間語毎に行っている。
Conventionally, in this type of arithmetic processing method, an arithmetic instruction written in a source program is decomposed into multiple binary operations and transcription instructions in the intermediate language, and the type of the operand of the intermediate word in the binary operation format is 2. If both are binary type, set the calculation mode to 2.
It is in decimal format, otherwise it is in decimal format. And in order to match the operation mode to the operand that is different from the operation mode. Outputs an object to be converted to the same type as the calculation mode. These calculation mode determination and type conversion processes are performed for each intermediate word.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の演算処理方式では,一つの算術式として
の演算モードを決定するのではなく,各中間語毎に演算
モードを決定して,その演算モードに従った型変換のオ
ブジェクトを出力するので,複数のオペランドを持ち,
最初に行われる演算の一つのオペランドが2進型ではな
く,他の全てのオペランドが2進型のような算術式の場
合,各中間語毎の演算モードは全て2進型以外と決定さ
れ,型変換のオブジェクトが各中間語毎に出力される。
In the conventional arithmetic processing method described above, the arithmetic mode is not determined for a single arithmetic expression, but the arithmetic mode is determined for each intermediate word, and an object of type conversion according to that arithmetic mode is output. , has multiple operands,
If one operand of the first operation performed is not a binary type and all other operands are binary type arithmetic expressions, the operation mode for each intermediate word is determined to be other than binary type, A type conversion object is output for each intermediate word.

このため,オブジェクト効率が悪く,さらに,実行する
時間がかかるという問題点がある。
For this reason, there are problems in that object efficiency is poor and furthermore, it takes time to execute.

〔課題全解決するための手段〕[Means to solve all problems]

本発明の演算処理方式は,複数の型を持つ言語の言語処
理プロセッサにおける演算のオブジェクト生成において
,2項演算ではなく複数のオペランドを扱う演算で,各
々のオペランドが各々の型を持ち,式として複数の型を
持った算術式を入力して,各々のオペランドの型を認識
し,それらの型の組み合わせにより,その算術式を実行
するにあたっての演算モードを2進型かIQ進型かに決
定する演算モード決定手段と,前記手段で央定した2進
型か1o進型かの演算モードに従わないオペランドに対
して,演算モードに合わせる型変換のオブジェクト及び
演算を行うオブジェクIf生成するオブジェクト生成手
段を有することを特徴としている。
The arithmetic processing method of the present invention is an operation that handles multiple operands instead of a binary operation when generating objects for operations in language processors for languages with multiple types, where each operand has its own type and can be expressed as an expression. Inputs an arithmetic expression with multiple types, recognizes the type of each operand, and determines whether the arithmetic expression is executed in binary or IQ based on a combination of these types. an operation mode determining means for determining an operation mode, and an object for generating an object If for an operand that does not follow the operation mode of binary type or decimal type centrally determined by the means, an object for type conversion to match the operation mode and an object for performing the operation. It is characterized by having means.

〔実施例〕〔Example〕

本発明について実施例によって説明する。 The present invention will be explained by examples.

第1図を参照して1,本発明による演算処理方式は,コ
ンパイラ1,演算モード決定手段2.オブジェクト生戒
千段5,ソースファイル4,中間語ファイル5,オブジ
ェクトファイル6を備えている。
Referring to FIG. 1, 1. The arithmetic processing method according to the present invention includes a compiler 1, an arithmetic mode determining means 2. It has 5 object life rules, 4 source files, 5 intermediate language files, and 6 object files.

コンパイラ1はソースファイル4よりソースプログラム
中の2項演算ではなく複数のオペランドを扱う演算で,
各々のオペランドが各々の型を持ち式として複数の型を
持った算術式を認識したら,演算モード決定千段2を起
動する。
From source file 4, compiler 1 uses operations that handle multiple operands rather than binary operations in the source program.
When an arithmetic expression in which each operand has its own type and has a plurality of types as an expression is recognized, operation mode determination step 2 is activated.

演算モード決定手段2は算術式の各々のオペランドの型
を認識し,その型の組み合わせにより,その算術方式を
実行するにあたっての2進型か10進型かの演算モード
を一つ決定する。その後,中間語ファイル5へ,その算
術式の中間語全出力する前に,決定した演算モードを出
力する。
The operation mode determining means 2 recognizes the type of each operand of an arithmetic expression, and determines one operation mode, binary type or decimal type, for executing the arithmetic method based on a combination of the types. Thereafter, before outputting all intermediate words of the arithmetic expression to the intermediate language file 5, the determined operation mode is output.

コンパイラ1よりオブジェクト生成手段5が起動される
と,中間語ファイル5よシ算術式の演算モードを認識し
て,その算術式の演算モードに従わないオペランドに対
して演算モードに合わせる型変換のオブジェクトと演算
を行うオブジェクト’t生成し,オブジェクトファイル
6へ出力する。
When the object generation means 5 is activated by the compiler 1, the intermediate language file 5 recognizes the operation mode of the arithmetic expression, and converts the type of the operand that does not follow the operation mode of the arithmetic expression to match the operation mode. An object that performs the calculation is generated and output to the object file 6.

次に具体的な例を用いて説明する。Next, explanation will be given using a specific example.

第2図に,ソースファイル1中のソースプログラムの一
部を示す。
FIG. 2 shows part of the source program in source file 1.

第2図も参照して,.DATA−1は4バイトの2進型
データ,DATA−2は10進型データ,D A T 
A−5は2バイトの2進型データとして定義される。手
続き処理では,DATA−2とDATA−3金乗算した
結果と,DATA−1を加算した値をDATA−1に代
入する。コンパイラ1は算術命令( COMPUTFI
:命令)を認識すると演算モード決定千段2を起動する
。演算モード決定手段2は,2進型データと10進型デ
ータと2進型データとを計算した結果を2進型データに
代入することによって算術式のオペランドの型を知るこ
とにより,その算術式の演算モードを2進型か10進型
かに決定する。この演算モードを決定するには,例えば
第6図に示す表を弓いても良い。この場合,演算モード
は2進型となる。決定した演算モードを算術式の中間語
の前に,中間語ファイル5へ出方する。
See also Figure 2. DATA-1 is 4-byte binary data, DATA-2 is decimal data, DATA
A-5 is defined as 2-byte binary data. In the procedure process, the result of multiplying DATA-2 and DATA-3 by gold and the value obtained by adding DATA-1 are assigned to DATA-1. Compiler 1 uses arithmetic instructions (COMPUTFI
: command) is recognized, operation mode determination 1000 steps 2 is activated. The arithmetic mode determining means 2 determines the arithmetic expression by learning the type of the operand of the arithmetic expression by substituting the result of calculating the binary data, decimal data, and binary data into the binary data. Determine whether the operation mode is binary or decimal. To determine this calculation mode, for example, the table shown in FIG. 6 may be used. In this case, the calculation mode is binary. The determined operation mode is output to the intermediate language file 5 before the intermediate language of the arithmetic expression.

第4図に,中間語ファイル5において第2図の算術命令
( C!OMPUTm命令)に当る部分を示す。処理4
1は算術式の演算モードが2進型であること金意味する
。処理42はDATA−2とD A T A−5とを乗
算した結果iT#1に代入すること,処理45はDAT
A−1とT#1とを加算した結果をDATA−1に代入
することを意味する。オブジェクト生成手段3がコンパ
イラ1から起動されると,中間語ファイル5の処理41
を読み込み,算術式の演算モードが2進型であることを
認識する。処理42を読み込み,演算モードの2進型に
合わないオペランドであるDATA−2に対して,2進
型に合わせる型変換のオブジェクIf生成してから,乗
算するオブジェクトヲ生成する。処理46を読み込み,
演算モードの2進型に合わないオペランドはないので型
変換のオブジェクトは生成しないで,加算のオブジェク
If生成する。生成されたオブジェクトはオブジェクト
ファイル6へ出力する。
FIG. 4 shows a portion of the intermediate language file 5 that corresponds to the arithmetic instruction (C!OMPUTm instruction) in FIG. Processing 4
1 means that the operation mode of the arithmetic expression is binary. Process 42 multiplies DATA-2 and DATA A-5 and assigns the result to iT#1, and process 45 multiplies DATA
This means that the result of adding A-1 and T#1 is assigned to DATA-1. When the object generation means 3 is activated by the compiler 1, processing 41 of the intermediate language file 5 is performed.
and recognizes that the operation mode of the arithmetic expression is binary. The process 42 is read, and an object If for type conversion to match the binary type is generated for DATA-2, which is an operand that does not match the binary type of the operation mode, and then an object to be multiplied is generated. Read process 46,
Since there are no operands that do not match the binary type of the operation mode, an object for addition is generated without generating an object for type conversion. The generated object is output to the object file 6.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明では,算術式の各中間梧毎に
演算モードを決定し,その中間語毎にその演算モードに
合わせる型変換のオブジェクトk出力するのではなく,
算術式として一つの演算モードを決定することにより複
数のオペランドを持ち,最初に行われる演算の一つのオ
ペランドが2進型ではなく,他の全てのオペランドが2
進型のような算術式の場合,演算モードを2進型と決定
することで,2進型演算が行われるため実行時間が短縮
できるという効果がある。
As explained above, in the present invention, instead of determining the operation mode for each intermediate word of an arithmetic expression and outputting a type conversion object k that matches the operation mode for each intermediate word,
By determining one operation mode as an arithmetic expression, it has multiple operands, and one operand of the first operation performed is not binary, and all other operands are binary.
In the case of an arithmetic expression such as a base type arithmetic expression, determining the operation mode to be a binary type has the effect of reducing execution time because a binary type operation is performed.

4

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

第1図は本発明による演算処理方式の一実施例を示す全
体構成図,第2図は第1図に示すソースファイルの一部
を示す図,第3図は第1図に示す演算モード決定手段で
使用する演算モードを決定するために引く表を示す図,
第4図は第1図に示す中間語ファイルの一部を示す図で
ある。 1・・・コンパイラ,2・・・演算モード決定手段,6
・・・オブジェクト生成手段,4・・・ソースファイル
,5・・・中間語ファイル,6・・・オブジェクトファ
イル。 N−二“二,二〉′
Figure 1 is an overall configuration diagram showing one embodiment of the calculation processing method according to the present invention, Figure 2 is a diagram showing a part of the source file shown in Figure 1, and Figure 3 is the calculation mode determination shown in Figure 1. Diagram showing the table to be pulled to determine the mode of operation to be used by the means,
FIG. 4 is a diagram showing a part of the intermediate language file shown in FIG. 1. 1... Compiler, 2... Calculation mode determining means, 6
. . . object generation means, 4 . . . source file, 5 . . . intermediate language file, 6 . . . object file. N-2 "2, 2〉'

Claims (1)

【特許請求の範囲】[Claims] 1、複数の型を持つ言語の演算におけるオブジェクト生
成の際、複数のオペランドを扱う演算であり、各々のオ
ペランドが各々の型を持ち、複数の型を持った算術式を
入力して、各々のオペランドの型を認識し、それらの型
の組み合わせにより前記算術式を実行するにあたっての
演算モードを2進型か10進型かに決定する演算モード
決定手段と、該演算モード決定手段で決定した2進型か
10進型かの演算モードに従わないオペランドに対して
、演算モードに合わせる型変換のオブジェクト及び演算
を行うオブジェクトを生成するオブジェクト生成手段と
を有することを特徴とする演算処理方式。
1. When creating an object in an operation in a language with multiple types, it is an operation that handles multiple operands, each operand has its own type, and an arithmetic expression with multiple types is input, and each an operation mode determining means for recognizing the types of operands and determining the operation mode for executing the arithmetic expression as binary type or decimal type based on a combination of these types; 1. An arithmetic processing method, comprising object generation means for generating an object for type conversion to match the arithmetic mode and an object for performing an arithmetic operation on an operand that does not follow an arithmetic mode of base type or decimal type.
JP19136389A 1989-07-26 1989-07-26 Arithmetic processing system Pending JPH0357022A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19136389A JPH0357022A (en) 1989-07-26 1989-07-26 Arithmetic processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19136389A JPH0357022A (en) 1989-07-26 1989-07-26 Arithmetic processing system

Publications (1)

Publication Number Publication Date
JPH0357022A true JPH0357022A (en) 1991-03-12

Family

ID=16273334

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19136389A Pending JPH0357022A (en) 1989-07-26 1989-07-26 Arithmetic processing system

Country Status (1)

Country Link
JP (1) JPH0357022A (en)

Similar Documents

Publication Publication Date Title
US5815719A (en) Method and apparatus for easy insertion of assembler code for optimization
JPH04307625A (en) Loop optimization system
JPH11288375A (en) Variable target compilation processing method, processor therefor, storage medium for program therefor and storage medium for conversion table
JPS6124729B2 (en)
JPH0523447B2 (en)
JPH0357022A (en) Arithmetic processing system
JP2004046747A (en) Vectorization system
JPS6155738A (en) Determining system of operation mode
JPH0689166A (en) Parts processing description expanding system
JPH0210429A (en) Program structure processing system
JPH11242598A (en) Compiling method and device, object program executing method and device and program storage medium
JPS58200349A (en) Microprogram controller
JP4327533B2 (en) Arithmetic processing program, arithmetic processing method, and arithmetic processing apparatus
JPH04343140A (en) Parallelized processing system
JPH0383140A (en) Arithmetic formula expanding system
JPH0721031A (en) Language processing method
JPH0250730A (en) Language converting system based upon common machine word
JPH04248624A (en) Program conversion processor
JPS62269238A (en) Compiling system
JPH0340033A (en) Recognizing/processing system for code system of call origin
JPH02170235A (en) Register saving/restoring system for call of subroutine
JPS6297031A (en) Matching system for bit number of mantissa part
JPH01258122A (en) Data format conversion system
JPS6242234A (en) Arithmetic processing system for variable having bit train attribute
JPH10222377A (en) Method for defining macroinstruction and assembler device