JP3394854B2 - Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register - Google Patents

Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register

Info

Publication number
JP3394854B2
JP3394854B2 JP18235295A JP18235295A JP3394854B2 JP 3394854 B2 JP3394854 B2 JP 3394854B2 JP 18235295 A JP18235295 A JP 18235295A JP 18235295 A JP18235295 A JP 18235295A JP 3394854 B2 JP3394854 B2 JP 3394854B2
Authority
JP
Japan
Prior art keywords
instruction
unconditional jump
branch destination
jump instruction
general
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP18235295A
Other languages
Japanese (ja)
Other versions
JPH0934704A (en
Inventor
泰功 野末
俊春 大島
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 JP18235295A priority Critical patent/JP3394854B2/en
Publication of JPH0934704A publication Critical patent/JPH0934704A/en
Application granted granted Critical
Publication of JP3394854B2 publication Critical patent/JP3394854B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、無条件ジャンプ命
令処理方法およびそのための装置に関し、特にプリデコ
ードした命令が無条件ジャンプ命令の場合に、汎用レジ
スタの特定領域に入っている第1の分岐先アドレスの記
憶領域から分岐先命令をプリフェッチして保持するとと
もに、デコード後の前記無条件ジャンプ命令を実行する
に際し、これにより特定される第2の分岐先アドレスが
第1の分岐先アドレスと一致することを確認した上で前
記分岐先命令を続けて実行するようにしたものに関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an unconditional jump instruction processing method and an apparatus therefor, and particularly when a predecoded instruction is an unconditional jump instruction, a first branch in a specific area of a general-purpose register. The second branch destination address specified by this prefetches and holds the branch destination instruction from the storage area of the destination address, and at the time of executing the decoded unconditional jump instruction matches the first branch destination address. It is confirmed that the branch destination instruction is continuously executed.

【0002】一般に、プロセッサにおける無条件ジャン
プ命令の分岐処理の高速化を図るために、汎用レジスタ
の特定領域に分岐先アドレスを保持しておき、無条件ジ
ャンプ命令がプリデコードされた時点でこの分岐先アド
レスの分岐先命令をプリフェッチすることが行われてい
る。
Generally, in order to speed up the branch processing of an unconditional jump instruction in a processor, a branch destination address is held in a specific area of a general-purpose register, and this branch is executed when the unconditional jump instruction is predecoded. Prefetching the branch destination instruction at the destination address is performed.

【0003】そして、例えばそれぞれパイプライン処理
を行っている多重プロセッサの出力同士を比較するよう
な高信頼性システムの場合に、第1のプロセッサで発生
したパリティエラーなどが第2のプロセッサに通知され
る前に当該プロセッサが新たな命令を実行して前記特定
領域の内容を変更した状態、すなわち第1のプロセッサ
と第2のプロセッサの各汎用レジスタで指定される分岐
先アドレスが不一致となって、両プロセッサが再同期ス
タートした後の無条件ジャンプ命令の際にプリフェッチ
される分岐先命令が異なるといったエラー状態の発生を
抑制することが望ましく、本発明はこのような要請に応
えるものである。
Then, for example, in the case of a high-reliability system in which the outputs of multiple processors each performing pipeline processing are compared with each other, a parity error or the like generated in the first processor is notified to the second processor. Before the processor executes a new instruction to change the contents of the specific area, that is, the branch destination addresses specified by the general-purpose registers of the first processor and the second processor do not match, It is desirable to suppress the occurrence of an error state in which the branch destination instructions that are prefetched differ when an unconditional jump instruction is issued after both processors have started resynchronization, and the present invention addresses such a demand.

【0004】[0004]

【従来の技術】図5は、従来の無条件ジャンプ命令処理
方式の概要を示す説明図であり、11は主記憶、12は命令
キャッシュ、13は命令バッファ、14はこの命令バッファ
中のプリデコード部、15は命令種別信号、16はデコード
部、17はデ−タキャッシュ、18は汎用レジスタ、19はこ
の汎用レジスタ中の特定領域(例えばGR3)、20はこ
の特定領域に格納されている分岐先アドレス、21は演算
部、22はゲート部をそれぞれ示している。
2. Description of the Related Art FIG. 5 is an explanatory view showing an outline of a conventional unconditional jump instruction processing system. 11 is a main memory, 12 is an instruction cache, 13 is an instruction buffer, and 14 is a predecode in this instruction buffer. Section, 15 is an instruction type signal, 16 is a decoding section, 17 is a data cache, 18 is a general register, 19 is a specific area (eg GR3) in this general register, and 20 is a branch stored in this specific area. A destination address, 21 is an arithmetic unit, and 22 is a gate unit.

【0005】ここで、主記憶11から命令キャッシュ12に
移された命令群はプログラムカウンタ(図示省略)によ
って指示される順序で命令バッファ13に取り込まれ、そ
このプリデコード部14でプリデコードされてその内容が
無条件ジャンプ命令であるかどうかの判断がおこなわれ
る。
Here, the instruction group transferred from the main memory 11 to the instruction cache 12 is fetched into the instruction buffer 13 in the order instructed by the program counter (not shown) and predecoded by the predecoding section 14 there. It is determined whether the content is an unconditional jump instruction.

【0006】この判断結果が「無条件ジャンプ命令であ
る」の場合にはその旨の命令種別信号15がゲート部22に
送られてこれを開状態とし、汎用レジスタ中の特定領域
19の分岐先アドレス20がプリフェッチ用デ−タとして主
記憶11や命令キャッシュ12に与えられ、この分岐先アド
レス20の領域の命令(分岐先命令)がプリフェッチされ
て命令バッファ13に格納される。
If the result of this determination is "unconditional jump instruction", an instruction type signal 15 to that effect is sent to the gate section 22 to open it, and the specific area in the general register is opened.
The branch destination address 20 of 19 is given to the main memory 11 and the instruction cache 12 as prefetch data, and the instruction (branch destination instruction) in the area of the branch destination address 20 is prefetched and stored in the instruction buffer 13.

【0007】そして、命令バッファ13から取り出された
前記無条件ジャンプ命令がデコード部16でデコードさ
れ、その内容が演算部21で実行されるとき、プロセッサ
は当該命令により指定される汎用レジスタ領域のデ−タ
(本来の分岐先アドレス)とプリフェッチのときに用い
た分岐先アドレス20と一致するかどうかを判断する。
Then, when the unconditional jump instruction fetched from the instruction buffer 13 is decoded by the decoding unit 16 and the content thereof is executed by the arithmetic unit 21, the processor deactivates the data in the general-purpose register area designated by the instruction. -Whether it matches the target address (original branch destination address) and the branch destination address 20 used during prefetch.

【0008】その結果が「一致する」の場合にはすでに
命令バッファ13に格納している分岐先命令を続けて実行
し、また「一致しない」の場合にはこの分岐先命令を取
り消すとともにあらためて本来の分岐先アドレスへのフ
ェッチ処理へと移行する。
If the result is "match", the branch destination instruction already stored in the instruction buffer 13 is continuously executed, and if "no match", this branch destination instruction is canceled and the original The process moves to the fetch processing to the branch destination address of.

【0009】このように、無条件ジャンプ命令の場合に
はプリデコードのときにその分岐先アドレスをいわば予
測することにより当該命令に続いて実行される分岐先命
令をあらかじめ命令バッファ13にプリフェッチしてお
き、その後の当該無条件ジャンプ命令の実行時に本来の
分岐先アドレスと先の予測値が一致することを確認した
上でプリフェッチした分岐先命令を用いるようにしてい
る。
As described above, in the case of an unconditional jump instruction, the branch destination address to be executed following the instruction is prefetched into the instruction buffer 13 in advance by predicting the branch destination address at the time of predecoding. Then, the prefetched branch destination instruction is used after confirming that the original branch destination address and the previous predicted value match when the unconditional jump instruction is executed thereafter.

【0010】この分岐先アドレスの予測精度を高めるた
めには、プログラム作成者は、 ・無条件ジャンプ命令で指定される汎用レジスタ領域の
デ−タ(本来の分岐先アドレス)と当該命令のプリデコ
ード時の特定領域19のデ−タ(予測した分岐先アドレ
ス)とを極力一致させる、 ・無条件ジャンプ命令で指定される汎用レジスタ領域と
して特定領域19を極力用いる、ような各プログラムを作
成することになる。
In order to improve the prediction accuracy of this branch destination address, the program creator must: -Data of the general-purpose register area designated by the unconditional jump instruction (original branch destination address) and predecoding of the instruction. Create each program such that the data (predicted branch destination address) of the specific area 19 at the time is matched as much as possible, and the specific area 19 is used as much as possible as a general-purpose register area specified by the unconditional jump instruction. become.

【0011】なお、汎用レジスタ18はキャッシュメモリ
やアドレス変換バッファのような有効フラグを持たない
のが一般的である。これは、汎用レジスタのセットはプ
ログラムによって行われるため、その作成者はどの領域
にデ−タが書き込まれ、またどの領域が無効デ−タ(不
定デ−タ)であるかを知ることができ、この無効デ−タ
領域を参照しないようなプログラム内容とすればよいか
らである。
The general-purpose register 18 generally does not have a valid flag like a cache memory or an address translation buffer. This is because the setting of general-purpose registers is performed by the program, so that the creator can know which area the data is written to and which area is invalid data (undefined data). This is because the program content should not refer to this invalid data area.

【0012】また、無条件ジャンプ命令の例としては、
サブルーチン呼び出し命令で復帰アドレスを汎用レジス
タに格納し、サブルーチンから戻るときにこの汎用レジ
スタの値を用いることなどがある。
As an example of the unconditional jump instruction,
For example, the return address is stored in a general-purpose register by a subroutine call instruction, and the value of this general-purpose register is used when returning from the subroutine.

【0013】図6は、従来の、二重プロセッサの一方で
パリティエラーが発生したときの様子を示す説明図であ
り、CPU♯1とCPU♯2はともに同じ命令群をパイ
プライン処理している。なお、各命令の内容は、デコー
ド(Decode )ー演算(Execute)ーライト(Write)
の一連の処理である。
FIG. 6 is an explanatory diagram showing a state where a parity error occurs in one of the conventional dual processors, and both CPU # 1 and CPU # 2 pipeline the same instruction group. . The contents of each instruction are decoded (Decode) -operation (Execute) -write (Write).
Is a series of processing.

【0014】CPU♯1は、命令1のデコードサイクル
(1番目のサイクル)でパリティエラーが発生したため
に次のサイクルの命令実行をキャンセルして割込みを発
生し、続いて逐次処理へと移行する。
The CPU # 1 cancels the instruction execution of the next cycle due to the occurrence of a parity error in the decode cycle of the instruction 1 (first cycle), generates an interrupt, and then shifts to sequential processing.

【0015】CPU♯2は、CPU♯1から、このパリ
ティエラーの通知を5番目のサイクルで受け取り当該サ
イクルの命令実行をキャンセルして割込みを発生し、続
いて逐次処理へと移行する。
The CPU # 2 receives the parity error notification from the CPU # 1 in the fifth cycle, cancels the instruction execution in the cycle, generates an interrupt, and then shifts to the sequential processing.

【0016】すなわち、CPU♯2の方は、CPU♯1
でパリティエラーが発生した後もプロセス実行を継続し
て命令1〜命令4の処理を行なっており、命令2の実行
の結果、CPU♯2の汎用レジスタ18のGR3領域(特
定領域)の内容はGR4領域のデ−タとGR5領域のデ
−タとの加算値で更新される。
That is, the CPU # 1 is the CPU # 1.
Even after the parity error occurs, the process is continued to process the instructions 1 to 4, and as a result of the execution of the instruction 2, the contents of the GR3 area (specific area) of the general-purpose register 18 of the CPU # 2 are It is updated with the added value of the data in the GR4 area and the data in the GR5 area.

【0017】一方、CPU♯1の汎用レジスタ18のGR
3領域はこのような更新が行われないので、割込み発生
時点(プロセス実行の最終サイクル)での各CPUにお
けるGR3領域の内容、すなわち分岐先アドレスには不
一致が生じることになる。もっとも、この段階での分岐
先アドレスの不一致はエラーとはならない。
On the other hand, the GR of the general-purpose register 18 of the CPU # 1
Since such an update is not performed for the three areas, the contents of the GR3 area in each CPU at the time of the interrupt occurrence (the final cycle of the process execution), that is, the branch destination address will be inconsistent. However, a mismatch of branch destination addresses at this stage does not result in an error.

【0018】なお、逐次処理とは、割込み発生時点では
まだ完了していない突き放し処理の完了を待つことであ
り、例えばそれ以前の命令によってメモリへの書き込み
が要求されてその書き込み待ちがある場合にこれの実行
が終了するまで割込み処理への状態遷移を待たせること
である。
The sequential processing is to wait for the completion of the push-out processing which has not been completed at the time of occurrence of the interrupt. For example, when writing to the memory is requested by an instruction before that and there is a waiting for the writing. This is to make the state transition to the interrupt processing wait until the execution of this is completed.

【0019】CPU♯1およびCPU♯2は、ともに停
止状態のt1 の時点で再同期スタートして退避・切替処
理へと移行する。このとき、各CPUは、割込み発生時
点での自らの状態を表すPSW(processor status wor
d) や実行命令のアドレスを示すPC(programm counte
r)の内容をそれぞれの制御レジスタなどにいったん退避
させ、かつPSWおよびPCの内容を割込み処理用の新
たなデ−タに切り替えている。
Both CPU # 1 and CPU # 2 start resynchronization at the time of t 1 in the stopped state and shift to the save / switch processing. At this time, each CPU has a PSW (processor status wor) that indicates its own state at the time of occurrence of an interrupt.
d) or a PC (programm counte) that indicates the address of the execution instruction
The contents of r) are temporarily saved in the respective control registers and the like, and the contents of PSW and PC are switched to new data for interrupt processing.

【0020】続いてCPU♯1およびCPU♯2はt2
の時点でプロセス実行の再開(割込処理)へと移行す
る。このとき、各CPUは、自らのキャッシュメモリや
アドレス変換バッファの各フラグを無効化し、また対応
する内部レジスタ等の内容をすべて一致させてから復帰
する。なお、各CPUの汎用レジスタはフラグを有して
いないので無効化されることはない。
Subsequently, CPU # 1 and CPU # 2 set t 2
At the point of, the process is restarted (interrupt processing). At this time, each CPU invalidates each flag of its own cache memory and address translation buffer, and also matches the contents of corresponding internal registers and the like, and then returns. The general-purpose register of each CPU does not have a flag and is not invalidated.

【0021】ここで、「復帰」とは、割込処理から通常
処理に戻ること、すなわち各CPUで一致するように復
元されたPSW、PCおよび汎用レジスタの各デ−タを
用いてプロセス実行を再開することである。
Here, "return" means returning from interrupt processing to normal processing, that is, process execution using each data of PSW, PC and general-purpose register restored to match in each CPU. It is to restart.

【0022】また、各CPUの内部レジスタ等の内容を
一致させるためには、多重CPUの任意の一つを基準と
してその退避データなどをメモリに書き出し、これを全
CPUに読み込ませる等の処理が行なわれる。
Further, in order to match the contents of the internal registers of each CPU, the saved data and the like are written to the memory with reference to an arbitrary one of the multiple CPUs and read by all CPUs. Done.

【0023】一方、図示のCPU♯1およびCPU♯2
は、割込処理に入っても各CPUの内部状態を一致させ
る処理が終了するまではそれぞれの汎用レジスタ18のG
R3領域(特定領域)のデ−タは不一致のままである。
On the other hand, the illustrated CPU # 1 and CPU # 2
Even if the interrupt processing is started, G of each general-purpose register 18 is kept until the processing for matching the internal states of the CPUs is completed.
The data in the R3 area (specific area) remains inconsistent.

【0024】そのため、割込処理プログラム中の無条件
ジャンプ命令がプリデコードされると、CPU♯1がそ
の汎用レジスタ18のGR3領域から取り出してくる分岐
先アドレスとCPU♯2のそれとが一致せずエラーとな
る。
Therefore, when the unconditional jump instruction in the interrupt processing program is pre-decoded, the branch destination address fetched from the GR3 area of the general-purpose register 18 by the CPU # 1 does not match that of the CPU # 2. An error will occur.

【0025】[0025]

【発明が解決しようとする課題】従来のこのような無条
件ジャンプ命令処理方式は、当該命令のプリデコードの
ときに予測した分岐先アドレスと無条件ジャンプ命令が
期待している分岐先アドレスとが一致しない場合には、
この予測アドレスを用いて行ったプリフェッチ処理が無
駄になってしまうという問題点を有している。
In such a conventional unconditional jump instruction processing system, the branch destination address predicted at the time of predecoding the instruction and the branch destination address expected by the unconditional jump instruction are different from each other. If they do not match,
There is a problem that the prefetch processing performed using this predicted address becomes useless.

【0026】また、多重プロセッサの出力同士を比較す
るような高信頼性システムにおける第1のプロセッサで
発生したパリティエラーなどが第2のプロセッサに通知
される前に当該プロセッサの特定領域の内容(予測した
分岐先アドレス)が変更されたときには、それぞれの予
測アドレスが不一致となってしまうため、両プロセッサ
が再同期スタートした後でこの特定領域の内容が一致化
されないまま割込処理プログラム中の無条件ジャンプ命
令がプリデコードされると両者の分岐先アドレスが異な
ってしまうという本質的な問題点があった。
In addition, before a second processor is notified of a parity error or the like that has occurred in the first processor in a high-reliability system in which the outputs of multiple processors are compared with each other, the contents (prediction of a specific area of the processor) When the branch destination address) is changed, the predicted addresses do not match, so after the two processors have started resynchronization, the contents of this specific area remain unmatched and unconditional in the interrupt processing program. When the jump instruction is pre-decoded, there is an inherent problem that the branch destination addresses of the two differ.

【0027】そこで、本発明では、プリデコードされた
時点での無条件ジャンプ命令の分岐先アドレスの予測値
を格納する汎用レジスタ領域に有効/無効を示すフラグ
を設け、これが「無効」に設定されている場合には、無
条件ジャンプ命令の分岐先命令のプリフェッチ処理を禁
止することにより、分岐先命令のプリフェッチ処理の無
駄をなくし、また多重プロセッサにおける分岐先命令の
プリフェッチ処理の信頼性を高めることを目的とする。
Therefore, in the present invention, a flag indicating valid / invalid is provided in the general-purpose register area that stores the predicted value of the branch destination address of the unconditional jump instruction at the time of predecoding, and this is set to "invalid". In this case, by prohibiting the prefetch processing of the branch destination instruction of the unconditional jump instruction, it is possible to eliminate the waste of the prefetch processing of the branch destination instruction and to improve the reliability of the prefetch processing of the branch destination instruction in the multiprocessor. With the goal.

【0028】[0028]

【課題を解決するための手段】図1は、本発明の原理説
明図である。図において、1は、記憶手段であり、分岐
先アドレスA0 (予測値)の部分には無条件ジャンプ命
令の分岐先命令が保持されている。2は、命令実行手段
であり、記憶手段1から取り出した命令のプリデコー
ド、デコード、実行といった一連の処理を行なってい
る。3は、プリフェッチ要求手段であり、命令種別が
「無条件ジャンプ命令」で、かつ後述のフラグ6が「有
効(セット状態)」な場合にプリフェッチ要求を出力し
ている。4は、汎用レジスタであり、無条件ジャンプ命
令の分岐先アドレスなどを保持している。5は、特定領
域であり、分岐先アドレスA0 (予測値)を保持してい
る。6は、フラグであり、分岐先アドレスA0 の有効/
無効を示している。7は、フラグ設定手段であり、電源
投入時や各種エラー(パリティエラー、バスエラーな
ど)の検出時などにフラグ6を無効化(リセット)して
いる。なお、特定領域5の書き換えによりフラグ6は有
効化される。
FIG. 1 is a diagram for explaining the principle of the present invention. In the figure, reference numeral 1 denotes a storage means, which holds a branch destination instruction of an unconditional jump instruction at a branch destination address A 0 (predicted value). Reference numeral 2 denotes an instruction executing means, which performs a series of processes such as predecoding, decoding, and execution of the instruction fetched from the storage means 1. Reference numeral 3 is a prefetch requesting means, which outputs a prefetch request when the instruction type is "unconditional jump instruction" and a flag 6 described later is "valid (set state)". Reference numeral 4 is a general-purpose register that holds the branch destination address of the unconditional jump instruction. A specific area 5 holds a branch destination address A 0 (predicted value). Reference numeral 6 is a flag that indicates whether the branch destination address A 0 is valid /
Indicates invalid. A flag setting means 7 invalidates (resets) the flag 6 when the power is turned on or when various errors (parity error, bus error, etc.) are detected. The flag 6 is validated by rewriting the specific area 5.

【0029】命令実行手段2における処理の概要は次の
ようになっている。 記憶手段1から取り出した命令をプリデコードしてそ
の種別をプリフェッチ要求手段3に通知する。 プリフェッチされた分岐先命令を保持する。 命令をデコードする。 デコードされた内容を実行する。なお、無条件ジャン
プ命令であり、かつそこで特定される分岐先アドレスが
予測値のA0 と一致している場合には、すでに保持され
ている分岐先命令を続けて実行する。
The outline of the processing in the instruction executing means 2 is as follows. The instruction fetched from the storage means 1 is predecoded and its type is notified to the prefetch request means 3. Holds the prefetched branch destination instruction. Decode the instruction. Execute the decoded contents. When the instruction is an unconditional jump instruction and the branch destination address specified there is coincident with the predicted value A 0 , the branch destination instruction already held is continuously executed.

【0030】図2は、本発明の、二重プロセッサの一方
でパリティエラーが発生したときの様子を示す説明図で
あり、図6の場合と同じようにCPU♯1とCPU♯2
はともに同じ命令群をパイプライン処理している。
FIG. 2 is an explanatory diagram showing a situation when a parity error occurs in one of the dual processors of the present invention, and CPU # 1 and CPU # 2 are the same as in the case of FIG.
Both pipeline the same instruction group.

【0031】図6の場合と相違しているのは、 ・パリティエラーの発生検出時からプロセス実行の再開
時(t2 )までの任意の時点でフラグ6を無効化してい
ること ・それにともない、プロセス実行の再開時(t2 )にお
いては汎用レジスタ4の特定領域(例えばGR3)5の
分岐先アドレスA0 はいわば使用禁止となっていること ・そのため、プロセス実行の再開後の処理においてCP
U♯1およびCPU♯2の特定領域5の書き込みが行な
われないかぎり、無条件ジャンプ命令のプリデコード時
にその分岐先命令はプリフェッチされないことなどであ
る。
6 differs from the case of FIG. 6 in that the flag 6 is invalidated at any time from when the occurrence of a parity error is detected to when the process execution is restarted (t 2 ). When the process execution is restarted (t 2 ), the branch destination address A 0 of the specific area (eg, GR3) 5 of the general-purpose register 4 is, so to speak, prohibited from being used.
Unless the specific area 5 of U # 1 and CPU # 2 is written, the branch destination instruction is not prefetched at the time of predecoding an unconditional jump instruction.

【0032】本発明の無条件ジャンプ命令処理方法とし
ての基本的な構成は、「プリデコードした命令が無条件
ジャンプ命令の場合に、汎用レジスタの特定領域に入っ
ている第1の分岐先アドレスの記憶領域から分岐先命令
をプリフェッチして保持するとともに、デコード後の前
記無条件ジャンプ命令を実行するに際し、これにより特
定される第2の分岐先アドレスが第1の分岐先アドレス
と一致することを確認した上で、前記無条件ジャンプ命
令に続いて前記分岐先命令を実行する無条件ジャンプ命
令処理方法において、所定状態のときに無効化されるフ
ラグを前記特定領域に対応して設け、当該フラグが有効
であるときのみ前記分岐先命令をプリフェッチするよう
にしたこと」である。
The basic configuration of the unconditional jump instruction processing method of the present invention is that "when the predecoded instruction is an unconditional jump instruction, the first branch destination address in the specific area of the general register is While prefetching and holding the branch destination instruction from the storage area, when executing the unconditional jump instruction after decoding, it is possible that the second branch destination address specified thereby matches the first branch destination address. After confirming, in the unconditional jump instruction processing method for executing the branch destination instruction following the unconditional jump instruction, a flag that is invalidated in a predetermined state is provided corresponding to the specific area, The branch destination instruction is prefetched only when is valid. "

【0033】本発明の無条件ジャンプ命令処理装置とし
ての基本的な構成は、「プリデコードした命令が無条件
ジャンプ命令の場合に、汎用レジスタの特定領域に入っ
ている第1の分岐先アドレスの記憶領域から分岐先命令
をプリフェッチして保持するとともに、デコード後の前
記無条件ジャンプ命令を実行するに際し、これにより特
定される第2の分岐先アドレスが第1の分岐先アドレス
と一致することを確認した上で前記分岐先命令を続けて
実行する無条件ジャンプ命令処理装置において、前記特
定領域に対応し、かつ所定状態のときに無効化されるフ
ラグと、当該フラグが有効であるときのみ前記分岐先命
令のプリフェッチ要求を出力するプリフェッチ要求手段
とを備えたこと」である。
The basic configuration of the unconditional jump instruction processing device of the present invention is that "when the predecoded instruction is an unconditional jump instruction, the first branch destination address in the specific area of the general register is While prefetching and holding the branch destination instruction from the storage area, when executing the unconditional jump instruction after decoding, it is possible that the second branch destination address specified thereby matches the first branch destination address. In the unconditional jump instruction processing device that continuously executes the branch destination instruction after checking, a flag corresponding to the specific area and invalidated in a predetermined state, and the flag only when the flag is valid And a prefetch request means for outputting a prefetch request for a branch destination instruction. "

【0034】本発明の汎用レジスタとしての基本的な構
成は、「無条件ジャンプ命令をプリデコードしたときの
プリフェッチ先を示す分岐先アドレスが特定領域に保持
されている汎用レジスタにおいて、前記特定領域に対応
し、かつ所定状態のときに無効化されて前記プリフェッ
チを抑止するためのフラグを備えたこと」である。
The basic structure of the general-purpose register of the present invention is as follows: "In a general-purpose register in which a branch destination address indicating a prefetch destination when an unconditional jump instruction is predecoded is held in a specific area, Corresponding and provided with a flag that is invalidated in a predetermined state to suppress the prefetching. "

【0035】[0035]

【発明の実施の形態】図3および図4を参照して本発明
の実施の形態を説明する。図3は、本発明の無条件ジャ
ンプ命令処理方式の概要を示す説明図であり、図5で示
したものに前述のフラグ6およびフラグ設定手段7と、
新たなアンド回路23とを設けた形になっている。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment of the present invention will be described with reference to FIGS. FIG. 3 is an explanatory diagram showing an outline of the unconditional jump instruction processing method of the present invention. The flag 6 and the flag setting means 7 described above are added to those shown in FIG.
A new AND circuit 23 is provided.

【0036】アンド回路23にはフラグ信号24と命令種別
信号15とが入力され、アンド回路23の出力信号でゲート
部22を制御し、フラグ信号24が「有効フラグ」を、また
命令種別信号15が「無条件ジャンプ命令」をそれぞれ示
しているときには汎用レジスタ18の特定領域19(GR
3)に書き込まれている分岐先アドレスA0 がゲート部
22を通って主記憶11に送られる。
A flag signal 24 and an instruction type signal 15 are input to the AND circuit 23, and the output signal of the AND circuit 23 controls the gate section 22 so that the flag signal 24 indicates the "valid flag" and the instruction type signal 15 Are "unconditional jump instructions" respectively, the specific area 19 (GR
The branch destination address A 0 written in 3) is the gate section.
It is sent to the main memory 11 through 22.

【0037】図4は、命令バッファに取り込まれた命令
に対する処理手順を示す説明図であり、その内容は次の
ようになっている。 (1) 命令バッファ13に取り込まれた命令をプリデコード
部14でプリデコードして、次のステップに進む。 (2) 命令の種別が「無条件ジャンプ命令」で、かつフラ
グ6が有効化(セット)されているかどうかを判断し、
その結果が「YES 」の場合は次のステップに進み、「N
O」の場合はステップ(4) に進む。 (3) 汎用レジスタ18の特定領域19(GR3)で指定され
る分岐先アドレスA0 の分岐先命令を主記憶11からプリ
フェッチして命令バッファ13に保持して、次のステップ
に進む。 (4) 命令バッファ13から取り出した命令をデコード部16
でデコードして、次のステップに進む。 (5) 命令の種別が「無条件ジャンプ命令」であるかどう
かを判断し、その結果が「YES 」の場合は次のステップ
に進み、「NO」の場合はステップ(9) に進む。 (6) この命令で特定される分岐先アドレスと、ステップ
(3) で求めた分岐先アドレスA0 とが一致するかどうか
を判断し、その結果が「YES 」の場合は次のステップに
進み、「NO」の場合はステップ(8) に進む。 (7) ステップ(3) でプリフェッチした分岐先命令を命令
バッファ13から取り出して実行し、かつステップ(4) で
デコードした命令を取り消す。 (8) ステップ(3) でプリフェッチした分岐先命令を取り
消して、次のステップに進む。 (9) ステップ(4) でデコードした命令を実行する。
FIG. 4 is an explanatory diagram showing a processing procedure for an instruction fetched in the instruction buffer, and the contents thereof are as follows. (1) The prefetch unit 14 predecodes the instruction fetched in the instruction buffer 13, and proceeds to the next step. (2) Determine whether the instruction type is an "unconditional jump instruction" and flag 6 is enabled (set),
If the result is "YES", proceed to the next step and select "N
If “O”, proceed to step (4). (3) The branch destination instruction at the branch destination address A 0 specified by the specific area 19 (GR3) of the general-purpose register 18 is prefetched from the main memory 11 and held in the instruction buffer 13, and the process proceeds to the next step. (4) The decoding unit 16 decodes the instruction fetched from the instruction buffer 13.
Decode with and proceed to the next step. (5) Determine whether the instruction type is an "unconditional jump instruction". If the result is "YES", proceed to the next step, and if "NO", proceed to step (9). (6) The branch destination address specified by this instruction and the step
It is determined whether or not the branch destination address A 0 obtained in (3) matches, and if the result is "YES", the process proceeds to the next step, and if "NO", the process proceeds to step (8). (7) The branch destination instruction prefetched in step (3) is fetched from the instruction buffer 13 and executed, and the instruction decoded in step (4) is canceled. (8) Cancel the branch destination instruction prefetched in step (3) and proceed to the next step. (9) Execute the instruction decoded in step (4).

【0038】ステップ(6) における分岐先アドレスの特
定は命令中で指定される汎用レジスタ領域に書き込まれ
ているデータを取り出すことにより行なわれる。なお、
この汎用レジスタ領域としては特定領域19を含む任意の
領域が用いられるのが一般的である。
The branch destination address is specified in step (6) by extracting the data written in the general-purpose register area specified in the instruction. In addition,
As this general-purpose register area, any area including the specific area 19 is generally used.

【0039】また、ステップ(8) ーステップ(9) のルー
トをたどる命令の場合にはその中で指定される汎用レジ
スタ領域のデータ(分岐先アドレス)を読み出し、主記
憶11の当該アドレスに入っている分岐先命令を取り出す
といったフェッチ処理が行なわれる。
In the case of an instruction that follows the route from step (8) to step (9), the data (branch destination address) in the general-purpose register area specified in the instruction is read out and the address is stored in the main memory 11. Fetch processing is performed such as fetching the branch destination instruction that is present.

【0040】[0040]

【発明の効果】本発明は、このように、プリデコードさ
れた時点での無条件ジャンプ命令の分岐先アドレスの予
測値を格納する汎用レジスタ領域に有効/無効を示すフ
ラグを設け、これが「無効」に設定されている場合に
は、無条件ジャンプ命令の分岐先命令のプリフェッチ処
理を禁止している。
As described above, according to the present invention, a flag indicating validity / invalidity is provided in the general-purpose register area for storing the predicted value of the branch destination address of the unconditional jump instruction at the time of predecoding. , The prefetch processing of the branch destination instruction of the unconditional jump instruction is prohibited.

【0041】そのため、無条件ジャンプ命令のプリデコ
ード時の分岐先アドレス(予測値)とデコード時の分岐
先アドレス(期待値)との不一致にともなうプリフェッ
チ処理の無駄をなくすことができる。
Therefore, it is possible to eliminate the waste of the prefetch process due to the mismatch between the branch destination address (predicted value) at the predecoding of the unconditional jump instruction and the branch destination address (expected value) at the decoding.

【0042】また、プロセッサが多重化されたシステム
において、無条件ジャンプ命令のプリデコード時にプリ
フェッチした分岐先命令を当該無条件ジャンプ命令のデ
コード時に実行するときの各プロセッサ出力の一致性は
確保され、システムの信頼性を高めることができる。
Further, in a system in which processors are multiplexed, consistency of outputs of respective processors is ensured when a branch destination instruction prefetched at the time of predecoding an unconditional jump instruction is executed at the time of decoding the unconditional jump instruction. The reliability of the system can be increased.

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

【図1】本発明の、原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】本発明の、二重プロセッサの一方でパリティエ
ラーが発生したときの様子を示す説明図である。
FIG. 2 is an explanatory diagram showing a situation when a parity error occurs in one of the dual processors of the present invention.

【図3】本発明の、無条件ジャンプ命令処理方式の概要
を示す説明図である。
FIG. 3 is an explanatory diagram showing an outline of an unconditional jump instruction processing system of the present invention.

【図4】本発明の、命令バッファに取り込まれた命令に
対する処理手順を示す説明図である。
FIG. 4 is an explanatory diagram showing a processing procedure for an instruction fetched in an instruction buffer according to the present invention.

【図5】従来の、無条件ジャンプ命令処理方式の概要を
示す説明図である。
FIG. 5 is an explanatory diagram showing an outline of a conventional unconditional jump instruction processing method.

【図6】従来の、二重プロセッサの一方でパリティエラ
ーが発生したときの様子を示す説明図である。
FIG. 6 is an explanatory diagram showing a state when a parity error occurs in one of the conventional dual processors.

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

図1において、 1・・・記憶手段 2・・・命令実行手段 3・・・プリフェッチ要求手段 4・・・汎用レジスタ 5・・・特定領域 6・・・フラグ 7・・・フラグ設定手段 In FIG. 1 ... storage means 2 ... Instruction execution means 3 ... Prefetch request means 4 ... General purpose register 5: Specific area 6 ... Flag 7 ... Flag setting means

フロントページの続き (56)参考文献 特開 平6−266556(JP,A) 特開 平2−166520(JP,A) 特開 平5−216852(JP,A) 特開 平2−59822(JP,A) 特開 平7−84786(JP,A) 特開 平8−123686(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 9/38 Continuation of front page (56) Reference JP-A-6-266556 (JP, A) JP-A-2-166520 (JP, A) JP-A-5-216852 (JP, A) JP-A-2-59822 (JP , A) JP-A-7-84786 (JP, A) JP-A-8-123686 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) G06F 9/38

Claims (6)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 プリデコードした命令が無条件ジャンプ
命令の場合に、汎用レジスタの特定領域に入っている第
1の分岐先アドレスの記憶領域から分岐先命令をプリフ
ェッチして保持するとともに、デコード後の前記無条件
ジャンプ命令を実行するに際し、これにより特定される
第2の分岐先アドレスが第1の分岐先アドレスと一致す
ることを確認した上で前記分岐先命令を続けて実行する
無条件ジャンプ命令処理方法において、 所定状態のときに無効化されるフラグを前記特定領域に
対応して設け、 当該フラグが有効であるときのみ前記分岐先命令をプリ
フェッチするようにしたことを特徴とする無条件ジャン
プ命令処理方法。
1. When the predecoded instruction is an unconditional jump instruction, the branch destination instruction is prefetched and held from the storage area of the first branch destination address contained in the specific area of the general-purpose register, and after decoding. When executing the unconditional jump instruction, the unconditional jump for executing the branch target instruction continuously after confirming that the second branch target address specified thereby matches the first branch target address. In the instruction processing method, a flag to be invalidated in a predetermined state is provided corresponding to the specific area, and the branch destination instruction is prefetched only when the flag is valid. Jump instruction processing method.
【請求項2】 前記所定状態が、電源投入直後や、パリ
ティエラー等のハードウェア異常の検出時などであるこ
とを特徴とする請求項1記載の無条件ジャンプ命令処理
方法。
2. The unconditional jump instruction processing method according to claim 1, wherein the predetermined state is immediately after power is turned on or when a hardware abnormality such as a parity error is detected.
【請求項3】 プリデコードした命令が無条件ジャンプ
命令の場合に、汎用レジスタの特定領域に入っている第
1の分岐先アドレスの記憶領域から分岐先命令をプリフ
ェッチして保持するとともに、デコード後の前記無条件
ジャンプ命令を実行するに際し、これにより特定される
第2の分岐先アドレスが第1の分岐先アドレスと一致す
ることを確認した上で前記分岐先命令を続けて実行する
無条件ジャンプ命令処理装置において、 前記特定領域に対応し、かつ所定状態のときに無効化さ
れるフラグと、 当該フラグが有効であるときのみ前記分岐先命令のプリ
フェッチ要求を出力するプリフェッチ要求手段とを備え
たことを特徴とする無条件ジャンプ命令処理装置。
3. When the predecoded instruction is an unconditional jump instruction, the branch destination instruction is prefetched and held from the storage area of the first branch destination address in the specific area of the general-purpose register, and after decoding When executing the unconditional jump instruction, the unconditional jump for executing the branch target instruction continuously after confirming that the second branch target address specified thereby matches the first branch target address. The instruction processing device includes a flag that corresponds to the specific area and is invalidated in a predetermined state, and a prefetch request unit that outputs a prefetch request of the branch destination instruction only when the flag is valid. An unconditional jump instruction processing device characterized by the above.
【請求項4】 前記所定状態が、電源投入直後や、パリ
ティエラー等のハードウェア異常の検出時などであるこ
とを特徴とする請求項3記載の無条件ジャンプ命令処理
装置。
4. The unconditional jump instruction processing device according to claim 3, wherein the predetermined state is immediately after power-on, when a hardware abnormality such as a parity error is detected, or the like.
【請求項5】 無条件ジャンプ命令をプリデコードした
ときのプリフェッチ先を示す分岐先アドレスが特定領域
に保持されている汎用レジスタにおいて、 前記特定領域に対応し、かつ所定状態のときに無効化さ
れて前記プリフェッチを抑止するためのフラグを備えた
ことを特徴とする汎用レジスタ。
5. A general-purpose register in which a branch destination address indicating a prefetch destination at the time of predecoding an unconditional jump instruction is held in a specific area, which corresponds to the specific area and is invalidated in a predetermined state. A general-purpose register having a flag for suppressing the prefetch.
【請求項6】 前記所定状態が、電源投入直後や、パリ
ティエラー等のハードウェア異常の検出時などであるこ
とを特徴とする請求項5記載の汎用レジスタ。
6. The general-purpose register according to claim 5, wherein the predetermined state is immediately after power-on or when a hardware error such as a parity error is detected.
JP18235295A 1995-07-19 1995-07-19 Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register Expired - Fee Related JP3394854B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18235295A JP3394854B2 (en) 1995-07-19 1995-07-19 Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18235295A JP3394854B2 (en) 1995-07-19 1995-07-19 Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register

Publications (2)

Publication Number Publication Date
JPH0934704A JPH0934704A (en) 1997-02-07
JP3394854B2 true JP3394854B2 (en) 2003-04-07

Family

ID=16116817

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18235295A Expired - Fee Related JP3394854B2 (en) 1995-07-19 1995-07-19 Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register

Country Status (1)

Country Link
JP (1) JP3394854B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4739380B2 (en) * 2008-08-25 2011-08-03 ルネサスエレクトロニクス株式会社 Information processing device
CN111026442B (en) * 2019-12-17 2022-08-02 天津国芯科技有限公司 Method and device for eliminating program unconditional jump overhead in CPU
CN113760366B (en) * 2021-07-30 2024-02-09 浪潮电子信息产业股份有限公司 Method, system and related device for processing conditional jump instruction

Also Published As

Publication number Publication date
JPH0934704A (en) 1997-02-07

Similar Documents

Publication Publication Date Title
JP2889955B2 (en) Branch prediction method and apparatus therefor
US6314514B1 (en) Method and apparatus for correcting an internal call/return stack in a microprocessor that speculatively executes call and return instructions
JP2846406B2 (en) Branch processing method and branch processing device
US5826074A (en) Extenstion of 32-bit architecture for 64-bit addressing with shared super-page register
US7065632B1 (en) Method and apparatus for speculatively forwarding storehit data in a hierarchical manner
US7444501B2 (en) Methods and apparatus for recognizing a subroutine call
JPH02260033A (en) Branch forecast
JPH0795271B2 (en) Branch instruction execution device
KR20090061644A (en) Methods and apparatus for emulating the branch prediction behavior of an explicit subroutine call
JP2001142705A (en) Processor and microprocessor
JP2507638B2 (en) Data processing device
JP2006520964A5 (en)
JP2006520964A (en) Method and apparatus for branch prediction based on branch target
US5996059A (en) System for monitoring an execution pipeline utilizing an address pipeline in parallel with the execution pipeline
US20040215934A1 (en) Register value tracker
JP3486690B2 (en) Pipeline processor
JP4243271B2 (en) Data processing apparatus and data processing method
JPH07120284B2 (en) Data processing device
JP3394854B2 (en) Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register
JP3599499B2 (en) Central processing unit
JP2710994B2 (en) Data processing device
JP2008299729A (en) Processor
JP2532560B2 (en) Data processing device for high-performance exception handling
JP3156773B2 (en) Instruction processing unit
JP3325309B2 (en) Subroutine return instruction processing unit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20030121

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080131

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090131

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100131

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110131

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110131

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120131

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130131

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130131

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140131

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees