JPS6349844A - Instruction prefetching device - Google Patents

Instruction prefetching device

Info

Publication number
JPS6349844A
JPS6349844A JP19354886A JP19354886A JPS6349844A JP S6349844 A JPS6349844 A JP S6349844A JP 19354886 A JP19354886 A JP 19354886A JP 19354886 A JP19354886 A JP 19354886A JP S6349844 A JPS6349844 A JP S6349844A
Authority
JP
Japan
Prior art keywords
instruction
buffer
address
branch
difference
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
JP19354886A
Other languages
Japanese (ja)
Inventor
Yoshinori Chiwaki
千脇 義憲
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 JP19354886A priority Critical patent/JPS6349844A/en
Publication of JPS6349844A publication Critical patent/JPS6349844A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To carry out an instruction with no delay by extracting a branching destination instruction after producing an instruction buffer address from the difference between a branching destination address and an instruction prefetching address as long as said difference is kept under the capacity of an instruction buffer. CONSTITUTION:A subtractor 8 obtains a difference between the branching destination address of the branch instruction estimated by a branch estimating buffer 6 and a prefetching instruction address. When said difference is smaller than the capacity of an instruction buffer 18, an instruction differential buffer 19 produces the read address of the buffer 18 based on said difference and then reads it out of the buffer 18 since this buffer 18 contains a branching destination instruction. Then an instruction is carried out with no delay.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は命令先取り装置に関し、特に、分岐命令の分岐
先命令が分岐バッファ内にある場合の分岐先命令の先取
シ装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an instruction prefetching device, and more particularly to a prefetching device for a branch destination instruction when the branch destination instruction of a branch instruction is in a branch buffer.

〔従来の技術〕[Conventional technology]

従来この種の命令先取シ装置は、命令バッファ内に分岐
先命令がある場合、命令実行時の分岐先アドレスを用い
て1分岐先アドレスと命令バッファアドレスの対応表等
によう、命令バッファ内にある分岐先命令を取出してい
た。分岐予測バッファを持つ装置は命令バッファ内に分
岐先命令があっても、分岐先命令の先取シを行っていた
。このような予測方式の代表側が特開昭57−2015
55号公報に示されている。
Conventionally, this type of instruction prefetching device uses, when there is a branch destination instruction in the instruction buffer, the branch destination address at the time of execution of the instruction to store the branch destination instruction in the instruction buffer as shown in the correspondence table between one branch destination address and the instruction buffer address. A certain branch destination instruction was being retrieved. Devices with a branch prediction buffer preempt the branch destination instruction even if there is a branch destination instruction in the instruction buffer. A representative example of such a prediction method is Japanese Patent Application Laid-Open No. 57-2015.
It is shown in Publication No. 55.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した従来の命令先取シ装置は、分岐命令の実行時ま
で分岐先アドレスがわからないので、パイプライン計算
機の場合2分岐先命令を遅れなく取シ出す事は難しいと
いう欠点がある。
The above-mentioned conventional instruction prefetching device does not know the branch destination address until the branch instruction is executed, so it has the disadvantage that in the case of a pipeline computer, it is difficult to fetch two branch destination instructions without delay.

また、分岐予測バッファを持つ先取シ装置の場合、分岐
先は既に命令バッファ内にあるにもかかわらず、命令の
先取υを行うので、命令が供給されるまで待たされると
いう欠点がある。
Furthermore, in the case of a prefetching device having a branch prediction buffer, the instruction is prefetched even though the branch destination is already in the instruction buffer, so there is a drawback that the branch must wait until the instruction is supplied.

第4図は、第2図に示すような命令群に対する。FIG. 4 corresponds to a group of instructions as shown in FIG.

分岐予測バッファを持つ装置の命令の先取シと実行との
動作を示している。命令の先取シをD −) A→P 
−) C−) Tステージにより取シ出し、命令の実行
をD−+A→P−+C−+’r−+E→Wステージで行
う。
The operation of prefetching and executing instructions in a device having a branch prediction buffer is shown. Preemption of command D -) A→P
-) C-) The command is fetched in the T stage and the instruction is executed in the D-+A→P-+C-+'r-+E→W stage.

分岐命令TNZがあると1分岐先命令=LD人命令の取
シ出しのため、命令の実行は 待だされることになる。
If there is a branch instruction TNZ, execution of the instruction will be delayed because one branch destination instruction = LD instruction is fetched.

〔問題点を解決するための手段〕[Means for solving problems]

本発明の装置は1分岐命令の分岐先アドレスを予測する
分岐予測バッファを備えた命令先取シ装置において、 分岐予測バッファによυ予測された分岐命令の分岐先ア
ドレスと先取シ用命令アドレスとの差を求める手段と、 この差が命令バッファの容量よシ小さい場合にはその差
を用いて命令バッファの読出しアドレスを作成して分岐
先命令を命令バッファから胱出す手段 とを含むことを特徴とする。
The device of the present invention is an instruction prefetching device equipped with a branch prediction buffer that predicts the branch destination address of one branch instruction, and the instruction prefetching device is configured to combine the branch destination address of the branch instruction predicted by the branch prediction buffer and the preemption instruction address. The present invention is characterized by comprising means for determining the difference, and means for generating a read address of the instruction buffer using the difference when the difference is smaller than the capacity of the instruction buffer to output the branch destination instruction from the instruction buffer. do.

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

第1図は本発明の一実施例を示すブロック図である。FIG. 1 is a block diagram showing one embodiment of the present invention.

第1図において、1は命令解読ステージ(Dステージ)
の命令先取シ用命令カウンタ(DFIC)。
In Figure 1, 1 is the instruction decoding stage (D stage)
instruction prefetch instruction counter (DFIC).

2riDFIC1と命令先取シ用命令カウンタ4とを切
替えるセレクタ、3riセレクタ2の出力を+1する加
(至)器、4は加η、器3とDBIC7の出力を切替え
て保持するAステージの命令先取シ用命令カウンタ(A
EIC)、5はPステージの命令先取シ用命令カウンタ
(PFIC)、6はPFIC5の出力によりヒットした
場合にヒツト信号と分岐先アドレスとを出力する分岐予
測バッファ、ljDステージの分岐アドレスを保持する
分岐先アドレスレジスタ(DBIC)、8はPFICs
の内容と分岐予測バッファ6の分岐先アドレスとの差を
求め命令バッファの容量以内のときにはその差を出力し
、また他のときは+1を出力する減糞:器、1tH−j
ヒツト信号により減算器8の出力と+1とを切替えるセ
レクタ、9はPステージの仮想アドレス(PVA)、1
1riPステージのアドレス差を保持するレジスタ(P
D)、12riCステージのアドレス差を保持するレジ
スタ(CD)、13riTステージのアドレス差を保持
するレジスタ(TD)。
2 is a selector that switches between the DFIC 1 and the instruction counter 4 for instruction prefetching; 3 is an adder that increases the output of the ri selector 2 by 1; 4 is an adder; 4 is an adder; instruction counter (A
EIC), 5 is an instruction counter (PFIC) for instruction preemption of the P stage, 6 is a branch prediction buffer that outputs a hit signal and a branch destination address when a hit occurs due to the output of PFIC 5, and holds the branch address of the ljD stage. Branch destination address register (DBIC), 8 is PFICs
1tH-j which calculates the difference between the contents of the branch prediction buffer 6 and the branch destination address of the branch prediction buffer 6, and outputs the difference if it is within the capacity of the instruction buffer, and outputs +1 in other cases.
A selector that switches between the output of the subtracter 8 and +1 according to the hit signal, 9 is the virtual address (PVA) of the P stage, 1
A register that holds the address difference of 1riP stage (P
D), a register (CD) that holds the address difference of the 12riC stage, and a register (TD) that holds the address difference of the 13riT stage.

14はレジスタ9の出力を人力して実アドレスを出力す
丞アドレス変換バッファ、15ricステージの実アド
レスを保持するレジスタ(CR人)。
14 is an address translation buffer that inputs the output of register 9 and outputs a real address, and 15 is a register (CR) that holds the real address of the ric stage.

16はレジスタ15の出力を人力して命令を出力するキ
ャシュ、−17riTステージの命令を保持するレジス
z(TIR)、18ri4命令を保持する命令バッファ
(IB)、19は命令バッファ18に対応して差を保持
する命令差分バッファ(IBD)。
16 is a cache that outputs instructions by manually inputting the output of the register 15, a register z (TIR) that holds instructions at the -17riT stage, an instruction buffer (IB) that holds 18ri4 instructions, and 19 corresponding to the instruction buffer 18. Instruction Difference Buffer (IBD) to hold differences.

20は命令バッファ18と命令差分バッファ19の書込
みアドレスを与える人力ポインタ(IPNT)。
20 is a manual pointer (IPNT) that provides the write address of the instruction buffer 18 and instruction difference buffer 19;

21は入力ポインタ20の内容を+1する加算器、22
は命令バッファ18と命令差分バッファ19の読出しア
ドレスを与える出力ポインタ(LOPNT )、23r
i命令差分バッファ19の出力により出カポインタ22
を加減算する加減算器、24はDステージの命令を保持
するレジスタ(DIR)である。
21 is an adder that adds 1 to the contents of the input pointer 20; 22
is an output pointer (LOPNT), 23r, which provides the read address of the instruction buffer 18 and instruction difference buffer 19.
The output pointer 22 is set by the output of the i-instruction difference buffer 19.
24 is a register (DIR) that holds D stage instructions.

次に本実施例の動作を示す。Next, the operation of this embodiment will be described.

いま、第2図に示す様に、メモリの内容をAレジスタ(
AREG)にロードするLDA命令と、メモリとARE
Gの各内容を加えるADA命令と。
Now, as shown in Figure 2, the contents of the memory are stored in the A register (
LDA instruction to load into AREG), memory and ARE
and an ADA instruction that adds each content of G.

インデケータがOにならないときに上記のLDA命令に
分岐するTNZ命令と、LDA命令とを実行する場合を
説明する。
A case will be described in which the TNZ instruction, which branches to the above-mentioned LDA instruction when the indicator does not become O, and the LDA instruction are executed.

DPICIの内容は加算器3で+1されて、AFIC4
に入力する。AFIC4の内容は、PFIC5とPDA
9とに入力、さらにPVA9の内容はアドレス変換バッ
ファ14によってアドレス変換され実アドレスとなって
CRA15に保持される。
The contents of DPICI are incremented by 1 in adder 3 and sent to AFIC4.
Enter. The contents of AFIC4 are PFIC5 and PDA
Further, the contents of PVA9 are converted into addresses by the address conversion buffer 14, and are held in the CRA 15 as real addresses.

次に、CRA15によりキャシュ16から命令を取シ出
し、TIR,15を経由してIBI 8の工PNT20
で示されるアドレスに格納する。次に、lB18の、0
PNT22で示されるアドレスから命令を取シ出し、命
令実行の最初のステージのDIR24にセットして命令
を実行する。
Next, the command is retrieved from the cache 16 by the CRA 15, and sent to the IBI 8's PNT 20 via the TIR, 15.
Store at the address indicated by . Next, 0 of lB18
The instruction is taken out from the address indicated by PNT22, set in DIR24 at the first stage of instruction execution, and executed.

分岐命令の場合には、PF’IC5のアドレスで分M 
予測バッファ6をアクセスしてDBIC7に分岐先アド
レスを取シ出してAFIC,iにセットし、分岐先命令
の先取りを行う。
In the case of a branch instruction, the minute M is specified at the address of PF'IC5.
The prediction buffer 6 is accessed to fetch the branch destination address to the DBIC 7 and set in AFIC,i, thereby prefetching the branch destination instruction.

第2図において、TNZ命令がI、DA命令に分岐して
ループする場合、lB18内には、既にLDA命令は取
り出されている。このため、減算器8によJTND命令
とLDA命令のアドレス差(−2)を計算し、これをI
BD19に格納する。
In FIG. 2, when the TNZ instruction branches to I and DA instructions and loops, the LDA instruction has already been taken out in IB18. Therefore, the subtracter 8 calculates the address difference (-2) between the JTND instruction and the LDA instruction, and
Store in BD19.

次にTNZ命令の実行時、DIR24にTNZ命令が入
った時、0PNT22から−2の減算を行い(OPNT
=2−2=0)分岐先のLDA命令を次に取り出せるよ
うにする。
Next, when the TNZ instruction is executed, when the TNZ instruction enters DIR24, -2 is subtracted from 0PNT22 (OPNT
=2-2=0) Allows the branch destination LDA instruction to be retrieved next.

従がって、第3図に示す様に1分岐先命令の取出しが不
要のため遅れなく、命令を実行できる。
Therefore, as shown in FIG. 3, it is not necessary to take out one branch destination instruction, so the instruction can be executed without delay.

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

以上説明したように1本発明は、分岐先アドレスと命令
先取シアドレスとの差を求めて、命令バッファ容量以内
の時は、命令バッファ内に分岐先命令があるので、差か
ら命令バッファアドレスを作って分岐先命令を取シ出す
ことにより、分岐先命令の先取シを行わなくてもよいの
で、性能を上げるという効果がある。
As explained above, the present invention calculates the difference between the branch destination address and the instruction preemption address, and if it is within the instruction buffer capacity, there is a branch destination instruction in the instruction buffer, so the instruction buffer address is calculated from the difference. By creating and fetching the branch destination instruction, there is no need to prefetch the branch destination instruction, which has the effect of improving performance.

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

第1図は1本発明の一実施例、第2図は命令群の一例、
第3図は本発明の命令の先取シと命令の実行の動作図お
よび第4図は従来の命令の先取ルと命令の実行の動作図
を示す。 1.4.5・・・・・・命令先取り用命令カウンタ、2
゜10・・・・・・セレクタ、3.21・・・・・・加
算器、6・・・・・・分岐予測バッファ%7・・・・・
・分岐先アドレスレジスタ、8・・・・・・減算器、9
,11,12,13,15゜17.24・・・・・・レ
ジスタ、14・・・・・・アドレス変換バッファ、16
・・・・・・キャシュ、18・・・・・・命令バッファ
、19・・・・・・命令差分バッファ、20・・・・・
・入力ポインタ、22・・・・・・出力ポインタ、23
・・・・・・加減第 1 凹 茅 2 図 今々q嶌行 グ 3rgJ 第 4 閃
Fig. 1 shows one embodiment of the present invention, Fig. 2 shows an example of a group of instructions,
FIG. 3 shows an operational diagram of instruction prefetching and instruction execution according to the present invention, and FIG. 4 shows an operational diagram of conventional instruction prefetching and instruction execution. 1.4.5... Instruction counter for instruction prefetching, 2
゜10... Selector, 3.21... Adder, 6... Branch prediction buffer %7...
・Branch destination address register, 8...Subtractor, 9
,11,12,13,15゜17.24...Register, 14...Address translation buffer, 16
... Cache, 18 ... Instruction buffer, 19 ... Instruction difference buffer, 20 ...
・Input pointer, 22...Output pointer, 23
・・・・・・Adjustment 1st concave 2 figimaqshimagyogu 3rgJ 4th flash

Claims (1)

【特許請求の範囲】 分岐命令の命令先アドレスを予測する分岐予測バッファ
を備えた命令先取り装置において、前記分岐予測バッフ
ァにより予測された分岐命令の分岐先アドレスと先取り
用命令アドレスとの差を求める手段と、 該差が命令バッファの容量より小さい場合にはその差を
用いて命令バッファの読出しアドレスを作成して分岐先
命令を命令バッファから読出す手段とを含むことを特徴
とする命令先取り装置。
[Scope of Claims] In an instruction prefetching device equipped with a branch prediction buffer for predicting an instruction destination address of a branch instruction, a difference between a branch destination address of a branch instruction predicted by the branch prediction buffer and a prefetching instruction address is determined. An instruction prefetching device comprising: means for creating a read address of the instruction buffer using the difference when the difference is smaller than the capacity of the instruction buffer, and reading a branch destination instruction from the instruction buffer. .
JP19354886A 1986-08-18 1986-08-18 Instruction prefetching device Pending JPS6349844A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19354886A JPS6349844A (en) 1986-08-18 1986-08-18 Instruction prefetching device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19354886A JPS6349844A (en) 1986-08-18 1986-08-18 Instruction prefetching device

Publications (1)

Publication Number Publication Date
JPS6349844A true JPS6349844A (en) 1988-03-02

Family

ID=16309895

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19354886A Pending JPS6349844A (en) 1986-08-18 1986-08-18 Instruction prefetching device

Country Status (1)

Country Link
JP (1) JPS6349844A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013131036A (en) * 2011-12-21 2013-07-04 Fujitsu Ltd Arithmetic processing unit and method for controlling arithmetic processing unit

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59223850A (en) * 1983-06-03 1984-12-15 Fuji Electric Co Ltd Pre-read control system of instruction
JPS60168238A (en) * 1984-02-10 1985-08-31 Hitachi Ltd Instruction control system
JPS60241136A (en) * 1984-05-16 1985-11-30 Mitsubishi Electric Corp Data processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59223850A (en) * 1983-06-03 1984-12-15 Fuji Electric Co Ltd Pre-read control system of instruction
JPS60168238A (en) * 1984-02-10 1985-08-31 Hitachi Ltd Instruction control system
JPS60241136A (en) * 1984-05-16 1985-11-30 Mitsubishi Electric Corp Data processor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013131036A (en) * 2011-12-21 2013-07-04 Fujitsu Ltd Arithmetic processing unit and method for controlling arithmetic processing unit

Similar Documents

Publication Publication Date Title
JP3599409B2 (en) Branch prediction device
KR930003124B1 (en) Apparatus for the control of branch instruction in pipeline system
JPS6349844A (en) Instruction prefetching device
JPH04287125A (en) Information processor
JP2668987B2 (en) Data processing device
JP2591325B2 (en) Branch control device
JPH0331933A (en) Data processor
JP3568737B2 (en) Microprocessor with conditional execution instruction
JP2001022577A (en) Information processor
JP3325309B2 (en) Subroutine return instruction processing unit
JPH08137690A (en) Program execution control method
KR100468618B1 (en) Apparatus for branch prediction in superscalar processor with variable length instruction
JPH01271842A (en) Information processor
JPH02121034A (en) Branch controller
JPH0991139A (en) Information processor
JPS6047618B2 (en) information processing equipment
JPH02278428A (en) Branch control system
JPH01240931A (en) Data processor
JPH0373022A (en) Central processing unit
JPH07271581A (en) Microprocessor
JPH0384630A (en) Microprocessor
JPH06301538A (en) Condition branch instruction processor
JPH0290326A (en) Preceding control system
JPH0512010A (en) Branch forecast system
JPH10214187A (en) High-speed branching processor, and branching processing method therefor