JPS5952349A - Instruction pre-fetch controller - Google Patents
Instruction pre-fetch controllerInfo
- Publication number
- JPS5952349A JPS5952349A JP16186082A JP16186082A JPS5952349A JP S5952349 A JPS5952349 A JP S5952349A JP 16186082 A JP16186082 A JP 16186082A JP 16186082 A JP16186082 A JP 16186082A JP S5952349 A JPS5952349 A JP S5952349A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- buffer
- storage
- branch
- instructions
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 239000000872 buffer Substances 0.000 claims abstract description 36
- 239000012536 storage buffer Substances 0.000 claims abstract description 31
- 230000010365 information processing Effects 0.000 abstract description 6
- 239000000284 extract Substances 0.000 abstract description 3
- 238000000034 method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 238000001514 detection method Methods 0.000 description 5
- 230000007704 transition Effects 0.000 description 2
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3802—Instruction prefetching
- G06F9/3804—Instruction prefetching for branches, e.g. hedging, branch folding
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
本発明は命令先取制御装置に係り、特に情報処理装置に
於ける命令先取りの制御方式に関するものである。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an instruction prefetch control device, and particularly to a control method for instruction prefetch in an information processing device.
一般に、情報処理装置のプロセッサは、次の4つのステ
ップ(命令によっては第2.第3のステップが抜ける場
合もある。)を繰り返すことによって、プログラムを実
行する。Generally, a processor of an information processing device executes a program by repeating the following four steps (the second and third steps may be omitted depending on the instruction).
第1のステップ;メモリから次の命令を取り出す。First step: retrieve the next instruction from memory.
第2のステップ;オペランドを読み出す。Second step; read the operand.
第3のステップ;命令を実行する。Third step: Execute the instruction.
第4のステップ;結果を書込む。Fourth step; write the results.
また、従来の情報処理装置の実行の方式として次の2つ
の方式がある。第1の方式はこれらのステップを直列に
実行するものであり、第2の方式はメモリからより多く
の連続した命令を取出し、命令バッファド呼ばれる先取
り専用の内部ランダムφアクセス・メモリ(RAM)に
格納し、順次これを実行するものである。Furthermore, there are the following two methods for executing the conventional information processing apparatus. The first method executes these steps serially, and the second method retrieves more consecutive instructions from memory and stores them in a prefetch-only internal random φ access memory (RAM) called instruction buffered. This is then executed sequentially.
第1の方式の場合、現在実行中の命令が完全に終了した
稜に次の命令をメモリから取り出すのに対し、第2の方
式の場合、前の命令の実行中に次の命令を取り出し、前
の命令が実行終了後、ただちに次の命令を実行できるた
め、命令取り出しに要する時間を大幅に短縮することが
できる。In the first method, the next instruction is fetched from memory when the currently executing instruction is completely finished, whereas in the second method, the next instruction is fetched while the previous instruction is being executed. Since the next instruction can be executed immediately after the previous instruction finishes executing, the time required to fetch the instruction can be significantly reduced.
しかしながら前記第2の方式に於ても、命令の流れを変
更する分岐命令の場合、あらかじめ先取りしておいた先
取りバッファの命令をすべて無効化し、分岐先アドレス
から新たに命令の取出しをしなおさなければならない。However, even in the second method, in the case of a branch instruction that changes the flow of instructions, all instructions in the prefetch buffer that have been prefetched must be invalidated and a new instruction must be fetched from the branch destination address. Must be.
また、命令の実行結果によって、分岐を行うか行なわな
(・かが決定される条件付分岐命令のような場合、特に
その先取り制御が難しくなる。Further, in the case of a conditional branch instruction, in which whether to branch or not is determined depending on the execution result of the instruction, preemption control becomes particularly difficult.
前記の欠点を克服するために、従来の技術では、命令の
先取り用に2個以上の命令バッファと、その制御回路及
び分岐命令の検出回路を設けることによって、先取りに
効果的に対処する方式が考えられている。すなわち、命
令を先取りした時点でその命令が分岐命令か否かを検出
し、無条件分岐命令ならば分岐先アドレスを計算し、そ
のアドレスから引続き先取りを行ない、条件付分岐命令
の場合には分岐の成功、不成功の両方の場合を考慮して
、それぞれ分岐先アドレスからの先取り及び分岐しな(
・場合の先取りを2つの命令バッファに並行して行う。In order to overcome the above-mentioned drawbacks, in the conventional technology, there is a method for effectively dealing with prefetching by providing two or more instruction buffers for prefetching instructions, their control circuits, and branch instruction detection circuits. It is considered. In other words, when an instruction is prefetched, it is detected whether the instruction is a branch instruction or not, and if it is an unconditional branch instruction, the branch destination address is calculated and prefetch is continued from that address, and if it is a conditional branch instruction, the branch is executed. Taking into account both success and failure cases, prefetching from the branch destination address and not branching (
- Perform case prefetching in parallel to two instruction buffers.
従って、実際に条件付分岐命令を実行する際には分岐の
成功、不成功によって2つの命令バッファのうち一方を
選択し、以後の実行をそのバッファから行うことになる
。Therefore, when actually executing a conditional branch instruction, one of the two instruction buffers is selected depending on whether the branch is successful or unsuccessful, and subsequent execution is performed from that buffer.
この方式は同時に複数命令の処理を行ういわゆるパイプ
ライン制御方式とあわせて高速な処理を噺
要求される大型形算機に用いられることが多いが、この
方式においても、条件付分岐命令の場合には両方の場合
を考慮して命令取り出しを行うので命令を格納して(・
る主メモリへのアクセス回数は増大し、主メモリの使用
効率を低下させるという欠点を有する。This method is often used in large computers that require high-speed processing, along with the so-called pipeline control method that processes multiple instructions at the same time. takes both cases into consideration when fetching instructions, so store the instructions (・
This has the disadvantage that the number of accesses to the main memory increases, which reduces the efficiency of main memory use.
本発明の目的は、前記欠点を解決した命令先取制御装置
を提供することにある。An object of the present invention is to provide an instruction preemption control device that solves the above-mentioned drawbacks.
本発明は、命令先取バッファ以外に、命令格納バッファ
と、この命令格納バッファへ格納を開始することを指令
する命令(格納開始命令)手段と、この命令を命令先取
り時に検出する検出器と、この命令格納バッファを分岐
先として指定する条件付分岐命令手段とを備え、命令先
取り時に前記格納開始命令を検出すると以降の先取り命
令を前記命令格納バッファのサイズ分だけ、前記命令先
取リバッファだけでなく前記命令格納バッファへも格納
し、前記条件付分岐命令による分岐の際前記命令格納バ
ッファからの命令取り出しを行うように構成されている
ことを特徴とする命令先取制御装置にある。In addition to the instruction prefetch buffer, the present invention also includes an instruction storage buffer, an instruction (storage start instruction) means for instructing the instruction storage buffer to start storing, a detector for detecting this instruction when the instruction is prefetched, and a detector for detecting this instruction when the instruction is prefetched. conditional branch instruction means for specifying an instruction storage buffer as a branch destination, and when the storage start instruction is detected during instruction prefetching, subsequent prefetching instructions are transferred by the size of the instruction storage buffer, not only to the instruction prefetching rebuffer, but also to the instruction prefetching rebuffer. The instruction prefetch control device is characterized in that it is configured to also store instructions in an instruction storage buffer, and to take out instructions from the instruction storage buffer when branching by the conditional branch instruction.
本発明によれば、条件付分岐命令の分岐先の命令をあら
かじめ定められたバッファに格納しておき、分岐時のメ
モリアクセスを減少させ、命令先取りの回数を減少させ
ることにより、情報処理の性能を向上させると(・う効
果が得られる。4次に、本発明の実施例について図面を
参照しながら、詳細に説明する。According to the present invention, information processing performance is improved by storing a branch destination instruction of a conditional branch instruction in a predetermined buffer, reducing memory access at the time of branching, and reducing the number of instruction prefetching. 4. Next, embodiments of the present invention will be described in detail with reference to the drawings.
第1図は本発明の一実施例である命令先取制御 5−
装置の概略を示すブロック図、第2図は第1図の命令先
取制御装置を利用したプログラム例を示す説明図、第3
図はプログラム実行時のバッファの内容を示す説明図で
ある。FIG. 1 is a block diagram showing an outline of an instruction preemption control device according to an embodiment of the present invention, FIG. 2 is an explanatory diagram showing an example of a program using the instruction preemption control device of FIG. 1, and FIG.
The figure is an explanatory diagram showing the contents of the buffer during program execution.
第1図において、この命令先取制御装置は、格納命令検
出信号6を出力する格納開始命令検出器1と、命令先取
バッファ2と、マルチプレクサ3と、分岐信号7を出力
する演算器4と、命令格納バッファ5と、プログラムカ
ウンタ退避レジスタ8と、先取命令アドレスレジスタ9
と、プロクラムカウンタ10とを備えている。通常、命
令は先取命令アドレス・レジスタ9により指定されたア
ドレスから、命令先取バッファ2に格納される。In FIG. 1, this instruction prefetch control device includes a storage start instruction detector 1 that outputs a storage instruction detection signal 6, an instruction prefetch buffer 2, a multiplexer 3, an arithmetic unit 4 that outputs a branch signal 7, and a storage start instruction detector 1 that outputs a storage instruction detection signal 6. Storage buffer 5, program counter save register 8, and prefetch instruction address register 9
and a program counter 10. Normally, instructions are stored in the instruction prefetch buffer 2 starting from the address specified by the prefetch instruction address register 9.
このとき、格納開始命令検出器1は先取りされる命令を
チェックし、格納開始命令なら格納命令検出信号6をア
クティブとする。この信号6がアクティブになると、以
降の命令を命令先取バッファ2に格納するだけでなく、
命令格納バッファ5にも格納する。ただし、サイズは命
令格納バッファ5のサイズ分である。マルチプレクサ3
は、命令6−
先取バッファ2と命令格納バッファ5からの命令取り出
しの切り分けを行う。通常は命令先取バッファ2から取
り出すが、分岐信号7がアクティブとなった場合は、命
令格納バッファ5から命令を取り出す。分岐信号7は演
算器4の中で、条件付分岐命令が実行され分岐が行なわ
れる場合にアクティブとなる。命令が命令格納バッファ
5かも取り出されて(・る間に命令先取バッファ2には
命令格納バッファ5に引続く命令を先取りしておき、命
令格納バッファ5の内容を全て取り出した後は引き続き
先取命令バッファ2からの取り出しを行う。このため、
格納開始命令検出時に先取命令アドレスレジスタ9の内
容をプログラムカウンタ退避レジスタ8に退避しておき
、分岐信号7がアクティブになるとこの値をプログラム
・カウンタ10に復帰する。先取命令アドレス・レジス
タ9にはこのプログラム・カウンタ10の値に命令格納
バッファ5のサイズを加えた値をセットし、再び命令先
取バッファ2の先取りを行う。At this time, the storage start command detector 1 checks the instruction to be prefetched, and makes the storage command detection signal 6 active if it is a storage start command. When this signal 6 becomes active, it not only stores subsequent instructions in the instruction prefetch buffer 2, but also stores subsequent instructions in the instruction prefetch buffer 2.
It is also stored in the instruction storage buffer 5. However, the size is the size of the instruction storage buffer 5. multiplexer 3
The command 6 separates the fetching of instructions from the prefetch buffer 2 and the instruction storage buffer 5. Normally, the instruction is taken out from the instruction prefetch buffer 2, but when the branch signal 7 becomes active, the instruction is taken out from the instruction storage buffer 5. The branch signal 7 becomes active in the arithmetic unit 4 when a conditional branch instruction is executed and a branch is taken. While the instruction is also fetched from the instruction storage buffer 5 (・), the instruction following the instruction stored in the instruction storage buffer 5 is prefetched in the instruction prefetch buffer 2, and after all the contents of the instruction storage buffer 5 are fetched, the prefetched instruction continues to be read. Extract from buffer 2. For this reason,
When a storage start instruction is detected, the contents of the prefetch instruction address register 9 are saved in the program counter save register 8, and when the branch signal 7 becomes active, this value is returned to the program counter 10. A value obtained by adding the size of the instruction storage buffer 5 to the value of the program counter 10 is set in the prefetching instruction address register 9, and the prefetching of the instruction prefetching buffer 2 is performed again.
次に、第2図のプログラム例の説明図と第3図のバッフ
ァの内容の遷移を示す説明図とを用(・て本発明の動作
例を示す。第2図にお(・て、12は格納開始命令(S
AVE)であり、16は条件付分岐命令(JC)である
。11,13,14,15.17はプログラム(2)、
a、a、a、@である。まず最初は、プログラム(A)
11が、命令先取バッファ2に入り、実行される/(第
3図の15tep )。Next, an example of the operation of the present invention will be described using the explanatory diagram of the program example in FIG. 2 and the explanatory diagram showing the transition of the contents of the buffer in FIG. is the storage start command (S
AVE), and 16 is a conditional branch instruction (JC). 11, 13, 14, 15.17 is program (2),
a, a, a, @. First of all, program (A)
11 enters the instruction prefetch buffer 2 and is executed (15tep in FIG. 3).
(SAVE)12が先取りされると、検出器1により検
出され(2step)、プログラム(E13は、命令先
取バッファ2と命令格納バッファ50両方に格納される
(3step)。その後も、プログラムIQ、Q)、
14 、15は命令先取バッファ2から取り出され(4
,5step)、JCの実行゛37となる。When (SAVE) 12 is prefetched, it is detected by the detector 1 (2 steps), and the program (E13) is stored in both the instruction prefetch buffer 2 and the instruction storage buffer 50 (3 steps). ),
14 and 15 are taken out from instruction prefetch buffer 2 (4
, 5 steps), and the JC is executed (37).
この時、分岐が成立したとすると、プログラム013が
命令格納バッファ5から取り出される(6゜7step
)。この時、命令先取バッファ2にはプログラム014
の先取りが始まる(8step)。At this time, if the branch is established, program 013 is taken out from the instruction storage buffer 5 (6°7 steps
). At this time, the program 014 is stored in the instruction prefetch buffer 2.
Preemption begins (8 steps).
命令格納バッファ5中のプログラム813の実行が終る
と、命令先取りバッファ2から命令の取り出しが始まり
、プログラム(Q、(I)、14,15を実行する(9
.10step)。次に、JC命令38を実行し、分岐
が成立しなければ、命令先取バッファ2中のプログラム
@17をそのまま実行する。When the execution of the program 813 in the instruction storage buffer 5 is finished, the fetching of instructions from the instruction prefetch buffer 2 starts, and the programs (Q, (I), 14, 15 are executed (9)
.. 10 steps). Next, the JC instruction 38 is executed, and if the branch is not taken, the program @17 in the instruction prefetch buffer 2 is executed as is.
このように、本発明によれば、分岐先の命令があらかじ
め命令格納バッファに格納され(・でるので、分岐時の
メモリアクセスは必要なくなり、また命令格納バッファ
の命令を実行中には、命令先取りバッファに命令格納バ
ッファ以降に引続く命令の先取りを並行して行なえるの
で、情報処理の性能が大幅に改善できるという効果が得
られる。As described above, according to the present invention, the instruction at the branch destination is stored in the instruction storage buffer in advance, so memory access at the time of branching is no longer necessary, and while the instruction in the instruction storage buffer is being executed, instruction prefetching is performed. Since instructions subsequent to the instruction storage buffer can be prefetched in parallel, information processing performance can be significantly improved.
尚、本実施例では、命令格納バッファを一つ用いる例を
示したが、これを複数にすることにより、入し子構造に
なったループプログラムを高速に実行することも可能と
なる。In this embodiment, an example is shown in which one instruction storage buffer is used, but by using a plurality of instruction buffers, it is also possible to execute a nested loop program at high speed.
また第3図において、命令先取バッファの内容18.1
9,20,21,25.26と命令格納バッファの内容
31.32は、命令が承り出されているバッファを示し
ている。In addition, in FIG. 3, the contents of the instruction prefetch buffer 18.1
9, 20, 21, 25.26 and the contents of the instruction storage buffer 31.32 indicate the buffer in which the instruction is being accepted.
9−
第1図は本発明の実施例の命令先取制御装置の櫃略を示
すブロック図、第2図は本発明の実施例を使用したプロ
グラム例を示す説明図、第3図は本発明の実施例を使用
した場合の再バッファの遷移を示す説明図である。
内因において、
1・・・・・・格納開始命令検出器、2・−・・・・命
令先取バッファ、3・・・・・・マルチプレクサ、4・
・・・・・演算器、5・・・・・・命令格納バッファ、
6・−・・・・格納命令検出信号、7・・・・・・分岐
信号、8・・・・・・プログラムカウンタ退避レジスタ
、9・・・・・・先取命令アドレス・レジスタ、10・
・・・・・プログラムカウンタ、11・・・・・・プロ
グラム囚、12・・・・・・格納開始命令(SAVE)
、13・・・・・・プログラム例、14・・・・・・プ
ログラム0.15・・・・・・プログラム0.16・・
・・・・条件付分岐命令(JC)、17・・・・・・プ
ログラム0.18乃至26・・・・・・命令先取バッフ
ァの内容、27乃至35・・・・・・命令格納バッファ
の内容、36・・・・・・格納開始命令実行、37゜第
2図
躬3図9- Fig. 1 is a block diagram showing an outline of an instruction preemption control device according to an embodiment of the present invention, Fig. 2 is an explanatory diagram showing an example of a program using the embodiment of the present invention, and Fig. 3 is a block diagram showing an outline of an instruction preemption control device according to an embodiment of the present invention. It is an explanatory diagram showing transition of re-buffering when using an example. In the internal causes, 1...Storage start instruction detector, 2...Instruction prefetch buffer, 3...Multiplexer, 4...
... Arithmetic unit, 5 ... Instruction storage buffer,
6... Store instruction detection signal, 7... Branch signal, 8... Program counter save register, 9... Preemption instruction address register, 10...
...Program counter, 11...Program prisoner, 12...Storage start command (SAVE)
, 13...Program example, 14...Program 0.15...Program 0.16...
...Conditional branch instruction (JC), 17...Program 0.18 to 26...Contents of instruction prefetch buffer, 27 to 35...Instruction storage buffer Contents, 36... Execution of storage start command, 37゜Figure 2 Figure 3
Claims (1)
バッファに格納するように構成された命令先取制御装置
において、命令格納バッファと、前記命令格納バッファ
に先取命令を格納することを指定する格納開始命令手段
と、前記格納開始命令を検出する検出器と、前記命令格
納バッファを分岐先として指定する条件付分岐命令手段
とを備え、前記格納開始命令を前記検出器により検出し
た時に先取りした命令を前記命令先取バッファおよび前
記命令格納バッファに格納し、前記条件付分岐命令の実
行時に条件成立により分岐する場合は実行命令の取り出
しを前記命令格納バッファより行うように構成されて(
・ることを特徴とする命令先取制御装f。An instruction preemption control device configured to read an execution instruction in advance from a storage means and store it in an instruction prefetch buffer, comprising: an instruction storage buffer; and a storage start command means for specifying that a prefetch instruction is stored in the instruction storage buffer; , comprising: a detector for detecting the storage start instruction; and a conditional branch instruction means for specifying the instruction storage buffer as a branch destination; The instructions are stored in a buffer and the instruction storage buffer, and when the conditional branch instruction is executed and a branch is taken due to the satisfaction of a condition, the execution instruction is retrieved from the instruction storage buffer (
- An instruction preemption control device f.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP16186082A JPS5952349A (en) | 1982-09-17 | 1982-09-17 | Instruction pre-fetch controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP16186082A JPS5952349A (en) | 1982-09-17 | 1982-09-17 | Instruction pre-fetch controller |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS5952349A true JPS5952349A (en) | 1984-03-26 |
JPS6232507B2 JPS6232507B2 (en) | 1987-07-15 |
Family
ID=15743330
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP16186082A Granted JPS5952349A (en) | 1982-09-17 | 1982-09-17 | Instruction pre-fetch controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS5952349A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61165135A (en) * | 1984-12-24 | 1986-07-25 | Fujitsu Ltd | Loop processing system |
WO2006057084A1 (en) * | 2004-11-25 | 2006-06-01 | Matsushita Electric Industrial Co., Ltd. | Command supply device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS518304A (en) * | 1974-07-10 | 1976-01-23 | Toa Nenryo Kogyo Kk | Muhaiseijobunsanzai |
-
1982
- 1982-09-17 JP JP16186082A patent/JPS5952349A/en active Granted
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS518304A (en) * | 1974-07-10 | 1976-01-23 | Toa Nenryo Kogyo Kk | Muhaiseijobunsanzai |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61165135A (en) * | 1984-12-24 | 1986-07-25 | Fujitsu Ltd | Loop processing system |
WO2006057084A1 (en) * | 2004-11-25 | 2006-06-01 | Matsushita Electric Industrial Co., Ltd. | Command supply device |
US7822949B2 (en) | 2004-11-25 | 2010-10-26 | Panasonic Corporation | Command supply device that supplies a command read out from a main memory to a central processing unit |
Also Published As
Publication number | Publication date |
---|---|
JPS6232507B2 (en) | 1987-07-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2858140B2 (en) | Pipeline processor device and method | |
US6760835B1 (en) | Instruction branch mispredict streaming | |
JPH0527143B2 (en) | ||
EP0166431B1 (en) | An information processing apparatus having an instruction prefetch circuit | |
KR910008410B1 (en) | Micro-code redding control system | |
JP3737083B2 (en) | Multicycle instruction | |
JPS5952349A (en) | Instruction pre-fetch controller | |
JP3493110B2 (en) | High-speed branch processing unit | |
JPH04213727A (en) | Information processor | |
JPH0248733A (en) | Information processor | |
JPS6022768B2 (en) | Data processing method | |
JPS63314644A (en) | Data processor | |
JPH027128A (en) | Information processor | |
JPH0527972A (en) | Instruction prefetch device | |
KR970062891A (en) | Operation execution method and operation execution device | |
JPS6029840A (en) | Interruption system for execution program | |
JPH06168120A (en) | Intruction prefetch device | |
JPH0247725A (en) | Data processor | |
JPH0715662B2 (en) | Information processing device for prefetching instructions | |
JPH08212068A (en) | Information processor | |
JPH10283182A (en) | Pipeline information processor | |
JPH05143362A (en) | Interruption processing system | |
JPH04158444A (en) | Information processor | |
JPS63221428A (en) | Data processor | |
JPH01240941A (en) | Information processor |