JPH0342723A - Data processor - Google Patents

Data processor

Info

Publication number
JPH0342723A
JPH0342723A JP17703489A JP17703489A JPH0342723A JP H0342723 A JPH0342723 A JP H0342723A JP 17703489 A JP17703489 A JP 17703489A JP 17703489 A JP17703489 A JP 17703489A JP H0342723 A JPH0342723 A JP H0342723A
Authority
JP
Japan
Prior art keywords
instruction
branch
branching
address
flop
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.)
Pending
Application number
JP17703489A
Other languages
Japanese (ja)
Inventor
Toshinao Ide
井手 敏直
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 JP17703489A priority Critical patent/JPH0342723A/en
Publication of JPH0342723A publication Critical patent/JPH0342723A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To efficiently pre-fetch an instruction by allowing a programmer to expect the realization/non-realization of branching and designating it in a flip flop by means of the instruction. CONSTITUTION:The branching expectation flip flop 15 can be set/reset by the other instruction. When the branching expectation FF 15 is set, an AND gate 18 is driven, and an address selection circuit 13 does not select the output of a normal instruction address selection circuit 12 but selects a branching address 16 instructed in the low-order of the branching instruction, transmits it to a main storage device 1 and pre-fetches the instruction of a branching destination. When branching expectation FF 15 is not set or when the instruction is not the branching instruction, the AND gate 18 is not driven but the normal instruction address selection circuit 12 is selected, and a normal sequence is pre-fetched.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明はデータ処理装置のブランチ命令方式に関し、特
にブランチ命令によるブランチ先の先取り方式に関する
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a branch instruction system for a data processing device, and more particularly to a system for preempting a branch destination using a branch instruction.

[従来の技術] 従来、データ処理装置においては命令実行速度を上げる
ため命令読出しの先取りを行なっている。
[Prior Art] Conventionally, in data processing devices, instructions are read in advance in order to increase the instruction execution speed.

これはブランチ命令時ブランチ先の命令を先取りして読
出しておき、ブランチ条件が成立した場合。
This happens when the branch destination instruction is prefetched and read out during a branch instruction, and the branch condition is met.

即ブランチ先の命令が実行できるよう禍成されている。It is designed so that the instruction at the immediate branch destination can be executed.

[発明が解決しようとする課題] 前述した従来のブランチ先の命令の先取りは。[Problem to be solved by the invention] The conventional prefetching of branch destination instructions mentioned above.

ブランチ命令におけるブランチ条件が成立した場合、最
も有効に動作する。しかし、ブランチ条件が不成立の場
合、改めてブランチ命令の次の命令の読出しを始めなけ
ればならないという欠点かある。即ち、ブランチ命令が
読出された場合必ずブランチ先の命令を読出すため、ブ
ランチ条件が成立する確率が高い場合は有効であるが、
ブランチ条件が成立する確率が低い場合は効率が悪くな
る。
It operates most effectively when the branch condition in the branch instruction is satisfied. However, there is a drawback that if the branch condition is not satisfied, reading of the instruction following the branch instruction must be started again. In other words, when a branch instruction is read, the instruction at the branch destination is always read, so it is effective when the probability of the branch condition being satisfied is high.
If the probability of the branch condition being satisfied is low, the efficiency will be poor.

[課題を解決するための手段] 本発明によるデータ処理装置は、命令にてセット/リセ
ットできるブランチ成立/不成立の予想のためのフリッ
プフロップと、ブランチ命令を検出する回路と、メモリ
リクエストアドレスとしてブランチ命令で、かつ前記予
想フリップフロップがセットされている場合ブランチ命
令によるブランチ先のアドレスを選択し、前記予想フリ
ップフロップがセットされていない場合通常シーケンス
の命令のアドレスを選択する選択回路とを有している。
[Means for Solving the Problems] A data processing device according to the present invention includes a flip-flop for predicting whether a branch is established or not established which can be set/reset by an instruction, a circuit for detecting a branch instruction, and a circuit that detects a branch instruction as a memory request address. a selection circuit that selects a branch destination address according to a branch instruction when the predicted flip-flop is set, and selects an address of a normal sequence instruction when the predicted flip-flop is not set. ing.

[実施例] 次に1本発明について図面を参照して説明する。[Example] Next, one embodiment of the present invention will be explained with reference to the drawings.

第1図は本発明の実施例を示す図である。この図におい
て、主記憶装置1に格納されているプログラムはプログ
ラムバッファ2に読出され1通常プログラムバッファ3
,4を経て命令レジスタ5へ格納される。命令レジスタ
5の内容はデータ処理部6へ送られて解読 実行に移さ
れデータ処理される。また、プログラムバッファ2.3
.4及び命令レジスタ5に対応してプログラムの主記憶
上のアドレスを保持するためのレジスタ7.89.10
が存在し、命令先取りのアドレスレジスタとして利用さ
れる。
FIG. 1 is a diagram showing an embodiment of the present invention. In this figure, a program stored in a main memory 1 is read out to a program buffer 2;
, 4 and then stored in the instruction register 5. The contents of the instruction register 5 are sent to the data processing section 6, where they are decoded, executed, and processed. Also, program buffer 2.3
.. Register 7.89.10 for holding the address on the main memory of the program corresponding to 4 and instruction register 5
exists and is used as an address register for instruction prefetching.

今、ブランチ命令でない通常の命令の場合、命令レジス
タ5に読出されたデータ処理部6で処理されるが、プロ
グラム先取りのため現在の命令のアドレスレジスタ10
に数命令分(プログラムバッファ2,3.4の格納状況
により変化)の先のアドレス11を加え、アドレス選択
回路12,13を介して主記憶装置1へ送り読出しリク
エストを行う。
Now, in the case of a normal instruction that is not a branch instruction, it is processed by the data processing unit 6 that is read out to the instruction register 5, but since the program is prefetched, the address register 10 of the current instruction is
The next address 11 corresponding to several instructions (varies depending on the storage status of the program buffers 2, 3, 4) is added to the address selection circuits 12, 13, and sent to the main memory 1 to issue a read request.

次に、ブランチ命令の場合、プログラムバッファ2に読
出された命令の命令コードが命令解読回路14に送られ
るとブランチ命令であるため信号線]7が駆動される。
Next, in the case of a branch instruction, when the instruction code of the instruction read into the program buffer 2 is sent to the instruction decoding circuit 14, the signal line ]7 is driven because it is a branch instruction.

ここで、他の命令にてセット/リセットできるブランチ
予想フリップフロップ15がセットされている場合アン
ドゲート]8が駆動され、アドレス選択回路13は通常
命令アドレス選択回路12の出力は選択せず、ブランチ
命令の下位に指示されているブランチアドレス16を選
択して主記憶装置1に送りブランチ先の命令先取りを行
う。一方、ブランチ予想フリップフロップ15がセット
されていない場合、あるいはブランチ命令でない場合は
アンドゲート18は駆動されず2通常命令アドレス選択
回路12が選択され通常シーケンスの先取りが行われる
Here, if the branch prediction flip-flop 15 that can be set/reset by another instruction is set, the AND gate]8 is driven, and the address selection circuit 13 normally does not select the output of the instruction address selection circuit 12, but branches The branch address 16 specified below the instruction is selected and sent to the main memory 1 to prefetch the branch destination instruction. On the other hand, if the branch prediction flip-flop 15 is not set or if the instruction is not a branch instruction, the AND gate 18 is not driven and the two normal instruction address selection circuits 12 are selected and the normal sequence is prefetched.

次に、第2図のタイミングチャートを参照して本発明の
効果を従来別と比較しながら説明する。
Next, the effects of the present invention will be explained while comparing with the conventional one with reference to the timing chart of FIG.

第2図において、命令はA、(A+1)、(A+2)、
・・・と続き、(A+2)なる命令はブランチ命令で、
ブランチ先の命令はBと仮定している。
In Figure 2, the instructions are A, (A+1), (A+2),
...and the instruction (A+2) is a branch instruction,
It is assumed that the branch destination instruction is B.

第2図(a)は従来の方式で命令の先取りはあるが ブ
ランチ先の先取りはない場合でブランチ命令(A+2)
が条件成立するタイミングチャートである。メモリリク
エストアドレスとプログラムバッファ2,3.4および
命令レジスタ5には図で示したようなアドレス及びアド
レスの内容がセットされる。
Figure 2 (a) shows a conventional method in which the instruction is prefetched but the branch destination is not prefetched, which is a branch instruction (A+2).
This is a timing chart in which the condition is satisfied. The memory request address, program buffers 2, 3.4, and instruction register 5 are set with addresses and address contents as shown in the figure.

一方、第2図(a)においてA、、(A+1)、Bは2
ステ一ジ時間か必要な命令であり、(A+2)はブラン
チ命令で1ステージで終了する。命令レジスタ5に(A
+2)かセットされた時点ては既に(A+5)の読出し
リクエストが出されていてプログラムバッファには(A
+3)なる命令がセットされており、さらに(A+4)
、(A+5)が読出されてくる。しかし、(A+2)な
るブランチ命令がブランチする場合Bなる命令を読出す
必要があり、(A+3)、(A+4)、(A+5)の命
令を捨て、Bが命令レジスタ5にセットされるまで処理
を中断しなければならない。即ち、このタイムチャート
の場合、4ステージウエイトさせる必要がある。
On the other hand, in Fig. 2(a), A, , (A+1), and B are 2
This instruction requires a stage time, and (A+2) is a branch instruction that completes in one stage. In instruction register 5 (A
+2) is set, a read request for (A+5) has already been issued and the program buffer has (A
+3) is set, and (A+4)
, (A+5) are read out. However, when the branch instruction (A+2) branches, it is necessary to read the instruction B, and the instructions (A+3), (A+4), and (A+5) are discarded, and processing continues until B is set in instruction register 5. must be interrupted. That is, in the case of this time chart, it is necessary to wait four stages.

次に、第2図(b)のタイムチャートはブランチ先の先
取りがあり、ブランチ命令(A+2)の条件成立の場合
である。この場合、プログラムバッファ2にブランチ命
令(A+2)がセットされるとBの読出しリクエストを
行うため1ステージのウェイトで済む。
Next, the time chart of FIG. 2(b) shows a case where the branch destination is prefetched and the condition of the branch instruction (A+2) is satisfied. In this case, when the branch instruction (A+2) is set in the program buffer 2, a read request for B is made, so one stage of wait is sufficient.

次に、第2図(C)のタイムチャートはブランチ先の先
取りはあるがブランチ条件不成立の場合てプログラムバ
ッファ2にブランチ命令(A+2)かセットされたB2
i、Hの読出しリクエストを行いさらに命令(B+1)
もリクエストするが、命令レジスタ5における(A+2
)のブランチ条件が不成立のためB、(B+1)を捨て
、(A+4)以降の読出しが必要となり、3ステージの
ウェイトが必要となる。
Next, in the time chart of FIG. 2(C), when the branch destination is prefetched but the branch condition is not satisfied, a branch instruction (A+2) or B2 is set in the program buffer 2.
i, H read request and further command (B+1)
is also requested, but (A+2
) is not satisfied, so it is necessary to discard B and (B+1) and read from (A+4) onward, requiring three stages of wait.

第3図は第2図のウェイト数をまとめたもので従来のウ
ェイト数と本発明のブランチ予想フリップフロップ15
を使用した場合のウェイト数の比較である。
Figure 3 summarizes the weight numbers in Figure 2, including the conventional weight number and the branch prediction flip-flop 15 of the present invention.
This is a comparison of the number of weights when using .

この図において、ブランチ予想フリップフロップ15か
セットされている場合はブランチ成立/不成立のウェイ
ト数は従来と同様1ウエイト73ウエイトで同じである
が、ブランチ予想フリップフロップ15がセットされて
いない場合は4ウエイト70ウエイトである。即ち、ブ
ランチが成立する場合は本発明は従来と同じか遅くなる
(ブランチ予想なしの時)が、ブランチ不成立の場合は
本発明の場合は従来と同じか早くなる。従って。
In this figure, when the branch prediction flip-flop 15 is set, the number of waits for branch establishment/failure is 1 wait and 73 waits, which is the same as before, but when the branch prediction flip-flop 15 is not set, the number of waits for branch establishment/unestablishment is 1 wait and 73 waits. The weight is 70 weight. That is, when the branch is taken, the present invention is the same or slower than the conventional method (when no branch prediction is made), but when the branch is not taken, the present invention is the same or faster than the conventional method. Therefore.

プログラマがブランチしないと予想した時にブランチす
る場合とブランチしない場合の比較となるが、これは一
般にプログラマがプログラミングするときある程度の確
率で予想できるので ブランチしない確率が高いと予測
した時にブランチする場合よりもブランチしない確率か
圧倒的に多いと考えられる。従って、ブランチ不成立を
予想してブランチ不成立の場合、従来より3ウエイト無
駄を省けることになる。
This is a comparison between branching when the programmer predicts not to branch and not branching, but since programmers can generally predict this with a certain degree of probability when programming, it is better to branch when the programmer predicts that there is a high probability of not branching. It is thought that the probability of not branching is overwhelmingly high. Therefore, when a branch is predicted to fail and the branch fails, three waits can be wasted compared to the conventional method.

第4図はブランチ命令が成立/不成立する確率を具体的
に設定した時の平均ウェイト数を算出した図である。
FIG. 4 is a diagram in which the average weight number is calculated when the probability that a branch instruction is established or not established is specifically set.

ブランチ命令Bl、B2.B3.B4の各々のブランチ
する/しないの確率と、ブランチ予想フリップフロップ
15を使用した本発明の場合とブランチ予想フリップフ
ロップを使用しない従来の平均ウェイト数は、ブランチ
予想フリップフロップを立てた場合は同じであるが、ブ
ランチ予想フリップフロップを立てない場合は本発明の
方が少ない。叩ち、ブランチ命令B1〜B4を経る平均
ウ エイト 5、4となり明らかに効果がわかる。
Branch instructions Bl, B2. B3. The probability of branching/not branching for each of B4 and the average number of weights in the case of the present invention using the branch prediction flip-flop 15 and in the conventional case without using the branch prediction flip-flop are the same when the branch prediction flip-flop is set up. However, the present invention has fewer cases in which the branch prediction flip-flop is not set up. The average weight after hitting and branching instructions B1 to B4 is 5.4, which clearly shows the effect.

[発明の効果] 本発明ではブランチ成立または不成立をプログラマが予
想し,命令にてフリップフロップに指定しておくことに
より,命令先取りを効率よく行える効果がある。
[Effects of the Invention] According to the present invention, the programmer predicts whether a branch will be established or not and specifies it in a flip-flop using an instruction, thereby making it possible to efficiently prefetch instructions.

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

第1図は本発明の一実施例のブロック図,第2図は本発
明の効果を従来例との比較で説明するためのタイミング
チャート、第3図は第2図のタイミングチャートをまと
めたウェイト数を示す図。 第4図は具体的ブランチ命令実行時の平均ウェイト数を
算出した図である。 図において,1・・・主記憶装置,2,3.4・・・プ
ログラムバッファ、5・・・命令レジスタ、6・・・デ
ータ処理部,7,8,9,1.0・・・アドレスレジス
タ。 11・・・命令先取りカウンタ,12・・・通常命令ア
ドレス選択回路,13・・・アドレス選択回路,1.4
・・・命令解読回路。 5・・・ブランチ予想フリップフロ ップ。
Fig. 1 is a block diagram of an embodiment of the present invention, Fig. 2 is a timing chart for explaining the effects of the present invention in comparison with a conventional example, and Fig. 3 is a weight diagram summarizing the timing chart of Fig. 2. Diagram showing numbers. FIG. 4 is a diagram showing the calculation of the average wait number when executing a specific branch instruction. In the figure, 1... Main storage device, 2, 3.4... Program buffer, 5... Instruction register, 6... Data processing section, 7, 8, 9, 1.0... Address register. 11... Instruction prefetch counter, 12... Normal instruction address selection circuit, 13... Address selection circuit, 1.4
...Instruction decoding circuit. 5...Branch prediction flip-flop.

Claims (1)

【特許請求の範囲】[Claims] 1)主記憶中の命令先取りを行うデータ処理装置におい
て、命令にてセット/リセットされるフリップフロップ
と、先取り命令読出しリクエストアドレスとしてブラン
チ命令で、かつ前記フリップフロップがセットされてい
る場合前記ブランチ命令によるブランチ先のアドレスを
選択し、前記フリップフロップがセットされていない場
合ブランチしない命令シーケンスのアドレスを選択する
選択回路とを有することを特徴とするデータ処理装置。
1) In a data processing device that prefetches instructions in main memory, a flip-flop is set/reset by an instruction, and when a branch instruction is used as a prefetch instruction read request address and the flip-flop is set, the branch instruction a selection circuit that selects an address to which a branch is to be made based on the above-mentioned flip-flop, and selects an address of an instruction sequence that is not to be branched if the flip-flop is not set.
JP17703489A 1989-07-11 1989-07-11 Data processor Pending JPH0342723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17703489A JPH0342723A (en) 1989-07-11 1989-07-11 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17703489A JPH0342723A (en) 1989-07-11 1989-07-11 Data processor

Publications (1)

Publication Number Publication Date
JPH0342723A true JPH0342723A (en) 1991-02-22

Family

ID=16023991

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17703489A Pending JPH0342723A (en) 1989-07-11 1989-07-11 Data processor

Country Status (1)

Country Link
JP (1) JPH0342723A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05224925A (en) * 1992-01-24 1993-09-03 Nec Corp Instruction prefetching system
JPH05233284A (en) * 1992-01-27 1993-09-10 Nec Corp Instruction prefetch system
JP2013250593A (en) * 2012-05-30 2013-12-12 Renesas Electronics Corp Semiconductor device
EP2736116A2 (en) 2012-11-27 2014-05-28 Furuno Electric Company Limited Radar antenna and radar antenna manufacturing method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS50114944A (en) * 1974-02-18 1975-09-09
JPS51123534A (en) * 1975-04-21 1976-10-28 Nec Corp Data processing unit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS50114944A (en) * 1974-02-18 1975-09-09
JPS51123534A (en) * 1975-04-21 1976-10-28 Nec Corp Data processing unit

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05224925A (en) * 1992-01-24 1993-09-03 Nec Corp Instruction prefetching system
JPH05233284A (en) * 1992-01-27 1993-09-10 Nec Corp Instruction prefetch system
JP2013250593A (en) * 2012-05-30 2013-12-12 Renesas Electronics Corp Semiconductor device
EP2736116A2 (en) 2012-11-27 2014-05-28 Furuno Electric Company Limited Radar antenna and radar antenna manufacturing method

Similar Documents

Publication Publication Date Title
FI90804C (en) Controller for a data processor comprising an interrupt service utilizing redirection of advance search of instructions
US5127091A (en) System for reducing delay in instruction execution by executing branch instructions in separate processor while dispatching subsequent instructions to primary processor
US4858104A (en) Preceding instruction address based branch prediction in a pipelined processor
US4775927A (en) Processor including fetch operation for branch instruction with control tag
JPS6341093B2 (en)
JPS63503177A (en) Command preemption control device
US5146570A (en) System executing branch-with-execute instruction resulting in next successive instruction being execute while specified target instruction is prefetched for following execution
JPH0527971A (en) Information processor
JPH0342723A (en) Data processor
JPH11345121A (en) Instruction extracting device for program control unit and method thereof
JPS60175147A (en) Instruction prefetching system
JPH03263224A (en) Data processor
JPS60231241A (en) Program advance fetch control system
KR920006613B1 (en) Instruction fetching unit for pipelined processing
JP3123946B2 (en) Microcomputer
JPH0287229A (en) Prefetch control system for execution instruction
JPH0248733A (en) Information processor
JPH08286914A (en) Memory controller
KR100329780B1 (en) Interrupt processing apparatus reducing interrupt response time
JPS6022768B2 (en) Data processing method
JPH0749782A (en) Information processor
JPS6277648A (en) Instruction readout control system
JPS6232507B2 (en)
JPH1165843A (en) Information processor
JPH01193938A (en) Instruction pre-reader