JP2000132391A - Branch prediction mechanism - Google Patents

Branch prediction mechanism

Info

Publication number
JP2000132391A
JP2000132391A JP10301841A JP30184198A JP2000132391A JP 2000132391 A JP2000132391 A JP 2000132391A JP 10301841 A JP10301841 A JP 10301841A JP 30184198 A JP30184198 A JP 30184198A JP 2000132391 A JP2000132391 A JP 2000132391A
Authority
JP
Japan
Prior art keywords
branch
instruction
address
branch history
instructions
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
JP10301841A
Other languages
Japanese (ja)
Inventor
Sachiko Shimada
幸子 嶋田
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 JP10301841A priority Critical patent/JP2000132391A/en
Publication of JP2000132391A publication Critical patent/JP2000132391A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To improve the prediction hit rate of a branch instruction with condition and to improve performance by making a plurality of branch history information contained in one line of a branch history buffer correspond to the addresses of the branch instructions with conditions. SOLUTION: A branch history buffer 804 storing the plurality of branch history information in one line is installed. In fetching an instruction (IF stage), one line containing the plurality of branch history information is read from the branch history buffer 804. When a plurality of branch instructions with conditions are contained in the fetched instruction, the respective branch instructions with conditions are branch-predicted by using the plurality of branch history information which are read. As a means for making the plurality of branch history information contained in one line of the branch history buffer 804 correspond to the addresses of the branch instructions with condition, an entry in the line of the branch history buffer 804 is made to correspond to an entry in the line of an instruction cache 802.

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, and more particularly to a microprocessor having a branch instruction predicting mechanism.

【0002】[0002]

【従来の技術】現在のマイクロプロセッサは、パイプラ
イン方式の導入によりマイクロプロセッサ内で並列処理
を行い高速化を図っている。図8は、パイプライン処理
を説明するための図である。図8を参照すると、このマ
イクロプロセッサにおいて、プログラム内の各命令は、
命令フェッチ(IF)、命令デコード(ID)、演算実
行(EX)、データ読み出し(MEM)、書き込み(W
B)で一連の処理を終了する。これらの各処理をそれぞ
れ1サイクルで行い、この処理の単位を「パイプライン
ステージ」と呼ぶ。
2. Description of the Related Art At present, a microprocessor performs parallel processing in a microprocessor by introducing a pipeline system to increase the speed. FIG. 8 is a diagram for explaining the pipeline processing. Referring to FIG. 8, in the microprocessor, each instruction in a program is:
Instruction fetch (IF), instruction decode (ID), operation execution (EX), data read (MEM), write (W
In B), a series of processing ends. Each of these processes is performed in one cycle, and the unit of this process is called a “pipeline stage”.

【0003】T1サイクルにおいて、命令1はIFステ
ージの処理が行われる。
In the T1 cycle, the instruction 1 is processed in the IF stage.

【0004】T2サイクルにおいて、命令1はIDステ
ージに処理が移り、IFステージでは、命令2の処理が
行われる。
In the T2 cycle, the processing of the instruction 1 shifts to the ID stage, and the processing of the instruction 2 is performed in the IF stage.

【0005】T3サイクルでは、命令1はEXステー
ジ、命令2はIDステージ、命令3はIFステージでの
処理が行われる。命令1の処理が終了するT5サイクル
では命令5の処理が始まっている。
In the T3 cycle, the instruction 1 is processed in the EX stage, the instruction 2 is processed in the ID stage, and the instruction 3 is processed in the IF stage. In the T5 cycle in which the processing of the instruction 1 ends, the processing of the instruction 5 has started.

【0006】このようにパイプライン方式のマイクロプ
ロセッサは、1つの命令をいくつかのステップで処理
し、資源を増やすことなく、複数の命令をオーバーラッ
プさせて並列実行することを可能としている。
[0006] As described above, the pipeline type microprocessor processes one instruction in several steps, and enables a plurality of instructions to be executed in parallel with overlapping without increasing resources.

【0007】図9は、パイプライン方式のマイクロプロ
セッサの構成の一例を示すブロック図である。図9を参
照すると、このパイプライン方式のマイクロプロセッサ
は、PC(プログラムカウンタ)レジスタ201、命令
キャッシュユニット202、命令デコード/レジスタユ
ニット203、命令実行ユニット204、データキャッ
シュユニット205、アドレス加算器206、及び、各
パイプラインステージを区切るためのパイプラインレジ
スタ207、208、209、210を備えて構成され
る。
FIG. 9 is a block diagram showing an example of a configuration of a pipeline type microprocessor. Referring to FIG. 9, this pipelined microprocessor includes a PC (program counter) register 201, an instruction cache unit 202, an instruction decode / register unit 203, an instruction execution unit 204, a data cache unit 205, an address adder 206, And pipeline registers 207, 208, 209, 210 for separating each pipeline stage.

【0008】命令の処理は以下のように行われる。The processing of an instruction is performed as follows.

【0009】PCレジスタ201は、プログラム内での
命令のアドレスを格納している。PCレジスタ201で
指定された命令を、命令キャッシュユニット202で読
み出し(命令フェッチ)、パイプラインレジスタ207
に格納する。
The PC register 201 stores an address of an instruction in a program. The instruction specified by the PC register 201 is read by the instruction cache unit 202 (instruction fetch), and the pipeline register 207
To be stored.

【0010】命令デコード/レジスタユニット203で
は、読み出された命令のデコード、及びレジスタの値を
読み出し、パイプラインレジスタ208に格納する。
The instruction decode / register unit 203 decodes the read instruction, reads the register value, and stores it in the pipeline register 208.

【0011】命令実行ユニット204では、デコードさ
れた命令の演算が行われ、その結果がパイプラインレジ
スタ209に格納される。また演算結果は、レジスタフ
ァイルに書き込むためデータ線211を通って一旦パイ
プラインレジスタ210へ格納される。
In the instruction execution unit 204, the operation of the decoded instruction is performed, and the result is stored in the pipeline register 209. The operation result is temporarily stored in the pipeline register 210 through the data line 211 for writing to the register file.

【0012】データキャッシュユニット205では、演
算結果のデータキャッシュへの書き込み及び読み出しが
行われる。データキャッシュから読み出されたデータは
パイプラインレジスタ210へ格納され、データ線21
2を通って命令デコード/レジスタユニット203内の
レジスタへ書き込まれる。
The data cache unit 205 writes and reads operation results to and from the data cache. The data read from the data cache is stored in the pipeline register 210,
2 is written to a register in the instruction decode / register unit 203.

【0013】またアドレス加算器206は、次に実行す
る命令のアドレスを計算し、アドレス線213を通って
PCレジスタ201に格納される。
The address adder 206 calculates the address of the next instruction to be executed, and stores it in the PC register 201 through the address line 213.

【0014】パイプラインレジスタ207、208、2
09、210がそれぞれのステージでの用いるデータを
保持することにより、各パイプラインステージに区切ら
れ、パイプラインステージ単位での並列処理が可能とな
る。
The pipeline registers 207, 208, 2
Since the data 09 and 210 hold the data used in the respective stages, the data is divided into the respective pipeline stages and the parallel processing can be performed in units of the pipeline stages.

【0015】通常のプログラム・フローは、次に実行さ
れる命令がプログラム順序の次の命令である。このた
め、命令のフェッチと同じサイクルでプログラム順序の
次の命令のアドレスをアドレス加算器206で計算し、
次サイクルでは、PCレジスタ201に新しい命令のア
ドレスを格納することができる。
In a normal program flow, the next instruction to be executed is the next instruction in the program order. Therefore, the address of the next instruction in the program order is calculated by the address adder 206 in the same cycle as the instruction fetch,
In the next cycle, the address of a new instruction can be stored in the PC register 201.

【0016】しかし、分岐命令では命令内で指定された
アドレスの命令にプログラム・フローが変更される。分
岐命令により変更されるプログラムフローのアドレス指
定は通常IDステージの命令実行ユニットにおいて行わ
れ、この為3サイクル遅れる。そして、指定されたアド
レスの命令を改めて命令キャッシュからフェッチするた
め、パイプラインが停止する原因となる。
However, in the case of a branch instruction, the program flow is changed to an instruction at an address specified in the instruction. The addressing of the program flow changed by the branch instruction is usually performed in the instruction execution unit in the ID stage, and is therefore delayed by three cycles. Then, since the instruction at the specified address is fetched from the instruction cache again, this causes the pipeline to stop.

【0017】パイプライン方式のプロセッサでは、パイ
プラインを満たしておいて命令を並列化することにより
性能をあげているが、特に、パイプライン段数の増加し
た近年のマイクロプロセッサでは、分岐命令により、そ
の後の命令の並列化ができなくなり、分岐によるペナル
ティも増加する。
In a pipeline type processor, performance is improved by parallelizing instructions while filling the pipeline. In particular, in a recent microprocessor having an increased number of pipeline stages, a branch instruction causes Cannot be parallelized, and the penalty due to branching also increases.

【0018】このため、分岐ペナルティを軽減するた
め、パイプラインの早期段階で、分岐命令の指定するア
ドレスを計算し、指定されたアドレスの命令をフェッチ
している。
Therefore, in order to reduce the branch penalty, the address specified by the branch instruction is calculated at an early stage of the pipeline, and the instruction at the specified address is fetched.

【0019】図10は、分岐ペナルティを軽減するため
パイプラインの早期段階で分岐命令の指定するアドレス
を計算し、指定されたアドレスの命令をフェッチするこ
とを可能としたマイクロプロセッサの構成の一例を示す
ブロック図である。図10を参照すると、この従来のプ
ロセッサは、PCレジスタ301、命令キャッシュユニ
ット302、命令デコード/レジスタユニット303、
命令実行ユニット304、データキャッシュユニット3
05、アドレス加算器306、パイプラインレジスタ3
07、308、309、310、及び分岐予測ユニット
312を備えて構成される。
FIG. 10 shows an example of the configuration of a microprocessor capable of calculating an address specified by a branch instruction at an early stage of a pipeline and fetching an instruction at the specified address in order to reduce a branch penalty. FIG. Referring to FIG. 10, this conventional processor includes a PC register 301, an instruction cache unit 302, an instruction decode / register unit 303,
Instruction execution unit 304, data cache unit 3
05, address adder 306, pipeline register 3
07, 308, 309, 310 and a branch prediction unit 312.

【0020】PCレジスタ301で指定された命令を命
令キャッシュユニット302で読み出し、パイプライン
レジスタ307へ格納する。
The instruction specified by the PC register 301 is read by the instruction cache unit 302 and stored in the pipeline register 307.

【0021】命令デコード/レジスタユニット303は
命令のデコードを行う。パイプラインレジスタ307へ
格納された命令が分岐命令の場合には、分岐予測ユニッ
ト312において、該分岐命令で指定されるアドレスを
計算し、その値をアドレス線313を通してPCレジス
タ301に格納し、新たに命令をフェッチする。
The instruction decode / register unit 303 decodes an instruction. If the instruction stored in the pipeline register 307 is a branch instruction, the branch prediction unit 312 calculates an address specified by the branch instruction, stores the value in the PC register 301 through the address line 313, Fetch instructions.

【0022】分岐予測ユニット312で分岐命令の指定
するアドレスを計算することによりパイプラインの早期
段階で、次命令のフェッチを可能とし、これにより、分
岐によるパイプラインの停止ペナルティを軽減してい
る。
By calculating the address specified by the branch instruction in the branch prediction unit 312, the next instruction can be fetched at an early stage of the pipeline, thereby reducing the penalty for stopping the pipeline due to the branch.

【0023】分岐命令には、分岐が常に成立する無分岐
命令の他、条件付分岐命令がある。条件付分岐命令は、
例えばゼロフラグがオンのとき分岐する等、先行する別
の命令の実行により設定される条件等に依存して、分岐
が成立するか不成立となるかが決定される。
The branch instruction includes a non-branch instruction in which a branch is always taken, and a conditional branch instruction. The conditional branch instruction is
For example, whether a branch is taken or not taken is determined depending on conditions set by execution of another preceding instruction, such as branching when the zero flag is on.

【0024】条件分岐命令実行時、命令実行ユニット3
04における条件の決定まで、プログラム・フローが決
定されないため、図10に示したマイクロプロセッサで
は、条件付分岐命令によるパイプラインの停止パナルテ
ィを軽減することができない。
When the conditional branch instruction is executed, the instruction execution unit 3
Since the program flow is not determined until the condition in step 04, the microprocessor shown in FIG. 10 cannot reduce the pipeline stop panalty due to the conditional branch instruction.

【0025】図11は、条件付分岐命令のパイプライン
の停止ペネルティの軽減を図る従来のプロセッサの構成
を示すブロック図である。図11を参照すると、このマ
イクロプロセッサは、PCレジスタ401、命令キャッ
シュユニット402、命令デコード/レジスタユニット
403、命令実行ユニット404、データキャッシュユ
ニット405、アドレス加算器406、パイプラインレ
ジスタ407、408、409、410、分岐予測ユニ
ット412、及び分岐履歴バッファ414を備えて構成
される。
FIG. 11 is a block diagram showing a configuration of a conventional processor for reducing a stop penalty of a pipeline of a conditional branch instruction. Referring to FIG. 11, the microprocessor includes a PC register 401, an instruction cache unit 402, an instruction decode / register unit 403, an instruction execution unit 404, a data cache unit 405, an address adder 406, and pipeline registers 407, 408, and 409. , 410, a branch prediction unit 412, and a branch history buffer 414.

【0026】分岐履歴バッファ414は、条件付分岐命
令における条件が成立したか不成立であったか情報を記
憶しておくためのバッファである。
The branch history buffer 414 is a buffer for storing information on whether a condition in a conditional branch instruction is satisfied or not satisfied.

【0027】PCレジスタ401で指定された命令を命
令キャッシュユニット402で読み出し、パイプライン
レジスタ407へ格納する。同時に、分岐履歴バッファ
414からPCレジスタ401で指定されたアドレスの
分岐履歴情報を読み出し、パイプラインレジスタ407
へ格納する。
The instruction specified by the PC register 401 is read by the instruction cache unit 402 and stored in the pipeline register 407. At the same time, the branch history information at the address specified by the PC register 401 is read from the branch history buffer 414, and the pipeline register 407 is read.
To store.

【0028】命令デコード/レジスタユニット403
は、読み出された命令のデコードを行う。パイプライン
レジスタ407に格納された命令が条件付分岐命令であ
る場合には、パイプラインレジスタ407に格納された
分岐履歴情報に基づいて、条件付分岐命令は、分岐が成
立するか否かの予測が行われる。
Instruction decode / register unit 403
Performs decoding of the read instruction. When the instruction stored in the pipeline register 407 is a conditional branch instruction, the conditional branch instruction predicts whether or not the branch is taken based on the branch history information stored in the pipeline register 407. Is performed.

【0029】分岐成立と予測された場合には、命令中に
指定されるアドレスを分岐予測ユニット412で計算
し、その値をアドレス線413を通してPCレジスタ4
01に格納し、新たに命令をフェッチを行う。
When it is predicted that the branch is taken, the address specified in the instruction is calculated by the branch prediction unit 412, and the value is transferred to the PC register 4 through the address line 413.
01, and a new instruction is fetched.

【0030】分岐不成立と予測された場合には、すでに
フェッチされているプログラム順序の次の命令を命令デ
コード/レジスタユニット403へ転送する。
When it is predicted that the branch is not taken, the next instruction in the program order already fetched is transferred to the instruction decode / register unit 403.

【0031】分岐条件の決定は、命令実行ユニット40
4において行われる。分岐予測が正しい場合には、予測
に従いフェッチしてきた命令の実行が行われる。
The branch condition is determined by the instruction execution unit 40.
4 is performed. If the branch prediction is correct, the fetched instruction is executed according to the prediction.

【0032】分岐予測が間違っていた場合には、正しい
命令アドレスをアドレス線415を通してPCレジスタ
401に格納し、プログラム・フローの命令をフェッチ
し直す。
If the branch prediction is wrong, the correct instruction address is stored in the PC register 401 through the address line 415, and the instruction in the program flow is fetched again.

【0033】条件の決定後、分岐履歴情報が更新され、
信号線416を通して分岐履歴バッファ414に書き込
まれる。
After the condition is determined, the branch history information is updated.
The data is written to the branch history buffer 414 through the signal line 416.

【0034】図12は、複数のマイクロプロセッサを並
列に接続した従来の情報処理装置の構成の一例を示す図
であり、図12には、簡単の為2つのマイクロプロセッ
サが接続されている構成が示されているが、2個に限定
されるものでない。
FIG. 12 is a diagram showing an example of the configuration of a conventional information processing apparatus in which a plurality of microprocessors are connected in parallel. FIG. 12 shows a configuration in which two microprocessors are connected for simplicity. Although shown, it is not limited to two.

【0035】図12を参照すると、外部バス501に接
続された2個のプロセッサ502a、502bから構成
され、各プロセッサは、それぞれ、PCレジスタ503
a、503b、命令キャッシュユニット504a、50
4b、アドレス加算器505a、505b、分岐履歴バ
ッファ506a、506b、命令デコードユニット50
7a、507b、分岐予測ユニット508a、508
b、命令実行ユニット509a、509b、及び、デー
タキャッシュユニット510a、510bを備えてい
る。
Referring to FIG. 12, there are provided two processors 502a and 502b connected to an external bus 501, each of which is provided with a PC register 503.
a, 503b, instruction cache units 504a, 50
4b, address adders 505a, 505b, branch history buffers 506a, 506b, instruction decode unit 50
7a, 507b, branch prediction units 508a, 508
b, instruction execution units 509a and 509b, and data cache units 510a and 510b.

【0036】それぞれのプロセッサ502a、502b
は、図11に示した従来のプロセッサと同様の動作を行
う。
Each processor 502a, 502b
Performs the same operation as the conventional processor shown in FIG.

【0037】プロセッサ502a、502b内で処理さ
れる条件付分岐命令は、プロセッサ502a、502b
内に個別に保持する分岐履歴バッファ506a、506
bの情報に基づき、分岐予測ユニット508a、508
bにより予測が行われる。分岐条件の決定後、命令実行
ユニット509a、509bで履歴情報は更新されそれ
ぞれの分岐履歴バッファ506a、506bに書き込ま
れる。
The conditional branch instructions processed in the processors 502a and 502b are
History buffers 506a and 506 individually held in
b, the branch prediction units 508a, 508
The prediction is performed by b. After the branch condition is determined, the history information is updated in the instruction execution units 509a and 509b and written into the respective branch history buffers 506a and 506b.

【0038】これらの分岐履歴情報はそれぞれのプロセ
ッサ502a、502b内で保持され、プロセッサ50
2a、502b間では共有されない。
The branch history information is held in each of the processors 502a and 502b.
It is not shared between 2a and 502b.

【0039】複数のプロセッサを並列に接続した情報処
理装置として、オンチップマルチプロセッサの研究も進
められている。複数のプロセッサを1チップに集積した
技術であるオンチップマルチプロセッサとして、例えば
文献(電子情報通信学会論文誌、D−I、Vol.J8
1−D−I、No.6、May 1998、pp.71
8−727)等が参照される。
As an information processing device in which a plurality of processors are connected in parallel, research on an on-chip multiprocessor is also underway. As an on-chip multiprocessor which is a technology in which a plurality of processors are integrated on a single chip, for example, literatures (Transactions of the Institute of Electronics, Information and Communication Engineers, DI, Vol. J8)
1-DI, No. 6, May 1998; 71
8-727).

【0040】上記文献で取り上げられている構成の一つ
を図13に示す。図13を参照すると、このオンチップ
マルチプロセッサは、パイプラインレジスタ601、命
令キャッシュユニット602、2個のプロセッサ603
a、603bと、を備えて構成されている。
FIG. 13 shows one of the configurations taken up in the above-mentioned document. Referring to FIG. 13, this on-chip multiprocessor includes a pipeline register 601, an instruction cache unit 602, and two processors 603.
a, 603b.

【0041】2個のプロセッサ603a、603bは、
それぞれPCレジスタ604a、604b、命令デコー
ド/レジスタユニット607a、607b、分岐予測ユ
ニット608a、608b、アドレス加算器606a、
606b、命令実行ユニット610a、610b、デー
タキャッシュユニット612a、612b、及びパイプ
ラインレジスタ605a、605b、609a、609
b、611a、611b、613a、613bを備えて
いる。
The two processors 603a and 603b are
PC registers 604a, 604b, instruction decode / register units 607a, 607b, branch prediction units 608a, 608b, address adders 606a,
606b, instruction execution units 610a, 610b, data cache units 612a, 612b, and pipeline registers 605a, 605b, 609a, 609
b, 611a, 611b, 613a, 613b.

【0042】パイプラインレジスタ601、命令キャッ
シュユニット602は2個のプロセッサ603a、60
3bの共有の資源として用いられる。
The pipeline register 601 and the instruction cache unit 602 include two processors 603a and 60
3b is used as a shared resource.

【0043】パイプラインレジスタ601には、各プロ
セッサ603a、603bから転送されたアドレスから
一つを選択し格納している。
The pipeline register 601 selects and stores one of the addresses transferred from the processors 603a and 603b.

【0044】IFステージにおいてこのパイプラインレ
ジスタ601に格納されたアドレスで指定される命令キ
ャッシュ602から命令列を読み出す。
In the IF stage, an instruction sequence is read from the instruction cache 602 specified by the address stored in the pipeline register 601.

【0045】読み出された命令列は、その命令列を要求
したプロセッサ603a/603bのパイプラインレジ
スタ605a、605bへ格納する。また同時に、パイ
プラインレジスタ601の内容が命令列を要求したプロ
セッサ603a/603bのPCレジスタ604a、6
04bへ格納される。
The read instruction sequence is stored in the pipeline registers 605a and 605b of the processor 603a / 603b that has requested the instruction sequence. At the same time, the contents of the pipeline register 601 are the PC registers 604a,
04b.

【0046】パイプラインレジスタ601は、一つのみ
アドレスを指定し、命令キャッシュ602へのアクセス
は、1サイクルに唯一1度に限られる。すなわち、1つ
のプロセッサが命令キャッシュへアクセスしているサイ
クルでは、他のプロセッサが命令キャッシュへアクセス
することができない。
The pipeline register 601 specifies only one address, and access to the instruction cache 602 is limited to only once per cycle. That is, in a cycle in which one processor accesses the instruction cache, another processor cannot access the instruction cache.

【0047】このため、2つのプロセッサ603a、6
03bに十分な命令を供給するためには、1サイクルで
2サイクルの命令を命令キャッシュから読み出しパイプ
ラインレジスタ605a、605bに格納する必要があ
る。
Therefore, the two processors 603a and 603a
In order to supply a sufficient instruction to 03b, it is necessary to read an instruction of two cycles in one cycle from the instruction cache and store it in the pipeline registers 605a and 605b.

【0048】IDステージにおいて、パイプラインレジ
スタ605a、605b内の命令列は、命令デコード/
レジスタユニット607a、607bでデコードされ
る。また、これらの命令が分岐命令であれば、分岐予測
ユニット608a、608bで分岐予測がなされる。
In the ID stage, the instruction sequence in the pipeline registers 605a and 605b is
The data is decoded by the register units 607a and 607b. If these instructions are branch instructions, branch prediction is performed by branch prediction units 608a and 608b.

【0049】これらの分岐予測は、それぞれのプロセッ
サ603a、603b内で行われ、これらの分岐履歴情
報は、プロセッサ間で共有されない。
These branch predictions are performed in the respective processors 603a and 603b, and the branch history information is not shared between the processors.

【0050】一方、単一プロセッサでも、単一プロセッ
サで複数の命令を同時に複数の実行ユニットにおいて並
列に処理する技術であるスーパースカラ技術により並列
度が増してきている。1ステップにおいて処理する命令
数が増加するため、1サイクルで命令キャッシュからフ
ェッチする命令数が増加する。
On the other hand, even in a single processor, the degree of parallelism has been increased by a superscalar technique, which is a technique for processing a plurality of instructions in a plurality of execution units in parallel by a single processor at the same time. Since the number of instructions processed in one step increases, the number of instructions fetched from the instruction cache in one cycle increases.

【0051】図14は、スーパースカラを実現する従来
のプロセッサの構成の一例を示す図である。図14を参
照すると、PCレジスタ701、命令キャッシュ70
2、アドレス加算器703、分岐履歴バッファ704、
命令デコード/レジスタユニット706、分岐予測ユニ
ット707、命令実行ユニット709、及びデータキャ
ッシュユニット712を備えて構成されいる。
FIG. 14 is a diagram showing an example of a configuration of a conventional processor for realizing a super scalar. Referring to FIG. 14, the PC register 701, the instruction cache 70
2, address adder 703, branch history buffer 704,
It comprises an instruction decode / register unit 706, a branch prediction unit 707, an instruction execution unit 709, and a data cache unit 712.

【0052】命令実行ユニット709は、複数の演算ユ
ニット709a、709bを含み、複数の命令の並列実
行を可能としている。
The instruction execution unit 709 includes a plurality of operation units 709a and 709b, and is capable of executing a plurality of instructions in parallel.

【0053】PCレジスタ701で指定された複数の命
令が命令キャッシュ702から読み出されパイプライン
レジスタ705に格納される。これらの命令は、命令デ
コード/レジスタユニット706でデコードされ、命令
実行ユニット内709の演算ユニットへ割り振られて実
行される。
A plurality of instructions specified by the PC register 701 are read from the instruction cache 702 and stored in the pipeline register 705. These instructions are decoded by the instruction decode / register unit 706, allocated to the operation units in the instruction execution unit 709, and executed.

【0054】条件付分岐命令の予測は、分岐予測ユニッ
ト707で行われる。命令フェッチ時に、PCレジスタ
701に対応する1つの分岐履歴情報を分岐履歴バッフ
ァ704から読み出し、パイプラインレジスタ705に
格納する。
The prediction of a conditional branch instruction is performed by the branch prediction unit 707. At the time of instruction fetch, one piece of branch history information corresponding to the PC register 701 is read from the branch history buffer 704 and stored in the pipeline register 705.

【0055】パイプラインレジスタ705に格納された
複数の命令中に条件付き分岐命令命令が複数含まれる場
合には、それら全ての条件付分岐命令の予測を行うこと
ができず、1つの条件付分岐命令の予測のみを行ってい
る。
When a plurality of conditional branch instructions are included in a plurality of instructions stored in the pipeline register 705, prediction of all conditional branch instructions cannot be performed, and one conditional branch instruction cannot be predicted. Only instruction prediction is performed.

【0056】[0056]

【発明が解決しようとする課題】並列度が増加した情報
処理装置においては、1サイクルで複数の条件付分岐命
令を処理する必要が生じる。しかしながら、従来の情報
処理装置においては、複数の条件付分岐命令を予測する
ことが出来ず、パイプラインレジスタに格納された複数
の命令中に条件付き分岐命令が複数含まれる場合には、
1つの条件付分岐命令の予測のみを行っている。また、
情報処理装置において性能向上のためには条件分岐命令
の予測ヒット率をあげることが必須である。
In an information processing apparatus having an increased degree of parallelism, it is necessary to process a plurality of conditional branch instructions in one cycle. However, in the conventional information processing apparatus, when a plurality of conditional branch instructions cannot be predicted and a plurality of conditional branch instructions are included in a plurality of instructions stored in a pipeline register,
Only one conditional branch instruction is predicted. Also,
In order to improve the performance of the information processing apparatus, it is essential to increase the predicted hit rate of the conditional branch instruction.

【0057】そして、従来の情報処理装置では、複数の
プロセッサ毎個別に分岐履歴バッファを備えており、ハ
ードウエア量が増大し、予測ヒット率を向上するために
各プロセッサが使用する分岐履歴情報量を増やした場
合、さらにハードウエア量が増大する、という問題点を
有している。
In the conventional information processing apparatus, a branch history buffer is individually provided for each of a plurality of processors, the amount of hardware increases, and the amount of branch history information used by each processor to improve the prediction hit rate. However, there is a problem that the amount of hardware further increases when the number is increased.

【0058】したがって、本発明は、上記問題点に鑑み
てなされたものであって、その目的は、1サイクルに命
令キャッシュから複数の命令をフェッチする情報処理装
置において、フェッチしてきた複数の命令中に含まれる
複数の条件付分岐命令の分岐予測を可能とする、情報処
理装置を提供することにある。
Therefore, the present invention has been made in view of the above problems, and an object of the present invention is to provide an information processing apparatus that fetches a plurality of instructions from an instruction cache in one cycle. An object of the present invention is to provide an information processing apparatus which enables branch prediction of a plurality of conditional branch instructions included in the information processing apparatus.

【0059】本発明の他の目的は、条件付分岐命令の予
測ヒット率を向上し、性能向上を図る情報処理装置を提
供することにある。
Another object of the present invention is to provide an information processing apparatus which improves the prediction hit rate of a conditional branch instruction to improve the performance.

【0060】[0060]

【課題を解決するための手段】前記目的を達成する本発
明の情報処理装置は、分岐履歴バッファを1ラインに複
数の分岐履歴情報を格納する構成とし、命令フェッチ時
に、前記分岐履歴バッファから複数の分岐履歴情報を含
む1ラインを読み出し、フェッチした命令中に複数の条
件付分岐命令が含まれている場合、分岐履歴バッファか
ら読み出した複数の分岐履歴情報を用いて各々の条件付
分岐命令の分岐予測を行う。本発明において、分岐履歴
バッファの1ラインに含まれる複数の分岐履歴情報を条
件付分岐命令のアドレスと対応付けさせる。
According to a first aspect of the present invention, there is provided an information processing apparatus comprising: a branch history buffer configured to store a plurality of pieces of branch history information in one line; If a plurality of conditional branch instructions are read from a line fetched from the branch history buffer and the fetched instruction includes a plurality of conditional branch instructions, each of the conditional branch instructions is read out using the plurality of branch history information read from the branch history buffer. Perform branch prediction. In the present invention, a plurality of pieces of branch history information included in one line of the branch history buffer are associated with addresses of conditional branch instructions.

【0061】また本発明は、複数のプロセッサを含む情
報処理装置において、分岐命令を実行した際の分岐成立
/不成立の履歴、及び、成立した場合の命令アドレスを
格納する分岐履歴バッファを前記複数プロセッサ間で共
有することを特徴とする。
According to the present invention, in an information processing apparatus including a plurality of processors, a branch history buffer for storing a history of branch taken / not taken when a branch instruction is executed and an instruction address when the branch instruction is taken is provided by the plurality of processors. It is characterized by being shared between.

【0062】[0062]

【発明の実施の形態】本発明の実施の形態について説明
する。本発明の情報処理装置は、その好ましい実施の形
態において、図1を参照すると、1ラインに複数の分岐
履歴情報を格納する分岐履歴バッファ(804)を備
え、命令フェッチ時(IFステージ)において、分岐履
歴バッファから複数の分岐履歴情報を含む1ラインを読
み出し、フェッチした命令中に、複数の条件付分岐命令
が含まれている場合、該分岐履歴バッファから読み出し
た複数の分岐履歴情報を用いて、各々の条件付分岐命令
の分岐予測を行う。分岐履歴バッファに格納される情報
としては、(a)分岐命令を実行した際の分岐成立/不
成立の分岐履歴情報、(b)分岐履歴情報と分岐成立時
のアドレス、(c)分岐履歴情報と分岐成立時のアドレ
スと分岐が成立した場合の成立先の命令のうちの少なく
とも一つの形態を含む。
Embodiments of the present invention will be described. Referring to FIG. 1, the information processing apparatus according to the present invention includes a branch history buffer (804) for storing a plurality of pieces of branch history information in one line. When one line including a plurality of pieces of branch history information is read from the branch history buffer and a plurality of conditional branch instructions are included in the fetched instruction, the plurality of pieces of branch history information read from the branch history buffer are used. , Branch prediction of each conditional branch instruction. The information stored in the branch history buffer includes (a) branch history information indicating whether a branch is taken / not taken when a branch instruction is executed, (b) branch history information and an address when a branch is taken, (c) branch history information, It includes at least one form of the address at the time of the branch and the instruction at the branch destination when the branch is taken.

【0063】また本発明の実施の形態においては、分岐
履歴バッファの1ラインに含まれる複数の分岐履歴情報
を条件付分岐命令のアドレスと対応付けさせる。
In the embodiment of the present invention, a plurality of pieces of branch history information included in one line of the branch history buffer are associated with addresses of conditional branch instructions.

【0064】複数の分岐履歴情報と条件付分岐命令のア
ドレスの対応付けのための第一の手段として、図2を参
照すると、命令キャッシュ(802)のライン(90
1)中のエントリに分岐履歴バッファ(804)のライ
ン(902)内のエントリを対応させる。命令キャッシ
ュ(802)の1ライン中の先頭の命令は、分岐履歴バ
ッファ(804)の1ライン中の最初の分岐履歴情報
に、2番目の命令は2番目の履歴情報に、と対応付け
る。これにより、複数の条件付分岐命令をそれぞれに対
応する分岐履歴情報を用いて分岐予測することが可能と
なる。
As a first means for associating a plurality of pieces of branch history information with addresses of conditional branch instructions, referring to FIG.
1) The entry in the line (902) of the branch history buffer (804) corresponds to the entry in (1). The first instruction in one line of the instruction cache (802) is associated with the first branch history information in one line of the branch history buffer (804), and the second instruction is associated with the second history information. This makes it possible to predict a plurality of conditional branch instructions using the corresponding branch history information.

【0065】対応付けの第二の手段として、図7を参照
すると、分岐履歴バッファ(1402a、1402b)
のそれぞれの分岐履歴情報に、分岐履歴情報のアドレス
の一部を持つタグ(1403a、1403b)を備え、
条件付分岐命令のアドレスとコンパレータで比較する構
成としてもよい。
As a second means of association, referring to FIG. 7, a branch history buffer (1402a, 1402b)
Are provided with tags (1403a, 1403b) each having a part of the address of the branch history information,
The address of the conditional branch instruction may be compared with a comparator.

【0066】本発明の実施の形態によれば、条件付分岐
命令の履歴情報を異なる命令の履歴情報と混同すること
なく予測に用いることが可能となり予測ヒット率を向上
することを可能とする。
According to the embodiment of the present invention, the history information of a conditional branch instruction can be used for prediction without being confused with the history information of a different instruction, and the prediction hit rate can be improved.

【0067】より詳細には、本発明の情報処理装置は、
その好ましい一実施の形態において、図1を参照する
と、複数の命令を同一サイクルで同時に命令キャッシュ
から読み出すことのできる命令キャッシュユニット(8
02)と、1ラインあたり複数の分岐履歴情報を格納す
る分岐履歴バッファ(804)と、を備え、IFステー
ジにおいて、命令キャッシュユニット(802)では、
PCレジスタ(801)で指定されたアドレスに従い命
令キャッシュのラインにアクセスし該ラインから複数エ
ントリの命令を読み出して命令バッファ(805a)に
格納し、PCレジスタ(801)で指定されたアドレス
に従い分岐履歴バッファ(804)のラインにアクセス
し、該ラインから命令キャッシュ(802)のエントリ
に対応した命令の分岐履歴情報を複数エントリ読み出し
てヒストリバッファ(805c)に格納し、IDステー
ジにおいて、命令デコード/レジスタユニット(80
6)では、命令バッファ(805a)に格納された命令
をデコードして、条件付分岐命令か否か判定され、判定
結果を分岐予測ユニット(807)に送り、分岐予測ユ
ニット(807)では、命令バッファに格納された命令
が条件付分岐命令であったときに、ヒストリバッファ
(805c)に格納された分岐履歴情報に基づいて、前
記条件付分岐命令が成立するか否かを予測し、前記条件
付分岐命令の分岐が成立すると予測された場合には、分
岐先のアドレスを計算し計算結果を前記PCレジスタ
(801)へ転送し、且つ、分岐予測の結果は命令実行
ユニット(809)に送られ、EXステージでは、各命
令の演算、条件付分岐命令の分岐検証を行なう命令実行
ユニット(809)において、前記条件付分岐命令に関
する前記分岐予測ユニット(807)での分岐予測が正
しい場合、分岐履歴情報を更新し、分岐履歴バッファ
(804)に更新した履歴情報を書き込み、分岐予測が
間違っている場合には、正しい命令をフェッチするため
アドレスを計算してPCレジスタ(801)に書き込む
とともに、分岐履歴情報の更新を行い前記更新した履歴
情報を分岐履歴バッファ(804)に書き込む。
More specifically, the information processing apparatus of the present invention
In one preferred embodiment, referring to FIG. 1, an instruction cache unit (8) capable of simultaneously reading a plurality of instructions from the instruction cache in the same cycle.
02) and a branch history buffer (804) for storing a plurality of branch history information per line. In the IF stage, the instruction cache unit (802)
The instruction cache line is accessed in accordance with the address specified by the PC register (801), instructions of a plurality of entries are read from the line, stored in the instruction buffer (805a), and the branch history is stored in accordance with the address specified by the PC register (801). A line of the buffer (804) is accessed, a plurality of entries of branch history information of an instruction corresponding to an entry of the instruction cache (802) are read from the line, and stored in a history buffer (805c). Unit (80
In 6), the instruction stored in the instruction buffer (805a) is decoded, and it is determined whether or not the instruction is a conditional branch instruction. The determination result is sent to the branch prediction unit (807). When the instruction stored in the buffer is a conditional branch instruction, whether or not the conditional branch instruction is satisfied is predicted based on branch history information stored in a history buffer (805c). When it is predicted that the branch of the branch instruction is taken, the address of the branch destination is calculated, the calculation result is transferred to the PC register (801), and the result of the branch prediction is sent to the instruction execution unit (809). In the EX stage, an instruction execution unit (809) for performing the operation of each instruction and verifying the branch of the conditional branch instruction includes the branch prediction unit for the conditional branch instruction. If the branch prediction at the link (807) is correct, the branch history information is updated, the updated history information is written into the branch history buffer (804), and if the branch prediction is wrong, the address for fetching the correct instruction is stored. Is calculated and written into the PC register (801), the branch history information is updated, and the updated history information is written into the branch history buffer (804).

【0068】このように、本発明の実施においては、同
一サイクル内で複数の分岐履歴情報を参照し、それぞれ
の分岐命令の予測を、同一サイクル内に行うことができ
As described above, in the embodiment of the present invention, prediction of each branch instruction can be performed in the same cycle by referring to a plurality of pieces of branch history information in the same cycle.

【0069】また図7を参照すると、複数ブロックから
なる分岐履歴バッファ(1402a、1402b)に、
分岐履歴情報のアドレスの一部を持つタグ(1403
a、1403b)を備え、IFステージにおいて、分岐
履歴バッファ(1402a、1402b)からPCレジ
スタ(1401)で指定されたエントリの履歴情報とタ
グアドレスを読み出してヒストリバッファ(1406
a、1406b)に格納し、IDステージにおいて、そ
のタグアドレスと、バッファ(1405)の条件付分岐
命令のアドレスと、をコンパレータ(1407)で比較
し、一致したブロックの分岐履歴情報をマルチプレクサ
で(1408)で選択し、分岐予測ユニットにおける条
件付分岐命令の分岐予測に用いる。
Referring to FIG. 7, a branch history buffer (1402a, 1402b) composed of a plurality of blocks stores
Tag (1403) having a part of the address of branch history information
a, 1403b), at the IF stage, reads the history information and the tag address of the entry designated by the PC register (1401) from the branch history buffer (1402a, 1402b), and reads the history buffer (1406).
a, 1406b), and in the ID stage, the tag address and the address of the conditional branch instruction in the buffer (1405) are compared by a comparator (1407), and the branch history information of the matched block is output by a multiplexer ( 1408) and used for branch prediction of a conditional branch instruction in the branch prediction unit.

【0070】また本発明は、別の好ましい実施の形態と
して、複数のプロセッサを持つ情報処理装置において
は、図4を参照すると、分岐履歴バッファ(1103)
をプロセッサ間で共有する。同一の条件付分岐命令を複
数のプロセッサ(1104a、1104b)で実行した
場合、複数のプロセッサ間で分岐履歴情報を共有するこ
とが可能となり、予測のヒット率を向上することができ
る。
According to another preferred embodiment of the present invention, in an information processing apparatus having a plurality of processors, referring to FIG.
Is shared between processors. When the same conditional branch instruction is executed by a plurality of processors (1104a, 1104b), branch history information can be shared among the plurality of processors, and the prediction hit rate can be improved.

【0071】[0071]

【実施例】本発明の実施例について図面を参照して説明
する。
Embodiments of the present invention will be described with reference to the drawings.

【0072】[実施例1]図1は、本発明の一実施例を
なす情報処理装置の構成を示すブロック図である。図1
を参照すると、この情報処理装置は、1サイクルで2命
令の処理を行うことができるスーパースカラ方式のマイ
クロプロセッサであり、アドレスレジスタ801、命令
キャッシュユニット802、アドレス加算器803、分
岐履歴バッファ804、命令デコード/レジスタユニッ
ト806、分岐予測ユニット807、命令実行ユニット
809、データキャッシュユニット811、及びパイプ
ラインレジスタ805a、805b、805c、80
8、810、812、を備えて構成されている。
[Embodiment 1] FIG. 1 is a block diagram showing the configuration of an information processing apparatus according to an embodiment of the present invention. FIG.
, This information processing device is a super scalar type microprocessor capable of processing two instructions in one cycle, and includes an address register 801, an instruction cache unit 802, an address adder 803, a branch history buffer 804, Instruction decode / register unit 806, branch prediction unit 807, instruction execution unit 809, data cache unit 811, and pipeline registers 805a, 805b, 805c, 80
8, 810, and 812.

【0073】図2は、図1に示した命令キャッシュユニ
ット802、分岐履歴バッファ804、パイプラインレ
ジスタ805a、805cについてその構成を示すブロ
ック図である。
FIG. 2 is a block diagram showing the configuration of instruction cache unit 802, branch history buffer 804, and pipeline registers 805a and 805c shown in FIG.

【0074】図2を参照すると、パイプラインレジスタ
805aは、命令キャッシュユニット802から一度に
読み出した2命令を格納する命令バッファであり、パイ
プラインレジスタ805cは、分岐履歴バッファ804
から読み出した分岐履歴情報を2エントリ格納するヒス
トリバッファである。
Referring to FIG. 2, a pipeline register 805a is an instruction buffer for storing two instructions read at a time from instruction cache unit 802, and a pipeline register 805c is a branch history buffer 804
This is a history buffer that stores two entries of branch history information read out from.

【0075】なお、図1には、左端にパイプラインレジ
スタで区切られるパイプラインステージ名を示してい
る。
FIG. 1 shows pipeline stage names separated by pipeline registers at the left end.

【0076】図1及び図2を参照して、本発明の第1の
実施例の動作について説明する。PCレジスタ801
は、命令キャッシュユニット802、分岐予測バッファ
804にアクセスするためのアドレスを格納する。この
アドレスは、アドレス加算器803、分岐予測ユニット
807、命令実行ユニット809からそれぞれアドレス
線813、814、815を通して転送され、マルチプ
レクサにより、1つが選択される。
The operation of the first embodiment of the present invention will be described with reference to FIGS. PC register 801
Stores an address for accessing the instruction cache unit 802 and the branch prediction buffer 804. This address is transferred from the address adder 803, the branch prediction unit 807, and the instruction execution unit 809 through address lines 813, 814, and 815, respectively, and one is selected by the multiplexer.

【0077】選択されたアドレスがPCレジスタ801
に格納される。アドレスの選択は、命令実行ユニット8
09から転送されるアドレスが最優先であり、分岐予測
ユニット807から転送されるアドレス、アドレス加算
器803の結果の順で決定される。
When the selected address is the PC register 801
Is stored in The address is selected by the instruction execution unit 8
The address transferred from the address 09 is the highest priority, and is determined in the order of the address transferred from the branch prediction unit 807 and the result of the address adder 803.

【0078】IFステージでは、命令キャッシュユニッ
ト802、アドレス加算器803、分岐履歴バッファ8
04での処理が行われる。
In the IF stage, the instruction cache unit 802, the address adder 803, the branch history buffer 8
04 is performed.

【0079】アドレス加算器803は、次サイクルで命
令キャッシュユニット802、分岐予測バッファ804
にアクセスするために、PCレジスタ801に格納され
たアドレスの値に8を加算して、2命令先のアドレスの
値を得る。結果は、アドレス線813を通してPCレジ
スタ801に送られる。
The address adder 803 supplies the instruction cache unit 802 and the branch prediction buffer 804 in the next cycle.
Is added to the value of the address stored in the PC register 801 to obtain the value of the address two instructions ahead. The result is sent to the PC register 801 through the address line 813.

【0080】命令キャッシュユニット802では、PC
レジスタ801で指定されたアドレスを先頭とする2命
令を読み出す。PCレジスタ801で指定されたアドレ
スに従い命令キャッシュのライン901にアクセスす
る。該ラインから、例えば400番地の命令901e
と、404番地の命令901fの2命令を読み出す。
In the instruction cache unit 802, the PC
Two instructions starting from the address specified by the register 801 are read. The instruction cache line 901 is accessed according to the address specified by the PC register 801. From the line, for example, an instruction 901e at address 400
And two instructions 901f at address 404 are read.

【0081】読み出した2命令は、命令バッファ805
aに格納される。400番地の命令が命令バッファ80
5a1に、404番地の命令が命令バッファ805a2
に格納される。
The two instructions read are stored in the instruction buffer 805.
a. The instruction at address 400 is the instruction buffer 80
5a1, the instruction at address 404 is stored in the instruction buffer 805a2.
Is stored in

【0082】分岐履歴バッファ804では、PCレジス
タ801で指定されたアドレスを先頭とする2エントリ
の履歴情報を読み出す。PCレジスタ801で指定され
たアドレスに従い分岐予測バッファ804のライン90
2にアクセスする。該ラインの中から、400番地の命
令の分岐履歴情報902eと404番地の命令の分岐履
歴情報902fを読み出す。
The branch history buffer 804 reads two entries of history information starting from the address specified by the PC register 801. Line 90 of the branch prediction buffer 804 according to the address specified by the PC register 801
Access 2 From this line, branch history information 902e of the instruction at address 400 and branch history information 902f of the instruction at address 404 are read.

【0083】このように、命令キャッシュのエントリと
分岐履歴バッファ804のエントリは常に対応付けられ
ている。
As described above, the entry in the instruction cache and the entry in the branch history buffer 804 are always associated with each other.

【0084】読み出された分岐履歴情報は、ヒストリバ
ッファ805cに格納する。2エントリ中400番地の
分岐履歴情報がヒストリバッファ805c1に、404
番地の分岐履歴情報がヒストリバッファ805c2に格
納される。
The read branch history information is stored in the history buffer 805c. The branch history information at address 400 in the two entries is stored in the history buffer 805c1 as 404.
The branch history information of the address is stored in the history buffer 805c2.

【0085】ヒストリバッファに格納された分岐履歴情
報は、命令バッファ805aに格納された命令に常に対
応している。ヒストリバッファ805c1は命令バッフ
ァ805a1の分岐履歴情報であり、ヒストリバッファ
805c2は命令バッファ805a2の分岐履歴情報で
ある。
The branch history information stored in the history buffer always corresponds to the instruction stored in the instruction buffer 805a. The history buffer 805c1 is branch history information of the instruction buffer 805a1, and the history buffer 805c2 is branch history information of the instruction buffer 805a2.

【0086】IDステージでは、命令デコード/レジス
タユニット806及び分岐予測ユニット807での処理
が行われる。
In the ID stage, processing in the instruction decode / register unit 806 and the branch prediction unit 807 is performed.

【0087】命令デコード/レジスタユニット806で
は、命令バッファ805aに格納された命令のデコード
とレジスタからのデータ読み出しが行われる。
The instruction decode / register unit 806 decodes the instruction stored in the instruction buffer 805a and reads data from the register.

【0088】命令のデコードにより、命令バッファ80
5aに格納された命令が条件付分岐命令か否か判定され
る。判定結果は、信号線816を通して、分岐予測ユニ
ット807に送られる。
By decoding the instruction, the instruction buffer 80
It is determined whether the instruction stored in 5a is a conditional branch instruction. The determination result is sent to the branch prediction unit 807 via the signal line 816.

【0089】分岐予測ユニット807では、命令バッフ
ァ805aに格納された命令が条件付分岐命令であった
ときに、条件付分岐命令が成立するか否かを予測する。
When the instruction stored in the instruction buffer 805a is a conditional branch instruction, the branch prediction unit 807 predicts whether or not the conditional branch instruction is taken.

【0090】条件付分岐命令の分岐が成立すると予測さ
れた場合には、分岐先のアドレスを計算し、結果をアド
レス線814を通してPCレジスタ801へ転送する。
成立しないと予測された場合には何も行わない。
If the branch of the conditional branch instruction is predicted to be taken, the branch destination address is calculated, and the result is transferred to the PC register 801 through the address line 814.
No action is taken if it is predicted not to hold.

【0091】分岐の予測は、ヒストリバッファ805c
に格納された分岐履歴情報に基づいて行われる。また条
件付分岐命令内のオフセットの値を条件付分岐命令のア
ドレスの値に加算することにより、分岐先命令のアドレ
スを得る。分岐予測の結果は信号線817を通して命令
実行ユニット809に送られる。
The branch is predicted by the history buffer 805c.
This is performed based on the branch history information stored in. Further, the address of the branch destination instruction is obtained by adding the offset value in the conditional branch instruction to the address value of the conditional branch instruction. The result of the branch prediction is sent to the instruction execution unit 809 via a signal line 817.

【0092】EXステージでは、命令実行ユニット80
9で処理が行われる。命令実行ユニット809は、各命
令の演算や条件付分岐命令の予測検証を行う。また分岐
履歴情報の更新を行う。分岐予測が正しい場合には、分
岐履歴情報を更新し、信号線818を通して分岐履歴バ
ッファ804に更新した履歴情報を書き込む。分岐予測
が間違っている場合には、正しい命令をフェッチするた
め、正しいアドレスを計算し、アドレス線815を通し
てPCレジスタ801に書き込む。また分岐履歴情報の
更新を行い、信号線818を通して更新した履歴情報を
分岐履歴バッファ804に書き込む。
In the EX stage, the instruction execution unit 80
The process is performed at 9. The instruction execution unit 809 performs the operation of each instruction and the prediction verification of the conditional branch instruction. Also, the branch history information is updated. If the branch prediction is correct, the branch history information is updated, and the updated history information is written to the branch history buffer 804 via the signal line 818. If the branch prediction is wrong, the correct address is calculated to fetch the correct instruction and written to the PC register 801 through the address line 815. Further, the branch history information is updated, and the updated history information is written to the branch history buffer 804 via the signal line 818.

【0093】MEMステージでは、データキャッシュユ
ニット811において処理が行われる。データキャッシ
ュユニット811では、データの読み出し、及び書き込
みが行われる。
In the MEM stage, processing is performed in the data cache unit 811. The data cache unit 811 reads and writes data.

【0094】WBステージでは、パイプラインレジスタ
812に格納されたデータをデータ線819を通して命
令デコード/レジスタユニット806内のレジスタへの
書き込む。
In the WB stage, data stored in the pipeline register 812 is written to a register in the instruction decode / register unit 806 via a data line 819.

【0095】図3は、実行するプログラムと各ステージ
で処理される命令を、サイクル毎に表形式で示した図で
ある。図3において、aluは演算命令であり、brは
条件付分岐命令である。「br、 100」は条件が成
立するならば命令アドレスに100を加算したアドレス
へ分岐する命令である。分岐命令の最後に付加されてい
る、(NT)、(T)は、条件付分岐命令が成立するか
否かを表し、(T)は分岐が成立することを表し、(N
T)は分岐が不成立であることを表す。
FIG. 3 is a diagram showing a program to be executed and instructions processed in each stage in a table format for each cycle. In FIG. 3, alu is an operation instruction, and br is a conditional branch instruction. “Br, 100” is an instruction that branches to an address obtained by adding 100 to the instruction address if the condition is satisfied. (NT) and (T) added to the end of the branch instruction represent whether or not a conditional branch instruction is taken, (T) represents that a branch is taken, and (N)
T) indicates that the branch is not taken.

【0096】また、これら(分岐の成立/不成立)は、
条件が決定した後に判る分岐の結果であり、分岐履歴バ
ッファ804の情報に基づく分岐予測時のものとは異な
る場合がある。
These (branch taken / not taken) are
This is the result of the branch that is known after the condition is determined, and may be different from that at the time of branch prediction based on information in the branch history buffer 804.

【0097】図1及び図3を参照すると、T1サイクル
において、PCレジスタ801にアドレス400番地が
セットされると、命令キャッシュユニット802内の命
令キャッシュから400番地を先頭とする2命令(40
0番地と404番地)を読み出され、命令バッファ80
5aに格納される。
Referring to FIG. 1 and FIG. 3, when the address 400 is set in the PC register 801 in the T1 cycle, two instructions starting from address 400 from the instruction cache in the instruction cache unit 802 (40
(Addresses 0 and 404) are read out and the instruction buffer 80 is read.
5a.

【0098】400番地の条件付分岐命令は805a1
に、404番地の条件付分岐命令は命令バッファ805
a2に格納される。同時に分岐履歴バッファ804か
ら、PCレジスタ801で指定された400番地を先頭
とする2エントリの履歴情報を読み出し、ヒストリバッ
ファ805cに格納する。ヒストリバッファ805c1
に、「不成立」の履歴情報が、ヒストリバッファ805
c2に「成立」の履歴情報が格納される。すなわち40
0番地の履歴情報が「不成立」であり、404番地の履
歴情報が「成立」である。
The conditional branch instruction at address 400 is 805a1
The conditional branch instruction at address 404 is stored in the instruction buffer 805.
a2. At the same time, two entries of history information starting from address 400 specified by the PC register 801 are read from the branch history buffer 804 and stored in the history buffer 805c. History buffer 805c1
The history information of “not established” is stored in the history buffer 805.
The history information of “established” is stored in c2. That is, 40
The history information at address 0 is “not established”, and the history information at address 404 is “established”.

【0099】アドレス加算器803では、PCレジスタ
801の値400番地に、8を加算し、408番地の値
を得る。この結果をPCレジスタ801へ転送する。
The address adder 803 adds 8 to the value 400 of the PC register 801 to obtain the value of address 408. The result is transferred to the PC register 801.

【0100】次に、T2サイクルにおけるIDステージ
の動作について説明する。
Next, the operation of the ID stage in the T2 cycle will be described.

【0101】命令デコード/レジスタユニット806で
は、命令バッファ805aに格納された400番地と4
04番地の2命令のデコードが行われ、条件付分岐命令
であることが分かる。同時に、分岐予測ユニット807
で、条件付分岐命令の予測を行う。分岐予測は、ヒスト
リバッファ805cに格納された分岐履歴情報に基づき
行われる。
The instruction decode / register unit 806 stores addresses 400 and 4 stored in the instruction buffer 805a.
Decoding of two instructions at address 04 is performed, and it is found that the instruction is a conditional branch instruction. At the same time, branch prediction unit 807
Predicts a conditional branch instruction. Branch prediction is performed based on branch history information stored in the history buffer 805c.

【0102】400番地の条件付分岐命令は「不成立」
の予測がなされる。条件付分岐命令が不成立であるた
め、プログラム・フローは変更されない。
The conditional branch instruction at address 400 is "not taken"
Is predicted. Since the conditional branch instruction is not taken, the program flow is not changed.

【0103】また404番地の条件付分岐命令は「成
立」の予測がなされる。条件付分岐命令が成立するため
プログラム・フローは、命令中に指定された100番地
先の504番地の命令に分岐する。計算されたアドレス
504番地は、アドレス線814を通してPCレジスタ
801に格納される。
The conditional branch instruction at address 404 is predicted to be "taken". Since the conditional branch instruction is satisfied, the program flow branches to the instruction at the address 504, which is the address 100 specified in the instruction. The calculated address 504 is stored in the PC register 801 through the address line 814.

【0104】IFステージでは、408番地と412番
地の命令フェッチが行われる。しかしながら、404番
地の条件付分岐命令が「成立」と予測されたため、フェ
ッチされた命令は、キャンセルされる。
In the IF stage, instruction fetches at addresses 408 and 412 are performed. However, the fetched instruction is canceled because the conditional branch instruction at address 404 is predicted to be “taken”.

【0105】次にT3サイクルにおけるEXステージの
動作について説明する。命令実行ユニット809では4
00番地と404番地の条件付分岐命令の予測検証が行
われる。400番地の条件付分岐命令の分岐は「不成
立」であり、予測が正しいためプログラム・フローの変
更は行われない。404番地の条件付分岐命令の分岐は
「成立」であり、予測は正しかったことになる。この場
合、分岐履歴情報が更新され、信号線818を通して分
岐履歴バッファ804に書き込まれる。
Next, the operation of the EX stage in the T3 cycle will be described. 4 in the instruction execution unit 809
Prediction verification of conditional branch instructions at addresses 00 and 404 is performed. The branch of the conditional branch instruction at address 400 is "not taken" and the program flow is not changed because the prediction is correct. The branch of the conditional branch instruction at address 404 is "taken", and the prediction was correct. In this case, the branch history information is updated and written to the branch history buffer 804 via the signal line 818.

【0106】IFステージでは、T3サイクルで予測さ
れた504番地を先頭とする2命令のフェッチが行われ
る。
In the IF stage, two instructions are fetched starting from the address 504 predicted in the T3 cycle.

【0107】T4サイクルにおいて、400番地と40
4番地の条件付分岐命令は、MEMステージの処理が行
われる。
In the T4 cycle, addresses 400 and 40
The conditional branch instruction at address 4 is processed in the MEM stage.

【0108】IFステージでは、PCレジスタ801に
は、T3サイクルで命令実行ユニット809で計算され
たアドレス512番地が格納されている。512番地と
516番地の2つの命令が命令キャッシュユニット80
2から読み出される。T4サイクルで、504番地と5
08番地の2つの命令がIDステージでデコードされ
る。
In the IF stage, the PC register 801 stores the address 512 calculated by the instruction execution unit 809 in the T3 cycle. Two instructions at addresses 512 and 516 are stored in the instruction cache unit 80.
2 is read. 504 and 5 in T4 cycle
Two instructions at address 08 are decoded in the ID stage.

【0109】本実施例では、分岐履歴バッファ804の
1ラインに、複数の条件付分岐命令の履歴情報を命令キ
ャッシュの1ラインに対応して格納し、命令フェッチ時
にこれら複数の履歴情報を読み出し、参照することによ
って、従来の方式ではできなかった複数の条件付分岐命
令の予測を可能としている。
In this embodiment, the history information of a plurality of conditional branch instructions is stored in one line of the branch history buffer 804 corresponding to one line of the instruction cache, and the plurality of pieces of history information are read out at the time of instruction fetch. The reference makes it possible to predict a plurality of conditional branch instructions which cannot be performed by the conventional method.

【0110】[実施例2]本発明の第2の実施例につい
て説明する。図4は、本発明の第2の実施例の構成を示
すブロック図である。図4を参照すると、本発明の第2
の実施例は、パイプラインレジスタ1101、命令キャ
ッシュ1102、分岐履歴バッファ1103、プロセッ
サ1104a、1104bを備えて構成される。各プロ
セッサ1104a、1104bは、スーパースカラ方式
のマイクロプロセッサであり、1サイクルで2命令の処
理を行うことができる。
[Embodiment 2] A second embodiment of the present invention will be described. FIG. 4 is a block diagram showing the configuration of the second exemplary embodiment of the present invention. Referring to FIG. 4, a second embodiment of the present invention is shown.
The embodiment includes a pipeline register 1101, an instruction cache 1102, a branch history buffer 1103, and processors 1104a and 1104b. Each of the processors 1104a and 1104b is a super scalar type microprocessor, and can process two instructions in one cycle.

【0111】これらの命令キャッシュユニット1102
及び分岐履歴バッファ1103へのアクセスは、前記第
1の実施例と同様、パイプラインレジスタ1101で指
定される共通のアドレスである。
These instruction cache units 1102
Access to the branch history buffer 1103 is a common address specified by the pipeline register 1101, as in the first embodiment.

【0112】また、命令キャッシュユニット1102及
び分岐履歴バッファ1103は2つのプロセッサ間共有
のリソースであり、図13に示した従来のプロセッサと
同様に、パイプラインレジスタ1101は、1つのアド
レスのみを指定するため、1つのプロセッサが、命令キ
ャッシュユニット1102及び分岐履歴バッファ110
3へアクセスしているサイクルでは、他方のプロセッサ
がこれら共有のリソースにアクセスすることはできな
い。
The instruction cache unit 1102 and the branch history buffer 1103 are resources shared by two processors, and the pipeline register 1101 specifies only one address, as in the conventional processor shown in FIG. Therefore, one processor can execute the instruction cache unit 1102 and the branch history buffer 110
In the cycle accessing 3, the other processor cannot access these shared resources.

【0113】2命令発行のスーパースカラ方式のプロセ
ッサを2つ並列に接続していることから、命令キャッシ
ュユニット1102では、命令キャッシュから1サイク
ルで4命令をフェッチし、命令バッファ1106a又は
1106bに格納する。
Since two super scalar processors that issue two instructions are connected in parallel, the instruction cache unit 1102 fetches four instructions from the instruction cache in one cycle and stores them in the instruction buffer 1106a or 1106b. .

【0114】これによりそれぞれのプロセッサ1104
a、1104bへの命令供給能力をあげる。
As a result, each processor 1104
a) Increase the ability to supply instructions to 1104b.

【0115】また分岐履歴バッファ1103からは4命
令分の分岐履歴情報を読み出し、ヒストリバッファ11
06aまたは1106bに格納する。
The branch history information for four instructions is read from the branch history buffer 1103, and the history buffer 11
06a or 1106b.

【0116】プロセッサ1104a、1104bは、P
Cレジスタ1105a、1105b、命令デコード/レ
ジスタユニット1108a、1108b、分岐予測ユニ
ット1109a、1109b、命令実行ユニット111
1a、1111b、データキャッシュユニット1113
a、1113b、命令バッファ1106a、1106
b、ヒストリバッファ1107a、1107bを備えて
構成される。
The processors 1104 a and 1104 b
C registers 1105a and 1105b, instruction decode / register units 1108a and 1108b, branch prediction units 1109a and 1109b, and instruction execution unit 111
1a, 1111b, data cache unit 1113
a, 1113b, instruction buffers 1106a, 1106
b, history buffers 1107a and 1107b.

【0117】図5は、図4の命令キャッシュユニット1
102、分岐予測バッファ1103、及びパイプライン
レジスタ1106a、1106b、1107a、110
7bの構成を示すブロック図である。
FIG. 5 shows the instruction cache unit 1 of FIG.
102, a branch prediction buffer 1103, and pipeline registers 1106a, 1106b, 1107a, 110
It is a block diagram which shows the structure of 7b.

【0118】図5を参照すると、命令キャッシュユニッ
ト1102の1ライン1201は、エントリ1201
a、1201b、1201c、1201d、1201
e、1201fを備え、計8つの命令を格納する。分岐
履歴バッファ1103の1ラインは、分岐履歴情報を8
エントリ1202a、1202b、1202c、120
2d、1202e、1202fを持つ。
Referring to FIG. 5, one line 1201 of instruction cache unit 1102 has entry 1201
a, 1201b, 1201c, 1201d, 1201
e, 1201f, and stores a total of eight instructions. One line of the branch history buffer 1103 stores 8 pieces of branch history information.
Entries 1202a, 1202b, 1202c, 120
2d, 1202e, and 1202f.

【0119】各プロセッサ毎に用意された命令バッファ
1106a、1106bにはそれぞれ4命令を格納する
ことができ、ヒストリバッファ1107a、1107b
には、4分岐履歴情報を格納することができる。
The instruction buffers 1106a and 1106b prepared for each processor can store four instructions, respectively, and the history buffers 1107a and 1107b
Can store 4-branch history information.

【0120】図4及び図5を参照して、本発明の第2の
実施例の動作について説明する。パイプラインレジスタ
1101には、各プロセッサ1104a、1104bか
らアドレスが転送される。これらのアドレスからアービ
トレーションにより、選択された唯一つのアドレスがパ
イプラインレジスタ1101に格納される。
The operation of the second embodiment of the present invention will be described with reference to FIGS. The addresses are transferred from the processors 1104a and 1104b to the pipeline register 1101. Only one address selected by arbitration from these addresses is stored in the pipeline register 1101.

【0121】IFステージにおいて、パイプラインレジ
スタ1101により指定されたアドレスにより命令キャ
ッシュ1102及び分岐履歴バッファ1103がアクセ
スされる。
In the IF stage, the instruction cache 1102 and the branch history buffer 1103 are accessed by the address specified by the pipeline register 1101.

【0122】パイプラインレジスタ1101で指定され
るアドレスは唯一つであるため、各サイクルにおいて、
一つのプロセッサのみが、命令キャッシュユニット11
02から命令の供給を受ける。
Since only one address is specified by pipeline register 1101, in each cycle,
Only one processor has instruction cache unit 11
02 is supplied with an instruction.

【0123】命令キャッシュユニット1102から読み
出された4命令は、パイプラインレジスタ1101のア
ドレスを決定したプロセッサの命令バッファに格納され
る。また、分岐履歴バッファ1103から読み出された
4エントリの分岐履歴情報は同じプロセッサのヒストリ
バッファに格納される。
The four instructions read from the instruction cache unit 1102 are stored in the instruction buffer of the processor that has determined the address of the pipeline register 1101. Also, the branch history information of four entries read from the branch history buffer 1103 is stored in the history buffer of the same processor.

【0124】図6は、本発明の第2の実施例において、
実行プログラムと各サイクルでの処理を表形式で示した
図であり、図6(a)に、プロセッサ1(1104
a)、図6(b)に、プロセッサ2(1104b)の処
理ステージが示されている。
FIG. 6 shows a second embodiment of the present invention.
FIG. 6A is a diagram showing, in a table form, an execution program and processing in each cycle, and FIG.
6A shows the processing stages of the processor 2 (1104b).

【0125】パイプラインレジスタ1101には、プロ
セッサ1(1104a)により決定された400番地の
アドレスがセットされている。命令キャッシュユニット
1102内の命令キャッシュ1201eに400番地の
命令が格納されている。
The address of the address 400 determined by the processor 1 (1104a) is set in the pipeline register 1101. The instruction at address 400 is stored in the instruction cache 1201e in the instruction cache unit 1102.

【0126】T1サイクルにおいて、パイプラインレジ
スタ1101で指定されたアドレスにより命令キャッシ
ュからは400番地の命令を先頭とする4命令(40
0、404、408、412番地)が読み出され、プロ
セッサ1(1104a)の命令バッファ1106aに格
納され、分岐履歴バッファ1103からは400番地の
命令の分岐履歴情報を先頭とする4情報が読み出され、
プロセッサ1(1104a)のヒストリバッファ110
7aに格納される。
In the T1 cycle, the instruction specified by the pipeline register 1101 causes the instruction cache to read four instructions (40 instructions starting with the instruction at address 400).
0, 404, 408, and 412) are stored in the instruction buffer 1106a of the processor 1 (1104a). From the branch history buffer 1103, four pieces of information starting from the branch history information of the instruction at the address 400 are read. And
History buffer 110 of processor 1 (1104a)
7a.

【0127】命令キャッシュの1201eに格納されて
いる400番地の命令は命令バッファ1106a1へ、
1201fに格納されている404番地の命令は命令バ
ッファ1106a2へ、1201gに格納されている4
08番地の命令は命令バッファ1106a3へ、120
2hに格納されている412番地の命令は命令バッファ
1106a4へと読み出される。
The instruction at address 400 stored in the instruction cache 1201e is stored in the instruction buffer 1106a1.
The instruction at address 404 stored in 1201f is stored in the instruction buffer 1106a2 and stored in the instruction buffer 1106a2.
The instruction at address 08 is sent to instruction buffer 1106a3,
The instruction at address 412 stored in 2h is read out to the instruction buffer 1106a4.

【0128】分岐履歴バッファ1103の1202eに
格納されている400番地の分岐履歴情報は、ヒストリ
バッファ1107a1へ、1202fに格納されている
404番地の分岐履歴情報はヒストリバッファ1107
a2へ、1202gに格納されている404番地の分岐
履歴情報はヒストリバッファ1107a3へ、1202
hに格納されている404番地の分岐履歴情報はヒスト
リバッファ1107a4へ読み出される。
The branch history information at address 400 stored in 1202e of the branch history buffer 1103 is sent to the history buffer 1107a1, and the branch history information at address 404 stored at 1202f is sent to the history buffer 1107.
a2, the branch history information at address 404 stored in 1202g is sent to the history buffer 1107a3,
The branch history information at address 404 stored in h is read out to the history buffer 1107a4.

【0129】T2サイクルにおいて、プロセッサ1(1
104a)は、PCレジスタ1105に400番地を保
持している。
In the T2 cycle, the processor 1 (1
104a) holds the address 400 in the PC register 1105.

【0130】命令バッファ1106aに読み出された4
00番地と404番地の命令をデコードする。また、同
時に、ヒストリバッファ1107aに格納されたこれら
の分岐履歴情報に基づき分岐予測を行う。
4 read to the instruction buffer 1106a
The instructions at addresses 00 and 404 are decoded. At the same time, branch prediction is performed based on the branch history information stored in the history buffer 1107a.

【0131】ここで400番地の条件付分岐命令は「不
成立」と予測され、404番地の条件付分岐命令は「成
立」と予測される。
Here, the conditional branch instruction at address 400 is predicted as “not taken”, and the conditional branch instruction at address 404 is predicted as “taken”.

【0132】条件付分岐命令が「不成立」である場合に
は、プログラム・フローは変更されない。404番地の
条件付分岐命令が「成立」と予測されたため、プログラ
ム・フローは、404番地の命令内で指定された100
番地先の504番地の命令に分岐する。すなわち、プロ
グラムフロー変更に伴い、408番地、408番地の命
令がキャンセルされる。
If the conditional branch instruction is "not taken", the program flow is not changed. Since the conditional branch instruction at address 404 was predicted to be "taken", the program flow proceeds to the 100th instruction specified in the instruction at address 404.
Branch to the instruction at address 504 at the address. In other words, the instructions at addresses 408 and 408 are canceled with the change in the program flow.

【0133】同じT2サイクルにおいて、パイプライン
レジスタ1101はプロセッサ2により決定されたアド
レス384番地を保持している。このアドレスを先頭と
する4命令を、命令キャッシュ1102からプロセッサ
2(1104b)の命令バッファ1106bに読み出
す。
In the same T2 cycle, the pipeline register 1101 holds the address 384 determined by the processor 2. The four instructions starting with this address are read from the instruction cache 1102 to the instruction buffer 1106b of the processor 2 (1104b).

【0134】また分岐履歴バッファ1103から分岐履
歴情報をヒストリバッファ1107bに読み出す。
The branch history information is read from the branch history buffer 1103 to the history buffer 1107b.

【0135】T3サイクルにおいて404番地の条件付
分岐命令の予測に従い504番地を先頭とする4命令
が、命令キャッシュ1102から読み出されプロセッサ
1(1104a)の命令バッファ1106aに格納され
る。
In the T3 cycle, four instructions starting at address 504 are read from the instruction cache 1102 and stored in the instruction buffer 1106a of the processor 1 (1104a) according to the prediction of the conditional branch instruction at address 404.

【0136】EXステージでは、400番地と404番
地が命令実行ユニット1111aにおいて処理される。
400番地の条件付分岐命令は「不成立」で予測が正し
いが、404番地の条件付分岐命令は「不成立」であ
り、予測が間違っていることが検証により分かる。
In the EX stage, addresses 400 and 404 are processed in the instruction execution unit 1111a.
The conditional branch instruction at address 400 is "not taken" and the prediction is correct, but the conditional branch instruction at address 404 is "not taken" and the verification shows that the prediction is wrong.

【0137】このため、このサイクルのIFステージで
読み出された504番地と508番地の2つの命令は、
キャンセルされる。また400番地、404番地の分岐
履歴情報は更新される。すなわち、2命令とも「不成
立」の履歴情報が、分岐履歴バッファ1103に書き込
まれる。
Therefore, the two instructions at addresses 504 and 508 read in the IF stage of this cycle are:
Canceled. The branch history information at addresses 400 and 404 is updated. That is, the history information of “not established” is written to the branch history buffer 1103 for both instructions.

【0138】一方、プロセッサ2(1104a)では、
T3サイクルにおいて384番地、388番地の命令
が、IDステージで処理される。
On the other hand, in the processor 2 (1104a),
In the T3 cycle, the instructions at addresses 384 and 388 are processed in the ID stage.

【0139】T4サイクルにおいて、プロセッサ1(1
104b)では、400番地、404番地の命令がME
Mステージにおいて処理される。プロセッサ2(110
4b)のEXステージでは、384番地、388番地の
命令の実行が行われ、IDステージでは、392、39
6番地の命令のデコードが行われる。また、IFステー
ジにおいて、400番地を先頭とする4命令のフェッチ
が行われる。
In cycle T4, processor 1 (1
In 104b), the instructions at addresses 400 and 404 are ME
Processed at M stage. Processor 2 (110
In the EX stage 4b), the instructions at addresses 384 and 388 are executed. In the ID stage, 392 and 39 are executed.
The instruction at the address 6 is decoded. In the IF stage, fetch of four instructions starting from address 400 is performed.

【0140】T5サイクルにおいて、プロセッサ1(1
104a)では、408番地を先頭とする4命令のフェ
ッチが行われる。一方、プロセッサ2(1104b)で
は、400番地と404番地の条件付分岐命令の予測が
行われる。ヒストリバッファに読み出された分岐履歴情
報により、400番地は「不成立」、また404番地も
T3サイクルで更新された「不成立」の履歴情報に基づ
き、プログラム・フローは変更されずに実行される。
In cycle T5, processor 1 (1
In 104a), fetch of four instructions starting from address 408 is performed. On the other hand, the processor 2 (1104b) predicts conditional branch instructions at addresses 400 and 404. Based on the branch history information read into the history buffer, the program flow is executed without being changed, based on the history information of "not taken" at address 400 and "not taken" updated at address 404 in the T3 cycle.

【0141】このように本発明の第2の実施例では、複
数のプロセッサを持つ情報処理装置において、プロセッ
サ間で分岐履歴バッファを共有し、複数の命令の分岐履
歴情報を一度に読み出す構成とされており、このため、
複数の分岐命令を例えば同一サイクル内で予測すること
ができる。
As described above, in the second embodiment of the present invention, in an information processing apparatus having a plurality of processors, a branch history buffer is shared between processors, and branch history information of a plurality of instructions is read at a time. Because of this,
A plurality of branch instructions can be predicted, for example, in the same cycle.

【0142】また同一の条件付分岐命令を複数のプロセ
ッサで実行した場合、複数のプロセッサ間で履歴情報を
共有化することにより、予測のヒット率を向上すること
ができる。
When the same conditional branch instruction is executed by a plurality of processors, by sharing the history information among the plurality of processors, the prediction hit rate can be improved.

【0143】従来のプロセッサ毎個別に設けられた分岐
履歴バッファと比べ、本発明の第2の実施例では、分岐
履歴バッファを共有リソースとし、ハードウェア量を増
やすことなく、各プロセッサが使用できる情報量を増加
することが可能となる。
In comparison with the conventional branch history buffer individually provided for each processor, in the second embodiment of the present invention, the branch history buffer is used as a shared resource, and information which can be used by each processor without increasing the amount of hardware. It is possible to increase the amount.

【0144】[実施例3]次に本発明の第3の実施例に
ついて説明する。図7は、本発明の第3の実施例の構成
を示すブロック図であり、2ウエイセットアソシアティ
ブ方式で構成された分岐履歴バッファの構成を示してい
る。図7を参照すると、分岐履歴バッファは、2つのブ
ロック1402a、1402bから構成されている。各
ブロック1402a、1402bは、分岐履歴情報のア
ドレスの一部を持つタグバッファ1403a、1403
bと、分岐履歴情報を格納するバッファ1404a、1
404bを備えている。バッファ1405は、命令デコ
ードの際に、その命令のアドレスを格納するためのもの
である。
[Embodiment 3] Next, a third embodiment of the present invention will be described. FIG. 7 is a block diagram showing a configuration of the third embodiment of the present invention, and shows a configuration of a branch history buffer configured by a two-way set associative system. Referring to FIG. 7, the branch history buffer includes two blocks 1402a and 1402b. Each block 1402a, 1402b has a tag buffer 1403a, 1403 having a part of the address of the branch history information.
b and buffers 1404a, 1404 storing branch history information.
404b. The buffer 1405 is for storing the address of the instruction when decoding the instruction.

【0145】ヒストリバッファ1406a、1406b
は、分岐履歴バッファ1402a、1402bから読み
出した履歴情報とタグを格納するためのパイプラインレ
ジスタである。なお、タグ情報は、アドレスの所定の下
位ビットが用いられ、分岐履歴バッファの各エントリに
付加情報(タグ)として格納される。
History buffers 1406a and 1406b
Is a pipeline register for storing history information and tags read from the branch history buffers 1402a and 1402b. The tag information uses predetermined lower bits of the address, and is stored as additional information (tag) in each entry of the branch history buffer.

【0146】コンパレータ1407は、ヒストリバッフ
ァ1406a、1406bのタグ情報とバッファ140
5の値を比較する。
The comparator 1407 stores the tag information of the history buffers 1406a and 1406b and the buffer 140
Compare the value of 5.

【0147】マルチプレクサ1408は、コンパレータ
1407の比較結果を選択制御信号として、2つのブロ
ックから読み出された分岐情報を選択する。バッファ1
405は、分岐命令のアドレスを格納する。
The multiplexer 1408 selects the branch information read from the two blocks using the comparison result of the comparator 1407 as a selection control signal. Buffer 1
Reference numeral 405 stores the address of the branch instruction.

【0148】本発明の第3の実施例の動作について説明
する。分岐履歴バッファ1402a、1402bの読み
出しは、IFステージにおいて行われる。読み出された
情報はパイプラインレジスタ1406a、1406bに
格納され、IDステージで、コンパレータ1407に
て、条件付分岐命令のアドレスとタグ情報とが比較され
た後、条件付分岐命令の予測に使用される。
The operation of the third embodiment of the present invention will be described. Reading of the branch history buffers 1402a and 1402b is performed in the IF stage. The read information is stored in pipeline registers 1406a and 1406b, and in the ID stage, the address of the conditional branch instruction is compared with the tag information by the comparator 1407, and is used for predicting the conditional branch instruction. You.

【0149】IFステージにおいて、命令キャッシュか
らの命令フェッチと同時に分岐履歴バッファからは、条
件付分岐命令の分岐履歴情報が読み出される。
At the IF stage, the branch history information of the conditional branch instruction is read from the branch history buffer simultaneously with the instruction fetch from the instruction cache.

【0150】命令フェッチを行う命令のアドレスは、P
Cレジスタ1401に格納されている。
The address of the instruction for performing the instruction fetch is P
It is stored in the C register 1401.

【0151】PCレジスタ1401で指定されたエント
リの分岐履歴情報とタグが各ブロック1402a、14
02bから読み出され、ヒストリバッファ1406a、
1406bにそれぞれ格納される。
The branch history information and the tag of the entry specified by the PC register 1401 are stored in each of the blocks 1402a and 1402.
02b, and read from the history buffer 1406a,
1406b.

【0152】IDステージにおいて、命令キャッシュか
らフェッチされた命令が条件付分岐命令だった場合に
は、不図示の分岐予測ユニットにおいて分岐予測がなさ
れる。
In the ID stage, if the instruction fetched from the instruction cache is a conditional branch instruction, a branch prediction unit (not shown) performs branch prediction.

【0153】バッファ1405のアドレスと、ヒストリ
バッファの分岐情報のタグ1406a、1406bをコ
ンパレータ1407で比較し、タグが一致した場合に
は、一致したブロック方の分岐履歴情報を、マルチプレ
クサ1408で選択し、条件付分岐命令の予測に用い
る。
The address of the buffer 1405 is compared with the tags 1406a and 1406b of the branch information of the history buffer by the comparator 1407. If the tags match, the branch history information of the matched block is selected by the multiplexer 1408. Used for predicting conditional branch instructions.

【0154】本発明の第3の実施例は、1サイクルで複
数の命令をフェッチする情報処理装置において、分岐履
歴バッファから1サイクルに複数の分岐履歴情報を読み
出すことができ、フェッチした命令列中の複数の条件付
分岐命令の予測を行うことを可能とする。
According to the third embodiment of the present invention, in an information processing apparatus that fetches a plurality of instructions in one cycle, a plurality of pieces of branch history information can be read from a branch history buffer in one cycle. Can be predicted for a plurality of conditional branch instructions.

【0155】また、タグにアドレス情報を持つことによ
り、分岐履歴情報と分岐命令の関連性が明確となり、こ
のため異なる分岐命令の情報が予測に用いられるという
事態の発生を防ぎ、分岐予測時の予測のヒット率を向上
することができる。
Also, by having address information in the tag, the relationship between the branch history information and the branch instruction is clarified, so that the occurrence of a situation in which information of different branch instructions is used for prediction is prevented, and The prediction hit rate can be improved.

【0156】[0156]

【発明の効果】以上説明したように、本発明によれば下
記記載の効果を奏する。
As described above, according to the present invention, the following effects can be obtained.

【0157】本発明の第1の効果は、複数の条件付分岐
命令の分岐予測を行うことができ、分岐予測のヒット率
を向上し、処理性能を向上する、ということである。並
列度が増加した情報処理装置においては1サイクルで複
数の条件付分岐命令を処理する必要が生じる。従来の情
報処理装置においては、複数の条件付分岐命令を予測す
ることが出来なかったが、本発明は、この問題を解決し
ている。
A first effect of the present invention is that branch prediction of a plurality of conditional branch instructions can be performed, and the hit rate of branch prediction is improved, thereby improving processing performance. In an information processing device having an increased degree of parallelism, it is necessary to process a plurality of conditional branch instructions in one cycle. In a conventional information processing apparatus, a plurality of conditional branch instructions could not be predicted, but the present invention has solved this problem.

【0158】また情報処理装置において性能向上のため
には条件分岐命令の予測ヒット率をあげることが必須で
ある。本発明によれば、複数の条件付分岐命令の予測が
可能となることにより予測できない条件付分岐命令をな
くすことができ、予測のヒット率の向上が望める。
In order to improve the performance of the information processing apparatus, it is essential to increase the prediction hit rate of the conditional branch instruction. According to the present invention, since a plurality of conditional branch instructions can be predicted, unpredictable conditional branch instructions can be eliminated, and an improvement in prediction hit rate can be expected.

【0159】本発明の第2の効果は、同一の条件付分岐
命令を複数のプロセッサで実行した場合、複数のプロセ
ッサで分岐履歴バッファを共有することにより、さらに
予測のヒット率を向上することができる、ということで
ある。
A second effect of the present invention is that, when the same conditional branch instruction is executed by a plurality of processors, a plurality of processors share a branch history buffer, thereby further improving the prediction hit ratio. It is possible.

【0160】本発明の第3の効果は、分岐履歴バッファ
を共有とすることにより、ハードウェア量を増やすこと
なく、各プロセッサが使用する履歴情報量を増やすこと
ができる、ということである。
A third effect of the present invention is that by sharing the branch history buffer, the amount of history information used by each processor can be increased without increasing the amount of hardware.

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

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

【図2】本発明の第1の実施例の詳細構成を示すブロッ
ク図である。。
FIG. 2 is a block diagram showing a detailed configuration of the first embodiment of the present invention. .

【図3】本発明の第1の実施例の分岐予測動作を説明す
るための図であり、プログラムと各ステージで処理され
る命令を示す図である。
FIG. 3 is a diagram for explaining a branch prediction operation according to the first embodiment of the present invention, and is a diagram showing a program and instructions processed in each stage.

【図4】本発明の第2の実施例の構成を示すブロック図
である。
FIG. 4 is a block diagram showing a configuration of a second exemplary embodiment of the present invention.

【図5】本発明の第2の実施例の詳細構成を示すブロッ
ク図である。。
FIG. 5 is a block diagram showing a detailed configuration of a second embodiment of the present invention. .

【図6】本発明の第2の実施例の分岐予測動作を説明す
るための図であり、プログラムと各ステージで処理され
る命令を示す図である。
FIG. 6 is a diagram for explaining a branch prediction operation according to the second embodiment of the present invention, and is a diagram illustrating a program and instructions processed in each stage.

【図7】本発明の第3の実施例の構成を示すブロック図
である。
FIG. 7 is a block diagram showing a configuration of a third exemplary embodiment of the present invention.

【図8】パイプライン処理の動作原理を説明するための
図である。
FIG. 8 is a diagram for explaining the operation principle of pipeline processing.

【図9】パイプライン方式マイクロプロセッサの構成の
一例を示すブロック図である。
FIG. 9 is a block diagram illustrating an example of a configuration of a pipelined microprocessor.

【図10】分岐予測ユニットを有するマイクロプロセッ
サの構成の一例を示すブロック図である。
FIG. 10 is a block diagram illustrating an example of a configuration of a microprocessor having a branch prediction unit.

【図11】分岐履歴バッファを有するマイクロプロセッ
サの構成の一例を示すブロック図である。
FIG. 11 is a block diagram illustrating an example of a configuration of a microprocessor having a branch history buffer.

【図12】複数のプロセッサを並列接続した従来の情報
処理装置の構成の一例を示すブロック図である。
FIG. 12 is a block diagram illustrating an example of a configuration of a conventional information processing device in which a plurality of processors are connected in parallel.

【図13】分岐予測機構を有し、オンチップマルチプロ
セッサにおける共有キャッシュを有する、従来の情報処
理装置の構成の一例を示すブロック図である。
FIG. 13 is a block diagram showing an example of a configuration of a conventional information processing apparatus having a branch prediction mechanism and having a shared cache in an on-chip multiprocessor.

【図14】スーパースカラ方式のマイクロプロセッサの
構成の一例を示すブロック図である。
FIG. 14 is a block diagram illustrating an example of a configuration of a superscalar microprocessor.

【符合の説明】[Description of sign]

201 PCレジスタ 202 命令キャッシュユニット 203 命令デコード/レジスタユニット 204 命令実行ユニット 205 データキャッシュユニット 206 アドレス加算器 207 パイプラインレジスタ 208 パイプラインレジスタ 209 パイプラインレジスタ 210 パイプラインレジスタ 211 データ線 212 データ線 213 アドレス線 301 PCレジスタ 302 命令キャッシュユニット 303 命令デコード/レジスタユニット 304 命令実行ユニット 305 データキャッシュユニット 306 アドレス加算器 307 パイプラインレジスタ 308 パイプラインレジスタ 309 パイプラインレジスタ 310 パイプラインレジスタ 311 アドレス線 312 分岐予測ユニット 313 アドレス線 401 PCレジスタ 402 命令キャッシュユニット 403 命令デコード/レジスタユニット 404 命令実行ユニット 405 データキャッシュユニット 406 アドレス加算器 407 パイプラインレジスタ 408 パイプラインレジスタ 409 パイプラインレジスタ 410 パイプラインレジスタ 411 アドレス線 412 分岐予測ユニット 413 アドレス線 414 分岐履歴バッファ 415 アドレス線 416 信号線 501 外部バス 502a プロセッサa 502b プロセッサb 503a PCレジスタ 503b PCレジスタ 504a 命令キャッシュユニット 504b 命令キャッシュユニット 505a アドレス加算器 505b アドレス加算器 506a 分岐履歴バッファ 506b 分岐履歴バッファ 507a 命令デコード/レジスタユニット 507b 命令デコード/レジスタユニット 508a 分岐予測ユニット 508b 分岐予測ユニット 509a 命令実行ユニット 509b 命令実行ユニット 510a データキャッシュユニット 510b データキャッシュユニット 511a パイプラインレジスタ 511b パイプラインレジスタ 512a パイプラインレジスタ 512b パイプラインレジスタ 513a パイプラインレジスタ 513b パイプラインレジスタ 514a パイプラインレジスタ 514b パイプラインレジスタ 601 パイプラインレジスタ 602 命令キャッシュユニット 603a プロセッサa 603b プロセッサb 604a PCレジスタ 604b PCレジスタ 605a パイプラインレジスタ 605b パイプラインレジスタ 606a アドレス加算器 606b アドレス加算器 607a 命令デコード/レジスタユニット 607b 命令デコード/レジスタユニット 608a 分岐予測ユニット 608b 分岐予測ユニット 609a パイプラインレジスタ 609b パイプラインレジスタ 610a 命令実行ユニット 610b 命令実行ユニット 611a パイプラインレジスタ 611b パイプラインレジスタ 612a データキャッシュユニット 612b データキャッシュユニット 613a パイプラインレジスタ 613b パイプラインレジスタ 701 PCレジスタ 702 命令キャッシュユニット 703 アドレス加算器 704 分岐履歴バッファ 705 パイプラインレジスタ 706 命令デコード/レジスタユニット 707 分岐予測ユニット 708 パイプラインレジスタ 709 命令実行ユニット 709a 演算器 709b 演算器 710 パイプラインレジスタ 711 データキャッシュユニット 712 パイプラインレジスタ 801 PCレジスタ 802 命令キャッシュユニット 803 アドレス加算器 804 分岐履歴バッファ 805a 命令バッファ 805b パイプラインレジスタ 805c ヒストリバッファ 806 命令デコード/レジスタユニット 807 分岐予測ユニット 808 パイプラインレジスタ 809 命令実行ユニット 810 パイプラインレジスタ 811 データキャッシュユニット 812 パイプラインレジスタ 813 アドレス線 814 アドレス線 815 アドレス線 816 信号線 817 信号線 818 信号線 819 データ線 901 命令キャッシュ内ライン 902 分岐履歴バッファ内ライン 1101 パイプラインレジスタ 1102 命令キャッシュユニット 1103 分岐履歴バッファ 1104a プロセッサa 1104b プロセッサb 1105a PCレジスタ 1105b PCレジスタ 1106a 命令バッファ 1106b 命令バッファ 1107a ヒストリバッファ 1107b ヒストリバッファ 1108a 命令デコード/レジスタユニット 1108b 命令デコード/レジスタユニット 1109a 分岐予測ユニット 1109b 分岐予測ユニット 1110a パイプラインレジスタ 1110b パイプラインレジスタ 1111a 命令実行ユニット 1111b 命令実行ユニット 1112a パイプラインレジスタ 1112b パイプラインレジスタ 1113a データキャッシュユニット 1113b データキャッシュユニット 1114a パイプラインレジスタ 1114b パイプラインレジスタ 1201 命令キャッシュ内ライン 1202 分岐履歴バッファ内ライン 1401 PCレジスタ 1402a 分岐履歴バッファ内ブロック 1402b 分岐履歴バッファ内ブロック 1403a タグバッファ 1403b タグバッファ 1404a 履歴バッファ 1404b 履歴バッファ 1405 アドレスバッファ 1406a ヒストリバッファ 1406b ヒストリバッファ 1407 コンパレータ 1408 マルチプレクサ 201 PC register 202 Instruction cache unit 203 Instruction decode / register unit 204 Instruction execution unit 205 Data cache unit 206 Address adder 207 Pipeline register 208 Pipeline register 209 Pipeline register 210 Pipeline register 211 Data line 212 Data line 213 Address line 301 PC register 302 Instruction cache unit 303 Instruction decode / register unit 304 Instruction execution unit 305 Data cache unit 306 Address adder 307 Pipeline register 308 Pipeline register 309 Pipeline register 310 Pipeline register 311 Address line 312 Branch prediction unit 313 Address Line 401 PC Regis 402 instruction cache unit 403 instruction decode / register unit 404 instruction execution unit 405 data cache unit 406 address adder 407 pipeline register 408 pipeline register 409 pipeline register 410 pipeline register 411 address line 412 branch prediction unit 413 address line 414 branch History buffer 415 Address line 416 Signal line 501 External bus 502a Processor a 502b Processor b 503a PC register 503b PC register 504a Instruction cache unit 504b Instruction cache unit 505a Address adder 505b Address adder 506a Branch history buffer 506b Branch history buffer 507a Instruction / Register unit 07b Instruction decode / register unit 508a Branch prediction unit 508b Branch prediction unit 509a Instruction execution unit 509b Instruction execution unit 510a Data cache unit 510b Data cache unit 511a Pipeline register 511b Pipeline register 512a Pipeline register 512b Pipeline register 513a Pipeline register 513b pipeline register 514a pipeline register 514b pipeline register 601 pipeline register 602 instruction cache unit 603a processor a 603b processor b 604a PC register 604b PC register 605a pipeline register 605b pipeline register 606a address adder 6 06b Address adder 607a Instruction decode / register unit 607b Instruction decode / register unit 608a Branch prediction unit 608b Branch prediction unit 609a Pipeline register 609b Pipeline register 610a Instruction execution unit 610b Instruction execution unit 611a Pipeline register 611b Pipeline register 612a Data Cache unit 612b Data cache unit 613a Pipeline register 613b Pipeline register 701 PC register 702 Instruction cache unit 703 Address adder 704 Branch history buffer 705 Pipeline register 706 Instruction decode / register unit 707 Branch prediction unit 708 Pipeline register 709 Instruction actual Unit 709a Operation unit 709b Operation unit 710 Pipeline register 711 Data cache unit 712 Pipeline register 801 PC register 802 Instruction cache unit 803 Address adder 804 Branch history buffer 805a Instruction buffer 805b Pipeline register 805c History buffer 806 Instruction decode / register unit 807 Branch prediction unit 808 Pipeline register 809 Instruction execution unit 810 Pipeline register 811 Data cache unit 812 Pipeline register 813 Address line 814 Address line 815 Address line 816 Signal line 817 Signal line 818 Signal line 819 Data line 901 Instruction cache line 902 Line in branch history buffer 110 1 Pipeline Register 1102 Instruction Cache Unit 1103 Branch History Buffer 1104a Processor a 1104b Processor b 1105a PC Register 1105b PC Register 1106a Instruction Buffer 1106b Instruction Buffer 1107a History Buffer 1107b History Buffer 1108a Instruction Decode / Register Unit 1108b Instruction Decode / register Unit 1108b Prediction unit 1109b branch prediction unit 1110a pipeline register 1110b pipeline register 1111a instruction execution unit 1111b instruction execution unit 1112a pipeline register 1112b pipeline register 1113a data cache unit 1113b data cache unit 11 14a Pipeline Register 1114b Pipeline Register 1201 Instruction Cache Line 1202 Branch History Buffer Line 1401 PC Register 1402a Branch History Buffer Block 1402b Branch History Buffer Block 1403a Tag Buffer 1403b Tag Buffer 1404a History Buffer 1404b History Buffer 1405 Address Buffer 1406a History buffer 1406b History buffer 1407 Comparator 1408 Multiplexer

Claims (19)

【特許請求の範囲】[Claims] 【請求項1】複数の命令を同一サイクルで同時に命令キ
ャッシュから読み出す情報処理装置において、 読み出した複数の命令中の複数の分岐命令について、同
一サイクル内で複数の分岐履歴情報を参照して、それぞ
れの分岐命令の予測を同一サイクル内に行う手段を備え
たことを特徴とする情報処理装置。
An information processing apparatus for simultaneously reading a plurality of instructions from an instruction cache in the same cycle, wherein a plurality of branch instructions among the plurality of read instructions are referred to in a same cycle by a plurality of branch history information, respectively. An information processing apparatus comprising means for performing prediction of a branch instruction in the same cycle.
【請求項2】1ラインに複数の分岐命令の分岐履歴情報
を格納する分岐履歴バッファを有することを特徴とする
請求項1記載の情報処理装置。
2. The information processing apparatus according to claim 1, further comprising a branch history buffer for storing branch history information of a plurality of branch instructions in one line.
【請求項3】命令キャッシュのライン内の命令に対応し
て、1ラインに複数の分岐履歴情報を格納する分岐履歴
バッファを有し、 前記プロセッサ内で実行する複数の分岐命令の予測を行
う、ことを可能としたことを特徴とする請求項1記載の
情報処理装置。
3. A branch history buffer for storing a plurality of pieces of branch history information in one line corresponding to an instruction in a line of an instruction cache, wherein a plurality of branch instructions to be executed in the processor are predicted. 2. The information processing apparatus according to claim 1, wherein the information processing apparatus is capable of performing the following.
【請求項4】複数のプロセッサを含む情報処理装置にお
いて、 分岐命令の予測を行うための手段を前記複数プロセッサ
間で共有することを特徴とする情報処理装置。
4. An information processing apparatus including a plurality of processors, wherein a means for predicting a branch instruction is shared among the plurality of processors.
【請求項5】分岐命令を実行した際の分岐成立/不成立
の履歴、及び、分岐が成立した場合の命令アドレスを格
納する分岐履歴バッファを前記複数プロセッサ間で共有
することを特徴とする請求項4記載の情報処理装置。
5. A branch history buffer for storing a branch taken / not taken history at the time of execution of a branch instruction and an instruction address when a branch is taken is shared by the plurality of processors. 5. The information processing apparatus according to 4.
【請求項6】複数のプロセッサを含む情報処理装置にお
いて、 複数の命令を同一サイクルで同時に命令キャッシュから
読み出すことのできる命令キャッシュユニットを有し、 読み出した複数命令中の複数の分岐命令について、同一
サイクル内に複数の分岐履歴情報を参照し、それぞれの
命令の予測を同一サイクル内に行う手段を備えた、こと
を特徴とする情報処理装置。
6. An information processing apparatus including a plurality of processors, comprising: an instruction cache unit capable of simultaneously reading a plurality of instructions from an instruction cache in the same cycle; An information processing apparatus comprising: means for referring to a plurality of pieces of branch history information in a cycle and predicting each instruction in the same cycle.
【請求項7】1ラインに複数の分岐命令の分岐履歴情報
を格納する分岐履歴バッファを前記複数プロセッサ間で
共有することを特徴とする請求項4乃至6のいずれか一
に記載の情報処理装置。
7. The information processing apparatus according to claim 4, wherein a branch history buffer for storing branch history information of a plurality of branch instructions in one line is shared by the plurality of processors. .
【請求項8】命令キャッシュのライン内の命令に対応し
て、1ラインに複数の分岐履歴情報を格納する分岐履歴
バッファを有し、前記分岐履歴バッファを前記複数プロ
セッサ間で共有し、前記プロセッサ内で実行する複数の
分岐命令の予測を行うことを可能としたことを特徴とす
る請求項4乃至6のいずれか一に記載の情報処理装置。
8. A processor according to claim 1, further comprising a branch history buffer for storing a plurality of pieces of branch history information in one line corresponding to instructions in a line of the instruction cache, wherein said branch history buffer is shared by said plurality of processors. 7. The information processing apparatus according to claim 4, wherein prediction of a plurality of branch instructions to be executed within the apparatus can be performed.
【請求項9】複数の命令を同一サイクルで同時に命令キ
ャッシュから読み出す情報処理装置において、 1ラインに複数の分岐命令の分岐履歴情報が格納される
分岐履歴バッファであって、分岐履歴情報のアドレスの
一部を持つタグを有する1又は複数のブロックと、前記
各ブロックの前記タグのアドレスと条件付分岐命令のア
ドレスとを比較するコンパレータとを含む分岐履歴バッ
ファを備え、 プロセッサで1度にフェッチした命令内の複数の条件付
分岐命令の予測を可能としたことを特徴とする情報処理
装置。
9. An information processing apparatus for simultaneously reading a plurality of instructions from an instruction cache in the same cycle, comprising: a branch history buffer in which one line stores branch history information of a plurality of branch instructions; A branch history buffer including one or more blocks having a tag having a part and a comparator for comparing the address of the tag of each block with the address of a conditional branch instruction; An information processing apparatus, wherein a plurality of conditional branch instructions in an instruction can be predicted.
【請求項10】複数のプロセッサを含む情報処理装置に
おいて、 1ラインに複数の分岐命令の分岐履歴情報が格納される
分岐履歴バッファであって、分岐履歴情報のアドレスの
一部を持つタグを有する1又は複数のブロックと、前記
各ブロックの前記タグのアドレスと条件付分岐命令のア
ドレスとを比較するコンパレータとを含む分岐履歴バッ
ファを備え、 前記複数のプロセッサ間で前記分岐履歴バッファを共有
し、 前記複数のプロセッサ間で実行する全ての分岐命令の予
測を行うことを可能としたことを特徴とする情報処理装
置。
10. An information processing apparatus including a plurality of processors, wherein a branch history buffer for storing branch history information of a plurality of branch instructions in one line, comprising a tag having a part of the address of the branch history information. A branch history buffer including one or a plurality of blocks and a comparator for comparing an address of the tag of each of the blocks and an address of a conditional branch instruction, wherein the plurality of processors share the branch history buffer; An information processing apparatus, wherein prediction of all branch instructions executed among the plurality of processors can be performed.
【請求項11】複数のプロセッサを含む情報処理装置に
おいて、 前記命令キャッシュのライン内の命令に対応して1ライ
ンに複数の分岐履歴情報を格納する分岐履歴バッファを
備え、 複数のプロセッサ間で前記分岐履歴バッファを共有し、 前記複数のプロセッサ内で実行する全ての分岐命令の予
測を行うことを可能とすることを特徴とする情報処理装
置。
11. An information processing apparatus including a plurality of processors, comprising: a branch history buffer for storing a plurality of branch history information in one line corresponding to an instruction in a line of the instruction cache; An information processing apparatus, wherein a branch history buffer is shared, and all branch instructions executed in the plurality of processors can be predicted.
【請求項12】パイプライン方式のプロセッサを含む情
報処理装置において、 複数の命令を同一サイクルで同時に命令キャッシュから
読み出すことのできる命令キャッシュユニットと、 1ラインあたり複数の分岐履歴情報を格納する分岐履歴
バッファとを備え、 前記命令キャッシュからの命令フェッチ時、前記分岐履
歴バッファからも複数の分岐履歴情報を含むラインを読
み出し、前記フェッチした命令中に、複数の条件付分岐
命令が含まれている場合に、前記分岐履歴バッファから
読み出した複数の分岐履歴情報を用いて、前記複数の条
件付分岐命令の各々の分岐予測を行うように構成されて
いる、ことを特徴とする情報処理装置。
12. An information processing apparatus including a pipeline processor, an instruction cache unit capable of simultaneously reading a plurality of instructions from an instruction cache in the same cycle, and a branch history storing a plurality of pieces of branch history information per line. A buffer including a plurality of conditional branch instructions read out from the branch history buffer at the time of fetching an instruction from the instruction cache, wherein the fetched instruction includes a plurality of conditional branch instructions. An information processing apparatus configured to perform a branch prediction of each of the plurality of conditional branch instructions using a plurality of pieces of branch history information read from the branch history buffer.
【請求項13】前記命令キャッシュのライン内のエント
リに、前記分岐履歴バッファのライン内のエントリをそ
れぞれ対応させることで、前記分岐履歴バッファの1ラ
インに含まれる複数の分岐履歴情報を、条件付分岐命令
のアドレスと対応付けたことを特徴とする請求項12記
載の情報処理装置。
13. A plurality of pieces of branch history information included in one line of the branch history buffer can be conditionally associated with an entry in the line of the instruction cache corresponding to an entry in the line of the branch history buffer. 13. The information processing apparatus according to claim 12, wherein the information is associated with a branch instruction address.
【請求項14】前記分岐履歴バッファが、分岐履歴情報
のアドレスの一部を持つタグを含む複数のブロックと、
前記各ブロックについてアクセスされたラインにおける
前記タグのアドレスと条件付分岐命令のアドレスとを比
較するコンパレータとを含むことを特徴とする請求項1
2記載の情報処理装置。
14. A branch history buffer comprising: a plurality of blocks each including a tag having a part of an address of branch history information;
2. A comparator for comparing an address of the tag in a line accessed for each block with an address of a conditional branch instruction.
2. The information processing apparatus according to item 2.
【請求項15】前記コンパレータの比較結果により、条
件付分岐命令のアドレスとタグのアドレスが一致したブ
ロックのラインに含まれる分岐履歴情報がマルチプレク
サから選択出力され、該分岐履歴情報が分岐命令の分岐
予測に用いられる、ことを特徴とする請求項14記載の
情報処理装置。
15. A multiplexer which selectively outputs branch history information included in a line of a block in which the address of a conditional branch instruction matches the address of a tag according to the comparison result of the branch instruction, and stores the branch history information in the branch instruction. The information processing apparatus according to claim 14, which is used for prediction.
【請求項16】パイプライン方式のプロセッサを複数備
えた情報処理装置において、 分岐命令の分岐履歴情報を格納する分岐履歴バッファを
前記複数のプロセッサ間で共有し、 前記プロセッサは、前記複数のプロセッサ間で共有する
命令キャッシュから複数の命令をフェッチする際に、前
記複数の命令の分岐履歴情報を前記分岐履歴バッファか
ら一度に読み出すことにより、前記複数の条件付分岐命
令の予測を可能とし、同一の条件付分岐命令を複数のプ
ロセッサで実行する場合、前記複数のプロセッサ間で分
岐履歴情報を共有可能としたことを特徴とする情報処理
装置。
16. An information processing apparatus provided with a plurality of processors of a pipeline system, wherein a plurality of processors share a branch history buffer for storing branch history information of a branch instruction, When a plurality of instructions are fetched from an instruction cache shared by a plurality of instructions, the branch history information of the plurality of instructions is read out from the branch history buffer at a time, thereby enabling the prediction of the plurality of conditional branch instructions. An information processing apparatus, wherein when a conditional branch instruction is executed by a plurality of processors, branch history information can be shared among the plurality of processors.
【請求項17】パイプライン方式のプロセッサを含む情
報処理装置において、 複数の命令を同一サイクルで同時に命令キャッシュから
読み出すことのできる命令キャッシュユニットと、 複数の分岐履歴情報を格納する分岐履歴バッファと、を
備え、 命令フェッチ(IF)ステージにおいて、前記命令キャ
ッシュユニットでは、PCレジスタで指定されたアドレ
スに従い前記命令キャッシュのラインにアクセスし該ラ
インから複数エントリの命令を読み出して命令バッファ
に格納し、前記PCレジスタで指定されたアドレスに従
い前記分岐履歴バッファのラインにアクセスし、該ライ
ンから前記命令キャッシュのエントリに対応した命令の
分岐履歴情報を複数エントリ読み出してヒストリバッフ
ァに格納し、 命令デコード(ID)ステージにおいて、命令デコード
ユニットでは、前記命令バッファに格納された命令をデ
コードして、条件付分岐命令か否か判定され、判定結果
を分岐予測ユニットに送り、 前記分岐予測ユニットでは、前記命令バッファに格納さ
れた命令が条件付分岐命令であったときに、前記ヒスト
リバッファに格納された分岐履歴情報に基づいて、前記
条件付分岐命令が成立するか否かを予測し、前記条件付
分岐命令の分岐が成立すると予測された場合には、分岐
先のアドレスを計算し計算結果を前記PCレジスタへ転
送し、且つ、分岐予測の結果は命令実行ユニットに送ら
れ、 命令実行(EX)ステージにおいて、前記命令実行ユニ
ットでは、前記条件付分岐命令に関する前記分岐予測ユ
ニットでの分岐予測が正しい場合には、分岐履歴情報を
更新し前記分岐履歴バッファに更新した履歴情報を書き
込み、分岐予測が間違っている場合には、正しい命令を
フェッチするためアドレスを計算して前記PCレジスタ
に書き込むとともに、分岐履歴情報の更新を行い前記更
新した履歴情報を前記分岐履歴バッファに書き込む、こ
とを特徴とする情報処理装置。
17. An information processing apparatus including a pipeline type processor, an instruction cache unit capable of simultaneously reading a plurality of instructions from an instruction cache in the same cycle, a branch history buffer storing a plurality of branch history information, In the instruction fetch (IF) stage, the instruction cache unit accesses a line of the instruction cache according to an address specified by a PC register, reads instructions of a plurality of entries from the line, and stores the instructions in an instruction buffer. Accessing a line of the branch history buffer according to an address specified by a PC register, reading a plurality of entries of branch history information of an instruction corresponding to an entry of the instruction cache from the line, storing the information in a history buffer, and decoding the instruction (ID) On stage In the instruction decoding unit, the instruction stored in the instruction buffer is decoded, and it is determined whether or not the instruction is a conditional branch instruction. The result of the determination is sent to the branch prediction unit. When the stored instruction is a conditional branch instruction, predicting whether or not the conditional branch instruction is taken based on the branch history information stored in the history buffer, If the branch is predicted to be taken, the branch destination address is calculated, the calculation result is transferred to the PC register, and the result of the branch prediction is sent to the instruction execution unit. In the instruction execution (EX) stage, In the instruction execution unit, if the branch prediction in the branch prediction unit for the conditional branch instruction is correct, the branch history information is updated and the branch The updated history information is written to the history buffer, and if the branch prediction is incorrect, the address is calculated to fetch the correct instruction and written to the PC register, and the branch history information is updated to update the updated history information. In the branch history buffer.
【請求項18】パイプライン方式のプロセッサを含む情
報処理装置において、 複数の命令を同一サイクルで同時に命令キャッシュから
読み出すことのできる命令キャッシュユニットと、 複数ブロックよりなり、各ブロックが、一ライン内に分
岐履歴情報のアドレスの一部を持つタグを有する分岐履
歴バッファと、を備え、 命令キャッシュからの命令のフェッチ時において、PC
レジスタで指定されたアドレスに従い前記分岐履歴バッ
ファのエントリにアクセスし、該エントリの分岐履歴情
報をタグアドレスとともに読み出してヒストリバッファ
に格納し、 IDステージにおいて、前記ヒストリバッファのタグア
ドレスと、条件付分岐命令のアドレスと、をコンパレー
タで比較し、一致した方のブロックの分岐履歴情報をマ
ルチプレクサで選択して分岐予測ユニットに送出し、前
記分岐予測ユニットで、分岐履歴情報を前記条件付分岐
命令の分岐予測に用いる、ことを特徴とする情報処理装
置。
18. An information processing apparatus including a pipeline type processor, comprising: an instruction cache unit capable of simultaneously reading a plurality of instructions from an instruction cache in the same cycle; and a plurality of blocks, each block being included in one line. A branch history buffer having a tag having a part of the address of the branch history information.
The branch history buffer entry is accessed in accordance with the address specified by the register, the branch history information of the entry is read out together with the tag address and stored in the history buffer. In the ID stage, the tag address of the history buffer and the conditional branch are read. The address of the instruction is compared with a comparator, the branch history information of the matched block is selected by a multiplexer and sent to the branch prediction unit, and the branch prediction unit converts the branch history information to the conditional branch instruction. An information processing device for use in prediction.
【請求項19】前記分岐履歴バッファが、(a)分岐履
歴情報、(b)分岐履歴情報と分岐成立時のアドレス、
(c)分岐履歴情報と分岐成立時のアドレスと分岐が成
立した場合の成立先の命令のうちの少なくとも一つの形
態を含むことを特徴とする請求項1〜4、6〜18のい
ずれか一に記載の情報処理装置。
19. The branch history buffer includes: (a) branch history information; (b) branch history information and an address at the time of branch establishment;
(C) at least one form of branch history information, an address when the branch is taken, and an instruction at a taken place when the branch is taken. An information processing apparatus according to claim 1.
JP10301841A 1998-10-23 1998-10-23 Branch prediction mechanism Pending JP2000132391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10301841A JP2000132391A (en) 1998-10-23 1998-10-23 Branch prediction mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10301841A JP2000132391A (en) 1998-10-23 1998-10-23 Branch prediction mechanism

Publications (1)

Publication Number Publication Date
JP2000132391A true JP2000132391A (en) 2000-05-12

Family

ID=17901812

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10301841A Pending JP2000132391A (en) 1998-10-23 1998-10-23 Branch prediction mechanism

Country Status (1)

Country Link
JP (1) JP2000132391A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7346737B2 (en) 2004-05-29 2008-03-18 Samsung Electronics Co., Ltd. Cache system having branch target address cache
US7472263B2 (en) 2003-12-05 2008-12-30 Fujitsu Limited Method and apparatus for prediction handling multiple branches simultaneously
JP2013122774A (en) * 2006-09-27 2013-06-20 Qualcomm Inc Method and device for solving simultaneously predicted branch instruction
CN112540792A (en) * 2019-09-23 2021-03-23 阿里巴巴集团控股有限公司 Instruction processing method and device
CN116521577A (en) * 2023-07-03 2023-08-01 太初(无锡)电子科技有限公司 Chip system and method for fast processing instruction cache of branch prediction failure

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7472263B2 (en) 2003-12-05 2008-12-30 Fujitsu Limited Method and apparatus for prediction handling multiple branches simultaneously
US7346737B2 (en) 2004-05-29 2008-03-18 Samsung Electronics Co., Ltd. Cache system having branch target address cache
JP2013122774A (en) * 2006-09-27 2013-06-20 Qualcomm Inc Method and device for solving simultaneously predicted branch instruction
CN112540792A (en) * 2019-09-23 2021-03-23 阿里巴巴集团控股有限公司 Instruction processing method and device
CN116521577A (en) * 2023-07-03 2023-08-01 太初(无锡)电子科技有限公司 Chip system and method for fast processing instruction cache of branch prediction failure
CN116521577B (en) * 2023-07-03 2023-10-13 太初(无锡)电子科技有限公司 Chip system and method for fast processing instruction cache of branch prediction failure

Similar Documents

Publication Publication Date Title
US7793079B2 (en) Method and system for expanding a conditional instruction into a unconditional instruction and a select instruction
US9430235B2 (en) Predicting and avoiding operand-store-compare hazards in out-of-order microprocessors
US9239735B2 (en) Compiler-control method for load speculation in a statically scheduled microprocessor
EP3171264B1 (en) System and method of speculative parallel execution of cache line unaligned load instructions
US20170010967A1 (en) Using l1 cache as re-order buffer
US11132202B2 (en) Cache control circuitry and methods
US9886278B2 (en) Computing architecture and method for processing data
US11900120B2 (en) Issuing instructions based on resource conflict constraints in microprocessor
CN113495758A (en) Method for processing data dependency, microprocessor thereof and data processing system
US9690590B2 (en) Flexible instruction execution in a processor pipeline
US6862676B1 (en) Superscalar processor having content addressable memory structures for determining dependencies
US20220035635A1 (en) Processor with multiple execution pipelines
US9747109B2 (en) Flexible instruction execution in a processor pipeline
JP2000132391A (en) Branch prediction mechanism
US11451241B2 (en) Setting values of portions of registers based on bit values
US20120144174A1 (en) Multiflow method and apparatus for operation fusion
US11422821B1 (en) Age tracking for independent pipelines
US7996655B2 (en) Multiport execution target delay queue FIFO array
US7769987B2 (en) Single hot forward interconnect scheme for delayed execution pipelines
US11347506B1 (en) Memory copy size determining instruction and data transfer instruction
TWI786691B (en) Micro processor and branch processing method
US20240078035A1 (en) Write-back rescheduling
US20240020119A1 (en) Vector processor with extended vector registers
US20170060591A1 (en) System and method for multi-branch switching
Robbins et al. The control section

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20010313