[go: up one dir, main page]

JP2000347861A - Compiler, processor and recording medium - Google Patents

Compiler, processor and recording medium

Info

Publication number
JP2000347861A
JP2000347861A JP11156155A JP15615599A JP2000347861A JP 2000347861 A JP2000347861 A JP 2000347861A JP 11156155 A JP11156155 A JP 11156155A JP 15615599 A JP15615599 A JP 15615599A JP 2000347861 A JP2000347861 A JP 2000347861A
Authority
JP
Japan
Prior art keywords
flag
instruction
processor
result
parallel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP11156155A
Other languages
Japanese (ja)
Other versions
JP4006887B2 (en
Inventor
Masato Suzuki
正人 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP15615599A priority Critical patent/JP4006887B2/en
Publication of JP2000347861A publication Critical patent/JP2000347861A/en
Application granted granted Critical
Publication of JP4006887B2 publication Critical patent/JP4006887B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Advance Control (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

(57)【要約】 【課題】 古典的なVLIWプロセッサは、スロット毎に役
割が固定されておりコンパイラにおいて抽出される並列
性の度合いが低い。スロット毎に役割を固定させない今
日的なVLIWプロセッサでは、全ての演算オペレーション
についてフラグの変化の有無を指定可能にするためにオ
ペコードの長さが長くなって命令長が長くなり、結果的
にプログラムサイズが増大するという問題がある。 【解決手段】 コンパイラがオペレーションのフラグへ
の反映の仕方に関するフラグ制御コードを含む機械命令
を生成し、プロセッサがフラグ制御コードに従って並列
実行による操作結果をフラグに反映する。好適なフラグ
制御コードとして、並列に実行される複数のスロットの
いずれのオペレーションの結果をフラグに反映させるか
を指定するものや、オペレーションの結果をフラグに反
映する順序を指定するものがある。
(57) [Summary] [PROBLEMS] A classic VLIW processor has a fixed role for each slot, and the degree of parallelism extracted by a compiler is low. In today's VLIW processors, where the role is not fixed for each slot, the length of the operation code is increased and the instruction length is increased in order to be able to specify whether or not flags change for all operation operations, resulting in a longer program size. Is increased. SOLUTION: A compiler generates a machine instruction including a flag control code related to how an operation is reflected on a flag, and a processor reflects an operation result by parallel execution on the flag according to the flag control code. Preferable flag control codes include a code that specifies which operation result of a plurality of slots to be executed in parallel is reflected in the flag, and a code that specifies an order in which the result of the operation is reflected in the flag.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンパイラとプロ
セッサと記録媒体とに関し、特にVLIW(Very LongInstru
ction Word)方式のプロセッサにおけるフラグ制御に関
するものおよびそのコンパイラおよびその機械命令プロ
グラムを記録した記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler, a processor, and a recording medium, and more particularly to a VLIW (Very Long Instrument).
The present invention relates to a flag control in a processor of a ction word) system, a compiler thereof, and a recording medium storing a machine instruction program thereof.

【0002】[0002]

【従来の技術】近年の電子技術の発展により、高性能な
プロセッサが普及し、あらゆる分野で用いられている。
そのようなプロセッサでは命令の並列処理により高い性
能を達成している。VLIWと呼ばれるアーキテクチャも命
令の並列処理の1つの形態であり、VLIWアーキテクチャ
を採るプロセッサ(以下、「VLIWプロセッサ」とい
う。)は、内部に複数のオペレーションユニットを備
え、1つの命令に置かれたスロットと呼ばれる複数のフ
ィールドに指定されたオペレーションを同時並列に実行
する。このようなVLIWプロセッサの機械命令プログラム
は、コンパイラによって高級言語で記述されたプログラ
ムにおけるオペレーションレベルでの並列性が検出され
スケジューリングされた後に生成されたものである。機
械命令プログラムは実行コードとも呼ばれる。
2. Description of the Related Art With the development of electronic technology in recent years, high-performance processors have become widespread and used in all fields.
Such a processor achieves high performance by parallel processing of instructions. An architecture called VLIW is also one form of instruction parallel processing. A processor employing the VLIW architecture (hereinafter, referred to as a “VLIW processor”) includes a plurality of operation units therein and has a slot provided for one instruction. Performs the operations specified in multiple fields simultaneously, in parallel. Such a machine instruction program of the VLIW processor is generated after a parallelism at an operation level in a program described in a high-level language is detected and scheduled by a compiler. The machine instruction program is also called an execution code.

【0003】古典的なVLIWプロセッサは、スロット毎に
役割が固定されており、例えば、演算オペレーションを
指定する第1スロットとロードストアオペレーションを
指定する第2スロットと分岐オペレーションを指定する
第3スロットとからなる命令語を有するものがある。こ
のようなVLIWプロセッサでは、演算結果の状態を示すフ
ラグは第1スロットで指定されるオペレーションによっ
てのみ反映される。
In a classic VLIW processor, the role is fixed for each slot. For example, a first slot for designating an arithmetic operation, a second slot for designating a load store operation, and a third slot for designating a branch operation. Some have an instruction word consisting of In such a VLIW processor, the flag indicating the state of the operation result is reflected only by the operation specified in the first slot.

【0004】しかしスロット毎に役割が固定されている
ため、コンパイラにおいて抽出される並列性の度合いが
低くなる。演算とロードストアと分岐のオペレーション
は平均すると概ね3分の1ずつの割合で出現するが、局
所的なそれらの頻度は大きくばらつくため、例えば演算
オペレーションが集中するような場合、上記例示したVL
IWプロセッサでは十分な並列度を確保することができな
い。
However, since the role is fixed for each slot, the degree of parallelism extracted by the compiler is reduced. The arithmetic, load store, and branch operations appear on average at a rate of approximately one-third on average, but since their local frequencies vary widely, for example, when arithmetic operations are concentrated, the above-described VL
An IW processor cannot ensure sufficient parallelism.

【0005】そこで今日的なVLIWプロセッサでは、スロ
ット毎に役割を固定させない方式をとるものが多い。図
17はそのような従来技術におけるVLIW方式のプロセッ
サの命令構成図である。命令フォーマットは同図(a)
に示すように命令は64ビット長であり、それぞれが1
1ビットの3つのスロットからなり、いずれのスロット
も均等にオペレーションを指定することができる。11
ビットの各スロットは、5ビットのオペコード(op)と
3ビットのソースオペランド(src)と3ビットのデス
ティネーションオペランド(dst)からなり、同図
(b)に示すビット列が割付けられている。ここで、フ
ラグが変化するオペレーションは同時には1つしか指定
できないが、いずれのスロットに指定しても構わない。
Therefore, many of today's VLIW processors adopt a system in which the role is not fixed for each slot. FIG. 17 is an instruction configuration diagram of such a VLIW processor according to the related art. The instruction format is shown in Figure (a).
The instruction is 64 bits long as shown in FIG.
The operation consists of three 1-bit slots, and any slot can specify an operation equally. 11
Each bit slot is composed of a 5-bit operation code (op), a 3-bit source operand (src), and a 3-bit destination operand (dst), and the bit string shown in FIG. Here, only one operation in which the flag changes can be specified at the same time, but any slot can be specified.

【0006】図18は同従来技術におけるプロセッサの
概略構成図である。このプロセッサは3つのオペレーシ
ョンを並列実行し、図17(a)に示すような第1から
第3の3つのスロットからなる命令の列で構成されるプ
ログラムがROM41に格納され、それぞれのスロットに
書かれたオペレーションが第1命令解読器45から第3
命令解読器47で解読された後、第1操作ユニット58
から第3操作ユニット60で実行される。第1操作ユニ
ット58から第3操作ユニット60のそれぞれから出力
されるフラグ生成のための原始データはセレクタ61に
おいて1つが選択され、フラグ生成ユニット62でC、
V、N、Zの各フラグが生成され、フラグレジスタ63
に各フラグが格納される。セレクタ61における選択
は、フラグが変化するオペレーションが指定されたスロ
ットを第1命令解読器45から第3命令解読器47が特
定することで達成される。なお、Cフラグは桁上げを、
Vフラグはオーバフローを、Nフラグは負数を、Zフラ
グはゼロを表す。
FIG. 18 is a schematic configuration diagram of a processor in the prior art. This processor executes three operations in parallel, and stores a program consisting of a sequence of instructions consisting of first to third three slots as shown in FIG. 17A in the ROM 41, and writes the program in each slot. The entered operation is performed by the first instruction
After being decoded by the command decoder 47, the first operation unit 58
From the third operation unit 60. One of the source data for flag generation output from each of the first operation unit 58 to the third operation unit 60 is selected by the selector 61, and the flag generation unit 62 selects C,
V, N, and Z flags are generated, and the flag register 63
Each flag is stored. The selection by the selector 61 is achieved by the first instruction decoder 45 to the third instruction decoder 47 specifying the slot in which the operation whose flag changes is specified. Note that the C flag indicates carry,
The V flag indicates overflow, the N flag indicates a negative number, and the Z flag indicates zero.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、上記の
従来技術では、全ての演算オペレーションについてフラ
グが変化するオペコードとフラグが変化しないオペコー
ドとの2種類ずつ持つためにオペコードの長さが長くな
って命令長が長くなり、結果的にプログラムサイズが増
大するという問題がある。
However, in the above-mentioned prior art, the length of the operation code becomes longer because the operation code has two types, one of which is an operation code whose flag changes and the other of which is not. There is a problem that the length is increased, and as a result, the program size is increased.

【0008】図17に示す例では、四則演算および論理
演算オペレーションについてフラグ変化の有無を区分す
る2種類のオペコードのためにオペコードが5ビット必
要になる。一方、オペランドとして8本のレジスタの1
つを選択するとすれば、1スロットの長さは、オペコー
ド5ビットとオペランド3ビットの2つを合わせて11
ビットになる。3並列の場合、3スロットを32ビット
では表現できず、通常、命令語長は2のべき乗数のビッ
ト長で表現するために命令語長が64ビットになり、3
1ビットもの未使用領域(図17(a)のreservedで表
す領域)が生じることになりコード効率が著しく低下す
る。コード効率とは、一連の操作をどれだけ少ないプロ
グラムサイズで実現できるかという尺度である。
In the example shown in FIG. 17, five bits of the operation code are required for two types of operation codes for discriminating the presence / absence of a flag change for the four arithmetic operations and the logical operation. On the other hand, one of eight registers is used as an operand.
If one is selected, the length of one slot is 11 bits in total of two bits of 5 bits of an operation code and 3 bits of an operand.
Become a bit. In the case of three parallel operations, three slots cannot be represented by 32 bits, and the instruction word length is usually 64 bits because the instruction word length is represented by a bit length of a power of two.
An unused area of 1 bit (area indicated by reserved in FIG. 17A) is generated, and the code efficiency is significantly reduced. Code efficiency is a measure of how small a sequence of operations can be achieved with a small program size.

【0009】そこで、本発明はかかる点に鑑みてなされ
たものであり、並列度の向上とコード効率の低下の抑止
とを両立するコンパイラおよびプロセッサを提供するこ
とを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a compiler and a processor that achieve both improvement in parallelism and suppression of reduction in code efficiency.

【0010】本発明の前記並びにその他の目的と新規な
特徴は、本明細書の記述及び添付図面から明らかになる
であろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0011】[0011]

【課題を解決するための手段】上記課題を解決するため
に、本発明によれば、コンパイラが操作結果のフラグへ
の反映の仕方に関するフラグ制御記述を含む機械命令を
生成し、プロセッサがフラグ制御記述に従って並列実行
による操作結果をフラグに反映する。
According to the present invention, in order to solve the above-mentioned problems, a compiler generates a machine instruction including a flag control description on a method of reflecting an operation result on a flag, and a processor controls the flag control. The operation result of the parallel execution is reflected in the flag according to the description.

【0012】つまり上記課題を解決するために、本発明
のコンパイラは、高級言語プログラムから、複数の操作
を同時並列に実行し操作結果をフラグに反映するプロセ
ッサを対象とする長語命令形式の機械命令プログラムを
生成するコンパイラであって、1つの機械命令の中に、
複数の操作記述と、操作結果の前記フラグへの反映の仕
方に関するフラグ制御記述とを含む機械命令を生成する
機械命令生成手段を備えることを特徴とする。
In other words, in order to solve the above-mentioned problem, a compiler according to the present invention provides a long-language instruction format machine for a processor that executes a plurality of operations simultaneously and in parallel from a high-level language program and reflects the operation results in flags. A compiler for generating an instruction program, wherein one machine instruction includes:
A machine instruction generating means for generating a machine instruction including a plurality of operation descriptions and a flag control description on how to reflect an operation result on the flag is provided.

【0013】つまり上記課題を解決するために、本発明
のプロセッサは、複数の操作を指定する長語命令形式の
命令を実行するプロセッサであって、同時並列に実行で
きる数の操作記述と、操作結果のフラグへの反映の仕方
に関するフラグ制御記述とを同時に含む命令を取出し、
前記操作記述による操作を並列実行するとともに、前記
フラグ制御記述に従って前記並列実行による操作結果を
フラグに反映することを特徴とする。
That is, in order to solve the above-mentioned problems, a processor of the present invention is a processor for executing a long-word instruction format instruction for designating a plurality of operations. Fetch an instruction that also includes a flag control description on how to reflect the result in the flag,
The operation according to the operation description is executed in parallel, and the operation result of the parallel execution is reflected on a flag according to the flag control description.

【0014】また本発明のプロセッサは、複数の操作を
指定する長語命令形式の命令を実行するプロセッサであ
って、同時並列に実行できる数の操作記述と、操作結果
のフラグへの反映の仕方に関するフラグ制御記述とを同
時に含む命令を取出す命令読出し手段と、前記操作記述
を解読し、解読結果に基づいて操作を並列実行する命令
解読実行手段と、前記フラグ制御記述に従って、前記命
令解読実行手段における操作結果をフラグに反映するフ
ラグ生成保持手段とを備えたことを特徴とする。
The processor according to the present invention is a processor for executing instructions in a long-word instruction format for designating a plurality of operations. The number of operation descriptions that can be executed in parallel and the method of reflecting operation results on flags are described. Instruction reading means for extracting an instruction containing the flag control description at the same time, instruction decoding executing means for decoding the operation description, and executing an operation in parallel based on the decoding result, and instruction decoding executing means according to the flag control description. And a flag generation and holding means for reflecting the operation result in the flag to the flag.

【0015】つまり上記課題を解決するために、本発明
の記録媒体は、複数の操作を同時並列に実行し操作結果
をフラグに反映するプロセッサによって実行される機械
命令プログラムを記録した記録媒体であって、1つの機
械命令が、複数の操作記述と、操作結果の前記フラグへ
の反映の仕方に関するフラグ制御記述とを含む構成であ
ることを特徴とする。
That is, in order to solve the above problems, a recording medium according to the present invention is a recording medium that records a machine instruction program executed by a processor that executes a plurality of operations simultaneously and in parallel and reflects an operation result on a flag. One machine instruction is characterized in that it is configured to include a plurality of operation descriptions and a flag control description on how to reflect an operation result on the flag.

【0016】また本発明の記録媒体は、プロセッサによ
って実行される機械命令プログラムを記録した記録媒体
であって、同時並列に実行できる数の操作記述と、操作
結果のフラグへの反映の仕方に関するフラグ制御記述と
を同時に含む長語命令形式の命令を取出す第1ステップ
と、前記操作記述による操作を並列実行する第2ステッ
プと、前記フラグ制御記述に従って前記並列実行による
操作結果をフラグに反映する第3ステップとをプロセッ
サに実行させるための機械命令プログラムを記録した記
録媒体である。
Further, the recording medium of the present invention is a recording medium in which a machine instruction program executed by a processor is recorded, wherein a number of operation descriptions that can be executed simultaneously and a flag relating to a method of reflecting the operation result on the flag are provided. A first step of extracting an instruction in a long-word instruction format including a control description at the same time; a second step of executing the operation according to the operation description in parallel; This is a recording medium on which a machine instruction program for causing a processor to execute three steps is recorded.

【0017】上記のコンパイラ、プロセッサまたは記録
媒体におけるフラグ制御記述は、同一の機械命令の中に
含まれる前記複数の操作記述の内から、前記フラグに操
作の結果を反映させる1つを特定する情報で構成される
としてもよい。
The flag control description in the compiler, the processor or the recording medium is information for specifying one of the plurality of operation descriptions included in the same machine instruction to reflect an operation result in the flag. May be configured.

【0018】上記のコンパイラ、プロセッサまたは記録
媒体におけるフラグ制御記述は、同一の機械命令の中に
含まれる前記複数の操作記述による操作の結果を前記フ
ラグに反映させる順序を特定する情報で構成されるとし
てもよい。
The flag control description in the compiler, the processor, or the recording medium is constituted by information for specifying an order in which a result of an operation according to the plurality of operation descriptions included in the same machine instruction is reflected in the flag. It may be.

【0019】上記のコンパイラ、プロセッサまたは記録
媒体におけるフラグ制御記述は、同一の機械命令の中に
含まれる前記複数の操作記述の内から、前記フラグに操
作の結果を反映させるいくつかを抽出し、抽出された前
記いくつかの操作記述による操作の結果を前記フラグに
反映させる順序を特定する情報で構成されるとしてもよ
い。
The above-mentioned flag control description in the compiler, processor or recording medium extracts, from among the plurality of operation descriptions included in the same machine instruction, some of which reflect the operation result in the flag, It may be configured with information for specifying the order in which the results of the operations according to the extracted some operation descriptions are reflected in the flag.

【0020】[0020]

【発明の実施の形態】以下、本発明の実施の形態につい
て、図面を用いて詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0021】(実施の形態1) 1.コンパイラ 1.1 コンパイラの構成 図1は、本発明の第1の実施形態におけるコンパイラの
構成を示すブロック図である。
(Embodiment 1) 1. 1. Compiler 1.1 Configuration of Compiler FIG. 1 is a block diagram showing a configuration of a compiler according to the first embodiment of the present invention.

【0022】コンパイラ102は、ユーザが記述したC
言語プログラムのファイル101を翻訳し、機械命令プ
ログラムのファイル110を出力する。
The compiler 102 has a C
The language program file 101 is translated, and the machine instruction program file 110 is output.

【0023】コンパイラ102は、C言語プログラムの
ファイル101を読込用バッファ104に読み込むファ
イル読込部103と、読込用バッファ104に読み込ま
れたC言語プログラムの構文や意味を解析して逐次実行
形式の中間コードを生成し逐次中間コード用バッファ1
06に書き込む構文解析部105と、逐次中間コード用
バッファ106に格納された逐次中間コードを入力して
命令の3並列実行を目的とする命令のスケジューリング
を行い、機械命令プログラムを生成し出力用バッファ1
08に書き込む機械命令生成部107と、出力用バッフ
ァ108に格納された機械命令プログラムをファイル1
10に出力するファイル出力部109とから構成され
る。機械命令生成部107を除く各要素は、公知の技術
に基づいて構成すればよいのでここでは説明を省略す
る。
The compiler 102 analyzes the syntax and meaning of the C language program read into the reading buffer 104 by analyzing the syntax and meaning of the C language program read into the reading buffer 104. Generates a code and successively intermediate buffer 1
06, and the sequential intermediate code stored in the sequential intermediate code buffer 106 are input to perform scheduling of instructions for three-parallel execution of instructions, generate a machine instruction program, and generate an output buffer. 1
08 and a machine instruction program stored in the output buffer 108 in the file 1
10 and a file output unit 109 for outputting the data to the file output unit 10. The components other than the machine instruction generation unit 107 may be configured based on a known technique, and a description thereof will not be repeated.

【0024】図2は、機械命令生成部107の構成を示
すブロック図である。機械命令生成部107は、依存関
係抽出部120と並列中間コード生成部121とフラグ
制御コード生成部122とから構成される。依存関係抽
出部120は、逐次中間コード用バッファ106から入
力される複数の逐次中間コード間の依存関係を検出して
パラメータ化する。並列中間コード生成部121は、依
存関係抽出部120で作られた依存関係のパラメータを
用いて逐次実行形式の中間コードから並列実行形式の中
間コードを生成する。フラグ制御コード生成部122
は、並列中間コード生成部121で生成される並列中間
コードを対応する機械命令に割り当てるとともに、フラ
グが変化するオペレーションを含むスロットがあるかど
うかに基づいてフラグ制御コードを生成する。フラグ制
御コードとは、並列に実行される3つのスロットのいず
れのオペレーションの結果をフラグに反映させるかを指
定する2ビットのコードであって、01は第1スロッ
ト、10は第2スロット、11は第3スロットのオペレ
ーションの結果をフラグに反映させることを指定し、0
0はいずれのスロットのオペレーションの結果もフラグ
に反映させないことを指定するものとする。
FIG. 2 is a block diagram showing the configuration of the machine instruction generator 107. The machine instruction generation unit 107 includes a dependency extraction unit 120, a parallel intermediate code generation unit 121, and a flag control code generation unit 122. The dependency extracting unit 120 detects a dependency between a plurality of sequential intermediate codes input from the sequential intermediate code buffer 106 and parameterizes the detected dependencies. The parallel intermediate code generation unit 121 generates a parallel execution format intermediate code from the serial execution format intermediate code using the dependency parameter created by the dependency extraction unit 120. Flag control code generator 122
Assigns a parallel intermediate code generated by the parallel intermediate code generation unit 121 to a corresponding machine instruction, and generates a flag control code based on whether or not there is a slot including an operation whose flag changes. The flag control code is a 2-bit code that specifies which operation result of the three slots to be executed in parallel is reflected in the flag, where 01 is the first slot, 10 is the second slot, and 11 is the second slot. Specifies that the result of the operation of the third slot is reflected in the flag, and 0
0 indicates that the result of the operation of any slot is not reflected in the flag.

【0025】図3は、フラグ制御コード生成部122に
おけるフラグ制御コードの生成フローを示したフローチ
ャートである。この生成フローは、以下の動作例を用い
て詳細に説明する。
FIG. 3 is a flowchart showing a flow of generating a flag control code in the flag control code generation unit 122. This generation flow will be described in detail using the following operation example.

【0026】1.2 コンパイラの動作例 図4は、C言語プログラムの例を示すプログラムリスト
である。図4のC言語プログラムには、配列変数x[i]と
配列変数y[i]との積をiについて累算するいわゆる積和
演算を行うループのみが記述されている。
1.2 Example of Operation of Compiler FIG. 4 is a program list showing an example of a C language program. In the C language program of FIG. 4, only a loop for performing a so-called multiply-accumulate operation for accumulating a product of an array variable x [i] and an array variable y [i] for i is described.

【0027】以下に、図4のプログラムリストを入力と
した場合における上記構成をもつコンパイラの動作につ
いて図1から図8を用いて説明する。
Hereinafter, the operation of the compiler having the above configuration when the program list of FIG. 4 is input will be described with reference to FIGS.

【0028】ファイル読込部103は、ユーザが記述し
たC言語プログラム101を読み込み、読込用バッファ
104に格納する。
The file reading unit 103 reads the C language program 101 described by the user, and stores it in the reading buffer 104.

【0029】構文解析部105は、読込用バッファ10
4に格納されたC言語プログラムを取り出して構文解析
を行い、逐次実行形式の中間コードを逐次中間コード用
バッファ106に出力する。図5は、このとき逐次中間
コード用バッファ106に格納される逐次中間コードプ
ログラムを示したリストである。各コードの意味は以下
の通りである。 (逐次中間コード1)ポインタXの示すメモリ領域から
値を取り出して変数xに格納する。 (逐次中間コード2)ポインタYの示すメモリ領域から
値を取り出して変数yに格納する。 (逐次中間コード3)変数xと変数yとの積を求め一時変
数t1に格納する。 (逐次中間コード4)変数aと一時変数t1との和を求め
変数aに格納する。 (逐次中間コード5)ポインタXを4減らす。 (逐次中間コード6)ポインタYを4減らす。 (逐次中間コード7)変数iを1減らす。[F]は、この結
果をフラグに反映することを意味する。 (逐次中間コード8)フラグが「大なり(>)」を満た
すならば逐次中間コード1へ分岐する。
The syntax analysis unit 105 includes the read buffer 10
Then, the C language program stored in C.4 is taken out, the syntax analysis is performed, and the intermediate code in the sequential execution format is output to the sequential intermediate code buffer 106. FIG. 5 is a list showing the sequential intermediate code program stored in the sequential intermediate code buffer 106 at this time. The meaning of each code is as follows. (Sequential intermediate code 1) A value is extracted from the memory area indicated by the pointer X and stored in a variable x. (Sequential intermediate code 2) The value is taken out from the memory area indicated by the pointer Y and stored in the variable y. (Sequential intermediate code 3) The product of variable x and variable y is calculated and stored in temporary variable t1. (Sequential intermediate code 4) The sum of the variable a and the temporary variable t1 is obtained and stored in the variable a. (Sequential intermediate code 5) Decrease pointer X by 4. (Sequential intermediate code 6) Decrease pointer Y by 4. (Sequential intermediate code 7) Decrease the variable i by one. [F] means that this result is reflected in the flag. If the (sequential intermediate code 8) flag satisfies “greater than (>)”, the flow branches to the sequential intermediate code 1.

【0030】次に、機械命令生成部107における依存
関係抽出部120は、逐次中間コード用バッファ106
に格納された逐次中間コード列を取り出し、逐次中間コ
ード間の依存関係を解析してパラメータ化する。図6
は、図5に示す逐次中間コードプログラムにおける依存
関係のパラメータ化に関する説明図である。逐次中間コ
ード1の実行結果である変数xは逐次中間コード3にお
いて参照される。また逐次中間コード1を実行する前に
逐次中間コード5を実行してポインタXを更新してはな
らない。従って、逐次中間コード3および逐次中間コー
ド5は逐次中間コード1に依存する。以上の解析によ
り、図6の依存関係有向グラフのイおよびニと依存関係
パラメータP1が決定される。以下同様に、逐次中間コ
ード3および逐次中間コード6は逐次中間コード2に依
存し(依存関係有向グラフのロおよびホ、依存関係パラ
メータP2)、逐次中間コード4は逐次中間コード3に
依存し(依存関係有向グラフのハ、依存関係パラメータ
P3)、逐次中間コード8は逐次中間コード7に依存す
る(依存関係有向グラフのヘ、依存関係パラメータP
7)。依存関係パラメータP4からP6およびP8は他
に依存関係を与えないことを示す。
Next, the dependency extracting section 120 in the machine instruction generating section 107 executes the sequential intermediate code buffer 106
Is extracted, and the dependency between the sequential intermediate codes is analyzed and parameterized. FIG.
FIG. 6 is an explanatory diagram regarding parameterization of a dependency in the sequential intermediate code program shown in FIG. 5. The variable x which is the execution result of the sequential intermediate code 1 is referred to in the sequential intermediate code 3. Also, the sequential intermediate code 5 must not be executed to update the pointer X before the sequential intermediate code 1 is executed. Therefore, the sequential intermediate code 3 and the sequential intermediate code 5 depend on the sequential intermediate code 1. Through the above analysis, the dependency parameter P1 and the parameters a and d of the dependency directed graph of FIG. 6 are determined. Similarly, the sequential intermediate code 3 and the sequential intermediate code 6 depend on the sequential intermediate code 2 (b and e of the dependency directed graph, the dependency parameter P2), and the sequential intermediate code 4 depends on the sequential intermediate code 3 (dependent In the relational directed graph, the dependency parameter P3), the sequential intermediate code 8 depends on the sequential intermediate code 7 (in the dependency directed graph, the dependency parameter P
7). Dependency parameters P4 to P6 and P8 indicate that no other dependencies are given.

【0031】続いて、並列中間コード生成部121は、
依存関係抽出部120で作られた依存関係のパラメータ
を用いて逐次実行形式の中間コードから並列実行形式の
中間コードを生成する。図7は、図6の依存関係パラメ
ータP1〜P8を用いて図5の逐次中間コードプログラ
ムを並列実行形式に並べ変えた並列中間コードプログラ
ムのリストである。ここで並列度は最大3である。各コ
ードの意味は以下の手順に従って生成される。 (並列中間コード1)逐次中間コード1および逐次中間
コード2は並列に実行可能であるが、他の逐次中間コー
ドはいずれもこれらと依存関係を有するため、並列中間
コード1は逐次中間コード1と逐次中間コード2とから
構成される。 (並列中間コード2)逐次中間コード3は、互いに依存
関係のない逐次中間コード5および逐次中間コード7と
並列に実行可能であるため、並列中間コード2は逐次中
間コード3と逐次中間コード5と逐次中間コード7とか
ら構成される。 (並列中間コード3)逐次中間コード4は、互いに依存
関係のない逐次中間コード6および逐次中間コード8と
並列に実行可能であるため、並列中間コード3は逐次中
間コード4と逐次中間コード6と逐次中間コード8とか
ら構成される。
Subsequently, the parallel intermediate code generation unit 121
An intermediate code in a parallel execution format is generated from the intermediate code in a sequential execution format using the parameters of the dependency relationship created by the dependency relationship extraction unit 120. FIG. 7 is a list of parallel intermediate code programs obtained by rearranging the sequential intermediate code program of FIG. 5 into a parallel execution format using the dependency relationship parameters P1 to P8 of FIG. Here, the degree of parallelism is a maximum of three. The meaning of each code is generated according to the following procedure. (Parallel intermediate code 1) Although the sequential intermediate code 1 and the sequential intermediate code 2 can be executed in parallel, all the other sequential intermediate codes have a dependency on them, so that the parallel intermediate code 1 is And a sequential intermediate code 2. (Parallel intermediate code 2) Since the sequential intermediate code 3 can be executed in parallel with the sequential intermediate code 5 and the sequential intermediate code 7, which have no dependency on each other, the parallel intermediate code 2 is composed of the sequential intermediate code 3 and the sequential intermediate code 5. And a sequential intermediate code 7. (Parallel intermediate code 3) Since the sequential intermediate code 4 can be executed in parallel with the sequential intermediate code 6 and the sequential intermediate code 8 that have no dependency on each other, the parallel intermediate code 3 is composed of the sequential intermediate code 4 and the sequential intermediate code 6. And a sequential intermediate code 8.

【0032】次に、フラグ制御コード生成部122は、
並列中間コード生成部121で生成される並列中間コー
ドを対応する機械命令に割り当てるとともに、フラグが
変化するオペレーションを含むスロットがあるかどうか
に基づいてフラグ制御コードを生成して出力用バッファ
108に出力する。図8は、図7の並列中間コードプロ
グラムをもとに生成された機械命令プログラムのリスト
である。なお、機械命令プログラムは本来0と1のビッ
ト列であるが、意味を表すために図8ではニモニック表
記してある。各命令とも、セミコロン(;)で区切られ
た左から、フラグ制御コード、第1スロット、第2スロ
ット、第3スロットである。各命令の意味および生成の
手順は以下の通りである。 (命令1)ポインタXおよびポインタYをレジスタR0およ
びレジスタR1に割り付け、変数xおよび変数yをレジスタ
R2およびレジスタR3に割り付ける。命令の第1スロット
は逐次中間コード1に相当し、R0の間接参照によるデー
タをR2に転送するLD操作である。第2スロットは逐次中
間コード2に相当し、R1の間接参照によるデータをR3に
転送するLD操作である。第3スロットは対応する逐次中
間コードがないため、NOP操作となる。NOP操作は、例え
ばレジスタR7をレジスタR7へ転送するなどの操作で実現
されるが、解かりやすくするためにここではNOPと表記
する。そしていずれのスロットの操作の結果もフラグに
反映しないので、図3におけるステップS301、ステップ
S303、ステップS305、ステップS307と処理されてフラグ
制御コードとして00が生成される。 (命令2)変数iおよび一時変数t1をレジスタR4および
レジスタR3に割り付ける。命令の第1スロットは逐次中
間コード3に相当し、R2とR3の積を求め結果をR3に格納
するMUL操作である。第2スロットは逐次中間コード5
に相当し、R0から4を引いて結果をR0に格納するSUB操
作である。第3スロットは逐次中間コード7に相当し、
R4から1を引いて結果をR4に格納するSUB操作である。
このとき第3スロットの操作の結果をフラグに反映する
ので、図3におけるステップS301、ステップS303、ステ
ップS305、ステップS306と処理されてフラグ制御コード
として11が生成される。 (命令3)変数aをレジスタR5に割り付ける。命令の第
1スロットは逐次中間コード4に相当し、R3とR5の和を
求め結果をR5に格納するADD操作である。第2スロット
は逐次中間コード6に相当し、R1から4を引いて結果を
R1に格納するSUB操作である。第3スロットは逐次中間
コード8に相当し、フラグが「大なり(>)」を満たす
ならば2命令前、即ち命令1に分岐するBGT操作であ
る。そしていずれのスロットの操作の結果もフラグに反
映しないので、図3におけるステップS301、ステップS3
03、ステップS305、ステップS307と処理されてフラグ制
御コードとして00が生成される。
Next, the flag control code generation unit 122
The parallel intermediate code generated by the parallel intermediate code generation unit 121 is assigned to a corresponding machine instruction, and a flag control code is generated based on whether or not there is a slot including an operation whose flag changes, and is output to the output buffer 108. I do. FIG. 8 is a list of machine instruction programs generated based on the parallel intermediate code program of FIG. Note that the machine instruction program is originally a bit string of 0s and 1s, but is represented by a mnemonic in FIG. 8 to represent the meaning. Each instruction is a flag control code, a first slot, a second slot, and a third slot from the left delimited by a semicolon (;). The meaning of each instruction and the procedure of generation are as follows. (Instruction 1) Allocate pointer X and pointer Y to register R0 and register R1, and register variables x and y
Assign to R2 and register R3. The first slot of the instruction corresponds to the sequential intermediate code 1, and is an LD operation for transferring data by indirect reference of R0 to R2. The second slot corresponds to the sequential intermediate code 2 and is an LD operation for transferring data by indirect reference of R1 to R3. Since there is no corresponding intermediate code in the third slot, a NOP operation is performed. The NOP operation is realized by, for example, an operation of transferring the register R7 to the register R7, but is referred to as NOP here for easy understanding. Since the result of the operation of any slot is not reflected in the flag, step S301 in FIG.
S303, step S305, and step S307 are processed to generate 00 as the flag control code. (Instruction 2) Allocate variable i and temporary variable t1 to register R4 and register R3. The first slot of the instruction corresponds to the sequential intermediate code 3, and is a MUL operation for obtaining the product of R2 and R3 and storing the result in R3. The second slot is sequential intermediate code 5
Is a SUB operation of subtracting 4 from R0 and storing the result in R0. The third slot corresponds to the sequential intermediate code 7,
This is a SUB operation of subtracting 1 from R4 and storing the result in R4.
At this time, since the result of the operation of the third slot is reflected in the flag, steps S301, S303, S305, and S306 in FIG. 3 are performed, and 11 is generated as a flag control code. (Instruction 3) Allocate variable a to register R5. The first slot of the instruction corresponds to the sequential intermediate code 4, and is an ADD operation for obtaining the sum of R3 and R5 and storing the result in R5. The second slot corresponds to the sequential intermediate code 6, and subtracts 4 from R1 to obtain the result.
This is a SUB operation stored in R1. The third slot corresponds to the sequential intermediate code 8. If the flag satisfies "greater than (>)", it is a BGT operation two instructions before, that is, a branch to the instruction 1. Then, since the result of the operation of any slot is not reflected in the flag, steps S301 and S3 in FIG.
03, step S305, and step S307 are processed to generate 00 as a flag control code.

【0033】最後に、ファイル出力部109は出力用バ
ッファ108に格納された機械命令プログラムをファイ
ル110に出力する。
Finally, the file output unit 109 outputs the machine instruction program stored in the output buffer 108 to the file 110.

【0034】以上のように、図4のC言語プログラムは
図8の機械命令プログラムに変換される。なお、上記動
作例では図3における未通過のステップがあるが、第1
スロットの操作の結果をフラグに反映する場合は、図3
におけるステップS301、ステップS302と処理されてフラ
グ制御コードとして01が生成され、第2スロットの操
作の結果をフラグに反映する場合は、図3におけるステ
ップS301、ステップS303、ステップS304と処理されてフ
ラグ制御コードとして10が生成される。
As described above, the C language program in FIG. 4 is converted into the machine instruction program in FIG. Note that in the above operation example, there is an unpassed step in FIG.
When the result of the slot operation is reflected in the flag, FIG.
Is generated as a flag control code by performing steps S301 and S302 in step S301, and when the result of the operation of the second slot is reflected in the flag, the processing is performed in steps S301, S303, and S304 in FIG. 10 is generated as the control code.

【0035】2.プロセッサ 2.1 命令の構成 図9は本発明の第1の実施形態におけるプロセッサの命
令構成図である。命令フォーマットは同図(a)に示す
ように命令は32ビット長であり、2ビットのフラグ制
御コードを指示するためのフラグ制御フィールドと、そ
れぞれが10ビットの3つのスロットからなり、いずれ
のスロットも均等にオペレーションを指定することがで
きる。10ビットの各スロットは、4ビットのオペコー
ド(op)と3ビットのソースオペランド(src)と3ビ
ットのデスティネーションオペランド(dst)からな
り、同図(b)に示すビット列が割り付けられている。
ここで、フラグが変化するオペレーションは同時には1
つしか指定できないが、いずれのスロットに指定しても
構わない。第1スロットの操作の結果をフラグに反映す
るときはフラグ制御コードを01に、第2スロットの操
作の結果をフラグに反映するときはフラグ制御コードを
10に、第3スロットの操作の結果をフラグに反映する
ときはフラグ制御コードを11にし、いずれのスロット
の操作の結果もフラグに反映しないときはフラグ制御コ
ードを00にする。オペコードは0000のMOV操作か
ら1111のST操作まで16種類が割り当てられてい
る。オペランドは3ビットでレジスタR0からR7の1つを
選択する。
2. Processor 2.1 Instruction Configuration FIG. 9 is an instruction configuration diagram of the processor according to the first embodiment of the present invention. The instruction format is a 32-bit instruction format as shown in FIG. 7A, and includes a flag control field for indicating a 2-bit flag control code, and three slots each having 10 bits. Can also specify the operation equally. Each 10-bit slot is composed of a 4-bit opcode (op), a 3-bit source operand (src), and a 3-bit destination operand (dst), and the bit string shown in FIG.
Here, the operation in which the flag changes is 1 at the same time.
Only one can be specified, but any slot can be specified. The flag control code is set to 01 when the result of the operation of the first slot is reflected in the flag, the flag control code is set to 10 when the result of the operation of the second slot is reflected in the flag, and the result of the operation of the third slot is set. The flag control code is set to 11 when reflecting on the flag, and the flag control code is set when the result of any slot operation is not reflected on the flag. Sixteen types of operation codes are allocated from 0000 MOV operations to 1111 ST operations. The operand is 3 bits and selects one of the registers R0 to R7.

【0036】2.2 プロセッサの構成 図10は、同実施形態におけるプロセッサの概略構成図
である。
2.2 Configuration of Processor FIG. 10 is a schematic configuration diagram of the processor in the embodiment.

【0037】このプロセッサは、命令フェッチステージ
(以下、IFステージ)、解読およびレジスタ読出しステ
ージ(以下、DECステージ)、実行ステージ(以下、EX
ステージ)の3つのステージからなる3段パイプライン
構造を成している。
This processor includes an instruction fetch stage (hereinafter, IF stage), a decoding and register reading stage (hereinafter, DEC stage), and an execution stage (hereinafter, EX stage).
(Stage) in a three-stage pipeline structure.

【0038】図10において、1は機械命令プログラム
を格納するROM、2と3と4は機械命令(以下、命令と
略す。)の第1スロットと第2スロットと第3スロット
の内容を格納するそれぞれI1ラッチとI2ラッチとI
3ラッチ、5と6と7はそれぞれI1ラッチ2とI2ラ
ッチ3とI3ラッチ4に保持された命令の第1スロット
と第2スロットと第3スロットの内容を解読しプロセッ
サ各部を制御する第1命令解読器と第2命令解読器と第
3命令解読器、8はオペランドを格納するレジスタファ
イル、9と10と11はそれぞれI1ラッチ2とI2ラ
ッチ3とI3ラッチ4の内容の一部とレジスタファイル
8の出力との2入力から1つを選択するD1セレクタと
D2セレクタとD3セレクタ、12と13と14はそれ
ぞれD1セレクタ9とD2セレクタ10とD3セレクタ
11の出力を格納するD11ラッチとD12ラッチとD
13ラッチ、15と16と17はレジスタファイル8の
出力を格納するD21ラッチとD22ラッチとD23ラ
ッチ、18はD11ラッチ12およびD21ラッチ15
の内容を用いて算術論理演算やロード・ストアなど全て
の操作を行う第1操作ユニット、19はD12ラッチ1
3およびD22ラッチ16の内容を用いて算術論理演算
やロード・ストアなど全ての操作を行う第2操作ユニッ
ト、20はD13ラッチ14およびD23ラッチ17の
内容を用いて算術論理演算やロード・ストアなど全ての
操作を行う第3操作ユニットで、第1操作ユニット18
と第2操作ユニット19と第3操作ユニット20の出力
はともにレジスタファイル8に接続される。21は命令
のフラグ制御フィールドの内容を格納するI0ラッチ、
22はI0ラッチ21の内容を格納するD0ラッチ、2
3は第1操作ユニット18から第3操作ユニット20の
それぞれから出力されるフラグ生成のための原始データ
の1つを選択して出力するセレクタ、24はセレクタ2
3で選択された原始データに基づいてC、V、N、Zの
各フラグを生成するフラグ生成ユニット、25はフラグ
生成ユニット24で生成された各フラグを格納するフラ
グレジスタ、26は第1命令解読器5から第3命令解読
器7のいずれかが条件分岐操作を解読した場合にフラグ
レジスタ25の各フラグの状態に基づいて分岐するか否
かを決定する分岐ユニット、27は分岐ユニット26か
ら分岐の指示があればその分岐先に従って命令列をフェ
ッチし、分岐の指示がなければ連続する命令列をシーケ
ンシャルにフェッチする命令フェッチユニットである。
In FIG. 10, reference numeral 1 denotes a ROM for storing a machine instruction program, and 2, 3 and 4 store the contents of the first, second, and third slots of a machine instruction (hereinafter abbreviated as an instruction). I1 latch, I2 latch and I
The three latches 5, 5, 6 and 7 decode the contents of the first, second and third slots of the instruction held in the I1 latch 2, the I2 latch 3 and the I3 latch 4, respectively, and control the respective parts of the processor. An instruction decoder, a second instruction decoder, and a third instruction decoder, 8 is a register file for storing operands, 9 and 10, 11 are registers and a part of the contents of I1 latch 2, I2 latch 3, and I3 latch 4, respectively. D1 selector, D2 selector and D3 selector for selecting one from two inputs of the output of file 8; D13 latches and D12 for storing the outputs of D1 selector 9, D2 selector 10 and D3 selector 11; Latch and D
13 latches, 15, 16 and 17 are D21 latches, D22 latches and D23 latches for storing the output of the register file 8, and 18 are D11 latches 12 and D21 latches 15.
1 is a first operation unit for performing all operations such as arithmetic logic operation and load / store using the contents of
2 and a second operation unit for performing all operations such as arithmetic and logical operations and load / store operations using the contents of the D22 latch 16; 20 denotes an arithmetic and logical operation and load / store operations using the contents of the D13 latch 14 and the D23 latch 17; A third operation unit for performing all operations, the first operation unit 18
The outputs of the second operating unit 19 and the third operating unit 20 are both connected to the register file 8. 21 is an I0 latch for storing the contents of the flag control field of the instruction;
22 is a D0 latch for storing the contents of the I0 latch 21;
Reference numeral 3 denotes a selector for selecting and outputting one of source data for flag generation output from each of the first operation unit 18 to the third operation unit 20, and reference numeral 24 denotes a selector 2
3. A flag generation unit that generates each of the flags C, V, N, and Z based on the source data selected in step 3, a flag register 25 that stores the flags generated by the flag generation unit 24, and a first instruction 26. A branch unit that determines whether or not to branch based on the state of each flag in the flag register 25 when any one of the decoder 5 to the third instruction decoder 7 decodes a conditional branch operation. The instruction fetch unit fetches an instruction sequence according to a branch destination when there is a branch instruction, and sequentially fetches a continuous instruction sequence when there is no branch instruction.

【0039】セレクタ23は、D0ラッチ22の値が0
1ならば第1操作ユニット18から出力される原始デー
タを選択し、10ならば第2操作ユニット19から出力
される原始データを選択し、11ならば第3操作ユニッ
ト20から出力される原始データを選択し、00ならば
機能しない。またフラグ生成ユニット24は、D0ラッ
チ22の値が01ならば第1命令解読器5の指示に従っ
てセレクタ23が出力する原始データを用いて各フラグ
を生成し、生成したフラグのみをフラグレジスタ25の
対応する位置に格納する。例えば、第1命令解読器5が
ADD操作を解読する場合は全てのフラグについて、AND操
作を解読する場合はNフラグとZフラグとについて、TS
T操作を解読する場合はZフラグだけについてフラグを
生成しフラグレジスタ25を更新する。同様に、D0ラ
ッチ22の値が10ならば第2命令解読器6の指示に従
い、11ならば第3命令解読器7の指示に従う。D0ラ
ッチ22の値が00ならばいずれのフラグも更新しな
い。なお、Cフラグは桁上げを、Vフラグはオーバフロ
ーを、Nフラグは負数を、Zフラグはゼロを表す。
The selector 23 sets the value of the D0 latch 22 to 0.
If 1, the source data output from the first operation unit 18 is selected, if 10 the source data output from the second operation unit 19 is selected, and if 11 the source data output from the third operation unit 20 is selected. Is selected and 00 does not work. If the value of the D0 latch 22 is 01, the flag generation unit 24 generates each flag using the source data output from the selector 23 according to the instruction of the first instruction decoder 5, and stores only the generated flag in the flag register 25. Store in the corresponding location. For example, the first command decoder 5
When decoding the ADD operation, all the flags are used. When decoding the AND operation, the N flag and the Z flag are used.
When decoding the T operation, a flag is generated for only the Z flag and the flag register 25 is updated. Similarly, if the value of the D0 latch 22 is 10, the instruction of the second instruction decoder 6 is followed, and if the value of the D0 latch 22 is 11, the instruction of the third instruction decoder 7 is followed. If the value of the D0 latch 22 is 00, none of the flags are updated. The C flag indicates a carry, the V flag indicates an overflow, the N flag indicates a negative number, and the Z flag indicates zero.

【0040】2.3 プロセッサの動作例 以下に、図8の機械命令プログラムがROM1に格納され
た場合における上記構成をもつプロセッサの動作につい
て図11を用いて説明する。なお、図8の命令1におけ
るNOP操作はMOV R7,R7で実現されているものとする。
2.3 Operation Example of Processor Hereinafter, the operation of the processor having the above configuration when the machine instruction program of FIG. 8 is stored in the ROM 1 will be described with reference to FIG. It is assumed that the NOP operation in instruction 1 of FIG. 8 is realized by MOVs R7 and R7.

【0041】図11は、図8の機械命令プログラムがRO
M1に格納された場合におけるプロセッサの動作タイミ
ング図である。同図は、プロセッサの動作をパイプライ
ンのIFステージでROM1から読出される命令、DECステー
ジで解読される命令、EXステージで実行される命令をマ
シンサイクルと呼ばれるタイミング毎に示している。以
下、時間が経過する順にタイミング毎にその動作を説明
する。
FIG. 11 shows that the machine instruction program of FIG.
FIG. 9 is an operation timing chart of the processor when the data is stored in M1. The figure shows the operation of the processor at each timing called a machine cycle, the instructions read from the ROM 1 in the IF stage of the pipeline, the instructions decoded in the DEC stage, and the instructions executed in the EX stage. Hereinafter, the operation will be described for each timing in order of elapse of time.

【0042】(タイミングt1) ・IFステージ:命令1 命令1がROM1から読出され、命令1のフラグ制御コー
ド00および第1スロットから第3スロットがそれぞれ
I0ラッチ21およびI1ラッチ2からI3ラッチ4に
格納される。
(Timing t1) IF stage: Instruction 1 Instruction 1 is read from ROM 1, flag control code 00 of instruction 1 and first to third slots are respectively transferred from I0 latch 21 and I1 latch 2 to I3 latch 4 Is stored.

【0043】(タイミングt2) ・DECステージ:命令1 I1ラッチ2に格納された命令1の第1スロットが第1
命令解読器5で解読される。解読された結果としてLD操
作であることが判明する。この解読に基づいてレジスタ
ファイル8からレジスタR0が読出され、読出された値が
D11ラッチ12に格納される。同時に、I2ラッチ3
に格納された命令1の第2スロットが第2命令解読器6
で解読される。解読された結果としてLD操作であること
が判明する。この解読に基づいてレジスタファイル8か
らレジスタR1が読出され、読出された値がD12ラッチ
13に格納される。さらに同時に、I3ラッチ4に格納
された命令1の第3スロットが第3命令解読器7で解読
される。解読された結果としてNOP操作(MOV R7,R7)で
あることが判明する。この解読に基づいてレジスタファ
イル8からレジスタR7が読出され、読出された値がD1
3ラッチ14に格納される。これらと同時に、I0ラッ
チ21の値00がD0ラッチ22に格納される。また分
岐ユニット26は第1命令解読器5から第3命令解読器
7のいずれもが分岐操作を解読していないことから機能
せず、従って命令フェッチユニット27はシーケンシャ
ルなフェッチを続けることになる。 ・IFステージ:命令2 命令2がROM1から読出され、命令2のフラグ制御コー
ド11および第1スロットから第3スロットがそれぞれ
I0ラッチ21およびI1ラッチ2からI3ラッチ4に
格納される。
(Timing t2) DEC stage: Instruction 1 The first slot of instruction 1 stored in I1 latch 2 is the first slot.
It is decoded by the instruction decoder 5. As a result of the decryption, it is determined that the operation is the LD operation. Based on this decoding, register R0 is read from register file 8, and the read value is stored in D11 latch 12. At the same time, I2 latch 3
The second slot of the instruction 1 stored in the second instruction decoder 6
Will be decrypted. As a result of the decryption, it is determined that the operation is the LD operation. Based on the decoding, the register R1 is read from the register file 8, and the read value is stored in the D12 latch 13. At the same time, the third slot of the instruction 1 stored in the I3 latch 4 is decoded by the third instruction decoder 7. As a result of the decryption, it is determined that the operation is the NOP operation (MOV R7, R7). Based on this decoding, register R7 is read from register file 8, and the read value is D1.
3 latch 14. At the same time, the value 00 of the I0 latch 21 is stored in the D0 latch 22. Also, the branch unit 26 does not function because none of the first to third instruction decoders 5 to 7 has decoded the branch operation, so the instruction fetch unit 27 continues sequential fetching. IF stage: instruction 2 Instruction 2 is read from ROM 1 and flag control code 11 of instruction 2 and first to third slots are stored in I0 latch 21 and I1 latch 2 to I3 latch 4, respectively.

【0044】(タイミングt3) ・EXステージ:命令1 D11ラッチ12に格納されたレジスタR0の値をアドレ
スとしてメモリからデータを読み出す操作が第1操作ユ
ニット18にて行われ、読み出しデータはレジスタファ
イル8のレジスタR2に格納される。同時に、D12ラッ
チ13に格納されたレジスタR1の値をアドレスとしてメ
モリからデータを読み出す操作が第2操作ユニット19
にて行われ、読み出しデータはレジスタファイル8のレ
ジスタR3に格納される。さらに同時に、D13ラッチ1
4に格納されたレジスタR7の値をそのまま出力する操作
が第3操作ユニット20にて行われ、出力データはレジ
スタファイル8のレジスタR7に格納される。これらと同
時に、D0ラッチ22の値00によりセレクタ23は機
能せず、フラグ生成ユニット24はフラグレジスタ25
のいずれのフラグも更新しない。 ・DECステージ:命令2 I1ラッチ2に格納された命令2の第1スロットが第1
命令解読器5で解読される。解読された結果としてMUL
操作であることが判明する。この解読に基づいてレジス
タファイル8からレジスタR2とR3とが読出され、読出さ
れた値がそれぞれD11ラッチ12とD21ラッチ15
とに格納される。同時に、I2ラッチ3に格納された命
令2の第2スロットが第2命令解読器6で解読される。
解読された結果としてSUB操作であることが判明する。
この解読に基づいて命令中の即値4がD2セレクタ10
を経由してD12ラッチ13に格納されるとともに、レ
ジスタファイル8からレジスタR0が読出され、読出され
た値がD22ラッチ16に格納される。さらに同時に、
I3ラッチ4に格納された命令2の第3スロットが第3
命令解読器7で解読される。解読された結果としてSUB
操作であることが判明する。この解読に基づいて命令中
の即値1がD3セレクタ11を経由してD13ラッチ1
4に格納されるとともに、レジスタファイル8からレジ
スタR4が読出され、読出された値がD23ラッチ17に
格納される。これらと同時に、I0ラッチ21の値11
がD0ラッチ22に格納される。また分岐ユニット26
は第1命令解読器5から第3命令解読器7のいずれもが
分岐操作を解読していないことから機能せず、従って命
令フェッチユニット27はシーケンシャルなフェッチを
続けることになる。 ・IFステージ:命令3 命令3がROM1から読出され、命令2のフラグ制御コー
ド00および第1スロットから第3スロットがそれぞれ
I0ラッチ21およびI1ラッチ2からI3ラッチ4に
格納される。
(Timing t3) EX stage: Instruction 1 An operation of reading data from the memory using the value of the register R0 stored in the D11 latch 12 as an address is performed by the first operation unit 18, and the read data is stored in the register file 8 Is stored in the register R2. At the same time, the operation of reading data from the memory using the value of the register R1 stored in the D12 latch 13 as an address is performed by the second operation unit 19.
The read data is stored in the register R3 of the register file 8. At the same time, D13 latch 1
The operation of outputting the value of the register R7 stored in the register 4 as it is is performed by the third operation unit 20, and the output data is stored in the register R7 of the register file 8. At the same time, the selector 23 does not function due to the value 00 of the D0 latch 22, and the flag generation unit 24
Do not update any of the flags. • DEC stage: instruction 2 The first slot of instruction 2 stored in I1 latch 2 is the first slot
It is decoded by the instruction decoder 5. MUL as decrypted result
It turns out to be an operation. Based on this decoding, the registers R2 and R3 are read from the register file 8, and the read values are stored in the D11 latch 12 and the D21 latch 15, respectively.
And stored in At the same time, the second slot of the instruction 2 stored in the I2 latch 3 is decoded by the second instruction decoder 6.
As a result of the decryption, it is determined that the operation is a SUB operation.
Based on this decoding, the immediate value 4 in the instruction is changed to the D2 selector 10
, The register R0 is read from the register file 8, and the read value is stored in the D22 latch 16. At the same time,
The third slot of the instruction 2 stored in the I3 latch 4 is the third slot.
The command is decoded by the command decoder 7. SUB as decrypted result
It turns out to be an operation. Based on this decoding, the immediate value 1 in the instruction is transferred to the D13 latch 1 via the D3 selector 11.
4, the register R4 is read from the register file 8, and the read value is stored in the D23 latch 17. At the same time, the value 11
Are stored in the D0 latch 22. The branch unit 26
Does not work because none of the first to third instruction decoders 5 to 7 has decoded the branch operation, so the instruction fetch unit 27 will continue to fetch sequentially. IF stage: instruction 3 Instruction 3 is read from ROM 1 and flag control code 00 of instruction 2 and first to third slots are stored in I0 latch 21 and I1 latch 2 to I3 latch 4, respectively.

【0045】(タイミングt4) ・EXステージ:命令2 D11ラッチ12に格納されたレジスタR2の値とD21
ラッチ15に格納されたレジスタR3の値との間で乗算操
作が第1操作ユニット18にて行われ、操作結果はレジ
スタファイル8のレジスタR3に格納される。同時に、D
12ラッチ13に格納された値4とD22ラッチ16に
格納されたレジスタR0の値との間で減算操作(R0から4
を引く)が第2操作ユニット19にて行われ、操作結果
はレジスタファイル8のレジスタR0に格納される。さら
に同時に、D13ラッチ14に格納された値1とD23
ラッチ17に格納されたレジスタR4の値との間で減算操
作(R4から1を引く)が第3操作ユニット20にて行わ
れ、操作結果はレジスタファイル8のレジスタR4に格納
される。これらと同時に、D0ラッチ22の値11によ
りセレクタ23は第3操作ユニット20からの原始デー
タ(この場合は、最上位ビットおよびその次位のビット
の桁上げ、結果の最上位ビットおよび結果の全ビットが
ゼロか否かの情報)を選択し、フラグ生成ユニット24
は第3命令解読器7からの全フラグ更新の指示に基づき
C、V、N、Zフラグを生成しフラグレジスタ25を更
新する。Cフラグは最上位ビットからの桁上げを、Vフ
ラグは最上位ビットおよびその次位のビットの桁上げの
排他的論理和を、Nフラグは結果の最上位ビットを、Z
フラグは結果の全ビットがゼロである情報をフラグとし
て用いる。 ・DECステージ:命令3 I1ラッチ2に格納された命令3の第1スロットが第1
命令解読器5で解読される。解読された結果としてADD
操作であることが判明する。この解読に基づいてレジス
タファイル8からレジスタR3とR5とが読出され、読出さ
れた値がそれぞれD11ラッチ12とD21ラッチ15
とに格納される。同時に、I2ラッチ3に格納された命
令3の第2スロットが第2命令解読器6で解読される。
解読された結果としてSUB操作であることが判明する。
この解読に基づいて命令中の即値4がD2セレクタ10
を経由してD12ラッチ13に格納されるとともに、レ
ジスタファイル8からレジスタR1が読出され、読出され
た値がD22ラッチ16に格納される。さらに同時に、
I3ラッチ4に格納された命令2の第3スロットが第3
命令解読器7で解読される。解読された結果としてBGT
操作であることが判明する。これらと同時に、I0ラッ
チ21の値00がD0ラッチ22に格納される。また分
岐ユニット26は第3命令解読器7がBGT操作を解読し
ていることに基づいて、同じタイミングで更新されたフ
ラグレジスタ25を参照して分岐条件、即ち「大なり
(>)」が満たされるか否かを判定し、満たされるなら
ば第3スロット中の即値-2により2命令前からフェッチ
するように命令フェッチユニット27に指示を与え、満
たされないならば命令フェッチユニット27に何も指示
を与えず従って命令フェッチユニット27はシーケンシ
ャルなフェッチを続けることになる。なお、BGT操作に
おける分岐条件の判定はCフラグとZフラグの否定との
論理積が真ならば条件満足、偽ならば条件不満足として
行われる。なおこのタイミングでは条件が満たされるも
のとする。
(Timing t4) EX stage: instruction 2 The value of register R2 stored in D11 latch 12 and D21
A multiplication operation is performed by the first operation unit 18 with the value of the register R3 stored in the latch 15, and the operation result is stored in the register R3 of the register file 8. At the same time, D
A subtraction operation is performed between the value 4 stored in the 12 latch 13 and the value of the register R0 stored in the D22 latch 16 (from R0 to 4).
Is performed in the second operation unit 19, and the operation result is stored in the register R0 of the register file 8. At the same time, the value 1 stored in D13 latch 14 and D23
The third operation unit 20 performs a subtraction operation (subtract 1 from R4) with the value of the register R4 stored in the latch 17, and the operation result is stored in the register R4 of the register file 8. At the same time, the value 23 of the D0 latch 22 causes the selector 23 to determine the source data from the third operation unit 20 (in this case, the carry of the most significant bit and the bit following it, the most significant bit of the result and the total of the result). (Information on whether the bit is zero) is selected, and the flag generation unit 24
Generates the C, V, N, and Z flags based on the instruction to update all the flags from the third instruction decoder 7, and updates the flag register 25. The C flag indicates the carry from the most significant bit, the V flag indicates the exclusive OR of the carry of the most significant bit and the bit following it, the N flag indicates the most significant bit of the result,
The flag uses information in which all bits of the result are zero as a flag. DEC stage: Instruction 3 The first slot of instruction 3 stored in I1 latch 2 is the first
It is decoded by the instruction decoder 5. ADD as decrypted result
It turns out to be an operation. Based on the decoding, registers R3 and R5 are read from register file 8, and the read values are stored in D11 latch 12 and D21 latch 15, respectively.
And stored in At the same time, the second slot of the instruction 3 stored in the I2 latch 3 is decoded by the second instruction decoder 6.
As a result of the decryption, it is determined that the operation is a SUB operation.
Based on this decoding, the immediate value 4 in the instruction is changed to the D2 selector 10
, Is stored in the D12 latch 13, the register R1 is read from the register file 8, and the read value is stored in the D22 latch 16. At the same time,
The third slot of the instruction 2 stored in the I3 latch 4 is the third slot.
The command is decoded by the command decoder 7. BGT as a result of decryption
It turns out to be an operation. At the same time, the value 00 of the I0 latch 21 is stored in the D0 latch 22. Further, the branch unit 26 satisfies the branch condition, that is, “greater than (>)” by referring to the flag register 25 updated at the same timing based on the fact that the third instruction decoder 7 is decoding the BGT operation. It is determined whether or not the instruction is fetched. If the condition is satisfied, an instruction is given to the instruction fetch unit 27 so that the instruction is fetched two instructions before by the immediate value -2 in the third slot. Therefore, the instruction fetch unit 27 continues the sequential fetch. The determination of the branch condition in the BGT operation is performed if the logical product of the C flag and the negation of the Z flag is true, and the condition is not satisfied if the logical product is false. It is assumed that the condition is satisfied at this timing.

【0046】(タイミングt5) ・EXステージ:命令3 D11ラッチ12に格納されたレジスタR3の値とD21
ラッチ15に格納されたレジスタR5の値との間で加算操
作が第1操作ユニット18にて行われ、操作結果はレジ
スタファイル8のレジスタR5に格納される。同時に、D
12ラッチ13に格納された値4とD22ラッチ16に
格納されたレジスタR1の値との間で減算操作(R1から4
を引く)が第2操作ユニット19にて行われ、操作結果
はレジスタファイル8のレジスタR1に格納される。さら
に同時に、D13ラッチ14に格納された値-2に基づい
て分岐操作が第3操作ユニット20にて行われる。これ
らと同時に、D0ラッチ22の値00によりセレクタ2
3は機能せず、フラグ生成ユニット24はフラグレジス
タ25のいずれのフラグも更新しない。 ・IFステージ:命令1 タイミングt4での分岐ユニット26における分岐条件が
満たされたことにより、命令フェッチユニット27は再
び命令1をROM1から読出し、命令1のフラグ制御コー
ド00および第1スロットから第3スロットがそれぞれ
I0ラッチ21およびI1ラッチ2からI3ラッチ4に
格納される。
(Timing t5) EX stage: instruction 3 D11 The value of the register R3 stored in the latch 12 and D21
An addition operation is performed by the first operation unit 18 with the value of the register R5 stored in the latch 15, and the operation result is stored in the register R5 of the register file 8. At the same time, D
A subtraction operation (from R1 to 4) is performed between the value 4 stored in the 12 latch 13 and the value of the register R1 stored in the D22 latch 16.
Is performed in the second operation unit 19, and the operation result is stored in the register R1 of the register file 8. Further, at the same time, a branch operation is performed in the third operation unit 20 based on the value-2 stored in the D13 latch 14. At the same time, the selector 00 is set by the value 00 of the D0 latch 22.
3 does not work, and the flag generation unit 24 does not update any flags in the flag register 25. IF stage: instruction 1 When the branch condition in the branch unit 26 at the timing t4 is satisfied, the instruction fetch unit 27 reads the instruction 1 again from the ROM 1, and reads the instruction 1 from the flag control code 00 and the first slot to the third slot. Slots are stored in I0 latch 21 and I1 latch 2 through I3 latch 4, respectively.

【0047】以下、命令3における分岐条件が満たされ
なくなるまで、タイミングt2からt5に記す動作を繰り返
すことになる。
Thereafter, the operations described at timings t2 to t5 are repeated until the branch condition in instruction 3 is not satisfied.

【0048】なお、上記の動作例ではフラグ制御コード
が11のときだけを説明したが、11以外のときも全く
同様である。即ち、フラグ制御コードが01または10
の場合は、セレクタ23はそれぞれ第1操作ユニット1
8または第2操作ユニット19からの原始データを選択
し、フラグ生成ユニット24はそれぞれ第1命令解読器
5または第2命令解読器6からのフラグ更新の指示に基
づき各フラグを生成しフラグレジスタ25を更新する。
どのフラグを生成し更新するかはオペコード指定される
操作の内容で決まる。
In the above-described operation example, only the case where the flag control code is 11 has been described. That is, the flag control code is 01 or 10
In the case of, each of the selectors 23 is the first operation unit 1
8 or the source data from the second operation unit 19, and the flag generation unit 24 generates each flag based on the flag update instruction from the first instruction decoder 5 or the second instruction decoder 6, and generates a flag register 25. To update.
Which flag is generated and updated is determined by the content of the operation specified by the operation code.

【0049】3.記録媒体 本発明の記録媒体の実施の形態として、図8の機械命令
プログラムを記録した磁気ディスク(フロッピーディス
クやハードディスクなど)、光ディスク(CD-ROMやPDな
ど)、光磁気ディスク、半導体メモリ(ROMやフラッシ
ュメモリなど)がある。
3. Recording Medium As an embodiment of the recording medium of the present invention, a magnetic disk (floppy disk, hard disk, etc.), an optical disk (CD-ROM, PD, etc.), a magneto-optical disk, a semiconductor memory (ROM) storing the machine instruction program of FIG. And flash memory).

【0050】以上のように本実施の形態によれば、スロ
ットに指定できるオペレーションが制限されず並列度の
向上が保たれたまま、コンパイラのフラグ制御コード生
成部122がフラグを変化させる操作を含むスロットを
特定してフラグ制御コードを生成するためにオペコード
の長さが短くなって、コード効率が向上する。図17お
よび図18の従来技術では1命令が64ビットであるの
に対して本実施形態では1命令が32ビットで同様の機
能を指定できることから、コード効率が2倍高くなって
いることがわかる。
As described above, according to the present embodiment, the flag control code generation unit 122 of the compiler includes the operation of changing the flag while the operation that can be specified for the slot is not restricted and the degree of parallelism is maintained. The length of the operation code for identifying the slot and generating the flag control code is shortened, thereby improving the code efficiency. 17 and FIG. 18, one instruction is 64 bits, whereas in the present embodiment, one instruction can specify the same function with 32 bits, which means that the code efficiency is twice as high. .

【0051】なお、本実施形態のプロセッサでは、3つ
の命令解読器と3つの操作ユニットを設けて最大3並列
実行を達成しているが、これらを4つずつ設けて4並列
実行してもよいし、あるいはそれ以上であってもよい。
4並列実行の場合は、フラグ制御コードを3ビットにし
て第1から第4スロットの操作のフラグへの反映といず
れのスロットも反映させないこととを指定するようにし
てもよいし、フラグ制御コードは2ビットのままにして
おいて第1から第4スロットのいずれかの操作をフラグ
へ反映するようにして、フラグを変化させない場合はフ
ラグ反映が指定されたスロットにはフラグ変化を伴わな
い操作を指定するようにしてもよいし、同じくフラグ制
御コードは2ビットのままにしておいて第1から第3ス
ロットの操作のフラグへの反映といずれのスロットも反
映させないこととを指定するようにして、第4スロット
の操作はフラグへ反映されないとしてもよい。
In the processor of this embodiment, three instruction decoders and three operation units are provided to achieve a maximum of three parallel executions. However, four of these units may be provided and four parallel executions may be performed. Or more.
In the case of four-parallel execution, the flag control code may be set to 3 bits to specify that the operation of the first to fourth slots is to be reflected in the flag and that none of the slots is to be reflected. Is set to 2 bits and any one of the first to fourth slots is reflected in the flag. If the flag is not changed, the operation without flag change is performed in the slot for which flag reflection is specified. May be designated, and the flag control code may be left at 2 bits to designate that the operation of the first to third slots is reflected in the flag and that none of the slots is reflected. Thus, the operation of the fourth slot may not be reflected on the flag.

【0052】(実施の形態2)実施の形態2は、実施の
形態1のフラグ制御コードを、第1スロットの操作の結
果をフラグに反映させるか、第1と第2スロットの操作
の結果をこの順にフラグに反映させるか、第1から第3
スロットの操作の結果をこの順にフラグに反映させる
か、いずれのスロットの操作もフラグに反映させないか
を指定するものに代えたものである。
(Embodiment 2) In Embodiment 2, the flag control code of Embodiment 1 is used to reflect the result of the operation of the first slot in the flag, or the result of the operation of the first and second slots. In this order, the flag is reflected, or the first to third
Instead of designating whether the result of the slot operation is reflected on the flag in this order or whether any slot operation is not reflected on the flag.

【0053】1.コンパイラ コンパイラの構成および動作は、フラグ制御コード生成
部122の動作を除いて実施の形態1に記したものと同
じである。フラグ制御コード生成部122は次の原理に
基づいて動作する。
1. Compiler The configuration and operation of the compiler are the same as those described in the first embodiment except for the operation of the flag control code generation unit 122. The flag control code generator 122 operates based on the following principle.

【0054】フラグ制御コード生成部122は、第1ス
ロットの操作の結果をフラグに反映させると判断すると
フラグ制御コードを01にし、第1と第2スロットの操
作の結果をこの順にフラグに反映させると判断するとフ
ラグ制御コードを10にし、第1から第3スロットの操
作の結果をこの順にフラグに反映させると判断するとフ
ラグ制御コードを11にし、いずれのスロットの操作も
フラグに反映させないと判断するとフラグ制御コードを
00にする。
When the flag control code generation unit 122 determines that the result of the operation of the first slot is reflected in the flag, the flag control code is set to 01, and the result of the operation of the first and second slots is reflected on the flag in this order. When it is determined that the flag control code is set to 10, and when it is determined that the operation results of the first to third slots are reflected in this order in the flag, the flag control code is set to 11 and when it is determined that the operation of any slot is not reflected in the flag. Set the flag control code to 00.

【0055】2.プロセッサ 2.1 命令の構成 図12は本発明の第2の実施形態におけるプロセッサの
命令構成図である。命令フォーマットは同図(a)に示
すように、図9(a)に示す第1の実施形態におけるプ
ロセッサの命令フォーマットと同一であり、同図(b)
に示すビット列の内、フラグ制御コードのビット割り付
けのみが異なっている。即ち、フラグが変化するオペレ
ーションは同時にいくつも指定できるが、指定できるス
ロットはフラグを反映させるオペレーションの数により
制限される。第1スロットの操作の結果をフラグに反映
するときはフラグ制御コードを01に、第1と第2スロ
ットの操作の結果をこの順にフラグに反映するときはフ
ラグ制御コードを10に、第1から第3スロットの操作
の結果をこの順にフラグに反映するときはフラグ制御コ
ードを11にし、いずれのスロットの操作の結果もフラ
グに反映しないときはフラグ制御コードを00にする。
2. Processor 2.1 Instruction Configuration FIG. 12 is an instruction configuration diagram of the processor according to the second embodiment of the present invention. The instruction format is the same as the instruction format of the processor in the first embodiment shown in FIG. 9A, as shown in FIG.
Are different only in the bit assignment of the flag control code. That is, any number of operations that change the flag can be specified at the same time, but the number of slots that can be specified is limited by the number of operations that reflect the flag. The flag control code is set to 01 when the result of the operation of the first slot is reflected on the flag, and the flag control code is set to 10 when the result of the operation of the first and second slots is reflected on the flag in this order. When the result of the operation of the third slot is reflected on the flag in this order, the flag control code is set to 11, and when the result of the operation of any slot is not reflected on the flag, the flag control code is set to 00.

【0056】2.2 プロセッサの構成 図13は、同実施形態におけるプロセッサの概略構成図
である。
2.2 Configuration of Processor FIG. 13 is a schematic configuration diagram of the processor in the embodiment.

【0057】図13において実施の形態1におけるプロ
セッサと同一の構成要素には同一の符号を付している。
31と32と33は、それぞれ実施の形態1のプロセッ
サにおける第1命令解読器5と第2命令解読器6と第3
命令解読器7の機能に加えて、変化するフラグの種別を
識別する2ビットの情報を出力する第1命令解読器と第
2命令解読器と第3命令解読器であり、上記2ビットの
情報はいずれも、00のときはいずれのフラグも変化し
ないことを、01のときはZフラグのみが変化すること
を、10のときはNフラグとZフラグが変化すること
を、11のときは全てのフラグが変化することを示す。
また34は第1命令解読器31からの上記2ビットの情
報を保持するD3ラッチ、35は第2命令解読器32か
らの上記2ビットの情報を保持するD4ラッチ、36は
第3命令解読器33からの上記2ビットの情報を保持す
るD5ラッチである。37は、D3ラッチ34の値(こ
れをG1とする)、D4ラッチ35の値(これをG2とす
る)、D5ラッチ36の値(これをG3とする)およびD
0ラッチ22の内容(これをFCとする)に基づいて、第
1操作ユニット18から第3操作ユニット20からの原
始データを用いてC、V、N、Zフラグを生成するフラ
グ生成リオーダユニットである。その他の構成は、実施
の形態1におけるプロセッサと同一である。
In FIG. 13, the same components as those of the processor according to the first embodiment are denoted by the same reference numerals.
31, 32 and 33 are the first instruction decoder 5, the second instruction decoder 6 and the third instruction decoder 6 in the processor of the first embodiment, respectively.
In addition to the function of the instruction decoder 7, a first instruction decoder, a second instruction decoder, and a third instruction decoder which output 2-bit information for identifying the type of the flag to be changed. Indicates that none of the flags change when the value is 00, that only the Z flag changes when the value is 01, that the N flag and the Z flag change when the value is 10, and that when the value is 11, Indicates that the flag changes.
34 is a D3 latch for holding the 2-bit information from the first instruction decoder 31, 35 is a D4 latch for holding the 2-bit information from the second instruction decoder 32, and 36 is a third instruction decoder. 33 is a D5 latch that holds the 2-bit information from 33. 37 is the value of the D3 latch 34 (this is G1), the value of the D4 latch 35 (this is G2), the value of the D5 latch 36 (this is G3), and D
A flag generation reorder unit that generates C, V, N, and Z flags from the first operation unit 18 using source data from the third operation unit 20 based on the contents of the 0 latch 22 (this is FC). is there. Other configurations are the same as those of the processor in the first embodiment.

【0058】図14はフラグ生成リオーダユニット37
の各フラグの生成論理を示した真理値表であり、G1、G
2、G3およびFCにより、Cフラグの生成論理SC、Vフラ
グの生成論理SV、Nフラグの生成論理SNおよびZフラグ
の生成論理SZを決定する。SCからSZの欄の「1」は各フ
ラグを第1操作ユニット18からの原始データを用いて
生成することを示し、「2」は各フラグを第2操作ユニ
ット19からの原始データを用いて生成することを示
し、「3」は各フラグを第3操作ユニット20からの原
始データを用いて生成することを示し、「0」はフラグ
を変化させないことを示す。またG1からG3の欄の「*
*」は無視(don't care)を意味する。原始データは、
最上位ビットおよびその次位のビットの桁上げ、結果の
最上位ビットおよび結果の全ビットがゼロか否かの情報
で構成され、Cフラグは最上位ビットからの桁上げを、
Vフラグは最上位ビットおよびその次位のビットの桁上
げの排他的論理和を、Nフラグは結果の最上位ビット
を、Zフラグは結果の全ビットがゼロである情報をフラ
グとして用いる点は、第1の実施形態のプロセッサと同
じである。
FIG. 14 shows the flag generation reorder unit 37.
Is a truth table showing the generation logic of each flag of G1, G
2, G3 and FC determine the C flag generation logic SC, V flag generation logic SV, N flag generation logic SN and Z flag generation logic SZ. "1" in the column of SC to SZ indicates that each flag is generated using the original data from the first operating unit 18, and "2" indicates that each flag is generated using the original data from the second operating unit 19. "3" indicates that each flag is generated using the original data from the third operation unit 20, and "0" indicates that the flag is not changed. "*" In the column of G1 to G3
“*” Means “don't care”. The source data is
The carry of the most significant bit and the bit following it, the most significant bit of the result and information indicating whether all bits of the result are zero or not. The C flag indicates the carry from the most significant bit.
The V flag uses the exclusive OR of the carry of the most significant bit and the next bit, the N flag uses the most significant bit of the result, and the Z flag uses the information that all bits of the result are zero as flags. , Is the same as the processor of the first embodiment.

【0059】2.3 プロセッサの動作例 以下に、図16の命令Aが実行される場合のプロセッサ
の動作について説明する。
2.3 Operation Example of Processor The operation of the processor when the instruction A in FIG. 16 is executed will be described below.

【0060】命令Aのフラグ制御コードは11、第1ス
ロットはR0とR1の和を求め結果をR1に格納するADD操
作、第2スロットはR2とR3の論理和を求め結果をR3に格
納するSUB操作、第3スロットはR4とゼロとを比較するT
ST操作である。 ・IFステージ 命令AがROM1から読出され、命令Aのフラグ制御コー
ド11および第1スロットから第3スロットがそれぞれ
I0ラッチ21およびI1ラッチ2からI3ラッチ4に
格納される。 ・DECステージ(IFステージの動作のマシンサイクル) I1ラッチ2に格納された命令Aの第1スロットが第1
命令解読器31で解読される。解読された結果としてAD
D操作であることが判明する。この解読に基づいてレジ
スタファイル8からレジスタR0とR1とが読出され、読出
された値がそれぞれD11ラッチ12とD21ラッチ1
5とに格納される。同時に、I2ラッチ3に格納された
命令Aの第2スロットが第2命令解読器32で解読され
る。解読された結果としてOR操作であることが判明す
る。この解読に基づいてレジスタファイル8からレジス
タR2とR3とが読出され、読出された値がそれぞれD12
ラッチ13とD22ラッチ16とに格納される。さらに
同時に、I3ラッチ4に格納された命令Aの第3スロッ
トが第3命令解読器33で解読される。解読された結果
としてTST操作であることが判明する。この解読に基づ
いてレジスタファイル8からレジスタR4が読出され、読
出された値がD23ラッチ17に格納される。これらと
同時に、I0ラッチ21の値11がD0ラッチ22に格
納され、第1命令解読器31でADD操作が解読されるこ
とにより値11(ADD操作は全てのフラグが変化)がD
3ラッチ34に格納され、第2命令解読器32でOR操作
が解読されることにより値10(OR操作はNフラグとZ
フラグが変化)がD4ラッチ35に格納され、第3命令
解読器33でTST操作が解読されることにより値01(T
ST操作はZフラグのみが変化)がD5ラッチ36に格納
される。また分岐ユニット26は第1命令解読器5から
第3命令解読器7のいずれもが分岐操作を解読していな
いことから機能せず、従って命令フェッチユニット27
はシーケンシャルなフェッチを続けることになる。 ・EXステージ(DECステージの動作のマシンサイクル) D11ラッチ12に格納されたレジスタR0の値とD21
ラッチ15に格納されたレジスタR1の値との間で加算操
作が第1操作ユニット18にて行われ、操作結果はレジ
スタファイル8のレジスタR1に格納される。同時に、D
12ラッチ13に格納されたレジスタR2の値とD22ラ
ッチ16に格納されたレジスタR3の値との間で論理和操
作が第2操作ユニット19にて行われ、操作結果はレジ
スタファイル8のレジスタR3に格納される。さらに同時
に、D23ラッチ17に格納されたレジスタR4の値とゼ
ロとの間で比較操作(R4から0を引く)が第3操作ユニ
ット20にて行われ、操作結果はどこにも格納されな
い。これらと同時に、D0ラッチ22の値11によりFC
=11が、D3ラッチ34の値11によりG1=11が、D4ラ
ッチ35の値10によりG2=10が、D5ラッチ36の値
01によりG3=01がそれぞれフラグ生成リオーダユニッ
ト37に入力され、図15の下から7つ目の欄に示すよ
うに、SC=1に基づいて第1操作ユニット18の最上位ビ
ットからの桁上げをCフラグとし、SV=1に基づいて第1
操作ユニット18の最上位ビットおよびその次位のビッ
トの桁上げの排他的論理和をVフラグとし、SN=2に基づ
いて第2操作ユニット19の結果の最上位ビットをNフ
ラグとし、SZ=3に基づいて第3操作ユニット20の結果
の全ビットがゼロである情報をZフラグとしてC、V、
N、Zフラグを生成しフラグレジスタ25を更新する。
このようにフラグ生成リオーダユニット37は、ADD操
作とSUB操作とTST操作とをあたかもこの順に逐次実行し
たかのようにフラグ生成を行う。
The flag control code of the instruction A is 11, the first slot is an ADD operation for obtaining the sum of R0 and R1, and storing the result in R1, and the second slot is for calculating the logical sum of R2 and R3 and storing the result in R3. SUB operation, third slot T comparing R4 with zero
ST operation. IF stage Instruction A is read from ROM 1, and flag control code 11 of instruction A and first to third slots are stored in I0 latch 21 and I1 latch 2 to I3 latch 4, respectively. • DEC stage (machine cycle of operation of IF stage) The first slot of instruction A stored in I1 latch 2 is the first slot
The instruction is decoded by the instruction decoder 31. AD as a result of decryption
It turns out to be a D operation. Based on the decoding, registers R0 and R1 are read from register file 8, and the read values are stored in D11 latch 12 and D21 latch 1, respectively.
5 is stored. At the same time, the second slot of the instruction A stored in the I2 latch 3 is decoded by the second instruction decoder 32. As a result of the decryption, it is determined that the operation is an OR operation. Based on this decoding, registers R2 and R3 are read from register file 8, and the read values are
The data is stored in the latch 13 and the D22 latch 16. At the same time, the third slot of the instruction A stored in the I3 latch 4 is decoded by the third instruction decoder 33. As a result of the decryption, it is determined that the operation is the TST operation. Based on the decoding, the register R4 is read from the register file 8, and the read value is stored in the D23 latch 17. At the same time, the value 11 of the I0 latch 21 is stored in the D0 latch 22, and the value 11 (all flags change in the ADD operation) is changed to D by the first instruction decoder 31 decoding the ADD operation.
3 is stored in the latch 34 and the OR operation is decoded by the second instruction decoder 32 to obtain a value of 10 (OR operation is performed by the N flag and the Z flag).
The flag change is stored in the D4 latch 35, and the third instruction decoder 33 decodes the TST operation so that the value 01 (T
(Only the Z flag changes in the ST operation) is stored in the D5 latch 36. Also, the branch unit 26 does not function because none of the first to third instruction decoders 5 to 7 has decoded the branch operation, and accordingly, the instruction fetch unit 27 does not function.
Will continue a sequential fetch. EX stage (machine cycle of operation of the DEC stage) The value of the register R0 stored in the D11 latch 12 and D21
An addition operation is performed on the value of the register R1 stored in the latch 15 by the first operation unit 18, and the operation result is stored in the register R1 of the register file 8. At the same time, D
The second operation unit 19 performs an OR operation between the value of the register R2 stored in the 12 latch 13 and the value of the register R3 stored in the D22 latch 16, and the operation result is stored in the register R3 of the register file 8. Is stored in At the same time, a comparison operation (subtracting 0 from R4) is performed in the third operation unit 20 between the value of the register R4 stored in the D23 latch 17 and zero, and the operation result is not stored anywhere. At the same time, the value of FC
= 11, G1 = 11 by the value 11 of the D3 latch 34, G2 = 10 by the value 10 of the D4 latch 35, and G3 = 01 by the value 01 of the D5 latch 36, respectively, to the flag generation reorder unit 37. As shown in the seventh column from the bottom of FIG. 15, the carry from the most significant bit of the first operation unit 18 is set to the C flag based on SC = 1, and the first flag is set based on SV = 1.
The exclusive OR of the carry of the most significant bit of the operation unit 18 and the bit following it is set as a V flag, the most significant bit of the result of the second operation unit 19 is set as an N flag based on SN = 2, and SZ = 3, information that all bits of the result of the third operation unit 20 are zero is set as a Z flag as C, V,
The N and Z flags are generated and the flag register 25 is updated.
As described above, the flag generation reorder unit 37 generates a flag as if the ADD operation, the SUB operation, and the TST operation were sequentially executed in this order.

【0061】なお、上記の動作例ではFC=11かつG1=11か
つG2=10かつG3=01のときだけを説明したが、これ以外の
ときも全く同様である。即ち、図14、図15の真理値
表に従ってC、V、N、Zフラグのそれぞれを第1操作
ユニット18から第3操作ユニット20の原始データを
用いて生成すればよい。
In the above operation example, only the case where FC = 11, G1 = 11, G2 = 10, and G3 = 01 has been described, but the other cases are exactly the same. That is, each of the C, V, N, and Z flags may be generated using the source data of the first operation unit 18 to the third operation unit 20 according to the truth tables of FIGS.

【0062】3.記録媒体 本発明の記録媒体の実施の形態として、図16の命令を
記録した磁気ディスク(フロッピーディスクやハードデ
ィスクなど)、光ディスク(CD-ROMやPDなど)、光磁気
ディスク、半導体メモリ(ROMやフラッシュメモリな
ど)がある。
3. Recording Medium As an embodiment of the recording medium of the present invention, a magnetic disk (floppy disk, hard disk, etc.), an optical disk (CD-ROM, PD, etc.), a magneto-optical disk, a semiconductor memory (ROM, flash, Memory etc.).

【0063】以上のように本実施の形態によれば、第1
の実施形態と同様にコード効率が向上することに加え
て、フラグを変化させる操作の位置とフラグ変化の順序
とを特定するフラグ制御コードを生成することにより、
複数のスロットでフラグが変化するオペレーションを指
定することができ、一層の並列度向上が見込まれる。こ
れは例えば、ADD操作におけるオーバフローの有無とSUB
操作における結果の符号とTST操作における比較結果と
の三者のそれぞれにより多方向に分岐するような場合
に、ADD操作のVフラグとSUB操作のNフラグとTST操作
のZフラグがいずれもフラグレジスタ25に反映される
ため、図16の命令Aのように1つの命令で3つの操作
を並列に実行することができるからである。
As described above, according to the present embodiment, the first
In addition to improving the code efficiency as in the first embodiment, by generating a flag control code for specifying the position of the operation for changing the flag and the order of the flag change,
An operation in which the flag changes in a plurality of slots can be specified, and further improvement in the degree of parallelism is expected. This is due, for example, to the presence or absence of overflow in the ADD operation and SUB
In the case where the sign of the result of the operation and the comparison result of the TST operation are branched in multiple directions, the V flag of the ADD operation, the N flag of the SUB operation, and the Z flag of the TST operation are all in the flag register. This is because three operations can be executed in parallel by one instruction as in instruction A of FIG.

【0064】なお、本実施形態のプロセッサでは、1つ
の操作をフラグに反映させる場合、2つの操作をフラグ
に反映させる場合、3つの操作をフラグに反映させる場
合のそれぞれについて1通りずつを指定できる2ビット
のフラグ制御コードを持たせているが、このビット数を
増やして、1つの操作をフラグに反映させる場合におけ
る操作の選択の3通りと、2つの操作をフラグに反映さ
せる場合における操作の選択と順序の6通りと、3つの
操作をフラグに反映させる場合における順序の6通りの
全てまたは一部を指定するようにしてもよい。
In the processor of this embodiment, one operation can be designated for each of the case where one operation is reflected on the flag, the case where two operations are reflected on the flag, and the case where three operations are reflected on the flag. Although a two-bit flag control code is provided, the number of bits is increased to select one of three types of operation when one operation is reflected on the flag, and three types of operation when two operations are reflected on the flag. All or a part of the six orders of the selection and the order and the six orders in the case where the three operations are reflected on the flag may be designated.

【0065】また、3つの命令解読器と3つの操作ユニ
ットを設けて最大3並列実行を達成しているが、これら
を4つずつ設けて4並列実行してもよいし、あるいはそ
れ以上であってもよい。
Although three instruction decoders and three operation units are provided to achieve a maximum of three parallel executions, four of them may be provided for four parallel executions, or more. You may.

【0066】以上、本発明に係るコンパイラ及びプロセ
ッサについて、上記の2つの実施形態に基づいて説明し
たが、本発明はこれら実施形態に限られないことは勿論
である。即ち、 (1)上記の2つの実施形態では、コンパイラにおい
て、フラグ制御コード生成部122が機械命令生成時に
フラグ制御コードを生成しているが、並列中間コード生
成部121が並列中間コード生成時にフラグ制御コード
を生成するようにしてもよい。 (2)上記の2つの実施形態のプロセッサは、命令フェ
ッチ、解読、実行の3段パイプラインで構成されるとし
ているが、パイプラインの段数は何段であってもよい
し、パイプラインを採らなくともよい。
As described above, the compiler and the processor according to the present invention have been described based on the above two embodiments. However, it is needless to say that the present invention is not limited to these embodiments. That is, (1) In the above two embodiments, in the compiler, the flag control code generation unit 122 generates the flag control code when generating the machine instruction, but the parallel intermediate code generation unit 121 uses the flag when generating the parallel intermediate code. A control code may be generated. (2) The processors of the above two embodiments are configured by a three-stage pipeline of instruction fetch, decoding, and execution. However, the number of stages of the pipeline may be any, and It is not necessary.

【0067】[0067]

【発明の効果】以上の説明から明らかなように、本発明
に係るコンパイラ、プロセッサおよび記録媒体は、フラ
グが変化する操作記述とフラグが変化しない操作記述と
の2種類を持たせる必要がないために操作記述の長さが
長くならず、また機械命令が含み得る操作記述に制限が
ないために、コード効率の向上と命令並列度の向上とが
同時に図られ、特にマルチメディア関連の製品開発にお
いて非常に有用であり、マルチメディア関連産業の進歩
発展に多大な貢献をするものである。
As is clear from the above description, the compiler, processor and recording medium according to the present invention do not need to have two types of operation descriptions, one in which the flag changes and the other in which the flag does not change. Since the length of the operation description is not lengthened and the operation description that can be included in the machine instruction is not limited, the code efficiency and instruction parallelism are improved at the same time, especially in the development of multimedia-related products. It is very useful and makes a great contribution to the advancement and development of the multimedia related industry.

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

【図1】実施形態に係るコンパイラの構成を示すブロッ
ク図
FIG. 1 is a block diagram showing a configuration of a compiler according to an embodiment.

【図2】同実施形態に係るコンパイラの機械命令生成部
107の構成を示すブロック図
FIG. 2 is an exemplary block diagram showing a configuration of a machine instruction generation unit 107 of the compiler according to the embodiment.

【図3】同実施形態に係るコンパイラのフラグ制御コー
ド生成部122におけるフラグ制御コードの生成フロー
を示したフローチャート
FIG. 3 is a flowchart showing a flow of generating a flag control code in a flag control code generation unit 122 of the compiler according to the embodiment;

【図4】C言語プログラムの例を示すプログラムリスト
を示す図
FIG. 4 is a diagram showing a program list showing an example of a C language program;

【図5】図4に示すC言語プログラムを入力として与え
た場合に、同実施形態に係るコンパイラの逐次中間コー
ド用バッファ106に格納された逐次中間コードプログ
ラムを示したリストを示す図
FIG. 5 is a diagram showing a list showing a sequential intermediate code program stored in a sequential intermediate code buffer 106 of the compiler according to the embodiment when the C language program shown in FIG. 4 is given as an input;

【図6】図5に示す逐次中間コードプログラムにおける
依存関係のパラメータ化に関する説明図
FIG. 6 is an explanatory diagram relating to parameterization of dependencies in the sequential intermediate code program shown in FIG. 5;

【図7】図4に示すC言語プログラムを入力として与え
た場合に、同実施形態に係るコンパイラの並列中間コー
ド生成部121が生成する並列中間コードプログラムを
示したリストを示す図
FIG. 7 is a view showing a list showing parallel intermediate code programs generated by a parallel intermediate code generation unit 121 of the compiler according to the embodiment when the C language program shown in FIG. 4 is given as an input;

【図8】図4に示すC言語プログラムを入力として与え
た場合に、同実施形態に係るコンパイラにより生成され
た機械命令プログラムを示したリストを示す図
FIG. 8 is a diagram showing a list showing machine instruction programs generated by the compiler according to the embodiment when the C language program shown in FIG. 4 is given as an input;

【図9】実施形態1に係るプロセッサの命令構成図FIG. 9 is an instruction configuration diagram of a processor according to the first embodiment.

【図10】同実施形態に係るプロセッサの概略構成図FIG. 10 is a schematic configuration diagram of a processor according to the embodiment;

【図11】同実施形態に係るプロセッサの図8の機械命
令プログラムに対応した動作タイミング図
FIG. 11 is an operation timing chart corresponding to the machine instruction program of FIG. 8 of the processor according to the embodiment;

【図12】実施形態2に係るプロセッサの命令構成図FIG. 12 is an instruction configuration diagram of a processor according to a second embodiment.

【図13】同実施形態に係るプロセッサの概略構成図FIG. 13 is a schematic configuration diagram of a processor according to the embodiment;

【図14】同実施形態に係るプロセッサのフラグ生成リ
オーダユニット34の各フラグの生成論理を示した真理
値表図
FIG. 14 is a truth table showing the generation logic of each flag of the flag generation reorder unit of the processor according to the embodiment;

【図15】同実施形態に係るプロセッサの機械命令の例
示図
FIG. 15 is an exemplary diagram of machine instructions of the processor according to the embodiment;

【図16】同実施形態に係るプロセッサの機械命令の例
示図
FIG. 16 is an exemplary diagram of machine instructions of the processor according to the embodiment;

【図17】従来技術におけるプロセッサの命令構成図FIG. 17 is an instruction configuration diagram of a processor according to the related art.

【図18】同従来技術におけるプロセッサの概略構成図FIG. 18 is a schematic configuration diagram of a processor according to the related art.

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

1 ROM 2 I1ラッチ 3 I2ラッチ 4 I3ラッチ 5 第1命令解読器 6 第2命令解読器 7 第3命令解読器 8 レジスタファイル 9 D1セレクタ 10 D2セレクタ 11 D3セレクタ 12 D11ラッチ 13 D12ラッチ 14 D13ラッチ 15 D21ラッチ 16 D22ラッチ 17 D23ラッチ 18 第1操作ユニット 19 第2操作ユニット 20 第3操作ユニット 21 I0ラッチ 22 D0ラッチ 23 セレクタ 24 フラグ生成ユニット 25 フラグレジスタ 26 分岐ユニット 27 命令フェッチユニット 31 第1命令解読器 32 第2命令解読器 33 第3命令解読器 34 D3ラッチ 35 D4ラッチ 36 D5ラッチ 37 フラグ生成リオーダユニット 101 C言語プログラム 102 コンパイラ 103 ファイル読込部 104 読込用バッファ 105 構文解析部 106 逐次中間コード用バッファ 107 機械命令生成部 108 出力用バッファ 109 ファイル出力部 110 機械命令プログラム 120 依存関係抽出部 121 並列中間コード生成部 122 フラグ制御コード生成部 1 ROM 2 I1 latch 3 I2 latch 4 I3 latch 5 First instruction decoder 6 Second instruction decoder 7 Third instruction decoder 8 Register file 9 D1 selector 10 D2 selector 11 D3 selector 12 D11 latch 13 D12 latch 14 D13 latch 15 D21 latch 16 D22 latch 17 D23 latch 18 First operation unit 19 Second operation unit 20 Third operation unit 21 I0 latch 22 D0 latch 23 Selector 24 Flag generation unit 25 Flag register 26 Branch unit 27 Instruction fetch unit 31 First instruction Decryptor 32 Second instruction decoder 33 Third instruction decoder 34 D3 latch 35 D4 latch 36 D5 latch 37 Flag generation reorder unit 101 C language program 102 Compiler 103 File reading unit 10 Read buffer 105 parser 106 sequentially for the intermediate code buffer 107 machine instruction generation unit 108 output buffer 109 File output unit 110 machine instructions programs 120 dependency extracting unit 121 parallel intermediate code generating unit 122 flag control code generation unit

Claims (21)

【特許請求の範囲】[Claims] 【請求項1】 高級言語プログラムから、複数の操作を
同時並列に実行し操作結果をフラグに反映するプロセッ
サを対象とする長語命令形式の機械命令プログラムを生
成するコンパイラであって、 1つの機械命令の中に、 複数の操作記述と、 操作結果の前記フラグへの反映の仕方に関するフラグ制
御記述と を含む機械命令を生成する機械命令生成手段を備えるこ
とを特徴とするコンパイラ。
1. A compiler for generating, from a high-level language program, a machine instruction program in a long-word instruction format for a processor that executes a plurality of operations in parallel and reflects an operation result on a flag, the machine comprising: A compiler comprising: machine instruction generating means for generating a machine instruction including, in an instruction, a plurality of operation descriptions and a flag control description regarding how to reflect an operation result on the flag.
【請求項2】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させる1つを特定
する情報で構成されることを特徴とする請求項1記載の
コンパイラ。
2. The method according to claim 1, wherein the flag control description includes information for specifying one of the plurality of operation descriptions included in the same machine instruction that reflects an operation result in the flag. The compiler according to claim 1, wherein
【請求項3】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述によ
る操作の結果を前記フラグに反映させる順序を特定する
情報で構成されることを特徴とする請求項1記載のコン
パイラ。
3. The flag control description includes information for specifying an order in which results of operations performed by the plurality of operation descriptions included in the same machine instruction are reflected on the flag. The compiler according to item 1.
【請求項4】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させるいくつかを
抽出し、抽出された前記いくつかの操作記述による操作
の結果を前記フラグに反映させる順序を特定する情報で
構成されることを特徴とする請求項1記載のコンパイ
ラ。
4. The flag control description includes, from among the plurality of operation descriptions included in the same machine instruction, extracting some of the plurality of operation descriptions reflecting the operation result in the flag, 2. The compiler according to claim 1, further comprising information for specifying an order in which the result of the operation according to the operation description is reflected in the flag.
【請求項5】 前記機械命令の一語に含まれる前記操作
記述の数が、前記プロセッサにより同時並列に実行され
る操作の最大数に等しいことを特徴とする請求項1から
4のいずれか1項に記載のコンパイラ。
5. The method according to claim 1, wherein a number of the operation descriptions included in one word of the machine instruction is equal to a maximum number of operations executed in parallel by the processor. Compiler as described in section.
【請求項6】 複数の操作を指定する長語命令形式の命
令を実行するプロセッサであって、 同時並列に実行できる数の操作記述と、操作結果のフラ
グへの反映の仕方に関するフラグ制御記述とを同時に含
む命令を取出し、 前記操作記述による操作を並列実行するとともに、 前記フラグ制御記述に従って前記並列実行による操作結
果をフラグに反映することを特徴とするプロセッサ。
6. A processor for executing an instruction in a long-word instruction format for designating a plurality of operations, comprising: a description of the number of operations that can be executed in parallel; and a flag control description relating to a method of reflecting operation results on a flag. A processor that fetches an instruction that includes the following at the same time, executes the operation according to the operation description in parallel, and reflects an operation result of the parallel execution in a flag according to the flag control description.
【請求項7】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させる1つを特定
する情報で構成されることを特徴とする請求項6記載の
プロセッサ。
7. The flag control description is configured to include information for specifying one of the plurality of operation descriptions included in the same machine instruction that reflects an operation result in the flag. The processor of claim 6, wherein:
【請求項8】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述によ
る操作の結果を前記フラグに反映させる順序を特定する
情報で構成されることを特徴とする請求項6記載のプロ
セッサ。
8. The flag control description is configured by information for specifying an order in which results of operations performed by the plurality of operation descriptions included in the same machine instruction are reflected in the flag. Item 7. The processor according to Item 6.
【請求項9】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させるいくつかを
抽出し、抽出された前記いくつかの操作記述による操作
の結果を前記フラグに反映させる順序を特定する情報で
構成されることを特徴とする請求項6記載のプロセッ
サ。
9. The flag control description includes, from among the plurality of operation descriptions included in the same machine instruction, extracting some of the plurality of operation descriptions reflecting the operation result in the flag, and extracting the extracted some. 7. The processor according to claim 6, comprising information for specifying an order in which the result of the operation according to the operation description is reflected in the flag.
【請求項10】 複数の操作を指定する長語命令形式の
命令を実行するプロセッサであって、 同時並列に実行できる数の操作記述と、操作結果のフラ
グへの反映の仕方に関するフラグ制御記述とを同時に含
む命令を取出す命令読出し手段と、 前記操作記述を解読し、解読結果に基づいて操作を並列
実行する命令解読実行手段と、 前記フラグ制御記述に従って、前記命令解読実行手段に
おける操作結果をフラグに反映するフラグ生成保持手段
とを備えたことを特徴とするプロセッサ。
10. A processor for executing a long-word instruction format instruction for designating a plurality of operations, comprising: a description of the number of operations that can be executed in parallel; and a flag control description relating to a method of reflecting operation results on flags. Instruction reading means for retrieving an instruction which simultaneously includes: an instruction decoding means for decoding the operation description and executing an operation in parallel based on the decoding result; and a flag for the operation result in the instruction decoding execution means according to the flag control description. And a flag generation / holding unit for reflecting the result to a processor.
【請求項11】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させる1つを特定
する情報で構成されることを特徴とする請求項10記載
のプロセッサ。
11. The flag control description is configured to include information for specifying one of the plurality of operation descriptions included in the same machine instruction that reflects an operation result in the flag. The processor of claim 10, wherein:
【請求項12】 前記命令解読実行手段は、それぞれが
フラグを生成するための原始データであって並列に実行
できる数に等しい組の原始データを出力し、 前記フラグ生成保持手段は、 前記フラグ制御記述に従って、前記命令解読実行手段が
出力する前記原始データの組から1つを選択するセレク
タと、 前記セレクタが出力する原始データを用いてフラグデー
タを生成するフラグ生成手段と、 前記フラグ生成手段が生成するフラグデータを保持する
フラグレジスタとからなることを特徴とする請求項11
記載のプロセッサ。
12. The command decoding and executing means outputs a set of source data each of which is a source data for generating a flag and which is equal to a number which can be executed in parallel. A selector for selecting one from the set of source data output by the instruction decoding and executing unit according to the description; a flag generating unit for generating flag data using the source data output by the selector; 12. A flag register for holding flag data to be generated.
Processor as described.
【請求項13】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述によ
る操作の結果を前記フラグに反映させる順序を特定する
情報で構成されることを特徴とする請求項10記載のプ
ロセッサ。
13. The flag control description includes information for specifying an order in which results of operations performed by the plurality of operation descriptions included in the same machine instruction are reflected in the flag. Item 11. The processor according to item 10.
【請求項14】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させるいくつかを
抽出し、抽出された前記いくつかの操作記述による操作
の結果を前記フラグに反映させる順序を特定する情報で
構成されることを特徴とする請求項10記載のプロセッ
サ。
14. The flag control description extracts, from among the plurality of operation descriptions included in the same machine instruction, some that reflect the result of the operation on the flag, and extracts the some 11. The processor according to claim 10, comprising information for specifying an order in which the result of the operation according to the operation description is reflected in the flag.
【請求項15】 前記命令解読実行手段は、それぞれが
どのフラグが変化するかの情報であって並列に実行でき
る数に等しい組の情報と、それぞれがフラグを生成する
ための原始データであって並列に実行できる数に等しい
組の原始データとを出力し、 前記フラグ生成保持手段は、 前記フラグ制御記述と前記情報とに従って、フラグ毎
に、前記命令解読実行手段が出力する前記原始データの
組のいずれを用いるかを決定し、決定された原始データ
を用いてフラグデータを生成するフラグ生成手段と、 前記フラグ生成手段が生成するフラグデータを保持する
フラグレジスタとからなることを特徴とする請求項13
または14記載のプロセッサ。
15. The instruction decoding and executing means comprises: a set of information each of which is information on which flag changes and which is equal to the number which can be executed in parallel; and each is source data for generating a flag. Outputting a set of source data equal to the number that can be executed in parallel, the flag generation and holding means, for each flag, according to the flag control description and the information, the source data set output by the instruction decoding execution means And a flag register for holding the flag data generated by the flag generating unit. The flag generating unit generates flag data using the determined source data. Item 13
Or a processor according to 14.
【請求項16】 前記フラグ生成手段は、前記フラグ制
御記述により特定される順序が後である操作を優先し
て、前記操作に関するフラグデータを生成することを特
徴とする請求項15記載のプロセッサ。
16. The processor according to claim 15, wherein said flag generating means generates flag data relating to the operation with priority given to an operation specified later by said flag control description.
【請求項17】 複数の操作を同時並列に実行し操作結
果をフラグに反映するプロセッサによって実行される機
械命令プログラムを記録した記録媒体であって、 1つの機械命令が、 複数の操作記述と、 操作結果の前記フラグへの反映の仕方に関するフラグ制
御記述とを含む構成であることを特徴とする機械命令プ
ログラムを記録した記録媒体。
17. A recording medium recording a machine instruction program executed by a processor that executes a plurality of operations simultaneously and in parallel and reflects an operation result on a flag, wherein one machine instruction includes a plurality of operation descriptions, And a flag control description relating to how the operation result is reflected in the flag.
【請求項18】 プロセッサによって実行される機械命
令プログラムを記録した記録媒体であって、 同時並列に実行できる数の操作記述と、操作結果のフラ
グへの反映の仕方に関するフラグ制御記述とを同時に含
む長語命令形式の命令を取出す第1ステップと、 前記操作記述による操作を並列実行する第2ステップ
と、 前記フラグ制御記述に従って前記並列実行による操作結
果をフラグに反映する第3ステップとをプロセッサに実
行させるための機械命令プログラムを記録した記録媒
体。
18. A recording medium on which a machine instruction program to be executed by a processor is recorded, the medium including a number of operation descriptions that can be executed simultaneously in parallel and a flag control description on how to reflect operation results on flags. A first step of fetching an instruction in a long-word instruction format, a second step of executing the operation according to the operation description in parallel, and a third step of reflecting an operation result of the parallel execution in a flag according to the flag control description to a processor A recording medium that stores a machine instruction program to be executed.
【請求項19】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させる1つを特定
する情報で構成されることを特徴とする請求項17また
は18記載の記録媒体。
19. The flag control description is configured to include information for specifying one of the plurality of operation descriptions included in the same machine instruction that reflects an operation result in the flag. 19. The recording medium according to claim 17, wherein:
【請求項20】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述によ
る操作の結果を前記フラグに反映させる順序を特定する
情報で構成されることを特徴とする請求項17または1
8記載の記録媒体。
20. The flag control description comprises information for specifying an order in which results of operations performed by the plurality of operation descriptions included in the same machine instruction are reflected in the flag. Item 17 or 1
8. The recording medium according to 8.
【請求項21】 前記フラグ制御記述は、 同一の機械命令の中に含まれる前記複数の操作記述の内
から、前記フラグに操作の結果を反映させるいくつかを
抽出し、抽出された前記いくつかの操作記述による操作
の結果を前記フラグに反映させる順序を特定する情報で
構成されることを特徴とする請求項17または18記載
の記録媒体。
21. The flag control description includes: extracting, from the plurality of operation descriptions included in the same machine instruction, some of the plurality of operation descriptions that reflect the operation result in the flag; 19. The recording medium according to claim 17, comprising information for specifying an order in which an operation result according to the operation description is reflected in the flag.
JP15615599A 1999-06-03 1999-06-03 Compiler, processor and recording medium Expired - Fee Related JP4006887B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15615599A JP4006887B2 (en) 1999-06-03 1999-06-03 Compiler, processor and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15615599A JP4006887B2 (en) 1999-06-03 1999-06-03 Compiler, processor and recording medium

Publications (2)

Publication Number Publication Date
JP2000347861A true JP2000347861A (en) 2000-12-15
JP4006887B2 JP4006887B2 (en) 2007-11-14

Family

ID=15621560

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15615599A Expired - Fee Related JP4006887B2 (en) 1999-06-03 1999-06-03 Compiler, processor and recording medium

Country Status (1)

Country Link
JP (1) JP4006887B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2426605A (en) * 2005-05-26 2006-11-29 Advanced Risc Mach Ltd Instruction issue control within a superscalar processor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2426605A (en) * 2005-05-26 2006-11-29 Advanced Risc Mach Ltd Instruction issue control within a superscalar processor
GB2426605B (en) * 2005-05-26 2010-06-30 Advanced Risc Mach Ltd Instruction issue control within a superscalar processor
US7774582B2 (en) 2005-05-26 2010-08-10 Arm Limited Result bypassing to override a data hazard within a superscalar processor

Also Published As

Publication number Publication date
JP4006887B2 (en) 2007-11-14

Similar Documents

Publication Publication Date Title
EP1296227B1 (en) Valid instruction dispatching and execution
US7458069B2 (en) System and method for fusing instructions
JP3547139B2 (en) Processor
US5303356A (en) System for issuing instructions for parallel execution subsequent to branch into a group of member instructions with compoundability in dictation tag
US5333280A (en) Parallel pipelined instruction processing system for very long instruction word
US6490673B1 (en) Processor, compiling apparatus, and compile program recorded on a recording medium
US5710902A (en) Instruction dependency chain indentifier
US5504932A (en) System for executing scalar instructions in parallel based on control bits appended by compounding decoder
US7552313B2 (en) VLIW digital signal processor for achieving improved binary translation
JP2002333978A (en) Vliw type processor
JPH1165844A (en) Data processing device having pipeline bypass function
US20060015855A1 (en) Systems and methods for replacing NOP instructions in a first program with instructions of a second program
US6064818A (en) Straight path optimization for compilers
JP2001243070A (en) Processor, branch prediction method, and compilation method
JP4006887B2 (en) Compiler, processor and recording medium
JP2828219B2 (en) Method of providing object code compatibility, method of providing object code compatibility and compatibility with scalar and superscalar processors, method for executing tree instructions, data processing system
US6886091B1 (en) Replacing VLIW operation with equivalent operation requiring fewer issue slots
KR100837400B1 (en) Method and apparatus for processing according to multithreading / nonsequential merging technique
JPH11242599A (en) Computer program
JP3737573B2 (en) VLIW processor
JP3915019B2 (en) VLIW processor, program generation device, and recording medium
JP3553845B2 (en) Processor, compiler, coiling method, and recording medium
JP2004021890A (en) Data processor
JP2000081982A (en) Compiler, processor and recording medium
CN101124539A (en) low power assembler

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060427

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20060512

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070123

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070306

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070626

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070710

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070807

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070820

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

Free format text: PAYMENT UNTIL: 20100907

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100907

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110907

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120907

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees