JPH0212429A - Information processor with function coping with delayed jump - Google Patents

Information processor with function coping with delayed jump

Info

Publication number
JPH0212429A
JPH0212429A JP16087788A JP16087788A JPH0212429A JP H0212429 A JPH0212429 A JP H0212429A JP 16087788 A JP16087788 A JP 16087788A JP 16087788 A JP16087788 A JP 16087788A JP H0212429 A JPH0212429 A JP H0212429A
Authority
JP
Japan
Prior art keywords
instruction
jump
nop
code
delayed
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
JP16087788A
Other languages
Japanese (ja)
Inventor
Haruyuki Tago
田胡 治之
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP16087788A priority Critical patent/JPH0212429A/en
Publication of JPH0212429A publication Critical patent/JPH0212429A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To execute a conventional code as well as a code generated for delayed jump by stopping update of a program counter at the time of a conditional jump instruction. CONSTITUTION:When a jump instruction or a conditional jump instruction is executed in the NOP insertion mode, a jump instruction detection signal 14 is true. When a mode bit indicates the NOP insertion mode at this time, the input to an instruction register (IR) 22 is switched from an instruction buffer (IRB) 20 to a NOP code generating circuit 21. The input to a program counter 23 is not the output of a normal incrementer (INC) 24 and the current value of the program counter 23 is fed back. Consequently, not a prefetched instruction but the NOP code from a NOP code generating circuit 21 is loaded to the IR 22 by the next clock, and the NOP instruction is inserted. Thus, the conventional code as well as the code generated for delayed jump is executed.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明はディレイド・ジャンプ機能をもつ情報処理装置
(以下、コンピュータと称す)に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Industrial Application Field) The present invention relates to an information processing device (hereinafter referred to as a computer) having a delayed jump function.

(従来の技術) 第5図のa欄に機械語の命令列の一例をニモニックコー
ドで示す。パイプライン方式のコンピュータでは、10
0番地を実行中に101番地の命令語をフェッチし、1
01番地の命令語実行中に102番地の命令語をフェッ
チすることにより、高速化を図っている。102番地の
命令はジャンプ命令なので、単純なブリフェッチではパ
イプライン機構が有効に働かない。パイプライン処理を
なるべく乱さないためには、つぎの2つの方法がある。
(Prior Art) Column a in FIG. 5 shows an example of a machine language instruction sequence in mnemonic code. In a pipelined computer, 10
Fetch the instruction word at address 101 while executing address 0, and
The speed is increased by fetching the instruction word at address 102 while the instruction word at address 01 is being executed. Since the instruction at address 102 is a jump instruction, the pipeline mechanism does not work effectively with a simple briefetch. There are two methods to avoid disrupting pipeline processing as much as possible.

第1はジャンプ命令実行中にブリフェッチ済みの103
番地の命令を捨て、改めてジャンプ先の105番地の命
令をフェッチするようにハードウェアを設計する方法で
ある。第2はディレイド・ジャンプである。これはジャ
ンプ命令の次の命令(この例では103番地のADDA
、B)が必ず実行されてから102番地のジャンプ命令
が実行される仕様とする方法である。第1の方法は従来
とられた方法だが、制御系を中心としたハードウェアが
複雑になり、マシンサイクルの高速化を制限しがちであ
った。第2の方法は、ジャンプ命令にからむ制御はソフ
トウェアに任せて、ハードウェアを簡単にする方法で、
近年注目されている。以下、この方法について説明する
ディレイド・ジャンプでは、第5図のa欄のコードその
ままでは102番地と103番地の実行がオーバーラツ
プする。そこでジャンプ命令直後にNOP命令を挿入す
る(第5図のb欄)。第6図に第5図のb欄の命令列の
マシンサイクルごとの実行経過を示す。各命令は第1図
のクロ・ツクでメモリから命令フェッチ(IF)され、
第2のクロックで命令デコード(ID)され、実行(E
X)される。102番地のジャンプ命令では、クロック
4の実行時に分岐先アドレスが計算され、プログラムカ
ウンターにロドされる。従って分岐先番地からの命令フ
ェッチはクロック5まで開始できない。103番地の命
令はジャンプ先が決まる前にクロック5で実行されるが
NOPなので問題はない。これにより、正しい結果は得
られるが、ジャンプ命令ごとにNOP命令を実行するの
で性能が低下する。そこでジャンプ直前の命令がジャン
プの条件に無関係な時には、第5図のC欄のように命令
を入れ換えて、NOP命令を削除する。
The first is 103, which has been briefetched during the execution of a jump instruction.
This is a method of designing hardware such that the instruction at address 105 is discarded and the instruction at address 105, which is the jump destination, is fetched again. The second is delayed jump. This is the instruction following the jump instruction (in this example, ADDA at address 103).
, B) is always executed before the jump instruction at address 102 is executed. The first method is a conventional method, but the hardware, mainly the control system, becomes complicated, which tends to limit speeding up of machine cycles. The second method is to leave the control related to jump instructions to software and simplify the hardware.
It has been attracting attention in recent years. In the delayed jump described below regarding this method, the execution of addresses 102 and 103 will overlap if the code in column a of FIG. 5 is used as is. Therefore, a NOP instruction is inserted immediately after the jump instruction (column b in FIG. 5). FIG. 6 shows the execution progress of the instruction sequence in column b of FIG. 5 for each machine cycle. Each instruction is fetched from memory (IF) by the clock in FIG.
The instruction is decoded (ID) and executed (E
X) be done. For the jump instruction at address 102, the branch destination address is calculated during execution of clock 4 and is loaded into the program counter. Therefore, instruction fetch from the branch destination address cannot be started until clock 5. The instruction at address 103 is executed at clock 5 before the jump destination is determined, but since it is a NOP, there is no problem. Although this allows correct results to be obtained, performance deteriorates because a NOP instruction is executed for each jump instruction. Therefore, when the instruction immediately before the jump is unrelated to the jump condition, the instructions are replaced as shown in column C of FIG. 5, and the NOP instruction is deleted.

第7図に第5図のC欄の命令列のマシンサイクルごとの
実行経過を示すが、正しい結果が早く得られている。以
上のように、NOP命令を挿入したコードを発生し、更
に可能な場合にはジャンプ命令とその直前の命令を入れ
換える機能を持つコンパイラが準備されていれば、ディ
レイド・ジャンプ機構に対応できる。しかし、従来のオ
ブジェクトコードそのもの(第5図のa欄)を実行でき
ない問題点があった。あえて実行させた場合を第8図に
示す。正しい結果はz=(A+1)であるが、この場合
Z −(A + B +l )となり、誤った結果とな
っている。
FIG. 7 shows the execution progress for each machine cycle of the instruction sequence in column C of FIG. 5, and it shows that correct results are obtained quickly. As described above, if a compiler is prepared that has the function of generating code into which a NOP instruction is inserted and, if possible, replacing the jump instruction with the instruction immediately before it, it is possible to support the delayed jump mechanism. However, there was a problem in that the conventional object code itself (column a in FIG. 5) could not be executed. FIG. 8 shows a case where this is intentionally executed. The correct result is z=(A+1), but in this case it becomes Z - (A + B +l), which is an incorrect result.

(発明が解決しようとする課題) 以上のように、ディレイド・ジャンプ機構を持つコンピ
ュータでは従来のオブジェクトコードをそのまま実行で
きない欠点があった。本発明はこの問題を解決し、従来
のコード、ディレイド・ジャンプ用に生成されたコード
のいずれも実行できるコンピュータを提供することを目
的としている。
(Problems to be Solved by the Invention) As described above, computers with a delayed jump mechanism have the drawback that conventional object code cannot be executed as is. The present invention aims to solve this problem and provide a computer that can execute both conventional code and code generated for delayed jumps.

[発明の構成〕 (課題を解決するための手段) 本発明は上記問題を解決するため、NOP命令挿入モー
ドの有効、無効を示すモードビットとNOPコード発生
回路を持ち、ジャンプ命令が実行されたとき、モードビ
ットが有効であれば、NOP命令を命令列に挿入する。
[Structure of the Invention] (Means for Solving the Problems) In order to solve the above problem, the present invention has a mode bit indicating whether the NOP instruction insertion mode is valid or invalid and a NOP code generation circuit, and has a NOP code generation circuit when a jump instruction is executed. If the mode bit is valid, a NOP instruction is inserted into the instruction string.

(作  用) この様な構成とすれば、従来のコードをそのまま実行す
る事も、ディレイド・ジャンプ用に生成されたコードも
実行できる。
(Function) With this configuration, conventional code can be executed as is, and code generated for delayed jumps can also be executed.

(実施例) 以下、本発明を説明する。(Example) The present invention will be explained below.

第1図にコンピュータの内部構成例を示す。FIG. 1 shows an example of the internal configuration of a computer.

第1図中のすべてのレジスタはエツジトリガ形である。All registers in FIG. 1 are edge triggered.

制御レジスタ中にある走行モードビット(10)が、「
ジャンプ命令実行直後にNOP命令を挿入するか否か」
を規定する。NOP命令を挿入しないモードを「通常モ
ード」、挿入するモードを「NOP挿入モード」と呼ぶ
。「通常モード」では現在実行中の命令コードは命令レ
ジスタ(221R)に保持され、ブリフェッチされた次
命令は命令バッファ(201RB)に保持される。命令
のオペレーションコード部は制御部(25)でデコード
され、各部の制御信号が生成される。「NOP挿入モー
ド」でジャンプ命令または条件ジャンプ命令が実行され
ると、ジャンプ命令検出信号(14)が真になる。この
ときモードビットが「NOP挿入モード」であると、I
Rの入力はIRBでなく、NOPコード発生回路に切り
替えられる。またプログラムカウンタの人力には、通常
のインクメンタ(INC)出力ではなく、現在のPCの
値がフィードバックされる。
The drive mode bit (10) in the control register is set to “
Whether to insert a NOP instruction immediately after executing a jump instruction
stipulates. A mode in which a NOP instruction is not inserted is called a "normal mode", and a mode in which a NOP instruction is inserted is called a "NOP insertion mode". In the "normal mode", the instruction code currently being executed is held in the instruction register (221R), and the next instruction that has been pre-fetched is held in the instruction buffer (201RB). The operation code section of the instruction is decoded by the control section (25), and control signals for each section are generated. When a jump instruction or conditional jump instruction is executed in the "NOP insertion mode", the jump instruction detection signal (14) becomes true. At this time, if the mode bit is "NOP insertion mode", I
The input of R is switched to the NOP code generation circuit instead of the IRB. Furthermore, the current PC value is fed back to the program counter, rather than the normal incrementer (INC) output.

これにより、次クロックには、ブリフェッチされた命令
ではなく、NOPコード発生回路(21)からNOPコ
ードがIHにロードされる。即ちNOP命令が挿入され
たことになる。ジャンプ信号はプログラムカウンタ(2
3PC)のインクリメントも抑える。これは挿入された
NOP命令実行時にPCが進みすぎるのを防ぐためであ
る。
As a result, at the next clock, the NOP code is loaded into the IH from the NOP code generation circuit (21) instead of the brifetched instruction. In other words, a NOP instruction has been inserted. The jump signal is the program counter (2
3PC) increment is also suppressed. This is to prevent the PC from advancing too much when executing the inserted NOP instruction.

無条件ジャンプの命令の実行経過を第2図に示す。クロ
ック4でジャンプ先番地が算出され、クロック5でPC
にロードされる。ジャンプ命令検出信号によりクロック
5ではNOPが内部で発生され、ジャンプ先の命令はク
ロック5でフェッチされ、クロック6で実行される。
FIG. 2 shows the execution progress of the unconditional jump command. At clock 4, the jump destination address is calculated, and at clock 5, the PC
loaded into. A NOP is internally generated at clock 5 due to the jump instruction detection signal, and the jump destination instruction is fetched at clock 5 and executed at clock 6.

次に条件ジャンプ命令について述べる。第3図に条件ジ
ャンプ命令(この例ではJun+p Minus)の条
件成立時の実行経過を示す。クロック4でジャンプ先番
地が算出され、クロック5てPCにロードされる。ジャ
ンプ命令検出信号によりクロック5ではNOPが内部で
発生され、ジャンプ先の命令はクロック5でフェッチさ
れ、クロック6で実行される。第4図に条件ジャンプ命
令(この例ではJump Minus)の条件不成立時
の実行経過を示す。
Next, we will discuss conditional jump instructions. FIG. 3 shows the progress of execution when a conditional jump instruction (Jun+p Minus in this example) is satisfied. The jump destination address is calculated at clock 4 and loaded into the PC at clock 5. A NOP is internally generated at clock 5 due to the jump instruction detection signal, and the jump destination instruction is fetched at clock 5 and executed at clock 6. FIG. 4 shows the execution progress of a conditional jump instruction (Jump Minus in this example) when the condition is not satisfied.

ジャンプ命令検出信号により、PCは203番地をクロ
ック4〜5の間保持する。これによって、クロック5で
ジャンプ命令の次命令のフェッチが203番地から正し
く行なわれる。
Due to the jump instruction detection signal, the PC holds address 203 for clocks 4 to 5. As a result, the next instruction after the jump instruction is correctly fetched from address 203 at clock 5.

[発明の効果] 以上述べたように本発明によれば、モードビットの切り
替えにより、従来のコード、ディレイド・ジャンプ用に
生成されたコードのいずれも実行できるコンピュータを
実現できる。
[Effects of the Invention] As described above, according to the present invention, it is possible to realize a computer that can execute both conventional codes and codes generated for delayed jumps by switching the mode bits.

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

第1図は本発明の一実〜施例のコンピュータの構成を示
す図、第2図はNOP挿入モード時、無条件ジャンプ命
令の実行経過を示す図、第3図はNOP挿入モード時、
条件ジャンプ成立時の実行経過を示す図、第4図はNO
P挿入モード時、条件至第8図は命令の実行経過をマシ
ンサイクルごとに示す図である。 10・・・・・・走行モードビット 11・・・・・・フラグ 12・・・・・・算術論理演算ユニット13・・・・・
・レジスターファイル 14・・・・・・ジャンプ命令検出信号20・・・・・
・命令バッファ(IRB)21・・・・・・NOPコー
ド発生回路22・・・・・・命令レジスタ(IR)23
・・・・・・プログラムカウンタ(PC)24・・・・
・・インクリメンタ(INC)25・・・・・・制御部
FIG. 1 is a diagram showing the configuration of a computer according to an embodiment of the present invention, FIG. 2 is a diagram showing the execution progress of an unconditional jump instruction in NOP insertion mode, and FIG. 3 is a diagram showing the execution progress of an unconditional jump instruction in NOP insertion mode.
Figure 4 shows the execution progress when the conditional jump is established.
FIG. 8 is a diagram showing the progress of instruction execution for each machine cycle in the P insertion mode. 10... Running mode bit 11... Flag 12... Arithmetic logic operation unit 13...
・Register file 14...Jump instruction detection signal 20...
・Instruction buffer (IRB) 21...NOP code generation circuit 22...Instruction register (IR) 23
...Program counter (PC) 24...
・・Incrementer (INC) 25 ・・・Control unit

Claims (2)

【特許請求の範囲】[Claims] (1)プログラムカウンタの値が不連続に変化しうる命
令を持ち、前期命令の次番地の命令を実行してからジャ
ンプ先番地の命令を実行するディレイド・ジャンプ機構
を持つ情報処理装置において、少なくとも「通常モード
」と「NOP挿入モード」を示すモードビットを設け、
通常モードではディレイドジャンプ動作を行い、NOP
挿入モードではジャンプ命令実行直後にNOP命令をコ
ンピュータ内部で発生し命令ストリームに挿入する手段
を有し、少なくとも条件ジャンプ命令時にはプログラム
カウンタの更新を停止する手段を有することを特徴とす
るディレイド・ジャンプ対応機能付情報処理装置。
(1) In an information processing device that has an instruction in which the value of the program counter can change discontinuously and has a delayed jump mechanism that executes the instruction at the next address of the previous instruction and then executes the instruction at the jump destination address, at least A mode bit is provided to indicate "normal mode" and "NOP insertion mode",
In normal mode, delayed jump operation is performed and NOP
In the insert mode, a NOP instruction is generated inside the computer and inserted into the instruction stream immediately after the jump instruction is executed, and the program counter is stopped from being updated at least when a conditional jump instruction is executed. Functional information processing device.
(2)前期プログラムカウンタの値が不連続に変化しう
る命令は、無条件ジャンプ命令、条件ジャンプ命令、コ
ール命令、リターン命令の少なくとも一つからなること
を特徴とする請求項1記載のディレイド・ジャンプ対応
機能付情報処理装置。
(2) The delayed program according to claim 1, wherein the instruction in which the value of the previous program counter can change discontinuously includes at least one of an unconditional jump instruction, a conditional jump instruction, a call instruction, and a return instruction. Information processing device with jump support function.
JP16087788A 1988-06-30 1988-06-30 Information processor with function coping with delayed jump Pending JPH0212429A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16087788A JPH0212429A (en) 1988-06-30 1988-06-30 Information processor with function coping with delayed jump

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16087788A JPH0212429A (en) 1988-06-30 1988-06-30 Information processor with function coping with delayed jump

Publications (1)

Publication Number Publication Date
JPH0212429A true JPH0212429A (en) 1990-01-17

Family

ID=15724305

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16087788A Pending JPH0212429A (en) 1988-06-30 1988-06-30 Information processor with function coping with delayed jump

Country Status (1)

Country Link
JP (1) JPH0212429A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0334025A (en) * 1989-06-30 1991-02-14 Mitsubishi Electric Corp Instruction processing system
JP2007200055A (en) * 2006-01-27 2007-08-09 Hitachi Ltd Iscsi communication control method and storage system using it
WO2008029450A1 (en) * 2006-09-05 2008-03-13 Fujitsu Limited Information processing device having branching prediction mistake recovery mechanism
DE102019103111B4 (en) 2019-02-08 2023-06-07 Andrea Kurlbaum Anti-slip device for a carrying strap

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0334025A (en) * 1989-06-30 1991-02-14 Mitsubishi Electric Corp Instruction processing system
JP2007200055A (en) * 2006-01-27 2007-08-09 Hitachi Ltd Iscsi communication control method and storage system using it
WO2008029450A1 (en) * 2006-09-05 2008-03-13 Fujitsu Limited Information processing device having branching prediction mistake recovery mechanism
JPWO2008029450A1 (en) * 2006-09-05 2010-01-21 富士通株式会社 Information processing apparatus having branch prediction miss recovery mechanism
DE102019103111B4 (en) 2019-02-08 2023-06-07 Andrea Kurlbaum Anti-slip device for a carrying strap

Similar Documents

Publication Publication Date Title
JP2796797B2 (en) Method of processing an interrupt routine by a digital instruction processor controller
JP3093624B2 (en) Method and apparatus for handling speculative exceptions
JP2518616B2 (en) Branching method
JP3120152B2 (en) Computer system
US5596733A (en) System for exception recovery using a conditional substitution instruction which inserts a replacement result in the destination of the excepting instruction
WO2009114289A1 (en) System and method of selectively committing a result of an executed instruction
KR100597328B1 (en) Data processor system having branch control and method thereof
EP0404068A2 (en) Branch instruction executing device
EP0227117B1 (en) Program skip operation control system
KR20020073233A (en) Method and apparatus for executing coprocessor instructions
WO2021249054A1 (en) Data processing method and device, and storage medium
US5469552A (en) Pipelined data processor having combined operand fetch and execution stage to reduce number of pipeline stages and penalty associated with branch instructions
JPH0212429A (en) Information processor with function coping with delayed jump
JP3599499B2 (en) Central processing unit
KR102379886B1 (en) Vector instruction processing
KR970011209B1 (en) Microprocessor including circuit for generating signal used for tracing executed instruction stream
JPH0384632A (en) Data processor
JP2001014161A (en) Programmable controller
JP2000029696A (en) Processor, and pipeline process control method
KR100631318B1 (en) Method and instruction decoder for processing conditional jump instruction in a processor with pipelined architecture
EP0211487A1 (en) Conditional operations in computers
JP3100705B2 (en) Apparatus for instruction preparation in a microprocessor
JP3063593B2 (en) Programmable controller
JP2944335B2 (en) Information processing device
JP2825315B2 (en) Information processing device