JP2000056971A - High-speed arithmetic processor and recording medium - Google Patents

High-speed arithmetic processor and recording medium

Info

Publication number
JP2000056971A
JP2000056971A JP10220329A JP22032998A JP2000056971A JP 2000056971 A JP2000056971 A JP 2000056971A JP 10220329 A JP10220329 A JP 10220329A JP 22032998 A JP22032998 A JP 22032998A JP 2000056971 A JP2000056971 A JP 2000056971A
Authority
JP
Japan
Prior art keywords
instruction
data
prediction
execution
data dependency
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.)
Withdrawn
Application number
JP10220329A
Other languages
Japanese (ja)
Inventor
Yasushi Iwata
靖 岩田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP10220329A priority Critical patent/JP2000056971A/en
Publication of JP2000056971A publication Critical patent/JP2000056971A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To execute a program in data dependency relation fast by extracting information on data dependency relation and performing static prediction when a source program is compiled, and dynamically predicting and selectively executing an instruction which is not solved so far and has high prediction probability at the time of execution. SOLUTION: A compiler 2 takes a morpheme analysis and a syntax analysis of a C source code 1 to generate a binary code. A simulator 4 registers in a profile image table 5 a pair of the line of an instruction in data dependency relation of an object to be predicted and a dependent instruction among instructions in data dependency relation. In the profile image table 5, the object instruction to be predicted among the instructions in the data dependency relation is registered. A compiler 6 generates a binary code 7 in execution form and registers an instruction code and a dependent instruction in the data dependence relation in the binary code in execution form corresponding to line numbers (address). The analysis and prediction of the source program and the fast execution of the compiled instruction in executable form are enabled.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、ソースプログラム
を解析して予測を行うおよびソースプログラムをコンパ
イルした実行可能形式の命令を高速実行する高速演算処
理装置および記録媒体に関するものである。
[0001] 1. Field of the Invention [0002] The present invention relates to a high-speed arithmetic processing device and a recording medium for analyzing a source program to make predictions and executing the executable-format instructions obtained by compiling the source program at a high speed.

【0002】[0002]

【従来の技術】従来、プロセッサの実行性能向上を図る
ために分岐命令があるときに分岐先を予測して先行的に
実行し、予測結果が正しければその先行実行した次から
実行を継続し、予測結果が間違っていれば先行実行をキ
ャンセルして他の分岐先を実行するようにしていた。
2. Description of the Related Art Conventionally, in order to improve the execution performance of a processor, when there is a branch instruction, a branch destination is predicted and executed in advance, and if the prediction result is correct, execution is continued from the one after the preceding execution. If the prediction result is wrong, the preceding execution is canceled and another branch destination is executed.

【0003】[0003]

【発明が解決しようとする課題】上述したように従来は
分岐先の予測、即ち制御の流れの分岐予測は行われてい
たが、あるタスク内で実行に必要なデータが他のタスク
内で実行されて確定しないと実行できないといういわゆ
るデータ依存関係がある場合のデータ予測は行われてい
なく、高速実行し得ないという問題があった。
As described above, conventionally, prediction of a branch destination, that is, branch prediction of a control flow, has been performed. However, data necessary for execution in one task is executed in another task. There is a problem that data cannot be predicted when there is a so-called data dependency that the data cannot be executed unless it is determined and confirmed, and high-speed execution cannot be performed.

【0004】本発明は、これらの問題を解決するため、
ソースプログラムのコンパイル時にデータ依存関係の情
報を抽出して静的予測を行うと共に実行時にデータ依存
関係があり実行時までに解決されなくて予測確率の高い
命令を動的予測して選択実行し、データ依存関係にある
プログラムの高速実行を実現することを目的としてい
る。
[0004] The present invention solves these problems,
Performs static prediction by extracting information on data dependencies at the time of compiling the source program and dynamically predicting and executing instructions that have data dependencies at the time of execution and are not resolved by the time of execution and have a high prediction probability, The purpose is to realize high-speed execution of programs that have a data dependency.

【0005】[0005]

【課題を解決するための手段】図1を参照して課題を解
決するための手段を説明する。図1において、コンパイ
ラ2は、Cソースコードを形態素解析、構文解析などを
行い、バイナリを生成するものである。
Means for solving the problem will be described with reference to FIG. In FIG. 1, a compiler 2 generates a binary by performing morphological analysis, syntax analysis, and the like on a C source code.

【0006】シミュレータ4は、データ依存関係にある
命令のうち予測すべき命令を選択してプロファイルイメ
ージテーブル5に登録するものである。プロファイルイ
メージテーブル5は、データ依存関係にある命令のうち
予測すべき対象の命令を登録するものである(後述する
図4参照)。
The simulator 4 selects an instruction to be predicted from instructions having a data dependency and registers it in the profile image table 5. The profile image table 5 is for registering an instruction to be predicted among instructions having a data dependency (see FIG. 4 described later).

【0007】実行形式バイナリ7は、実行形式のバイナ
リ(後述する図5参照)である。次に、動作を説明す
る。コンパイラ2がCソースプログラムを解析し、シミ
ュレータ4が解析した結果をもとに行番号に対応づけて
データ依存関係にある命令をプロファイルイメージジテ
ーブル5に設定および設定したデータ依存関係にある命
令のうちデータ予測対象の命令の予測フラグをONに設
定するようにしている。
The executable binary 7 is an executable binary (see FIG. 5 described later). Next, the operation will be described. The compiler 2 analyzes the C source program, sets the data-dependent instruction in the profile image table 5 in association with the line number based on the result of the analysis by the simulator 4, and executes the instruction of the set data-dependent instruction. The prediction flag of the instruction whose data is to be predicted is set to ON.

【0008】この際、予測フラグをONに設定する命令
として、自タスク内でデータが決定される命令を除いた
命令とするようにしている。また、予測フラグをONに
設定する命令として、他タスク内でデータが決定される
が命令実行時までに確定している命令を除いた命令とす
るようにしている。
At this time, the instruction for setting the prediction flag to ON is an instruction excluding the instruction whose data is determined in the own task. The instruction for setting the prediction flag to ON is an instruction that excludes an instruction whose data is determined in another task but has been determined by the time the instruction is executed.

【0009】また、実行可能形式の命令の実行時に、デ
ータ依存関係にある命令を設定したテーブルを参照して
データの値を予測して先行実行し、動的予測の結果の集
計を行い予測の正解率の低い命令の先行実行を抑止する
ようにしている。
In addition, when an executable instruction is executed, a data value is predicted with reference to a table in which instructions having a data dependency are set, and pre-execution is performed. Preemptive execution of instructions with a low correct answer rate is suppressed.

【0010】この際、動的予測の結果の集計として、予
測結果が正解のときに正解フラグに+1、不正解のとき
に不正解フラグを+1して正解率を集計するようにして
いる。
At this time, as a total of the results of the dynamic prediction, the correct flag is incremented by +1 when the prediction result is correct, and the incorrect flag is incremented by +1 when the prediction result is incorrect, and the correct answer rate is totaled.

【0011】また、データ依存関係にある命令として、
メモリアクセス命令とするようにしている。従って、ソ
ースプログラムのコンパイル時にデータ依存関係の情報
を抽出して静的予測を行うと共に実行時にデータ依存関
係があり実行時までに解決されなくて予測確率の高い命
令を動的予測して選択実行することにより、データ依存
関係にあるプログラムを高速実行することが可能とな
る。
[0011] Further, as an instruction having a data dependency,
It is a memory access instruction. Therefore, at the time of compiling the source program, information on data dependence is extracted and static prediction is performed, and at the time of execution, an instruction which has data dependence and is not resolved by execution and has a high prediction probability is dynamically predicted and selected for execution. By doing so, it becomes possible to execute a data-dependent program at high speed.

【0012】[0012]

【発明の実施の形態】次に、図1から図13を用いて本
発明の実施の形態および動作を順次詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, embodiments and operations of the present invention will be sequentially described in detail with reference to FIGS.

【0013】図1は、本発明のシステム構成図を示す。
図1において、Cソースコードは、ソースコードの例で
あって、ここでは、C言語のソースコードである。
FIG. 1 shows a system configuration diagram of the present invention.
In FIG. 1, a C source code is an example of a source code, and here is a C language source code.

【0014】コンパイラ2は、Cソースコード1を形態
素解析、構文解析などを行い、バイナリ3を生成するも
のである。バイナリ3は、コンパイラ2によって生成さ
れた実行形式のコードである。
The compiler 2 generates a binary 3 by performing morphological analysis, syntax analysis and the like on the C source code 1. The binary 3 is an executable code generated by the compiler 2.

【0015】シミュレータ4は、データ依存関係にある
命令のうち予測すべき命令を選択してプロファイルイメ
ージテーブル5に登録などするものである。プロファイ
ルイメージテーブル5は、データ依存関係にある命令の
うち予測すべき対象の命令を登録するものであって、後
述する図4に示すようにデータ依存関係にある命令の行
番号、依存命令の対を登録したものである。
The simulator 4 selects an instruction to be predicted from instructions having a data dependency and registers the instruction in the profile image table 5. The profile image table 5 is for registering an instruction to be predicted among instructions having a data dependency, and as shown in FIG. 4 described later, a row number of an instruction having a data dependency and a pair of a dependent instruction. Is registered.

【0016】コンパイラ6は、実行形式バイナリ7を生
成するものである。実行形式バイナリ7は、実行形式の
バイナリであって、後述する図5に示すように行番号
(アドレス)に対応づけて命令コード、データ依存関係
にある依存命令を登録したものである。以下順次詳細に
説明する。
The compiler 6 generates an executable binary 7. The execution form binary 7 is an execution form binary in which an instruction code and a dependent instruction having a data dependency are registered in association with a line number (address) as shown in FIG. The details will be sequentially described below.

【0017】図2は、本発明の説明図(その1)を示
す。図2において、PE(A)、PE(B)は、プロセ
ッサエレメントであって、タスクA、Bを動作させるも
のである。ここでは、PE(A)上でタスクAが動作
し、PE(B)上でタスクBが動作している。一点鎖線
の矢印でデータ依存関係(1)、(2)、(3)を示
し、このうちのデータ依存関係(1)のみが、データ予
測して先行実行する対象である。
FIG. 2 is an explanatory view (part 1) of the present invention. In FIG. 2, PE (A) and PE (B) are processor elements that operate tasks A and B. Here, task A operates on PE (A), and task B operates on PE (B). The data dependency relationships (1), (2), and (3) are indicated by dashed-dotted arrows, and only the data dependency relationship (1) is an object to be predicted and executed in advance.

【0018】PC(行番号)は、プログラムカウンタで
あって、現在の実行しようとする行番号(アドレス)を
保持(生成)するものである。次に、図2の動作を説明
する。
The PC (line number) is a program counter which holds (generates) the line number (address) to be executed at present. Next, the operation of FIG. 2 will be described.

【0019】(1) PE(B)上で動作するタスクB
が行番号PC=001でz=y+4の演算を行う。この
際、演算中のyはPE(A)で動作するタスクAが行番
号PC=101でy=c+2の演算によって算出されて
確定するまで待機する必要があるというデータ依存関係
がある。
(1) Task B operating on PE (B)
Performs the operation of z = y + 4 with the row number PC = 001. At this time, y during the calculation has a data dependency that it is necessary to wait until task A operating on the PE (A) is calculated and determined by the calculation of y = c + 2 at the row number PC = 101 and determined.

【0020】(2) PE(B)上で動作するタスクB
が行番号PC=002でz=z+2の演算を行う。この
際、同じタスクBで行番号PC=001で既に算出され
て確定しており待機する必要がないというデータ依存関
係がある。
(2) Task B operating on PE (B)
Performs the operation of z = z + 2 with the row number PC = 002. At this time, there is a data dependency that the same task B has already been calculated and determined with the row number PC = 001 and does not need to wait.

【0021】(3) PE(B)で動作するタスクBが
行番号PC=003でx=x+5の演算を行う。この
際、演算中のxはPE(A)で動作するタスクAが行番
号PC=100でx=a+1の演算によって算出されて
確定しており待機する必要がないというデータ依存関係
がある。
(3) The task B operating on the PE (B) performs an operation of x = x + 5 with the row number PC = 003. At this time, x during the calculation has a data dependency such that the task A operating on the PE (A) is determined by the calculation of x = a + 1 with the row number PC = 100 and x = a + 1, and there is no need to wait.

【0022】従って、上記(1)、(2)、(3)のデ
ータ依存関係のうち、待機する必要のあるデータ依存関
係は(1)のみでありこれが本願発明のデータの値を予
測して先行実行する対象の命令であり、後述する図5の
実行形式バイナリの該当するアドレス(行番号)の予測
フラグを1(予測)に設定する。予測する必要のないも
のには予測フラグを0(非予測)に設定する。これによ
り、コンパイル時にデータ依存関係にある命令のうち静
的な予測が行われたこととなる。以上のことをまとめる
と以下のようになる。
Therefore, of the data dependencies (1), (2), and (3), only the data dependency that needs to be waited is (1), which is used to predict the value of the data of the present invention. This is an instruction to be executed in advance, and sets a prediction flag of a corresponding address (line number) of an execution format binary in FIG. 5 described later to 1 (prediction). For those that do not need to be predicted, the prediction flag is set to 0 (non-prediction). This means that a static prediction has been performed among the instructions that have a data dependency at the time of compilation. The above is summarized as follows.

【0023】(イ) 自タスク内で定義されている命令
は予測対象としない(図2の(2)の場合は予測対象と
しない)。 (ロ) 他タスク内で定義されていて、その命令を実行
するまでにそのデータが確定している命令は予測対象と
しない(図2の(3)の場合は予測対象としない)。
(A) Instructions defined in the invoking task are not to be predicted (in the case of (2) in FIG. 2, they are not to be predicted). (B) Instructions that are defined in other tasks and whose data are determined before the execution of the instruction are not to be predicted (in the case of (3) in FIG. 2, are not to be predicted).

【0024】(ハ) 他タスク内で定義されていて、そ
の命令を実行するときでも、そのデータが確定しない命
令は予測対象とする(図2の(1)の場合は予測対象と
する)。
(C) An instruction which is defined in another task and whose data is not determined even when the instruction is executed is to be predicted (in the case of (1) in FIG. 2, it is to be predicted).

【0025】(ニ) 尚、後述する図8で説明するよう
に、(ハ)の命令についてデータを予測して実際にシミ
ュレーション実行して予測結果の正解率が高い命令のみ
を予測対象とし、正確率が低い命令を予測対象から外す
ようにしてもよい。
(D) As will be described later with reference to FIG. 8, the data of the instruction (c) is predicted, the simulation is actually executed, and only the instruction having a high accuracy rate of the prediction result is set as a prediction target, and Instructions with a low rate may be excluded from prediction targets.

【0026】図3は、本発明の説明図(その2)を示
す。これは、図2のタスクB上で動作するソースイメー
ジプログラムの例を示す。ここでは、例えば図2のタス
クB上で実行される行番号001は、001 add
%rz,%ry,4となる。001は行番号であり、a
ddは加算命令であり、%rz,%ry,4はレジスタ
ryの内容(y)に4を加算してその結果をレジスタr
zに格納するものである。同様に、行番号121、20
0は、ST(ストア命令)、ld(ロード命令)につい
て記述したものである。
FIG. 3 is an explanatory view (part 2) of the present invention. This shows an example of a source image program that runs on task B in FIG. Here, for example, the line number 001 executed on the task B in FIG. 2 is 001 add
% Rz,% ry, 4. 001 is a line number, a
dd is an addition instruction, and% rz,% ry, 4 add 4 to the contents (y) of the register ry and store the result in the register r.
z. Similarly, line numbers 121 and 20
0 describes ST (store instruction) and ld (load instruction).

【0027】図4は、本発明のプロファイルイメージテ
ーブル例を示す。これは、データ依存関係にある命令を
ソースプログラムから抽出して登録したものであって、
図2の行番号001、002、003のものを登録した
ものである。例えば プログラムカウンタ 依存命令1 依存命令2 依存命令3 001 101 − − は、図2のタスクBで実行される行番号001の命令で
あって、データ依存関係の1番目が行番号101である
旨を表す。データ依存関係の2番目、3番目はここでは
なしである。行番号200の命令は、データ依存関係の
ある命令が1番目(依存命令1)150(レジスタr
2)、2番目(依存命令2)130(レジスタr3)、
3番目(依存命令3)121(レジスタr8)の3つが
ある。
FIG. 4 shows an example of a profile image table according to the present invention. This is a data-dependent instruction extracted from the source program and registered.
2 are registered in the row numbers 001, 002, and 003 of FIG. For example, the program counter dependent instruction 1 dependent instruction 2 dependent instruction 3 001 101 --- is the instruction of the line number 001 executed by the task B in FIG. Represent. The second and third data dependencies are none here. The instruction of line number 200 is the first instruction having a data dependency (dependent instruction 1) 150 (register r
2) second (dependent instruction 2) 130 (register r3),
Third (dependent instruction 3) 121 (register r8).

【0028】以上のように、コンパイル時に命令の行番
号に対応づけてデータ依存関係のある他の命令の行番号
を抽出して登録することにより、データ依存関係にある
命令についてのみデータの値を予測して先行実行するこ
とが可能となる。
As described above, by extracting and registering the line numbers of other instructions having a data dependency at the time of compiling at the time of compiling, the data value can be changed only for the instructions having the data dependency. It is possible to predict and execute in advance.

【0029】図5は、本発明の実行形式バイナリ例を示
す。これは、実行形式のバイナリであって、図示の下記
の項目を登録したものである。 アドレス 命令コード 依存命令1、依存命令2、依存命令3 予測フラグ 001 add %rz,%ry,4 101 − − 1(予測) 002 add %rz,%rz,z − − − 0(非予測) 003 add %rx,%rx,5 100 − − 0(非予測) 以上のようにデータ依存関係にあるアドレス(行番
号)、命令コード、依存命令1〜3、予測フラグfをコ
ンパイル時に登録しておくことにより、実行時に予測フ
ラグが1(予測)のみの命令についてデータの値を予測
して先行実行することにより、選択的に静的予測した結
果をもとに効率的に実行時にデータ依存関係にある命令
を先行実行し、CPUの高速実行を実現することが可能
となる。
FIG. 5 shows an example of an executable binary of the present invention. This is an executable binary, in which the following items shown in the figure are registered. Address Instruction code Dependent instruction 1, Dependent instruction 2, Dependent instruction 3 Prediction flag 001 add% rz,% ry, 4 101--1 (prediction) 002 add% rz,% rz, z---0 (non-prediction) 003 add% rx,% rx, 5 100 --0 (non-prediction) As described above, the address (line number), instruction code, dependent instructions 1 to 3 and prediction flag f that have a data dependency are registered at the time of compilation. Thus, by predicting the value of the data for an instruction whose prediction flag is only 1 (prediction) at the time of execution and executing the instruction in advance, the data dependency is efficiently reduced at the time of execution based on the result of the selective static prediction. It is possible to execute a certain instruction in advance and realize high-speed execution of the CPU.

【0030】図6は、本発明の他のシステム構成図を示
す。これは、実行時に後述する図8に示すように、PC
(プログラムカウンタ)に設定されたアドレス(行番
号)とタグとを比較して一致するときにヒット、一致す
るものみつからないときにミスヒットを出力し、ヒット
のときは更に値と差分を読み出して演算器によって演算
(ここでは、例えば加算)して予測値を算出するハード
イメージである。
FIG. 6 shows another system configuration diagram of the present invention. This is performed at the time of execution, as shown in FIG.
The address (line number) set in the (program counter) is compared with the tag to output a hit when they match, and to output a mishit when they do not match, and to read out the value and difference when a hit occurs. This is a hardware image in which a prediction value is calculated by performing a calculation (here, for example, addition) by a calculator.

【0031】以上の構成により、図5で予測フラグが1
(予測)とした命令のアドレスとそのときの変数のデー
タの値、および前前回と前回との差分を高速に読み出
し、データ依存関係にある変数の値を予測して先行実行
することが可能となる。以下実行時の動作を順次詳細に
説明する。
With the above configuration, the prediction flag is set to 1 in FIG.
It is possible to read out the address of the instruction set as (predicted), the value of the data of the variable at that time, and the difference between the previous and previous times at a high speed, predict the value of the variable having a data dependency, and execute the preceding execution. Become. Hereinafter, the operation at the time of execution will be sequentially described in detail.

【0032】図7は、本発明の説明図(その3、実行
時)を示す。これは、PC(プログラムカウンタ)に行
番号001が設定され、図2のPE(B)上で動作する
タスクBが行番号001でz=y+4を実行しようとし
たときの様子を示す。
FIG. 7 is an explanatory diagram of the present invention (No. 3, execution). This shows a state in which the line number 001 is set in the PC (program counter), and the task B operating on the PE (B) in FIG. 2 tries to execute z = y + 4 with the line number 001.

【0033】初期値は、データ依存関係にある行番号0
01の命令の変数yの初期値が0であることを表す。1
回目は、データ依存関係にある行番号001の命令の変
数yの実行結果が8となったことを表す。
The initial value is the row number 0 which has a data dependency.
It indicates that the initial value of the variable y of the instruction 01 is 0. 1
The third time indicates that the execution result of the variable y of the instruction of the line number 001 having the data dependency relationship is 8.

【0034】2回目は、データ依存関係にある行番号0
01の命令の変数yの予測の例を表す。(a)は、2回
目に予測した値y=16(1回目の値に差分を加算した
8+8=16)と実際に実行したyの値16とが一致し
て正解の場合を表す。この場合には、図示の下記のよう
に更新する。
The second time, the line number 0 having a data dependency
13 shows an example of prediction of a variable y of the 01 instruction. (A) shows the case where the value y = 16 predicted at the second time (8 + 8 = 16 obtained by adding the difference to the value at the first time) coincides with the value 16 of the actually executed y and is correct. In this case, updating is performed as shown below.

【0035】 PC 値 差分 001 16 8 (b)は、2回目に予測した値y=16(1回目の値に
差分を加算した8+8=16)と実際に実行したyの値
8とが不一致で不正解の場合を表す。この場合には、図
示の下記のように更新する。
The PC value difference 001 16 8 (b) indicates that the second predicted value y = 16 (8 + 8 = 16 obtained by adding the difference to the first time value) does not match the actually executed y value 8. Indicates an incorrect answer. In this case, updating is performed as shown below.

【0036】 PC 値 差分 001 8 0 以上のように、初期値をもとに1回目の値を予測して実
際の実行結果と一致したときにそのときの値および前回
との差分を登録することを繰り返すと、後述する図8に
示すようなテーブルを作成することが可能となる。そし
て、正解のときに予測した実行結果が正しいのでそれに
続く処理を実行することが可能となり、一方、不正解の
ときに予測の結果をキャンセルして確定した変数の値で
再実行する。これにより、実行時に正解となる値および
差分が図8のテーブルに示すように登録され、当該正解
数の割合が所定閾値(例えば60%以上)の命令の予測
を行い、それ以外の命令の予測を抑止することで、予測
率の確率を向上させてキャンセル率を小さくして全体の
実行速度を大幅に向上させることが可能となる。
PC value difference 001 8 0 As described above, the first value is predicted based on the initial value, and when it matches the actual execution result, the value at that time and the difference from the previous time are registered. Is repeated, a table as shown in FIG. 8 to be described later can be created. Then, since the execution result predicted at the time of the correct answer is correct, the subsequent processing can be executed. On the other hand, at the time of the incorrect answer, the result of the prediction is canceled and re-executed with the determined variable value. As a result, the value and the difference that become correct at the time of execution are registered as shown in the table of FIG. 8, the ratio of the number of correct answers is predicted for a predetermined threshold value (for example, 60% or more), and the prediction of other instructions is performed. Is suppressed, the probability of the prediction rate is improved, the cancellation rate is reduced, and the overall execution speed can be greatly improved.

【0037】図8は、本発明の説明図(その4、実行
時)を示す。これは、既述した図7の手順によって予測
対象の命令(命令の行番号)について正解のときの変数
の値および前回との差分を登録したリストであり、正解
と不正解の数を集計して正解率が所定閾値(例えば60
%以上)の命令のみを残し他の命令の予測フラグを0
(非予測)に設定し、動的に統計を集計してデータ依存
関係にあるデータの予測の正解率を向上させて高速実行
させることを動的に制御することが可能となる。ここで
は、PC=001(行番号001)についてn回実行
し、正解が13974回、不正解が64回となり、正解
率が60%以上であるので、データの依存関係にある命
令(行番号001の命令)のデータ予測を行う。一方、
PC=002(行番号002)についてn回実行し、正
解が21回、不正解が17365回となり、正解率が6
0%以下であるので、データの依存関係にある命令(行
番号002の命令)のデータ予測を抑止し、キャンセル
による不要な負荷による処理速度の低下を防止すること
を実行時に動的に行うことが可能となる。
FIG. 8 is an explanatory diagram (No. 4, during execution) of the present invention. This is a list in which the values of variables at the time of the correct answer and the difference from the previous time are registered for the instruction (the line number of the instruction) to be predicted by the procedure of FIG. The correct answer rate is a predetermined threshold (for example, 60
% Or more) and the prediction flag of other instructions is set to 0.
(Non-prediction) is set, and it is possible to dynamically collect statistics and dynamically increase the accuracy rate of prediction of data having a data dependency to perform high-speed execution. Here, PC = 001 (line number 001) is executed n times, the correct answer is 13974 times, the incorrect answer is 64 times, and the correct answer rate is 60% or more. Instruction). on the other hand,
PC = 002 (line number 002) is executed n times, the number of correct answers is 21 times, the number of incorrect answers is 17365 times, and the correct answer rate is 6
Since it is 0% or less, the data prediction of the instruction having the data dependence (the instruction of the line number 002) is suppressed, and the processing speed is dynamically reduced at the time of execution to prevent the reduction in the processing speed due to the unnecessary load due to the cancellation. Becomes possible.

【0038】図9は、本発明の1実施例構成図を示す。
図9の(a)は、実行オブジェクトの各PE#1から#
4への割り振りの様子を示す。ここでは、図示のよう
に、実行オブジェクトを4台のPE#1から#4に割り
振ると共に、このときに各アドレス(行番号)に対応づ
けて既述したデータ依存関係にある命令のアドレス(行
番号)を依存命令1、2、3に登録しておく(コンパイ
ル時に収集して登録しておく)。これら4台のPE#1
から#4にそれぞれ割り振られた実行オブジェクトは、
逐次(b)のPE#1から#4によって実行する。
FIG. 9 is a block diagram showing one embodiment of the present invention.
FIG. 9A shows each of PE # 1 to PE # of the execution object.
The state of allocation to No. 4 is shown. Here, as shown in the figure, the execution objects are allocated to the four PEs # 1 to # 4, and at this time, the addresses (line numbers) of the instructions having the data dependency described above in association with each address (line number) are assigned. No.) are registered in the dependent instructions 1, 2, and 3 (collected and registered at the time of compilation). These four PE # 1
The execution objects respectively assigned to to # 4 are
It is sequentially executed by PEs # 1 to # 4 in (b).

【0039】図9の(b)は、4台のPE#1から#4
によってそれぞれ実行オブジェクトを実行するときの処
理を示す。ここでは、各PE#1から#4では、データ
依存ありがYES、依存解決済みがNOの場合には、変
数の値を予測し、この予測した値をもとに実行オブジェ
クトをそれぞれ実行する。
FIG. 9B shows four PEs # 1 to # 4.
Shows the processing when each execution object is executed. Here, in each of the PEs # 1 to # 4, if the data dependence is YES and the dependency solved is NO, the values of the variables are predicted, and the execution objects are respectively executed based on the predicted values.

【0040】以上のように、実行オブジェクトを各PE
#1から#4に割り振り、各PE#1から#4でデータ
依存ありがYES、依存解決済みがNOの場合に、変数
の値を予測し、この予測した値をもとに実行オブジェク
トをそれぞれ実行することにより、データ依存関係にあ
る命令を正解率高く先行実行し、処理速度を高速化する
ことが可能となる。
As described above, the execution object is
If the data is allocated to # 1 to # 4 and the data dependencies are YES in each of PEs # 1 to # 4, and if the dependency has been resolved is NO, the value of the variable is predicted, and the execution object is determined based on the predicted value. By executing, it is possible to precedely execute instructions having a data dependency with a high correct answer rate and to increase the processing speed.

【0041】図10は、本発明の他の動作説明フローチ
ャートを示す。これは、既述したデータ依存関係にある
命令の変数の値の予測を動的に決定するときのフローチ
ャートである。
FIG. 10 is a flowchart illustrating another operation of the present invention. This is a flowchart when dynamically predicting the value of a variable of an instruction having a data dependency described above.

【0042】図10において、S1は、依存ありか判別
する。これは、例えば既述した図9の(a)で各PEに
割り振られた実行オブジェクトに依存命令1、2、3の
いずれかが設定され、実行しようとする命令にデータ依
存関係があるか判別する。YESの場合には、データ依
存関係があると判明したので、S2に進む。NOの場合
には、データ依存関係がないと判明したので、S5で予
測フラグを0(非予測)にセットする。
In FIG. 10, S1 determines whether there is any dependency. This is because, for example, one of the dependent instructions 1, 2, and 3 is set in the execution object allocated to each PE in FIG. 9A, and it is determined whether the instruction to be executed has a data dependency. I do. In the case of YES, it is determined that there is a data dependency, and the process proceeds to S2. In the case of NO, it is determined that there is no data dependency, so the prediction flag is set to 0 (non-prediction) in S5.

【0043】S2は、データ依存関係があったが解消し
たか判別する。YESの場合には、データ依存関係が解
消したのでS6で予測フラグを0(非予測)にセットす
る。NOの場合には、データ依存関係が解消していない
ので、S3に進む。
In step S2, it is determined whether or not the data dependency exists but has been resolved. In the case of YES, since the data dependency has been resolved, the prediction flag is set to 0 (non-prediction) in S6. In the case of NO, the process proceeds to S3 because the data dependency has not been resolved.

【0044】S3は、変数の値の予測した結果の正解率
が高いか判別する。これは、命令の変数の値の予測を行
ってその結果を既述した図8に示すように収集してその
正解率が高い(例えば60%以上)のときにデータ予測
して高速化できると判明したので、S4で命令の変数の
データの値を予測する。一方、NOの場合には、正解率
が低く、キャンセルに伴う処理が発生し、予測を行うと
処理速度がそのために低下してしまうので、S7で予測
フラグを0(非予測)にセットする。
In step S3, it is determined whether or not the correct answer rate of the result of predicting the value of the variable is high. This is because if the value of the instruction variable is predicted and the result is collected as shown in FIG. 8 and the data is predicted when the correct answer rate is high (for example, 60% or more), the speed can be increased. Since it is found, the value of the data of the variable of the instruction is predicted in S4. On the other hand, in the case of NO, the correct answer rate is low, processing accompanying the cancellation occurs, and if the prediction is performed, the processing speed is reduced. Therefore, the prediction flag is set to 0 (non-prediction) in S7.

【0045】以上のように、実行時に動的にデータの依
存関係があり、データの依存関係が解消していなく、か
つデータ予測したときの正解率が高いときに命令の変数
のデータの値の予測を行い、それ以外の命令についてデ
ータの予測を抑止し、命令の実行速度を動的に解析して
効率的に高速化を図ることが可能となる。
As described above, there is a dynamic data dependency at the time of execution, and when the data dependency is not resolved and the accuracy rate at the time of data prediction is high, the value of the data of the instruction variable is high. Prediction is performed, data prediction is suppressed for the other instructions, and the execution speed of the instruction is dynamically analyzed to efficiently increase the speed.

【0046】図11は、本発明の予測正解率例を示す。
これは、ベンチマークプログラムSC(SPECint
92、System Perfomance Evaluation Cooperative)を
シミュレート実行したときのデータであって、横軸が各
種処理を行うプログラムなどをを表し、縦軸が予測正解
率を表す。図中の棒グラフの横線の部分がLOAD命令
の部分を表し、横線の部分がSTORE命令の部分を表
し、点々の部分がOTHERS(LAAD、STORE
などのメモリアクセス命令以外の命令)の部分を表す。
図中の記号は下記を表す。
FIG. 11 shows an example of the predicted correct answer rate of the present invention.
This is the benchmark program SC (SPECint
92, which is data obtained when a simulation of System Performance Evaluation Cooperative) is performed. The horizontal axis represents a program for performing various processes, and the vertical axis represents a predicted correct answer rate. The horizontal line portion of the bar graph in the figure represents the LOAD instruction portion, the horizontal line portion represents the STORE instruction portion, and the dotted portions represent OTHERS (LAAD, STORE).
Instruction other than the memory access instruction).
The symbols in the figure represent the following.

【0047】 comp:compress(圧縮プログラム) eqn :eqntott(Cプログラム) esp :espresse gcc :コンパイラ li :lispインタプリタで9クイーン問題を解
く sc :スプレッドシート ave :平均 図12は、本発明の選択的値予測の対象命令と非対象命
令例(%)を表す。これは、図11で既述したベンチマ
ークプログラムSCを分類したものであって、図示の下
記の項目に分類したものである。
Comp: compress (compression program) eqn: eqnottt (C program) esp: epresse gcc: Compiler li: Solving 9 queens problem with lisp interpreter sc: Spreadsheet ave: Average FIG. 12 shows selective values of the present invention. Indicates the target instruction and the non-target instruction example (%) of the prediction. This is a classification of the benchmark program SC already described in FIG. 11, and is classified into the following items shown in the figure.

【0048】 ・依存無し(データ依存関係がない場合): ・解決済み(データ依存関係はあるが実行時までに解決
済みの場合): ・予測対象(データ依存関係があり、解決済みでない場
合):本願発明の命令のデータの値の予測対象となる命
令 ・load:データをメモリにロードする命令 ・store:メモリからデータをレジスタにストアす
る命令 ・others:load、storeのメモリアクセ
ス命令以外の命令 ここで、左側に記載した(1)は、図2の(1)に対応
して、データ依存関係を予測する対象の割合(%)であ
る。
No dependency (when there is no data dependency): Solved (when there is data dependency but it has been solved by the time of execution): Prediction target (when there is data dependency and it has not been solved) : Instruction for which the value of the data of the instruction of the present invention is to be predicted ・ load: Instruction for loading data into memory ・ store: Instruction for storing data from memory to register ・ others: Instruction other than load and store memory access instructions Here, (1) described on the left side corresponds to (1) in FIG. 2 and is a ratio (%) of an object whose data dependency is predicted.

【0049】(2)は、図2の(2)に対応して、デー
タ依存関係がない命令の割合(%)である。(3)は、
図2の(3)に対応して、データ依存関係があるか命令
の実際の実行時までに解決してデータの値が確定してい
る命令の割合(%)である。
(2) is the ratio (%) of instructions having no data dependency, corresponding to (2) in FIG. (3)
Corresponding to (3) in FIG. 2, this is the ratio (%) of instructions for which there is a data dependency or for which the value of the data is resolved by the time of actual execution of the instruction.

【0050】従って、ベンチマークプログラムSCで
は、予測対象は、comp、eqn、esp、gcc、
li、sc、Aveで9.2〜11.6%の間の割合で
あり、これらについて選択的に命令の変数の値の予測を
行い、むやみに予測する際のキャンセルに伴う処理の低
下を無くし、予測したときに高速化される可能性の高い
もののみのデータ依存関係にある命令の変数の値を予測
して先行実行することが可能となる。更に、load命
令やstore命令のメモリアクセスは実行速度が遅く
先行実行するメリットが高いので、当該メモリアクセス
命令(load命令、store命令)を予測対象とし
て選択し、データ依存関係にある命令の変数の値を予測
して先行実行するようにしてもよい。
Therefore, in the benchmark program SC, the prediction targets are comp, eqn, esp, gcc,
The ratio of li, sc, and Ave is between 9.2 and 11.6%. For these, the values of instruction variables are selectively predicted, and the reduction in processing due to the cancellation when predicting unnecessarily is eliminated. In addition, it becomes possible to predict the value of a variable of an instruction that has a data dependency of only one that is likely to be speeded up when predicted and execute it in advance. Further, since the memory access of the load instruction and the store instruction has a merit that the execution speed is slow and the preceding execution is high, the memory access instruction (the load instruction and the store instruction) is selected as a prediction target, and the variable of the instruction having the data dependency is selected. The value may be predicted and executed in advance.

【0051】図13は、本発明の実行時間例を示す。こ
れは、既述したベンチマークプログラムSCの各プログ
ラムをシミュレート実行したときの時間を表し、横軸が
各種処理を行うプログラムなどを表し、縦軸が実行時間
(Kサイクル)を表す。図中の棒グラフの左側が予測な
し、中央が予測あり、右側が完全予測(予測が全部正解
の場合)を表す。例えばscの場合には、予測なしの場
合に比して、本願発明の予測を行うと、20.9%の時
間(サイクル数)だけ高速化できることが判明した。詳
細に説明すれば、ベンチマークプログラムSC中に含ま
れる9.2%のsc(スプレッドシート)の命令を予測
対象とし、約20.9%のサイクル数だけ高速化できる
ことが判明した。この際、予測を全て正解とすると、約
34.5%のサイクル数だけ高速化できるとシミュレー
トできた。ベンチマークプログラム中の他のプログラム
についても図12に示す全体に対するそれぞれの割合に
対し、図13の中央の予測ありのサイクル数に高速化で
きる。
FIG. 13 shows an example of the execution time of the present invention. This represents the time when each of the benchmark programs SC described above is simulated and executed, the horizontal axis represents a program for performing various processes, and the vertical axis represents the execution time (K cycles). The left side of the bar graph in the figure indicates no prediction, the center indicates prediction, and the right side indicates perfect prediction (when all predictions are correct). For example, in the case of sc, it has been found that, when the prediction of the present invention is performed, the speed can be increased by 20.9% of the time (the number of cycles) as compared with the case without prediction. More specifically, it has been found that 9.2% sc (spreadsheet) instructions included in the benchmark program SC can be predicted, and the speed can be increased by about 20.9% of the number of cycles. At this time, if all the predictions were correct, it could be simulated that the speed could be increased by about 34.5% of the number of cycles. For other programs in the benchmark program, the speed can be increased to the number of cycles with prediction in the center of FIG. 13 for each ratio to the whole shown in FIG.

【0052】[0052]

【発明の効果】以上説明したように、本発明によれば、
ソースプログラムのコンパイル時にデータ依存関係の情
報を抽出して静的予測を行うと共に実行時にデータ依存
関係があり実行時までに解決されなくて予測確率の高い
命令を動的予測して選択実行する構成を採用しているた
め、データ依存関係にあるプログラムを高速実行する装
置を実現できる。
As described above, according to the present invention,
A configuration in which information on data dependence is extracted at the time of compiling a source program to perform static prediction, and at the time of execution, an instruction which has a data dependence and is not resolved by execution and has a high prediction probability is dynamically predicted and selected for execution. Therefore, a device that executes a program having a data dependency at a high speed can be realized.

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

【図1】本発明のシステム構成図である。FIG. 1 is a system configuration diagram of the present invention.

【図2】本発明の説明図(その1)である。FIG. 2 is an explanatory view (No. 1) of the present invention.

【図3】本発明の説明図(その2)である。FIG. 3 is an explanatory view (No. 2) of the present invention.

【図4】本発明のプロファイルイメージテーブル例であ
る。
FIG. 4 is an example of a profile image table according to the present invention.

【図5】本発明の実行形式バイナリ例である。FIG. 5 is an example of an executable binary of the present invention.

【図6】本発明の他のシステム構成図である。FIG. 6 is another system configuration diagram of the present invention.

【図7】本発明の説明図(その3、実行時)である。FIG. 7 is an explanatory diagram of the present invention (No. 3, execution).

【図8】本発明の説明図(その4、実行時)である。FIG. 8 is an explanatory diagram (No. 4, execution) of the present invention.

【図9】本発明の1実施例構成図である。FIG. 9 is a configuration diagram of one embodiment of the present invention.

【図10】本発明の他の動作説明フローチャートであ
る。
FIG. 10 is a flowchart illustrating another operation of the present invention.

【図11】本発明の予測正解率例である。FIG. 11 is an example of a predicted correct answer rate according to the present invention.

【図12】本発明の選択的値予測の対象命令と非対象命
令例である。
FIG. 12 is an example of a target instruction and a non-target instruction for selective value prediction according to the present invention.

【図13】本発明の実行時間例である。FIG. 13 is an example of execution time of the present invention.

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

1:ソースコード 2、6:コンパイラ 3:バイナリ 4:シミュレータ 5:プロファイルイメージテーブル 7:実行形式バイナリ 1: Source code 2, 6: Compiler 3: Binary 4: Simulator 5: Profile image table 7: Executable binary

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】ソースプログラムを解析して予測を行う高
速演算処理装置において、 ソースプログラムを解析する手段と、 上記解析した結果をもとに行番号に対応づけてデータ依
存関係にある命令をテーブルに設定する手段と、 上記設定したデータ依存関係にある命令のうちデータ予
測対象の命令の予測フラグをONに設定する手段とを備
えたことを特徴とする高速演算処理装置。
1. A high-speed processing apparatus for analyzing and predicting a source program, comprising: means for analyzing the source program; and a table for storing an instruction having a data dependency in association with a line number based on the result of the analysis. And a means for setting a prediction flag of an instruction of a data prediction target among the instructions having the data dependence set to ON.
【請求項2】上記予測フラグをONに設定する命令とし
て、自タスク内でデータが決定される命令を除いた命令
としたことを特徴とする請求項1記載の高速演算処理装
置。
2. The high-speed arithmetic processing device according to claim 1, wherein the instruction for setting the prediction flag to ON is an instruction excluding an instruction whose data is determined in its own task.
【請求項3】上記予測フラグをONに設定する命令とし
て、他タスク内でデータが決定されるが命令実行時まで
に確定している命令を除いた命令としたことを特徴とす
る請求項1あるいは請求項2記載の高速演算処理装置。
3. An instruction for setting the prediction flag to ON, wherein the instruction excludes an instruction whose data is determined in another task but which is determined by the time of execution of the instruction. Alternatively, the high-speed processing device according to claim 2.
【請求項4】ソースプログラムをコンパイルした実行可
能形式の命令を高速実行する高速演算処理装置におい
て、 実行可能形式の命令の実行時に、データ依存関係にある
命令を設定したテーブルを参照してデータの値を予測し
て先行実行する手段と、 上記動的予測の結果の集計を行い予測の正解率の低い命
令の先行実行を抑止する手段とを備えたことを特徴とす
る高速演算処理装置。
4. A high-speed processing apparatus for executing an executable-format instruction obtained by compiling a source program at a high speed, comprising the steps of: executing an executable-format instruction by referring to a table in which data-dependent instructions are set; A high-speed processing apparatus comprising: means for predicting a value and executing the result in advance; and means for summing up the results of the dynamic prediction and suppressing the advance execution of an instruction having a low accuracy rate of the prediction.
【請求項5】上記動的予測の結果の集計として、予測結
果が正解のときに正解フラグに+1、不正解のときに不
正解フラグを+1して正解率を集計することを特徴とす
る請求項4記載の高速演算処理装置。
5. The total of the results of the dynamic prediction, wherein the correct answer flag is incremented by +1 when the predicted result is correct, and the incorrect flag is incremented by +1 when the predicted result is incorrect, and the correct answer rate is totaled. Item 5. A high-speed processing device according to item 4.
【請求項6】上記データ依存関係にある命令として、メ
モリアクセス命令としたことを特徴とする請求項1から
請求項5のいずれかに記載の高速演算処理装置。
6. The high-speed processing device according to claim 1, wherein the instruction having the data dependency is a memory access instruction.
【請求項7】ソースプログラムを解析する手段と、 上記解析した結果をもとに行番号に対応づけてデータ依
存関係にある命令をテーブルに設定する手段と、 上記設定したデータ依存関係にある命令のうちデータ予
測対象の命令の予測フラグをONに設定する手段ととし
て機能させるプログラムを記録したコンピュータ読取可
能な記録媒体。
7. A means for analyzing a source program, means for setting an instruction having a data dependency in a table in association with a line number based on the result of the analysis, and an instruction having a data dependency set in the table A computer-readable recording medium on which a program for functioning as a means for setting a prediction flag of an instruction of a data prediction target to ON is recorded.
【請求項8】実行可能形式の命令の実行時に、データ依
存関係にある命令を設定したテーブルを参照してデータ
の値を予測して先行実行する手段と、 上記動的予測の結果の集計を行い予測の正解率の低い命
令の先行実行を抑止する手段ととして機能させるプログ
ラムを記録したコンピュータ読取可能な記録媒体。
8. A means for predicting the value of data with reference to a table in which instructions having a data dependence are set when executing an instruction in an executable format, and executing a preceding execution. A computer-readable recording medium in which a program for functioning as a means for suppressing an advance execution of an instruction having a low accuracy rate of a predicted prediction is recorded.
JP10220329A 1998-08-04 1998-08-04 High-speed arithmetic processor and recording medium Withdrawn JP2000056971A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10220329A JP2000056971A (en) 1998-08-04 1998-08-04 High-speed arithmetic processor and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10220329A JP2000056971A (en) 1998-08-04 1998-08-04 High-speed arithmetic processor and recording medium

Publications (1)

Publication Number Publication Date
JP2000056971A true JP2000056971A (en) 2000-02-25

Family

ID=16749447

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10220329A Withdrawn JP2000056971A (en) 1998-08-04 1998-08-04 High-speed arithmetic processor and recording medium

Country Status (1)

Country Link
JP (1) JP2000056971A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5146444B2 (en) * 2007-03-20 2013-02-20 富士通株式会社 Multiprocessor system and control method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5146444B2 (en) * 2007-03-20 2013-02-20 富士通株式会社 Multiprocessor system and control method thereof

Similar Documents

Publication Publication Date Title
US10402177B2 (en) Methods and systems to vectorize scalar computer program loops having loop-carried dependences
US11216258B2 (en) Direct function call substitution using preprocessor
JP5707011B2 (en) Integrated branch destination / predicate prediction
US5790862A (en) Resource assigning apparatus which assigns the variable in a program to resources
US6487715B1 (en) Dynamic code motion optimization and path tracing
JP4844971B2 (en) Method and apparatus for performing interpreter optimization during program code conversion
US20080288930A1 (en) Computer-Implemented Method and System for Improved Data Flow Analysis and Optimization
US6925639B2 (en) Method and system for register allocation
US10430191B2 (en) Methods and apparatus to compile instructions for a vector of instruction pointers processor architecture to enable speculative execution and avoid data corruption
US20050028148A1 (en) Method for dynamic recompilation of a program
US7712091B2 (en) Method for predicate promotion in a software loop
US20050071825A1 (en) Combinational approach for developing building blocks of DSP compiler
JP2018028777A (en) Emulation device, emulation method, and emulation program
JP3539613B2 (en) Array summary analysis method for loops containing loop jump statements
US9720663B2 (en) Methods, systems and apparatus to optimize sparse matrix applications
US9552250B2 (en) Detecting X86 CPU register corruption from kernel crash dumps
JP2000056971A (en) High-speed arithmetic processor and recording medium
US7774766B2 (en) Method and system for performing reassociation in software loops
JPWO2017204139A1 (en) Data processing apparatus, data processing method, and program recording medium
JP2002014868A (en) Microprocessor having memory referring operation detecting mechanism and compile method
US8572594B2 (en) Invasion analysis to identify open types
CN111857815A (en) Instruction processing method and device
KR102207775B1 (en) Method for Static Analysis based on Data Dependence on Data Plane Towards Network Switch Parallelization, and Parallelization Apparatus using the same
EP4113283A1 (en) Compilation system and method
Best et al. Synchronization via scheduling: managing shared state in video games

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20051004