JP2006286027A - Compiler device and compiling method - Google Patents
Compiler device and compiling method Download PDFInfo
- Publication number
- JP2006286027A JP2006286027A JP2006207058A JP2006207058A JP2006286027A JP 2006286027 A JP2006286027 A JP 2006286027A JP 2006207058 A JP2006207058 A JP 2006207058A JP 2006207058 A JP2006207058 A JP 2006207058A JP 2006286027 A JP2006286027 A JP 2006286027A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- register
- unit
- cycle
- instructions
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30145—Instruction analysis, e.g. decoding, instruction word fields
- G06F9/30156—Special purpose encoding of instructions, e.g. Gray coding
Abstract
Description
本発明は、C/C++言語等の高級言語で記述されたソースプログラムを機械語プログラムに変換するコンパイラに関し、特に、プログラム実行時の消費電力が少ない機械語プログラムを出力可能なコンパイラに関する。 The present invention relates to a compiler that converts a source program written in a high-level language such as a C / C ++ language into a machine language program, and more particularly to a compiler that can output a machine language program with low power consumption during program execution.
近年普及している携帯電話、情報携帯端末等の携帯型の情報処理装置では、消費電力の低減が要求されている。このため、このような情報処理装置で利用されるプロセッサが備える高い機能を有効に引き出しつつ、低消費電力で動作可能な機械語命令を生成可能なコンパイラが求められている。 In portable information processing apparatuses such as mobile phones and information portable terminals that have become popular in recent years, reduction of power consumption is required. Therefore, there is a need for a compiler that can generate machine language instructions that can operate with low power consumption while effectively extracting the high functions of a processor used in such an information processing apparatus.
従来のコンパイラとして、命令の実行順序を変更することによりプロセッサの消費電力の低減を図った命令列最適化装置がある(たとえば、特許文献1参照。)。 As a conventional compiler, there is an instruction sequence optimizing device that reduces the power consumption of a processor by changing the execution order of instructions (see, for example, Patent Document 1).
この命令列最適化装置では、命令の依存関係に影響を与えることなく、命令のビットパターン間のハミング距離を低減させるように命令の配置変更を行なう。これにより、プロセッサの消費電力を低減させることができる命令列の最適化を行なうことができる。
しかしながら、従来の命令列最適化装置では、並列処理可能なプロセッサを前提としていない。このため、従来の最適化処理を並列処理可能なプロセッサにそのまま適用しても、最適な命令列の最適化を得ることができないという問題がある。 However, the conventional instruction sequence optimization device does not assume a processor capable of parallel processing. For this reason, there is a problem that even if the conventional optimization processing is directly applied to a processor capable of parallel processing, the optimization of the optimum instruction sequence cannot be obtained.
そこで、本発明は、このような状況に鑑みてなされたものであり、並列処理可能なプロセッサを低消費電力で動作させることができる命令列を生成可能なコンパイラを提供することを目的とする。 Therefore, the present invention has been made in view of such a situation, and an object thereof is to provide a compiler capable of generating an instruction sequence that can operate a processor capable of parallel processing with low power consumption.
上記目的を達成するために、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令とのハミング距離が小さくなる命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。 In order to achieve the above object, a compiler apparatus according to the present invention includes a plurality of execution units that can process a source program in parallel, and a plurality of instruction issuance units that respectively issue instructions executed by the plurality of execution units. A compiler device for translating the machine program into a machine language program for a processor, the parser means for parsing the source program, the intermediate code conversion means for converting the analyzed source program into intermediate code, and the intermediate code Priority is given to an instruction having a reduced Hamming distance from an instruction placed at a position corresponding to the same instruction issuing unit in the immediately preceding instruction cycle without breaking the dependency relation of the corresponding instruction. Optimization means for optimizing the intermediate code by placing the instruction at each corresponding position, and optimization Characterized in that it comprises a code generating means for converting the machine instructions the intermediate code.
これにより、各命令発行ユニットで実行される命令のビットパターンの変化を抑えることができるので、プロセッサの命令レジスタに保持される値のビット変化が小さく、プロセッサを低消費電力で動作させることができる命令列が生成される。 As a result, it is possible to suppress changes in the bit pattern of instructions executed by each instruction issuing unit, so that bit changes in values held in the instruction register of the processor are small, and the processor can be operated with low power consumption. An instruction sequence is generated.
また、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。 In addition, a compiler apparatus according to the present invention provides a machine for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that respectively issue instructions executed by the plurality of execution units. A compiler apparatus for translating into a word program, a parser means for parsing the source program, an intermediate code conversion means for converting the analyzed source program into an intermediate code, and an instruction dependency corresponding to the intermediate code The instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit in the immediately preceding instruction cycle is prioritized without damaging the instruction cycle. An optimization means for allocating the instruction at a location and optimizing the intermediate code; Characterized in that it comprises a code generating means for converting the intermediate code into machine language instructions.
これにより、同一のレジスタへのアクセスが連続し、レジスタを選択するための制御信号の変化が少なくなり、プロセッサを低消費電力で動作させることができる命令列が生成される。 As a result, access to the same register continues, the change in the control signal for selecting the register is reduced, and an instruction sequence that can operate the processor with low power consumption is generated.
さらに、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記複数の命令発行ユニットの各々には、あらかじめ優先的に発行される命令が規定されており、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、前記複数の命令発行ユニットの各々で優先発行される命令を優先して、前記複数の命令発行ユニットの各々に対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。 Furthermore, a compiler apparatus according to the present invention provides a machine for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler apparatus for translating into a word program, wherein each of the plurality of instruction issuing units is preliminarily specified with an instruction that is preferentially issued, and is analyzed by parser means for parsing the source program The intermediate code conversion means for converting the source program into an intermediate code and the instruction issued preferentially in each of the plurality of instruction issue units without breaking the dependency relationship between the instructions corresponding to the intermediate code, The instruction is arranged at a position corresponding to each of the plurality of instruction issuing units, and the intermediate code is optimized. And means, characterized in that it comprises a code generating means for converting the machine instructions the intermediate code optimized.
これにより、同じ命令発行ユニットで優先発行される命令として、プロセッサの同じ構成要素を利用する命令を割り当てれば、同一の命令発行ユニットでは、同じ構成要素を利用する命令が連続して実行されることになるため、プロセッサを低消費電力で動作させることができる命令列が生成される。 Thus, if an instruction that uses the same component of the processor is assigned as an instruction that is preferentially issued by the same instruction issuing unit, instructions that use the same component are continuously executed in the same instruction issuing unit. Therefore, an instruction string that can operate the processor with low power consumption is generated.
さらにまた、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記複数の命令発行ユニットにそれぞれ対応する複数の命令の配置位置について、同一数の命令の未配置位置があらかじめ定められた命令サイクル数以上連続する区間を検出する区間検出手段と、前記区間の直前に、前記命令の未配置位置に対応する命令発行ユニットの動作を停止させるための命令を挿入する第1の命令挿入手段と、当該命令が挿入された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。 Furthermore, a compiler apparatus according to the present invention is for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler device that translates into a machine language program, which corresponds to parser means for parsing the source program, intermediate code conversion means for converting the analyzed source program into intermediate code, and the plurality of instruction issuing units, respectively. And a section detecting means for detecting a section in which unplaced positions of the same number of instructions continue for more than a predetermined number of instruction cycles, and the unplaced position of the instructions immediately before the section. First instruction insertion means for inserting an instruction for stopping the operation of the corresponding instruction issuing unit Characterized by comprising a code generating means for converting the intermediate code to which the instruction is inserted into machine instructions.
これにより、命令発行ユニットに対応する位置に命令が連続して配置されていない場合には、その間、その命令発行ユニットへの電力の供給を停止させることができため、プロセッサを低消費電力で動作させることができる命令列が生成される。 As a result, when instructions are not continuously arranged at the position corresponding to the instruction issuing unit, the supply of power to the instruction issuing unit can be stopped during that time, so that the processor operates with low power consumption. An instruction sequence that can be generated is generated.
さらにまた、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムは、前記プロセッサが使用する命令発行ユニットの個数を指定可能な個数指定情報を含み、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、前記個数指定情報で指定された個数の命令発行ユニットのみを動作させるように命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。 Furthermore, a compiler apparatus according to the present invention is for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler apparatus for translating into a machine language program, wherein the source program includes number specifying information that can specify the number of instruction issuing units used by the processor, and is analyzed by parser means for parsing the source program. In addition, the intermediate code converting means for converting the source program into the intermediate code and the instruction issuing unit of the number specified by the number specifying information are operated without breaking the dependency relationship between the instructions corresponding to the intermediate code. An optimization means for allocating instructions and optimizing the intermediate code; Characterized in that it comprises a code generating means for converting the intermediate code into machine language instructions.
これにより、個数指定情報で指定された箇所の命令に関しては、命令が供給されない命令発行ユニットを発生させることができ、その命令発行ユニットへの電力の供給を停止させることができるため、プロセッサを低消費電力で動作させることができる命令列が生成される。 As a result, regarding the instruction at the location specified by the number specification information, an instruction issuing unit to which no instruction is supplied can be generated and power supply to the instruction issuing unit can be stopped. An instruction sequence that can be operated with power consumption is generated.
さらにまた、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記プロセッサが使用する命令発行ユニットの個数を受付ける受付け手段と、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、前記受付け手段が受付けた前記個数の命令発行ユニットのみを動作させるように命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。 Furthermore, a compiler apparatus according to the present invention is for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler device that translates into a machine language program, receiving means for receiving the number of instruction issuing units used by the processor, parser means for parsing the source program, and converting the analyzed source program into intermediate code The intermediate code converting means and the instructions corresponding to the intermediate code are arranged so as to operate only the number of instruction issuing units received by the receiving means without breaking the dependency relationship between the instructions. Optimization means for converting the intermediate code into machine language instructions Characterized in that it comprises a code generating means.
これにより、受付け手段で受付けた個数の命令発行ユニットのみを動作させ、その他の命令発行ユニットへの電力の供給を停止させることができるため、プロセッサを低消費電力で動作させることができる命令例が生成される。 As a result, only the number of instruction issuing units received by the receiving means can be operated and the supply of power to the other instruction issuing units can be stopped, so that there are instruction examples that can operate the processor with low power consumption. Generated.
なお、本発明は、このようなコンパイラ装置として実現することができるだけでなく、このようなプログラムに含まれる手段をステップとするコンパイル方法として実現したり、このような特徴的なコンパイラ用のプログラムまたはコンピュータ読取可能な記録媒体として実現したりすることもできる。そして、そのようなプログラムやデータファイルは、CD−ROM(Compact Disk-Read Only Memory)等の記録媒体やインターネット等の伝送媒体を介して広く流通させることができるのは言うまでもない。 The present invention can be realized not only as such a compiler apparatus but also as a compiling method using steps included in such a program as a step, or a characteristic compiler program or It can also be realized as a computer-readable recording medium. Needless to say, such a program or data file can be widely distributed via a recording medium such as a CD-ROM (Compact Disk-Read Only Memory) or a transmission medium such as the Internet.
以上の説明から明らかように、本発明に係るコンパイラ装置によると、プロセッサの命令レジスタに保持される値のビット変化が小さく、プロセッサを低消費電力で動作させることができる命令列が生成される。 As can be seen from the above description, according to the compiler apparatus of the present invention, an instruction sequence is generated in which the bit change of the value held in the instruction register of the processor is small and the processor can be operated with low power consumption.
また、同一のレジスタへのアクセスが連続し、レジスタを選択するための制御信号の変化が少なくなり、プロセッサを低消費電力で動作させることができる命令列が生成される。 In addition, an access to the same register is continued, a change in a control signal for selecting the register is reduced, and an instruction sequence that can operate the processor with low power consumption is generated.
さらに、同一スロットで同じ構成要素を利用する命を連続して実行させることができるため、プロセッサを低消費電力で動作させることができる命令列が生成される。 Furthermore, since instructions that use the same component in the same slot can be continuously executed, an instruction sequence that can operate the processor with low power consumption is generated.
さらにまた、空きスロットへの電力の供給を停止させることができるため、プロセッサを低消費電力で動作させることができる命令列が生成される。 Furthermore, since the power supply to the empty slot can be stopped, an instruction sequence that can operate the processor with low power consumption is generated.
以上のように、本発明に係るコンパイラにより、並列処理可能なプロセッサを低消費電力で動作させることが可能となる。特に、携帯電話、情報携帯端末等の携帯型の情報処理装置のように、低消費電力での動作が求められる装置で用いられるプロセッサ向きの命令列(機械語プログラム)を生成することができ、その実用的価値は極めて高い。 As described above, the compiler according to the present invention makes it possible to operate a processor capable of parallel processing with low power consumption. In particular, it is possible to generate a processor-oriented instruction sequence (machine language program) used in a device that requires operation with low power consumption, such as a portable information processing device such as a mobile phone or an information portable terminal, Its practical value is extremely high.
以下、本発明に係るコンパイラの実施の形態について図面を用いて詳細に説明する。
本実施の形態におけるコンパイラは、C/C++言語等の高級言語で記述されたソースプログラムを特定のプロセッサ(ターゲット)が実行できる機械語プログラムに翻訳するクロスコンパイラであり、プロセッサの消費電力を低減させることができるという特徴を有する。
Hereinafter, embodiments of a compiler according to the present invention will be described in detail with reference to the drawings.
The compiler in this embodiment is a cross compiler that translates a source program written in a high-level language such as C / C ++ into a machine language program that can be executed by a specific processor (target), and reduces the power consumption of the processor. It has the feature that it can be.
[プロセッサ]
まず、本実施の形態におけるコンパイラの対象となるプロセッサの一例について、図1〜図11を用いて説明する。
[Processor]
First, an example of a processor that is a target of a compiler according to the present embodiment will be described with reference to FIGS.
本実施の形態におけるコンパイラの対象となるプロセッサは、例えば、通常のマイコンに比べて実行可能な命令の並列性が高く、複数の命令を並列して処理できるようにパイプライン方式が採用されている。 The processor that is the target of the compiler in this embodiment, for example, has higher parallelism of instructions that can be executed than a normal microcomputer, and adopts a pipeline system so that a plurality of instructions can be processed in parallel. .
図1は、本実施の形態に係るプロセッサが解読実行する命令の構造を示す図である。
図1(a)〜図1(d)を参照して、本プロセッサの各命令は、32ビットの固定長である。各命令の0ビット目は、並列実行境界情報を示す。並列実行境界情報が“1”のときは、その命令と後続命令との間に並列実行の境界が存在し、並列実行境界情報が“0”のときは、並列実行の境界が存在しないことになる。並列実行境界情報の利用方法については、後述する。
FIG. 1 is a diagram showing a structure of an instruction that is decoded and executed by the processor according to the present embodiment.
1A to 1D, each instruction of the processor has a fixed length of 32 bits. The 0th bit of each instruction indicates parallel execution boundary information. When the parallel execution boundary information is “1”, there is a parallel execution boundary between the instruction and the succeeding instruction, and when the parallel execution boundary information is “0”, there is no parallel execution boundary. Become. A method of using the parallel execution boundary information will be described later.
各命令の命令長から並列実行境界情報を除いた31ビットの部分においてオペレーションを決定する。具体的には、フィールド“Op1”、“Op2”、“Op3”および“Op4”では、オペレーションの種類を示すオペコードを指定する。レジスタフィールド“Rs”、“Rs1”および“Rs2”では、ソースオペランドとなるレジスタのレジスタ番号を指定する。レジスタフィールド“Rd”では、ディスティネーションオペランドとなるレジスタのレジスタ番号を指定する。フィールド“Imm”では、演算用定数オペランドを指定する。フィールド“Disp”では、変位(ディスプレースメント)を指定する。 The operation is determined in the 31-bit portion obtained by removing the parallel execution boundary information from the instruction length of each instruction. Specifically, in the fields “Op1”, “Op2”, “Op3”, and “Op4”, an operation code indicating the type of operation is designated. In the register fields “Rs”, “Rs1”, and “Rs2”, the register number of the register that becomes the source operand is designated. In the register field “Rd”, the register number of the register serving as the destination operand is designated. In the field “Imm”, a constant operand for calculation is designated. In the field “Disp”, a displacement is specified.
オペコードの先頭2ビット(30および31ビット目)は、オペレーションの種類(オペレーション群)を指定するために用いられる。その詳細については、後述する。 The first 2 bits (30th and 31st bits) of the opcode are used to specify the type of operation (operation group). Details thereof will be described later.
オペコードOp2〜Op4は、16ビット長のデータであるが、オペコードOp1は21ビット長のデータである。したがって、便宜的に、オペコードOp1の前半部分(16〜31ビット目)をオペコードOp1−1と呼び、後半部分(11〜15ビット目)をオペコードOp1−2と呼ぶ。 The opcodes Op2 to Op4 are 16-bit data, while the opcode Op1 is 21-bit data. Therefore, for the sake of convenience, the first half (16th to 31st bits) of the opcode Op1 is called an opcode Op1-1, and the second half (11th to 15th bits) is called an opcode Op1-2.
図2は、本実施の形態に係るプロセッサの概略構成を示すブロック図である。プロセッサ30は、VLIW(Very Long Instruction Word)方式に従って記述された命令群(以下「パケット」と呼ぶ。)を記憶する命令メモリ40と、命令供給発行部50と、解読部60と、実行部70と、データメモリ100とを含む。各部の詳細については後述する。
FIG. 2 is a block diagram showing a schematic configuration of the processor according to the present embodiment. The
図3は、パケットの一例を示す図である。1パケットは、命令フェッチの単位であり、4命令から構成されるものと定義する。上述のように、1命令は32ビット長である。このため、1パケットは、128(=32×4)ビット長である。 FIG. 3 is a diagram illustrating an example of a packet. One packet is a unit of instruction fetch and is defined to be composed of four instructions. As described above, one instruction is 32 bits long. Therefore, one packet is 128 (= 32 × 4) bits long.
再度図2を参照して、命令供給発行部50は、命令メモリ40、解読部60および実行部70に接続され、実行部70より供給されるPC(プログラムカウンタ)の値に基づいて、命令メモリ40よりパケットを受信し、解読部60に並列して最高3つの命令を供給する。
Referring again to FIG. 2, the instruction supply /
解読部60は、命令供給発行部50および実行部70に接続され、命令供給発行部50から供給された命令を解読し、実行部70に供給する。
The
実行部70は、命令供給発行部50、解読部60およびデータメモリ100に接続され、解読部60より供給される解読結果に基づいて、必要に応じデータメモリ100に記憶されたデータアクセスを行ない、命令に基づいた処理を実行する。また、処理が実行されるごとに、実行部70はPCの値を1つずつインクリメントする。
The
命令供給発行部50は、命令メモリ40および実行部70内の後述するPC部に接続され、PC部に保持されたプログラムカウンタで示される命令メモリ40のアドレスにアクセスし、命令メモリ40よりパケットを受信する命令フェッチ部52と、命令フェッチ部52に接続され、パケットを一時的に保持する命令バッファ54と、命令バッファ54に接続され、パケットに含まれる命令を最大3つ保持する命令レジスタ部56とを含む。
The instruction supply /
命令フェッチ部52および命令メモリ40は、IA(Instruction Address)バス42およびID(Instruction Data)バス44により接続されている。IAバス42は32ビット幅であり、IDバス44は128ビット幅である。命令フェッチ部52から命令メモリ40へのアドレス供給は、IAバス42を介して行われる。命令メモリ40から命令フェッチ部52へのパケットの供給は、IDバス44を解して行われる。
The instruction fetch
命令レジスタ部56は、各々命令バッファ54に接続され、それぞれ1つの命令を保持する命令レジスタ56a〜56cを含む。
The
解読部60は、命令レジスタ部56内の3つの命令レジスタ56a〜56cに保持された命令の発行に関する制御を行う命令発行制御部62と、命令発行制御部62および命令レジスタ部56に接続され、命令発行制御部62の制御に基づいて、命令レジスタ部56から供給される命令をデコードするデコード部64とを含む。
The
デコード部64は、命令レジスタ56a〜56cにそれぞれ接続され、基本的に1サイクルに1つの命令を解読し、制御信号を出力する命令デコーダ64a〜64cを含む。
The
実行部70は、デコード部64に接続され、デコード部64内の3つの命令デコーダ64a〜64cより出力される制御信号に基づいて、実行部70内の後述する各構成要素を制御する実行制御部72と、次に実行すべきパケットのアドレスを保持するPC部74と、32個の32ビットレジスタR0〜R31から構成されるレジスタファイル76と、各々、SIMD(Single Instruction Multiple Data)型命令の演算を実行する算術論理・比較演算部78a〜78cと、算術論理・比較演算部78a〜78cと同様、SIMD型命令の実行が可能であり、ビット精度を落とさないように、最長で65ビットで累算する乗算・積和演算部80aおよび80bとを含む。
The
実行部70は、さらに、各々、データの算術シフト(2の補数体系のシフト)または論理シフト(符号なしシフト)を実行するバレルシフタ82a〜82bと、除算器84と、データメモリ100に接続され、データメモリ100との間でデータの受渡しを行うオペランドアクセス部88と、32ビット幅のデータバス90(L1バス、R1バス、L2バス、R2バス、L3バス、R3バス)と、32ビット幅のデータバス92(D1バス、D2バス、D3バス)とを含む。
The
レジスタファイル76は、32個の32ビットレジスタR0〜R31を含む。L1バス、R1バス、L2バス、R2バス、L3バスおよびR3バスにデータを出力するレジスタファイル76内のレジスタの選択は、実行制御部72よりレジスタファイル76に供給される制御信号CL1、CR1、CL2、CR2、CL3およびCR3によりそれぞれ行なわれる。また、D1バス、D2バスおよびD3バスを流れるデータが書き込まれるレジスタの選択は、実行制御部72よりレジスタファイル76に供給される制御信号CD1、CD2およびCD3によりそれぞれ行なわれる。
The
算術論理・比較演算部78aの2つの入力ポートは、L1バスおよびR1バスにそれぞれ接続され、その出力ポートは、D1バスに接続されている。算術論理・比較演算部78bの2つの入力ポートは、L2バスおよびR2バスにそれぞれ接続され、その出力ポートは、D2バスに接続されている。算術論理・比較演算部78cの2つの入力ポートは、L3バスおよびR3バスにそれぞれ接続され、その出力ポートは、D3バスに接続されている。
Two input ports of the arithmetic logic /
乗算・積和演算部80aの4つの入力ポートは、L1バス、R1バス、L2バスおよびR2バスにそれぞれ接続され、その2つの出力ポートは、D1バスおよびD2バスにそれぞれ接続されている。乗算・積和演算部80bの4つの入力ポートは、L2バス、R2バス、L3バスおよびR3バスにそれぞれ接続され、その2つの出力ポートは、D2バスおよびD3バスにそれぞれ接続されている。
The four input ports of the multiplication / product-
バレルシフタ82aの2つの入力ポートは、L1バスおよびR1バスにそれぞれ接続され、その出力ポートは、D1バスに接続されている。バレルシフタ82bの2つの入力ポートは、L2バスおよびR2バスにそれぞれ接続され、その出力ポートは、D2バスに接続されている。バレルシフタ82cの2つの入力ポートは、L3バスおよびR3バスにそれぞれ接続され、その出力ポートは、D3バスに接続されている。
Two input ports of the
除算器84の2つの入力ポートは、L1バスおよびR1バスにそれぞれ接続され、その出力ポートは、D1バスに接続されている。 Two input ports of the divider 84 are connected to the L1 bus and the R1 bus, respectively, and their output ports are connected to the D1 bus.
オペランドアクセス部88およびデータメモリ100は、OA(Operand Address)バス96およびOD(OperandData)バス94により接続されている。OAバス96およびODバス94はそれぞれ32ビット幅である。また、オペランドアクセス部88は、OAバス96を介してデータメモリ100のアドレスを指定し、ODバス94を介して、当該アドレスのデータの読み書きを行なう。
The
また、オペランドアクセス部88は、D1バス、D2バス、D3バス、L1バスおよびR1バスに接続され、いずれかのバスとの間でデータの受渡しを行なう。
プロセッサ30は、3命令を並列実行可能であるが、後述するように、パイプライン動作のうち、並列実行可能な命令割り当てステージ、デコードステージ、実行ステージおよび書き込みステージからなる1組のパイプライン処理を実行させうる回路の集合を本明細書中で「スロット」と定義する。したがって、プロセッサ30は、第1〜第3スロットの3つのスロットを有する。命令レジスタ56aおよび命令デコーダ64aの組は第1スロット、命令レジスタ56bおよび命令デコーダ64bの組は第2スロット、命令レジスタ56cおよび命令デコーダ64cの組は第3スロットにそれぞれ属するものとする。
Although the
各スロットには、デフォルト論理と呼ばれる命令が割り当てられており、同一のスロットでは極力同一の命令が実行されるように、命令スケジューリングが行なわれる。例えば、第1スロットにはメモリアクセスに関する命令(デフォルト論理)、第2スロットには乗算に関するデフォルト論理、第3スロットにはその他のデフォルト論理が割り当てられている。なお、デフォルト論理は、図1を参照して説明したオペレーション群と一対一に対応している。すなわち、先頭2ビットが“01”、“10”および“11”の命令は、それぞれ第1スロット、第2スロットおよび第3スロットのデフォルト論理である。 Each slot is assigned an instruction called default logic, and instruction scheduling is performed so that the same instruction is executed as much as possible in the same slot. For example, an instruction relating to memory access (default logic) is assigned to the first slot, a default logic relating to multiplication is assigned to the second slot, and other default logic is assigned to the third slot. Note that the default logic has a one-to-one correspondence with the operation group described with reference to FIG. That is, instructions whose first 2 bits are “01”, “10”, and “11” are the default logic of the first slot, the second slot, and the third slot, respectively.
第1スロットのデフォルト論理としては、ld(ロード命令)、st(ストア命令)などがある。第2スロットのデフォルト論理としては、mul1,mul2(乗算命令)などがある。第3スロットのデフォルト論理としては、add1,add2(加算命令)、sub1,sub2(減算命令)、mov1,mov2(レジスタ間の転送命令)などがある。 The default logic of the first slot includes ld (load instruction), st (store instruction), and the like. The default logic of the second slot includes mul1, mul2 (multiplication instruction) and the like. The default logic of the third slot includes add1, add2 (addition instruction), sub1, sub2 (subtraction instruction), mov1, mov2 (transfer instruction between registers), and the like.
図4は、パケットに含まれる並列実行境界情報について説明するための図である。命令メモリ40には、パケット112および114の順でパケットが記憶されているものとする。このうち、パケット112の命令2およびパケット114の命令5の並列実行境界情報は“1”であるものとし、それ以外の命令の並列実行境界情報は“0”であるものとする。
FIG. 4 is a diagram for explaining parallel execution boundary information included in a packet. Assume that packets are stored in the instruction memory 40 in the order of
命令フェッチ部52は、PC部74のプログラムカウンタの値に基づいて、パケット112、パケット114の順でパケットを読み込み、順次、命令バッファ54に供給する。実行部70では並列実行境界情報が“1”までの命令が並列実行される。
The instruction fetch
図5は、パケットの並列実行境界情報に基づいて作成された並列実行される命令の実行単位の一例を示す図である。図4および図5を参照して、パケット112および114を並列実行境界情報が“1”の命令の部分で区切ると、実行単位122〜126が生成される。したがって、命令バッファ54から命令レジスタ部56には、実行単位122〜126の順で命令が供給されることとなる。これらの、命令の供給に関する制御は、命令発行制御部62が行なう。
FIG. 5 is a diagram illustrating an example of an execution unit of instructions executed in parallel created based on parallel execution boundary information of packets. Referring to FIGS. 4 and 5, when
命令デコーダ64a〜64cは、命令レジスタ56a〜56cに保持された命令のオペコードをそれぞれ解読し、制御信号を実行制御部72に出力する。実行制御部72は、命令デコーダ64a〜64cでの解析結果に基づいて、実行部70の構成要素の各種制御を行なう。
The
例えば、命令“add1 R3,R0”について考える。この命令の意味は、レジスタR3の値とレジスタR0の値とを加算し、結果をレジスタR0に書き込むというものであるが、この場合、実行制御部72は、以下のような制御を一例として行なう。実行制御部72は、レジスタR3に保持された値をL1バスに出力するための制御信号CL1をレジスタファイル76に供給する。また、実行制御部72は、レジスタR0に保持された値をR1バスに出力するための制御信号CR1をレジスタファイル76に供給する。
For example, consider the instruction “add1 R3, R0”. The meaning of this instruction is to add the value of the register R3 and the value of the register R0 and write the result to the register R0. In this case, the execution control unit 72 performs the following control as an example. . The execution control unit 72 supplies the
さらに、実行制御部72は、D1バスを介して得られる実行結果をレジスタR0に書き込むための制御信号CD1をレジスタファイル76に供給する。さらにまた、実行制御部72は算術論理・比較演算部78aを制御し、L1バスおよびL2バスを介してレジスタR3およびR0の値を受け取り、加算した後、加算結果をD1バスを介してレジスタR0に書き込む。
Further, the execution control unit 72 supplies a control signal CD1 for writing the execution result obtained through the D1 bus to the register R0 to the
図6は、算術論理・比較演算部78a〜78cの概略構成を示すブロック図である。図6および図2を参照して、算術論理・比較演算部78a〜78cの各々は、データバス90を介してレジスタファイル76に接続されたALU(Arithmetic and Logical Unit)部132と、ALU部132およびデータバス92を介してレジスタファイル76に接続され、飽和、最大・最小値検出、絶対値生成処理を行なう飽和処理部134と、ALU部132に接続され、オーバーフローの検出とコンディションフラグの生成を行なうフラグ部136とを含む。
FIG. 6 is a block diagram showing a schematic configuration of the arithmetic logic /
図7は、バレルシフタ82a〜82cの概略構成を示すブロック図である。図7および図2を参照して、バレルシフタ82a〜82cの各々は、32ビットのデータを保持するアキュムレータM0およびM1を有するアキュムレータ部142と、アキュムレータM0およびデータバス90を介してレジスタファイル76に接続され、アキュムレータM0またはレジスタの値を受けるセレクタ146と、アキュムレータM1およびデータバス90を介してレジスタファイル76に接続され、アキュムレータM1およびレジスタの値を受けるセレクタ148と、セレクタ146の出力に接続された上位バレルシフタ150と、セレクタ148の出力に接続された下位バレルシフタ152と、上位バレルシフタ150および下位バレルシフタ152の出力に接続された飽和処理部154とを含む。
FIG. 7 is a block diagram illustrating a schematic configuration of the
飽和処理部154の出力は、アキュムレータ部142とデータバス92を介してレジスタファイル76とに接続されている。
The output of the
バレルシフタ82a〜82cの各々は、構成部品を動作させることにより、データの算術シフト(2の補数体系のシフト)または論理シフト(符号なしシフト)を実行する。通常は、32ビットもしくは、64ビットのデータを入出力としている。レジスタファイル76内のレジスタまたはアキュムレータ部142内のアキュムレータに格納された被シフトデータに対して、別のレジスタまたは即値でシフト量が指定される。データは、左63ビット〜右63ビットの算術または論理シフトが行われ、入力ビット長で出力される。
Each of the
また、バレルシフタ82a〜82cの各々は、SIMD型命令に対して、8、16、32、64ビットのデータをシフトすることができる。例えば、8ビットデータのシフトを4並列で処理することができる。
Further, each of the
算術シフトは、2の補数体系のシフトであり、加算や減算時の小数点の位置合わせや、2のべき乗の乗算(2、2の2乗、2の(−1)乗、2の(−2)乗倍など)等のために行われる。 Arithmetic shift is a shift of 2's complement system, and alignment of decimal point at the time of addition or subtraction, multiplication by power of 2 (2, 2 squared, 2 (-1) power, 2 (-2) Etc.) etc.
図8は、除算器84の概略構成を示すブロック図である。図8および図2を参照して、除算器84は、32ビットのデータを保持するアキュムレータM0およびM1を有するアキュムレータ部162と、アキュムレータ部162ならびにデータバス90および92を介してレジスタファイル76に接続された除算部164とを含む。
FIG. 8 is a block diagram showing a schematic configuration of the divider 84. Referring to FIGS. 8 and 2, divider 84 is connected to register
除算器84は、被除数を64ビット、除数を32ビットとし、商と剰余を32ビットずつ出力する。商と剰余を求めるまでに34サイクルを必要とする。符号付き、符号なし、両方のデータを扱うことが可能である。ただし、被除数と除数において符号の有無の設定は共通とする。その他、オーバーフローフラグ、0除算フラグを出力する機能を有する。 Divider 84 sets the dividend to 64 bits and the divisor to 32 bits, and outputs the quotient and remainder each 32 bits. 34 cycles are required to find the quotient and the remainder. Both signed and unsigned data can be handled. However, the setting of the presence / absence of a sign is common to the dividend and the divisor. In addition, it has a function of outputting an overflow flag and a division by zero flag.
図9は、乗算・積和演算部80aおよび80bの概略構成を示すブロック図である。図9および図2を参照して、乗算・積和演算部80aおよび80bの各々は、64ビットのデータを保持するアキュムレータM0およびM1を有するアキュムレータ部172と、各々データバス90を介してレジスタファイル76に接続された2入力の32ビット乗算器(MUL)174aおよび174bとを含む。
FIG. 9 is a block diagram showing a schematic configuration of the multiplication / product-
乗算・積和演算部80aおよび80bの各々は、さらに、乗算器174aの出力およびアキュムレータ部172に接続された64ビット加算器(Adder)176aと、乗算器174bの出力およびアキュムレータ部172に接続された64ビット加算器176bと、64ビット加算器176aおよび64ビット加算器176bの出力に接続された64ビット加算器176cと、64ビット加算器176bおよび176cの出力に接続されたセレクタ178と、加算器176aの出力、セレクタ178の出力、アキュムレータ部172およびデータバス92を介してレジスタファイル76に接続された飽和処理部(Saturation)180とを含む。
Each of multiplication / product-
乗算・積和演算部80aおよび80bの各々は、以下の乗算、積和演算を行う。
・32×32ビットのsignedの乗算、積和、積差演算
・32×32ビットのunsignedの乗算
・16×16ビットの2並列のsignedの乗算、積和、積差演算
・32×16ビットの2並列のsignedの乗算、積和、積差演算
Each of the multiplication / product-
32 × 32 bit signed multiplication, product sum,
これらの演算を整数、固定小数点フォーマットのデータに対して行う。また、これらの演算に対し、丸め、飽和を行う。 These operations are performed on data in integer and fixed-point format. Also, rounding and saturation are performed for these operations.
図10は、このようなプロセッサ30による命令実行時の各パイプライン動作を示すタイミング図である。図2および図10を参照して、命令フェッチステージでは、命令フェッチ部52が、PC部74に保持されたプログラムカウンタで指定されるアドレスの命令メモリ40をアクセスし、パケットを命令バッファ54に転送する。命令割り当てステージでは、命令バッファ54に保持された命令が命令レジスタ56a〜56cに割り当てられる。デコードステージでは、命令レジスタ56a〜56cに割り当てられた命令が、命令発行制御部62からの制御に従い、命令デコーダ64a〜64cでそれぞれデコードされる。実行ステージでは、命令デコーダ64a〜64cでのデコード結果に基づいて、実行制御部72が実行部70の構成部品を動作させ、各種演算を実行する。書き込みステージでは、演算結果をデータメモリ100またはレジスタファイル76に格納する。これらの処理により、最高3並列のパイプライン処理が実行可能になる。
FIG. 10 is a timing chart showing each pipeline operation when an instruction is executed by the
図11は、プロセッサ30で実行される命令、処理の内容およびそのビットパターンを示す図である。命令“ld Rs,Rd”は、データメモリ100の、図1で示したオペレーションのRsフィールドで指定されるレジスタ(以下「レジスタRs」という。以下同様である。)の値の番地のデータメモリ100に記憶されたデータを、レジスタRdにロードする処理を示す。そのビットパターンは、図11で図示したとおりである。
FIG. 11 is a diagram illustrating instructions executed by the
なお、図11のビットパターンのうち、先頭2ビット(30および31ビット目)は、オペレーション群を指定するために用いられ、0ビット目は、並列実行境界情報を指定するために用いられる。上述の先頭2ビットが“01”のオペレーションは、メモリアクセスに関するものである。先頭2ビットが“10”のオペレーションは、乗算に関するものである。先頭2ビットが“11”のオペレーションは、その他の演算に関するものである。 In the bit pattern of FIG. 11, the first 2 bits (30th and 31st bits) are used to specify an operation group, and the 0th bit is used to specify parallel execution boundary information. The above-described operation in which the first two bits are “01” relates to memory access. An operation whose first 2 bits are “10” relates to multiplication. The operation having the first two bits of “11” relates to other operations.
命令“st Rs,Rd”は、レジスタRsの値を、データメモリ100のレジスタRdで指定される番地にストアする処理を示す。 The instruction “st Rs, Rd” indicates a process of storing the value of the register Rs at the address specified by the register Rd of the data memory 100.
命令“mul1 Rs,Rd”は、レジスタRsの値とレジスタRdの値との積をレジスタRdに書き込む処理を示す。命令“mul2 Rs1,Rs2、Rd”は、レジスタRs1の値とレジスタRs2の値との積をレジスタRdに書き込む処理を示す。 The instruction “mul1 Rs, Rd” indicates a process of writing the product of the value of the register Rs and the value of the register Rd to the register Rd. The instruction “mul2 Rs1, Rs2, Rd” indicates a process of writing the product of the value of the register Rs1 and the value of the register Rs2 to the register Rd.
命令“add1 Rs,Rd”は、レジスタRsの値とレジスタRdの値との和をレジスタRdに書き込む処理を示す。命令“add2 Rs1,Rs2,Rd”は、レジスタRs1の値とレジスタRs2の値との和をレジスタRdに書き込む処理を示す。 The instruction “add1 Rs, Rd” indicates a process of writing the sum of the value of the register Rs and the value of the register Rd to the register Rd. The instruction “add2 Rs1, Rs2, Rd” indicates a process of writing the sum of the value of the register Rs1 and the value of the register Rs2 to the register Rd.
命令“sub1 Rs,Rd”は、レジスタRsの値とレジスタRdの値との差をレジスタRdに書き込む処理を示す。命令“sub2 Rs1,Rs2,Rd”は、レジスタRs1の値とレジスタRs2の値との差をレジスタRdに書き込む処理を示す。 The instruction “sub1 Rs, Rd” indicates a process of writing the difference between the value of the register Rs and the value of the register Rd into the register Rd. The instruction “sub2 Rs1, Rs2, Rd” indicates a process of writing the difference between the value of the register Rs1 and the value of the register Rs2 to the register Rd.
命令“mov1 Rs,Rd”は、レジスタRsの値をレジスタRdに書き込む処理を示す。命令“mov2 Imm,Rd”は、Immフィールドの値をレジスタRdに書き込む処理を示す。 The instruction “mov1 Rs, Rd” indicates a process of writing the value of the register Rs to the register Rd. The instruction “mov2 Imm, Rd” indicates a process of writing the value of the Imm field into the register Rd.
命令“div Rs,Rd”は、レジスタRsの値をレジスタRdの値で除した商をレジスタRdに書き込む処理を示す。命令“mod Rs,Rd”は、レジスタRsの値をレジスタRdの値で除した剰余をレジスタRdに書き込む処理を示す。 The instruction “div Rs, Rd” indicates a process of writing a quotient obtained by dividing the value of the register Rs by the value of the register Rd into the register Rd. The instruction “mod Rs, Rd” indicates a process of writing a remainder obtained by dividing the value of the register Rs by the value of the register Rd into the register Rd.
[コンパイラ]
次に、上述のプロセッサ30をターゲットとする本実施の形態に係るコンパイラの一例について図12〜図38を用いて説明する。
[compiler]
Next, an example of a compiler according to the present embodiment targeting the above-described
[コンパイラの全体構成]
図12は、本実施の形態に係るコンパイラ200の構成を示す機能ブロック図である。このコンパイラ200は、C/C++言語等の高級言語で記述されたソースプログラム202を、上述のプロセッサ30をターゲットプロセッサとする機械語プログラム204に変換するクロスコンパイラであり、パーソナルコンピュータ等のコンピュータ上で実行されるプログラムによって実現され、大きく分けて、パーサー部210と、中間コード変換部220と、最適化部230と、コード生成部240とから構成される。
[Compiler overall configuration]
FIG. 12 is a functional block diagram showing a configuration of the
パーサー部210は、コンパイルの対象となるソースプログラム202(インクルードされるヘッダファイルを含む)に対して、予約語(キーワード)等を抽出して字句解析する前置処理部であり、通常のコンパイラが備える解析機能を有する。
The
中間コード変換部220は、パーサー部210に接続され、パーサー部210から渡されたソースプログラム202の各ステートメントを一定規則に基づいて中間コードに変換する処理部である。ここで、中間コードは、典型的には、関数呼び出しの形式で表現されるコード(例えば、「+(int a, int b)」を示すコード;「整数aに整数bを加算する」ことを示す。)である。
The intermediate
最適化部230は、中間コード変換部220に接続され、中間コード変換部220から出力された中間コードについて、命令のオペコードに着目し、命令間の依存関係を崩すことなくプロセッサ30の消費電力が小さくなるように、命令の配置を行なう命令スケジューリング部232と、命令スケジューリング部232に接続され、命令スケジューリング部232でのスケジュール結果について、命令のレジスタフィールドに着目して、プロセッサ30の消費電力が小さくなるようにレジスタを割り付けるレジスタ割付部234とを含む。
The
最適化部230は、さらに、レジスタ割付部234に接続され、レジスタが割り付けられたスケジュール結果について、命令のビットパターンに着目し、命令の依存関係を崩すことなくプロセッサ30の消費電力が小さくなるように、命令の再配置を行なう命令再スケジューリング部236と、命令再スケジューリング部236に接続され、命令再スケジューリング部236のスケジュール結果について、一定サイクル以上停止しているスロットを検出し、その前後に、当該スロットを停止および復帰させる命令を挿入するスロット停止・復帰命令生成部238とを含む。
The
最適化部230は、さらに、スロット停止・復帰命令生成部238に接続され、スケジュール結果に基づいて、配置された命令の並列実行境界情報を設定する並列実行境界情報設定部239と、命令スケジューリング部232、レジスタ割付部234および命令再スケジューリング部236に接続され、スケジュール結果を各サイクルごとに消費電力が小さくなるように配置しなおすサイクル内配置調整処理部237とを含む。
The
なお、後述する最適化部230での処理は、基本ブロック単位に行なわれる。基本ブロックとは、たとえば式や代入文の並びのような、途中から外部への分岐が起こらず、また、外部から途中への分岐も起こらないプログラムの単位を言う。
Note that processing in the
コード生成部240は、最適化部230の並列実行境界情報設定部239に接続され、並列実行境界情報設定部239から出力された中間コードに対して、内部に保持する変換テーブル等を参照することで、全ての中間コードを機械語命令に置き換えることで、機械語プログラム204を生成する。
The
次に、以上のように構成されたコンパイラ200の特徴的な動作について、具体的な例を示しながら説明する。
Next, a characteristic operation of the
[命令スケジューリング部]
図13は、命令スケジューリング部232の動作を示すフローチャートである。命令スケジューリング部232の処理では、レジスタのスケジューリングは行なわず、レジスタの個数は無限にあると想定して処理が行なわれる。したがって、以下の説明では、命令スケジューリング部232でスケジューリングされるレジスタにはVr(Virtual Register)0、Vr1など、先頭にVrが付されるものとする。
[Instruction scheduling section]
FIG. 13 is a flowchart showing the operation of the
命令スケジューリング部232は、中間コード変換部220で生成された中間コードに基づいて、命令の依存グラフを作成する(ステップS2(以下「ステップ」を省略する。))。依存グラフとは、命令間の依存関係を示したグラフであり、命令ごとにノードを割り付け、依存関係のある命令をエッジで結んだ有向グラフである。依存グラフに関しては、周知の技術である。したがって、その詳細な説明はここでは繰返さない。たとえば、ここでは、図14(a)に示されるような3つの有向グラフからなる依存グラフが作成されるものとする。
The
命令スケジューリング部232は、依存グラフの中から実行可能な命令(ノード)を選択し、そのうち、各スロットのデフォルト論理に合致するように1サイクル目の命令をスケジューリングする(S4)。例えば、図14(a)の依存グラフでは、ノードN1、N6、N7、N11およびN12の命令のノードがスケジューリング可能であるが、そのうち、ノードN1がメモリアクセスに関する命令であり、ノードN11が乗算命令であり、ノードN6がシフト命令であるとする。この場合、ノードN1、N11およびN6がそれぞれ1サイクル目の第1〜第3スロットにそれぞれ配置される。配置済みのノードにはフラグが付され、依存グラフは図14(b)のように更新される。1サイクル目の命令スケジューリング(S4)の後、図15に示されるような命令のスケジュール結果が得られる。
The
命令スケジューリング部232は、依存グラフを参照し、配置候補命令集合を生成する(S8)。すなわち、図14(b)の例では、ノードN2、N7、N8およびN12で示される命令が配置候補命令集合となる。
The
命令スケジューリング部232は、配置候補命令集合の中から後述するアルゴリズムに従い、最適な命令を1つ取り出す(S12)。
The
命令スケジューリング部232は、取り出された最適命令が実際に配置可能か否かを判断する(S14)。配置可能か否かの判断は、最適命令を配置したと仮定した場合の着目サイクルの命令数が、1つ前のサイクルに配置された命令数を超えないか否かにより判断される。これにより、同一数の命令が配置されたサイクルが連続することとなる。
The
配置可能と判断した場合には(S14でYES)、その最適命令を仮配置し、配置候補命令集合から削除する(S16)。その後、命令スケジューリング部232は、さらに命令を配置することが可能か否かを、上述の判断処理(S14)と同様にして判断する(S18)。配置可能と判断した場合には(S18でYES)、依存グラフを参照し、新たな配置候補命令が生じた場合には、それを配置候補命令集合に追加する(S20)。以上の着目サイクルに対する命令仮配置処理を、配置候補命令がなくなるまで繰返す(S10〜S22)。
If it is determined that placement is possible (YES in S14), the optimum instruction is provisionally placed and deleted from the placement candidate instruction set (S16). Thereafter, the
なお、最適命令の仮配置処理(S16)の後、これ以上、着目サイクルに命令を配置することができないと判断した場合には(S18でNO)、命令の仮配置処理(S10〜S22)のループを抜ける。 If it is determined that the instruction cannot be arranged in the target cycle after the optimum instruction temporary arrangement process (S16) (NO in S18), the instruction temporary arrangement process (S10 to S22) is performed. Exit the loop.
命令の仮配置処理(S10〜S22)の後、命令スケジューリング部232は、仮配置された命令を確定させ、配置候補命令集合に対するスケジューリングを終了する(S24)。その後、配置済みの命令に関しては、依存グラフの対応するノードに配置済みのフラグが付され、依存グラフの更新が行なわれる(S26)。
After the instruction temporary placement process (S10 to S22), the
命令スケジューリング部232は、一定サイクル以上、同一数の命令が連続配置されているか否かを判断する(S27)。一定サイクル以上、同一数の命令が連続配置されていると判断した場合(たとえば、20サイクル以上2命令が連続配置されている場合や、10サイクル以上1命令が連続配置されている場合)には(S27でYES)、命令スケジューリング部232は、1サイクルに配置可能な命令の最大数(以下「最大配置可能命令数」という。)を3に設定し(S28)、以降のサイクルでは、なるべく、1サイクルに3命令が配置されるようにする。以上の処理を、未配置命令がなくなるまで繰返す(S6〜S29)。
The
図16は、図13の最適命令取出し処理(S12)の動作を示すフローチャートである。 FIG. 16 is a flowchart showing the operation of the optimum instruction fetch process (S12) of FIG.
命令スケジューリング部232は、配置候補命令の各々について、着目サイクルの1つ前のサイクルで配置された命令の各々との間で、オペコードのビットパターン間のハミング距離を求める(S42)。
The
たとえば、図14(b)を参照して、2サイクル目のスケジューリングの開始当初は、ノードN2、N7、N8およびN12が配置可能である。1サイクル目では、ノードN1、N6およびN11が配置されている。このため、ノードN1、N6およびN11とノードN2、N7、N8およびN12との間のすべての組み合わせについて、オペコードのビットパターン間のハミング距離が求められることになる。 For example, referring to FIG. 14B, nodes N2, N7, N8, and N12 can be arranged at the beginning of the scheduling of the second cycle. In the first cycle, nodes N1, N6 and N11 are arranged. For this reason, the Hamming distance between the bit patterns of the opcodes is obtained for all combinations between the nodes N1, N6 and N11 and the nodes N2, N7, N8 and N12.
図17は、オペコードのビットパターン間のハミング距離の算出方法を説明するための図である。Nサイクル目にはすでに、命令“ld Vr11,Vr12”が配置済みであり、N+1サイクル目の配置候補命令は、“st Vr13,Vr14”および“add1 Vr13,Vr14”であるとする。図17(a)を参照して、オペコード“ld”および“st”は、12、16、17、24および25ビット目のビットパターンが異なる。このため、ハミング距離は5である。同様にして、図17(b)を参照して、オペコード“ld”および“add1”は、16、17、18、20、25、26、28および31ビット目のビットパターンが異なる。このため、ハミング距離は8である。 FIG. 17 is a diagram for explaining a method of calculating the Hamming distance between the bit patterns of the operation code. It is assumed that the instruction “ld Vr11, Vr12” has already been arranged in the Nth cycle, and the arrangement candidate instructions in the N + 1th cycle are “st Vr13, Vr14” and “add1 Vr13, Vr14”. Referring to FIG. 17A, the operation codes “ld” and “st” have different bit patterns of the 12, 16, 17, 24, and 25th bits. For this reason, the Hamming distance is 5. Similarly, referring to FIG. 17B, the operation codes “ld” and “add1” have different bit patterns of the 16, 17, 18, 20, 25, 26, 28, and 31 bits. For this reason, the Hamming distance is 8.
図18は、ビット長が異なるオペコード間でのハミング距離の算出方法を説明するための図である。Nサイクル目にはすでに、命令“ld Vr11,Vr12”が配置済みであり、N+1サイクル目の配置候補命令は、“mul2 Vr13,Vr14,Vr15”および“st Vr13,Vr14”であるとする。図18(a)を参照して、オペコード“ld”および“mul2”のように、ビット長が異なるオペコード間では、オペコードの重複部分のビットパターンについてハミング距離が計算される。したがって、オペコードの16ビット目から31ビット目までの値に基づいてハミング距離が算出される。オペコード“ld”および“mul2”は、16、18、19、22、23、25、26、27、28、30および31ビット目が異なる。このため、ハミング距離は11である。図18(b)を参照して、その他の配置候補命令“st Vr13,Vr14”についても、図18(a)の例との整合性を確保するため、オペコードの16ビット目から31ビット目までの値に基づいてハミング距離が算出される。オペコード“ld”および“st”は、16、17、24および25ビット目が異なる。このため、ハミング距離は4である。 FIG. 18 is a diagram for explaining a method of calculating a Hamming distance between operation codes having different bit lengths. It is assumed that the instruction “ld Vr11, Vr12” has already been arranged in the Nth cycle, and the arrangement candidate instructions in the N + 1th cycle are “mul2 Vr13, Vr14, Vr15” and “st Vr13, Vr14”. Referring to FIG. 18A, the hamming distance is calculated for the bit pattern of the overlapped portion of the operation code between the operation codes having different bit lengths such as the operation codes “ld” and “mul2”. Therefore, the Hamming distance is calculated based on the values from the 16th bit to the 31st bit of the operation code. The opcodes “ld” and “mul2” are different in the 16, 18, 19, 22, 23, 25, 26, 27, 28, 30 and 31st bits. For this reason, the Hamming distance is 11. Referring to FIG. 18 (b), the other arrangement candidate instructions “st Vr13, Vr14” are also from the 16th bit to the 31st bit of the opcode in order to ensure consistency with the example of FIG. 18 (a). The Hamming distance is calculated based on the value of. The opcodes “ld” and “st” differ in the 16th, 17th, 24th and 25th bits. For this reason, the Hamming distance is 4.
再度図16を参照して、命令スケジューリング部232は、最小ハミング距離を有する配置候補命令を特定する(S43)。図17および図18の例では、命令“st Vr13,Vr14”がともに配置候補命令として特定される。
Referring to FIG. 16 again, the
命令スケジューリング部232は、最小ハミング距離を有する配置候補命令が2以上あるか否かを判断する(S44)。最小ハミング距離を有する配置候補命令が1つの場合には(S44でNO)、その命令を最適命令とする(S56)。
The
最小ハミング距離を有する配置候補命令が2つ以上ある場合には、(S44でYES)、それらの配置候補命令のうち命令が配置されていない空きスロットのデフォルト論理に合致するものがあるか否かを判断する(S46)。 If there are two or more placement candidate instructions having the minimum Hamming distance (YES in S44), whether or not any of these placement candidate instructions matches the default logic of an empty slot in which no instruction is placed. Is determined (S46).
デフォルト論理に合致する配置候補命令がなければ(S46でNO)、最小ハミング距離を有する2以上の配置候補命令のいずれかを任意に選択し、最適命令とする(S54)。 If there is no placement candidate instruction that matches the default logic (NO in S46), any one of two or more placement candidate instructions having the minimum Hamming distance is arbitrarily selected and set as the optimum instruction (S54).
デフォルト論理に合致する配置候補命令があり、かつその個数が1つであれば(S46でYES、S48でNO)、デフォルト論理に合致する配置候補命令を最適命令とする(S52)。 If there is a placement candidate instruction that matches the default logic and the number is one (YES in S46, NO in S48), the placement candidate instruction that matches the default logic is determined as the optimum instruction (S52).
デフォルト論理に合致する配置候補命令があり、かつその個数が2つ以上であれば(S46でYES、S48でYES)、デフォルト論理に合致する2以上の配置可能命令のうちのいずれかを任意に選択して最適命令とする(S50)。 If there is an arrangement candidate instruction that matches the default logic and the number is two or more (YES in S46, YES in S48), any one of two or more arrangementable instructions that match the default logic is arbitrarily selected. The optimum instruction is selected (S50).
[サイクル内配置調整処理部]
図19は、サイクル内配置調整処理部237の動作を示すフローチャートである。サイクル内配置調整処理部237は、命令スケジューリング部232でのスケジュール結果に基づいて、各サイクル内での命令の配置の調整を行なう。
[In-cycle placement adjustment processing section]
FIG. 19 is a flowchart showing the operation of the in-cycle arrangement
サイクル内配置調整処理部237は、スケジュール結果の2サイクル目から最終サイクルまでのうち、着目しているサイクルの3つの命令について並べ替えを行ない、6通りの命令並びを作成する(S61)。図20は、このようにして作成された6通りの命令並びの一例を示す図である。
The in-cycle arrangement
サイクル内配置調整処理部237は、後述する6通りの命令並びの各々についてハミング距離の和を求める処理(S62〜S67)を実行する。6通りの命令並びの各々について求められたハミング距離の和のうち最小のハミング距離の和をとる命令並びを選択し、その命令並びの並びになるように命令の並べ替えを行なう(S68)。以上の処理を、2サイクル目から最終サイクルまで繰返す(S60〜S69)。
The in-cycle arrangement
次に、6通りの命令並びの各々についてハミング距離の和を求める処理(S62〜S67)について説明する。サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令とのオペコードのビットパターン間のハミング距離を求める(S64)。ハミング距離を求める処理(S64)を3つのスロットの命令のすべてについて行ない(S63〜S65)、3つのスロットの命令の各々についてハミング距離の和を求める(S66)。以上の処理を、6通りの命令並びのすべてについて行なう(S62〜S67)。
Next, processing for obtaining the sum of the Hamming distances for each of the six instruction sequences (S62 to S67) will be described. The in-cycle arrangement
図21は、配置された命令の一例を示す図である。Nサイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“ld Vr10,Vr11”、“sub1 Vr12,Vr13”および“add1 Vr14,Vr15”がそれぞれ配置されているものとする。N+1サイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“st Vr16,Vr17”、“mul Vr18,Vr19”および“mod Vr20,Vr21”がそれぞれ配置されているものとする。 FIG. 21 is a diagram illustrating an example of arranged instructions. In the Nth cycle, “ld Vr10, Vr11”, “sub1 Vr12, Vr13”, and “add1 Vr14, Vr15” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall. In the (N + 1) th cycle, “st Vr16, Vr17”, “mul Vr18, Vr19” and “mod Vr20, Vr21” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall.
図22は、命令並び作成処理(S61)を説明するための図である。たとえば、図21に示すN+1サイクル目に配置された3つの命令より、図22(a)〜(f)に示す6つの命令並びが作成される。 FIG. 22 is a diagram for explaining the instruction arrangement creating process (S61). For example, six instruction sequences shown in FIGS. 22A to 22F are created from three instructions arranged in the (N + 1) th cycle shown in FIG.
図23は、オペコードのハミング距離算出処理(S64)を説明するための図である。たとえば、図21に示すNサイクル目の命令並びと、図22(c)に示すN+1サイクル目の命令並びとの間で、スロットごとにオペコードのハミング距離を算出すると、第1スロット、第2スロットおよび第3スロットにおけるハミング距離は、それぞれ10、9および5となる。 FIG. 23 is a diagram for explaining the operation code Hamming distance calculation processing (S64). For example, when the Hamming distance of the opcode is calculated for each slot between the Nth cycle instruction sequence shown in FIG. 21 and the N + 1th cycle instruction sequence shown in FIG. 22C, the first slot and the second slot are calculated. And the Hamming distances in the third slot are 10, 9 and 5, respectively.
したがって、図23の例におけるハミング距離の和は24となる。ハミング距離和算出処理(S66)では、このようにして、図21に示すNサイクル目の命令並びと、図22(a)〜(f)に示す6通りの命令並びの各々との間でハミング距離の和が求められ、それぞれ、14、16、24、22、24および20となる。命令並び選択処理(S68)では、6通りの命令並びのうち、最小のハミング距離の和をとる図22(a)の命令並びが選択される。 Therefore, the sum of the Hamming distances in the example of FIG. In the Hamming distance sum calculation process (S66), Hamming is performed between the instruction sequence at the Nth cycle shown in FIG. 21 and each of the six instruction sequences shown in FIGS. 22 (a) to (f). The sum of distances is determined to be 14, 16, 24, 22, 24, and 20, respectively. In the instruction arrangement selection process (S68), the instruction arrangement shown in FIG. 22A, which takes the sum of the minimum Hamming distances, is selected from the six instruction arrangements.
[レジスタ割付部]
図24は、レジスタ割付部234の動作を示すフローチャートである。レジスタ割付部234では、命令スケジューリング部232およびサイクル内配置調整処理部237でのスケジュール結果に基づいて、実際にレジスタの割付を行なっていく。
[Register allocation section]
FIG. 24 is a flowchart showing the operation of the
レジスタ割付部234は、ソースプログラム202から割付対象(変数)を抜き出し、各割付対象の生存区間およびその優先度を求める(S72)。生存区間とは、プログラム中で、変数が定義されてから、その参照が終了するまでの区間を言う。したがって、同一の変数であっても、複数の生存区間が存在する場合がある。優先度とは、割付対象の生存区間長およびその参照頻度で決定される。その詳細な説明は、本発明の本質的事項ではないため、省略する。
The
レジスタ割付部234は、割付対象より干渉グラフを作成する(S74)。干渉グラフとは、同一のレジスタを割り付けることができない割付対象の条件を示したグラフである。次に、干渉グラフの作成方法について説明する。
The
図25は、割付対象となる変数の生存区間を示す図である。ここでは、変数I、JおよびKの3つの変数を割付対象とした例を示す。 FIG. 25 is a diagram illustrating a life span of a variable to be assigned. Here, an example is shown in which three variables of variables I, J, and K are assigned.
変数Iは、ステップT1で定義されて、ステップT5で最終参照される。また、変数Iは、ステップT8で定義されて、ステップT10で最終参照される。したがって、変数Iは、2つの生存区間を有することとなる。先の生存区間での変数Iを変数I1と定義し、後の生存区間での変数を変数I2と定義することとする。変数Jは、ステップT2で定義されて、ステップT4で最終参照される。 Variable I is defined in step T1 and is finally referenced in step T5. The variable I is defined at step T8 and finally referred to at step T10. Therefore, the variable I has two life spans. The variable I in the previous life interval is defined as the variable I1, and the variable in the later life interval is defined as the variable I2. Variable J is defined in step T2 and is finally referenced in step T4.
変数Kは、ステップT3で定義されて、ステップT6で最終参照される。また、変数Kは、ステップT7で定義されてステップT9で最終参照される。したがって、変数Iと同様、変数Kは2つの生存区間を有することとなる。先の生存区間での変数Kを変数K1と定義し、後の生存区間での変数Kを変数K2と定義する。 The variable K is defined in step T3 and finally referred to in step T6. The variable K is defined in step T7 and is finally referred to in step T9. Therefore, like the variable I, the variable K has two life spans. The variable K in the previous life interval is defined as the variable K1, and the variable K in the later life interval is defined as the variable K2.
変数I1、I2、J、K1およびK2には、以下に示すような生存区間の重なりが生じる。すなわち、変数I1およびJの生存区間は、ステップT2〜T4で重なりを有する。変数JおよびK1の生存区間は、ステップT3〜T4で重なりを有する。変数I1およびK1の生存区間は、ステップT3〜T5で重なりを有する。変数I2およびK2は、ステップT8〜T9で重なりを有する。このように、生存区間が重なる変数同士は、同一のレジスタに割り付けることはできない。このため、割付対象となる変数をノードとし、生存区間が重なる変数同士をエッジで結んだものが干渉グラフとなる。 In the variables I1, I2, J, K1, and K2, there are overlaps of life spans as shown below. That is, the life spans of the variables I1 and J have an overlap at steps T2 to T4. The life spans of variables J and K1 have overlap at steps T3 to T4. The life spans of variables I1 and K1 have overlap at steps T3 to T5. Variables I2 and K2 have overlap in steps T8-T9. In this way, variables with overlapping life intervals cannot be assigned to the same register. For this reason, the variable to be allocated is a node, and the variables in which the live ranges overlap are connected by an edge is an interference graph.
図26は、図25の例に基づいて作成された変数の干渉グラフを示す図である。ノードI1、K1およびJは相互にエッジにより接続されている。このため、変数I1、K1およびJの間には相互に生存区間が重なる区間があり、これら3つの変数に同じレジスタを割り付けることはできないことがわかる。同様に、ノードI2およびK2はエッジにより接続されている。このため、変数I2およびK2に同じレジスタを割り付けることはできないことがわかる。 FIG. 26 is a diagram illustrating an interference graph of variables created based on the example of FIG. Nodes I1, K1 and J are connected to each other by edges. For this reason, it can be seen that there are sections in which the survival periods overlap between the variables I1, K1, and J, and the same register cannot be assigned to these three variables. Similarly, nodes I2 and K2 are connected by an edge. For this reason, it can be seen that the same register cannot be assigned to the variables I2 and K2.
しかし、エッジにより接続されていないノード間には依存関係が存在しない。たとえば、ノードJおよびK2はエッジにより接続されていない。このため、変数JおよびK2には生存区間の重なりがなく、同じレジスタを割り付けることができることがわかる。 However, there is no dependency between nodes that are not connected by an edge. For example, nodes J and K2 are not connected by an edge. For this reason, it can be seen that the variables J and K2 do not overlap the live ranges and can be assigned the same register.
再度図24を参照して、レジスタ割付部234は、レジスタ割付を行なっていない割付対象のうち、優先度が最も高い割付対象を選択する(S80)。命令スケジューリング部232は、割付対象を割り付けるレジスタとして、同一スロットで割付対象を参照する命令の直前に実行される命令のうち、同一フィールドのレジスタ番号と同一番号のレジスタが割り付け可能か否かを判断する(S82)。割り付け可能か否かの判断は、上述した干渉グラフを参照することにより行なわれる。
Referring to FIG. 24 again, the
図27は、命令スケジューリングの途中結果を示す図である。たとえば、図27(a)を参照して、現在の割付対象は、第1スロットの(N+1)番目のサイクルのソースオペランド(レジスタVr5)に割り付けられるものとする。レジスタVr5は、上述したように仮に設けられたレジスタである。このため、図24のレジスタ割付可能判断処理(S82)では、割付対象として、N番目のサイクルの同一フィールドで使用されるレジスタ(ここでは、レジスタR0)が割付可能か否かを判断することになる。図27(b)は、Vr5にレジスタR0を割付けた場合の命令のビットパターンを示している。このように、連続するサイクル間で同一のレジスタをアクセスすると、レジスタの特性により消費電力を削減することができる。 FIG. 27 is a diagram illustrating a result of instruction scheduling. For example, referring to FIG. 27A, it is assumed that the current allocation target is allocated to the source operand (register Vr5) of the (N + 1) th cycle of the first slot. The register Vr5 is a provisionally provided register as described above. Therefore, in the register allocation possibility determination process (S82) of FIG. 24, it is determined whether or not the register (here, register R0) used in the same field of the Nth cycle can be allocated. Become. FIG. 27B shows a bit pattern of an instruction when register R0 is assigned to Vr5. Thus, when the same register is accessed between successive cycles, power consumption can be reduced due to the characteristics of the register.
同一番号のレジスタが割り付け可能と判断された場合には(S82でYES)、レジスタ割付部234は、割付対象に、上述の同一番号のレジスタを割り付ける(S84)。同一番号のレジスタを割り付けることができないと判断された場合には(S82でNO)、レジスタ割付部234は、割付可能なレジスタのレジスタ番号(2進表現)の中で、先行サイクルの同一スロットの同一フィールドのレジスタ番号との間のハミング距離が最小となるものを求める(S86)。図27(c)は、レジスタR0のレジスタ番号(00000)とのハミング距離が最小となるレジスタ番号(00001)を有するレジスタR1が、使用可能なレジスタの中から選択された例を示している。
If it is determined that the register with the same number can be allocated (YES in S82), the
ハミング距離が最小となる割付可能なレジスタが1つしかない場合には(S88でNO)、割付対象に当該レジスタを割り付ける(S92)。ハミング距離が最小となる割付可能なレジスタが2つ以上ある場合には(S88でYES)、2つ以上の割付可能なレジスタのいずれかを任意に選択し、割付対象に割り付ける(S90)。以上の処理を、割付対象がなくなるまで行なう(S78〜S94)。 If there is only one register that can be allocated with the minimum Hamming distance (NO in S88), the register is allocated to the allocation target (S92). If there are two or more assignable registers with the minimum Hamming distance (YES in S88), any of the two or more assignable registers is arbitrarily selected and assigned to the assignment target (S90). The above processing is performed until there are no more allocation targets (S78 to S94).
レジスタ割付部234での処理の後、サイクル内配置調整処理部237は、レジスタ割付部234でのスケジュール結果に基づいて、各サイクル内での命令の配置の調整を行なう。サイクル内配置調整処理部237で実行される処理は、図19および図20を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。
After the processing in the
[命令再スケジューリング部]
図28は、命令再スケジューリング部236の動作を示すフローチャートである。命令再スケジューリング部236は、命令スケジューリング部232、レジスタ割付部234およびサイクル内配置調整処理部237で実行された処理により、プロセッサ30で動作可能にスケジューリングされた命令のスケジュール結果を、再度スケジューリングしなおす処理を行なう。すなわち、命令再スケジューリング部236は、レジスタ割付部234にて実レジスタが確定した命令列に対して、再度スケジューリングを行なうものである。
[Instruction rescheduling section]
FIG. 28 is a flowchart showing the operation of the
命令再スケジューリング部236は、スケジュール結果の中から冗長な命令を削除する(S112)。たとえば、命令“mov1 R0,R0”は、レジスタR0の内容をレジスタR0に書き込む処理であるため、冗長な命令である。また、同一サイクルの第1スロットの命令が“mov2 4,R1”であり、第2スロットの命令が“mov2 5,R1”である場合には、それぞれ4および5をレジスタR1に書き込む命令である。本実施の形態では、番号の大きいほうのスロットの命令が優先的に実行されることとする。このため、第1スロットの命令“mov2 4,R1”は、冗長な命令である。
The
冗長な命令を削除すると、命令の依存関係が変化する場合がある。このため、命令再スケジューリング部236は、依存グラフの再構築を行なう(S114)。命令再スケジューリング部236は、依存グラフの中から実行可能な命令(ノード)を選択し、そのうち、各スロットのデフォルト論理に合致するように1サイクル目の命令をスケジューリングする(S115)。1サイクル目の命令に対応する依存グラフのノードには、配置済みのフラグが付される。
When redundant instructions are deleted, the dependency of instructions may change. Therefore, the
命令再スケジューリング部236は、依存グラフを参照し、配置候補命令集合を生成する(S118)。命令再スケジューリング部236は、配置候補命令集合の中から後述するアルゴリズムに従い、最適な命令を1つ取り出す(S122)。
The
命令再スケジューリング部236は、取り出された最適命令が実際に配置可能か否かを判断する(S124)。配置可能か否かの判断は、図13のS14の判断と同様である。このため、その詳細な説明はここでは繰返さない。
The
配置可能と判断した場合には(S124でYES)、その最適命令を仮配置し、配置候補命令集合から削除する(S126)。その後、命令再スケジューリング部236は、さらに命令を配置することが可能か否かを、上述の配置可能判断(S124)と同様にして判断する(S128)。配置可能と判断した場合には(S128でYES)、依存グラフを参照し、新たな配置候補命令が生じた場合には、それを配置候補命令集合に追加する(S130)。以上の処理を、配置候補命令がなくなるまで繰返す(S120〜S132)。
If it is determined that placement is possible (YES in S124), the optimum instruction is temporarily placed and deleted from the placement candidate instruction set (S126). Thereafter, the
なお、最適命令の仮配置処理(S126)の後、これ以上、着目サイクルに命令を配置することができないと判断した場合には(S128でNO)、最適命令の仮配置処理(S120〜S132)のループを抜ける。 If it is determined that the instruction cannot be arranged in the target cycle after the optimum instruction temporary arrangement process (S126) (NO in S128), the optimum instruction temporary arrangement process (S120 to S132). Exit the loop.
最適命令の仮配置処理(S120〜S132)の後、命令再スケジューリング部236は、仮配置された命令を確定させ、配置候補命令集合に対するスケジューリングを終了する(S134)。その後、配置済みの命令に関しては、依存グラフの対応するノードに配置済みのフラグが付され、依存グラフの更新が行なわれる(S136)。
After the optimal instruction temporary placement process (S120 to S132), the
命令再スケジューリング部236は、一定サイクル以上、同一数の命令が連続配置されているか否かを判断する(S137)。一定サイクル以上、同一数の命令が連続配置されていると判断した場合には(S137でYES)、命令再スケジューリング部236は、最大配置可能命令数を3に設定し(S138)、以降のサイクルでは、なるべく、1サイクルに3命令が配置されるようにする。以上の処理を、未配置命令がなくなるまで繰返す(S116〜S139)。
The
図29は、図28の最適命令取出し処理(S122)の動作を示すフローチャートである。命令再スケジューリング部236は、配置候補命令のうち、着目サイクルの1つ前のサイクルの同一スロットで実行される命令と比較して、同一のレジスタ番号を有するフィールドの個数を求め、当該個数が最大の配置候補命令を特定する(S152)。
FIG. 29 is a flowchart showing the operation of the optimum instruction fetch process (S122) of FIG. The
図30は、配置候補命令特定処理(S152)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“add1 R0,R2”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として、図30(a)に示す“sub1 R0,R1”と、図30(b)に示す“div R0,R2”とがあるものとする。図30(a)に示すように、当該配置位置に命令“sub1 R0,R1”を配置した場合には、同一のレジスタ番号を有するフィールドは、レジスタR0(レジスタ番号00000)が配置されたフィールドのみである。このため、同一のレジスタ番号を有するフィールドの個数は1つである。図30(b)に示すように、当該配置位置に命令“div R0,R2”を配置した場合には、レジスタR0(レジスタ番号00000)およびレジスタR2(00010)がそれぞれ配置された2つのフィールドが同一のレジスタ番号を有する。このため、同一のレジスタ番号を有するフィールドの個数は2つである。 FIG. 30 is a diagram for explaining the arrangement candidate instruction specifying process (S152). Assume that “add1 R0, R2” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “sub1” shown in FIG. 30A is an instruction that can be arranged in the first slot of the (N + 1) th cycle. Assume that there are R0, R1 "and" div R0, R2 "shown in FIG. As shown in FIG. 30A, when the instruction “sub1 R0, R1” is arranged at the arrangement position, the field having the same register number is only the field in which the register R0 (register number 00000) is arranged. It is. For this reason, the number of fields having the same register number is one. As shown in FIG. 30 (b), when the instruction “div R0, R2” is arranged at the arrangement position, two fields in which the register R0 (register number 00000) and the register R2 (00010) are arranged are respectively displayed. Have the same register number. For this reason, the number of fields having the same register number is two.
当該個数が最大の配置候補命令が1つしかない場合には(S154でNO)、その配置候補命令を最適命令とする(S174)。 If there is only one placement candidate instruction with the maximum number (NO in S154), the placement candidate instruction is determined as the optimum instruction (S174).
当該個数が最大の配置候補命令がないか、または2つ以上ある場合には(S154でYES)、命令再スケジューリング部236は、配置候補命令の各々について、1つ前のサイクルの同一スロットで実行される命令と比較して、命令のビットパターンのハミング距離が最小のものを求める(S156)。
If there is no placement candidate instruction with the maximum number or there are two or more placement candidate instructions (YES in S154), the
図31は、配置候補命令特定処理(S156)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“mul1 R3,R10”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として、図31(a)に示す“add1 R2,R4”と、図30(b)に示す“sub2 R11,R0,R2”とがあるものとする。それぞれの命令のビットパターンは図示するとおりである。図31(a)に示すように、当該配置位置に命令“add1 R2,R4”を配置した場合には、命令“mul1 R3,R10”とのハミング距離は10である。図31(b)に示すように、当該配置位置に命令“sub2 R11,R0,R2”を配置した場合には、命令“mul1 R3,R10”とのハミング距離は8である。このため、配置候補命令として“sub2 R11,R0,R2”が特定される。 FIG. 31 is a diagram for explaining the arrangement candidate instruction specifying process (S156). Assume that “mul1 R3, R10” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “add1” shown in FIG. 31A is shown as an instruction that can be arranged in the first slot of the (N + 1) th cycle. Assume that there are R2, R4 "and" sub2 R11, R0, R2 "shown in FIG. The bit pattern of each instruction is as shown in the figure. As shown in FIG. 31A, when the instruction “add1 R2, R4” is arranged at the arrangement position, the Hamming distance to the instruction “mul1 R3, R10” is 10. As shown in FIG. 31B, when the instruction “sub2 R11, R0, R2” is arranged at the arrangement position, the Hamming distance to the instruction “mul1 R3, R10” is 8. Therefore, “sub2 R11, R0, R2” is specified as the arrangement candidate instruction.
最小ハミング距離を有する配置候補命令が1つの場合には(S158でNO),当該配置候補命令を最適命令とする(S172)。 If there is one placement candidate instruction having the minimum Hamming distance (NO in S158), the placement candidate instruction is set as the optimum instruction (S172).
最小ハミング距離を有する配置候補命令が2つ以上ある場合には(S158でYES)、2つ以上の配置候補命令のうち、当該配置候補命令が実行されるスロットのデフォルト論理に合致する配置候補命令を特定する(S160)。 If there are two or more placement candidate instructions having the minimum Hamming distance (YES in S158), a placement candidate instruction that matches the default logic of the slot in which the placement candidate instruction is executed out of the two or more placement candidate instructions. Is identified (S160).
図32は、配置候補命令特定処理(S160)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“st R1,R13”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として、図32(a)に示す“ld R30,R18”と、図32(b)に示す“sub1 R8,R2”とがあるものとする。それぞれの命令のビットパターンは図示するとおりである。第1スロットのデフォルト論理は、上述したようにメモリアクセスに関する命令である。これは、命令の先頭2ビットが“01”であることより判別可能である。命令“ld R30,R18”の先頭2ビットは“01”であるため、第1スロットのデフォルト論理に合致するが、命令“sub1 R8,R2”の先頭2ビットは“11”であるため、第1スロットのデフォルト論理には合致しない。このため、配置候補命令として“ld R30,R18”が特定される。 FIG. 32 is a diagram for explaining the arrangement candidate instruction specifying process (S160). Assume that “st R1, R13” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “ld” shown in FIG. 32A is given as an instruction that can be arranged in the first slot of the (N + 1) th cycle. Assume that there are “R30, R18” and “sub1 R8, R2” shown in FIG. The bit pattern of each instruction is as shown in the figure. The default logic of the first slot is a command related to memory access as described above. This can be distinguished from the fact that the first two bits of the instruction are “01”. Since the first 2 bits of the instruction “ld R30, R18” are “01”, it matches the default logic of the first slot, but the first 2 bits of the instruction “sub1 R8, R2” is “11”. It does not match the default logic of 1 slot. For this reason, “ld R30, R18” is specified as the placement candidate instruction.
デフォルト論理に合致する配置候補命令がなければ(S162でNO)、最小ハミング距離を有する配置候補命令のうちのいずれかを任意に選択し、最適命令とする(S170)。 If there is no placement candidate instruction that matches the default logic (NO in S162), one of the placement candidate instructions having the minimum Hamming distance is arbitrarily selected and set as the optimum instruction (S170).
デフォルト論理に合致する配置候補命令があり、かつその個数が1つであれば(S162でYES、S164でNO)、デフォルト論理に合致する配置候補命令を最適命令とする(S168)。 If there is a placement candidate instruction that matches the default logic and the number is one (YES in S162, NO in S164), the placement candidate instruction that matches the default logic is determined as the optimum instruction (S168).
デフォルト論理に合致する配置候補命令があり、かつその個数が2つ以上であれば(S162でYES、S164でYES)、デフォルト論理に合致する配置候補命令のうちのいずれかを任意に選択し、最適命令とする(S166)。 If there is a placement candidate instruction that matches the default logic and the number is two or more (YES in S162, YES in S164), any one of the placement candidate instructions that matches the default logic is arbitrarily selected, The optimum instruction is selected (S166).
命令再スケジューリング部236での処理の後、サイクル内配置調整処理部237は、命令再スケジューリング部236でのスケジュール結果に基づいて、各サイクル内での命令の配置の調整を行なう。サイクル内配置調整処理部237で実行される処理は、図19および図20を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。
After the processing in the
以上、命令再スケジューリング部236の動作について説明を行なったが、コンパイル時のオプションまたはソースプログラム中に記述されたプラグマに従って、1つのサイクルで使用するスロットの個数の制限を行なってもよい。プラグマとは、プログラムの意味を変更することなくコンパイラへの最適化の指針を与える記述のことを言う。たとえば、例1に示すように、C言語で記述されたソースプログラムをコンパイルする際のオプションとして“−para”を設け、その後に続く数字でスロットの数を規定する。例1では、ソースプログラム“foo.c”がCコンパイラによりコンパイルされるが、スケジュール結果の各サイクルには、必ず2命令が配置されることとなる。
The operation of the
また、例2に示すように、ソースプログラム中に記述された各関数について、使用されるスロットの個数をプラグマで定義してもよい。例2では、関数funcを実行する際に使用されるスロットの個数が1つと規定されている。このため、スケジュール結果のうち、関数funcを実行するサイクルの各々には、必ず1命令のみが配置されることとなる。 Further, as shown in Example 2, the number of slots used for each function described in the source program may be defined by a pragma. In Example 2, the number of slots used when executing the function func is defined as one. For this reason, in the schedule result, only one instruction is necessarily arranged in each cycle for executing the function func.
(例1)
cc −para 2 foo.c
(例2)
#pragma para=1 func
int func(void){
・・・・・・
}
(Example 1)
cc-
(Example 2)
#Pragma para = 1 func
int func (void) {
・ ・ ・ ・ ・ ・
}
なお、オプションとプラグマとが同時に設定された場合には、値の小さいほうが優先されるようにしてもよい。たとえば、例1に示すソースプログラム“foo.c”中に、例2に示す関数funcおよびそのプラグマが指定されている場合には、原則として、2スロットの並列処理が実行されるが、関数funcを実行するサイクルでは1スロットのみで処理が実行されるように、スケジュール結果が作成される。 When options and pragmas are set at the same time, the smaller value may be given priority. For example, when the function func and its pragma shown in Example 2 are specified in the source program “foo.c” shown in Example 1, two-slot parallel processing is executed in principle, but the function func In the cycle in which the process is executed, the schedule result is created so that the process is executed in only one slot.
また、オプションおよびプラグマに関しては、命令再スケジューリング部236のみならず、命令スケジューリング部232またはレジスタ割付部234での動作で考慮されるようにしてもよい。
Further, options and pragmas may be considered not only in the
[スロット停止・復帰命令生成部]
図33は、スロット停止・復帰命令生成部238の動作を示すフローチャートである。スロット停止・復帰命令生成部238は、命令再スケジューリング部236でのスケジュール結果から一定サイクル(たとえば4サイクル)以上、特定の1つのスロットのみが連続使用されている区間を検出する(S182)。スロット停止・復帰命令生成部238は、上記区間の1サイクル前の空きスロット位置に残りの2つのスロットを停止させる命令を挿入する(S184)。1サイクル前に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を挿入する。
[Slot stop / return instruction generator]
FIG. 33 is a flowchart showing the operation of the slot stop / return
次に、スロット停止・復帰命令生成部238は、上記区間の1サイクル後の空きスロット位置に停止させておいた2つのスロットを復帰させる命令を挿入する(S186)。サイクル後に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を追加する。
Next, the slot stop / return
図34は、命令が配置されたスケジュール結果の一例を示す図である。10サイクル目から18サイクル目までの9サイクルは第1スロットのみが連続使用されている。このため、9サイクル目の空きスロットに、第1スロットのみを動作させ残りの2つのスロットを停止させる命令(“set1 1”)が書き込まれる。また、19サイクル目の空きスロットに、残りの2つのスロットを復帰させる命令(“clear1 1”)が書き込まれる。図35は、図33の特定の1スロットのみが連続使用されている場合の処理(S182〜S186)で命令が書き込まれたスケジュール結果の一例を示す図である。
FIG. 34 is a diagram illustrating an example of a schedule result in which instructions are arranged. In the 9th cycle from the 10th cycle to the 18th cycle, only the first slot is continuously used. Therefore, an instruction (“
再度図33を参照して、スロット停止・復帰命令生成部238は、スケジュール結果から一定サイクル(たとえば4サイクル)以上、特定の2つのスロットのみが連続使用されている区間を検出する(S188)。スロット停止・復帰命令生成部238は、上記区間の1サイクル前の空きスロット位置に残りの1つのスロットを停止させる命令を挿入する(S190)。1サイクル前に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を挿入する。
Referring to FIG. 33 again, slot stop / return
次に、スロット停止・復帰命令生成部238は、上記区間の1サイクル後の空きスロット位置に停止させておいた1つのスロットを復帰させる命令を挿入する(S192)。サイクル後に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を追加する。
Next, the slot stop / return
図35のスケジュール結果では、4サイクル目から8サイクル目までの5サイクルは第1および第2スロットのみが使用され、第3スロットは使用されていない。このため、その前後のサイクルに第3スロットを停止させる命令(“set2 12”)および復帰させる命令(“clear2 12”)をそれぞれ書き込む必要がある。しかし、3サイクル目および9サイクル目の双方ともにすべてのスロットに命令が配置されている。このため、スロット停止・復帰命令生成部238は、4サイクル目の前および8サイクル目の後に1サイクルずつ新たなサイクルを挿入し、上記2命令をそれぞれのサイクルに書き込む。図36は、図33の特定の2スロットのみが連続使用されている場合の処理(S188〜S192)で命令が書き込まれたスケジュール結果の一例を示す図である。
In the schedule result of FIG. 35, only the first and second slots are used in the fifth cycle from the fourth cycle to the eighth cycle, and the third slot is not used. Therefore, it is necessary to write an instruction for stopping the third slot (“
なお、本実施の形態では、命令は、第1スロット、第2スロット、第3スロットの順に配置されることを前提としている。このため、2つのスロットが動作している場合には、必ず第3スロットが動作しておらず、1つのスロットのみが動作している場合には、必ず第2スロットと第3スロットとが動作していないことになる。 In this embodiment, it is assumed that instructions are arranged in the order of the first slot, the second slot, and the third slot. Therefore, when two slots are operating, the third slot is not always operating, and when only one slot is operating, the second and third slots are always operating. It will not be.
また、プロセッサ30には、32ビットのプログラム状態レジスタ(図示せず)が設けられている。図37は、プログラム状態レジスタの一例を示す図である。たとえば、15および16ビットの2ビットで動作しているスロットの数を表すことができる。この場合、図37(a)〜(d)は、動作しているスロットの数がそれぞれ0〜3であることを示している。
The
図38はプログラム状態レジスタの他の一例を示す図である。このプログラム状態レジスタでは、14ビット目が第1スロットに、15ビット目が第2スロットに、16ビット目が第3スロットに対応している。各ビットの値が「1」であれば、そのスロットが動作していることを示し、「0」であれば、そのスロットが停止していることを示す。たとえば、図38(b)のプログラム状態レジスタでは、第1スロットが停止しており、第2および第3スロットが動作していることを示している。 FIG. 38 shows another example of the program status register. In this program status register, the 14th bit corresponds to the first slot, the 15th bit corresponds to the second slot, and the 16th bit corresponds to the third slot. A value of “1” for each bit indicates that the slot is operating, and a value of “0” indicates that the slot is stopped. For example, the program status register shown in FIG. 38B indicates that the first slot is stopped and the second and third slots are operating.
上述した命令“set1”または“set2”でプログラム状態レジスタに保持された値が書き換えられる。 The value held in the program status register is rewritten by the above-described instruction “set1” or “set2”.
以上、本実施の形態におけるコンパイラについて説明したが、コンパイラ200の各部は以下のように変形可能である。次に、その変形例について順次説明を行なう。
Although the compiler according to the present embodiment has been described above, each part of the
[コンパイラの各部の変形例]
[命令再スケジューリング部236の動作の変形例]
本実施の形態では、図28および図29を参照して、命令再スケジューリング部236の動作について説明したが、図29を参照して説明した図28の最適命令取出し処理(S122)の代わりに、図39に示す最適命令取出し処理を行なってもよい。
[Modifications of each part of the compiler]
[Modification of Operation of Instruction Rescheduling Unit 236]
In the present embodiment, the operation of the
図39は、図28の最適命令取出し処理(S122)の他の動作を示すフローチャートである。 FIG. 39 is a flowchart showing another operation of the optimum instruction fetch process (S122) of FIG.
命令再スケジューリング部236は、図29の最小ハミング距離を求める処理(S156)の代わりに、以下に示す方法で最小ハミング距離を求める。すなわち、命令再スケジューリング部236は、配置候補命令のうち、1つ前のサイクルの同一スロットで実行される命令と比較して、レジスタフィールドのビットパターンのハミング距離が最小のものを求める(S212)。
The
図40は、配置候補命令特定処理(S212)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“add1 R0,R2”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として図40(a)に示す“sub1 R3,R1”と、図40(b)に示す“div R7,R1”とがあるものとする。それぞれの命令のビットパターンは図示するとおりである。図40(a)に示すように、当該配置位置に命令“sub1 R3,R1”を配置した場合には、命令“add1 R0,R2”とのレジスタフィールド間のハミング距離は4である。図40(b)に示すように、当該配置位置に命令“div R7,R1”を配置した場合には、命令“add1 R0,R2”とのレジスタフィールド間のハミング距離は5である。このため、配置候補命令として、“add1 R0,R2”が特定される。 FIG. 40 is a diagram for explaining the arrangement candidate instruction specifying process (S212). Assume that “add1 R0, R2” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “sub1 R3” shown in FIG. 40A is an instruction that can be arranged in the first slot of the (N + 1) th cycle. , R1 ”and“ div R7, R1 ”shown in FIG. 40B. The bit pattern of each instruction is as shown in the figure. As shown in FIG. 40A, when the instruction “sub1 R3, R1” is arranged at the arrangement position, the Hamming distance between the register fields of the instruction “add1 R0, R2” is four. As shown in FIG. 40B, when the instruction “div R7, R1” is arranged at the arrangement position, the Hamming distance between the register fields of the instruction “add1 R0, R2” is 5. Therefore, “add1 R0, R2” is specified as the arrangement candidate instruction.
その他の処理(S152〜S154、S158〜S174)は、図29で説明したものと同様である。このため、その詳細な説明はここでは繰返さない。 Other processes (S152 to S154, S158 to S174) are the same as those described in FIG. Therefore, detailed description thereof will not be repeated here.
[サイクル内配置調整処理部237の第1変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図41に示す処理を実行してもよい。
[First Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement
図41は、サイクル内配置調整処理部237の動作の第1変形例を示すフローチャートである。
FIG. 41 is a flowchart showing a first modification of the operation of the in-cycle arrangement
サイクル内配置調整処理部237は、図19のハミング距離を求める処理(S64)の代わりに、以下に示す方法で最小ハミング距離を求める。すなわち、サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令との間で、ビットパターン間のハミング距離を求める(S222)。その他の処理(S60〜S63、S65〜S69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。
The in-cycle arrangement
図42は、命令のハミング距離算出処理(S222)を説明するための図である。たとえば、図21に示すNサイクル目の命令並びと、図22(c)に示すN+1サイクル目の命令並びとの間で、スロットごとに命令のハミング距離を算出すると、第1スロット、第2スロットおよび第3スロットにおけるハミング距離は、それぞれ12、11および11となる。 FIG. 42 is a diagram for explaining the instruction Hamming distance calculation processing (S222). For example, when the Hamming distance of the instruction is calculated for each slot between the Nth cycle instruction sequence shown in FIG. 21 and the N + 1th cycle instruction sequence shown in FIG. 22C, the first slot and the second slot And the Hamming distances in the third slot are 12, 11 and 11, respectively.
したがって、図42の例におけるハミング距離の和は34である。ハミング距離和算出処理(S66)では、このようにして、図21に示すNサイクル目の命令並びと、図22(a)〜(f)に示す6通りの命令並びの各々との間でハミング距離の和が求められ、それぞれ28、26、34、28、34および30となる。命令並び選択処理(S68)では、6通りの命令並びのうち、最小のハミング距離の和をとる図22(b)の命令並びが選択される。 Therefore, the sum of the Hamming distances in the example of FIG. In the Hamming distance sum calculation process (S66), Hamming is performed between the instruction sequence at the Nth cycle shown in FIG. 21 and each of the six instruction sequences shown in FIGS. 22 (a) to (f). The sum of the distances is determined to be 28, 26, 34, 28, 34 and 30 respectively. In the instruction arrangement selection process (S68), the instruction arrangement shown in FIG. 22B that takes the sum of the minimum Hamming distances is selected from the six instruction arrangements.
なお、本変形例のハミング距離を求める処理(S222)では、レジスタが割付けられていることが前提となっている。このため、本変形例のサイクル内配置調整処理部237での処理は、レジスタが割付けられていない命令スケジューリング部232での処理の後に実行することはできず、レジスタ割付部234での処理の後または命令再スケジューリング部236での処理の後に実行される。
Note that, in the process of obtaining the Hamming distance (S222) of this modification, it is assumed that a register is allocated. For this reason, the process in the in-cycle arrangement
[サイクル内配置調整処理部237の第2変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図43に示す処理を実行してもよい。
[Second Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement
図43は、サイクル内配置調整処理部237の動作の第2変形例を示すフローチャートである。
FIG. 43 is a flowchart showing a second modification of the operation of the in-cycle arrangement
サイクル内配置調整処理部237は、図19のハミング距離を求める処理(S64)の代わりに、以下に示す方法で最小ハミング距離を求める。すなわち、サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令とのレジスタフィールドのビットパターン間のハミング距離を求める(S232)。その他の処理(S60〜S63、S65〜S69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。
The in-cycle arrangement
図44は、レジスタフィールドのハミング距離算出処理(S232)を説明するための図である。たとえば、図21に示すNサイクル目の命令並びと、図22(c)に示すN+1サイクル目の命令並びとの間で、スロットごとにレジスタフィールドのハミング距離を算出すると、第1スロット、第2スロットおよび第3スロットにおけるハミング距離は、それぞれ2、2および6となる。 FIG. 44 is a diagram for explaining the Hamming distance calculation process (S232) of the register field. For example, when the Hamming distance of the register field is calculated for each slot between the N-th cycle instruction sequence shown in FIG. 21 and the N + 1-th cycle instruction sequence shown in FIG. The Hamming distances in the slot and the third slot are 2, 2 and 6, respectively.
したがって、図44の例におけるハミング距離の和は10となる。ハミング距離和算出処理(S66)では、このようにして、図21に示すNサイクル目の命令並びと、図22(a)〜(f)に示す6通りの命令並びの各々との間でハミング距離の和が求められ、それぞれ14、10、10、6、10および10となる。命令並び選択処理(S68)では、6通りの命令並びのうち、最小のハミング距離の和をとる図22(d)の命令並びが選択される。 Therefore, the sum of the Hamming distances in the example of FIG. In the Hamming distance sum calculation process (S66), Hamming is performed between the instruction sequence at the Nth cycle shown in FIG. 21 and each of the six instruction sequences shown in FIGS. 22 (a) to (f). The sum of distances is determined to be 14, 10, 10, 6, 10 and 10, respectively. In the instruction arrangement selection process (S68), the instruction arrangement of FIG. 22 (d) that takes the sum of the minimum Hamming distances is selected from the six instruction arrangements.
なお、本変形例のハミング距離を求める処理(S232)では、レジスタが割付けられていることが前提となっている。このため、本変形例のサイクル内配置調整処理部237での処理は、レジスタが割付けられていない命令スケジューリング部232での処理の後に実行することはできず、レジスタ割付部234での処理の後または命令再スケジューリング部236での処理の後に実行される。
Note that, in the process of obtaining the Hamming distance (S232) of this modification, it is assumed that a register is allocated. For this reason, the process in the in-cycle arrangement
[サイクル内配置調整処理部237の第3変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図45に示す処理を実行してもよい。
[Third Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement
図45は、サイクル内配置調整処理部237の動作の第3変形例を示すフローチャートである。
FIG. 45 is a flowchart showing a third modification of the operation of the in-cycle arrangement
サイクル内配置調整処理部237は、図19のハミング距離を求める処理(S64)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令との間で、同一のレジスタ番号を有するレジスタフィールドの個数を求める(S242)。
The in-cycle arrangement
また、サイクル内配置調整処理部237は、図19のハミング距離の和を求める処理(S66)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、3つのスロットの命令の各々について求められた同一のレジスタ番号を有するレジスタフィールドの個数の和を求める(S244)。
Further, the in-cycle arrangement
さらに、サイクル内配置調整処理部237は、図19の命令の並べ替え処理(S68)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、6通りの命令並びの各々について求められたレジスタフィールドの個数の和のうち、最大のレジスタフィールドの個数の和をとる命令並びを選択し、その命令並びの並びになるように命令の並べ替えを行なう(S246)。その他の処理(S60〜S63、S65、S67およびS69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。
Further, the in-cycle arrangement
図46は、配置された命令の一例を示す図である。Nサイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“ld R0,R1”、“sub1 R2,R3”および“add1 R4,R5”がそれぞれ配置されているものとする。N+1サイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“st R5,R8”、“mul R2,R3”および“mod R0,R10”がそれぞれ配置されているものとする。 FIG. 46 is a diagram illustrating an example of arranged instructions. In the Nth cycle, “ld R0, R1”, “sub1 R2, R3” and “add1 R4, R5” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall. In the (N + 1) th cycle, “st R5, R8”, “mul R2, R3”, and “mod R0, R10” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall.
図47は、命令並び作成処理(S61)を説明するための図である。たとえば、図46に示すN+1サイクル目に配置された3つの命令より、図47(a)〜(f)に示す6つの命令並びが作成される。 FIG. 47 is a diagram for explaining the instruction arrangement creating process (S61). For example, six instruction sequences shown in FIGS. 47A to 47F are created from three instructions arranged in the (N + 1) th cycle shown in FIG.
図48は、レジスタフィールド個数算出処理(S242)を説明するための図である。たとえば、図46に示すNサイクル目の命令並びと、図47(f)に示すN+1サイクル目の命令並びとの間で、スロットごとに同一のレジスタ番号を有するレジスタフィールドの個数を求める。第1スロットについては、レジスタR0が両サイクルの同一レジスタフィールドで共通し、その他レジスタフィールドのレジスタは異なるため、当該個数は1である。第2スロットについては、レジスタR2およびR3が両サイクルの同一レジスタフィールドで共通するため、当該個数は2である。第3スロットについては、同一レジスタフィールドで共通するレジスタがないため、当該個数は0である。 FIG. 48 is a diagram for explaining the register field number calculation process (S242). For example, the number of register fields having the same register number for each slot is obtained between the instruction sequence of the Nth cycle shown in FIG. 46 and the instruction sequence of the (N + 1) th cycle shown in FIG. 47 (f). For the first slot, the number is 1 because the register R0 is common to the same register field in both cycles and the registers in the other register fields are different. For the second slot, the number is 2 because registers R2 and R3 are common to the same register field in both cycles. For the third slot, the number is 0 because there is no common register in the same register field.
したがって、図48の例における同一のレジスタ番号を有するレジスタフィールドの個数の和は3である。レジスタフィールド個数和算出処理(S244)では、このようにして、図46に示すNサイクル目の命令並びと、図47(a)〜(f)に示す6通りの命令並びとの各々との間でレジスタフィールドの個数の和が求められ、それぞれ0,2,0,0,0,1および3となる。命令並び選択処理(S246)では、6通りの命令並びのうち、最大のレジスタフィールドの個数和をとる図47(f)に示す命令並びが選択される。 Therefore, the sum of the number of register fields having the same register number in the example of FIG. In the register field number sum calculation process (S244), in this way, between the instruction sequence of the Nth cycle shown in FIG. 46 and each of the six instruction sequences shown in FIGS. 47 (a) to 47 (f). The sum of the number of register fields is obtained and becomes 0, 2, 0, 0, 0, 1 and 3, respectively. In the instruction arrangement selection process (S246), the instruction arrangement shown in FIG. 47 (f) that takes the maximum number of register fields is selected from the six instruction arrangements.
なお、本変形例のレジスタフィールドの個数を求める処理(S242)は、レジスタが割付けられていることが前提となっている。このため、本変形例のサイクル内配置調整処理部237での処理は、レジスタが割付けられていない命令スケジューリング部232での処理の後に実行することはできず、レジスタ割付部234での処理の後または命令再スケジューリング部236での処理の後に実行される。
Note that the processing (S242) for obtaining the number of register fields in this modification is based on the premise that registers are allocated. For this reason, the process in the in-cycle arrangement
[サイクル内配置調整処理部237の第4変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図49に示す処理を実行してもよい。
[Fourth Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement
図49は、サイクル内配置調整処理部237の動作の第4変形例を示すフローチャートである。
FIG. 49 is a flowchart showing a fourth modification of the operation of the in-cycle arrangement
サイクル内配置調整処理部237は、図19の命令並びごとにハミング距離の和を求める処理(S63〜S66)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、着目している命令並びに含まれる命令のうち、スロットのデフォルト論理に合致する命令の個数を求める(S252)。
The in-cycle arrangement
また、サイクル内配置調整処理部237は、図19の命令の並べ替え処理(S68)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、6通りの命令並びの各々について求められたデフォルト論理に合致する命令の個数のうち、最大個数をとる命令並びを選択し、その命令並びの並びになるように命令の並べ替えを行なう(S254)。その他の処理(S60〜S62、S67およびS69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。
The in-cycle arrangement
たとえば、命令並び作成処理(S61)で図47(a)〜(f)に示す6つの命令並びが作成されたものとする。上述のとおり、命令並びに含まれる各命令が配置されたスロットのデフォルト論理に合致するか否かは、命令の先頭2ビットを参照することにより判別可能である。たとえば、図47(b)に示す命令並びでは、第1スロットに配置された命令の先頭2ビットが“01”であるため、当該スロットのデフォルト論理に合致するが、第2スロットおよび第3スロットに配置された命令の先頭2ビットはそれぞれ“11”および“10”であるため、当該スロットのデフォルト論理には合致しない。このため、当該スロットでデフォルト論理に合致する命令は1つである。このようにして、個数算出処理(S252)では6通りの命令並びの各々についてデフォルト論理に合致する命令の個数が求められ、それぞれ3、1、1、0、0および1となる。命令並び選択処理(S254)では、6通りの命令並びのうち、デフォルト論理に合致する命令数の最大値をとる図47(a)に示す命令並びが選択される。 For example, it is assumed that six instruction sequences shown in FIGS. 47A to 47F have been created in the instruction sequence creation process (S61). As described above, whether or not the instruction and the included instruction match the default logic of the slot in which the instruction is arranged can be determined by referring to the first two bits of the instruction. For example, in the instruction sequence shown in FIG. 47B, the first 2 bits of the instruction placed in the first slot is “01”, which matches the default logic of the slot, but the second slot and the third slot Since the first 2 bits of the instruction placed in are “11” and “10” respectively, they do not match the default logic of the slot. For this reason, there is one instruction that matches the default logic in the slot. In this way, in the number calculation process (S252), the number of instructions that match the default logic is obtained for each of the six instruction sequences, which are 3, 1, 1, 0, 0, and 1, respectively. In the instruction arrangement selection process (S254), the instruction arrangement shown in FIG. 47A that takes the maximum number of instructions that match the default logic is selected from the six instruction arrangements.
以上のように、本実施の形態におけるコンパイラ200によれば、同一スロットのサイクル間で命令、オペコードおよびレジスタフィールドのハミング距離が小さくなるように命令の配置の最適化が行なわれる。このため、プロセッサの命令レジスタに保持される値のビット変化が小さく、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。
As described above, according to
また、同一スロットの同一レジスタフィールドにおいて、同一のレジスタのアクセスが連続するような命令の配置の最適化が行なわれる。このため、同一のレジスタへのアクセスが連続し、レジスタを選択するための制御信号の変化が少なくなり、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。 In addition, the instruction arrangement is optimized so that accesses to the same register continue in the same register field of the same slot. For this reason, access to the same register is continued, a change in the control signal for selecting the register is reduced, and a machine language program that can operate the processor with low power consumption is generated.
さらに、各スロットにはデフォルト論理に合致するように命令が割り当てられる。このため、同一のスロットでは、プロセッサの同じ構成要素を利用する命令が連続して実行されることになる。このため、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。 In addition, instructions are assigned to each slot to match the default logic. For this reason, in the same slot, an instruction using the same component of the processor is continuously executed. For this reason, a machine language program capable of operating the processor with low power consumption is generated.
さらにまた、1スロットまたは2スロットしか使用しない命令の命令サイクルが連続した場合には、その間、空きスロットへの電力の供給を停止させることができる。このため、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。 Furthermore, when an instruction cycle of an instruction that uses only one slot or two slots continues, the supply of power to the empty slot can be stopped during that period. For this reason, a machine language program capable of operating the processor with low power consumption is generated.
さらにまた、プラグマまたはコンパイル時のオプションでプログラム実行時に使用するスロット数を指定することができる。このため、空きスロットを発生させることができ、空きスロットへの電力の供給を停止させることができる。このため、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。 Furthermore, the number of slots to be used when executing a program can be specified by a pragma or a compile option. For this reason, an empty slot can be generated and the supply of power to the empty slot can be stopped. For this reason, a machine language program capable of operating the processor with low power consumption is generated.
以上、本発明に係るコンパイラについて、実施の形態に基づいて説明したが、本発明は、この実施の形態に限定されるものではない。 Although the compiler according to the present invention has been described based on the embodiment, the present invention is not limited to this embodiment.
例えば、図28および図29を参照して説明した命令再スケジューリング部232の最適命令取出し処理(S122)では、同一のレジスタ番号を有するフィールドの個数(S152)、直前に実行される命令とのハミング距離(S156)、スロットのデフォルト論理(S160)の順に優先して最適命令を特定したが、この優先順位はこれに限られるものではなく、その他の優先順位で最適命令を特定してもよい。
For example, in the optimum instruction fetching process (S122) of the
また、最適命令を特定する際に考慮するハミング距離、スロットのデフォルト論理等の各種条件も、この実施の形態に限定されるものではない。要するに、本発明に係るコンパイラによりプロセッサが動作した際に、総消費電力量が小さくなるような、条件の組み合わせや、優先順位であればよいのである。なお、命令スケジューリング部232以外の、命令スケジューリング部232、レジスタ割付部234およびサイクル内配置調整処理部237などの処理においても同様であるのは言うまでもない。
Further, various conditions such as the Hamming distance and the default logic of the slot considered when specifying the optimum instruction are not limited to this embodiment. In short, any combination of conditions or priority order may be used so that the total power consumption is reduced when the processor is operated by the compiler according to the present invention. Needless to say, the same applies to the processing other than the
さらに、これら条件の組み合わせや、優先順位をパラメータ化し、ソースプログラム202のヘッダファイルとしてコンパイル時に組み込む構成としてもよいし、これらのパラメータをコンパイラのオプションとして指定可能としてもよい。
Furthermore, a combination of these conditions and priorities may be parameterized and incorporated as a header file of the
さらにまた、本実施の形態の最適化部230での処理は、基本ブロックごとにいくつかのスケジューリング方法の中から最適なものを選択するようにしてもよい。例えば、基本ブロックごとに、あらかじめ用意された複数のスケジューリング方法のすべてについてスケジュール結果を求め、最も消費電力が小さくなると予測されるスケジューリング方法を選択するようにしてもよい。
Furthermore, the processing in the
また、バックトラックなどの手法を用いて最適なスケジューリング方法を選択するようにしてもよい。例えば、命令スケジューリング部232において最も消費電力が小さくなると予測されるスケジューリング方法を選択した後であっても、レジスタ割付部234でレジスタ割付を行なったところ、予測消費電力が予定していた値よりも大きくなった場合には、命令スケジューリング部232において2番目に消費電力が小さくなると予測されるスケジューリング方法を選択して、レジスタ割付を行なってみる。その結果、予測消費電力が予定していた値よりも小さくなれば、命令再スケジューリング部236による命令再スケジュール処理を実行するようにしてもよい。 さらにまた、本実施の形態では、C言語で記述されたソースプログラムを機械語プログラムに変換する例について説明したが、ソースプログラムはC言語以外の高級言語であってもよいし、他のコンパイラですでにコンパイルされた機械語プログラムであってもよい。ソースプログラムが機械語プログラムの場合には、その機械語プログラムを最適化した機械語プログラムが出力される構成となる。
Further, an optimal scheduling method may be selected using a method such as backtracking. For example, even after selecting a scheduling method in which the power consumption is predicted to be the smallest in the
30 プロセッサ
40 命令メモリ
50 命令供給発行部
52 命令フェッチ部
54 命令バッファ
56 命令レジスタ部
56a〜56c 命令レジスタ
60 解読部
62 命令発行制御部
64 デコード部
64a〜64c 命令デコーダ
70 実行部
72 実行制御部
74 PC部
76 レジスタファイル
78a〜78c 算術論理・比較演算部
80a,80b 乗算・積和演算部
82a〜82c バレルシフタ
84 除算器
88 オペランドアクセス部
90,92 データバス
94 ODバス
96 OAバス
100 データメモリ
112,114 パケット
122,124,126 実行単位
132 ALU部
134,154,180 飽和処理部
136 フラグ部
142,162,172 アキュムレータ部
146,148,178 セレクタ
150 上位バレルシフタ
152 下位バレルシフタ
164 除算部
174a,174b 32ビット乗算器(MUL)
176a〜176c 64ビット加算器(Adder)
200 コンパイラ
202 ソースプログラム
204 機械語プログラム
210 パーサー部
220 中間コード変換部
230 最適化部
232 命令スケジューリング部
234 レジスタ割付部
236 命令再スケジューリング部
237 サイクル内配置調整処理部
238 スロット停止・復帰命令生成部
239 並列実行境界情報設定部
240 コード生成部
DESCRIPTION OF
176a to 176c 64-bit adder (Adder)
DESCRIPTION OF
Claims (4)
前記ソースプログラムを構文解析するパーサー手段と、
解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、
前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、
最適化された前記中間コードを機械語命令に変換するコード生成手段と
を備えることを特徴とするコンパイラ装置。 A compiler apparatus for translating a source program into a machine language program for a processor having a plurality of execution units capable of parallel processing and a plurality of instruction issuance units that respectively issue instructions executed by the plurality of execution units. ,
Parser means for parsing the source program;
Intermediate code conversion means for converting the analyzed source program into intermediate code;
Priority is given to an instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit of the immediately preceding instruction cycle without breaking the dependency relation of the instruction corresponding to the intermediate code, An optimization means for optimizing the intermediate code by arranging the instruction at a corresponding position in each of a plurality of instruction issuing units;
A compiler apparatus comprising: code generation means for converting the optimized intermediate code into a machine language instruction.
前記ソースプログラムを構文解析するパーサーステップと、
解析された前記ソースプログラムを中間コードに変換する中間コード変換ステップと、
前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化ステップと、
最適化された前記中間コードを機械語命令に変換するコード生成ステップと
を含むことを特徴とするコンパイル方法。 A compiling method for translating a source program into a machine language program for a processor having a plurality of execution units capable of parallel processing and a plurality of instruction issuing units each issuing instructions executed by the plurality of execution units. ,
A parser step for parsing the source program;
An intermediate code conversion step of converting the analyzed source program into an intermediate code;
Priority is given to an instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit of the immediately preceding instruction cycle without breaking the dependency relation of the instruction corresponding to the intermediate code, An optimization step of optimizing the intermediate code by placing the instruction at a corresponding position in each of a plurality of instruction issuing units;
And a code generation step of converting the optimized intermediate code into a machine language instruction.
前記プログラムは、
前記ソースプログラムを構文解析するパーサーステップと、
解析された前記ソースプログラムを中間コードに変換する中間コード変換ステップと、
前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化ステップと、
最適化された前記中間コードを機械語命令に変換するコード生成ステップと
を含むことを特徴とするプログラム。 A program for a compiler that translates a source program into a machine language program for a processor having a plurality of execution units capable of parallel processing and a plurality of instruction issuing units that issue instructions executed by the plurality of execution units. There,
The program is
A parser step for parsing the source program;
An intermediate code conversion step of converting the analyzed source program into an intermediate code;
Priority is given to an instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit of the immediately preceding instruction cycle without breaking the dependency relation of the instruction corresponding to the intermediate code, An optimization step of optimizing the intermediate code by placing the instruction at a corresponding position in each of a plurality of instruction issuing units;
A code generation step for converting the optimized intermediate code into a machine language instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006207058A JP4721975B2 (en) | 2006-07-28 | 2006-07-28 | Compiler device and compiling method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006207058A JP4721975B2 (en) | 2006-07-28 | 2006-07-28 | Compiler device and compiling method |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003019365A Division JP3896087B2 (en) | 2003-01-28 | 2003-01-28 | Compiler device and compiling method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006286027A true JP2006286027A (en) | 2006-10-19 |
JP4721975B2 JP4721975B2 (en) | 2011-07-13 |
Family
ID=37407801
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006207058A Expired - Lifetime JP4721975B2 (en) | 2006-07-28 | 2006-07-28 | Compiler device and compiling method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4721975B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102248787B1 (en) | 2014-08-28 | 2021-05-06 | 삼성전자 주식회사 | Method and apparatus for power control for GPU resources |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06214802A (en) * | 1993-01-20 | 1994-08-05 | Fuji Xerox Co Ltd | Register allotment system |
JPH07121377A (en) * | 1993-10-20 | 1995-05-12 | Matsushita Electric Ind Co Ltd | Resource allocating device |
JPH08101773A (en) * | 1994-09-30 | 1996-04-16 | Toshiba Corp | Information processor |
JPH08101777A (en) * | 1994-09-30 | 1996-04-16 | Toshiba Corp | Instruction string optimizing device |
JPH08314727A (en) * | 1995-03-16 | 1996-11-29 | Matsushita Electric Ind Co Ltd | Resource allocation device |
JPH11249896A (en) * | 1997-12-23 | 1999-09-17 | Texas Instr Inc <Ti> | Power reducing method for multi-instruction word processor |
JP2000284968A (en) * | 1999-03-31 | 2000-10-13 | Toshiba Corp | Method and device for compiling |
JP2001243077A (en) * | 2000-02-22 | 2001-09-07 | Texas Instr Inc <Ti> | Method for optimally compiling application program |
JP2002342091A (en) * | 2001-05-18 | 2002-11-29 | Mitsubishi Electric Corp | Program preparation device |
-
2006
- 2006-07-28 JP JP2006207058A patent/JP4721975B2/en not_active Expired - Lifetime
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06214802A (en) * | 1993-01-20 | 1994-08-05 | Fuji Xerox Co Ltd | Register allotment system |
JPH07121377A (en) * | 1993-10-20 | 1995-05-12 | Matsushita Electric Ind Co Ltd | Resource allocating device |
JPH08101773A (en) * | 1994-09-30 | 1996-04-16 | Toshiba Corp | Information processor |
JPH08101777A (en) * | 1994-09-30 | 1996-04-16 | Toshiba Corp | Instruction string optimizing device |
JPH08314727A (en) * | 1995-03-16 | 1996-11-29 | Matsushita Electric Ind Co Ltd | Resource allocation device |
JPH11249896A (en) * | 1997-12-23 | 1999-09-17 | Texas Instr Inc <Ti> | Power reducing method for multi-instruction word processor |
JP2000284968A (en) * | 1999-03-31 | 2000-10-13 | Toshiba Corp | Method and device for compiling |
JP2001243077A (en) * | 2000-02-22 | 2001-09-07 | Texas Instr Inc <Ti> | Method for optimally compiling application program |
JP2002342091A (en) * | 2001-05-18 | 2002-11-29 | Mitsubishi Electric Corp | Program preparation device |
Also Published As
Publication number | Publication date |
---|---|
JP4721975B2 (en) | 2011-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3896087B2 (en) | Compiler device and compiling method | |
Eichenberger et al. | Using advanced compiler technology to exploit the performance of the Cell Broadband Engine™ architecture | |
Hoogerbrugge et al. | Transport-triggering vs. operation-triggering | |
US5790874A (en) | Information processing apparatus for reducing power consumption by minimizing hamming distance between consecutive instruction | |
Goossens et al. | Embedded software in real-time signal processing systems: Design technologies | |
JP3801545B2 (en) | COMPILER PROGRAM, COMPILER DEVICE, AND COMPILING METHOD | |
Leupers et al. | Retargetable compiler technology for embedded systems: tools and applications | |
JP4283131B2 (en) | Processor and compiling method | |
JP3327818B2 (en) | Program conversion device and recording medium | |
EP0843257A2 (en) | Improved code optimiser for pipelined computers | |
JPH09282179A (en) | Method and device for instruction scheduling in optimized compiler for minimizing overhead instruction | |
Kessler | Compiling for VLIW DSPs | |
Araujo et al. | Code generation for fixed-point DSPs | |
US7076775B2 (en) | Power efficiency in microprocessor systems | |
Hohenauer et al. | A SIMD optimization framework for retargetable compilers | |
Kessler et al. | Optimal integrated code generation for clustered VLIW architectures | |
JP4721975B2 (en) | Compiler device and compiling method | |
DeVries | A vectorizing SUIF compiler: implementation and performance. | |
EP2181389A2 (en) | Data processing with protection against soft errors | |
US8677312B1 (en) | Generation of compiler description from architecture description | |
EP1828889B1 (en) | Compiling method, compiling apparatus and computer system to compile a loop in a program | |
JP6897213B2 (en) | Code generator, code generator and code generator | |
Canedo et al. | Compiling for reduced bit-width queue processors | |
Tian et al. | Inside the Intel 10.1 Compilers: New Threadizer and New Vectorizer for Intel Core2 Processors. | |
JP4006887B2 (en) | Compiler, processor and recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060823 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090901 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091026 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100824 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110315 |
|
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: 20110405 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140415 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |