JPH02144626A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH02144626A
JPH02144626A JP29851488A JP29851488A JPH02144626A JP H02144626 A JPH02144626 A JP H02144626A JP 29851488 A JP29851488 A JP 29851488A JP 29851488 A JP29851488 A JP 29851488A JP H02144626 A JPH02144626 A JP H02144626A
Authority
JP
Japan
Prior art keywords
branch
instruction
address
prefetch
pointer
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.)
Granted
Application number
JP29851488A
Other languages
Japanese (ja)
Other versions
JPH0769810B2 (en
Inventor
Masanori Izumikawa
泉川 正則
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP63298514A priority Critical patent/JPH0769810B2/en
Publication of JPH02144626A publication Critical patent/JPH02144626A/en
Publication of JPH0769810B2 publication Critical patent/JPH0769810B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To rapidly execute a branching instruction without disturbing a pipeline by registering a branching address, instruction length and a branched address in a branch forecasting table at the time of generating a branch, and at the time of prefetching the branch instruction, fetching the branched instruction without fetching its succeeding instruction. CONSTITUTION:An instruction prefetch is executed by outputting a prefetch pointer 202 to the outside of a microprocessor through a prefetch address bus 101 and updating the pointer 202 by an output from an address incrementer 203. Simultaneously with said operation, the branch forecasting table is indexed, and at the time of prefetching an instruction registered in the table, the prefetch is informed to a prefetch pointer control circuit 204 by an output signal 105 from an address comparator 206. The circuit 204 prefetches a branch instruction hit by a branch instruction length 111 hit in the branch forecasting table up to the final byte and then sets up a forecasting branched address 104 in the prefetch pointer 202. Thus, the branching instruction can be rapidly executed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、バイブライン処理型マイクロプロセッサに関
する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a Vibrine processing type microprocessor.

〔従来の技術〕[Conventional technology]

命令のバイブライン処理は、命令のアドレスが連続であ
ることを前提にしているため分岐が発生した場合には、
バイブライン上の命令をすべて無効にし、命令のフェッ
チからやりなおす必要がある。従来バイブライン方式に
おいて分岐による損失を減少させるために分岐命令アド
レスと分岐先命令をキャッシングするためのテーブルを
用意しておき、分岐命令実行時には、このテーブルを検
索し、フェッチしようとする分岐命令のアドレスが書き
込まれていればその分岐先命令を得ていた。
Instruction vibe line processing assumes that the instruction addresses are consecutive, so if a branch occurs,
It is necessary to invalidate all instructions on the vibe line and start over from fetching instructions. Conventionally, in the Vibrine method, in order to reduce losses due to branches, a table is prepared for caching branch instruction addresses and branch destination instructions.When a branch instruction is executed, this table is searched and the branch instruction to be fetched is searched. If the address was written, the branch destination instruction was obtained.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来技術は、分岐が発生した場合のバイブライ
ンフラッシュから回復を短縮しようとするものでバイブ
ライン・フラッシュ自体を減少させることはできない。
The above-mentioned prior art attempts to shorten recovery from a vibeline flush when a branch occurs, but cannot reduce the vibeline flush itself.

また、キャッシングしておく分岐命令のワード数を増や
すと必要な資源が(エントリ数)×(分岐先命令の増分
)だけ増えてしまうという欠点がある。
Another disadvantage is that increasing the number of words of branch instructions to be cached increases the required resources by (number of entries) x (increase in branch destination instructions).

〔課題を解決するための手段〕[Means to solve the problem]

本発明の分岐予測制御機構内臓のパイプライン処理型マ
イクロプロセッサは、プリフェッチ・ポインタと分岐命
令の先頭アドレス、分岐命令長及び分岐先アドレスを登
録する分岐予測テーブルと、分岐が発生したときに分岐
予測テーブルに登録するための機構と、プリフェッチ・
アドレスが分岐予測テーブルにヒツトしたときに、ヒツ
トした分岐命令を分岐命令長から必要なだけ命令フェッ
チを行った後、プリフェッチ・ポインタに分岐先アドレ
スをヒツトする機構とを有している。
A pipeline processing type microprocessor with a built-in branch prediction control mechanism according to the present invention has a branch prediction table that registers a prefetch pointer, the start address of a branch instruction, a branch instruction length, and a branch destination address, and a branch prediction table that registers a prefetch pointer, the start address of a branch instruction, a branch instruction length, and a branch destination address. Mechanism for registering in the table and prefetch/
When an address hits the branch prediction table, the branch instruction is fetched as many instructions as necessary from the branch instruction length, and then the branch destination address is hit in the prefetch pointer.

このように、分岐命令のあるアドレスと分岐先アドレス
のベアを分岐予測テーブルに記憶しておき、分岐予測テ
ーブルに登録された分岐命令を再び実行するときは、パ
イプラインを乱すことなく高速に命令を実行することが
できる。
In this way, the address where the branch instruction is located and the bare branch destination address are stored in the branch prediction table, and when the branch instruction registered in the branch prediction table is executed again, the instruction can be executed at high speed without disturbing the pipeline. can be executed.

〔実施例〕〔Example〕

次に本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は、本発明な一実施例のブロック図であり、パイ
プライン処理型マイクロプロセッサに於いて命令プリフ
ェッチから命令デコードに関する処理を行う機能ブロッ
クについて示している。
FIG. 1 is a block diagram of an embodiment of the present invention, showing functional blocks that perform processing from instruction prefetch to instruction decoding in a pipeline processing type microprocessor.

命令デコーダ201は、プリフェッチした命令をデコー
ドし、前記命令が分岐命令である場合には命令コードに
従って分岐先アドレスを生成し、分岐先アトl/ス・バ
ス102を介して転送する機能と、前記分岐命令が動的
に変化しない無条件分岐命令すなわち分岐先アドレス計
算にレジスタやメモリ値を参照しない無条件分岐命令で
ある場合には、その分岐命令の先頭アドレス(以下分岐
元アドレス)及び分岐命令長を出力し登録指示を行う機
能を有する。プリフェッチ・ポインタ202は命令をプ
リフェッチすべき主記憶アドレスを保持しておりプリフ
ェッチ・アドレス101経由でマイクロプロセッサ外部
に出力される。プリフェッチ・制御回路204は、プリ
フェッチ・ポインタ202の更新の制御を行う、プリフ
ェッチ・ポインタの内容はアドレス・インクリメンタ2
03の出力103.予測分岐先アドレス・パス104、
分岐先アドレスバス102のうち何れかを選択して更新
される。分岐予測テーブル207は、分岐元アドレス3
01.バリッドフラグ302゜分岐命令長3032分岐
先分岐元アドレスを登録しており、登録は分岐予測テー
ブル制御回路205によって分岐が発生したときに行わ
れる。
The instruction decoder 201 has a function of decoding a prefetched instruction, generating a branch destination address according to the instruction code when the instruction is a branch instruction, and transferring the branch destination address via the branch destination address bus 102. If the branch instruction is an unconditional branch instruction that does not change dynamically, that is, it does not refer to registers or memory values to calculate the branch destination address, the start address of the branch instruction (hereinafter referred to as the branch source address) and the branch instruction It has the function of outputting the length and issuing registration instructions. The prefetch pointer 202 holds the main memory address at which instructions should be prefetched, and is output to the outside of the microprocessor via the prefetch address 101. The prefetch control circuit 204 controls updating of the prefetch pointer 202, and the contents of the prefetch pointer are stored in the address incrementer 2.
03 output 103. Predicted branch destination address path 104,
One of the branch destination address buses 102 is selected and updated. The branch prediction table 207 includes branch source address 3
01. Valid flag 302° Branch instruction length 3032 Branch destination and branch source addresses are registered, and registration is performed by the branch prediction table control circuit 205 when a branch occurs.

次に本実施例の分岐予測動作を説明する。命令プリフェ
ッチは、プリフェッチ・ポインタ202をプリフェッチ
・アドレスバス101経由でマイクロプロセッサ外部に
出力し、プリフェッチ・ポインタ202をアドレス・イ
ンクリメンタ203の出力によって更新することにより
て行う。同時に分岐予測テーブルを索引し分岐予測テー
ブルに登録されている命令をプリフェッチした場合(以
下、分岐予測テーブルヒツト)にはアドレス比較器20
6出力信号105によってプリフェッチ制御回路204
に通知される。プリフェッチ・制御回路は分岐予測テー
ブルにヒッドシた分岐命令長111によりヒツトした分
岐命令を最終バイトまでプリフェッチした後予測分岐先
アドレス104をプリフェッチ・ポインタ202にセッ
トする。
Next, the branch prediction operation of this embodiment will be explained. Instruction prefetching is performed by outputting prefetch pointer 202 to the outside of the microprocessor via prefetch address bus 101 and updating prefetch pointer 202 with the output of address incrementer 203. If the branch prediction table is indexed at the same time and an instruction registered in the branch prediction table is prefetched (hereinafter referred to as a branch prediction table hit), the address comparator 20
6 output signal 105 causes prefetch control circuit 204
will be notified. The prefetch control circuit prefetches the hit branch instruction up to the final byte based on the branch instruction length 111 stored in the branch prediction table, and then sets the predicted branch destination address 104 in the prefetch pointer 202.

第2図は本発明の他の実施例のブロック図で、上記実施
例に対してリタン・アドレスレジスタ209と予測はず
れ信号114を追加している。
FIG. 2 is a block diagram of another embodiment of the present invention, in which a return address register 209 and a prediction error signal 114 are added to the above embodiment.

この実施例ではリタン・アドレス・レジスタ209に予
測した分岐命令に連続する命令の先頭アドレスを格納し
ておくため、条件付分岐の分岐予測を行うことができる
利点がある。
In this embodiment, since the start address of the instruction following the predicted branch instruction is stored in the return address register 209, there is an advantage that branch prediction of a conditional branch can be performed.

次に本実施例の分岐予測動作を説明する。命令をプリフ
ェッチした際、分岐予測テーブルにヒツトした場合は分
岐命令長によりヒツトした分岐命令を最終バイトまでプ
リフェッチした後、引続く命令の先頭アドレスをリタン
・アドレス・レジスタ209に格納し、予測分岐先アド
レスをプリフェッチ・ポインタ202にセットする。予
測された分岐命令の条件が成立しなかったことを命令デ
コーダ201から予測はずれ信号114によって通知さ
れるとプリフェッチポインタ202の内容をリタン・ア
ドレス・レジスタ203の内容に更新し、予測した分岐
命令に引続く命令のプリフェッチを行う。条件が成立し
ている場合にはそのままプリフェッチを継続する。
Next, the branch prediction operation of this embodiment will be explained. When an instruction is prefetched, if the branch prediction table is hit, the hit branch instruction is prefetched to the final byte according to the branch instruction length, and then the start address of the following instruction is stored in the return address register 209, and the predicted branch destination is Set the address to prefetch pointer 202. When the instruction decoder 201 is notified by the misprediction signal 114 that the condition of the predicted branch instruction has not been met, the contents of the prefetch pointer 202 are updated to the contents of the return address register 203, and the predicted branch instruction is executed. Prefetch subsequent instructions. If the condition is met, prefetching continues.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、分岐が発生したときに分
岐予測テーブルに分岐元アドレス、命令長2分岐先アド
レスを登録しておき、次にその分岐命令をプリフェッチ
したときに、引続く命令をフェッチせずに分岐先の命令
をフェッチすることにより分岐命令をバイブラインを乱
すことなく高速に実行することができる。
As explained above, the present invention registers a branch source address and an instruction length 2 branch destination address in a branch prediction table when a branch occurs, and then when that branch instruction is prefetched, the following instruction is By fetching the branch destination instruction without fetching, the branch instruction can be executed at high speed without disturbing the vibe line.

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

第1図は本発明の一実施例と、第2図は他の実施例をそ
れぞれ示すブロック図である。 101・・・・・・プリフェッチ・アドレスバス、10
2・・・・・・分岐先アドレスバス、103・・・・・
・アドレス・インクリメンタ出力、104・・・・・・
予測分岐先アドレスバス、105・・・・・・分岐予測
テーブル・ヒツト信号、106・・・・・・分岐予測テ
ーブル・分岐元アドレスバス、107・・・・・・分岐
指示信号、108・・・・・・分岐予測テーブル・登録
指示信号、109・・・・・・分岐元アドレスバス、1
10・・・・・・分岐命令長、111・・・・・・分岐
予測テーブルにヒツトした分岐命令長、112・・・・
・・プリフェッチ・ポインタ更新指示信号、113・・
・・・・リタン・アドレス・ポインタ更新指示信号、1
14・・・・・・分岐予測はずれ信号、201・・・・
・・命令デコーダ、202・・・・・・プリフェッチ・
ポインタ、203・・・・・・アドレス・インクリメン
タ、204・・・・・・プリフェッチ、制御回路、20
5・・・・・・プリフェッチ・ポインタ入カマリチブレ
クサ、206・・・・・・アドレス・コンパレータ、2
07・・・・・・分岐予測テーブル、208・・・・・
・分岐予測テーブル制御回路、209・・・・・・リタ
ン・アドレス・レジスタ、301・・・・・・分岐予測
テーブル・分岐元アドレス部、302・・・・・・分岐
予測テーブル・パリ、ドフラグ、303・・・・・・分
岐予測テーブル・命令長部、304・・・・・・分岐予
測テーブル・分岐先アドレス部。 代理人 弁理士  内 原   音 箔1図 笈?可
FIG. 1 is a block diagram showing one embodiment of the present invention, and FIG. 2 is a block diagram showing another embodiment. 101... Prefetch address bus, 10
2... Branch destination address bus, 103...
・Address incrementer output, 104...
Predicted branch destination address bus, 105... Branch prediction table/hit signal, 106... Branch prediction table/branch source address bus, 107... Branch instruction signal, 108... ...Branch prediction table/registration instruction signal, 109...Branch source address bus, 1
10... Branch instruction length, 111... Branch instruction length hit in the branch prediction table, 112...
...Prefetch pointer update instruction signal, 113...
...Return address pointer update instruction signal, 1
14...Branch prediction error signal, 201...
・・Instruction decoder, 202 ・・Prefetch・
Pointer, 203... Address incrementer, 204... Prefetch, control circuit, 20
5... Prefetch pointer input Kamarichi lexer, 206... Address comparator, 2
07... Branch prediction table, 208...
・Branch prediction table control circuit, 209...Return address register, 301...Branch prediction table/branch source address section, 302...Branch prediction table Paris, flag , 303... Branch prediction table/instruction length section, 304... Branch prediction table/branch destination address section. Agent Patent Attorney Uchihara Otohaku 1 Zuko? Possible

Claims (1)

【特許請求の範囲】[Claims] 命令プリフェッチ用アドレスを示すプリフェッチ・ポイ
ンタと、分岐先アドレスがダイナミックに変化しない分
岐命令の先頭アドレス、分岐命令長及び分岐先アドレス
をキヤッシングするための分岐予測テーブルと、分岐が
発生したときに前記分岐予測テーブルに登録するための
手段と、プリフェッチ・アドレスが前記分岐予測テーブ
ルにヒットしたときに、ヒットした分岐命令を分岐命令
長から必要なだけ命令プリフェッチを行った後、前記プ
リフェッチ・ポインタに分岐先アドレスをセットする手
段とを有することを特徴とするマイクロプロセッサ。
A prefetch pointer indicating an instruction prefetch address, a branch prediction table for caching the start address, branch instruction length, and branch destination address of a branch instruction whose branch destination address does not change dynamically, and a branch prediction table for caching the branch instruction length and branch destination address when a branch occurs. means for registering in a prediction table, and when a prefetch address hits the branch prediction table, prefetching the hit branch instruction as many instructions as necessary from the branch instruction length, and then registering the branch destination in the prefetch pointer; A microprocessor comprising: means for setting an address.
JP63298514A 1988-11-25 1988-11-25 Microprocessor Expired - Fee Related JPH0769810B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63298514A JPH0769810B2 (en) 1988-11-25 1988-11-25 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63298514A JPH0769810B2 (en) 1988-11-25 1988-11-25 Microprocessor

Publications (2)

Publication Number Publication Date
JPH02144626A true JPH02144626A (en) 1990-06-04
JPH0769810B2 JPH0769810B2 (en) 1995-07-31

Family

ID=17860706

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63298514A Expired - Fee Related JPH0769810B2 (en) 1988-11-25 1988-11-25 Microprocessor

Country Status (1)

Country Link
JP (1) JPH0769810B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5729707A (en) * 1994-10-06 1998-03-17 Oki Electric Industry Co., Ltd. Instruction prefetch circuit and cache device with branch detection
US5872964A (en) * 1995-08-09 1999-02-16 Hitachi, Ltd. Comparison operating unit and graphic operating system
US6332190B1 (en) 1997-05-30 2001-12-18 Mitsubishi Denki Kabushiki Kaisha Branch prediction method using a prediction table indexed by fetch-block address

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5991551A (en) * 1982-11-17 1984-05-26 Nec Corp Instruction prefetching device forecasting address to be branched

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5991551A (en) * 1982-11-17 1984-05-26 Nec Corp Instruction prefetching device forecasting address to be branched

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5729707A (en) * 1994-10-06 1998-03-17 Oki Electric Industry Co., Ltd. Instruction prefetch circuit and cache device with branch detection
US5872964A (en) * 1995-08-09 1999-02-16 Hitachi, Ltd. Comparison operating unit and graphic operating system
US6332190B1 (en) 1997-05-30 2001-12-18 Mitsubishi Denki Kabushiki Kaisha Branch prediction method using a prediction table indexed by fetch-block address

Also Published As

Publication number Publication date
JPH0769810B2 (en) 1995-07-31

Similar Documents

Publication Publication Date Title
JP2796797B2 (en) Method of processing an interrupt routine by a digital instruction processor controller
JP2815237B2 (en) A device that processes instructions inside a computer system
US4847753A (en) Pipelined computer
US4858104A (en) Preceding instruction address based branch prediction in a pipelined processor
US20050278505A1 (en) Microprocessor architecture including zero impact predictive data pre-fetch mechanism for pipeline data memory
KR100240591B1 (en) Branch target buffer for processing branch instruction efficontly and brand prediction method using thereof
KR100267098B1 (en) Vector processor design to reduce register file read ports
JPS6323586B2 (en)
EP1241567B1 (en) Method and apparatus for executing coprocessor instructions
CN111213131B (en) Zero latency prefetch in a cache
JP2507638B2 (en) Data processing device
JP2560889B2 (en) Microprocessor
JP3182438B2 (en) Data processor
JPH01214932A (en) Data processor
JP3486690B2 (en) Pipeline processor
US20060224861A1 (en) Condition branch instruction encoding within a multiple instruction set data processing system
JPH02144626A (en) Microprocessor
US20050144427A1 (en) Processor including branch prediction mechanism for far jump and far call instructions
JP3394854B2 (en) Unconditional jump instruction processing method, unconditional jump instruction processing device therefor, and general-purpose register
JP2856373B2 (en) Data processing device
JPH0331933A (en) Data processor
JP2532560B2 (en) Data processing device for high-performance exception handling
JP3325309B2 (en) Subroutine return instruction processing unit
JPH09311787A (en) Data processor
JPH0218620A (en) Information processor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees