JP2012216009A - Method for increasing speed of program by performing overtaking control of memory access instruction - Google Patents

Method for increasing speed of program by performing overtaking control of memory access instruction Download PDF

Info

Publication number
JP2012216009A
JP2012216009A JP2011080035A JP2011080035A JP2012216009A JP 2012216009 A JP2012216009 A JP 2012216009A JP 2011080035 A JP2011080035 A JP 2011080035A JP 2011080035 A JP2011080035 A JP 2011080035A JP 2012216009 A JP2012216009 A JP 2012216009A
Authority
JP
Japan
Prior art keywords
instruction
overtaking
block
permission flag
entry
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
JP2011080035A
Other languages
Japanese (ja)
Inventor
Shukuyu Kudo
淑裕 工藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2011080035A priority Critical patent/JP2012216009A/en
Publication of JP2012216009A publication Critical patent/JP2012216009A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a method for performing a program at high speed.SOLUTION: A program performing system comprises: a CPU having a store instruction including an overtaking permitting flag showing overtaking permission/non-permission of a load instruction and an instruction set including an instruction for blocking overtaking of the load instruction; a compiler having overtaking permitting flag setting means for setting the flag and overtaking blocking instruction creating means for creating the instruction; and an instruction reorder unit having overtaking blocking instruction registering means for registering the instruction for blocking overtaking into an instruction reorder buffer and instruction by-pass means for registering a memory access instruction into the instruction reorder buffer while referring to the store instruction to which the overtaking permitting flag is set.

Description

本発明は、記憶装置にデータを書き込むないし記憶装置からデータを読み込む命令をもつCPUを利用する技術分野において、プログラムを高速に実行する技術に関する。   The present invention relates to a technique for executing a program at high speed in a technical field using a CPU having an instruction for writing data to a storage device or reading data from the storage device.

従来、命令レベルの並列性を高めてプログラムを高速実行するため、複数の命令パイプラインを実装したCPUがある。   Conventionally, there are CPUs equipped with a plurality of instruction pipelines in order to execute instructions at high speed by increasing instruction level parallelism.

図1は、従来例における命令パイプラインの流れを示す図である。命令パイプライン11は、基本的には、命令フェッチ12、命令デコード13、実行14、リード/ライト15の4つのステージで構成され、それらの各ステージはいくつか同時に処理できるようになっている。図1は二つの命令を同時処理可能な命令パイプラインの例である。メモリアクセス命令では、そのアドレス計算を実行ステージ14、メモリの読み込み/書き込みをリード/ライトステージ15で処理する。各ステージの前後には一時的な記憶域であるバッファが用意され、次のステージが処理可能になるまで、前ステージの結果がバッファ内で待たされる。   FIG. 1 is a diagram showing a flow of an instruction pipeline in a conventional example. The instruction pipeline 11 basically includes four stages of an instruction fetch 12, an instruction decode 13, an execution 14, and a read / write 15, and each of these stages can be processed simultaneously. FIG. 1 shows an example of an instruction pipeline capable of simultaneously processing two instructions. In the memory access instruction, the address calculation is processed in the execution stage 14, and the memory read / write is processed in the read / write stage 15. A buffer which is a temporary storage area is prepared before and after each stage, and the result of the previous stage is waited in the buffer until the next stage can be processed.

このような命令パイプラインを使って、メモリアクセス命令を同時に処理するとき、たとえばロード命令とストア命令でアクセスするメモリ領域が同じであるとき、それらの命令による読み込み/書き込みの順序関係が保たれなければ命令の正しい実行結果は得られない。このため、ロード命令、ストア命令のどちらか一方の命令は、リード/ライトステージ15の直前のバッファで待たされることになる。一般的に、メモリアクセス命令は実行に時間を要するため、それらの命令の結果を必要とする命令も同じように各ステージの前後のバッファ内で待たされる。このようにして、命令パイプラインの流れが止まってしまうことをパイプラインハザードと呼ぶ。   Using such an instruction pipeline, when memory access instructions are processed simultaneously, for example, when the memory area accessed by a load instruction and a store instruction is the same, the read / write order relationship by these instructions must be maintained. If this is the case, the correct execution result of the instruction cannot be obtained. Therefore, one of the load instruction and the store instruction is waited in the buffer immediately before the read / write stage 15. In general, since memory access instructions require time to execute, instructions that require the results of those instructions are similarly waited in buffers before and after each stage. Stopping the flow of the instruction pipeline in this way is called a pipeline hazard.

パイプラインハザードを避けて、プログラムを高速化するための方法として、リード/ライトステージの前後において、メモリアクセス命令のメモリ・ディスアンビギュエションを行い、あるメモリ領域に対するロード、ストアの順序関係を保ちながら、ロード命令をできるだけ先行して開始する方法がある。   As a method for avoiding pipeline hazards and speeding up the program, memory disambiguation of memory access instructions is performed before and after the read / write stage, and the order relationship between load and store for a certain memory area is determined. There is a way to start the load instruction as early as possible while keeping.

図2は、メモリアクセス命令のメモリ・ディスアンビギュエションを行い高速化するときの従来例を示す図である。同図の左上に示す6行の命令列は、命令パイプラインに入力される命令のアセンブライメージである。左端の列の数字21は、入力される順番であり、次の列22は、ロード、ストアのどちらであるかを示す。右列の中央部23はロード、ストアを行う領域のアドレスを示し、右端の数字24はロード、ストアするサイズを示す。アドレス計算ユニット25は、実行ステージ14に相当し、メモリアクセス命令のアクセスするメモリ領域のアドレスを計算する。命令デコードステージ13の結果が入力される。命令リオーダユニット26は、メモリ・ディスアンビギュエションを行いロード、ストア命令の実行順番を制御する。メモリアクセスユニット28は、リード/ライトステージ15に相当する。アドレス計算ユニット25、メモリアクセスユニット28は、二つの命令を同時に処理できるものとする。命令リオーダバッファ29は、命令パイプラインのリード/ライトステージ15の直前のバッファに相当する。   FIG. 2 is a diagram showing a conventional example in which memory disambiguation of a memory access instruction is performed to increase the speed. The six-row instruction sequence shown in the upper left of the figure is an assembler image of an instruction input to the instruction pipeline. The number 21 in the leftmost column indicates the input order, and the next column 22 indicates whether it is a load or a store. The central portion 23 of the right column indicates the address of the area where loading and storing are performed, and the number 24 at the right end indicates the size of loading and storing. The address calculation unit 25 corresponds to the execution stage 14 and calculates the address of the memory area accessed by the memory access instruction. The result of the instruction decode stage 13 is input. The instruction reorder unit 26 performs memory disambiguation and loads and controls the execution order of store instructions. The memory access unit 28 corresponds to the read / write stage 15. It is assumed that the address calculation unit 25 and the memory access unit 28 can process two instructions simultaneously. The instruction reorder buffer 29 corresponds to a buffer immediately before the read / write stage 15 of the instruction pipeline.

命令リオーダユニット26は、アドレス計算ユニット25から命令と計算されたアドレスを受け取ると命令リオーダバッファ29の空きエントリに登録する。図2の右下の表の行の一つ一つがエントリである。エントリが空いていない場合は空くまで待つ。命令リオーダバッファの一つのエントリには、エントリの「番号」211、ロード、ストアの「種別」212、ロード、ストアする「サイズ」213、計算された「アドレス」214、先行させなければならない命令に対応する命令リオーダバッファのエントリの番号である「先行N」(Nは1から命令リオーダバッファのエントリ数−1までの整数、図2の場合は1,2,3,4又は5のいずれか)215を登録する。「先行させなければならない命令」とは、当該命令の実行開始前に、実行完了していなければならない命令のことである。ここで、「実行完了」とは命令パイプラインのリード/ライトステージ15の完了を意味する。命令パイプラインの入力となっているアセンブライメージの、入力される順番21が4のストア命令218は、順番が1及び3のロード命令が終わる前にアドレス値address1を更新してはならないため、それらの実行完了を待たなければならない。このため、順番4の命令に対応する命令リオーダバッファの番号5のエントリ210の「先行1」、「先行2」には、順番1のロード命令に対応するエントリの番号「1」、順番3のロード命令に対応するエントリの番号「3」が登録される。また、2−1の入力される順番が6のロード命令217は、順番が4のストア命令218の実行完了前に実行を開始してはならないため、入力される順番が6のロード命令217に対応する命令リオーダバッファの番号4のエントリ216の「先行1」に、番号「5」が登録される。   When the instruction reorder unit 26 receives the instruction and the calculated address from the address calculation unit 25, the instruction reorder unit 26 registers it in the empty entry of the instruction reorder buffer 29. Each row in the lower right table of FIG. 2 is an entry. If the entry is not free, wait until it is free. One entry of the instruction reorder buffer includes an entry “number” 211, a load and store “type” 212, a load and store “size” 213, a calculated “address” 214, and an instruction to be preceded. “Leading N” which is the number of the corresponding instruction reorder buffer entry (N is an integer from 1 to the number of instruction reorder buffer entries−1, in the case of FIG. 2, one of 1, 2, 3, 4 or 5) 215 is registered. The “instruction that must be preceded” is an instruction that must be completed before the execution of the instruction starts. Here, “execution completion” means completion of the read / write stage 15 of the instruction pipeline. In the assembler image that is the input of the instruction pipeline, the store instruction 218 with the input order 21 of 4 must not update the address value address1 before the load instructions with the order 1 and 3 finish. You have to wait for the execution to complete. Therefore, the “preceding 1” and “preceding 2” of the entry 210 of the instruction reorder buffer number 5 corresponding to the instruction of order 4 include the number “1” of the entry corresponding to the load instruction of order 1 and the The entry number “3” corresponding to the load instruction is registered. Also, since the load instruction 217 whose order is 2-1 is input must not be started before the execution of the store instruction 218 whose order is 4 is completed, the load instruction 217 whose order is 6 is input. The number “5” is registered in “preceding 1” of the entry 216 of number 4 of the corresponding instruction reorder buffer.

命令リオーダユニット26は、すべての「先行N」に番号が設定されていない(命令リオーダバッファ29では「−」と表記。)エントリに対応する命令をメモリアクセスユニット28に渡す。メモリアクセスユニット28は、命令の実行が完了すると、命令リオーダユニット26に命令実行完了通知27を送る。命令実行完了通知27を受け取った命令リオーダユニット26は、完了した命令に対応する命令リオーダバッファのエントリをクリアして「空きエントリ」にするとともに、他のエントリの「先行N」に登録されていた当該エントリの番号をクリア(「−」に設定。)する。こうして命令リオーダバッファ29に空きができると、新たな命令を命令リオーダバッファに登録し、順次命令を実行している。   The instruction reorder unit 26 passes to the memory access unit 28 an instruction corresponding to an entry in which all “preceding N” numbers are not set (indicated as “−” in the instruction reorder buffer 29). When the execution of the instruction is completed, the memory access unit 28 sends an instruction execution completion notification 27 to the instruction reorder unit 26. The instruction reorder unit 26 that has received the instruction execution completion notification 27 clears the entry in the instruction reorder buffer corresponding to the completed instruction to become “empty entry” and is registered in “preceding N” of other entries. Clear the entry number (set to "-"). When the instruction reorder buffer 29 becomes free in this way, a new instruction is registered in the instruction reorder buffer, and instructions are sequentially executed.

また、SIMD(Single Instruction Multi Data)命令、ベクトル命令のような一つの命令で複数のメモリ領域に対してデータをロード、ストアする命令がある。   There are also instructions for loading and storing data in a plurality of memory areas with one instruction such as a SIMD (Single Instruction Multi Data) instruction and a vector instruction.

図3は、一つの命令で四つのメモリ領域にロード、ストアできるベクトル命令をもつ場合の従来例を示す図である。DOループ31は、ベクトル収集、ベクトル拡散を行うFortran言語で記述されている。DOループ31に対して、コンパイラは命令列32を生成する。レジスタ37のreg5は4つの値を保持できるレジスタ(ベクトルレジスタという。)である。レジスタreg1、reg2、reg3、reg4、及びreg6もベクトルレジスタである。ベクトルロード命令33は、配列IDX2,38の先頭がアドレス値address1のメモリ領域から、おのおののサイズが8バイトの、連続した4つのデータを1命令で読み込む命令である。図3は、命令列32の2回目の繰り返しの例であり、アドレスaddress1+0、address1+8、address1+16、address1+24のアドレスから値を読み込み、ベクトルレジスタreg1に書き込んでいる。ベクトルレジスタreg1,39には、4つの値2、5、6、6が書き込まれている。ベクトル収集命令34は、4つの値が書き込まれたベクトルレジスタreg1,39の値を元にアドレスを計算し、4つのメモリ領域から値を集める命令である。ベクトルレジスタreg1,39には、4つの値2、5、6、6が書き込まれているので、ベクトル収集命令34は、配列Y,310のアドレスaddress3+(2−1)×8、address3+(5−1)×8、address3+(6−1)×8から値を読み込み、ベクトルレジスタreg3,311に値を書き込んでいる。このようにして得た結果をもとにベクトル加算命令35が4つの加算を一命令で行い、その結果をベクトル拡散命令36がメモリに書き込む。   FIG. 3 is a diagram showing a conventional example in the case of having vector instructions that can be loaded and stored in four memory areas with one instruction. The DO loop 31 is described in the Fortran language that performs vector collection and vector diffusion. For the DO loop 31, the compiler generates an instruction sequence 32. Reg5 of the register 37 is a register (referred to as a vector register) that can hold four values. Registers reg1, reg2, reg3, reg4, and reg6 are also vector registers. The vector load instruction 33 is an instruction for reading four consecutive data pieces each having a size of 8 bytes from the memory area having the address value address1 at the top of the array IDX2, 38 with one instruction. FIG. 3 shows an example of the second repetition of the instruction sequence 32, in which values are read from the addresses of address address1 + 0, address1 + 8, address1 + 16, address1 + 24 and written to the vector register reg1. In the vector registers reg1, 39, four values 2, 5, 6, 6 are written. The vector collection instruction 34 is an instruction that calculates an address based on the values of the vector registers reg1 and 39 into which four values are written, and collects values from the four memory areas. Since four values 2, 5, 6, and 6 are written in the vector registers reg1 and 39, the vector collection instruction 34 uses the address address3 + (2-1) × 8, address3 + (5- 1) Values are read from x8, address3 + (6-1) x8, and values are written to vector registers reg3 and 311. Based on the result thus obtained, the vector addition instruction 35 performs four additions with one instruction, and the vector diffusion instruction 36 writes the result into the memory.

なお、特許文献1は、アドレス依存性チェックの際の処理待ちの発生を出来るだけ解消し、メモリへのアクセスが伴う処理を高速化する演算処理技術について記載されている。   Note that Patent Document 1 describes an arithmetic processing technique that eliminates as much as possible the waiting for processing during an address dependency check and speeds up processing involving access to a memory.

特開2009−026260号公報JP 2009-026260 A

しかしながら、メモリアクセス命令のメモリ・ディスアンビギュエションを行う場合には、前述のような仕組みであるため、先行して実行できるロード命令数を増やしプログラムを高速化するには、命令リオーダバッファ29のエントリ数、および、「先行N」215の列を増やすしかない。しかし、CPUの物理的な制約からそれらを増やすことは難しいという課題がある。また、それらが増えれば増えるほど、命令リオーダユニット26の処理量が増え、性能向上の度合いが減少するという課題がある。   However, since the memory disambiguation of the memory access instruction is performed as described above, the instruction reorder buffer 29 is used in order to increase the number of load instructions that can be executed in advance and increase the program speed. The number of entries and the column of “preceding N” 215 must be increased. However, there is a problem that it is difficult to increase them due to physical restrictions of the CPU. Further, there is a problem that as the number increases, the processing amount of the instruction reorder unit 26 increases and the degree of performance improvement decreases.

また、SIMD命令、ベクトル命令では、上述のような処理を行うので、それらがアクセスするすべてのメモリ領域ごとに先行させなければならない命令の完了を待ちあわせなければならない。そのため、ロード命令をできるだけ先行して開始しプログラムを高速化するには、図4のようにそれらの命令がアクセスするすべての領域のアドレスを命令リオーダバッファに登録しなければならなくなる。さらに、命令リオーダユニット26がアドレス計算の終わった命令を命令リオーダバッファに登録するとき、各エントリのすべてのアドレスを調べ先行させなければならない命令を得る必要があり、また、命令実行完了通知27を受け取ったときも各エントリのすべてのアドレスを調べ、クリアしなければならなくなる。このため、アドレスの登録領域が増加するだけでなく、調べるための時間も増加してしまうという課題があり、CPUの物理的制約、また、性能向上の恩恵も少ないことから、SIMD命令、ベクトル命令タイプのロード命令を先行して実行し、プログラムを高速化することはできない。   In addition, since the SIMD instruction and the vector instruction perform the processing as described above, it is necessary to wait for the completion of the instruction that must be preceded for every memory area to be accessed. Therefore, in order to start the load instruction as early as possible and speed up the program, it is necessary to register the addresses of all areas accessed by those instructions in the instruction reorder buffer as shown in FIG. Further, when the instruction reorder unit 26 registers an instruction for which address calculation has been completed in the instruction reorder buffer, it is necessary to check all addresses of each entry and obtain an instruction that must be preceded, and to issue an instruction execution completion notification 27. When received, all addresses in each entry must be examined and cleared. For this reason, there is a problem that not only the address registration area increases but also the time for checking increases, and the physical restrictions of the CPU and the benefits of performance improvement are few. Therefore, SIMD instructions and vector instructions It is not possible to speed up the program by executing the type of load instruction in advance.

本発明は、かかる実情に鑑み、ロード命令による追い越しの許可/不許可を示すフラグをもつストア命令、ロード命令の追い越しをブロックする命令を命令セットに含むCPUと、そのフラグの設定、命令を生成するコンパイラを提供することで、プログラムを高速に実行する手法を提供しようとするものである。   In view of such circumstances, the present invention provides a CPU including an instruction set that includes a store instruction having a flag indicating whether overtaking is permitted or not permitted by a load instruction, an instruction that blocks overtaking of a load instruction, setting of the flag, and generation of the instruction. By providing a compiler that does this, we intend to provide a method for executing a program at high speed.

本発明は、ロード命令の追い越しの許可/不許可を示す追い越し許可フラグをもつストア命令、ロード命令の追い越しをブロックする命令を含む命令セットをもつCPUと、そのフラグを設定する追い越し許可フラグ設定手段、その命令を生成する追い越しブロック命令生成手段をもつコンパイラと、追い越しをブロックする命令を命令リオーダバッファに登録する追い越しブロック命令登録手段、追い越し許可フラグの設定されたストア命令を参照しながら、メモリアクセス命令を命令リオーダバッファに登録する命令バイパス手段をもつ命令リオーダユニットを有する。   The present invention relates to a store instruction having an overtaking permission flag indicating permission / non-permission of overtaking of a load instruction, a CPU having an instruction set including an instruction for blocking overtaking of a load instruction, and overtaking permission flag setting means for setting the flag Memory access while referring to a compiler having an overtaking block instruction generation means for generating the instruction, an overtaking block instruction registration means for registering an instruction to block overtaking in the instruction reorder buffer, and a store instruction in which the overtaking permission flag is set An instruction reorder unit having an instruction bypass means for registering an instruction in an instruction reorder buffer;

なお、本明細書において、メモリにデータを書き込むことをストア、それを行う命令をストア命令、メモリからデータを読み込むことをロード、それを行う命令をロード命令という。また、ロード命令、ストア命令をまとめてメモリアクセス命令という。   In this specification, writing data to the memory is referred to as a store, an instruction for executing the data is referred to as a store instruction, reading data from the memory is referred to as load, and an instruction for executing the data is referred to as a load instruction. A load instruction and a store instruction are collectively referred to as a memory access instruction.

本発明によれば、追い越し許可フラグはONに設定されている第1の命令の後続の命令が、第1の命令と同時に、または、第1の命令を追い越して処理される。これにより、処理時間が短縮され、プログラムが高速化されるという効果を奏し得る。   According to the present invention, the instruction subsequent to the first instruction whose overtaking permission flag is set to ON is processed simultaneously with the first instruction or overtaking the first instruction. As a result, the processing time can be shortened and the program can be speeded up.

従来例における命令パイプラインの流れを示す図である。It is a figure which shows the flow of the instruction pipeline in a prior art example. メモリアクセス命令のメモリ・ディスアンビギュエションを行い高速化するときの従来例を示す図である。It is a figure which shows the prior art example when performing memory disambiguation of a memory access instruction and speeding up. 一つの命令で四つのメモリ領域にロード、ストアできるベクトル命令をもつ場合の従来例を示す図である。It is a figure which shows the prior art example when it has a vector instruction which can be loaded and stored in four memory areas with one instruction. 命令リオーダバッファの一例である。It is an example of an instruction reorder buffer. 本発明の一実施形態に係るプログラム実行システムの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the program execution system which concerns on one Embodiment of this invention. 本実施例における追い越し許可フラグ設定手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the overtaking permission flag setting means in a present Example. 本実施例における追い越しブロック命令生成手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the overtaking block command production | generation means in a present Example. 本実施例における追い越しブロック命令登録手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the overtaking block command registration means in a present Example. 本実施例における命令バイパス手段の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the command bypass means in a present Example. 本実施例において、ベクトル命令の場合における効果を示す図である。In this example, it is a figure which shows the effect in the case of a vector instruction. (A)は、他の実施例におけるプログラム111の一例を示す図である。(B)は、この実施例において追い越し許可フラグ設定手段の動作を示すフローチャートである。(A) is a figure which shows an example of the program 111 in another Example. (B) is a flowchart showing the operation of the overtaking permission flag setting means in this embodiment. 本発明の他の実施例におけるコンパイラの機能構成を示すブロック図である。It is a block diagram which shows the function structure of the compiler in the other Example of this invention. 本発明の他の実施例を示す図である。It is a figure which shows the other Example of this invention.

以下、本発明の実施の形態について図面を参照しつつ詳細に説明する。なお、同一の要素には同一の符号を付し、重複する説明を省略する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In addition, the same code | symbol is attached | subjected to the same element and the overlapping description is abbreviate | omitted.

図5は、本発明の一実施形態に係るプログラム実行システムの概略構成を示すブロック図である。同図に示すように、本実施例において、CPUの命令セットは、追い越し許可フラグをもつストア命令54、55、56、および、追い越しする命令をブロックする命令(以下「追い越しブロック命令」という。)57を含む。   FIG. 5 is a block diagram showing a schematic configuration of a program execution system according to an embodiment of the present invention. As shown in the figure, in this embodiment, the CPU instruction set includes store instructions 54, 55, 56 having an overtaking permission flag, and instructions for blocking overtaking instructions (hereinafter referred to as “overtaking block instructions”). 57.

また、本実施例におけるコンパイラ51は、プログラムのあるループ中のストア命令の追い越し許可フラグをON(追い越しを許可)に設定する指示行516が指定されたときループ中のストア命令54、55、56の追い越し許可フラグをONに設定する追い越し許可フラグ設定手段52と、プログラム中のある地点以降のロード命令の追い越しをブロックすることを指定する指示行515が指定されたときその場所に追い越しブロック命令57を生成する追い越しブロック命令生成手段53を有する。   Further, the compiler 51 in the present embodiment stores the store instructions 54, 55, and 56 in the loop when the instruction line 516 for setting the overtaking permission flag of the store instruction in a loop of the program to ON (passing is permitted) is designated. When the overtaking permission flag setting means 52 for setting the overtaking permission flag of the vehicle and the instruction line 515 for designating that the overtaking of the load instruction after a certain point in the program is to be blocked are designated, the overtaking block instruction 57 is provided at that location. Has an overtaking block instruction generation means 53.

命令リオーダユニット59は、メモリ・ディスアンビギュエションを行いロード、ストア命令の実行順番を制御する。本実施例における命令リオーダユニット59は、追い越しブロック命令57を命令リオーダバッファ517に登録する追い越しブロック命令登録手段510、追い越し許可フラグがONに設定されたストア命令を先行させなければならない命令とせず、かつ、命令リオーダバッファ517中の追い越しブロック命令57を先行させなければならない命令として、ロード命令を命令リオーダバッファ517に登録する命令バイパス手段511を有する。また、命令リオーダユニット59は、命令リオーダユニット26として説明した動作及び機能を包含している。   The instruction reorder unit 59 performs memory disambiguation and loads and controls the execution order of store instructions. The instruction reorder unit 59 in this embodiment does not make the overtaking block instruction registration means 510 for registering the overtaking block instruction 57 in the instruction reorder buffer 517, an instruction that must precede the store instruction in which the overtaking permission flag is set to ON, In addition, an instruction bypass unit 511 that registers a load instruction in the instruction reorder buffer 517 as an instruction that must be preceded by the overtaking block instruction 57 in the instruction reorder buffer 517. The instruction reorder unit 59 includes the operations and functions described as the instruction reorder unit 26.

アドレス計算ユニット58は、実行ステージ14に相当し、メモリアクセス命令のアクセスするメモリ領域のアドレスを計算する。命令デコードステージ13の結果が入力される。メモリアクセスユニット513は、リード/ライトステージ15に相当する。本実施例では、アドレス計算ユニット58、メモリアクセスユニット513は、二つの命令を同時に処理できるものとするが、並列処理可能な命令の数はこれに限定されない。命令リオーダバッファ517は、命令パイプラインのリード/ライトステージ15の直前のバッファに相当する。命令実行完了通知512は、命令実行完了通知27と同様の通知である。   The address calculation unit 58 corresponds to the execution stage 14 and calculates the address of the memory area accessed by the memory access instruction. The result of the instruction decode stage 13 is input. The memory access unit 513 corresponds to the read / write stage 15. In this embodiment, the address calculation unit 58 and the memory access unit 513 can process two instructions simultaneously, but the number of instructions that can be processed in parallel is not limited to this. The instruction reorder buffer 517 corresponds to a buffer immediately before the read / write stage 15 of the instruction pipeline. The instruction execution completion notification 512 is the same notification as the instruction execution completion notification 27.

本実施例におけるプログラム実行システムは、コンピュータにより実現される。プログラム実行システムは、システムの動作及び処理を制御するCPUと、プログラムや必要なデータを格納するROM及び/又はRAMと、外部からの入力及び外部への出力をするための入出力インタフェースと、外部とデータ通信するための通信インタフェースと、これらを結ぶバス等を備える。また、本明細書等において、手段とは、単に物理的手段を意味するものではなく、その手段が有する機能をソフトウェアによって実現する場合、すなわち、CPUが、メモリまたは外部記憶装置などに記憶された所定のプログラムを実行することにより実現する場合を含む。このとき、1つの手段が有する機能が2つ以上の物理的手段により実現されても、2つ以上の手段の機能が1つの物理的手段により実現されてもよい。   The program execution system in the present embodiment is realized by a computer. The program execution system includes a CPU for controlling the operation and processing of the system, a ROM and / or RAM for storing programs and necessary data, an input / output interface for external input and output, and an external A communication interface for data communication with the bus, a bus connecting these, and the like. Further, in this specification and the like, the means does not simply mean physical means, but the function of the means is realized by software, that is, the CPU is stored in a memory or an external storage device. This includes a case where it is realized by executing a predetermined program. At this time, the function of one means may be realized by two or more physical means, or the functions of two or more means may be realized by one physical means.

次に、図5〜9を用いて本実施例における動作について説明する。   Next, the operation in this embodiment will be described with reference to FIGS.

図6は、本実施例における追い越し許可フラグ設定手段の動作を示すフローチャートである。本実施例におけるコンパイラ51の追い越し許可フラグ設定手段52は、コンパイラがストア命令を処理するときに起動される。図6に示すように、まず、ストア命令がループに含まれるかどうかを判定する(S61)。ストア命令がループに含まれないとき、ストア命令の追い越し許可フラグをOFFに設定する(S64)。ストア命令がループに含まれるとき、ループに対して追い越し許可フラグをONに設定する指示行516が指定されたかどうかを判定する(S62)。指定されていないとき、ストア命令の追い越し許可フラグをOFFに設定する(S64)。指定されていたとき、ストア命令の追い越し許可フラグをONに設定する(S63)。   FIG. 6 is a flowchart showing the operation of the overtaking permission flag setting means in the present embodiment. The overtaking permission flag setting means 52 of the compiler 51 in this embodiment is activated when the compiler processes a store instruction. As shown in FIG. 6, first, it is determined whether or not a store instruction is included in the loop (S61). When the store instruction is not included in the loop, the overtaking permission flag of the store instruction is set to OFF (S64). When the store instruction is included in the loop, it is determined whether or not the instruction line 516 for setting the overtaking permission flag to ON is designated for the loop (S62). If not specified, the overtaking permission flag of the store instruction is set to OFF (S64). If so, the overtaking permission flag of the store instruction is set to ON (S63).

図7は、本実施例における追い越しブロック命令生成手段の動作を示すフローチャートである。本実施例におけるコンパイラ51の追い越しブロック命令生成手段53は、コンパイラが文を処理する直前に起動される。図7に示すように、まず、文の直前にロード命令の追い越しをブロックすることを指定する指示行515が指定されているか判定する(S71)。指定されていないとき、従来どおり、現在の文に対応する命令を生成する(S73)。指定されていたとき、追い越しブロック命令を生成する(S72)。その後、従来どおり、現在の文に対応する命令を生成する(S73)。   FIG. 7 is a flowchart showing the operation of the overtaking block instruction generation means in this embodiment. The overtaking block instruction generation means 53 of the compiler 51 in this embodiment is activated immediately before the compiler processes a statement. As shown in FIG. 7, first, it is determined whether or not an instruction line 515 for designating blocking of overtaking of a load instruction is designated immediately before a sentence (S71). If not specified, an instruction corresponding to the current sentence is generated as before (S73). If so, an overtaking block instruction is generated (S72). After that, an instruction corresponding to the current sentence is generated as usual (S73).

図8は、本実施例における追い越しブロック命令登録手段の動作を示すフローチャートである。本実施例における命令リオーダユニット59の追い越しブロック命令登録手段510は、命令リオーダユニット59が命令リオーダバッファ517に追い越しブロック命令57を登録するときに起動される。図8に示すように、追い越しブロック命令登録手段510は、命令リオーダバッファ517からエントリを取り出す(S81)。次に取り出したエントリが空のエントリかどうかを判定する(S82)。空のエントリでないとき、追い越しブロック命令に先行させなければならない命令として本エントリの番号を登録する(S83)。次に、取り出したエントリが命令リオーダバッファ517の最後のエントリかどうかを判定する(S84)。最後のエントリでなかったとき、命令リオーダバッファ517から次のエントリを取り出し(S81)、処理を繰り返す。ステップS84で最後のエントリだったとき、処理を終了する。ステップS82でエントリが空のエントリであったとき、取り出したエントリが命令リオーダバッファ517の最後のエントリかどうかを判定する(S84)。最後のエントリでなかったとき、命令リオーダバッファ517から次のエントリを取り出し(S81)、処理を繰り返す。ステップS84で最後のエントリだったとき、処理を終了する。   FIG. 8 is a flowchart showing the operation of the overtaking block instruction registration means in this embodiment. The overtaking block instruction registration means 510 of the instruction reorder unit 59 in this embodiment is activated when the instruction reorder unit 59 registers the overtaking block instruction 57 in the instruction reorder buffer 517. As shown in FIG. 8, the overtaking block instruction registration unit 510 takes out an entry from the instruction reorder buffer 517 (S81). Next, it is determined whether or not the extracted entry is an empty entry (S82). If it is not an empty entry, the number of this entry is registered as an instruction that must precede the overtaking block instruction (S83). Next, it is determined whether or not the fetched entry is the last entry in the instruction reorder buffer 517 (S84). If it is not the last entry, the next entry is extracted from the instruction reorder buffer 517 (S81), and the process is repeated. If it is the last entry in step S84, the process is terminated. If the entry is an empty entry in step S82, it is determined whether the extracted entry is the last entry in the instruction reorder buffer 517 (S84). If it is not the last entry, the next entry is extracted from the instruction reorder buffer 517 (S81), and the process is repeated. If it is the last entry in step S84, the process is terminated.

図9は、本実施例における命令バイパス手段の動作を示すフローチャートである。本実施例における命令リオーダユニット59の命令バイパス手段511は、命令リオーダユニット59が命令リオーダバッファ517に命令を登録するときに起動される。図9に示すように、まず、命令リオーダバッファ517からエントリを取り出す出したエントリが追い越しブロック命令のものかどうか判定する(S93)。エントリが追い越しブロック命令のものであるとき、登録しようとしている命令に先行させなければならない命令として、このエントリの番号を登録するものとする(S94)。その後、取り出したエントリが命令リオーダバッファ517の最後のエントリだったかどうか判定する(S95)。最後のエントリでなかったとき、次のエントリを取り出す(S91)。最後のエントリだったとき、従来と同じように、命令を命令リオーダバッファ517の空きエントリに登録する(S96)。   FIG. 9 is a flowchart showing the operation of the instruction bypass means in this embodiment. The instruction bypass unit 511 of the instruction reorder unit 59 in this embodiment is activated when the instruction reorder unit 59 registers an instruction in the instruction reorder buffer 517. As shown in FIG. 9, first, it is determined whether or not the entry taken out from the instruction reorder buffer 517 is an overtaking block instruction (S93). When the entry is for the overtaking block instruction, the entry number is registered as an instruction that must precede the instruction to be registered (S94). Thereafter, it is determined whether or not the fetched entry is the last entry in the instruction reorder buffer 517 (S95). If it is not the last entry, the next entry is extracted (S91). If it is the last entry, the instruction is registered in the empty entry of the instruction reorder buffer 517 as in the conventional case (S96).

ステップS93で追い越しブロック命令のエントリでなかったとき、エントリがストア命令のものかどうか判定する(S97)。エントリがストア命令のものでなかったとき、すなわち、ロード命令のエントリであったとき、登録しようとしている命令がロード命令であるかどうか判定する(S910)。ロード命令であるとき、取り出したエントリが命令リオーダバッファ517の最後のエントリだったかどうか判定し(S95)、次のエントリを処理するか(S91)、命令を登録して(S96)、処理を終了する。   If the entry is not an entry for the overtaking block instruction in step S93, it is determined whether the entry is for a store instruction (S97). When the entry is not a store instruction, that is, when the entry is a load instruction, it is determined whether the instruction to be registered is a load instruction (S910). When it is a load instruction, it is determined whether or not the fetched entry is the last entry of the instruction reorder buffer 517 (S95), the next entry is processed (S91), the instruction is registered (S96), and the process ends. To do.

ステップS910でロード命令でなかったとき、すなわち、ストア命令であったとき、メモリアクセス命令のメモリ・ディスアンビギュエションを行い、必要であれば先行させなければならない命令としてエントリ番号を登録するものとする。また、SIMD命令、ベクトル命令であるときは直前に登録した命令を先行させなければならない命令として登録するものとする(S911)。ステップS911は、従来どおりの処理である。その後、取り出したエントリが命令リオーダバッファ517の最後のエントリだったかどうか判定し(S95)、次のエントリを処理するか(S91)、命令を登録して(S96)、処理を終了する。   If it is not a load instruction in step S910, that is, if it is a store instruction, the memory disambiguation of the memory access instruction is performed, and the entry number is registered as an instruction that must be preceded if necessary. And If the instruction is a SIMD instruction or a vector instruction, the instruction registered immediately before is registered as an instruction to be preceded (S911). Step S911 is a conventional process. Thereafter, it is determined whether or not the fetched entry is the last entry in the instruction reorder buffer 517 (S95), the next entry is processed (S91), the instruction is registered (S96), and the process is terminated.

ステップS97でエントリがストア命令のものであったとき、登録しようとしている命令がロード命令かどうか判定する(S98)。ロード命令でないとき、すなわち、ストア命令であるとき、メモリアクセス命令のメモリ・ディスアンビギュエションを行い、必要であれば先行させなければならない命令としてエントリ番号を登録するものとする。また、SIMD命令、ベクトル命令であるときは直前に登録した命令を先行させなければならない命令として登録するものとする(S911)。その後、取り出したエントリが命令リオーダバッファ517の最後のエントリだったかどうか判定し(S95)、次のエントリを処理するか(S91)、命令を登録して(S96)、処理を終了する。   If the entry is for a store instruction in step S97, it is determined whether the instruction to be registered is a load instruction (S98). When the instruction is not a load instruction, that is, when it is a store instruction, memory disambiguation of a memory access instruction is performed, and an entry number is registered as an instruction that must be preceded if necessary. If the instruction is a SIMD instruction or a vector instruction, the instruction registered immediately before is registered as an instruction to be preceded (S911). Thereafter, it is determined whether or not the fetched entry is the last entry in the instruction reorder buffer 517 (S95), the next entry is processed (S91), the instruction is registered (S96), and the process is terminated.

ステップS98でロード命令であったとき、エントリに登録されていたストア命令の追い越し許可フラグがONであるかどうか判定する(S99)。追い越し許可フラグがOFF(追い越し不可)であったとき、メモリアクセス命令のメモリ・ディスアンビギュエションを行い、必要であれば先行させなければならない命令としてエントリ番号を登録するものとする。また、SIMD命令、ベクトル命令であるときは直前に登録した命令を先行させなければならない命令として登録するものとする(S911)。その後、取り出したエントリが命令リオーダバッファ517の最後のエントリだったかどうか判定し(S95)、次のエントリを処理するか(S91)、命令を登録して(S96)、処理を終了する。   If it is a load instruction in step S98, it is determined whether or not the overtaking permission flag of the store instruction registered in the entry is ON (S99). When the overtaking permission flag is OFF (passing is impossible), memory disambiguation of a memory access instruction is performed, and an entry number is registered as an instruction that must be preceded if necessary. If the instruction is a SIMD instruction or a vector instruction, the instruction registered immediately before is registered as an instruction to be preceded (S911). Thereafter, it is determined whether or not the fetched entry is the last entry in the instruction reorder buffer 517 (S95), the next entry is processed (S91), the instruction is registered (S96), and the process is terminated.

ステップS99で追い越し許可フラグがON(追い越し許可)であったとき、取り出したエントリが命令リオーダバッファ517の最後のエントリだったかどうか判定し(S95)、次のエントリを処理するか(S91)、命令を登録して(S96)、処理を終了する。   When the overtaking permission flag is ON (overtaking permission) in step S99, it is determined whether or not the extracted entry is the last entry in the instruction reorder buffer 517 (S95), whether the next entry is processed (S91), Is registered (S96), and the process is terminated.

このようにして、追い越し許可フラグがONのストア命令があったとき、ロード命令のメモリ・ディスアンビギュエションを省くことができ、また、SIMD命令、ベクトル命令タイプのロード命令を先行して実行することができ、プログラム実行が高速化される。   In this way, when there is a store instruction with the overtaking permission flag ON, the memory disambiguation of the load instruction can be omitted, and the SIMD instruction and the vector instruction type load instruction are executed in advance. And program execution is accelerated.

図10は、本実施例において、ベクトル命令の場合における効果を示す図である。ソースコード101は、サンプルのCプログラムのループである。同図においてx、y、z、idxはポインタである。このループ内では、二つのポインタの指示先から値をベクトルロードし、そのベクトル加算結果を、命令102でストアしている。命令102のストアは、一般的に、ベクトル拡散と呼ばれる。指示行103は、ループ中のストア命令の追い越し許可フラグをON(追い越しを許可)に設定する。このループに対して、本発明のコンパイラは、ソースコード101のループの一回の繰り返しに対して、ベクトル命令列104を生成する。VSC命令105は、追い越し許可フラグがONに設定されたストア命令(ベクトル拡散命令)である。VLDはベクトルロード命令、VADDはベクトル加算命令である。プログラムの実行では、命令列104が命令パイプラインに繰り返し投入される。命令列106は、命令列104が命令パイプラインに投入される順番を示す。左端例1010は投入される順番を示す。最初に、VLD命令109が投入される。命令108は次の繰り返しの最初のVLD命令であり、命令107はその次の繰り返しの最初のVLD命令である。   FIG. 10 is a diagram illustrating an effect in the case of a vector instruction in the present embodiment. The source code 101 is a sample C program loop. In the figure, x, y, z and idx are pointers. In this loop, values are vector-loaded from the two pointers, and the vector addition result is stored by the instruction 102. The store of instructions 102 is commonly referred to as vector spreading. The instruction line 103 sets the overtaking permission flag of the store instruction in the loop to ON (passing is permitted). For this loop, the compiler of the present invention generates a vector instruction sequence 104 for one iteration of the source code 101 loop. The VSC instruction 105 is a store instruction (vector spread instruction) in which the overtaking permission flag is set to ON. VLD is a vector load instruction, and VADD is a vector addition instruction. In executing the program, the instruction sequence 104 is repeatedly input into the instruction pipeline. The instruction sequence 106 indicates the order in which the instruction sequence 104 is input to the instruction pipeline. The leftmost example 1010 shows the order of input. First, the VLD instruction 109 is input. Instruction 108 is the first VLD instruction of the next iteration, and instruction 107 is the first VLD instruction of the next iteration.

時系列1011は、従来技術のときの命令パイプラインのリード/ライトステージでの処理状況である。命令は、右から左に流れていく。従来は、ベクトル命令の追い越しは行われなかったため、VSC命令1012と同時に、あるいはそれより先に、VLD命令1013は処理されなかった。後続のVSC命令1021に続くVLD命令1022も同じである。   The time series 1011 is the processing status at the read / write stage of the instruction pipeline in the prior art. Instructions flow from right to left. Conventionally, since the vector instruction is not overtaken, the VLD instruction 1013 is not processed at the same time as or before the VSC instruction 1012. The same applies to the VLD instruction 1022 following the subsequent VSC instruction 1021.

これに対して、時系列1014は、本発明での命令パイプラインのリード/ライトステージでの処理状況である。VSC命令1016の追い越し許可フラグはONに設定されているため、その後続のVLD命令1015が、VSC命令1016と同時に処理される。VSC命令1017も追い越し許可フラグがONに設定されているため、その後続のVLD命令1018、VLD命令1019がVSC命令1017を追い越して処理される。これにより、時間1020に相当する時間が短縮され、プログラムが高速化される。   On the other hand, the time series 1014 shows the processing status at the read / write stage of the instruction pipeline in the present invention. Since the overtaking permission flag of the VSC instruction 1016 is set to ON, the subsequent VLD instruction 1015 is processed simultaneously with the VSC instruction 1016. Since the overtaking permission flag of the VSC instruction 1017 is also set to ON, the subsequent VLD instruction 1018 and VLD instruction 1019 are processed by overtaking the VSC instruction 1017. Thereby, the time corresponding to the time 1020 is shortened, and the program is speeded up.

本発明の他の実施例として、プログラマが追い越し許可フラグをONに設定する指示行をループに対して指定する代わりに、文ごとに指定する方法がある。   As another embodiment of the present invention, there is a method in which an instruction line for setting an overtaking permission flag to ON is designated for each sentence instead of designating to a loop.

図11(A)は、他の実施例におけるプログラム111の一例を示す図である。図11(B)は、この実施例において追い越し許可フラグ設定手段の動作を示すフローチャートである。指示行112は、直後の文に対して指定された指示行である。このときの追い越し許可フラグ設定手段の動作は、最初に文に対して追い越し許可フラグをONに設定する指示行が指定されていたかどうかを判定する(S113)。指定されていたとき、文に対して生成するストア命令の追い越し許可フラグをONに設定する(S114)。そうでないとき、ストア命令の追い越し許可フラグをOFFに設定する(S115)。   FIG. 11A is a diagram illustrating an example of a program 111 in another embodiment. FIG. 11B is a flowchart showing the operation of the overtaking permission flag setting means in this embodiment. The instruction line 112 is an instruction line designated for the immediately following sentence. The operation of the overtaking permission flag setting means at this time determines whether or not an instruction line for setting the overtaking permission flag to ON is first designated for the sentence (S113). If it is specified, the overtaking permission flag of the store instruction generated for the sentence is set to ON (S114). Otherwise, the overtaking permission flag of the store instruction is set to OFF (S115).

図12は、本発明の他の実施例におけるコンパイラの機能構成を示すブロック図である。この実施例においては、プログラマが追い越し許可フラグをONに設定する指示行、ロード命令の追い越しをブロックすることを指定する指示行をループ、文に対して指定する代わりに、図12のコンパイラのように追い越し可能ストア命令検出手段121をコンパイラに追加し、それによりコンパイラがプログラムを解析し、追い越しブロック命令をどの位置に作るのか、どのストア命令の追い越し許可フラグをONに設定するのか、OFFに設定するのかを自動的に判定する方法がある。このとき、その検出結果を追い越し許可フラグ設定手段122、追い越しブロック命令生成手段123で利用する。   FIG. 12 is a block diagram showing a functional configuration of a compiler in another embodiment of the present invention. In this embodiment, instead of specifying the instruction line for setting the overtaking permission flag ON and the instruction line for blocking the overtaking of the load instruction for the loop and the statement, the programmer like the compiler of FIG. The store instruction detection means 121 that can be overtaken is added to the compiler, so that the compiler analyzes the program, and in which position the overtake block instruction is created, which store instruction overtake permission flag is set to ON, and OFF is set. There is a method for automatically determining whether to do this. At this time, the detection result is used by the overtaking permission flag setting unit 122 and the overtaking block instruction generation unit 123.

図13は、本発明の他の実施例を示す図である。この実施例は、ストア命令に追い越し許可フラグを設ける代わりに、追い越し許可を示す命令(追い越し許可命令)を追加し、その命令と追い越しブロック命令の間の区間のストア命令を追い越し許可と判断する方法である。同図において、OVT135が追い越し許可命令である。追い越し許可命令は、指示行1317の指定された位置に、コンパイラ131の追い越し許可命令生成手段132によって生成される。命令列134は、本実施例のコンパイラ131によって生成されたループ1316に対する命令列である。LABELから末尾のIFまでの命令138がループの一回の繰り返しに相当する命令列である。その直前に追い越し許可命令であるOVT135が生成される。そしてループの出口には指示行1318に相当する追い越しブロック命令SOVT137が生成される。追い越しブロック命令は、指定された位置に、コンパイラ131の追い越しブロック命令生成手段133によって生成される。このとき、OVT135とSOVT137の間で実行されるすべてのストア命令136は追い越し許可となる。   FIG. 13 is a diagram showing another embodiment of the present invention. In this embodiment, instead of providing an overtaking permission flag in a store instruction, an instruction indicating overtaking permission (overtaking permission instruction) is added, and a store instruction in a section between the instruction and the overtaking block instruction is determined as overtaking permission. It is. In the figure, OVT 135 is an overtaking permission command. The overtaking permission instruction is generated by the overtaking permission instruction generation unit 132 of the compiler 131 at the designated position of the instruction line 1317. The instruction sequence 134 is an instruction sequence for the loop 1316 generated by the compiler 131 of this embodiment. An instruction 138 from LABEL to the last IF is an instruction sequence corresponding to one iteration of the loop. Immediately before that, an OVT 135 that is an overtaking permission command is generated. Then, an overtaking block instruction SOVT137 corresponding to the instruction line 1318 is generated at the exit of the loop. The overtaking block instruction is generated at the designated position by the overtaking block instruction generation means 133 of the compiler 131. At this time, all store instructions 136 executed between the OVT 135 and the SOVT 137 are overtaken.

アドレス計算ユニット139、命令実行完了通知1314、メモリアクセスユニット1315、命令リオーダバッファ1319は、図5に記載の実施例の対応する構成と同様の構成を備える。   The address calculation unit 139, the instruction execution completion notification 1314, the memory access unit 1315, and the instruction reorder buffer 1319 have the same configuration as the corresponding configuration of the embodiment described in FIG.

本実施例の命令リオーダユニット1310は、追い越し許可/ブロック命令登録手段1311を備える。追い越し許可命令は、追い越し許可/ブロック命令登録手段1311により、図8の追い越しブロック命令登録手段と同じ手順で命令リオーダバッファ1319に登録される。追い越しブロック命令は、追い越し許可/ブロック命令登録手段1311により、図8の追い越しブロック命令登録手段と同じ手順で命令リオーダバッファ1319に登録される。   The instruction reorder unit 1310 of this embodiment includes an overtaking permission / block instruction registration means 1311. The overtaking permission instruction is registered in the instruction reorder buffer 1319 by the overtaking permission / block instruction registration means 1311 in the same procedure as the overtaking block instruction registration means of FIG. The overtaking block instruction is registered in the instruction reorder buffer 1319 by the overtaking permission / block instruction registration unit 1311 in the same procedure as the overtaking block instruction registration unit of FIG.

本実施例の命令バイパス手段1312は、図9の追い越し許可フラグがONであるかの判定(S99)の代わりに、追い越し許可命令実行後に一度も追い越しブロック命令を実行していないかどうかを判定する。実行していないとき、追い越し許可であるので取り出したエントリが命令リオーダバッファ1319の最後のエントリだったかどうか判定し(S95)、次のエントリを処理するか(S91)、命令を登録して(S96)、処理を終了する。追い越しブロック命令を実行していたとき、メモリアクセス命令のメモリ・ディスアンビギュエションを行い、必要であれば先行させなければならない命令としてエントリ番号を登録するものとする。   The instruction bypass unit 1312 of this embodiment determines whether or not an overtaking block instruction has been executed even after execution of the overtaking permission instruction, instead of determining whether the overtaking permission flag in FIG. 9 is ON (S99). . When not executed, since overtaking is permitted, it is determined whether or not the extracted entry is the last entry in the instruction reorder buffer 1319 (S95), the next entry is processed (S91), or the instruction is registered (S96). ), The process is terminated. When an overtaking block instruction is executed, memory disambiguation of a memory access instruction is performed, and an entry number is registered as an instruction that must be preceded if necessary.

また、SIMD命令、ベクトル命令であるときは直前に登録した命令を先行させなければならない命令として登録するものとする(S911)。その後、取り出したエントリが命令リオーダバッファ1319の最後のエントリだったかどうか判定し(S95)、次のエントリを処理するか(S91)、命令を登録して(S96)、処理を終了する。それ以外は、図9の命令バイパス手段と同じ動作をする。   If the instruction is a SIMD instruction or a vector instruction, the instruction registered immediately before is registered as an instruction to be preceded (S911). Thereafter, it is determined whether or not the fetched entry is the last entry in the instruction reorder buffer 1319 (S95), the next entry is processed (S91), the instruction is registered (S96), and the process is terminated. Otherwise, the operation is the same as the instruction bypass means of FIG.

本発明の他の実施例として、プログラマが追い越し許可命令、追い越しブロック命令の位置を指示行で支持する代わりに、図12のコンパイラのように追い越し可能ストア命令検出手段をコンパイラに追加し、それによりコンパイラがプログラムを解析し、追い越し許可命令、追い越しブロック命令をどの位置に作るのかを自動的に判定する方法もある。   As another embodiment of the present invention, instead of the programmer supporting the position of the overtaking permission instruction and the overtaking block instruction in the instruction line, an overtaking store instruction detecting means is added to the compiler as in the compiler of FIG. There is also a method in which the compiler analyzes the program and automatically determines where to pass the overtaking permission instruction and overtaking block instruction.

なお、本発明は、上記した実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲内において、他の様々な形で実施することができる。このため、上記実施形態はあらゆる点で単なる例示にすぎず、限定的に解釈されるものではない。例えば、上述の各処理ステップは処理内容に矛盾を生じない範囲で任意に順番を変更して又は並列に実行することができる。   The present invention is not limited to the above-described embodiment, and can be implemented in various other forms without departing from the gist of the present invention. For this reason, the said embodiment is only a mere illustration in all points, and is not interpreted limitedly. For example, the above-described processing steps can be executed in any order or in parallel as long as there is no contradiction in the processing contents.

上記の実施形態の一部又は全部は、以下の付記のようにも記載され得るが、以下には限
られない。
A part or all of the above embodiments can be described as in the following supplementary notes, but is not limited thereto.

(付記1)ロード命令の追い越しの許可又は不許可を示す追い越し許可フラグをもつストア命令と、ロード命令の追い越しをブロックする追い越しブロック命令と、を含む命令セットをもつプロセッサと、前記追い越し許可フラグを設定する追い越し許可フラグ設定手段と、前記追い越しブロック命令を生成する追い越しブロック命令生成手段と、をもつコンパイラと、前記追い越しブロック命令を命令リオーダバッファに登録する追い越しブロック命令登録手段と、前記追い越し許可フラグの設定されたストア命令を参照しながら、メモリアクセス命令を命令リオーダバッファに登録する命令バイパス手段と、をもつ命令リオーダユニットと、を有するプログラム実行システム。   (Supplementary Note 1) A processor having an instruction set including a store instruction having an overtaking permission flag indicating permission or disapproval of overtaking of a load instruction, and an overtaking block instruction for blocking overtaking of a load instruction, and the overtaking permission flag An overtaking permission flag setting means to set; an overtaking block instruction generation means for generating the overtaking block instruction; an overtaking block instruction registration means for registering the overtaking block instruction in an instruction reorder buffer; and the overtaking permission flag. An instruction reorder unit having instruction bypass means for registering a memory access instruction in an instruction reorder buffer while referring to the set store instruction.

(付記2)前記命令リオーダユニットは、前記追い越し許可フラグがONに設定されている第1の命令について、その後続の命令を、前記第1の命令と同時に又は追い越して処理されるよう、前記命令リオーダバッファに登録されることを特徴とする付記1記載のプログラム実行システム。   (Supplementary Note 2) The instruction reorder unit is configured to process the instruction for the first instruction in which the overtaking permission flag is set to ON so that the subsequent instruction is processed simultaneously with or overtaking the first instruction. The program execution system according to appendix 1, which is registered in a reorder buffer.

(付記3)ロード命令の追い越しの許可又は不許可を示す追い越し許可フラグをもつストア命令と、ロード命令の追い越しをブロックする追い越しブロック命令と、を含む命令セットをもつプロセッサを備えるプログラム実行システムにおいて、プログラムを実行する方法であって、コンパイラにおいて、前記追い越し許可フラグを設定する追い越し許可フラグ設定ステップと、前記コンパイラにおいて、前記追い越しブロック命令を生成する追い越しブロック命令生成ステップと、命令リオーダユニットが、前記追い越しブロック命令を命令リオーダバッファに登録する追い越しブロック命令登録ステップと、前記命令リオーダユニットが、前記追い越し許可フラグの設定されたストア命令を参照しながら、メモリアクセス命令を命令リオーダバッファに登録する命令バイパスステップと、を備える方法。   (Supplementary note 3) In a program execution system including a processor having an instruction set including a store instruction having an overtaking permission flag indicating permission or non-permission of overtaking of a load instruction, and an overtaking block instruction for blocking overtaking of a load instruction. A method of executing a program, wherein in a compiler, the overtaking permission flag setting step for setting the overtaking permission flag, in the compiler, the overtaking block instruction generation step for generating the overtaking block instruction, and the instruction reorder unit includes: An overtaking block instruction registration step for registering an overtaking block instruction in an instruction reorder buffer, and the instruction reorder unit refers to a store instruction in which the overtaking permission flag is set while referring to a memory access instruction. The method comprising the instruction bypass step of registering the Dabaffa, the.

(付記4)前記命令リオーダユニットが、前記追い越し許可フラグがONに設定されている第1の命令について、その後続の命令を、前記第1の命令と同時に又は追い越して処理されるよう、前記命令リオーダバッファに登録することを特徴とする付記3記載の方法。   (Supplementary note 4) The instruction reorder unit is configured to process the subsequent instruction for the first instruction in which the overtaking permission flag is set to ON at the same time as or overtaking the first instruction. The method according to appendix 3, wherein the method is registered in a reorder buffer.

51,131 コンパイラ、52,122 追い越し許可フラグ設定手段、53,123,133 追い越しブロック命令生成手段、58,139 アドレス計算ユニット、59,1310 命令リオーダユニット、510 追い越しブロック命令登録手段、511,1312 命令バイパス手段、512,1314 命令実行完了通知、513,1315 メモリアクセスユニット、517,1319 命令リオーダバッファ、121 追い越し可能ストア命令検出手段、132 追い越し許可命令生成手段、1311 追い越し許可/ブロック命令登録手段 51,131 compiler, 52,122 overtaking permission flag setting means, 53,123,133 overtaking block instruction generation means, 58,139 address calculation unit, 59,1310 instruction reorder unit, 510 overtaking block instruction registration means, 511,1312 instructions Bypass means, 512, 1314 instruction execution completion notification, 513, 1315 memory access unit, 517, 1319 instruction reorder buffer, 121 overtaking store instruction detecting means, 132 overtaking permission instruction generating means, 1311 overtaking permission / block instruction registration means

Claims (4)

ロード命令の追い越しの許可又は不許可を示す追い越し許可フラグをもつストア命令と、ロード命令の追い越しをブロックする追い越しブロック命令と、を含む命令セットをもつプロセッサと、
前記追い越し許可フラグを設定する追い越し許可フラグ設定手段と、前記追い越しブロック命令を生成する追い越しブロック命令生成手段と、をもつコンパイラと、
前記追い越しブロック命令を命令リオーダバッファに登録する追い越しブロック命令登録手段と、前記追い越し許可フラグの設定されたストア命令を参照しながら、メモリアクセス命令を命令リオーダバッファに登録する命令バイパス手段と、をもつ命令リオーダユニットと、
を有するプログラム実行システム。
A processor having an instruction set including a store instruction having an overtaking permission flag indicating permission or disapproval of overtaking of the load instruction, and an overtaking block instruction for blocking overtaking of the load instruction;
A compiler having overtaking permission flag setting means for setting the overtaking permission flag and overtaking block instruction generation means for generating the overtaking block instruction;
An overtaking block instruction registration means for registering the overtaking block instruction in an instruction reorder buffer; and an instruction bypass means for registering a memory access instruction in the instruction reorder buffer while referring to the store instruction in which the overtaking permission flag is set. An instruction reorder unit;
A program execution system.
前記命令リオーダユニットは、前記追い越し許可フラグがONに設定されている第1の命令について、その後続の命令を、前記第1の命令と同時に又は追い越して処理されるよう、前記命令リオーダバッファに登録されることを特徴とする請求項1記載のプログラム実行システム。   The instruction reorder unit registers, in the instruction reorder buffer, the subsequent instruction for the first instruction having the overtaking permission flag set to ON to be processed simultaneously with or overtaking the first instruction. The program execution system according to claim 1, wherein: ロード命令の追い越しの許可又は不許可を示す追い越し許可フラグをもつストア命令と、ロード命令の追い越しをブロックする追い越しブロック命令と、を含む命令セットをもつプロセッサを備えるプログラム実行システムにおいて、プログラムを実行する方法であって、
コンパイラにおいて、前記追い越し許可フラグを設定する追い越し許可フラグ設定ステップと、
前記コンパイラにおいて、前記追い越しブロック命令を生成する追い越しブロック命令生成ステップと、
命令リオーダユニットが、前記追い越しブロック命令を命令リオーダバッファに登録する追い越しブロック命令登録ステップと、
前記命令リオーダユニットが、前記追い越し許可フラグの設定されたストア命令を参照しながら、メモリアクセス命令を命令リオーダバッファに登録する命令バイパスステップと、
を備える方法。
A program is executed in a program execution system including a processor having an instruction set including a store instruction having an overtaking permission flag indicating permission or disapproval of overtaking of a load instruction and an overtaking block instruction for blocking overtaking of a load instruction A method,
In the compiler, an overtaking permission flag setting step for setting the overtaking permission flag;
In the compiler, an overtaking block instruction generation step for generating the overtaking block instruction;
An instruction reorder unit for registering the overtaking block instruction in an instruction reorder buffer;
An instruction bypass step in which the instruction reorder unit registers a memory access instruction in an instruction reorder buffer while referring to a store instruction in which the overtaking permission flag is set;
A method comprising:
前記命令リオーダユニットが、前記追い越し許可フラグがONに設定されている第1の命令について、その後続の命令を、前記第1の命令と同時に又は追い越して処理されるよう、前記命令リオーダバッファに登録することを特徴とする請求項3記載の方法。   The instruction reorder unit registers, in the instruction reorder buffer, the subsequent instruction for the first instruction having the overtaking permission flag set to ON to be processed simultaneously with or overtaking the first instruction. 4. The method of claim 3, wherein:
JP2011080035A 2011-03-31 2011-03-31 Method for increasing speed of program by performing overtaking control of memory access instruction Withdrawn JP2012216009A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011080035A JP2012216009A (en) 2011-03-31 2011-03-31 Method for increasing speed of program by performing overtaking control of memory access instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011080035A JP2012216009A (en) 2011-03-31 2011-03-31 Method for increasing speed of program by performing overtaking control of memory access instruction

Publications (1)

Publication Number Publication Date
JP2012216009A true JP2012216009A (en) 2012-11-08

Family

ID=47268730

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011080035A Withdrawn JP2012216009A (en) 2011-03-31 2011-03-31 Method for increasing speed of program by performing overtaking control of memory access instruction

Country Status (1)

Country Link
JP (1) JP2012216009A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014235747A (en) * 2013-05-31 2014-12-15 アーム・リミテッド Data processing systems

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014235747A (en) * 2013-05-31 2014-12-15 アーム・リミテッド Data processing systems
US10176546B2 (en) 2013-05-31 2019-01-08 Arm Limited Data processing systems

Similar Documents

Publication Publication Date Title
JP7284199B2 (en) Backwards compatibility through algorithm matching, feature disablement, or performance limitations
JP5611756B2 (en) Program flow control
JP5906325B2 (en) Programs and computing devices with exceptions for code specialization in computer architectures that support transactions
CN108885551B (en) Memory copy instruction, processor, method and system
KR102379894B1 (en) Apparatus and method for managing address conflicts when performing vector operations
US20150212972A1 (en) Data processing apparatus and method for performing scan operations
WO2017019286A1 (en) Backward compatibility by restriction of hardware resources
JP3988144B2 (en) Vector processing device and overtaking control circuit
JP2006313422A (en) Calculation processing device and method for executing data transfer processing
JP2005182659A (en) Vliw type dsp and its operation method
JP7064135B2 (en) Arithmetic processing device and control method of arithmetic processing device
JP2007206933A (en) Information processor, boot loader generation method and program transfer method in information processor
JP2004529405A (en) Superscalar processor implementing content addressable memory for determining dependencies
US20070220235A1 (en) Instruction subgraph identification for a configurable accelerator
JP6468053B2 (en) Information processing apparatus, parallel processing program, and shared memory access method
JP2012216009A (en) Method for increasing speed of program by performing overtaking control of memory access instruction
JP2004516571A (en) Hardware loop that uses resources efficiently
JP7409208B2 (en) arithmetic processing unit
JPH10124312A (en) Central processor
US9135006B1 (en) Early execution of conditional branch instruction with pc operand at which point target is fetched
JP2013061810A (en) Information processor, information processor control method, and intermediate code instruction execution program
JP2924735B2 (en) Pipeline operation device and decoder device
JP4502983B2 (en) Vector control circuit, vector processing device, vector control method, and vector control program
JP2013156792A (en) Microprocessor device
JP3743155B2 (en) Pipeline controlled computer

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: 20140603