JPH06161752A - Branch control system - Google Patents

Branch control system

Info

Publication number
JPH06161752A
JPH06161752A JP30835492A JP30835492A JPH06161752A JP H06161752 A JPH06161752 A JP H06161752A JP 30835492 A JP30835492 A JP 30835492A JP 30835492 A JP30835492 A JP 30835492A JP H06161752 A JPH06161752 A JP H06161752A
Authority
JP
Japan
Prior art keywords
instruction
branch
pipeline
resource
execution
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
JP30835492A
Other languages
Japanese (ja)
Inventor
Kazuyasu Nonomura
一泰 野々村
Takahito Noda
敬人 野田
Yuji Kamisaka
裕士 神阪
Toru Watabe
徹 渡部
Takumi Maruyama
拓巳 丸山
Takumi Takeno
巧 竹野
Shinya Kato
慎哉 加藤
Chiyonsuwannapaisaan Poonshiyai
ポーンシャイ・チョンスワンナパイサーン
Atsushi Sokawa
淳 惣川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP30835492A priority Critical patent/JPH06161752A/en
Publication of JPH06161752A publication Critical patent/JPH06161752A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To minimize the disorder of a pipeline at the time of the execution of a branch instruction by executing a following instruction first through a pipeline if there is contention about a resource between a conditional branch instruction and a precedent instruction, and carrying on the execution of the pipeline if a branch condition is met and no branching is performed and canceling the instruction when branching is performed. CONSTITUTION:A pipeline control part 3 decodes instructions and if the contention about the resource 4 is caused between the conditional branch instruction and precedent instruction, the branch instruction is reported to a branching decision part 2 and operation is instructed first without keeping the following instruction wait to feed the instruction to the pipeline of a pipeline processing part 1. When the branching decision part 2 determines the branching of the branch instruction, the pipeline control part 3 informs the pipeline processing part of that, and cancels the execution of the following instruction in the pipeline and also feeds the instruction at a branch destination to the pipeline. When no branching is determined, on the other hand, the instructions in the pipelines are executed as they are.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、命令をパイプラインで
実行するときの分岐を制御する分岐制御方式に関するも
のである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a branch control system for controlling a branch when an instruction is executed in a pipeline.

【0002】近年、コンピュータシステムの命令実行速
度の高速化のため、パイプラインによる命令実行が一般
化している。このパイプラインは、複数の命令を実行す
るため、資源(レジスタ、演算器など)の競合が発生す
る場合がある。このため、これらパイプライン制御を行
うプロセッサにおいて、各パイプラインで資源の競合を
検出し、データのバイパスや、先行命令がその資源を開
放するまで、後続命令のパイプラインの実行停止などを
行っている。データのバイパスを行うと、そのために大
幅なハードウェアの増加を招き、ゲート規模の増大に伴
いプロセッサのマシンサイクルの低下を来しかねない。
また、後続命令の実行を停止すると、そのまま後続命令
の実行サイクルが増加する。従って、資源の競合をでき
る限り少なくすることが要求されている。
In recent years, in order to increase the instruction execution speed of computer systems, instruction execution by pipeline has become popular. Since this pipeline executes a plurality of instructions, resource (register, arithmetic unit, etc.) contention may occur. For this reason, in these pipeline control processors, resource conflicts are detected in each pipeline, data bypass, and execution of subsequent instruction pipelines are stopped until the preceding instruction releases the resource. There is. Bypassing the data causes a large increase in hardware, which may cause a decrease in the machine cycle of the processor as the gate size increases.
Further, when the execution of the subsequent instruction is stopped, the execution cycle of the subsequent instruction directly increases. Therefore, it is required to reduce the contention of resources as much as possible.

【0003】また、分岐命令の実行時には、パイプライ
ンにおいて先行して実行している命令を無効化し、分岐
先の命令をパイプラインに再投入しなければならないた
め、分岐命令の実行開始が遅れ、分岐命令のペナルティ
となる。このため、分岐命令と先行する命令との間にお
いて資源の競合がある場合には、かなりのペナルティが
発生し、実効的に性能低下を来し、このペナルティを少
しでも軽減する必要がある。
In addition, when a branch instruction is executed, it is necessary to invalidate the instruction that is being executed earlier in the pipeline and reinject the branch destination instruction into the pipeline, which delays the start of execution of the branch instruction. It is a branch instruction penalty. For this reason, if there is a resource conflict between the branch instruction and the preceding instruction, a considerable penalty occurs and the performance is effectively reduced, and it is necessary to reduce this penalty as much as possible.

【0004】[0004]

【従来の技術】従来のパイプライン制御を行うプロセッ
サは、分岐命令と当該分岐命令に先行する命令の間でデ
ータのバイパスが行えないような資源の競合がある場
合、分岐命令以降の命令のパイプラインでの実行を停止
していた。例えば サイクル→ 0 1 2 3 4 5 6 命令O L A S 分岐命令 J 次命令B0 L A S 次命令B1 L A S 中の次命令B0、B1のように、分岐命令に先行する命
令Oがある場合、当該分岐命令以降の次命令B0、B1
を先行する命令Oによる実行が終了するまで停止させて
いた。この例では、次命令B0がサイクル2で実行、次
命令B1がサイクル3で実行するところをそれぞれ2サ
イクル停止させ、サイクル4およびサイクル5で実行さ
せていた。
2. Description of the Related Art A conventional processor for pipeline control has a pipeline of instructions after a branch instruction when there is a resource conflict between the branch instruction and an instruction preceding the branch instruction so that data cannot be bypassed. It had stopped running on the line. For example, cycle → 0 1 2 3 4 5 6 instruction O L A S branch instruction J next instruction B 0 L A S next instruction B 1 L A S, next instruction B 0, B 1 has an instruction O preceding the branch instruction. In this case, the next instruction B0 and B1 after the branch instruction
Was stopped until the execution by the preceding instruction O was completed. In this example, the execution of the next instruction B0 in cycle 2 and the execution of the next instruction B1 in cycle 3 are stopped for 2 cycles each, and executed in cycles 4 and 5.

【0005】ここで、L:パイプラインのロードステー
ジ A:パイプラインの演算ステージ S:パイプラインのストアステージ を表す。
Here, L: pipeline load stage A: pipeline operation stage S: pipeline store stage

【0006】[0006]

【発明が解決しようとする課題】上述したように従来の
パイプライン制御は、分岐命令が条件分岐命令であり、
後続する命令が他の先行する命令との資源の競合がない
場合でも、後続命令は実行することができず、プロセッ
サの性能低下を招くといった問題を生じていた。
As described above, in the conventional pipeline control, the branch instruction is a conditional branch instruction,
Even if the succeeding instruction does not have a resource conflict with other preceding instructions, the succeeding instruction cannot be executed, which causes a problem that the performance of the processor is deteriorated.

【0007】本発明は、これらの問題を解決するため、
条件分岐命令が先行する命令との間で資源の競合があっ
た場合、条件分岐命令に後続する命令を先にパイプライ
ン実行し、分岐条件が確定して分岐しないときはそのま
まパイプラインの実行を継続し、分岐するときはパイプ
ライン中の命令を取り消し、分岐命令実行時のパイプラ
インの乱れを最小限に抑えることを目的としている。
The present invention solves these problems.
If there is a resource conflict with the instruction that precedes the conditional branch instruction, the instruction that follows the conditional branch instruction is pipelined first, and if the branch condition is fixed and the branch does not occur, the pipeline is executed as it is. The purpose is to cancel the instruction in the pipeline when continuing and branching, and to minimize the disturbance of the pipeline when executing the branch instruction.

【0008】[0008]

【課題を解決するための手段】図1は、本発明の原理ブ
ロック図を示す。図1において、パイプライン処理部1
は、パイプラインで処理を実行するものである。
FIG. 1 shows a block diagram of the principle of the present invention. In FIG. 1, a pipeline processing unit 1
Is to execute processing in a pipeline.

【0009】パイプライン制御部3は、命令をデコード
して分岐命令のときに分岐を判定したり、動作指示した
り、後続命令の中断指示したりなどするものである。分
岐判定部2は、分岐命令が分岐するか否かを判定するも
のである。
The pipeline control unit 3 decodes an instruction to determine a branch when it is a branch instruction, gives an operation instruction, gives an instruction to interrupt a subsequent instruction, and the like. The branch determination unit 2 determines whether or not a branch instruction branches.

【0010】資源4は、レジスタなどの資源である。The resource 4 is a resource such as a register.

【0011】[0011]

【作用】本発明は、図1に示すように、パイプライン制
御部3が命令をデコードして条件分岐命令とこれに先行
する命令との間に資源4の競合が発生した場合に分岐命
令を分岐判定部2に通知すると共に当該条件分岐命令に
後続する命令を待たせることなく先に動作指示してパイ
プライン処理部1のパイプラインに投入し、分岐判定部
2が分岐命令が分岐するか否かを判定し、分岐すると確
定したときにパイプライン制御部3がその旨の通知を受
けてパイプライン処理部1に通知してパイプライン中の
後続する命令の実行取り消すと共に分岐先の命令をパイ
プラインに投入し、一方、分岐しないと確定したときに
そのままパイプライン中の命令の実行を継続するように
している。
According to the present invention, as shown in FIG. 1, when a pipeline control unit 3 decodes an instruction and a contention of a resource 4 occurs between a conditional branch instruction and an instruction preceding it, a branch instruction is detected. Whether the branch determination unit 2 is notified and the instruction subsequent to the conditional branch instruction is instructed to be put into the pipeline of the pipeline processing unit 1 without waiting and the branch determination unit 2 branches the branch instruction. When it is determined that the branch is determined, the pipeline control unit 3 receives a notification to that effect and notifies the pipeline processing unit 1 to cancel the execution of the subsequent instruction in the pipeline and to execute the instruction at the branch destination. The instruction is put into the pipeline, and on the other hand, when it is decided not to branch, the execution of the instruction in the pipeline is continued.

【0012】従って、条件分岐命令が先行する命令との
間で資源4の競合があった場合、条件分岐命令に後続す
る命令を先にパイプラインで実行し、分岐条件が確定し
て分岐しないときにそのままパイプラインの実行を継続
し、分岐するときにパイプライン中の命令を取り消すこ
とにより、分岐命令実行時のパイプラインの乱れを最小
限に抑えることが可能となる。
Therefore, when there is contention of the resource 4 with the instruction preceded by the conditional branch instruction, the instruction following the conditional branch instruction is executed in the pipeline first, and the branch condition is determined and the branch is not taken. By continuing the execution of the pipeline as it is and canceling the instruction in the pipeline at the time of branching, it is possible to minimize the disturbance of the pipeline at the time of executing the branch instruction.

【0013】[0013]

【実施例】次に、図1から図4を用いて本発明の実施例
の構成および動作を順次詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the construction and operation of an embodiment of the present invention will be described in detail with reference to FIGS.

【0014】図1は、原理ブロック図を示す。図1にお
いて、パイプライン処理部1は、パイプラインで処理を
実行するものであって、パイプライン制御部3からの指
示に従い、資源4の読み出しを行ったり、演算などを行
ったり、資源4の変更を行ったりなどするものである。
FIG. 1 shows a block diagram of the principle. In FIG. 1, a pipeline processing unit 1 executes processing in a pipeline, and according to an instruction from the pipeline control unit 3, reads a resource 4, performs an operation, etc. It is to make changes.

【0015】分岐判定部2は、分岐条件を保持したり、
分岐条件の分岐判定を行ったりなどするものである。パ
イプライン制御部3は、命令コードを保持・デコード
し、命令間の資源4の競合を検出したり、パイプライン
処理部1のパイプラインのデータのバイパス制御した
り、パイプライン遷移の制御したり、分岐判定部2に分
岐条件のセット指示したり、分岐判定部2による分岐判
定結果を取り込んだり、分岐時にパイプラインによる命
令の実行取り消したり(中断したり)などするものであ
る。
The branch determination unit 2 holds a branch condition,
For example, the branch determination of the branch condition is performed. The pipeline control unit 3 holds and decodes instruction codes, detects contention of resources 4 between instructions, performs bypass control of pipeline data in the pipeline processing unit 1, and controls pipeline transitions. The branch determination unit 2 is instructed to set a branch condition, the branch determination result by the branch determination unit 2 is fetched, and the instruction execution by the pipeline is canceled (interrupted) at the time of branching.

【0016】資源4は、主記憶や汎用レジスタなどの資
源である。次に、図1の構成の動作を説明する。 (1) 取り込まれた命令列は、パイプライン制御部3
に格納して保持する。パイプライン制御部3は、保持し
た命令コードをデコードし、それが分岐命令であるか否
かの判定を行う。分岐命令でなかった場合には、パイプ
ライン処理部1に命令のデコード結果に基づく動作指示
を与える。パイプライン処理部1は、この動作指示に従
い、資源4の読み出し行い、指示に従って演算などを行
った後、指示に従って資源4の変更を行う。
The resource 4 is a resource such as a main memory or a general-purpose register. Next, the operation of the configuration of FIG. 1 will be described. (1) The fetched instruction sequence is stored in the pipeline control unit 3
Store and hold in. The pipeline control unit 3 decodes the held instruction code and determines whether or not it is a branch instruction. If it is not a branch instruction, the pipeline processing unit 1 is given an operation instruction based on the instruction decoding result. The pipeline processing unit 1 reads out the resource 4 according to the operation instruction, performs an operation or the like according to the instruction, and then changes the resource 4 according to the instruction.

【0017】(2) 一方、パイプライン制御部3は、
分岐命令であった場合、分岐判定部2に分岐条件を通知
すると共に分岐命令の判定に使用する資源4の競合がな
くなるまで分岐命令の実行を遅らせる。この間に、次の
命令が資源4の書き替えを行うパイプラインステージに
達した場合には、その命令の実行を待たせるようにパイ
プライン処理部1に指示する。分岐命令で使用する資源
4の競合がなくなったら、分岐判定部2が送出する分岐
判定信号を取り込み、分岐条件が成立しなかった場合に
は、そのままパイプライン処理部1によるパインプライ
ン処理を続行する。分岐条件が成立した場合には、パイ
プライン処理部1によるパイプライン処理を中断し(取
り消し)、分岐先の命令の動作指示を与える。
(2) On the other hand, the pipeline controller 3 is
If it is a branch instruction, the branch determination unit 2 is notified of the branch condition and the execution of the branch instruction is delayed until there is no conflict of the resources 4 used for the determination of the branch instruction. During this time, when the next instruction reaches the pipeline stage for rewriting the resource 4, the pipeline processing unit 1 is instructed to hold the execution of the instruction. When there is no competition for the resources 4 used in the branch instruction, the branch determination signal sent by the branch determination unit 2 is fetched, and if the branch condition is not satisfied, the pipeline processing unit 1 continues the pineline processing. . When the branch condition is satisfied, the pipeline processing by the pipeline processing unit 1 is interrupted (cancelled), and an operation instruction of the branch destination instruction is given.

【0018】以上によって、条件分岐命令において、た
とえ条件分岐命令と、これに先行する命令との間に資源
4の競合があったとしても、分岐しなかった場合には、
パイプライン処理部1によるパイプライン処理の全く乱
すことなく続行することが可能となる(図2の(d)の
場合)。以下順次説明する。
As described above, in the conditional branch instruction, even if there is contention of the resource 4 between the conditional branch instruction and the instruction preceding it, if the branch does not occur,
It is possible to continue the pipeline processing by the pipeline processing unit 1 without any disturbance (in the case of (d) in FIG. 2). This will be described sequentially below.

【0019】図2は、本発明の1実施例構成図を示す。
これは、図1のパイプライン処理部1、分岐判定部2、
パイプライン制御部3、および資源4の1実施例の構成
である。
FIG. 2 shows a block diagram of an embodiment of the present invention.
This is the pipeline processing unit 1 of FIG.
1 is a configuration of an embodiment of a pipeline control unit 3 and a resource 4.

【0020】図2において、資源4は、汎用レジスタ4
−1およびセレクタ4−2から構成される。セレクタ4
−2は、パイプライン制御部3の指定する汎用レジスタ
4−1の内容を出力するセレクタである。
In FIG. 2, the resource 4 is a general-purpose register 4
-1 and a selector 4-2. Selector 4
Reference numeral -2 is a selector that outputs the contents of the general-purpose register 4-1 designated by the pipeline control unit 3.

【0021】パイプライン処理部1は、3段のパイプラ
インからなる。ロードステージ1−1は汎用レジスタ4
−1のデータをロードする。演算ステージ1−2はロー
ドステージ1−1に保持された汎用レジスタの内容によ
り演算結果を生成する。変更ステージ1−3は汎用レジ
スタ4−1を変更するステージであり、演算ステージ1
−2で生成された演算結果を格納すべき汎用レジスタ4
−1に転送する。
The pipeline processing section 1 is composed of three stages of pipelines. Load stage 1-1 is general purpose register 4
Load -1 data. The operation stage 1-2 generates an operation result based on the contents of the general-purpose register held by the load stage 1-1. The changing stage 1-3 is a stage for changing the general-purpose register 4-1.
General-purpose register 4 for storing the operation result generated in -2
Transfer to -1.

【0022】分岐判定部2は、汎用レジスタ4−1のデ
ータをレジスタ2−1に保持し、パイプライン制御部3
より出力される判定条件をレジスタ2−2に保持する。
条件判定回路により、レジスタ2−1とレジスタ2−2
の出力に従って分岐判定信号2−3を出力する。
The branch judgment unit 2 holds the data of the general-purpose register 4-1 in the register 2-1 and the pipeline control unit 3
The determination condition output from the register is held in the register 2-2.
Depending on the condition judging circuit, the register 2-1 and the register 2-2
The branch determination signal 2-3 is output according to the output of.

【0023】パイプライン制御部3は、パイプライン処
理部1の各ステージに対応した、命令コード保持レジス
タ3−1、3−2、3−3を持っている。命令デコード
部3−4は、入力された命令コードをデコードし、分岐
判定部2に対し、分岐条件の送出およびセット指示を行
う。分岐番号レジスタ3−5は、分岐命令により参照す
る汎用レジスタ番号を保持する。競合検出回路3−6
は、分岐番号レジスタ3−5の保持されたレジスタ番号
が命令コード保持レジスタ3−1、3−2、3−3に保
持された命令により変更されることを検出する。分岐制
御部3−7は、競合検出回路3−6で競合が無いことが
確認され、かつ分岐判定信号2−3がONであった場
合、パイプライン処理部1の命令実行を中止し、パイプ
ライン処理部1に分岐先の命令投入を指示する分岐信号
3−7を送出する。
The pipeline control unit 3 has instruction code holding registers 3-1, 3-2, 3-3 corresponding to each stage of the pipeline processing unit 1. The instruction decoding unit 3-4 decodes the input instruction code, and gives the branch determination unit 2 a branch condition sending and setting instruction. The branch number register 3-5 holds a general-purpose register number referred to by a branch instruction. Conflict detection circuit 3-6
Detects that the register number held in the branch number register 3-5 is changed by the instruction held in the instruction code holding registers 3-1, 3-2, 3-3. When it is confirmed by the conflict detection circuit 3-6 that there is no conflict and the branch determination signal 2-3 is ON, the branch control unit 3-7 suspends the instruction execution of the pipeline processing unit 1 and A branch signal 3-7 is sent to the line processing unit 1 to instruct the input of a branch destination instruction.

【0024】次に、図3を用いて具体的に動作を説明す
る。図3は、本発明の具体例タイムチャートを示す。図
3の(a)は、資源の競合がない場合のタイムチャート
であり、分岐条件が成立した場合を示す。
Next, the operation will be specifically described with reference to FIG. FIG. 3 shows an example time chart of the present invention. FIG. 3A is a time chart when there is no resource competition, and shows a case where the branch condition is satisfied.

【0025】図3の(a)において、命令Oは分岐命令
の前に実行さている命令であり、L/A/Sはその命令
がそれぞれロードステージ1−1/演算ステージ1−2
/ストア(変更)ステージ1−3にあることを示す。分
岐命令の判定により、分岐信号がONになった場合に
は、分岐先の命令J0、J1を実行する。この例では、
分岐のペナルティはない。
In FIG. 3A, the instruction O is an instruction executed before the branch instruction, and the L / A / S instructions are the load stage 1-1 and the operation stage 1-2, respectively.
/ Store (change) Indicates that the stage is in stage 1-3. When the branch signal is turned on by the judgment of the branch instruction, the instructions J0 and J1 of the branch destination are executed. In this example,
There is no branch penalty.

【0026】図3の(b)は、資源の競合がない場合の
タイムチャートであり、分岐条件が成立しなかった場合
を示す。図3の(b)において、命令Oは分岐命令の前
に実行さている命令であり、L/A/Sはその命令がそ
れぞれロードステージ1−1/演算ステージ1−2/ス
トア(変更)ステージ1−3にあることを示す。分岐命
令の判定により、分岐信号がONにならないため、分岐
の次に命令B0、B1を実行する。
FIG. 3B is a time chart when there is no resource competition, and shows the case where the branch condition is not satisfied. In FIG. 3B, the instruction O is an instruction executed before the branch instruction, and the L / A / S instructions are the load stage 1-1 / operation stage 1-2 / store (change) stage, respectively. It is shown in 1-3. Since the branch signal is not turned on by the determination of the branch instruction, the instructions B0 and B1 are executed after the branch.

【0027】図3の(c)は、資源の競合がある場合の
タイムチャートであり、分岐条件が成立した場合を示
す。即ち分岐命令の直前の命令Oが分岐命令で判定に用
いる汎用レジスタ4−1を書き替えた場合のタイムチャ
ートである。
FIG. 3 (c) is a time chart when there is competition for resources, and shows the case where the branch condition is satisfied. That is, it is a time chart when the instruction O immediately before the branch instruction rewrites the general-purpose register 4-1 used for the determination by the branch instruction.

【0028】分岐命令の判定は命令Oの実行が完了する
時刻(Time)3まで待たされるが、次命令B0、B
1は待つことなく実行を開始する。時刻3において、分
岐信号がONとなるため、次命令B0、B1の実行を中
止し、分岐先の命令J0、J1を実行する。この場合の
分岐命令のペナルティは、2サイクルであり、次命令B
0、B1の実行を行っていたサイクルが無駄となる。
The determination of the branch instruction is delayed until the time (Time) 3 when the execution of the instruction O is completed, but the next instruction B0, B
1 starts execution without waiting. At time 3, since the branch signal is turned on, the execution of the next instructions B0 and B1 is stopped and the instructions J0 and J1 at the branch destination are executed. The branch instruction penalty in this case is 2 cycles, and the next instruction B
The cycles in which 0 and B1 are executed are wasted.

【0029】図3の(d)は、資源の競合がある場合の
タイムチャートであり、分岐条件が成立しない場合を示
す。分岐命令の判定は命令Oの実行が完了する時刻(T
ime)3まで待たされるが、次命令B0、B1は待つ
ことなく実行を開始する。時刻3において、分岐信号が
ONとならないため、次命令B0、B1の実行を引続き
行う。この場合、分岐命令の実行が2サイクル待たされ
たにもかかわらず、分岐によるペナルティはない。
FIG. 3 (d) is a time chart when there is competition for resources, and shows the case where the branch condition is not satisfied. The determination of a branch instruction is made at the time (T
(image) 3 is waited, but the next instruction B0, B1 starts execution without waiting. At time 3, since the branch signal is not turned ON, the next instructions B0 and B1 are continuously executed. In this case, there is no branch penalty, even though the execution of the branch instruction has been delayed for two cycles.

【0030】次に、図4のフローチャートを用いて図1
の構成の動作を詳細に説明する。ここで、パイプライン
制御部3、分岐判定部2、およびパイプライン処理部1
は、図1および図2のそれぞれに対応するものである。
Next, referring to the flow chart of FIG.
The operation of the above configuration will be described in detail. Here, the pipeline control unit 3, the branch determination unit 2, and the pipeline processing unit 1
Corresponds to FIG. 1 and FIG. 2, respectively.

【0031】図4において、S1は、パイプライン制御
部3が命令コードをデコードする。S2は、S1のデコ
ードして、資源の競合有りか判別する。YESの場合に
は、資源の競合が無くなるまで待機する。一方、NOの
場合には、資源の競合がないので、S3に進むと共に分
岐命令のときにセット信号を分岐判定部2に通知する。
In FIG. 4, in S1, the pipeline control unit 3 decodes the instruction code. In S2, decoding of S1 is performed, and it is determined whether or not there is resource competition. If yes, wait until there is no conflict of resources. On the other hand, in the case of NO, since there is no resource conflict, the process proceeds to S3 and the branch determination unit 2 is notified of the set signal at the time of a branch instruction.

【0032】S11は、パイプライン制御部3から分岐
命令の旨の通知を受けた分岐判定部2が分岐判定データ
(分岐判定結果のデータ)をセットし、分岐判定に従っ
て分岐判定信号をパイプライン制御部3に通知する。
In step S11, the branch determination unit 2 which receives the notification of the branch instruction from the pipeline control unit 3 sets the branch determination data (branch determination result data), and the pipeline determination signal is pipeline controlled according to the branch determination. Notify Part 3.

【0033】S3は、S12により分岐判定部2から分
岐判定に従った分岐判定信号を受け取ったパイプライン
制御部3が分岐成立か否かを判定する。YESの場合に
は、分岐判定したと判明したので、中断指示をパイプラ
イン処理部1に通知する。そして、S1に戻り繰り返し
行う。
In S3, it is determined whether or not the pipeline control unit 3 which has received the branch determination signal according to the branch determination from the branch determination unit 2 in S12 is a branch taken. In the case of YES, since it is determined that the branch determination is made, the suspension instruction is notified to the pipeline processing unit 1. Then, the process returns to S1 and is repeated.

【0034】S21は、パイプライン処理部1が後続命
令データを取り込む。S22は、S21で取り込んだ後
続命令の演算を行う。S23は、中断指示有りか判別す
る。これは、既述した例えば図3の(c)で分岐命令が
分岐すると判明して中断指示をパイプライン処理部1が
受け取り、中断指示有りか判別する。YESの場合(中
断指示有りと判明した場合)には、S24で後続命令を
中断し(例えば図3の(c)の次命令B0、B1を中止
し)、S25で分岐先命令データの取り込み(例えば図
3の(c)の分岐先命令J0、J1の取り込み)を行
い、S22に戻る。一方、NOの場合には、中断指示が
無かったので、S26で資源の書き替えを行い、S21
に戻る。
In S21, the pipeline processing unit 1 fetches subsequent instruction data. In S22, the subsequent instruction fetched in S21 is calculated. In S23, it is determined whether or not there is an interruption instruction. This is because the pipeline processing unit 1 receives the interruption instruction when it is found that the branch instruction is branched in (c) of FIG. 3 described above, and determines whether there is an interruption instruction. In the case of YES (when it is determined that there is an interruption instruction), the subsequent instruction is interrupted in S24 (for example, the next instruction B0 or B1 in (c) of FIG. 3 is stopped), and the branch destination instruction data is fetched in S25 ( For example, the branch destination instructions J0 and J1 in FIG. 3C are fetched) and the process returns to S22. On the other hand, in the case of NO, there is no interruption instruction, so the resource is rewritten in S26 and S21
Return to.

【0035】以上によって、パイプライン制御部3が取
り込んだ命令コードをデコードし、分岐条件命令のとき
に後続する命令(次命令)を待つことなくパイプライン
に投入して実行を行い、分岐条件命令のみを待たせて分
岐条件が分岐しないと確定したときはそのままパイプラ
インの処理を続行し、一方、分岐条件が分岐すると確定
したときに後続する命令を取り消し、分岐先の命令をパ
イプラインに投入して実行する。これらにより、分岐条
件命令とこれに先行する命令との間に資源4の競合があ
ったとしても、次の命令をパイプラインに投入して実行
し、条件確定時に分岐しなかったときはそのまま実行で
き、ペナルティが無く、高速に命令の実行を行うことが
可能となる。
As described above, the instruction code fetched by the pipeline control unit 3 is decoded, and at the time of a branch condition instruction, the instruction following it (next instruction) is input to the pipeline and executed, and the branch condition instruction is executed. When it is determined that the branch condition does not branch, the pipeline processing continues as it is. On the other hand, when the branch condition is determined to branch, the subsequent instruction is canceled and the branch destination instruction is input to the pipeline. Then run. As a result, even if there is contention of the resource 4 between the branch conditional instruction and the instruction preceding it, the next instruction is put into the pipeline and executed, and if the branch is not taken when the condition is determined, it is executed as it is. Therefore, the instruction can be executed at high speed without any penalty.

【0036】[0036]

【発明の効果】以上説明したように、本発明によれば、
条件分岐命令が先行する命令との間で資源の競合があっ
た場合、条件分岐命令に後続する命令を先にパイプライ
ンで実行し、分岐条件が確定して分岐しないときにその
ままパイプラインの実行を継続し、分岐するときにパイ
プライン中の命令を取り消す構成を採用しているため、
分岐命令実行時のパイプラインの乱れを最小限に抑える
ことができる。
As described above, according to the present invention,
If there is a resource conflict with the instruction that precedes the conditional branch instruction, the instruction that follows the conditional branch instruction is executed first in the pipeline, and if the branch condition is fixed and the branch is not executed, the pipeline is executed as it is. Since it adopts a configuration that cancels the instruction in the pipeline when branching,
It is possible to minimize the disturbance of the pipeline when executing a branch instruction.

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

【図1】本発明の原理ブロック図である。FIG. 1 is a principle block diagram of the present invention.

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

【図3】本発明の具体例タイムチャートである。FIG. 3 is a time chart of a specific example of the present invention.

【図4】本発明の動作説明図である。FIG. 4 is an explanatory diagram of the operation of the present invention.

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

1:パイプライン処理部 2:分岐判定部 3:パイプライン制御部 4:資源 1: Pipeline processing unit 2: Branch determination unit 3: Pipeline control unit 4: Resources

───────────────────────────────────────────────────── フロントページの続き (72)発明者 渡部 徹 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 丸山 拓巳 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 竹野 巧 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 加藤 慎哉 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 ポーンシャイ・チョンスワンナパイサーン 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 惣川 淳 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Toru Watanabe Inventor Toru Watanabe 1015 Kamiodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture, Fujitsu Limited (72) Inventor Takumi Maruyama 1015, Kamedotachu, Nakahara-ku, Kawasaki City, Kanagawa Prefecture, Fujitsu Limited ( 72) Inventor Takumi Takeno 1015 Kamiodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture, Fujitsu Limited (72) Inventor Shinya Kato, 1015, Kamikodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture, Fujitsu Limited (72) Inventor Pawnshai Chon Swan Napaisan 1015 Kamiodanaka, Nakahara-ku, Kawasaki, Kanagawa Prefecture, Fujitsu Limited (72) Inventor, Satoshi Satagawa, 1015, Kamikodanaka, Nakahara-ku, Kawasaki, Kanagawa Prefecture, Fujitsu Limited

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】命令をパイプラインで実行するときの分岐
を制御する分岐制御方式において、 条件分岐命令とこれに先行する命令との間に資源の競合
が発生した場合に、条件分岐命令に後続する命令を待た
せることなく先にパイプラインに投入して実行し、 条件分岐命令が分岐しないと確定したときにそのまま続
行し、分岐と確定したときに先に投入した後続する命令
を取り消すと共に分岐先の命令をパイプラインに投入し
て実行するように構成したことを特徴とする分岐制御方
式。
1. A branch control method for controlling a branch when an instruction is executed in a pipeline, wherein a conditional branch instruction follows a conditional branch instruction when a resource conflict occurs between the conditional branch instruction and an instruction preceding the conditional branch instruction. The instruction to be executed is first put into the pipeline and executed without waiting, and if the conditional branch instruction is determined not to branch, it continues as it is. A branch control method characterized by being configured so that the preceding instruction is put into a pipeline and executed.
JP30835492A 1992-11-18 1992-11-18 Branch control system Pending JPH06161752A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30835492A JPH06161752A (en) 1992-11-18 1992-11-18 Branch control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30835492A JPH06161752A (en) 1992-11-18 1992-11-18 Branch control system

Publications (1)

Publication Number Publication Date
JPH06161752A true JPH06161752A (en) 1994-06-10

Family

ID=17980055

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30835492A Pending JPH06161752A (en) 1992-11-18 1992-11-18 Branch control system

Country Status (1)

Country Link
JP (1) JPH06161752A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064421A (en) * 2013-09-24 2015-04-09 株式会社東芝 Controller, display device, control method and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064421A (en) * 2013-09-24 2015-04-09 株式会社東芝 Controller, display device, control method and program

Similar Documents

Publication Publication Date Title
JP2518616B2 (en) Branching method
US6662295B2 (en) Method and system dynamically presenting the branch target address in conditional branch instruction
US5404552A (en) Pipeline risc processing unit with improved efficiency when handling data dependency
US5922068A (en) Information processing system and information processing method for executing instructions in parallel
FI90804C (en) Controller for a data processor comprising an interrupt service utilizing redirection of advance search of instructions
JPH0776918B2 (en) Data processing system and method
JPH01175634A (en) Data processor
JPH06161752A (en) Branch control system
JPH06266556A (en) Data processor
JP2620505B2 (en) Method and system for improving the synchronization efficiency of a superscalar processor system
JP3602801B2 (en) Memory data access structure and method
JP2636562B2 (en) calculator
JP3204390B2 (en) Microcomputer
JP2503223B2 (en) Prior control method
JPS60241136A (en) Data processor
JP2636192B2 (en) Information processing device
JP3568737B2 (en) Microprocessor with conditional execution instruction
JP2741717B2 (en) Vector processing equipment
JPH07120281B2 (en) Information processing equipment
JP2702137B2 (en) Vector operation instruction processing method
JP3431503B2 (en) Information processing apparatus and program control method
JP2597744B2 (en) Branch control method
JPH05216664A (en) Instruction execution order control circuit
JP2636566B2 (en) Pipeline control method
JPH04326425A (en) Loop processing control system

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20010612