JPH0238965B2 - - Google Patents
Info
- Publication number
- JPH0238965B2 JPH0238965B2 JP59175994A JP17599484A JPH0238965B2 JP H0238965 B2 JPH0238965 B2 JP H0238965B2 JP 59175994 A JP59175994 A JP 59175994A JP 17599484 A JP17599484 A JP 17599484A JP H0238965 B2 JPH0238965 B2 JP H0238965B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- toar
- store
- tiar
- stis
- 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.)
- Expired - Lifetime
Links
Landscapes
- Advance Control (AREA)
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、パイプライン方式の計算機における
命令先取り制御方式に関し、特にストア命令実行
時に先取りしてある命令列への反映を行うための
効率的な制御方式に関する。[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to an instruction prefetch control method in a pipelined computer, and in particular to an efficient method for reflecting instructions to a prefetched instruction sequence when executing a store instruction. Concerning control methods.
一般に高速の計算機では、命令フエツチ時のメ
モリアクセスにより生じる実行の遅れを実質的に
削減するため、命令の先取り制御が行われてい
る。命令の先取りを行う場合には、各命令の時間
的な順序性を保証することが不可欠であり、たと
えば現在の命令の実行により後続のある命令の内
容が変更されたとき、命令バツフア内に先取りさ
れている命令列中に変更前のものがあれば、その
先取りされた命令の実行を禁止しなければならな
い。
In general, high-speed computers perform instruction prefetch control to substantially reduce execution delays caused by memory access during instruction fetching. When performing prefetching of instructions, it is essential to guarantee the temporal ordering of each instruction. If there is a pre-changed instruction in the command sequence, execution of that prefetched instruction must be prohibited.
計算機には、このような順序性の保証を行うた
めにいくつかの機能が用意されており、その1つ
にSTIS(Store in the Instruction Stream)と
呼ばれている機能がある。 Computers are equipped with several functions to guarantee such ordering, one of which is a function called STIS (Store in the Instruction Stream).
STIS機能は、現在実行されている命令が、す
でに先取りされている命令列の格納領域へのスト
アである場合を検出するもので、もしそようなス
トアがある場合、そのストアを反映するために、
命令バツフアに先取りされている命令列を一旦全
て放棄し、ストアの終了後に再び後続の命令を先
取りしなおす、すなわち再命令先取り(Re−
ifetch)を行うようにするものである。 The STIS function detects when the currently executed instruction is a store to the storage area of an instruction sequence that has already been prefetched. ,
The instruction sequence prefetched by the instruction buffer is temporarily discarded, and subsequent instructions are prefetched again after the store is completed. In other words, re-instruction prefetching (Re-instruction prefetch)
ifetch).
第2図は、このようなストアの具体例を示した
もので、21はメモリの命令格納領域の一部であ
る。現在、0番地から8番地までの命令が命令バ
ツフアに先取りされており、そして0番地のスト
ア命令“ST6番地”が実行された状態にある。し
たがつて6番地の内容が更新されたことにより、
命令バツフアに先取りされている6番地の内容は
無効となる。 FIG. 2 shows a specific example of such a store, where 21 is a part of the instruction storage area of the memory. Currently, instructions from addresses 0 to 8 have been prefetched by the instruction buffer, and the store instruction "ST6 address" at address 0 has been executed. Therefore, as the contents of address 6 have been updated,
The contents of address 6, which is prefetched by the instruction buffer, are invalid.
第3図は、前述したSTIS機能を実現する従来
方式の1例の構成を示したもので、22は実行ア
ドレス生成回路EAG、23は命令バツフアとし
て機能するLBS、24はSTIS検出回路、WAR
は現在実行中のストア命令の作業アドレスすなわ
ち先頭のストアアドレス、IARは命令先取り領域
の先頭アドレスを表している。 FIG. 3 shows the configuration of an example of a conventional method for realizing the above-mentioned STIS function, in which 22 is an execution address generation circuit EAG, 23 is an LBS that functions as an instruction buffer, 24 is an STIS detection circuit, and WAR
is the working address of the store instruction currently being executed, that is, the first store address, and IAR is the first address of the instruction prefetch area.
簡単に説明すると、実行アドレス生成回路
EAG22は、先取りすべき命令のアドレス修飾
計算を行い、命令先取り領域の先頭アドレスIAR
を発生する。IARは、命令バツフアのLBS23
およびSTIS検出回路24へ供給される。 To explain briefly, the execution address generation circuit
EAG22 performs address modification calculation of the instruction to be prefetched, and calculates the start address IAR of the instruction prefetch area.
occurs. IAR is instruction buffer LBS23
and is supplied to the STIS detection circuit 24.
STIS検出回路24は、ストアアドレスWAR
と命令先取り領域の先頭アドレスIARとを比較し
て、WARがIMRで始まる命令先取り領域中に入
るか否かを調べ、先取り領域中に入る場合には
STIS検出信号を出力してその領域中の先取り命
令列を無効化するようにしている。 The STIS detection circuit 24 uses the store address WAR
is compared with the start address IAR of the instruction prefetch area to check whether the WAR will fit into the instruction prefetch area starting with IMR.
A STIS detection signal is output to invalidate the prefetch instruction sequence in that area.
このとき、現在実行中の命令のアドレスを正確
に算出することは難しいので、命令バツフアの深
さにある幅を持たせた区間をSTIS検出範囲とし
ている。 At this time, since it is difficult to accurately calculate the address of the currently executing instruction, the STIS detection range is defined as an interval with a certain width equal to the depth of the instruction buffer.
第4図は、第3図に示した従来方式の構成によ
るストア命令のパイプライン制御タイミングを示
したもので、横軸のD,A,T,B,E,Wはそ
れぞれパイプラインの以下に示す制御ステージを
表している。 Figure 4 shows the pipeline control timing of store instructions in the conventional configuration shown in Figure 3, where D, A, T, B, E, and W on the horizontal axis are below the pipeline, respectively. represents the control stage shown.
D:Decode (命令デコード)
A:Address (実効アドレス生成)
T:Translation (アドレス変換)
B:Buffer (バツフア検索)
E:Execution (演算)
W:Write (レジスタへの書き込み)
図示のように、TステージでSTIS検出が行わ
れ、次のBステージで再先取りフラグ(Re−
ifetch flag)がONに設定される。そして再先取
り(Re−ifetch)の実行は、Wステージの後、す
なわちストア命令が終了した後で開始される。 D: Decode (instruction decode) A: Address (effective address generation) T: Translation (address translation) B: Buffer (buffer search) E: Execution (operation) W: Write (write to register) As shown, T STIS detection is performed at the stage, and the re-preemption flag (Re-
ifetch flag) is set to ON. The execution of Re-ifetch is started after the W stage, that is, after the store instruction is completed.
第3図および第4図で説明した従来方式の場
合、第5図に示す例のように、プログラムAとプ
ログラムAより分岐されるプログラムBがあり、
プログラムAの分岐命令BRANCHの直後に作業
領域があるような場合には、図の上方(アドレス
の低い方)ら下方へ順に実行して行くと、命令と
ともに作業領域の内容まで命令バツフアへ先取り
されることが起こる。その結果、プログラム中の
ストア命令STの実行により、図の矢印で示す作
業領域内へのストアがSTIS検出にかかり、先取
りされているストア命令STの後続命令は無効に
され、再先取り(Re−ifetch)が必要となる。
In the case of the conventional method explained in FIGS. 3 and 4, as in the example shown in FIG. 5, there is a program A and a program B that is branched from program A.
If there is a work area immediately after the branch instruction BRANCH in program A, if the program is executed from the top of the diagram (lower address) to the bottom, the contents of the work area will be prefetched into the instruction buffer along with the instructions. Something happens. As a result, when the store instruction ST is executed in the program, STIS detection is performed on the store in the work area shown by the arrow in the figure, and the subsequent instructions of the store instruction ST that have been prefetched are invalidated, and the re-preemption (Re- ifetch) is required.
しかし実際上は、作業領域が命令として実行さ
れることがないので、上記した再先取りは無駄と
なつて、性能低下の原因となる。 However, in reality, the work area is never executed as an instruction, so the above-mentioned re-preemption is wasteful and causes performance degradation.
特に大型計算機では、命令バツフアが深くなる
傾向にあるため、従来方式では、今後STIS検出
範囲が次第に広くなつて行くことが想定される。
このような状況で、さらにプログラム中でストア
命令が連続して実行されるような場合には、その
たびに再先取り(Re−ifetch)が行われることに
よつて著しく性能が低下することになる。なお、
第5図の例のように分岐命令BRANCHの後に作
業領域がある例は、実際のプログラムでしばしば
見られるところである。 Particularly in large computers, the instruction buffer tends to become deeper, so it is expected that the STIS detection range will gradually become wider in the future using conventional methods.
In this situation, if store instructions are executed continuously in a program, performance will drop significantly due to re-ifetching each time. . In addition,
An example in which there is a work area after the branch instruction BRANCH, as in the example shown in FIG. 5, is often seen in actual programs.
本発明は、現在実行中の命令の先頭アドレスと
ストア命令のオペランドアドレスすなわちストア
命令のストア先頭アドレスとを比較してその差を
求め、以後順次実行される命令の長さの累和がそ
の差を超えない限りSTIGS検出を行わないこと
により、STIS検出範囲を実質的範囲に限定でき
るようにするものである。
The present invention compares the start address of the instruction currently being executed and the operand address of the store instruction, that is, the store start address of the store instruction, and calculates the difference. By not performing STIGS detection unless the range exceeds 1, the STIS detection range can be limited to a practical range.
本発明の構成は、パイプライン方式より命令を
実行および制御するとともに命令の先取りを行う
計算機において、先に実行されたストア命令のス
トア先頭アドレス(TOAR)と現在実行中の命
令の先頭アドレス(TIAR)との差(TOAR−
TIAR)を計算する加算器と、該加算器の出力
(TOAR−TIAR)を保持するカウンタとをそな
え、プログラム中の一連の命令を順次実行してゆ
く際に、
上記加算器の出力(TOAR−TIAR)が負でそ
の絶対値が上記ストア命令のストアオペランドの
長さよりも小さい第1の場合と、上記加算器の出
力(TOAR−TIAR)が正でその値が先取りした
命令を格納するバツフアの深さに関連する値
(STIK)よりも小さいとき命令ごとにその命令
長を上記カウンタの内容から減算し、該減算結果
の値が負になつた第2の場合とにおいて、現在先
取りしてある命令列を無効にして再先取りを行わ
せることを特徴としている。 The configuration of the present invention is to use the store start address (TOAR) of the previously executed store instruction and the start address (TIAR) of the currently executed instruction in a computer that executes and controls instructions using a pipeline system and prefetches instructions. ) and the difference (TOAR−
It is equipped with an adder that calculates the output (TOAR-TIAR) of the adder and a counter that holds the output (TOAR-TIAR) of the adder. The first case where TIAR) is negative and its absolute value is smaller than the length of the store operand of the above store instruction, and the first case where the output (TOAR−TIAR) of the above adder is positive and its value is the buffer storing the prefetched instruction. In the second case where the instruction length is subtracted from the contents of the above counter for each instruction when it is smaller than the value related to the depth (STIK), and the value of the subtraction result becomes negative, the current prefetch is performed. The feature is that the instruction sequence is invalidated and re-preemption is performed.
以下に、本発明の詳細を実施例にしたがつて説
明する。
The details of the present invention will be explained below with reference to Examples.
第1図は、本発明の1実施例であるパイプライ
ンの構成図である。図において、1,2,3,は
それぞれ命令先取り領域命令バツフアの先頭アド
レスを格納するレジスタIAR−0,IAR−1,
IAR−2を示し、4は現在実行中の命令が先頭ア
ドレスIARから何半語目にあるかを半語単位でカ
ウントしているNSIカウンタ、5はこのNSIカウ
ンタの値をIARに加算し、命令実行アドレスを生
成するNSI加算器、6および7はNSI加算器5の
加算結果の命令実行アドレスをAステージおよび
Tステージで保持するレジスタAIARおよび
TIARである。また8はデイスプレイスメントレ
ジスタDR、9はベースレジスタBR、10はイ
ンデツクスレジスタXR、11はオペランドの実
行アドレスを計算するオペランド実行アドレス生
成回路OEAG、12および13はそれぞれTス
テージにおいてオペランド実行アドレスを保持す
るオペランドアドレスレジスタTOAR、OEAR
である。そして14はTIAR7とTOAR12の内
容の差をとるSTIS加算器、15はSTIS検出回路
を示す。なお、図上部のD,A,T,B,E,W
は、第4図で説明したパイプラインの制御ステー
ジとの対応を示している。以下、ストア命令実行
時の動作について述べる。 FIG. 1 is a configuration diagram of a pipeline that is an embodiment of the present invention. In the figure, 1, 2, 3 are registers IAR-0, IAR-1, which store the start address of the instruction prefetch area instruction buffer, respectively.
Indicates IAR-2, 4 is an NSI counter that counts in half-word units the number of half words from the start address IAR of the currently executing instruction, 5 is the value of this NSI counter added to IAR, NSI adders 6 and 7 generate instruction execution addresses, and registers AIAR and 7 hold the instruction execution address of the addition result of NSI adder 5 in the A stage and T stage.
It is TIAR. 8 is a displacement register DR, 9 is a base register BR, 10 is an index register Operand address registers TOAR, OEAR
It is. 14 is an STIS adder that takes the difference between the contents of TIAR7 and TOAR12, and 15 is an STIS detection circuit. In addition, D, A, T, B, E, W at the top of the figure
shows the correspondence with the control stage of the pipeline explained in FIG. The operation when executing a store instruction will be described below.
Dステージにおいて、レジスタIAR−0ないし
IAR−2の指定された1つに保持されている命令
先取り領域(命令バツフア)の先頭アドレスと、
カウンタNSICの内容であるところの前記命令先
取り領域の先頭アドレスから現在実行中の命令の
アドレスまでのオフセツト量とは、NSI加算器で
加算され、結果の実行命令アドレス(先頭アドレ
ス)はAIARへ格納される。 At the D stage, registers IAR-0 to
The start address of the instruction prefetch area (instruction buffer) held in a specified one of IAR-2,
The offset amount from the start address of the instruction prefetch area to the address of the currently executing instruction, which is the contents of the counter NSIC, is added by the NSI adder, and the resulting execution instruction address (start address) is stored in AIAR. be done.
たとえば命令先取り領域を8バイトの長さとし
て、IARに保持されている先頭アドレスが1040、
そしてカウンタNSICの値が4(バイト)であつ
た場合、命令実行アドレスは、1040+4=1044と
なり、この値がAIARに格納される。 For example, if the instruction prefetch area is 8 bytes long, the start address held in IAR is 1040,
If the value of the counter NSIC is 4 (bytes), the instruction execution address is 1040+4=1044, and this value is stored in AIAR.
AIARの実行命令アドレスは、次のAステージ
においてTIARへ転送される。他方、オペランド
実行アドレス生成回路OEAGは、RX形式をとる
ストア命令が指示するDR,BR、XRの内容に基
づいてオペランド実行アドレス(先頭アドレス)
すなわちストアアドレスを生成し、TOARおよ
びOEARへそれぞれ格納する。 The execution instruction address of AIAR is transferred to TIAR in the next A stage. On the other hand, the operand execution address generation circuit OEAG generates the operand execution address (first address) based on the contents of DR, BR, and XR specified by the store instruction in RX format.
In other words, store addresses are generated and stored in TOAR and OEAR, respectively.
次のTステージにおいてSTIS加算器14は
TIARの命令実行アドレスとTOARのオペランド
実行アドレスとの差をとり、その差とTST長
(ストアする長さ)またはSTIK(命令バツフアの
深さに関する目安となる定数)とをSTIS検出回
路15で比較し、STIS検出が行われた場合、再
先取りフラグを設定する。STIS検出には、次の
2つのタイプがある。 In the next T stage, the STIS adder 14
The STIS detection circuit 15 calculates the difference between the instruction execution address of TIAR and the operand execution address of TOAR, and compares the difference with the TST length (length to store) or STIK (a constant that is a guideline for the depth of the instruction buffer). However, if STIS detection is performed, the re-preemption flag is set. There are two types of STIS detection:
タイプ:TIAR−TOAR<TST長
タイプ:TOAR−TIAR<STIK
タイプは、第6図aに示すように、命令実行
アドレス(TIAR)がオペランド実行アドレス
(TOAR)よりも大きい(遠くにある)が、オペ
ランド実行アドレス(TOAR)を先頭にストア
されるオペランドの長さ(TST長)が命令実行
アドレス(TIAR)を越える範囲に亘つている場
合であり、先取りされている実行中の命令または
さらにその後続命令が変更されているため、
STIS状態としてストア命令終了後に直ちに再先
取り(Re−ifetch)する。 Type: TIAR-TOAR<TST length Type: TOAR-TIAR<STIK As shown in Figure 6a, the instruction execution address (TIAR) is larger (farther) than the operand execution address (TOAR), but This is a case where the length of the operand (TST length) stored starting from the operand execution address (TOAR) extends beyond the instruction execution address (TIAR), and the instruction currently being executed or its successor is prefetched. Because the instructions have changed,
As STIS state, re-ifetch is performed immediately after the store instruction ends.
タイプは、第6図bに示すように、オペラン
ド実行アドレス(TOAR)が命令実行アドレス
(TIAR)よりも大きい(遠くにある)が、その
差が命令バツフアの深さに関連して定められるあ
る範囲STIKよりも小さい場合であり、実行中の
命令あるいは先取りされている後続命令が変更さ
れている可能性があるため、さらに命令実行ごと
にその命令の語尾部分がオペランド実行アドレス
(ストアアドレス)にかかるか否かをチエツクし、
かかつた場合にはじめてSTIS状態とするもので
ある。 The type is one in which the operand execution address (TOAR) is larger (farther) than the instruction execution address (TIAR), but the difference is determined in relation to the depth of the instruction buffer, as shown in Figure 6b. If the range is smaller than STIK, and the instruction being executed or the subsequent instruction that has been prefetched may have been changed, the end of the instruction is changed to the operand execution address (store address) each time the instruction is executed. Check whether it takes or not.
Only when this happens is the STIS status established.
第7図は、第1図に示された実施例における
STIS検出回路の細部構成図である。図において、
14はオペランド実行アドレスと命令実行アドレ
スの差(TOAR−TIAR)を求めるSTIS加算器、
15はSTIS検出回路、25はタイプ検出用の
加算器、26はタイプ検出用の加算器、27は
正検出器、28はOR回路、29は(TOAR−
TIAR)から実行された命令の長さTILCを逐次
減算するためのカウンタSTIC、30はSTICの有
効/無効を表示するラツチSTIC VALID、31
は命令の長さTILC減算機のILC加算器、32は
セレクタ、33は比較器、34は負検出器を表し
ている。 FIG. 7 shows the embodiment shown in FIG.
FIG. 3 is a detailed configuration diagram of the STIS detection circuit. In the figure,
14 is an STIS adder that calculates the difference between the operand execution address and the instruction execution address (TOAR - TIAR);
15 is an STIS detection circuit, 25 is an adder for type detection, 26 is an adder for type detection, 27 is a positive detector, 28 is an OR circuit, 29 is a (TOAR-
Counter STIC for sequentially subtracting the length of the executed instruction TILC from TIAR), 30 is a latch STIC VALID, 31 that displays the validity/invalidity of STIC.
is an instruction length TILC adder of the TILC subtracter, 32 is a selector, 33 is a comparator, and 34 is a negative detector.
まずストア命令実行の際、STIS加算器14は
TOAR+(−TIAR)の加算を行う。ここで
TOAR−TIAR<0であれば、加算器25で
TST−(TIAR−TOAR)が計算され、正検出器
27が、
TST長−(TIAR−TOAR)>0
を検出した場合、前記したタイプの条件が成立
するので、OR回路28を介してSTIS検出信号を
出力する。 First, when executing a store instruction, the STIS adder 14
Add TOAR+(-TIAR). here
If TOAR−TIAR<0, adder 25
When TST-(TIAR-TOAR) is calculated and the positive detector 27 detects TST length-(TIAR-TOAR)>0, the above-mentioned type of condition is satisfied, so STIS is detected via the OR circuit 28. Output a signal.
他方、TOAR−TIAR>0であれば、加算器2
6で
(TOAR−TIAR)−STIK
を計算する。ここで前記したタイプの条件
(TOAR−TIAR)−STIK<0
が成立すれば、さらにカウンタSTIC,ILC加算
器、負検出器などによりSTIS条件をチエツクし
てゆく。すなわち命令を実行するごとにその長さ
TILCを(TOAR−TIAR)から減算して行き、
その値が負になつたとき、すなち実行中の命令の
語尾部分がストアアドレスのTOAR以後と重な
り、その実行中の命令または実行中の命令とその
後続命令とが、ストア命令によつて書き替えられ
ているものと判定し、STIS検出信号を出力する。
この条件は、例えばストア命令とそれに続いて実
行される各命令の長さをTILC0,TILC1,……
TILCrとし、後続命令はストア命令ではないとし
たとき、はじめて、(TOAR−TIAR)
−(TILC0+TILC1+……+TILCr)<0
となるr番目の命令でSTIS検出するもので、r
−1番目までの命令まではSTIS検出とならない
ので再先取りを行わずに済まさせることができ
る。 On the other hand, if TOAR−TIAR>0, adder 2
In step 6, calculate (TOAR−TIAR)−STIK. If the above-mentioned type of condition (TOAR-TIAR)-STIK<0 is satisfied, the STIS condition is further checked using the counter STIC, ILC adder, negative detector, etc. That is, each time an instruction is executed, its length
Subtract TILC from (TOAR−TIAR),
When the value becomes negative, that is, the end of the instruction being executed overlaps with the part after TOAR of the store address, and the instruction being executed or the instruction being executed and the subsequent instruction are It determines that it has been rewritten and outputs a STIS detection signal.
This condition, for example, defines the length of a store instruction and each subsequent instruction executed as TILC 0 , TILC 1 ,...
TILC r , and assuming that the subsequent instruction is not a store instruction, STIS is detected for the first time at the r-th instruction such that (TOAR - TIAR) - (TILC 0 + TILC 1 + ... + TILC r ) < 0, and r
- Since STIS detection is not performed until the first instruction, re-preemption can be avoided.
このため、カウンタSTICにはストア命令の実
行時にTOAR−TIARが設定され、以後後続命令
が実行されるたびにその命令長TILCをILC加算
器でカウンタSTICの内容から減算し、減算結果
を再びカウンタSTICに格納する循環的な減算動
作が行われる。セレクタ32は、上記したカウン
タSTICへの(TOAR−TIAR)の設定とその後
の実行命令長の減算動作とを切り替えるために使
用される。比較器33は、2回目以降のストア命
令出現時にその(TOAR−TIAR)値とカウンタ
STICの現在値とを比較し、(TOAR−TIAR)<
STICであれば、この新しいストア命令の
(TOAR−TIAR)値をSTICに設定するよう、セ
レクタ32を制御する。これは、タイプSTIS
が検出されたストア命令が2つ以上ある時STIS
検出が最もSTISになるのが早いストアアドレス
に対して行われる必要があるからである。負検出
器34はILC加算器31からの減算結果が負にな
つたとき、OR回路28からSTIS検出信号を出力
する。 Therefore, TOAR−TIAR is set in the counter STIC when a store instruction is executed, and every time a subsequent instruction is executed thereafter, the instruction length TILC is subtracted from the contents of the counter STIC by the ILC adder, and the subtraction result is returned to the counter STIC. A cyclic subtraction operation is performed to store the . The selector 32 is used to switch between setting (TOAR-TIAR) to the counter STIC described above and subtracting the execution instruction length thereafter. The comparator 33 compares the (TOAR−TIAR) value and the counter when a store instruction appears for the second time or later.
Compare with the current value of STIC, (TOAR−TIAR)<
If it is STIC, the selector 32 is controlled to set the (TOAR-TIAR) value of this new store instruction to STIC. This is type STIS
STIS when there are two or more store instructions detected.
This is because detection needs to be performed for the store address where STIS occurs earliest. The negative detector 34 outputs a STIS detection signal from the OR circuit 28 when the subtraction result from the ILC adder 31 becomes negative.
第8図はタイプのストア命令検出時の制御フ
ローを示したものである。なお、(TOAR−
TIAR)=Aとする。 FIG. 8 shows the control flow when a type store instruction is detected. In addition, (TOAR−
TIAR)=A.
ストア命令実行時に、STIC VALID=0のと
きは、初めてタイプとなつてときであるので、
現命令のAを求めるSTIC←A、STIC VALID←
1に設定する。 When STIC VALID = 0 when executing a store instruction, it is the first time it has become a type, so
STIC←A, STIC VALID← to find A of the current instruction
Set to 1.
他方 STIC VALID=1のときは、すでに先
行ストア命令によりSTICに有効データが設定済
みであるので、STICと現命令のAのどちらかが
小さいかを調べ、STIC−TILC<Aであれば
STIC←(STIC−TILC)の減算を行い、STIC
−TILCAであればこのAでSTICを更新する。
すなわち常により小さいSTIS検出範囲を採用す
る。 On the other hand, when STIC VALID = 1, valid data has already been set in STIC by the preceding store instruction, so check whether STIC or A of the current instruction is smaller, and if STIC - TILC < A
Perform subtraction of STIC←(STIC−TILC), and STIC
-If it is TILCA, update STIC with this A.
That is, always adopt a smaller STIS detection range.
第9図は、第8図で検出するタイプのストア
命令に続く他の通常命令(非ストア命令)実行時
の制御フローを示したものである。 FIG. 9 shows a control flow when executing another normal instruction (non-store instruction) following the store instruction of the type detected in FIG.
まずSTIC VALID=1の場合、STICより現在
実行している命令の長さTILCを減じ、結果値を
STICに代入する。この値が“0”以下である場
合、最後にSTICにTOAR−TIARを設定したス
トア命令のストアアドレスが、現在実行している
命令の中に含まれることになるので、命令実行を
中止して、その実行していた命令から再先取りし
て命令実行をやり直す。他方、STIC VALID=
0の場合には、タイプによるSTIS検出は行わ
れない。 First, if STIC VALID = 1, subtract the length of the currently executed instruction TILC from STIC and use the result value as
Assign to STIC. If this value is less than "0", the store address of the store instruction that last set TOAR-TIAR in STIC will be included in the currently executing instruction, so instruction execution will be stopped. , pre-fetch the instruction that was being executed again and re-execute the instruction. On the other hand, STIC VALID=
If 0, STIS detection by type is not performed.
またBRANCH,LPSW、および割込みなどで
実行中の命令のアドレスが変わる命令では、
STIC VALIDを“0”にリセツトする。その件
果第5図の例で説明したような無駄なSTIS検出
と再先取りが抑制される。 Also, for instructions that change the address of the instruction being executed due to BRANCH, LPSW, and interrupts,
Reset STIC VALID to “0”. As a result, wasteful STIS detection and preemption as described in the example of FIG. 5 are suppressed.
第10図は第7図に示した本発明実施例回路の
有効性を説明するためのプログラム例であり、第
11図はその実行時のパイプラインにおける
STIS検出動作を示したものである。第11図中
の要素14,29,30,31は、それぞれ第7
図におけるSTIS加算器、カウンタSTIC、ラツチ
STIC VALID、ILC加算器を表している。また
第10図および第11図中の番号乃至はプロ
グラム中の順次の命令とパイプライン動作との対
応を示している。なお簡単化のため、命令長
TILCは全て2バイトとする。 FIG. 10 is a program example for explaining the effectiveness of the circuit according to the embodiment of the present invention shown in FIG. 7, and FIG. 11 shows the pipeline during execution.
This shows STIS detection operation. Elements 14, 29, 30, and 31 in FIG.
STIS adder, counter STIC, latch in figure
Represents STIC VALID, ILC adder. The numbers in FIGS. 10 and 11 also show the correspondence between sequential instructions in the program and pipeline operations. For simplicity, the instruction length is
All TILCs are 2 bytes.
のストア命令ST18は最初のストア命令であ
り、STIS加算器14はTOAR−TIAR=18−0
=18を計算する。これによりタイプに検出さ
れ、STIC VALIDをONに設定するとともに
STIC29に“18”を設定する。 The store instruction ST18 is the first store instruction, and the STIS adder 14 has TOAR−TIAR=18−0
Calculate =18. This will detect the type and set STIC VALID to ON as well as
Set “18” to STIC29.
のストア命令ST22では、STIS加算器の出力
がTOAR−TIAR=22−2=20であり、STIC=
18の方が小さいので、IC加算器31の出力STIC
−TILC=18−2=16をSTIS29に代入する。 In the store instruction ST22, the output of the STIS adder is TOAR−TIAR=22−2=20, and STIC=
18 is smaller, so the output STIC of IC adder 31
Substitute -TILC=18-2=16 into STIS29.
の通常(非ストア)命令Aでは、ILC加算器
31の加算結果STIC−TILC=16−2=14を
STIC29に代入する。 In normal (non-store) instruction A, the addition result of ILC adder 31 STIC-TILC=16-2=14 is
Assign to STIC29.
のストア命令ST16では、STIS加算器14は
TOAR−TIAR=16−6=10を出力し、これは
STIC=14よりも小さいので、この値“10”を選
択し、STIS29に代入する。 In the store instruction ST16, the STIS adder 14
Outputs TOAR−TIAR=16−6=10, which is
Since STIC is smaller than 14, select this value "10" and substitute it into STIS29.
およびの通常命令B,Cでは、それぞれ
ILC加算器がSTICから命令長2ずつ減算し、
STIC=6となる。 In the normal instructions B and C of and, respectively,
The ILC adder subtracts the instruction length by 2 from STIC,
STIC=6.
の命令BRANCHでは、STC VALIDが
“0”にリセツトされ、タイプによるSTIS検出
動作は一旦終了する。 In the instruction BRANCH, STC VALID is reset to "0" and the type-based STIS detection operation is temporarily terminated.
以上のように本発明によれば、実行命令が実際
にストアアドレスにかかるかどうかを調べて再先
取りを開始するようにしているため、制御動作の
無駄がなくなり、従来方式にくらべて計算機の著
しい性能向上を図ることができる。
As described above, according to the present invention, re-prefetching is started after checking whether the execution instruction actually applies to the store address, which eliminates wasted control operations and significantly reduces computer processing costs compared to conventional methods. Performance can be improved.
第1図は本発明の1実施例の構成図、第2図は
再先取りが必要なストア命令の説明図、第3図は
従来のSTIS機能を実現した回路の1例を示す構
成図、第4図は第3図に示した従来例回路の動作
を示すパイプラインの制御タイミング図、第5図
はSTIS検出により不要な再先取りが生じるプロ
グラムの説明図、第6図は第1図に示した実施例
におけるSTIS検出のタイプおよびタイプの
説明図、第7図は第1図に示した実施例における
STIS検出回路の細部構成図、第8図および第9
図はそれぞれ第7図に示したSTIS検出回路の動
作を示す制御フロー図、第10図は実施例の動作
を説明するためのプログラム例の説明図、第11
図は第10図に示すプログラムの実行における
STIS検出動作を示す説明図である。
図中、5は命令実行アドレスを生成するNSI加
算器、7はレジスタTIAR、11はオペランド実
行アドレス生成回路OEAG、12はレジスタ
TOAR、14はSTIS加算器、15はSTIS検出
回路、TILCは実行命令の長さ、TST長はストア
されるオペランドの長さを表す。
FIG. 1 is a block diagram of one embodiment of the present invention, FIG. 2 is an explanatory diagram of a store instruction that requires re-prefetching, FIG. 3 is a block diagram showing an example of a circuit that implements the conventional STIS function, and FIG. Figure 4 is a pipeline control timing diagram showing the operation of the conventional example circuit shown in Figure 3, Figure 5 is an explanatory diagram of a program that causes unnecessary re-preemption due to STIS detection, and Figure 6 is the same as shown in Figure 1. FIG. 7 is an explanatory diagram of types and types of STIS detection in the embodiment shown in FIG.
Detailed configuration diagram of STIS detection circuit, Figures 8 and 9
The figures are a control flow diagram showing the operation of the STIS detection circuit shown in Fig. 7, Fig. 10 is an explanatory diagram of a program example for explaining the operation of the embodiment, and Fig. 11 is a control flow diagram showing the operation of the STIS detection circuit shown in Fig. 7.
The figure shows the execution of the program shown in Figure 10.
FIG. 3 is an explanatory diagram showing STIS detection operation. In the figure, 5 is an NSI adder that generates an instruction execution address, 7 is a register TIAR, 11 is an operand execution address generation circuit OEAG, and 12 is a register
TOAR, 14 is an STIS adder, 15 is an STIS detection circuit, TILC is the length of an execution instruction, and TST length is the length of an operand to be stored.
Claims (1)
御するとともに命令の先取りを行う計算機におい
て、先に実行されたストア命令のストア先頭アド
レス(TOAR)と現在実行中の命令の先頭アド
レス(TIAR)との差(TOAR−TIAR)を計算
する加算器と、該加算器の出力(TOAR−
TIAR)を保持するカウンタとをそなえ、プログ
ラム中の一連の命令を順次実行してゆく際に、 上記加算器の出力(TOAR−TIAR)が負でそ
の絶対値が上記ストア命令のストアオペランドの
長さよりも小さい第1の場合と、上記加算器の出
力(TOAR−TIAR)が正でその値が先取りした
命令を格納するバツフアの深さに関連する値
(STIK)よりも小さいとき命令ごとにその命令
長を上記カウンタの内容から減算し、該減算結果
の値が負になつた第2の場合とにおいて、現在先
取りしてある命令列を無効にして再先取りを行わ
せることを特徴とする命令先取り制御方式。[Claims] 1. In a computer that executes and controls instructions using a pipeline system and also prefetches instructions, the store start address (TOAR) of the previously executed store instruction and the start address (TOAR) of the currently executed instruction TIAR) and an adder that calculates the difference (TOAR−TIAR) and the output of the adder (TOAR−TIAR).
When a series of instructions in a program are sequentially executed, the output of the adder (TOAR - TIAR) is negative and its absolute value is the length of the store operand of the store instruction. In the first case, when the output of the adder (TOAR−TIAR) is positive and its value is smaller than the value (STIK) related to the depth of the buffer storing the prefetched instruction, the An instruction characterized by subtracting the instruction length from the contents of the counter, and in a second case where the value of the subtraction result becomes negative, invalidating the currently prefetched instruction sequence and causing the prefetch to be performed again. Preemptive control method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP17599484A JPS6154541A (en) | 1984-08-24 | 1984-08-24 | Instruction prefetch control system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP17599484A JPS6154541A (en) | 1984-08-24 | 1984-08-24 | Instruction prefetch control system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6154541A JPS6154541A (en) | 1986-03-18 |
| JPH0238965B2 true JPH0238965B2 (en) | 1990-09-03 |
Family
ID=16005845
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP17599484A Granted JPS6154541A (en) | 1984-08-24 | 1984-08-24 | Instruction prefetch control system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS6154541A (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| DE4412539C2 (en) * | 1993-04-12 | 2002-06-27 | Nsk Ltd | Ball screw |
| JP4779664B2 (en) * | 2006-01-19 | 2011-09-28 | 日本精工株式会社 | Ball screw |
| JP2007285351A (en) * | 2006-04-13 | 2007-11-01 | Nsk Ltd | Ball screw |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5482140A (en) * | 1977-12-14 | 1979-06-30 | Hitachi Ltd | Information processor |
| JPS57185545A (en) * | 1981-05-11 | 1982-11-15 | Hitachi Ltd | Information processor |
-
1984
- 1984-08-24 JP JP17599484A patent/JPS6154541A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6154541A (en) | 1986-03-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4827402A (en) | Branch advanced control apparatus for advanced control of a branch instruction in a data processing system | |
| JPH03147022A (en) | Branch instruction processing apparatus and method | |
| US5297281A (en) | Multiple sequence processor system | |
| JPH0564815B2 (en) | ||
| JP2006520964A5 (en) | ||
| JP2006520964A (en) | Method and apparatus for branch prediction based on branch target | |
| US7017026B2 (en) | Generating lookahead tracked register value based on arithmetic operation indication | |
| JPS6125169B2 (en) | ||
| US5978905A (en) | Program translating apparatus and a processor which achieve high-speed execution of subroutine branch instructions | |
| JPH0238965B2 (en) | ||
| CN102566977A (en) | Bytecode branch processor and method | |
| EP0969358A2 (en) | Information processing device and method for performing parallel processing | |
| JPH06266556A (en) | Data processor | |
| KR100930332B1 (en) | Processors and Control Methods | |
| US6775740B1 (en) | Processor having a selector circuit for selecting an output signal from a hit/miss judgement circuit and data from a register file | |
| US6711671B1 (en) | Non-speculative instruction fetch in speculative processing | |
| JPH10124312A (en) | Central processing unit | |
| JP2694799B2 (en) | Information processing device | |
| EP1358550A1 (en) | Synchronization of a main processor with an instruction path coprocessor | |
| JPH0384632A (en) | Data processor | |
| JP3762608B2 (en) | Computer and its control method | |
| KR960003052B1 (en) | Microprocessor having cashe memory unit | |
| JP2504191B2 (en) | Microprocessor | |
| JP2008191824A (en) | Prefetch method and unit for cache mechanism | |
| Pimentel et al. | Hardware versus hybrid data prefetching in multimedia processors: A case study |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees | ||
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| R360 | Written notification for declining of transfer of rights |
Free format text: JAPANESE INTERMEDIATE CODE: R360 |
|
| R360 | Written notification for declining of transfer of rights |
Free format text: JAPANESE INTERMEDIATE CODE: R360 |
|
| R370 | Written measure of declining of transfer procedure |
Free format text: JAPANESE INTERMEDIATE CODE: R370 |