[go: up one dir, main page]

JP2001101008A - Pair register allocation processing method, compilation processing device, and program recording medium for compiler - Google Patents

Pair register allocation processing method, compilation processing device, and program recording medium for compiler

Info

Publication number
JP2001101008A
JP2001101008A JP27573699A JP27573699A JP2001101008A JP 2001101008 A JP2001101008 A JP 2001101008A JP 27573699 A JP27573699 A JP 27573699A JP 27573699 A JP27573699 A JP 27573699A JP 2001101008 A JP2001101008 A JP 2001101008A
Authority
JP
Japan
Prior art keywords
register
instruction
pair
allocated
information
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.)
Granted
Application number
JP27573699A
Other languages
Japanese (ja)
Other versions
JP4298868B2 (en
Inventor
Yutaka Yamanaka
豊 山中
Masaki Aoki
正樹 青木
Tadashi Sugimoto
直史 杉本
Kiyobumi Suzuki
清文 鈴木
Koji Takahara
浩二 高原
Harumichi Koizumi
治道 小泉
Masato Morishima
政人 森島
Kenichi Yamamoto
賢一 山本
Yasunobu Tanimura
恭伸 谷村
Akira Kusakabe
明 日下部
Nobuyoshi Yamaji
延佳 山地
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP27573699A priority Critical patent/JP4298868B2/en
Publication of JP2001101008A publication Critical patent/JP2001101008A/en
Application granted granted Critical
Publication of JP4298868B2 publication Critical patent/JP4298868B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

(57)【要約】 【課題】 高級プログラミング言語で記述された原始プ
ログラムの翻訳処理において,連続したメモリアクセス
命令にできるだけペアレジスタを割り当てることを可能
とし,実行性能を向上させる。 【解決手段】 命令チェック手段20は,ペア命令の場合
に,その命令のペアレジスタ情報域に対の情報(第1要
素/第2要素)を設定し,第1要素の定義部に偶数レジ
スタを割り当てる旨の情報(ペアレジスタ情報)を設定
する。レジスタ割当て手段30は,第1要素の定義部に偶
数番目のレジスタを割り当て,レジスタ内容の退避命令
がでない限り,第2要素の定義部の命令まで,ペアレジ
スタ情報が設定されたレジスタを他の命令のレジスタと
して割り当てないようにする。
(57) [Summary] In a translation process of a source program described in a high-level programming language, a pair register can be assigned to consecutive memory access instructions as much as possible, thereby improving execution performance. SOLUTION: In the case of a pair instruction, an instruction check means 20 sets pair information (first element / second element) in a pair register information area of the instruction, and stores an even register in a definition part of the first element. Set information (pair register information) to be assigned. The register allocating means 30 allocates an even-numbered register to the definition part of the first element, and unless there is an instruction to save the register contents, transfers the register in which the pair register information is set up to another instruction of the definition part of the second element. Do not assign it as an instruction register.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は,FORTRAN,
C言語,C++言語等の高級プログラミング言語で記述
された原始プログラムのコンパイルにおいて実行性能の
よいオブジェクトプログラムの生成を可能としたペアレ
ジスタ割当て処理方法に関する。
TECHNICAL FIELD The present invention relates to FORTRAN,
The present invention relates to a pair register allocation processing method capable of generating an object program having a high execution performance in compiling a source program described in a high-level programming language such as C language or C ++ language.

【0002】[0002]

【従来の技術】従来のコンパイラの処理において,最終
的なオブジェクトプログラムの生成時におけるレジスタ
番号の割当て処理では,命令の実行される順番に規則的
にレジスタ番号を割り当てていた。
2. Description of the Related Art In conventional compiler processing, register numbers are regularly assigned in the order in which instructions are executed in register number assignment processing when a final object program is generated.

【0003】命令割当て時の最適化処理の段階で,1つ
の命令で2つのデータをメモリアクセスするペアメモリ
アクセス命令が割り当てられていても,その2つのデー
タを保持するレジスタが,偶数レジスタ(偶数番号のレ
ジスタ),偶数レジスタ+1の順で連続するレジスタ
(これをペアレジスタという)でない場合には,命令の
仕様(ハードウェアの制限)によりペアメモリアクセス
命令として実行することができないため,ペアメモリア
クセス命令に対するレジスタ割当て時に,そのペアメモ
リアクセス命令は,2つのシングルアクセス命令に分解
されてオブジェクトプログラムに展開されていた。
At the stage of optimization processing at the time of instruction assignment, even if a paired memory access instruction that accesses two data with one instruction is assigned, the register holding the two data is an even register (even number). If these registers are not consecutive registers in the order of numbered register) and even numbered register + 1 (this is called a paired register), the instruction cannot be executed as a paired memory access instruction due to the instruction specifications (hardware restrictions). At the time of register allocation for an access instruction, the pair memory access instruction has been decomposed into two single access instructions and expanded into an object program.

【0004】図6は,従来技術による翻訳結果の例を示
している。mult1命令では,乗算結果をレジスタr
egXに入れ,mult2命令では,乗算結果をレジス
タregYに入れている。store1命令は,レジス
タregXの値をメモリにストアし,store2命令
は,レジスタregYの値を連続するメモリの位置にス
トアしている。
FIG. 6 shows an example of a translation result according to the prior art. In the multi instruction, the multiplication result is stored in the register r.
egX, the result of the multiplication is stored in a register regY in the multi instruction. The store1 instruction stores the value of the register regX in the memory, and the store2 instruction stores the value of the register regY in consecutive memory locations.

【0005】ここで,レジスタregXが偶数レジスタ
で,レジスタregYが偶数レジスタ+1の連続したペ
アのレジスタであれば,図6に示すstore1命令お
よびstore2命令を,1つのペアメモリアクセス命
令に置き換えて,オブジェクトプログラム中に展開する
命令数を削減することができる。しかし,レジスタre
gXの定義部d1とレジスタregYの定義部d2の間
の命令でレジスタ割当てが行われ,レジスタregXと
レジスタregYとが,偶数番号から始まる連続したレ
ジスタでなくなれば,レジスタregXの参照部r1の
命令と,レジスタregYの参照部r2の命令とを,1
つのペアメモリアクセス命令とすることはできず,図6
に示すように,2つのシングルアクセス命令(stor
e1,store2)として実行されることになる。
Here, if the register regX is an even-numbered register and the register regY is a register of a continuous pair of even-numbered register + 1, the store1 instruction and the store2 instruction shown in FIG. 6 are replaced with one pair memory access instruction. The number of instructions to be expanded in the object program can be reduced. However, register re
Register allocation is performed by an instruction between the definition part d1 of gX and the definition part d2 of the register regY. If the registers regX and regY are not continuous registers starting from even numbers, the instruction of the reference part r1 of the register regX is executed. And the instruction of the reference part r2 of the register regY are
As shown in FIG.
As shown in the figure, two single access instructions (stor
e1, store2).

【0006】[0006]

【発明が解決しようとする課題】本発明は上記問題点の
解決を図り,連続したメモリアクセス命令をペアレジス
タに割り当てることで,翻訳結果であるオブジェクトプ
ログラムの実行性能を向上させることを目的とする。
SUMMARY OF THE INVENTION An object of the present invention is to solve the above-mentioned problems and improve the execution performance of an object program as a translation result by allocating consecutive memory access instructions to a pair register. .

【0007】[0007]

【課題を解決するための手段】上記の問題を解決するた
め,本発明では,定義部で割り当てるレジスタが,参照
部のペアメモリアクセス命令のレジスタの第1要素もし
くは第2要素であるかを判定し,第1要素のレジスタな
らば偶数レジスタを割り当て,第2要素のレジスタなら
ば奇数レジスタを割り当てる。
In order to solve the above-mentioned problem, according to the present invention, it is determined whether a register allocated by a definition unit is a first element or a second element of a register of a pair memory access instruction of a reference unit. If the register is the first element, an even register is allocated, and if the register is the second element, an odd register is allocated.

【0008】この際に,第2要素のレジスタとしたい偶
数レジスタ+1のレジスタには,ペアレジスタとして割
り当てる旨の情報を設定し,レジスタが不足してレジス
タの内容をメモリに退避する命令が出ない限りは,第2
要素の定義部の命令まで,この偶数レジスタ+1のレジ
スタを他の命令に割り当てないようにする。これによ
り,ペアメモリアクセス命令の実行が可能になる。
At this time, information indicating that the register is to be assigned as a pair register is set in the register of the even-numbered register + 1 desired to be the register of the second element, and there is no instruction to save the contents of the register to the memory because the register is insufficient. As long as the second
Until the instruction in the definition part of the element, the register of the even register + 1 is not allocated to another instruction. As a result, the execution of the pair memory access instruction becomes possible.

【0009】同様に,第1要素へのレジスタ割当てより
先に第2要素に奇数レジスタを割り当てた場合には,第
1要素のレジスタとしたい奇数レジスタ−1のレジスタ
には,ペアレジスタとして割り当てる旨の情報を設定
し,第1要素の参照部の命令と第1要素の定義部の命令
との間に,その奇数レジスタ−1のレジスタをできるだ
け割り当てないようにする。
Similarly, if an odd register is assigned to the second element prior to the assignment of the register to the first element, the odd register-1 to be the register of the first element is assigned as a pair register. Is set, and the register of the odd-numbered register-1 is allocated as little as possible between the instruction of the reference part of the first element and the instruction of the definition part of the first element.

【0010】以上の処理を計算機によって実現するため
のコンパイラのプログラムは,もちろん計算機が読み取
り可能な可搬媒体メモリ,半導体メモリ,ハードディス
クなどの適当な記録媒体に格納することができる。
A compiler program for realizing the above processing by a computer can be stored in an appropriate recording medium such as a computer-readable portable medium memory, a semiconductor memory, and a hard disk.

【0011】[0011]

【発明の実施の形態】以下,本発明の実施の形態につい
て説明する。図1に,本発明のブロック構成例を示す。
処理装置1は,CPUおよびメモリ等からなる装置であ
る。ソース(原始)プログラム2は,FORTRAN,
C言語,C++言語等の高級プログラミング言語で記述
されたプログラムである。オブジェクトプログラム3
は,ソースプログラム2を機械語命令列に翻訳した結果
のプログラムである。
Embodiments of the present invention will be described below. FIG. 1 shows a block configuration example of the present invention.
The processing device 1 is a device including a CPU, a memory, and the like. Source (primitive) program 2 is FORTRAN,
It is a program described in a high-level programming language such as C language or C ++ language. Object program 3
Is a program resulting from translating the source program 2 into a machine language instruction sequence.

【0012】コンパイラ10は,処理装置1で動作し,
ソースプログラム2を入力して,それを翻訳(コンパイ
ル)し,オブジェクトプログラム3を生成するプログラ
ムである。コンパイラ10は,ソースプログラム2を入
力して構文解析を行い,内部データ(ここでは,この内
部データを中間プログラムと呼ぶことにする)に変換す
るソースプログラム解析部11と,中間プログラムにつ
いて効率のよい命令列を生成するための処理を行う最適
化部12と,最適化した結果の命令列について使用可能
なレジスタを割り当てるレジスタ割当て部13と,レジ
スタを割り当てた結果の命令列から,必要に応じて命令
の並べ替え,組み合わせを行ってオブジェクトプログラ
ム3のコードを生成するスケジューリング/コード生成
部14からなる。
The compiler 10 operates on the processing device 1,
This is a program that inputs a source program 2, translates (compiles) it, and generates an object program 3. The compiler 10 inputs the source program 2 and analyzes the syntax, converts the internal data (here, this internal data is referred to as an intermediate program) into a source program analysis unit 11 and an efficient intermediate program. An optimization unit 12 that performs processing for generating an instruction sequence, a register allocation unit 13 that allocates registers that can be used for the optimized instruction sequence, and an instruction sequence that results from allocating registers are used as necessary. The scheduling / code generation unit 14 generates the code of the object program 3 by rearranging and combining instructions.

【0013】本発明は,特にレジスタ割当て部13の処
理に関連しており,コンパイラ10における他の部分の
処理については,従来と同様でよいので,詳しい説明は
省略する。
The present invention particularly relates to the processing of the register allocating unit 13, and the processing of the other parts in the compiler 10 may be the same as the conventional one, so that the detailed description will be omitted.

【0014】本発明においては,特にレジスタ割当て部
13に,ペア情報設定部21とペア命令割当て情報設定
部22とを持つ命令チェック手段20と,ペア命令定義
部検出部31とペアレジスタ割当て部32とを持つレジ
スタ割当て手段30とがある。命令チェック手段20
は,最適化部12の出力した中間プログラムを検査し,
レジスタ割当て前にペアメモリアクセス命令か否かを判
定するもので,レジスタ割当て手段30は,命令チェッ
ク手段20による処理の結果,命令がペアメモリアクセ
ス命令のときには,連続した偶数番号と奇数番号のレジ
スタの組からなるペアレジスタの割当てを行うものであ
る。
In the present invention, in particular, the register allocating unit 13 includes an instruction checking means 20 having a pair information setting unit 21 and a pair instruction allocation information setting unit 22, a pair instruction definition unit detecting unit 31, and a pair register allocating unit 32. There is a register allocating means 30 having the following. Instruction check means 20
Inspects the intermediate program output by the optimization unit 12,
The register allocating means 30 determines whether or not the instruction is a pair memory access instruction before allocating the register. Is assigned.

【0015】命令チェック手段20のペア情報設定部2
1は,最適化部12の出力した中間プログラムを,後方
から1命令ずつチェックしていき,ペアメモリアクセス
命令であるかどうかを判定し,ペアメモリアクセス命令
の場合には,コンパイラ10の作業用メモリ上に設けた
ペアレジスタ情報域に「対の情報(第1要素/第2要
素)」を設定する。この処理と同時に,ペア命令割当て
情報設定部22は,最適化部12の出力した中間プログ
ラムを,後方から1命令ずつチェックしていき,ペアメ
モリアクセス命令の第1要素または第2要素の定義部が
現れた場合に,第1要素の定義部には偶数レジスタを割
り当てるための情報を設定し,また第2要素の定義部に
は偶数レジスタ+1の奇数レジスタを割り当てるための
情報を設定する。
The pair information setting section 2 of the instruction checking means 20
1 checks the intermediate program output from the optimizing unit 12 one instruction at a time, from the rear, to determine whether or not the instruction is a pair memory access instruction. "Pair information (first element / second element)" is set in the pair register information area provided on the memory. At the same time as this processing, the pair instruction assignment information setting unit 22 checks the intermediate program output from the optimizing unit 12 one instruction at a time from the rear, and defines the first element or the second element of the pair memory access instruction. Appears, information for assigning an even register is set in the definition part of the first element, and information for assigning an odd register of the even register + 1 is set in the definition part of the second element.

【0016】レジスタ割当て手段30のペア命令定義部
検出部31は,ペア命令割当て情報設定部22が設定し
た情報からペアメモリアクセス命令の定義部を検出し,
ペアレジスタ割当て部32は,ペア命令定義部検出部3
1が検出したペアメモリアクセス命令の第1要素のレジ
スタに偶数レジスタを割り当て,また,ペアメモリアク
セス命令の第2要素のレジスタに奇数レジスタを割り当
てる処理を行う。
The pair instruction definition section detecting section 31 of the register allocating section 30 detects the definition section of the pair memory access instruction from the information set by the pair instruction allocation information setting section 22,
The pair register allocating unit 32 includes a pair instruction definition unit detecting unit 3
1 assigns an even-numbered register to the register of the first element of the paired memory access instruction and assigns an odd-numbered register to the register of the second element of the paired memory access instruction.

【0017】図2に,命令チェック手段20の処理の流
れを示す。命令チェック手段20では,ペア情報設定部
21により,中間プログラムの後方から順番に命令を調
べ,着目した命令がペアメモリアクセス命令であるかど
うかを判定し(ステップS1),ペアメモリアクセス命
令であればペアレジスタ情報域に対の情報(第1要素,
第2要素)を設定する(ステップS2)。また,ペア命
令割当て情報設定部22により,着目した命令がペアメ
モリアクセス命令の定義部かどうかを判定して(ステッ
プS3),ペアメモリアクセス命令の定義部であれば,
さらに第1要素であるかどうかを判定し(ステップS
4),第1要素であれば,この命令の定義部に偶数レジ
スタを割り当てるための情報を設定し(ステップS
5),第1要素でなければ,この命令の定義部に奇数レ
ジスタを割り当てるための情報を設定する(ステップS
6)。以上の処理をすべての命令について繰り返す。
FIG. 2 shows the flow of processing of the instruction check means 20. In the instruction checking means 20, the pair information setting unit 21 examines the instructions sequentially from the back of the intermediate program, determines whether the focused instruction is a pair memory access instruction (step S1), and determines whether the instruction is a pair memory access instruction. If the pair information (first element,
The second element is set (step S2). The pair instruction assignment information setting unit 22 determines whether the focused instruction is a definition part of a pair memory access instruction (step S3).
Further, it is determined whether the element is the first element (step S
4) If the element is the first element, information for allocating an even register to the definition part of this instruction is set (step S).
5) If it is not the first element, information for assigning an odd register to the definition part of this instruction is set (step S).
6). The above processing is repeated for all instructions.

【0018】次に,図3に,レジスタ割当て手段30の
処理の流れを示す。レジスタ割当て手段30の処理は,
中間プログラムの先頭の命令から後方へ向かって順番に
行う。中間プログラムの先頭の命令から順番に使用可能
なレジスタを割り当てていく際に,ペア命令定義部検出
部31により,ペアメモリアクセス命令の定義部かどう
かを判定し(ステップS11),定義部であれば,さら
に第1要素であるかどうかを判定する(ステップS1
2)。第1要素の場合には,第2要素に対してレジスタ
が割当て済みであるかどうかを判定して(ステップS1
3),第2要素が割当て済みであれば,第1要素に,第
2要素のレジスタ(奇数)−1のレジスタを割り当てる
(ステップS14)。第2要素が割当て済みでなけれ
ば,第1要素に偶数レジスタを割り当て(ステップS1
5),第2要素に第1要素のレジスタ(偶数)+1のレ
ジスタを予約する(ステップS16)。予約したレジス
タは,レジスタが不足するなどの特別な場合を除き,第
2要素以外への割当ては行わないようにする。
Next, FIG. 3 shows a flow of processing of the register allocating means 30. The processing of the register allocating means 30 is as follows.
It is performed in order from the first instruction of the intermediate program to the rear. When allocating available registers in order from the first instruction of the intermediate program, the pair instruction definition unit detecting unit 31 determines whether the instruction is a definition unit of a pair memory access instruction (step S11). Then, it is further determined whether the element is the first element (step S1).
2). In the case of the first element, it is determined whether a register has been allocated to the second element (step S1).
3) If the second element has been allocated, a register of the register (odd number) -1 of the second element is allocated to the first element (step S14). If the second element has not been allocated, an even register is allocated to the first element (step S1).
5) Reserve the register of the first element (even number) +1 for the second element (step S16). Reserved registers are not allocated to other than the second element, except in special cases such as a shortage of registers.

【0019】一方,ペアメモリアクセス命令の定義部が
第1要素ではない場合には(ステップS12),第1要
素が割当て済みかどうかを判定し(ステップS17),
第1要素が割当て済みであれば,第2要素に第1要素の
レジスタ(偶数)+1のレジスタを割り当てる(ステッ
プS18)。また,第1要素が割当て済みでなければ,
第2要素に偶数レジスタ+1のレジスタを割り当て(ス
テップS19),第1要素に偶数レジスタを予約する
(ステップS20)。
On the other hand, if the definition part of the pair memory access instruction is not the first element (step S12), it is determined whether the first element has been allocated (step S17).
If the first element has been allocated, the register of the register of the first element (even number) +1 is allocated to the second element (step S18). If the first element has not been assigned,
The register of the even register + 1 is assigned to the second element (step S19), and the even register is reserved for the first element (step S20).

【0020】次に,図4および図5に従って,具体的な
レジスタの割当て例について,従来技術による場合と本
実施の形態による場合とを対比して説明する。図4は,
FORTRANで記述されたソースプログラムの例を示
しており,図5は,図4に示すプログラムの一部につい
てレジスタを割り付けた例を示している。特に図5
(A)は,従来技術によるレジスタ割当ての例,図5
(B)は,本発明の実施の形態によるレジスタ割当ての
例を示している。
Next, referring to FIGS. 4 and 5, specific examples of register allocation will be described in comparison with the case of the prior art and the case of the present embodiment. FIG.
FIG. 5 shows an example of a source program described in FORTRAN, and FIG. 5 shows an example in which registers are assigned to a part of the program shown in FIG. In particular, FIG.
5A shows an example of register allocation according to the prior art, FIG.
(B) shows an example of register allocation according to the embodiment of the present invention.

【0021】この図5は,図4のプログラムの一部であ
る以下の部分, DO 20 J = 1,5 IB(J) = IA(J,J)+1 20 CONTINUE の翻訳結果の例であり,説明を分かりやすくするため
に,アセンブラ命令形式で表現している。また,このソ
ースプログラムの記述では,Jが1から5まで5回ルー
プする形になっているが,ここでは処理の高速化のた
め,ループアンローリングによる最適化が行われてい
る。
FIG. 5 is an example of a translation result of the following part which is a part of the program of FIG. 4, DO 20 J = 1,5 IB (J) = IA (J, J) +1 20 CONTINUE. In order to make the explanation easy to understand, it is expressed in assembler instruction format. Further, in the description of the source program, J is looped five times from 1 to 5, but here, optimization by loop unrolling is performed to speed up the processing.

【0022】図5(A)において,各行の命令の意味は
以下のとおりである。grNは,汎用レジスタNを表し
ている。ターゲットとなる計算機は1ワード=4バイト
を想定している。
In FIG. 5A, the meanings of the instructions on each line are as follows. grN represents a general-purpose register N. The target computer is assumed to have one word = 4 bytes.

【0023】(1)gr4+0のアドレスに入っているI
A(1,1)の内容を,gr18にロードする。
(1) I in the address of gr4 + 0
The contents of A (1,1) are loaded into gr18.

【0024】(2)gr18とJの初期値1を加算する。(2) gr18 and the initial value 1 of J are added.

【0025】(3)$0000001+640に入ってい
るIB(J)の先頭アドレスをgr19に入れる。な
お,このorn命令は論理和(or)をとる命令であ
り,gr0の値は必ず0として計算されるので,$00
00001+640のアドレスがgr19に入ることに
なる。
(3) The leading address of IB (J) contained in $ 000001 + 640 is entered in gr19. Note that the orn instruction is an instruction that takes a logical sum (or), and the value of gr0 is always calculated as 0, so
The address of 00001 + 640 will be in gr19.

【0026】(4)gr4+44のアドレスに入っている
IA(2,2)の内容をgr20にロードする。
(4) Load the contents of IA (2,2) contained in the address of gr4 + 44 into gr20.

【0027】(5)gr20とJの回転値2を加算する。(5) gr20 and the rotation value 2 of J are added.

【0028】(6)gr18に入っているIA(1,1)
+1をgr19+0のIB(1)にストアする。
(6) IA contained in gr18 (1, 1)
+1 is stored in IB (1) of gr19 + 0.

【0029】(7)gr20に入っているIA(2,2)
+2をgr19+4のIB(2)にストアする。
(7) IA contained in gr20 (2, 2)
+2 is stored in gr19 + 4 IB (2).

【0030】(8)gr4+88のアドレスに入っている
IA(3,3)の内容をgr21にロードする。
(8) The contents of IA (3,3) contained in the address of gr4 + 88 are loaded into gr21.

【0031】(9)gr21とJの回転値3を加算する。(9) gr21 and the rotation value 3 of J are added.

【0032】(10) gr4+132のアドレスに入って
いるIA(4,4)の内容をgr22にロードする。
(10) The contents of IA (4, 4) contained in the address of gr4 + 132 are loaded into gr22.

【0033】(11) gr22とJの回転値4を加算す
る。
(11) gr22 and the rotation value 4 of J are added.

【0034】(12) gr21に入っているIA(3,
3)+3をgr19+8のIB(3)にストアする。
(12) IA contained in gr21 (3,
3) Store +3 in IB (3) of gr19 + 8.

【0035】(13) gr22に入っているIA(4,
4)+4をgr19+12のIB(4)にストアする。
(13) IA contained in gr22 (4,
4) Store +4 in IB (4) of gr19 + 12.

【0036】(14) gr4+176のアドレスに入って
いるIA(5,5)の内容をgr23にロードする。
(14) The contents of IA (5, 5) contained in the address of gr4 + 176 are loaded into gr23.

【0037】(15) gr23とJの回転値5を加算す
る。
(15) gr23 and the rotation value 5 of J are added.

【0038】(16) gr23に入っているIA(5,
5)+5をgr19+16のIB(5)にストアする。
(16) IA contained in gr23 (5,
5) Store +5 in IB (5) of gr19 + 16.

【0039】図5(A)に示すように,従来の割り付け
では,行(1) のIA(1,1)の定義部ではレジスタg
r18が,行(4) のIA(2,2)の定義部ではレジス
タgr20が割り付けられている。これは,この2つの
定義部の間で,行(3) のIB(J)の先頭アドレスに関
する命令にレジスタgr19が割り付けられているため
である。このため,行(6) のIA(1,1)+1のスト
ア命令と行(7) のIA(2,2)+2のストア命令はペ
アメモリアクセス命令として実行できず,2つのシング
ル命令で実行されるように命令が展開されている。
As shown in FIG. 5A, in the conventional allocation, the register g in the definition part of IA (1,1) in row (1)
The register gr20 is allocated to r18 in the definition part of IA (2, 2) in the row (4). This is because the register gr19 is allocated to the instruction related to the start address of the IB (J) in line (3) between the two definition units. Therefore, the store instruction of IA (1,1) +1 in row (6) and the store instruction of IA (2,2) +2 in row (7) cannot be executed as a pair memory access instruction, and are executed by two single instructions. Instructions have been expanded to be

【0040】また,行(8) のIA(3,3)の定義部で
はレジスタgr21が,行(10)のIA(4,4)の定義
部ではレジスタgr22が,それぞれ割り付けてられて
いる。これらの割り付けられたレジスタは連続するが,
gr21,gr22という奇数レジスタで始まる並びで
あることから,行(12)のIB(3)へのストア命令と行
(13)のIB(4)へのストア命令はペアメモリアクセス
命令として実行できず,それぞれシングル命令で実行さ
れるように命令が展開されている。
The register gr21 is allocated to the definition part of IA (3, 3) in row (8), and the register gr22 is allocated to the definition part of IA (4, 4) in row (10). Although these allocated registers are continuous,
Since the sequence starts with odd registers gr21 and gr22, a store instruction to IB (3) in line (12) and a line
(13) The store instruction to the IB (4) cannot be executed as a pair memory access instruction, and the instructions are expanded so that each is executed by a single instruction.

【0041】本発明では,命令チェック手段20によ
り,レジスタ割当て前に,図5(A)における行(6),
(7),また行(12),(13) のようなペアメモリアクセスが可
能な命令を検出すると,そのペアの情報を記憶してお
き,その定義部の命令にペア命令割当て情報を設定して
おく。したがって,レジスタ割当て手段30によって,
第1要素の定義部に偶数レジスタ,第2要素の定義部に
その偶数レジスタ+1のレジスタを割り当てることがで
き,図5(B)に示すようにレジスタを割り付けること
ができる。
According to the present invention, the instruction check means 20 uses the instruction check means 20 to allocate the lines (6), (6) in FIG.
When a pair memory accessible instruction such as (7) or (12) or (13) is detected, the information of the pair is stored, and the pair instruction assignment information is set to the instruction of the definition part. Keep it. Therefore, by the register allocating means 30,
The register of the even element can be assigned to the definition part of the first element, and the register of the even register + 1 can be assigned to the definition part of the second element, and the registers can be assigned as shown in FIG.

【0042】すなわち,本発明では,図5(B)のよう
に,行(1)'のIA(1,1)の定義部1にレジスタgr
18を割り付け,レジスタgr19を第2要素用に予約
する。したがって,この間の行(3)'の命令にはレジスタ
gr20が割り付けられ,行(4)'のIA(2,2)の定
義部2にレジスタgr19が割り付けられる。これによ
り,図5(A)における行(6) のIA(1,1)のスト
アと行(7) のIA(2,2)のストアを,図5(B)の
行(6)'のように1つのペアメモリアクセス命令(st.
l)で実行することができることになる。行(6)'のs
t.l命令は,gr18に入っているIA(1,1)+
1を,gr20が示すIB(1)にストアするととも
に,gr19に入っているIA(2,2)+2を,IB
(1)に続くIB(2)にストアする命令である。
That is, according to the present invention, as shown in FIG. 5B, the register gr is stored in the definition part 1 of IA (1, 1) in row (1) ′.
18 is allocated, and the register gr19 is reserved for the second element. Therefore, the register gr20 is allocated to the instruction in the row (3) ′ during this period, and the register gr19 is allocated to the definition part 2 of the IA (2, 2) in the row (4) ′. As a result, the store of IA (1, 1) in row (6) and the store of IA (2, 2) in row (7) in FIG. As described above, one pair memory access instruction (st.
1). Line (6) 's
t. The l instruction is IA (1,1) in gr18 +
1 is stored in IB (1) indicated by gr20, and IA (2, 2) +2 stored in gr19 is stored in IB (1).
This is an instruction to store in IB (2) following (1).

【0043】また,行(8)'のIA(3,3)の定義部3
でレジスタgr22を,行(10)' のIA(4,4)の定
義部4にレジスタgr23を割り付ける。これにより,
レジスタgr22とレジスタgr23の参照部2(行(1
2)' )では,これらのペアレジスタのIB(3)とIB
(4)とに対するストアを,ペアメモリアクセス命令
(st.li9)で実行することができる。
Also, the definition part 3 of the IA (3, 3) in line (8) '
Assigns the register gr22 to the definition part 4 of the IA (4, 4) in the row (10) '. This gives
The reference part 2 of the register gr22 and the register gr23 (row (1
2) '), IB (3) and IB of these pair registers
(4) can be executed by a pair memory access instruction (st.li9).

【0044】[0044]

【発明の効果】以上説明したように,本発明によれば,
連続したメモリアクセス命令を,偶数レジスタ,奇数レ
ジスタという並びのペアレジスタに必ず割り当てること
ができる。これにより,ペア命令を実行させることで,
翻訳結果のプログラムの実行性能を向上させることが可
能となる。
As described above, according to the present invention,
Successive memory access instructions can always be assigned to a pair of registers, an even register and an odd register. As a result, by executing the pair instruction,
It becomes possible to improve the execution performance of the program resulting from the translation.

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

【図1】本発明のブロック構成例を示す図である。FIG. 1 is a diagram illustrating an example of a block configuration according to the present invention.

【図2】命令チェック手段の処理の流れを示す図であ
る。
FIG. 2 is a diagram showing a flow of processing of an instruction check unit.

【図3】レジスタ割当て手段の処理の流れを示す図であ
る。
FIG. 3 is a diagram showing a processing flow of a register allocating means.

【図4】ソースプログラムの例を示す図である。FIG. 4 is a diagram illustrating an example of a source program.

【図5】レジスタ割り付けの例を示す図である。FIG. 5 is a diagram showing an example of register allocation.

【図6】従来技術を説明するための図である。FIG. 6 is a diagram for explaining a conventional technique.

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

1 処理装置 2 ソースプログラム 3 オブジェクトプログラム 10 コンパイラ 11 ソースプログラム解析部 12 最適化部 13 レジスタ割当て部 14 スケジューリング/コード生成部 20 命令チェック手段 21 ペア情報設定部 22 ペア命令割当て情報設定部 30 レジスタ割当て手段 31 ペア命令定義部検出部 32 ペアレジスタ割当て部 DESCRIPTION OF SYMBOLS 1 Processing apparatus 2 Source program 3 Object program 10 Compiler 11 Source program analysis part 12 Optimization part 13 Register allocation part 14 Scheduling / code generation part 20 Instruction check means 21 Pair information setting part 22 Pair instruction allocation information setting part 30 Register allocation means 31 Pair instruction definition part detection part 32 Pair register allocation part

───────────────────────────────────────────────────── フロントページの続き (72)発明者 杉本 直史 東京都港区芝浦四丁目15番33号 株式会社 富士通ビ−・エス・シー内 (72)発明者 鈴木 清文 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 (72)発明者 高原 浩二 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 (72)発明者 小泉 治道 静岡県静岡市南町18番1号 株式会社富士 通静岡エンジニアリング内 (72)発明者 森島 政人 静岡県静岡市南町18番1号 株式会社富士 通静岡エンジニアリング内 (72)発明者 山本 賢一 静岡県静岡市南町18番1号 株式会社富士 通静岡エンジニアリング内 (72)発明者 谷村 恭伸 静岡県静岡市南町18番1号 株式会社富士 通静岡エンジニアリング内 (72)発明者 日下部 明 静岡県静岡市南町18番1号 株式会社富士 通静岡エンジニアリング内 (72)発明者 山地 延佳 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 Fターム(参考) 5B081 CC25  ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Naofumi Sugimoto 4-15-33 Shibaura, Minato-ku, Tokyo Inside Fujitsu BSC Ltd. (72) Inventor Kiyofumi Suzuki Kamiodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture 4-1-1, Fujitsu Limited (72) Inventor Koji Takahara 4-1-1, Kamikodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Fujitsu Limited (72) Inventor Judo Koizumi 18-1 Minamicho, Shizuoka City, Shizuoka Prefecture No. Fujitsu Shizuoka Engineering Co., Ltd. (72) Inventor Masato Morishima 18-1 Minamicho, Shizuoka City, Shizuoka Prefecture Inside Fujitsu Shizuoka Engineering Co., Ltd. (72) Kenichi Yamamoto 181-1 Minamicho, Shizuoka City, Shizuoka Prefecture Co., Ltd. Within Fujitsu Shizuoka Engineering (72) Inventor Yasunobu Tanimura 18-1 Minamicho, Shizuoka City, Shizuoka Prefecture Fujitsu Shizuoka Co., Ltd. Inside engineering (72) Inventor Akira Kusakabe 18-1, Minamicho, Shizuoka-shi, Shizuoka Prefecture Inside Fujitsu Shizuoka Engineering Co., Ltd. (72) Inventor Nobuka Yamaji 4-1-1 Uedanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Fujitsu Stock In-house F-term (reference) 5B081 CC25

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 高級プログラミング言語で記述された原
始プログラムを翻訳するコンパイル処理装置におけるレ
ジスタ割当て処理方法において,レジスタ割当て時に,
レジスタを参照するペアメモリアクセス命令を検出し,
第1要素および第2要素の対のペアレジスタ情報を設定
する過程と,定義部で割り当てるレジスタが,参照部の
ペアメモリアクセス命令のレジスタの第1要素もしくは
第2要素であるか否かを判定する過程と,前記定義部で
割り当てるレジスタが前記第1要素のレジスタであると
きには偶数レジスタを割り当て,前記第2要素のレジス
タであるときには前記偶数レジスタに続く奇数レジスタ
を割り当てる過程とを有することを特徴とするペアレジ
スタ割当て処理方法。
1. A register allocation processing method in a compile processing device for translating a source program described in a high-level programming language.
A pair memory access instruction that refers to a register is detected,
Setting the pair register information of the pair of the first element and the second element, and determining whether the register allocated by the definition unit is the first element or the second element of the register of the pair memory access instruction of the reference unit And assigning an even register when the register to be assigned by the definition unit is the register of the first element, and assigning an odd register following the even register when the register to be assigned is the register of the second element. Register allocation processing method.
【請求項2】 高級プログラミング言語で記述された原
始プログラムを翻訳するコンパイル処理装置において,
レジスタ割当て時に,レジスタを参照するペアメモリア
クセス命令を検出し,第1要素および第2要素の対のペ
アレジスタ情報を設定するとともに,定義部で割り当て
るレジスタが,参照部の命令のレジスタの第1要素もし
くは第2要素であるか否かを判定し,第1要素である場
合に,この命令の定義部に偶数レジスタを割り当てるた
めの情報を設定し,第2要素である場合に,この命令の
定義部に奇数レジスタを割り当てるための情報を設定す
る命令チェック手段と,前記命令の定義部で割り当てる
レジスタが前記第1要素のレジスタであるときには偶数
レジスタを割り当て,前記第2要素のレジスタであると
きには前記偶数レジスタに続く奇数レジスタを割り当て
るレジスタ割当て手段とを備えることを特徴とするコン
パイル処理装置。
2. A compiling apparatus for translating a source program described in a high-level programming language,
At the time of register allocation, a pair memory access instruction referring to the register is detected, pair register information of a pair of the first element and the second element is set, and the register allocated in the definition unit is the first register of the instruction of the reference unit. It is determined whether the element is a second element or not. If the element is the first element, information for allocating an even register to the definition part of this instruction is set. Instruction check means for setting information for assigning an odd register to the definition unit; and assigning an even register when the register to be assigned in the definition unit of the instruction is the register of the first element, and assigning an even register when the register of the instruction is the register of the second element. Register allocating means for allocating an odd register following the even register.
【請求項3】 高級プログラミング言語で記述された原
始プログラムを翻訳するコンパイラのプログラム記録媒
体であって,レジスタ割当て時に,レジスタを参照する
ペアメモリアクセス命令を検出し,第1要素および第2
要素の対のペアレジスタ情報を設定する処理と,定義部
で割り当てるレジスタが,参照部のペアメモリアクセス
命令のレジスタの第1要素もしくは第2要素であるか否
かを判定する処理と,前記定義部で割り当てるレジスタ
が前記第1要素のレジスタであるときには偶数レジスタ
を割り当て,前記第2要素のレジスタであるときには前
記偶数レジスタに続く奇数レジスタを割り当てる処理と
を,計算機に実行させるプログラムを記録したことを特
徴とするコンパイラのプログラム記録媒体。
3. A program recording medium of a compiler for translating a source program described in a high-level programming language, wherein a pair memory access instruction that refers to a register is detected when a register is allocated, and a first element and a second element are read.
A process of setting pair register information of an element pair, a process of determining whether or not a register to be allocated by a definition unit is a first element or a second element of a register of a pair memory access instruction of a reference unit; Recording a program for causing a computer to perform an operation of allocating an even register when the register to be allocated by the section is the register of the first element, and allocating an odd register following the even register when the register to be allocated is the register of the second element. A program recording medium for a compiler, comprising:
JP27573699A 1999-09-29 1999-09-29 Pair register allocation processing method, compile processing device, and compiler program recording medium Expired - Fee Related JP4298868B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27573699A JP4298868B2 (en) 1999-09-29 1999-09-29 Pair register allocation processing method, compile processing device, and compiler program recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27573699A JP4298868B2 (en) 1999-09-29 1999-09-29 Pair register allocation processing method, compile processing device, and compiler program recording medium

Publications (2)

Publication Number Publication Date
JP2001101008A true JP2001101008A (en) 2001-04-13
JP4298868B2 JP4298868B2 (en) 2009-07-22

Family

ID=17559681

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27573699A Expired - Fee Related JP4298868B2 (en) 1999-09-29 1999-09-29 Pair register allocation processing method, compile processing device, and compiler program recording medium

Country Status (1)

Country Link
JP (1) JP4298868B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7305665B2 (en) 2002-06-12 2007-12-04 International Business Machines Corporation Compiler register allocation and compilation
JP2012018435A (en) * 2010-07-06 2012-01-26 Fujitsu Ltd Compiler and compiling program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7305665B2 (en) 2002-06-12 2007-12-04 International Business Machines Corporation Compiler register allocation and compilation
US8104026B2 (en) 2002-06-12 2012-01-24 International Business Machines Corporation Compiler register allocation and compilation
JP2012018435A (en) * 2010-07-06 2012-01-26 Fujitsu Ltd Compiler and compiling program

Also Published As

Publication number Publication date
JP4298868B2 (en) 2009-07-22

Similar Documents

Publication Publication Date Title
US6826677B2 (en) Renaming registers to values produced by instructions according to assigned produce sequence number
US5761514A (en) Register allocation method and apparatus for truncating runaway lifetimes of program variables in a computer system
US5303357A (en) Loop optimization system
US5862385A (en) Compile method for reducing cache conflict
CA2166369C (en) Method and system for determining inter-compilation unit alias information
US6434743B1 (en) Method and apparatus for allocating stack slots
JP3546341B2 (en) Data prefetch method and program generation method for multiple loops
JP2011118909A (en) Memory access instruction vectorization
US20040268334A1 (en) System and method for software-pipelining of loops with sparse matrix routines
US5940621A (en) Language independent optimal size-based storage allocation
US8832671B1 (en) Conflict-free register allocation
JP2005529383A (en) Time-multiplexed speculative multithreading to support single-threaded applications
WO2005078579A1 (en) Program conversion device and program conversion method
JP2005332387A (en) Method and system for grouping and managing memory instructions
CN112631955A (en) Data processing method, data processing device, electronic device, and medium
US5418959A (en) Instruction operation size optimization
US7356812B2 (en) Passing parameters by implicit reference
JPH103391A (en) Method and system for assigning register using multiplex interference graph
JP2001101008A (en) Pair register allocation processing method, compilation processing device, and program recording medium for compiler
JP2000353097A (en) Method and device for generating low density interference graph
JP7383390B2 (en) Information processing unit, information processing device, information processing method and program
Khare et al. High-level synthesis with SDRAMs and RAMBUS DRAMs
JP2556148B2 (en) Vector register allocation method
JPS6234240A (en) Data allotting system
JP2008523523A (en) Compiling method, compiling device and computer system for loop in program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060324

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081001

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090414

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090416

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120424

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120424

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130424

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140424

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees