JPH06301534A - Information processor - Google Patents

Information processor

Info

Publication number
JPH06301534A
JPH06301534A JP9118093A JP9118093A JPH06301534A JP H06301534 A JPH06301534 A JP H06301534A JP 9118093 A JP9118093 A JP 9118093A JP 9118093 A JP9118093 A JP 9118093A JP H06301534 A JPH06301534 A JP H06301534A
Authority
JP
Japan
Prior art keywords
instruction
execution
branch
pipeline
execution pipeline
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
JP9118093A
Other languages
Japanese (ja)
Inventor
Makoto Odajima
眞 小田島
Kazuya Okabe
和也 岡部
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP9118093A priority Critical patent/JPH06301534A/en
Publication of JPH06301534A publication Critical patent/JPH06301534A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To return a state of an execution pipeline to an original state by simple control, even in the case a branch prediction fails. CONSTITUTION:A computing element 11 is provided with a first execution pipeline consisting of arithmetic parts 111, 112 and 113, and registers 114A, 115A and 116A, and a second execution pipeline consisting of the arithmetic parts 111, 112 and 113, and registers 114B, 115B and 116B. In the course of executing an instruction before a branch instruction, a first execution pipeline is used, and in the case of executing a preceding execution instruction after the branch instruction, a second execution pipeline is used. Its switching is executed by a decoder 17, a control part 18, a flag 19, a flag control part 20 and an OR circuit 21.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、演算がパイプライン
化されているとともに、静的あるいは動的な分岐予測に
より、命令の先行実行を行なう情報処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information processing apparatus in which operations are pipelined and instructions are executed in advance by static or dynamic branch prediction.

【0002】[0002]

【従来の技術】近年、マイクロプロセッサ等の情報処理
装置においては、命令の実行速度を高めるために、装置
全体のパイプライン化だけでなく、演算器のパイプライ
ン化も進められている。
2. Description of the Related Art In recent years, in information processing devices such as microprocessors, in order to increase the execution speed of instructions, not only the entire device is pipelined, but also the arithmetic unit is pipelined.

【0003】このようなパイプライン方式の演算器を有
する情報処理装置としては、例えば、「i860 Micr
oprocessor Architectur 第44頁〜第48頁」に記
載されるマイクロプロセッサがある。
As an information processing apparatus having such a pipeline type arithmetic unit, for example, "i860 Micr
oprocessor Architectur, pages 44-48 ".

【0004】このマイクロプロセッサにおいては、浮動
小数点演算ユニットがパイプライン化されている。具体
的には、32ビットの単精度浮動小数点の加算器と乗算
器が3段のパイプラインで実現されている。
In this microprocessor, the floating point arithmetic unit is pipelined. Specifically, a 32-bit single precision floating point adder and multiplier are realized by a three-stage pipeline.

【0005】また、このマイクロプロセッサにおいて
は、上述した演算器を制御する命令として、パイプライ
ン命令が用意されている。
In this microprocessor, a pipeline instruction is prepared as an instruction for controlling the above-mentioned arithmetic unit.

【0006】このパイプライン命令が実行されると、演
算器の実行パイプラインは1ステージ進められる。この
後、この実行パイプラインは、再度、該当する演算器を
使用するパイプライン命令が実行されるまで進められる
ことはない。この場合、該当する演算器を使用しない命
令は、このパイプラインの状態に影響を与えずに進む。
When this pipeline instruction is executed, the execution pipeline of the arithmetic unit is advanced by one stage. After this, the execution pipeline is not advanced again until the pipeline instruction using the corresponding arithmetic unit is executed again. In this case, an instruction that does not use the corresponding arithmetic unit proceeds without affecting the state of this pipeline.

【0007】なお、上記マイクロプロセッサにおいて
は、各パイプライン命令のオペランドにより指定される
ディスティネーションレジスタには、そのパイプライン
命令の実行結果ではなく、前に実行されたパイプライン
命令の実行結果が格納される。
In the above microprocessor, the execution result of the previously executed pipeline instruction is stored in the destination register designated by the operand of each pipeline instruction, not the execution result of the pipeline instruction. To be done.

【0008】図2に、パイプライン命令による加算器の
動作の一例を示す。なお、図示の例では、実行パイプラ
インとして、図3に示すような構成を仮定している。
FIG. 2 shows an example of the operation of the adder according to the pipeline instruction. In the illustrated example, the execution pipeline has the configuration shown in FIG.

【0009】図2(a)は、命令列を実行する前のレジ
スタf2〜f16 の内容を示す。同図(b)は、この内容を
有するレジスタf2〜f16 に対し、同図(a)命令列を実
行した場合の各命令の最初の実行サイクルE1における
実行パイプライン(加算パイプライン)の状態を示す。
FIG. 2A shows the contents of the registers f2 to f16 before executing the instruction sequence. FIG. 7B shows the state of the execution pipeline (addition pipeline) in the first execution cycle E1 of each instruction when the instruction sequence shown in FIG. 3A is executed with respect to the registers f2 to f16 having this content. Show.

【0010】図2(b)において、pfadd は、加算を指
定するパイプライン命令を示す。この加算命令は、3つ
のオペランドを持つ。ここで、第1オペランドと第2オ
ペランドは、加算のソースレジスタを示し、第3オペラ
ンドは、ディスティネーションレジスタを示す。
In FIG. 2B, pfadd indicates a pipeline instruction designating addition. This add instruction has three operands. Here, the first operand and the second operand indicate a source register for addition, and the third operand indicates a destination register.

【0011】レジスタf0は、常時、0を保持するレジス
タである。したがって、このレジスタf0がディスティネ
ーションレジスタとして指定されると、実行パイプライ
ンの出力は捨てられる。
The register f0 is a register that always holds 0. Therefore, when this register f0 is designated as the destination register, the output of the execution pipeline is discarded.

【0012】図2(b)に示すように、実行パイプライ
ンは、各加算命令が実行されるたびに、1ステージずつ
進められる。この場合、3番目の加算命令が実行される
までは、実行パイプラインが満たされていない。したが
って、この3番目の加算命令が実行されるまでの実行パ
イプラインの出力は捨てられる。
As shown in FIG. 2B, the execution pipeline is advanced by one stage each time each add instruction is executed. In this case, the execution pipeline is not satisfied until the third add instruction is executed. Therefore, the output of the execution pipeline until the third add instruction is executed is discarded.

【0013】最初の加算命令の実行結果は、4番目の加
算命令の最初の実行サイクルで、実行パイプラインから
出力される。したがって、この実行結果は、4番目の加
算命令の第3オペランドで指定されるディスティネーシ
ョンレジスタf12 に格納される。
The execution result of the first addition instruction is output from the execution pipeline in the first execution cycle of the fourth addition instruction. Therefore, this execution result is stored in the destination register f12 designated by the third operand of the fourth add instruction.

【0014】以下、同様に、各加算命令の実行結果は、
実行パイプラインの段数3分だけ後の加算命令で指定さ
れるディスティネーションレジスタに格納される。
Similarly, the execution result of each addition instruction is as follows.
It is stored in the destination register designated by the add instruction after the number of stages of the execution pipeline is 3 minutes.

【0015】このように、前の命令の実行結果に依存し
な命令を連続的に実行する場合、パイプライン命令を使
用することにより、高速な演算が可能となる。
As described above, in the case of continuously executing the instructions that do not depend on the execution result of the previous instruction, the pipeline instruction is used to enable the high-speed operation.

【0016】ところで、パイプライン方式の場合、分岐
命令の実行によって生じるパイプラインの遅れ、すなわ
ち、分岐ペナルティが問題になる。
In the case of the pipeline method, a pipeline delay caused by the execution of a branch instruction, that is, a branch penalty becomes a problem.

【0017】この分岐ペナルティを軽減する方式とし
て、遅延分岐方式と分岐予測方式がある。後者は、例え
ば、「情報処理学会研究会資料 計算機アーキテクチャ
86−3 DSN型スーパースカラ・プロセッサ・プ
ロトタイプの分岐パイプライン」に記載されている。
As a method for reducing this branch penalty, there are a delay branch method and a branch prediction method. The latter is described in, for example, "Information Processing Society of Japan Material, Computer Architecture 86-3: Branch Pipeline of DSN Superscalar Processor Prototype".

【0018】ここで、遅延分岐方式とは、分岐命令のう
しろに1つまたは複数の遅延スロットを設け、分岐が確
定するまで、常に、この遅延スロットに挿入された命令
(以下、「遅延スロット命令という。)を実行するもの
である。
Here, the delayed branch method is provided with one or more delay slots behind the branch instruction, and the instruction inserted in this delay slot (hereinafter, referred to as "delay slot" until the branch is confirmed). It is the one that executes an instruction.

【0019】これに対し、分岐予測方式とは、動的ある
いは静的に分岐方向を予測し、分岐が確定するまで、予
測した方向の命令を実行し、予測が失敗したときは、実
行した命令を無効とするものである。
On the other hand, the branch prediction method is to dynamically or statically predict the branch direction, execute an instruction in the predicted direction until the branch is determined, and execute the executed instruction when the prediction fails. Is invalidated.

【0020】この分岐予測方式には、動的な分岐予測方
式と静的な分岐予測方式がある。ここで、動的な分岐予
測方式とは、分岐命令が取り出されるたびに、分岐方向
を予測する方式である。これに対し、静的な分岐予測方
式とは、予めコンパイラが分岐方向を予測しておく方式
である。
This branch prediction method includes a dynamic branch prediction method and a static branch prediction method. Here, the dynamic branch prediction method is a method of predicting a branch direction every time a branch instruction is taken out. On the other hand, the static branch prediction method is a method in which the compiler predicts the branch direction in advance.

【0021】上述したマイクロプロセッサにおいては、
遅延分岐方式が採用されている。この場合、無条件分岐
命令とコール命令については、常に、遅延スロットが設
けられている。これに対し、条件付き分岐命令について
は、遅延スロットが設けられる場合と設けられない場合
がある。
In the microprocessor described above,
The delayed branch method is adopted. In this case, a delay slot is always provided for the unconditional branch instruction and the call instruction. In contrast, conditional branch instructions may or may not have a delay slot.

【0022】遅延スロットを持つ分岐命令(以下、「遅
延分岐命令」という。)の実行の結果、分岐が成立した
ときは、遅延スロット命令の実行は有効とされ、成立し
ないときは、無効とされる。コンパイラがこのような命
令を使い分けることによりコードの最適化が可能とな
る。
When a branch is taken as a result of the execution of a branch instruction having a delay slot (hereinafter referred to as "delayed branch instruction"), the execution of the delay slot instruction is valid, and when the branch is not taken, it is invalid. It The compiler can optimize the code by properly using such instructions.

【0023】しかし、上述したようなパイプライン方式
の演算器を有するマイクロプロセッサにおいては、全体
のパイプライン段数を増加させると、分岐が成立するか
否かの判定が相対的に遅れる。
However, in the microprocessor having the pipeline type arithmetic unit as described above, if the total number of pipeline stages is increased, the determination as to whether or not the branch is taken is relatively delayed.

【0024】これにより、分岐ペナルティ軽減方式とし
て、遅延分岐方式を採用すると、遅延スロット数が増加
する。その結果、コンパイラによって、すべての遅延ス
ロットを有効な命令で埋めることが非常に困難となる。
したがって、上述したようなマイクロプロセッサにおい
ては、分岐予測方式を採用する方が有効である。
As a result, if the delay branch method is adopted as the branch penalty mitigation method, the number of delay slots increases. As a result, it is very difficult for the compiler to fill all delay slots with valid instructions.
Therefore, it is more effective to adopt the branch prediction method in the microprocessor as described above.

【0025】[0025]

【発明が解決しようとする課題】しかしながら、上述し
たようなマイクロプロセッサで、分岐予測方式を採用す
ると、分岐予測が失敗した場合、実行パイプラインの制
御が複雑となり、ハードウェアが増加するという問題が
生じる。
However, if the branch prediction method is adopted in the microprocessor as described above, if the branch prediction fails, the control of the execution pipeline becomes complicated and the hardware increases. Occurs.

【0026】すなわち、分岐予測方式では、分岐予測が
失敗した場合、先行実行した命令(以下、「先行実行命
令」という。)の無効化を行なう必要がある。
That is, in the branch prediction method, if the branch prediction fails, it is necessary to invalidate the instruction that was executed in advance (hereinafter referred to as "preceding execution instruction").

【0027】しかし、上述したようなマイクロプロセッ
サにおいては、先行実行命令がパイプライン命令である
場合、この先行実行命令の無効化を行なうには、それに
よって進んだ実行パイプラインを、その数だけ戻さなけ
ればならない。
However, in the microprocessor as described above, when the preceding execution instruction is a pipeline instruction, in order to invalidate the preceding execution instruction, the execution pipeline advanced by that is returned by that number. There must be.

【0028】これを、図4,図5,図6を参照しながら
説明する。
This will be described with reference to FIGS. 4, 5 and 6.

【0029】図4は、分岐命令を含む命令列を示す。こ
こで、pfgtは、比較命令である。この比較命令は、第1
オペランドで指定されるレジスタの内容と第2オペラン
ドで指定されるレジスタの内容を比較し、前者の方が後
者の方より大きい場合、条件フラグccをセットする。ま
た、bc.tは、条件付き分岐命令である。この条件付き分
岐命令は、条件フラグccがセットされている場合は、ラ
ベルlabel 先に分岐し、リセットされている場合は、分
岐しない。
FIG. 4 shows an instruction sequence including branch instructions. Here, pfgt is a comparison instruction. This comparison instruction is the first
The contents of the register specified by the operand are compared with the contents of the register specified by the second operand. If the former is larger than the latter, the condition flag cc is set. Also, bc.t is a conditional branch instruction. This conditional branch instruction branches to the label label when the condition flag cc is set, and does not branch when the condition flag cc is reset.

【0030】図5は、図4の命令列を実行する前のレジ
スタの内容を示す。
FIG. 5 shows the contents of the registers before executing the instruction sequence of FIG.

【0031】図6は、図4の命令列を実行した場合にお
いて、各命令の最初の実行サイクルE1での実行パイプ
ライン(加算パイプライン)の状態を示す図である。
FIG. 6 is a diagram showing the state of the execution pipeline (addition pipeline) in the first execution cycle E1 of each instruction when the instruction sequence of FIG. 4 is executed.

【0032】図4の命令列の場合、命令(7)の実行結
果により、分岐が成立するか否かが判明する。この場
合、分岐が成立した場合は、命令(12)が実行され、
分岐が成立しなかった場合は、命令(8)が実行され
る。
In the case of the instruction sequence shown in FIG. 4, it is determined from the execution result of the instruction (7) whether or not the branch is taken. In this case, if the branch is taken, the instruction (12) is executed,
If the branch is not taken, the instruction (8) is executed.

【0033】図6において、命令(12)以降のパイプ
ラインの状態は、分岐が成立した場合の状態を示し、命
令(8)〜(11)のパイプラインの状態は、分岐が成
立しなかった場合の状態を示す。
In FIG. 6, the pipeline state after the instruction (12) shows the state when the branch is taken, and the pipeline states of the instructions (8) to (11) do not take the branch. The case is shown.

【0034】ここで、分岐命令(7)による分岐が、命
令(10)の最初の実行サイクルE1に入ったとき確定
する情報処理装置を考える。この場合、分岐が成立する
か否かが判定されるまで、3サイクルの分岐ペナルティ
が生じる。
Now, let us consider an information processing apparatus which is determined when the branch by the branch instruction (7) enters the first execution cycle E1 of the instruction (10). In this case, a 3-cycle branch penalty occurs until it is determined whether or not the branch is taken.

【0035】この分岐ペナルティを軽減するために、分
岐予測が実行される。図7は、この分岐予測により、例
えば、命令(8),(9),(10)を先行実行した場
合において、分岐予測が失敗した場合を示す。
Branch mitigation is performed to reduce this branch penalty. FIG. 7 shows a case where the branch prediction fails, for example, when the instructions (8), (9), and (10) are executed in advance by this branch prediction.

【0036】図7の命令(12)以降のパイプラインの
状態と図6の命令(12)以降のパイプラインの状態を
比較すると、両者の状態は異なる。これは、図7の場
合、命令(8),(9),(10)の演算結果が実行パ
イプラインに反映されているからである。したがって、
図7の場合において、図6と同じ結果を得るには、命令
(8),(9),(10)の先行実行により進んだ実行
パイプラインをその数だけ戻す必要がある。
When the state of the pipeline after the instruction (12) in FIG. 7 is compared with the state of the pipeline after the instruction (12) in FIG. 6, the two states are different. This is because in the case of FIG. 7, the operation results of the instructions (8), (9) and (10) are reflected in the execution pipeline. Therefore,
In the case of FIG. 7, in order to obtain the same result as in FIG. 6, it is necessary to return the number of execution pipelines advanced by the preceding execution of the instructions (8), (9) and (10).

【0037】このように、上述したようなマイクロプロ
セッサでは、分岐ペナルティ軽減方式として、分岐予測
方式を採用すると、分岐予測が失敗した場合、先行実行
命令の実行により進んだ実行パイプラインの状態を元に
戻す必要がある。これにより、実行パイプラインの制御
が複雑となり、ハードウェアが増加してしまう。
As described above, in the microprocessor as described above, when the branch prediction method is adopted as the branch penalty mitigation method, when the branch prediction fails, the state of the execution pipeline advanced by the execution of the preceding execution instruction is taken into account. Need to return to. This complicates the control of the execution pipeline and increases the hardware.

【0038】この発明は、上記の事情に対処すべくなさ
れたもので、分岐予測が失敗した場合でも、簡単な制御
により、実行パイプラインを元に戻すことが可能な情報
処理装置を提供することを目的とする。
The present invention has been made in order to cope with the above situation, and provides an information processing apparatus capable of returning an execution pipeline to the original state by a simple control even when a branch prediction fails. With the goal.

【0039】[0039]

【課題を解決するための手段】上記目的を達成するため
に、この発明は、2つの実行パイプラインを有し、パイ
プライン命令の実行により、この実行パイプラインが1
ステージずつ進められる演算手段と、分岐命令以前の命
令を実行する場合と分岐命令後の先行実行命令を実行す
る場合とで、前記2つの実行パイプラインを切り替えて
使用するパイプライン切替え手段とを設けるようにした
ものである。
In order to achieve the above object, the present invention has two execution pipelines, and by executing pipeline instructions, the execution pipeline becomes one.
Provided are arithmetic means for advancing by stages, and pipeline switching means for switching and using the two execution pipelines depending on whether an instruction before a branch instruction is executed or a preceding execution instruction after a branch instruction is executed. It was done like this.

【0040】[0040]

【作用】上記構成においては、分岐命令以前の命令の実
行時は、2つの実行パイプラインの一方が使用される。
これに対し、分岐命令後の先行実行命令の実行時は、他
方の実行パイプラインが使用される。
In the above structure, one of the two execution pipelines is used when the instruction before the branch instruction is executed.
On the other hand, when the preceding execution instruction is executed after the branch instruction, the other execution pipeline is used.

【0041】これにより、分岐命令以前の命令を実行し
た場合の実行パイプラインの状態が一方の実行パイプラ
インに保存されることになる。したがって、分岐予測が
失敗した場合でも、実行パイプラインを他方の実行パイ
プラインから一方のパイプラインに切り替えるだけで、
実行パイプラインの状態を元に戻すことができる。
As a result, the state of the execution pipeline when the instruction before the branch instruction is executed is saved in one of the execution pipelines. So even if the branch prediction fails, you can just switch the execution pipeline from the other execution pipeline to the one
The state of the execution pipeline can be restored.

【0042】[0042]

【実施例】以下、図面を参照しながら、この発明の実施
例を詳細に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0043】図1は、この発明の一実施例の構成を示す
ブロック図である。なお、この図1は、この発明を、図
3に示す構成のパイプラインを有する情報処理装置に適
用した場合を代表として示す。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. Note that FIG. 1 representatively shows a case where the present invention is applied to an information processing apparatus having a pipeline having the configuration shown in FIG.

【0044】図1において、11は、パイプライン命令
に基づいて、加算や減算等の演算を行うパイプライン方
式の演算器である。この演算器11は、詳細は後述する
が、3段構成の実行パイプラインを2つ有する。
In FIG. 1, reference numeral 11 is a pipeline type arithmetic unit for performing arithmetic operations such as addition and subtraction based on pipeline instructions. The arithmetic unit 11 has two three-stage execution pipelines, the details of which will be described later.

【0045】12は、演算器11の演算に必要なデータ
やこの演算器11の演算結果等を格納する複数のレジス
タを備えたレジスタファイルである。13,14は、こ
のレジスタファイル12から読み出されたデータを保持
し、演算器11に供給するレジスタである。
Reference numeral 12 is a register file having a plurality of registers for storing data necessary for the arithmetic operation of the arithmetic unit 11 and the arithmetic result of the arithmetic unit 11. Reference numerals 13 and 14 are registers that hold the data read from the register file 12 and supply the data to the arithmetic unit 11.

【0046】15は、レジスタファイル12と同じ構成
を有するフューチャーファイルである。このフューチャ
ーファイル15には、先行実行命令の実行時に、演算器
11から出力される演算結果が格納される。この格納内
容は、分岐予測が成功したときに、レジスタファイル1
2に複写される。
Reference numeral 15 is a future file having the same structure as the register file 12. The future file 15 stores the calculation result output from the arithmetic unit 11 when the preceding execution instruction is executed. This stored content is stored in the register file 1 when the branch prediction is successful.
2 is copied.

【0047】16は、図示しない主メモリから取り出さ
れた命令を格納する命令レジスタである。17は、この
命令レジスタ16に格納されている命令をデコードする
デコーダである。このデコーダ17は、また、デコード
した命令が分岐命令である場合、その旨を後述するフラ
グ制御部20に通知する機能を有する。
Reference numeral 16 is an instruction register for storing an instruction fetched from a main memory (not shown). Reference numeral 17 is a decoder which decodes the instruction stored in the instruction register 16. When the decoded instruction is a branch instruction, the decoder 17 also has a function of notifying the flag control unit 20 of that fact.

【0048】18は、デコーダ17のデコード結果に基
づいて、データのやりとり等を行なうための図示しない
ゲート群を制御する制御部である。この制御部18は、
また、分岐命令の実行時、分岐が確定したか否かを判定
し、この判定結果を後述するフラグ制御部20に通知す
る機能と、分岐予測が成功したか否かを判定する機能を
有する。
A control unit 18 controls a gate group (not shown) for exchanging data based on the decoding result of the decoder 17. This control unit 18
Further, it has a function of determining whether or not a branch has been determined at the time of execution of a branch instruction and notifying the flag control unit 20 of the determination result, which will be described later, and a function of determining whether or not the branch prediction is successful.

【0049】19は、現在実行中の命令が分岐命令以前
の命令か、分岐命令後の先行実行命令かを示すフラグで
ある。20は、フラグ19のセット、リセットを制御す
るフラグ制御部である。
Reference numeral 19 is a flag indicating whether the instruction currently being executed is an instruction before the branch instruction or a preceding execution instruction after the branch instruction. A flag control unit 20 controls setting and resetting of the flag 19.

【0050】このフラグ制御部20は、デコーダ12か
らデコード命令が分岐命令であるとの通知を受けると、
次の命令(最初の先行実行命令)の最初の実行サイクル
E1でフラグ19をセットし、制御部18から分岐が確
定したとの通知を受けると、この判定サイクルの次のサ
イクルでフラグ17をリセットする。
When the flag controller 20 receives a notification from the decoder 12 that the decode instruction is a branch instruction,
When the flag 19 is set in the first execution cycle E1 of the next instruction (first preceding execution instruction) and the notification that the branch is confirmed from the control unit 18, the flag 17 is reset in the cycle next to this determination cycle. To do.

【0051】21は、フラグ19の出力S1と制御部1
8の分岐予測判定出力S2の論理和をとるオア回路であ
る。
Reference numeral 21 denotes the output S1 of the flag 19 and the control unit 1.
It is an OR circuit that takes the logical sum of the branch prediction determination outputs S2 of 8.

【0052】なお、制御フラグ19の出力S1は、例え
ば、リセットのとき、0に設定され、セットのとき、1
に設定される。また、制御部18の分岐予測判定出力S
2は、通常は、0に設定され、分岐が成立したと判定さ
れると、この判定サイクルの次のサイクルの間だけ1に
設定される。
The output S1 of the control flag 19 is set to 0 at the time of reset and 1 at the time of set, for example.
Is set to. Further, the branch prediction determination output S of the control unit 18
2 is normally set to 0, and when it is determined that the branch is taken, it is set to 1 only during the cycle subsequent to this determination cycle.

【0053】上記演算器11は、演算部111,11
2,113と、パイプラインレジスタ114A,114
B,115A,115B,116A,116Bと、セレ
クタ117,118とから構成されている。
The arithmetic unit 11 includes arithmetic units 111, 11
2, 113 and pipeline registers 114A, 114
B, 115A, 115B, 116A, 116B and selectors 117, 118.

【0054】ここで、演算部111,112,113
は、それぞれ図3の第1,第2,第3の実行サイクルE
1,E2,E3に対応する。また、レジスタ114A,
115A,116Aは、分岐命令以前の命令の実行時に
使用され、レジスタ114B,115B,116Bは、
先行実行命令の実行時に使用される。
Here, the arithmetic units 111, 112, 113
Are the first, second, and third execution cycles E of FIG. 3, respectively.
It corresponds to 1, E2 and E3. In addition, the register 114A,
115A and 116A are used when the instruction before the branch instruction is executed, and the registers 114B, 115B and 116B are
It is used when the preceding execution instruction is executed.

【0055】なお、以下の説明では、演算部111,1
12,113とレジスタ114A,115A,116A
で構成される実行パイプラインを第1の実行パイプライ
ンといい、演算部111,112,113とレジスタ1
14B,115B,116Bで構成される実行パイプラ
インを第2の実行パイプラインという。
In the following description, the arithmetic units 111, 1
12, 113 and registers 114A, 115A, 116A
The execution pipeline configured by is referred to as a first execution pipeline, and includes the arithmetic units 111, 112, 113 and the register 1.
The execution pipeline composed of 14B, 115B, and 116B is called a second execution pipeline.

【0056】セレクタ117,118は、第1の実行パ
イプラインと第2の実行パイプラインとで、演算部11
1,112,113を共用するために設けられる。
The selectors 117 and 118 are composed of a first execution pipeline and a second execution pipeline.
It is provided to share 1,112,113.

【0057】上記レジスタ114A,115A,116
Aは、フラグ19がリセットされている(S1=0)と
きは、書込み可能となり、セットされている(S1=
1)ときは、この書込みが禁止されるようになってい
る。これに対し、レジスタ114B,115B,116
Bは、フラグ19の状態に関係なく、常に、書込み可能
とされている。
The registers 114A, 115A, 116
A is writable and set (S1 =) when the flag 19 is reset (S1 = 0).
In the case of 1), this writing is prohibited. On the other hand, the registers 114B, 115B, 116
B is always writable regardless of the state of the flag 19.

【0058】また、上記セレクタ117,118は、オ
ア回路21の出力が0のときは、レジスタ114A,1
15Aの出力を選択し、1のときは、レジスタ114
B,115Bの出力を選択するように構成されている。
Further, the selectors 117 and 118, when the output of the OR circuit 21 is 0, register 114A, 1
When the output of 15 A is selected and when it is 1, the register 114
It is configured to select the output of B and 115B.

【0059】上記構成において、動作を説明する。The operation of the above configuration will be described.

【0060】まず、図3に示す命令フェッチサイクルF
で、命令レジスタ16にフェッチされた命令は、次の命
令デコード/オペランドリードサイクルDで、デコーダ
17によりデコードされる。
First, the instruction fetch cycle F shown in FIG.
Then, the instruction fetched in the instruction register 16 is decoded by the decoder 17 in the next instruction decode / operand read cycle D.

【0061】このデコード命令が分岐命令であると、そ
の旨がデコーダ17からフラグ制御部20に通知され
る。これにより、フラグ19がセットされる。その結
果、以降にデコードされる命令が先行実行命令であるこ
とが演算器11に知らされる。これに対し、デコード命
令が分岐命令でない場合は、フラグ19はリセット状態
に保持される。
If the decode instruction is a branch instruction, the decoder 17 notifies the flag control unit 20 to that effect. As a result, the flag 19 is set. As a result, the arithmetic unit 11 is informed that the instruction decoded thereafter is the preceding execution instruction. On the other hand, if the decode instruction is not a branch instruction, the flag 19 is held in the reset state.

【0062】また、デコード命令がパイプライン命令で
あると、この命令のデコード結果に基づいて、命令デコ
ード/オペランドリードサイクルDで、レジスタファイ
ル12からデータが読み出される。このデータは、レジ
スタ13,14に保持される。
If the decode instruction is a pipeline instruction, data is read from the register file 12 in the instruction decode / operand read cycle D based on the decode result of this instruction. This data is held in the registers 13 and 14.

【0063】レジスタ13,14に保持されたデータ
は、第1の実行サイクルE1で、演算部111により演
算される。この演算結果は、フラグ15がリセット状態
にあるときは、2つのレジスタ114A,114Bに書
き込まれる。これに対し、フラグ19がセット状態にあ
るときは、レジスタ114Bにのみ書き込まれる。これ
により、この場合は、レジスタ111Aの内容が保護さ
れる。
The data held in the registers 13 and 14 are calculated by the calculation unit 111 in the first execution cycle E1. This calculation result is written in the two registers 114A and 114B when the flag 15 is in the reset state. On the other hand, when the flag 19 is in the set state, it is written only in the register 114B. As a result, in this case, the contents of the register 111A are protected.

【0064】レジスタ111A,111Bの内容は、セ
レクタ117に供給される。このセレクタ117では、
フラグ19がリセット状態にあるときは、レジスタ11
4Aの内容が選択される。これに対し、フラグ19がセ
ット状態にあるときは、レジスタ11Bの内容が選択さ
れる。
The contents of the registers 111A and 111B are supplied to the selector 117. In this selector 117,
When the flag 19 is in the reset state, the register 11
4A content is selected. On the other hand, when the flag 19 is in the set state, the content of the register 11B is selected.

【0065】セレクタ117の選択出力は、第2の実行
サイクルE2で、演算部112により演算される。この
演算結果は、第1の実行サイクルE1と同様に、フラグ
19の状態に基づいて、レジスタ115A,115Bの
両方、あるいは、レジスタ115Bにのみ書き込まれ
る。
The selected output of the selector 117 is calculated by the calculation section 112 in the second execution cycle E2. Similar to the first execution cycle E1, this operation result is written in both the registers 115A and 115B or only in the register 115B based on the state of the flag 19.

【0066】レジスタ115A,115Bの内容は、セ
レクタ118に供給され、フラグ19の状態に応じて、
いずれか一方が選択される。この選択出力は、第3の実
行サイクルE3で、演算部113により演算される。こ
の演算結果は、フラグ19の状態に基づいて、レジスタ
116A,116Bの両方、あるいは、レジスタ116
Bにのみ書き込まれる。
The contents of the registers 115A and 115B are supplied to the selector 118, and depending on the state of the flag 19,
Either one is selected. This selection output is calculated by the calculation unit 113 in the third execution cycle E3. The result of this operation is based on the state of the flag 19, both of the registers 116A and 116B, or the register 116.
Only written to B.

【0067】最後に、書込みサイクルWでは、レジスタ
116Aの内容がレジスタファイル12に書き込まれ、
レジスタ116Bの内容がフューチャーファイル18に
書き込まれる。
Finally, in the write cycle W, the contents of the register 116A are written in the register file 12,
The contents of the register 116B are written in the future file 18.

【0068】このように、先行実行命令が実行される
と、演算結果はレジスタ114B,115B,116B
のみを通過し、レジスタ114A,115B,115B
の内容は保護される。したがって、分岐予測が失敗した
場合、レジスタ114A,115A,115Aの内容
を、以降の演算で用いることにより、正しい演算結果を
得ることができる。
As described above, when the preceding execution instruction is executed, the operation result is stored in the registers 114B, 115B, 116B.
Only through the registers 114A, 115B, 115B
The content of is protected. Therefore, when the branch prediction fails, the correct calculation result can be obtained by using the contents of the registers 114A, 115A, 115A in the subsequent calculations.

【0069】ここで、上述した動作をさらに詳細に説明
する。
Now, the above-mentioned operation will be described in more detail.

【0070】いま、分岐命令以前の命令が実行されてい
るものとする。この場合、フラグ19の出力S1は0に
設定されている。これにより、レジスタ114A,11
5A,116Aでは、対応する演算部111,112,
113の演算結果の書込みがなされる。また、セレクタ
117,118では、オア回路21の出力が0に設定さ
れているので、レジスタ114A,115Aの内容が選
択される。
Now, it is assumed that the instruction before the branch instruction is being executed. In this case, the output S1 of the flag 19 is set to 0. As a result, the registers 114A, 11
5A and 116A, the corresponding arithmetic units 111, 112,
The calculation result of 113 is written. Further, in the selectors 117 and 118, since the output of the OR circuit 21 is set to 0, the contents of the registers 114A and 115A are selected.

【0071】これにより、この場合は、第1の実行パイ
プラインにより、パイプライン命令が実行される。ま
た、この第1の実行パイプラインの出力は、レジスタフ
ァイル12に書込まれる。
As a result, in this case, the pipeline instruction is executed by the first execution pipeline. The output of this first execution pipeline is written in the register file 12.

【0072】なお、この場合、第1の実行パイプライン
の状態、すなわち、レジスタ114A,115A,11
6Aの内容は、第2の実行パイプラインのレジスタ11
4B,115B,116Bにも書き込まれる。
In this case, the state of the first execution pipeline, that is, the registers 114A, 115A, 11
The content of 6A is the register 11 of the second execution pipeline.
It is also written in 4B, 115B, and 116B.

【0073】これにより、実行パイプラインを第1の実
行パイプラインから第2の実行パイプラインに切り替え
る際、第2の実行パイプラインの状態を第1の実行パイ
プラインの状態で置き換える必要がなくなる。
Thus, when switching the execution pipeline from the first execution pipeline to the second execution pipeline, it is not necessary to replace the state of the second execution pipeline with the state of the first execution pipeline.

【0074】この状態で、先行実行命令の実行が開始さ
れると、フラグ19の出力S1が1に切り替えられる。
これにより、レジスタ114A,115A,116Aの
書込みが禁止される。また、セレクタ117,118で
は、オア回路21の出力が1に切り替えられるので、レ
ジスタ114B,115Bの内容が選択される。
In this state, when the execution of the preceding execution instruction is started, the output S1 of the flag 19 is switched to 1.
As a result, writing to the registers 114A, 115A and 116A is prohibited. In the selectors 117 and 118, since the output of the OR circuit 21 is switched to 1, the contents of the registers 114B and 115B are selected.

【0075】これにより、実行パイプラインが第1の実
行パイプラインから第2の実行パイプラインに切り替え
られる。その結果、分岐命令以前のパイプライン命令の
実行状態は、そのまま、第1の実行パイプラインに保存
される。
As a result, the execution pipeline is switched from the first execution pipeline to the second execution pipeline. As a result, the execution state of the pipeline instruction before the branch instruction is stored as it is in the first execution pipeline.

【0076】なお、この場合、上記の如く、第2の実行
パイプラインのレジスタ114B,115B,116B
には、第1の実行パイプラインのレジスタ114A,1
15A,116Aの内容が書き込まれているので、第2
の実行パイプラインの状態を第1の実行パイプラインの
状態で置き換える必要がない。
In this case, as described above, the registers 114B, 115B and 116B of the second execution pipeline are used.
To the registers 114A, 1 of the first execution pipeline.
Since the contents of 15A and 116A are written, the second
It is not necessary to replace the state of the execution pipeline of the above with the state of the first execution pipeline.

【0077】この状態で、分岐が確定すると、フラグ1
9の出力S1が0に切り替えられる。これにより、実行
パイプラインが第2の実行パイプラインから第1の実行
パイプラインに切り替えられる。
When the branch is confirmed in this state, the flag 1
The output S1 of 9 is switched to 0. As a result, the execution pipeline is switched from the second execution pipeline to the first execution pipeline.

【0078】但し、この場合、分岐予測が失敗した場合
と成功した場合とで、異なる切替えを行なう必要があ
る。
However, in this case, different switching needs to be performed depending on whether the branch prediction fails or succeeds.

【0079】すなわち、分岐予測が失敗した場合は、実
行パイプラインの状態を元に戻す必要がある。したがっ
て、この場合は、そのまま実行パイプラインを切り替え
ればよい。
That is, when the branch prediction fails, it is necessary to restore the state of the execution pipeline. Therefore, in this case, the execution pipeline may be switched as it is.

【0080】これに対し、分岐予測が成功した場合は、
第2の実行パイプラインの状態から以降の命令の実行を
開始する必要がある。したがって、この場合、第1の実
行パイプラインの状態が第2の実行パイプラインの状態
で置き換えられる。この置換えは、制御部18の分岐予
測判定出力S2によりなされる。
On the other hand, if the branch prediction is successful,
It is necessary to start executing subsequent instructions from the state of the second execution pipeline. Therefore, in this case, the state of the first execution pipeline is replaced with the state of the second execution pipeline. This replacement is performed by the branch prediction determination output S2 of the control unit 18.

【0081】すなわち、この分岐予測判定出力S2は、
分岐予測が成功した場合は、その判定サイクルの次のサ
イクルの間だけ1となる。これにより、この場合は、セ
レクタ117,118の切替えタイミングが、分岐予測
が失敗した場合より、1サイクル分遅れる。その結果、
レジスタ115A,116Aにレジスタ114B,11
5Bの内容が書き込まれる。これにより、第1の実行パ
イプラインの状態が第2の実行パイプラインの状態で置
き換えられたことになる。
That is, this branch prediction judgment output S2 is
If the branch prediction is successful, it becomes 1 only during the cycle next to the determination cycle. As a result, in this case, the switching timing of the selectors 117 and 118 is delayed by one cycle from the case where the branch prediction fails. as a result,
Registers 115B and 116A have registers 114B and 11
The contents of 5B are written. As a result, the state of the first execution pipeline is replaced with the state of the second execution pipeline.

【0082】図8は、分岐予測が失敗した場合の実行パ
イプラインの状態を示す図である。同様に、図9は、分
岐予測が成功した場合の実行パイプラインの状態を示す
図である。なお、この図8,9は、図2(a)の命令列
を実行する場合を示す。また、分岐予測により、命令
(8),(9),(10)を先行実行する場合を示す。
FIG. 8 is a diagram showing the state of the execution pipeline when the branch prediction fails. Similarly, FIG. 9 is a diagram showing the state of the execution pipeline when the branch prediction is successful. 8 and 9 show the case where the instruction sequence of FIG. 2 (a) is executed. Further, the case where the instructions (8), (9), and (10) are executed in advance by branch prediction is shown.

【0083】図8,図9に示す如く、分岐命令(7)の
実行が開始されると、次の命令(最初の先行実行命令)
(8)の最初の実行サイクルで、フラグ19の出力S1
が0から1に切り替えられる。これにより、命令(8)
の演算結果がレジスタ114Bにのみ書き込まれる。
As shown in FIGS. 8 and 9, when the execution of the branch instruction (7) is started, the next instruction (first preceding execution instruction) is executed.
In the first execution cycle of (8), the output S1 of the flag 19
Is switched from 0 to 1. This gives instructions (8)
The calculation result of is written only in the register 114B.

【0084】また、セレクタ117,118では、それ
ぞれレジスタ114B,115Bの内容が選択される。
これにより、レジスタ115B,116Bには、レジス
タ114B,115Bの内容が書き込まれる。
The selectors 117 and 118 select the contents of the registers 114B and 115B, respectively.
As a result, the contents of the registers 114B and 115B are written in the registers 115B and 116B.

【0085】その結果、第2の実行パイプラインが1ス
テージだけ進められる。これに対し、第1の実行パイプ
ラインの実行内容は、そのまま保存される。以下、同様
に、先行実行命令(9),(10)の実行が開始される
たびに、第2の実行パイプラインが1ステージずつ進め
られる。
As a result, the second execution pipeline advances by one stage. On the other hand, the execution content of the first execution pipeline is saved as it is. Similarly, every time the execution of the preceding execution instructions (9) and (10) is started, the second execution pipeline is advanced by one stage.

【0086】最後の先行実行命令(10)の実行が開始
されると、分岐が確定する。これにより、フラグ19の
出力S1は、次のサイクルで0に切り替えられる。その
結果、図8の場合においては、命令(12)の演算結果
がレジスタ114A,114Bに書き込まれ、図9の場
合においては、命令(11)の演算結果がレジスタ11
4A,114Bに書き込まれる。
When the execution of the last preceding execution instruction (10) is started, the branch is determined. As a result, the output S1 of the flag 19 is switched to 0 in the next cycle. As a result, in the case of FIG. 8, the operation result of the instruction (12) is written in the registers 114A and 114B, and in the case of FIG.
4A and 114B are written.

【0087】これに対し、分岐予測判定出力S2は、分
岐予測が失敗した場合は、そのまま0に保持され、分岐
予測が成功した場合は、フラグ19の出力S1が0に切
り替えられたサイクルの間だけ1に切り替えられる。
On the other hand, the branch prediction judgment output S2 is held at 0 as it is when the branch prediction fails, and when the branch prediction is successful, the output S1 of the flag 19 is switched to 0 during the cycle. Only can be switched to 1.

【0088】これにより、分岐予測が失敗した場合は、
セレクタ117,118では、フラグ19が0に切り替
えられたサイクルからレジスタ114A,115Aの内
容が選択される。
As a result, if the branch prediction fails,
The selectors 117 and 118 select the contents of the registers 114A and 115A from the cycle when the flag 19 is switched to 0.

【0089】その結果、図8に示すように、レジスタ1
15A,115Bにはレジスタ114Aの内容が書き込
まれ、レジスタ116A,116Bには、レジスタ11
5Aの内容が書き込まれる。これにより、この場合は、
命令(12)の実行は、実行パイプラインの状態を元に
戻した状態から開始される。
As a result, as shown in FIG.
The contents of the register 114A are written in 15A and 115B, and the register 11 is written in the registers 116A and 116B.
The contents of 5A are written. So in this case,
Execution of the instruction (12) starts from a state in which the state of the execution pipeline is restored.

【0090】これに対し、分岐予測が成功した場合は、
セレクタ117,118では、フラグ19が0に切り替
えられたサイクルまで、レジスタ114B,115Bの
内容が選択される。
On the other hand, if the branch prediction is successful,
The selectors 117 and 118 select the contents of the registers 114B and 115B until the cycle in which the flag 19 is switched to 0.

【0091】これにより、図9に示すように、レジスタ
115A,115Bには、レジスタ114Bの内容が書
き込まれ、レジスタ116A,116Bには、レジスタ
115Bの内容が書き込まれる。その結果、この場合
は、命令(11)の実行は、第1の実行パイプラインの
状態を第2の実行パイプラインの状態で置換した状態か
ら開始される。
As a result, as shown in FIG. 9, the contents of the register 114B are written in the registers 115A and 115B, and the contents of the register 115B are written in the registers 116A and 116B. As a result, in this case, the execution of the instruction (11) starts from a state in which the state of the first execution pipeline is replaced with the state of the second execution pipeline.

【0092】以上詳述したこの実施例によれば、次のよ
うな効果が得られる。
According to this embodiment described in detail above, the following effects can be obtained.

【0093】(1)まず、演算器11の実行パイプライ
ンを二重構成とし、分岐命令以前の命令を実行する場合
と、分岐命令後の先行実行命令を実行する場合とで、2
つの実行パイプラインを切り替えて使用するようにした
ので、分岐予測が失敗した場合でも、単に実行パイプラ
インを切り替えるだけの簡単な制御により、実行パイプ
ラインの状態を元に戻すことができる。
(1) First, the execution pipeline of the arithmetic unit 11 has a dual structure, and two cases are executed depending on whether the instruction before the branch instruction is executed or the preceding execution instruction after the branch instruction is executed.
Since the two execution pipelines are switched and used, even if the branch prediction fails, the state of the execution pipeline can be returned to the original state by the simple control of simply switching the execution pipelines.

【0094】(2)また、分岐命令以前の命令の実行
時、この命令の実行で使用される第1の実行パイプライ
ンの状態を、逐次、第2の実行パイプラインに書き込む
ようにしたので、実行パイプラインを第1の実行パイプ
ラインから第2の実行パイプラインに切り替える際、第
2の実行パイプラインの状態を第1の実行パイプライン
の状態で置換する処理が不要となる。
(2) Further, when the instruction before the branch instruction is executed, the state of the first execution pipeline used in the execution of this instruction is written into the second execution pipeline one after another. When switching the execution pipeline from the first execution pipeline to the second execution pipeline, the process of replacing the state of the second execution pipeline with the state of the first execution pipeline becomes unnecessary.

【0095】(3)さらに、レジスタ114A,114
Bの内容を択一的に選択するセレクタ117と、レジス
タ115A,115Bの内容を択一的に選択するセレク
タ118により、2つの実行パイプラインを切り替える
ようにしたので、この2つの実行パイプラインで、演算
部111,112,113を共用することができる。
(3) Further, the registers 114A and 114
Since the selector 117 for selectively selecting the contents of B and the selector 118 for selectively selecting the contents of the registers 115A and 115B are configured to switch between the two execution pipelines, the two execution pipelines are used. , The arithmetic units 111, 112, 113 can be shared.

【0096】以上、この発明の一実施例を詳細に説明し
たが、この発明は、上述したような実施例に限定される
ものではない。
Although one embodiment of the present invention has been described in detail above, the present invention is not limited to the above embodiment.

【0097】(1)例えば、先の実施例では、分岐命令
以前の命令の実行時に、第1の実行パイプラインの状態
を、逐次、第2の実行パイプラインに書き込む場合を説
明した。しかし、この発明は、この書込みを省略し、第
1の実行パイプラインから第2の実行パイプラインへの
切替え時に、第2の実行パイプラインの状態を第1の実
行パイプラインの状態で置き換えるようにしてもよい。
(1) For example, in the above embodiment, the case where the state of the first execution pipeline is sequentially written to the second execution pipeline when the instruction before the branch instruction is executed has been described. However, the present invention omits this writing and replaces the state of the second execution pipeline with the state of the first execution pipeline when switching from the first execution pipeline to the second execution pipeline. You may

【0098】(2)また、先の実施例では、演算器11
1,112,113を第1,第2の実行パイプラインで
共用する場合を説明した。しかし、この発明は、これら
を各実行パイプラインごとに独立に設けるようにしても
よい。
(2) In the above embodiment, the arithmetic unit 11
The case where 1, 112, 113 are shared by the first and second execution pipelines has been described. However, in the present invention, these may be provided independently for each execution pipeline.

【0099】(3)さらに、先の実施例では、分岐予測
が成功した場合にも、実行パイプラインを切り替える場
合を説明した。しかし、この発明は、このような場合
は、実行パイプラインを切り替えないようにしてもよ
い。
(3) Furthermore, in the previous embodiment, the case where the execution pipeline is switched even when the branch prediction is successful has been described. However, the present invention may not switch the execution pipeline in such a case.

【0100】すなわち、分岐予測が成功した場合は、そ
のとき使用していた実行パイプラインをそのまま使用
し、次の分岐命令に出会ったとき、実行パイプラインの
切替えを行なうようにしてもよい。
That is, when the branch prediction is successful, the execution pipeline used at that time may be used as it is, and the execution pipeline may be switched when the next branch instruction is encountered.

【0101】但し、この場合、分岐命令以前の命令の実
行で使用される実行パイプラインと先行実行命令の実行
で使用される実行パイプラインを予め定めることができ
ないので、例えば、2つの実行パイプラインと2つのフ
ァイル12,15の間に切替えスイッチを設け、分岐命
令以前の命令を実行しているパイプラインの出力をレジ
スタファイル12に書き込む必要がある。
However, in this case, since it is not possible to predetermine the execution pipeline used in the execution of the instruction before the branch instruction and the execution pipeline used in the execution of the preceding execution instruction, for example, two execution pipelines are used. It is necessary to provide a changeover switch between the two files 12 and 15 and write the output of the pipeline executing the instruction before the branch instruction to the register file 12.

【0102】(4)さらにまた、先の実施例では、この
発明を、分岐ペナルティ軽減方式として分岐予測方式を
採用する情報処理装置に適用する場合を説明した。しか
し、この発明は、ある種の遅延分岐方式を採用する情報
処理装置にも適用することができる。
(4) Furthermore, in the above embodiment, the case where the present invention is applied to the information processing apparatus which adopts the branch prediction method as the branch penalty mitigation method has been described. However, the present invention can also be applied to an information processing apparatus that employs a certain kind of delay branch method.

【0103】すなわち、遅延分岐方式は、分岐命令に出
会うと、常にその後に続く遅延スロット命令を実行する
ものである。したがって、この方式は、静的な分岐予測
方式の一種とみることができる。しかも、この遅延分岐
方式には、分岐が成立しない場合に、遅延スロット命令
を取り消す方式がある。
That is, in the delayed branch method, when a branch instruction is encountered, a delay slot instruction that follows the branch instruction is always executed. Therefore, this method can be regarded as a kind of static branch prediction method. Moreover, this delay branch method has a method of canceling the delay slot instruction when the branch is not taken.

【0104】このような方式は、分岐予測方式となんら
変わることがない。したがって、この発明は、遅延分岐
方式を採用する情報処理装置であっても、上述したよう
な方式を採用する情報処理装置には、予測分岐方式を採
用する情報処理装置と同様に、適用することができる。
Such a scheme is no different from the branch prediction scheme. Therefore, even if an information processing apparatus adopting the delayed branch method is applied to the information processing apparatus adopting the method as described above, the present invention can be applied similarly to the information processing apparatus adopting the predictive branch method. You can

【0105】(5)また、先の実施例では、命令が分岐
命令以前の命令か、分岐命令後の先行実行命令かをデコ
ーダ17が動的に判定する場合を説明した。しかし、こ
の発明は、コンパイラによって分岐方向を予測し、予め
条件付き実行モードであることを示すビットを命令内に
付加する方法にも適用可能である。この場合、デコーダ
は、上記ビットに基づいて、上記判定を静的に行なうこ
とができる。
(5) In the above embodiment, the case where the decoder 17 dynamically determines whether the instruction is the instruction before the branch instruction or the preceding execution instruction after the branch instruction has been described. However, the present invention can also be applied to a method of predicting a branch direction by a compiler and adding a bit indicating in advance a conditional execution mode in an instruction. In this case, the decoder can statically make the determination based on the bits.

【0106】(6)このほかにも、この発明は、その要
旨を逸脱しない範囲で種々様々変形実施可能なことは勿
論である。
(6) In addition to this, it goes without saying that the present invention can be variously modified and implemented without departing from the scope of the invention.

【0107】[0107]

【発明の効果】以上詳述したように、この発明によれ
ば、分岐予測が失敗した場合でも、簡単な制御により、
実行パイプラインの状態を元に戻すことが可能な情報処
理装置を提供することができる。
As described above in detail, according to the present invention, even if the branch prediction fails, the simple control enables
It is possible to provide an information processing device that can restore the state of the execution pipeline.

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

【図1】この発明の一実施例の構成を示すブロック図で
ある。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.

【図2】従来のパイプライン方式の演算器の動作を説明
するための図である。
FIG. 2 is a diagram for explaining the operation of a conventional pipeline type arithmetic unit.

【図3】パイプライン構成の一例を示す図である。FIG. 3 is a diagram showing an example of a pipeline configuration.

【図4】分岐命令を含む命令列の一例を示す図である。FIG. 4 is a diagram showing an example of an instruction sequence including a branch instruction.

【図5】図4の命令列を実行する前のレジスタの内容を
示す図である。
5 is a diagram showing the contents of registers before the instruction sequence in FIG. 4 is executed.

【図6】分岐が成立しない場合と成立した場合の実行パ
イプラインの状態を示す図である。
FIG. 6 is a diagram showing states of an execution pipeline when a branch is not taken and when it is taken.

【図7】分岐予測が失敗した場合の実行パイプラインの
状態を示す図である。
FIG. 7 is a diagram showing a state of an execution pipeline when branch prediction fails.

【図8】分岐予測が失敗した場合の一実施例の実行パイ
プラインの状態を示す図である。
FIG. 8 is a diagram showing a state of an execution pipeline according to an embodiment when branch prediction fails.

【図9】分岐予測が成功した場合の一実施例の実行パイ
プラインの状態を示す図である。
FIG. 9 is a diagram showing a state of an execution pipeline according to an embodiment when branch prediction is successful.

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

11…演算器、12…レジスタファイル、13,14…
レジスタ、15…フューチャーファイル、16…命令レ
ジスタ、17…デコーダ、18…制御部、19…フラ
グ、20…フラグ制御部、21…オア回路、111,1
12,113…演算部、114A,114B,115
A,115B,116A,116B…パイプラインレジ
スタ、117,118…セレクタ。
11 ... Arithmetic unit, 12 ... Register file, 13, 14 ...
Register, 15 ... Future file, 16 ... Instruction register, 17 ... Decoder, 18 ... Control unit, 19 ... Flag, 20 ... Flag control unit, 21 ... OR circuit, 111, 1
12, 113 ... Arithmetic unit, 114A, 114B, 115
A, 115B, 116A, 116B ... Pipeline registers 117, 118 ... Selectors.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 演算がパイプライン化されているととも
に、静的あるいは動的な分岐予測により、命令の先行実
行を行なう情報処理装置において、 2つの実行パイプラインを有し、パイプライン命令の実
行により、この実行パイプラインが1ステージずつ進め
られる演算手段と、 分岐命令以前の命令を実行する場合と分岐命令後の先行
実行命令を実行する場合とで、前記2つの実行パイプラ
インを切り替えて使用するパイプライン切替え手段とを
具備したことを特徴とする情報処理装置。
1. An information processing device in which an operation is pipelined and which executes instructions in advance by static or dynamic branch prediction, has two execution pipelines, and executes pipeline instructions. According to the above, the execution pipeline is switched by one stage, and the two execution pipelines are switched and used depending on whether the instruction before the branch instruction is executed or the preceding execution instruction after the branch instruction is executed. An information processing apparatus, comprising:
JP9118093A 1993-04-19 1993-04-19 Information processor Pending JPH06301534A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9118093A JPH06301534A (en) 1993-04-19 1993-04-19 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9118093A JPH06301534A (en) 1993-04-19 1993-04-19 Information processor

Publications (1)

Publication Number Publication Date
JPH06301534A true JPH06301534A (en) 1994-10-28

Family

ID=14019262

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9118093A Pending JPH06301534A (en) 1993-04-19 1993-04-19 Information processor

Country Status (1)

Country Link
JP (1) JPH06301534A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7647488B2 (en) 2003-01-30 2010-01-12 Fujitsu Limited Information processing device with branch history restoration
USRE48845E1 (en) 2002-04-01 2021-12-07 Broadcom Corporation Video decoding system supporting multiple standards

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
USRE48845E1 (en) 2002-04-01 2021-12-07 Broadcom Corporation Video decoding system supporting multiple standards
US7647488B2 (en) 2003-01-30 2010-01-12 Fujitsu Limited Information processing device with branch history restoration

Similar Documents

Publication Publication Date Title
EP0423906B1 (en) Method of and apparatus for nullifying an instruction
JP3781052B2 (en) Superscaler microprocessor
US4740893A (en) Method for reducing the time for switching between programs
US6665776B2 (en) Apparatus and method for speculative prefetching after data cache misses
EP0605872B1 (en) Method and system for supporting speculative execution of instructions
JP3594506B2 (en) Microprocessor branch instruction prediction method.
JP5313253B2 (en) Link stack repair for speculative updates of errors
US5619664A (en) Processor with architecture for improved pipelining of arithmetic instructions by forwarding redundant intermediate data forms
US6687812B1 (en) Parallel processing apparatus
US5634136A (en) Data processor and method of controlling the same
JP3802038B2 (en) Information processing device
US7472264B2 (en) Predicting a jump target based on a program counter and state information for a process
JPH06301534A (en) Information processor
US6453412B1 (en) Method and apparatus for reissuing paired MMX instructions singly during exception handling
US6604193B1 (en) Processor in which register number translation is carried out
RU2816094C1 (en) Vliw processor with additional preparation pipeline and transition predictor
JP2019510313A (en) Vector instruction processing
JP2569867B2 (en) Effective Address Precalculation Pipeline Microprocessor
JPH05108348A (en) Parallel arithmetic processor
JPH08328856A (en) Computer apparatus for processing of branch instruction
JPH06324867A (en) Information processor
JPH06222919A (en) Pipeline information processor