JPH05165638A - Information processor - Google Patents

Information processor

Info

Publication number
JPH05165638A
JPH05165638A JP33188091A JP33188091A JPH05165638A JP H05165638 A JPH05165638 A JP H05165638A JP 33188091 A JP33188091 A JP 33188091A JP 33188091 A JP33188091 A JP 33188091A JP H05165638 A JPH05165638 A JP H05165638A
Authority
JP
Japan
Prior art keywords
instruction
address information
branch
branch destination
address
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
JP33188091A
Other languages
Japanese (ja)
Inventor
Hisayoshi Kato
久佳 加藤
Takahiro Onizuka
隆浩 鬼塚
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.)
Hitachi Ltd
Hitachi Computer Engineering Co Ltd
Original Assignee
Hitachi Ltd
Hitachi Computer Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd, Hitachi Computer Engineering Co Ltd filed Critical Hitachi Ltd
Priority to JP33188091A priority Critical patent/JPH05165638A/en
Publication of JPH05165638A publication Critical patent/JPH05165638A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To accelerate a processing by advancing the processing while decoding a stored instruction at a branching destination when new instruction address information is matching to the address information of the stored branching instruction. CONSTITUTION:A comparator 15 detects whether the new instruction address information this time is same as the instruction address information of the branching instruction executed in the past or not by comparing the branching instruction address information read from a storage device 12 with high-order address information inputted from an instruction address control part 11. When a matching detecting signal is outputted from the comparator 15 and the new address information this time shows the instruction address of the branching instruction executed in the past, a control circuit 19 instructs it to an instruction fetch unit 2 to fetch the instruction of an address shown by the branching destination address information read from a branching destination address storage device 13 and held in a register 16, namely, to fetch the branching destination instruction as prediction.

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 for processing instructions one after another by a pipeline control method, and more particularly to an instruction at a branch destination of a branch instruction which causes disturbance of the pipeline. The present invention relates to a preemptive information processing apparatus.

【0002】[0002]

【従来の技術】従来において、パイプライン制御方式に
よって次々とデ−タを処理する情報処理装置における分
岐命令を高速に処理する方法の1つとして、過去に実行
した分岐命令のアドレス情報とその分岐先のアドレス情
報とを対にして記憶しておき、先行演算部で分岐命令を
デコードした時は、その分岐命令の命令アドレス情報と
対になった分岐先アドレス情報が登録されているかを判
定し、登録されている場合は、分岐命令語の中のアドレ
ス部を用いて算出する分岐先の実効アドレス情報が求ま
る前に、その分岐先アドレス情報を使って、記憶装置に
対して分岐先の命令の読み出し要求を行い、算出した分
岐先命令の実効アドレス情報による読出しタイミングよ
り1サイクル早く分岐先の命令を読出し、その後に実効
アドレス情報と登録されていた分岐先のアドレス情報と
を比較することにより、登録されていた分岐先のアドレ
ス情報が正しかったかどうかを検証し、正しければ、記
憶装置から読み出され分岐先命令を有効となものとして
解読し、正しくなければ実効アドレス情報で読み出した
分岐先命令を1サイクル後に解読し、その解読結果に応
じて処理を進めるようにしたものがある。
2. Description of the Related Art Conventionally, as one of the methods for rapidly processing branch instructions in an information processing apparatus that processes data one after another by a pipeline control method, address information of branch instructions executed in the past and the branch information thereof are used. When the branch instruction is decoded by the preceding operation unit by storing it as a pair with the preceding address information, it is determined whether the branch address information paired with the instruction address information of the branch instruction is registered. , If it is registered, the branch destination address information is used to calculate the branch destination instruction before the effective address information of the branch destination calculated using the address part in the branch instruction word is obtained. Read request, the branch destination instruction is read one cycle earlier than the read timing based on the calculated effective address information of the branch destination instruction, and then the effective address information is registered. The address information of the registered branch destination is compared to verify whether the registered address information of the branch destination was correct. If it is correct, the branch destination instruction read from the storage device is regarded as valid. There is a method in which a branch destination instruction that is decoded and read out with effective address information if it is not correct is decoded after one cycle, and the process proceeds according to the decoding result.

【0003】このような分岐命令の分岐先命令の先取り
を行う情報処理装置として、例えば特開平3−4272
2号公報に開示されたものがある。
As an information processing apparatus for prefetching a branch target instruction of such a branch instruction, for example, Japanese Patent Laid-Open No. 3-4272.
There is one disclosed in Japanese Patent Publication No.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記の
従来技術にあっては、過去に実行した分岐命令のアドレ
ス情報と分岐先のアドレス情報を登録しているのみであ
るため、分岐先の実効アドレスを算出するオーバーヘッ
ドはなくすことができるが、各種命令を記憶した記憶装
置へのオーバーヘッドを少なくすることができないとい
う問題がある。
However, in the above-mentioned conventional technique, since the address information of the branch instruction executed in the past and the address information of the branch destination are only registered, the effective address of the branch destination is registered. However, there is a problem in that the overhead to the storage device storing various instructions cannot be reduced.

【0005】すなわち、図5のタイムチャ−トに示すよ
うに、命令解読サイクルをD,アドレス計算サイクルを
A,メモリ読出しサイクルをB,デ−タ転送サイクルを
L,演算サイクルをEとした場合、新たに分岐命令が読
み出されると、過去に同じ分岐命令が実行されていなけ
れば、図3(a)に示すように、分岐先の命令は分岐命
令が解読された後、アドレス計算サイクルA,メモリ読
出しサイクルB,デ−タ転送サイクルLという3つのサ
イクルを経過した後に解読される。これに対し、過去に
同じ分岐命令が実行されていた時は、分岐先の命令は登
録されていた分岐先のアドレス情報によって読み出され
るので、図3(b)に示すように、分岐命令が解読され
た後、アドレス計算サイクルAという1つのサイクルを
経過した後に解読される。
That is, as shown in the time chart of FIG. 5, when the instruction decoding cycle is D, the address calculation cycle is A, the memory read cycle is B, the data transfer cycle is L, and the operation cycle is E, When a new branch instruction is read, if the same branch instruction has not been executed in the past, as shown in FIG. 3A, the branch destination instruction is the address calculation cycle A, the memory after the branch instruction is decoded. Decoding is performed after three cycles of a read cycle B and a data transfer cycle L have passed. On the other hand, when the same branch instruction has been executed in the past, the branch destination instruction is read by the registered branch destination address information, so that the branch instruction is decoded as shown in FIG. 3B. Then, it is decoded after one cycle of the address calculation cycle A.

【0006】このようなことから、分岐先の実効アドレ
スを算出するオーバーヘッドはなくすことができるが、
各種命令を記憶した記憶装置へのオーバーヘッドを少な
くすることができない。
From the above, the overhead of calculating the effective address of the branch destination can be eliminated, but
It is not possible to reduce the overhead on the storage device that stores various instructions.

【0007】本発明の目的は、パイプライン形式でデ−
タ処理を行う装置において各種命令を記憶した記憶装置
へのオーバーヘッドを少なくすることができる情報処理
装置を提供することである。
An object of the present invention is to use a pipeline type data
An object of the present invention is to provide an information processing device capable of reducing overhead to a storage device storing various instructions in a device that performs data processing.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
に本発明は、過去に実行した分岐命令のアドレス情報と
その分岐先のアドレス情報とを対にして記憶し、新たな
命令アドレス情報が前記記憶した分岐命令のアドレス情
報と一致した時は、記憶した分岐先のアドレス情報を用
いて分岐先の命令を読み出す情報処理装置において、前
記分岐先のアドレス情報と対に分岐先の命令を記憶する
記憶手段を設け、新たな命令アドレス情報が前記記憶し
た分岐命令のアドレス情報と一致した時は、前記記憶手
段に記憶した分岐先の命令を解読して処理を進めるよう
にしたものである。
In order to achieve the above object, the present invention stores the address information of a branch instruction executed in the past and the address information of the branch destination as a pair, and stores new instruction address information. When the address information of the stored branch instruction matches, the information processing apparatus that reads the branch destination instruction using the stored branch destination address information stores the branch destination instruction in pair with the branch destination address information. When the new instruction address information coincides with the address information of the stored branch instruction, the instruction of the branch destination stored in the storage means is decoded to proceed the processing.

【0009】[0009]

【作用】上記手段によれば、新たな命令アドレス情報が
過去に実行した分岐命令のアドレス情報と一致した時
は、記憶手段に記憶した分岐先の命令を解読して処理を
進めるので、記憶装置へのオーバーヘッドを少なくする
ことができる。
According to the above means, when the new instruction address information coincides with the address information of the branch instruction executed in the past, the instruction of the branch destination stored in the storage means is decoded and the processing is advanced. Overhead can be reduced.

【0010】[0010]

【実施例】以下、本発明の一実施例について図面により
説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.

【0011】図1は本発明による情報処理装置の一実施
例の全体構成図を示したものである。図において、1は
各種の命令を記憶する記憶装置、2はこの記憶装置1に
信号線50を通じて読出し要求を行い、必要な命令を信
号線51を介して読出し、内部の命令バッファ3に保持
する命令フェッチユニットである。この命令フェッチユ
ニット2は、ユニット内に命令バッファ3を有する先行
命令読み出しのできる命令フェッチユニットであり、信
号線51を介して記憶装置1より送出される命令語をそ
の目的に応じて区別された命令バッファ3に次々とスタ
ックする。
FIG. 1 shows the overall configuration of an embodiment of an information processing apparatus according to the present invention. In the figure, 1 is a storage device for storing various instructions, 2 is a read request to the storage device 1 through a signal line 50, a required instruction is read out through a signal line 51, and is stored in an internal instruction buffer 3. It is an instruction fetch unit. The instruction fetch unit 2 is an instruction fetch unit capable of reading a preceding instruction having an instruction buffer 3 in the unit, and an instruction word sent from the storage device 1 via the signal line 51 is distinguished according to its purpose. The instruction buffer 3 is successively stacked.

【0012】4はセレクタ、5はレジスタであり、セレ
クタ4は通常は命令フェッチユニット2側を選択し、命
令フェッチユニット2の命令バッファ3から信号線52
を通じて出力される命令語をレジスタ5に保持させるよ
うになっている。この場合、命令語は命令部とアドレス
部とからなり、アドレス部は相対アドレス値で実効アド
レスを表すようになっている。そして、分岐命令につい
ては、図3に示すように、分岐命令コ−ド60、分岐条
件部61、アドレス部62から構成されている。
4 is a selector, 5 is a register, the selector 4 normally selects the instruction fetch unit 2 side, and the signal line 52 from the instruction buffer 3 of the instruction fetch unit 2 is selected.
The instruction word output through is stored in the register 5. In this case, the command word is composed of a command part and an address part, and the address part represents the effective address by a relative address value. The branch instruction is composed of a branch instruction code 60, a branch condition section 61, and an address section 62, as shown in FIG.

【0013】6はレジスタ5に保持された命令語を解読
する命令デコ−ダであり、分岐命令である場合はそのこ
とを示す信号が信号線53を通じて分岐判定回路7に入
力される。
Reference numeral 6 is an instruction decoder for decoding the instruction word held in the register 5. In the case of a branch instruction, a signal indicating this is input to the branch determination circuit 7 through the signal line 53.

【0014】この分岐判定回路7は、レジスタ5に保持
された命令語が分岐命令である場合に、その分岐条件部
で分岐が禁止されていないかどうかを判定するもので、
分岐条件部で禁止されていない分岐命令であった場合
は、そのことを示す信号を信号線54を通じて後述する
制御回路19および分岐命令アドレス記憶装置12、分
岐先アドレス記憶装置13に入力する。
The branch judging circuit 7 judges whether or not the branch is prohibited by the branch condition part when the instruction word held in the register 5 is a branch instruction.
If the branch instruction is not prohibited by the branch condition part, a signal indicating that is input to the control circuit 19, the branch instruction address storage device 12, and the branch destination address storage device 13 described later through the signal line 54.

【0015】8はレジスタ5に分岐命令が保持された場
合に、そのアドレス部に基づいて、分岐先のアドレスを
算出するアドレス計算器であり、算出された分岐先のア
ドレス情報はレジスタ9に保持された後、信号線55を
介して命令フェッチユニット2および後述する分岐先ア
ドレス記憶装置12に入力される。命令フェッチユニッ
ト2は制御回路19からフェッチ指示信号が与えられた
時のみ、このレジスタ9から入力された分岐先アドレス
情報で示される分岐先の命令をフェッチする。また、分
岐先アドレス記憶装置12は、レジスタ9から入力され
た分岐先アドレス情報を分岐条件が成立した分岐命令で
あった時のみ、過去に実行した分岐命令の分岐先アドレ
ス情報として記憶する。
Reference numeral 8 denotes an address calculator for calculating the address of the branch destination based on the address part when the branch instruction is held in the register 5, and the calculated address information of the branch destination is held in the register 9. After that, it is input to the instruction fetch unit 2 and the branch destination address storage device 12 described later via the signal line 55. The instruction fetch unit 2 fetches the branch destination instruction indicated by the branch destination address information input from the register 9 only when the fetch instruction signal is given from the control circuit 19. Further, the branch destination address storage device 12 stores the branch destination address information input from the register 9 as the branch destination address information of the branch instruction executed in the past only when the branch instruction satisfies the branch condition.

【0016】10は分岐先アドレス記憶装置13から読
み出された過去の分岐先アドレス情報と、アドレス計算
器8で算出し、かつレジスタ9に保持させた部分岐先ア
ドレス情報とが一致するかどうかを検出する比較器であ
り、一致しない場合は、分岐先アドレス記憶装置13か
らアドレス計算器8のアドレス計算に先立って読出した
分岐先アドレス情報を無効にするように信号線56を通
じて制御回路19に指示する。
Reference numeral 10 indicates whether or not the past branch destination address information read from the branch destination address storage device 13 matches the partial branch destination address information calculated by the address calculator 8 and held in the register 9. If it does not match, the control circuit 19 is instructed via the signal line 56 to invalidate the branch destination address information read from the branch destination address storage device 13 prior to the address calculation of the address calculator 8. Give instructions.

【0017】11は記憶装置1から各種命令を順次に読
み出すための命令アドレス情報を上位と下位に分離して
分岐命令アドレス記憶装置12、分岐先アドレス記憶装
置13および比較器15に入力する命令アドレス制御部
であり、上位の命令アドレス情報は比較器15に入力さ
れると共に、分岐命令アドレス記憶装置12に記憶情報
として入力される。また、下位の命令アドレス情報は分
岐命令アドレス記憶装置12および分岐先アドレス記憶
装置13ならびに分岐先命令記憶装置14に対し書き込
みアドレス指定信号として入力される。
Reference numeral 11 is an instruction address which is divided into upper and lower instruction address information for sequentially reading various instructions from the storage device 1 and is input to a branch instruction address storage device 12, a branch destination address storage device 13 and a comparator 15. This is a control unit, and higher order instruction address information is input to the comparator 15 and also to the branch instruction address storage device 12 as storage information. The lower instruction address information is input to the branch instruction address storage device 12, the branch destination address storage device 13 and the branch destination instruction storage device 14 as a write address designation signal.

【0018】12は過去に実行した分岐命令の命令アド
レス情報、詳しくはその上位アドレス情報を記憶する分
岐命令アドレス記憶装置であり、その上位アドレス情報
AAは図4に示すように下位アドレス情報BBで指定さ
れた記憶アドレスに書き込まれる。従って、この分岐命
令アドレス記憶装置12には、命令アドレス情報の下位
アドレス情報で指定し得るアドレス数と同数の過去に実
行した分岐命令のアドレス情報を記憶し得る。
Reference numeral 12 is a branch instruction address storage device for storing instruction address information of a branch instruction executed in the past, more specifically, upper address information thereof. The upper address information AA is lower address information BB as shown in FIG. It is written to the specified storage address. Therefore, this branch instruction address storage device 12 can store the same number of address information of the branch instructions executed in the past as the number of addresses that can be designated by the lower address information of the instruction address information.

【0019】13は、過去に実行した分岐命令の分岐先
アドレス情報を記憶する分岐先アドレス記憶装置であ
り、その記憶情報はレジスタ9から入力され、書き込み
アドレスは命令アドレス情報の下位アドレス情報によっ
て指定される。この分岐先アドレス記憶装置13も前記
記憶装置12と同様に、図4に示すように、命令アドレ
ス情報の下位アドレス情報で指定し得るアドレス数と同
数の過去の分岐先アドレス情報を記憶し得、しかも記憶
した上位アドレス情報と分岐先アドレス情報とは1対1
に対応している。
Reference numeral 13 denotes a branch destination address storage device for storing the branch destination address information of the branch instruction executed in the past. The storage information is input from the register 9 and the write address is designated by the lower address information of the instruction address information. To be done. Like the storage device 12, the branch destination address storage device 13 can store the same number of past branch destination address information items as the number of addresses that can be designated by the lower address information of the instruction address information, as shown in FIG. Moreover, the stored high-order address information and the branch destination address information are in a one-to-one relationship.
It corresponds to.

【0020】14は過去に実行した分岐命令における分
岐先の命令を記憶する分岐先命令記憶装置であり、記憶
する分岐先の命令は信号線57を介して命令フェッチユ
ニット2から入力され、その書き込みアドレスは命令ア
ドレス情報の下位アドレス情報によって指定される。こ
の分岐先命令記憶装置14も前記記憶装置12と同様
に、図4に示すように、命令アドレス情報の下位アドレ
ス情報で指定し得るアドレス数と同数の過去の分岐先命
令情報を記憶し得、しかもその記憶情報と前記分岐先ア
ドレス情報とは1対1に対応している。
Reference numeral 14 denotes a branch destination instruction storage device that stores a branch destination instruction in a branch instruction that has been executed in the past. The stored branch destination instruction is input from the instruction fetch unit 2 via the signal line 57, and its writing is performed. The address is specified by the lower address information of the instruction address information. Like the storage device 12, the branch destination instruction storage device 14 can store the same number of past branch destination instruction information as the number of addresses that can be designated by the lower address information of the instruction address information, as shown in FIG. Moreover, the stored information and the branch destination address information have a one-to-one correspondence.

【0021】15は新たな命令アドレス情報が過去に実
行したことのある分岐命令の命令アドレス情報と一致す
るものであるかどうか、換言すれば、今回実行しようと
している命令が過去に実行したことのある分岐命令と同
じであるかどうかを検出する比較器である。すなわち、
分岐命令アドレス記憶装置12には、図4に示したよう
に命令アドレス情報の上位アドレス情報AAが下位アド
レス情報BBで指定されるBBアドレスに書き込まれ
る。そこで、今回の新たな命令アドレス情報が与えられ
た時、その下位アドレス情報BBが同じで、過去の下位
アドレス情報BBで指定される記憶アドレスから「A
A」という情報が読み出された場合は、今回実行しよう
としている命令は過去に実行したことのある分岐命令と
同じであると考えることができる。比較器15はこのこ
とを検出するものであり、一致した場合の一致検出信号
は信号線58を介して制御回路19に入力される。
Reference numeral 15 indicates whether or not the new instruction address information matches the instruction address information of the branch instruction that has been executed in the past, in other words, whether the instruction currently being executed has executed in the past. It is a comparator that detects whether it is the same as a branch instruction. That is,
In the branch instruction address storage device 12, as shown in FIG. 4, the upper address information AA of the instruction address information is written in the BB address designated by the lower address information BB. Therefore, when new instruction address information is given this time, the lower address information BB is the same, and "A" is added from the storage address specified by the lower address information BB in the past.
When the information "A" is read, it can be considered that the instruction to be executed this time is the same as the branch instruction that has been executed in the past. The comparator 15 detects this, and the coincidence detection signal in the case of coincidence is input to the control circuit 19 via the signal line 58.

【0022】16は分岐先アドレス記憶装置13から今
回の分岐命令の分岐先を予測するものとして読み出され
た過去の分岐先アドレス情報を保持するレジスタであ
り、保持された分岐先アドレス情報は比較器10に入力
される。
Reference numeral 16 is a register for holding past branch destination address information read from the branch destination address storage device 13 as a prediction of the branch destination of the present branch instruction. The held branch destination address information is compared. Input to the container 10.

【0023】17は、今回の分岐命令の分岐先アドレス
の命令を記憶装置1から読み出す前に分岐先命令記憶装
置14から予測分岐先命令として先行して読み出された
分岐先命令を保持するレジスタ、18はレジスタ17に
保持された予測分岐先命令が、実際に記憶装置1をアク
セスして読出した分岐先命令と同じであるかどうかを検
出する比較器であり、予測したものと実際のものとが一
致しなかった場合は信号線59を通じて制御回路19に
通知され、この制御回路19によって予測の分岐先命令
はキャンセルされる。
Reference numeral 17 is a register for holding the branch destination instruction read out earlier as the predicted branch destination instruction from the branch destination instruction storage device 14 before reading the instruction of the branch destination address of the present branch instruction from the storage device 1. , 18 are comparators that detect whether the predicted branch destination instruction held in the register 17 is the same as the branch destination instruction that actually accessed the memory device 1 and read it. If the two do not match, the control circuit 19 is notified through the signal line 59, and the control circuit 19 cancels the predicted branch destination instruction.

【0024】19は、今回の新たな命令が過去に実行し
た分岐命令と同一命令であった時にその新たな命令の分
岐先の命令をフェッチするように指示したり、セレクタ
4を分岐先命令記憶装置14の側に切り換えたり、さら
に予測した分岐先の命令が異なっていた場合に、命令バ
ッファ3にフェッチさせた命令をキャンセルするように
指示するなどの制御を行う制御回路である。
Reference numeral 19 indicates that when the new instruction this time is the same as the branch instruction executed in the past, the instruction at the branch destination of the new instruction is fetched, or the selector 4 stores the branch destination instruction. It is a control circuit that performs control such as switching to the device 14 side or instructing the instruction buffer 3 to cancel the fetched instruction when the predicted branch destination instruction is different.

【0025】次に、以上の構成に係る動作について図2
のタイムチャ−トを参照して説明する。
Next, the operation of the above configuration will be described with reference to FIG.
The time chart will be described.

【0026】まず、新たな命令アドレス情報が入力さ
れ、命令フェッチユニット2の命令バッファ3に分岐命
令とそれに続く分岐先の命令がフェッチされると、命令
フェッチユニット2は、まず、分岐命令を信号線52、
セレクタ4を通じてレジスタ5に入力する。レジスタ5
は入力された分岐命令を取り込んで保持し、命令デコ−
ダ6に入力する。命令デコ−ダ6は入力された命令を解
読し、分岐命令であることを示す信号を信号線53を通
じて分岐判定回路7に入力する。分岐判定回路7は分岐
命令の分岐条件部で記述された分岐条件が成立するかど
うかを調べ、分岐が禁止されていない分岐命令であった
場合は、そのことを示す信号を制御回路19に入力す
る。
First, when new instruction address information is input and the branch instruction and the instruction at the subsequent branch destination are fetched into the instruction buffer 3 of the instruction fetch unit 2, the instruction fetch unit 2 first signals the branch instruction. Line 52,
Input to the register 5 through the selector 4. Register 5
Fetches and holds the input branch instruction, and
Type in da 6. The instruction decoder 6 decodes the input instruction and inputs a signal indicating a branch instruction to the branch determination circuit 7 through the signal line 53. The branch determination circuit 7 checks whether or not the branch condition described in the branch condition part of the branch instruction is satisfied, and if the branch instruction is not prohibited, inputs a signal indicating that to the control circuit 19. To do.

【0027】レジスタ5に保持された分岐命令は命令デ
コ−ダ6と並列にアドレス計算器8にも入力される。そ
こで、アドレス計算器8は入力された分岐命令のアドレ
ス部を基にその実効アドレスを算出し、レジスタ9に保
持させる。
The branch instruction held in the register 5 is also input to the address calculator 8 in parallel with the instruction decoder 6. Therefore, the address calculator 8 calculates the effective address based on the address portion of the input branch instruction and stores it in the register 9.

【0028】一方、命令アドレス制御部11は、新たに
入力された命令アドレス情報の上位アドレス情報を比較
器115および分岐命令アドレス記憶装置12に入力す
る。さらに、下位アドレス情報を記憶装置12、13、
14への読出しアドレス信号として入力する。これによ
り、記憶装置12、13、14からは、過去に実行した
分岐命令のアドレス情報、その分岐先のアドレス情報お
よび分岐先の命令がそれぞれ読み出される。
On the other hand, the instruction address control unit 11 inputs the higher-order address information of the newly input instruction address information to the comparator 115 and the branch instruction address storage device 12. Further, the lower address information is stored in the storage devices 12, 13,
It is inputted as a read address signal to 14. As a result, the address information of the branch instruction executed in the past, the address information of the branch destination, and the instruction of the branch destination are read from the storage devices 12, 13, and 14, respectively.

【0029】そこで、比較器15は今回の新たな命令ア
ドレス情報が過去に実行した分岐命令の命令アドレス情
報と同一であるかどうかを、記憶装置12から読み出さ
れた分岐命令アドレス情報と命令アドレス制御部11か
ら入力された上位アドレス情報とを比較することによっ
て検出する。この結果、同一でなかった場合、すなわち
今回の新たな命令アドレス情報が過去に実行されたこと
がない命令の命令アドレスを示していた場合、制御回路
19はそのことを示す比較器15からの出力信号に基づ
き、分岐判定回路7からの分岐命令であることを示す信
号が入力されたことを条件に、信号線60を通じて記憶
装置12,13を書き込み状態にする。
Therefore, the comparator 15 determines whether or not the new instruction address information of this time is the same as the instruction address information of the branch instruction executed in the past, by referring to the branch instruction address information and the instruction address read from the storage device 12. The detection is performed by comparing the higher-order address information input from the control unit 11. As a result, if they are not the same, that is, if the new instruction address information this time indicates the instruction address of an instruction that has not been executed in the past, the control circuit 19 outputs an output from the comparator 15 indicating that. Based on the signal, the storage devices 12 and 13 are put into the write state through the signal line 60 on condition that the signal indicating the branch instruction is input from the branch determination circuit 7.

【0030】すると、図4で説明したように、記憶回路
12には、今回の命令アドレス情報の下位アドレス情報
に対応した記憶アドレスに、上位アドレス情報が過去に
実行した分岐命令のアドレス情報として、また記憶回路
13には、アドレス計算器8で計算し、かつレジスタ9
に保持された今回の分岐命令の分岐先アドレス情報が、
過去に実行された分岐命令の分岐先アドレス情報とし
て、それぞれ対応する記憶アドレスに書き込まれる。
Then, as described with reference to FIG. 4, the storage circuit 12 stores, in the storage address corresponding to the lower address information of the instruction address information of this time, the upper address information as the address information of the branch instruction executed in the past. In addition, the memory circuit 13 calculates in the address calculator 8 and registers 9
The branch destination address information of the current branch instruction stored in
The branch destination address information of the branch instruction executed in the past is written in the corresponding storage address.

【0031】また、アドレス計算器8で計算し、かつレ
ジスタ9に保持された今回の分岐命令の分岐先アドレス
情報で示されるアドレスの分岐先命令をフェッチするよ
うに、命令フェッチユニット2に指示する。これによ
り、命令フェッチユニット2の命令バッファ3には、ア
ドレス計算器8で計算した分岐先アドレスの分岐先命令
がフェッチされる。このフェッチされた分岐先命令は、
分岐先命令記憶装置14に記憶情報として入力され、図
4に示したように、過去の実行した分岐命令の分岐先ア
ドレス情報として記憶される。この場合、分岐先命令は
図5(a)に示したタイミングでフェッチされる。従っ
て、比較器18の一致条件は成立しない。
Further, the instruction fetch unit 2 is instructed to fetch the branch destination instruction of the address calculated by the address calculator 8 and held in the register 9 and indicated by the branch destination address information of the current branch instruction. .. As a result, the branch destination instruction of the branch destination address calculated by the address calculator 8 is fetched into the instruction buffer 3 of the instruction fetch unit 2. This fetched branch destination instruction is
The data is input to the branch destination instruction storage device 14 as storage information, and as shown in FIG. 4, stored as the branch destination address information of the previously executed branch instruction. In this case, the branch destination instruction is fetched at the timing shown in FIG. Therefore, the matching condition of the comparator 18 is not satisfied.

【0032】しかし、比較器15から一致検出信号が出
力され、今回の新たな命令アドレス情報が過去に実行し
たことがある分岐命令の命令アドレスを示していた場
合、制御回路19は、分岐先アドレス記憶装置13から
読み出され、かつレジスタ16に保持された予測分岐先
アドレス情報で示されるアドレスの命令、すなわち予測
としての分岐先命令をフェッチするように、命令フェッ
チユニット2に指示する。これにより、命令フェッチユ
ニット2の命令バッファ3には、分岐先アドレス記憶装
置13から読み出した予測分岐先アドレス情報で示され
る分岐先アドレスの分岐先命令がフェッチされる。すな
わち、図2(a)に示すように、分岐命令に解読サイク
ルDの次のアドレス計算サイクルAと同じタイミングで
分岐先命令がフェッチされる。もしこのフェッチされた
分岐先命令が比較器10および18の出力に基づいて制
御回路19によってキャンセルされなければ、分岐先命
令記憶装置14から読出した分岐先命令がレジスタ5を
介して命令デコ−ダ6に入力され、分岐命令とその分岐
先命令とを記憶装置1へのオ−バヘッド無しで読出した
のと等価な状態で解読し、その処理を進めることができ
る。
However, when the coincidence detection signal is output from the comparator 15 and the new instruction address information this time indicates the instruction address of the branch instruction that has been executed in the past, the control circuit 19 causes the branch destination address. The instruction fetch unit 2 is instructed to fetch the instruction at the address indicated by the predicted branch destination address information read from the storage device 13 and held in the register 16, that is, the branch destination instruction as the prediction. As a result, the branch destination instruction of the branch destination address indicated by the predicted branch destination address information read from the branch destination address storage device 13 is fetched into the instruction buffer 3 of the instruction fetch unit 2. That is, as shown in FIG. 2A, the branch destination instruction is fetched into the branch instruction at the same timing as the address calculation cycle A next to the decoding cycle D. If the fetched branch destination instruction is not canceled by the control circuit 19 based on the outputs of the comparators 10 and 18, the branch destination instruction read from the branch destination instruction storage device 14 is transferred via the register 5 to the instruction decoder. 6, the branch instruction and the branch destination instruction can be decoded in a state equivalent to the case where the branch instruction and the branch destination instruction are read out to the storage device 1 without an overhead, and the processing can be advanced.

【0033】しかし、分岐先アドレス記憶装置13から
読出した予測分岐先情報を、分岐命令の解読サイクルD
の次のアドレス計算サイクルAでアドレス計算器8によ
って算出される実効アドレスと比較器10で比較した結
果、それらが不一致であったならば、予測分岐先アドレ
ス情報に従ってフェッチした分岐先命令をキャンセルす
るように指示する信号が信号線56を通じて比較器10
から制御回路19に入力される。そして、フェッチした
分岐先命令をキャンセルする信号が制御回路19から命
令フェッチユニット2に入力される。この結果、図2
(c)に示すように、予測分岐先アドレス情報に従って
フェッチした分岐先命令はキャンセルされる。そして、
アドレス計算サイクルAにおいてアドレス計算器8で算
出した分岐先アドレスで示されるアドレスの命令をフェ
ッチさせる指示が命令フェッチユニット2になされ、図
2(c)に示すように、分岐命令の解読サイクルDから
3サイクル遅れて分岐先命令がフェッチされる。
However, the predicted branch destination information read from the branch destination address storage device 13 is used as the branch instruction decoding cycle D.
When the effective address calculated by the address calculator 8 and the comparator 10 in the next address calculation cycle A are not matched, the branch destination instruction fetched according to the predicted branch destination address information is canceled. A signal indicating that the comparator 10
Is input to the control circuit 19. Then, a signal for canceling the fetched branch destination instruction is input from the control circuit 19 to the instruction fetch unit 2. As a result,
As shown in (c), the branch destination instruction fetched according to the predicted branch destination address information is canceled. And
The instruction fetch unit 2 is instructed to fetch the instruction at the address indicated by the branch destination address calculated by the address calculator 8 in the address calculation cycle A, and as shown in FIG. The branch destination instruction is fetched with a delay of 3 cycles.

【0034】しかし、予測分岐先アドレス情報と計算し
た分岐先アドレス情報とは一致したが、分岐先命令記憶
装置14から先行して出力した分岐先命令と、予測分岐
先アドレス情報に従ってフェッチさせた分岐先命令とを
比較器18で比較した結果、それらが不一致であったな
らば、予測分岐先アドレス情報に従ってフェッチした分
岐先命令をキャンセルする(無効にする)ように指示す
る信号が信号線59を通じて比較器18から制御回路1
9に入力される。そして、フェッチした分岐先命令をキ
ャンセルする信号が制御回路19から命令フェッチユニ
ット2に入力される。この結果、図2(b)に示すよう
に、予測分岐先アドレス情報に従ってフェッチした分岐
先命令はキャンセルされる。その後1サイクル遅れて予
測分岐先アドレス情報で示されるアドレスの命令をフェ
ッチさせる指示が命令フェッチユニット2になされ、図
2(b)に示すように、分岐命令の解読サイクルDから
1サイクル遅れて分岐先命令がフェッチされる。
However, although the predicted branch destination address information and the calculated branch destination address information match, the branch destination instruction previously output from the branch destination instruction storage device 14 and the branch fetched according to the predicted branch destination address information. As a result of comparison by the comparator 18 with the preceding instruction, if they do not match, a signal for instructing to cancel (invalidate) the fetched branch destination instruction according to the predicted branch destination address information is sent through the signal line 59. Control circuit 1 from comparator 18
9 is input. Then, a signal for canceling the fetched branch destination instruction is input from the control circuit 19 to the instruction fetch unit 2. As a result, as shown in FIG. 2B, the branch destination instruction fetched according to the predicted branch destination address information is canceled. After that, the instruction fetch unit 2 is instructed to fetch the instruction of the address indicated by the predicted branch destination address information with a delay of 1 cycle, and the instruction is fetched with a delay of 1 cycle from the branch instruction decoding cycle D as shown in FIG. The previous instruction is fetched.

【0035】従って、予測分岐先アドレス情報と対にし
て分岐先記憶装置14に記憶させた分岐先命令が、予測
分岐先アドレス情報によって記憶装置1から読出した分
岐先命令と一致するような分岐命令を実行する場合は、
記憶装置1へのオ−バヘッドがなくなり、パイプライン
処理をさらに高速化することができる。
Therefore, a branch instruction in which the branch destination instruction stored in the branch destination storage device 14 in a pair with the predicted branch destination address information matches the branch destination instruction read from the storage device 1 by the predicted branch destination address information. If you run
Since there is no overhead to the storage device 1, the pipeline processing can be further speeded up.

【0036】なお、本発明は上記実施例に限定されるも
のではなく、要旨を逸脱しない範囲で種々の変更が可能
である。
The present invention is not limited to the above embodiments, and various modifications can be made without departing from the scope of the invention.

【0037】[0037]

【発明の効果】以上のように本発明によれば、過去に実
行した分岐命令のアドレス情報とその分岐先のアドレス
情報とを対にして記憶し、新たな命令アドレス情報が前
記記憶した分岐命令のアドレス情報と一致した時は、記
憶した分岐先のアドレス情報を用いて分岐先の命令を読
み出す情報処理装置において、前記分岐先のアドレス情
報と対に分岐先の命令を記憶する記憶手段を設け、新た
な命令アドレス情報が前記記憶した分岐命令のアドレス
情報と一致した時は、前記記憶手段に記憶した分岐先の
命令を解読して処理を進めるようにしたため、パイプラ
イン形式でデ−タ処理を行う場合に各種命令を記憶した
記憶装置へのオーバーヘッドを少なくすることができ、
パイプライン処理をさらに高速化することができる。
As described above, according to the present invention, the address information of the branch instruction executed in the past and the address information of the branch destination are stored as a pair, and the new instruction address information is stored as the branch instruction. When the address information of the branch destination is matched, the information processing apparatus for reading the instruction of the branch destination using the stored address information of the branch destination is provided with a storage means for storing the instruction of the branch destination paired with the address information of the branch destination. When the new instruction address information coincides with the address information of the stored branch instruction, the instruction of the branch destination stored in the storage means is decoded and the processing is advanced. When performing, it is possible to reduce the overhead to the storage device that stores various instructions,
The pipeline processing can be further speeded up.

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

【図1】本発明の一実施例を示す全体ブロック図であ
る。
FIG. 1 is an overall block diagram showing an embodiment of the present invention.

【図2】実施例の動作を説明するためのタイムチャート
である。
FIG. 2 is a time chart for explaining the operation of the embodiment.

【図3】分岐命令の構造を示す説明図である。FIG. 3 is an explanatory diagram showing a structure of a branch instruction.

【図4】過去に実行した分岐命令のアドレス、分岐先の
アドレス、分岐先命令の各情報を記憶する記憶装置の記
憶構造の説明図である。
FIG. 4 is an explanatory diagram of a storage structure of a storage device that stores information of a branch instruction executed in the past, a branch destination address, and branch destination instruction information.

【図5】従来装置の問題を説明するためのタイムチャ−
トである。
FIG. 5 is a time chart for explaining the problem of the conventional device.
It is

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

1…記憶装置、2…命令フェッチユニット、6…命令デ
コ−ダ、7…分岐判定回路、8…アドレス計算器、1
0,15,18…比較器、11…命令アドレス制御部、
12…分岐命令アドレス記憶装置、13…分岐先アドレ
ス記憶装置、14…分岐先命令記憶装置、19…制御回
路。
1 ... Memory device, 2 ... Instruction fetch unit, 6 ... Instruction decoder, 7 ... Branch decision circuit, 8 ... Address calculator, 1
0, 15, 18 ... Comparator, 11 ... Instruction address control unit,
12 ... Branch instruction address storage device, 13 ... Branch destination address storage device, 14 ... Branch destination instruction storage device, 19 ... Control circuit.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 過去に実行した分岐命令のアドレス情報
とその分岐先のアドレス情報とを対にして記憶し、新た
な命令アドレス情報が前記記憶した分岐命令のアドレス
情報と一致した時は、記憶した分岐先のアドレス情報を
用いて分岐先の命令を読み出す情報処理装置において、
前記分岐先のアドレス情報と対に分岐先の命令を記憶す
る記憶手段を設け、新たな命令アドレス情報が前記記憶
した分岐命令のアドレス情報と一致した時は、前記記憶
手段に記憶した分岐先の命令を解読して処理を進めるこ
とを特徴とする情報処理装置。
1. The address information of a branch instruction executed in the past and the address information of the branch destination are stored as a pair, and when the new instruction address information matches the address information of the stored branch instruction, the memory is stored. In the information processing device that reads out the instruction of the branch destination using the address information of the branch destination,
A storage unit for storing the instruction of the branch destination is provided in pair with the address information of the branch destination, and when the new instruction address information matches the address information of the stored branch instruction, the branch destination stored in the storage unit is stored. An information processing device characterized by decoding instructions and proceeding with processing.
【請求項2】 前記記憶手段に記憶した分岐先の命令
を、対応する分岐先のアドレス情報により読み出した分
岐先の命令と不一致の時は無効にする手段を設けたこと
を特徴とする請求項1記載の情報処理装置。
2. A means for invalidating a branch destination instruction stored in the storage means when the instruction of the branch destination read by the address information of the corresponding branch destination does not match is provided. 1. The information processing device according to 1.
JP33188091A 1991-12-16 1991-12-16 Information processor Pending JPH05165638A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33188091A JPH05165638A (en) 1991-12-16 1991-12-16 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33188091A JPH05165638A (en) 1991-12-16 1991-12-16 Information processor

Publications (1)

Publication Number Publication Date
JPH05165638A true JPH05165638A (en) 1993-07-02

Family

ID=18248660

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33188091A Pending JPH05165638A (en) 1991-12-16 1991-12-16 Information processor

Country Status (1)

Country Link
JP (1) JPH05165638A (en)

Similar Documents

Publication Publication Date Title
US4827402A (en) Branch advanced control apparatus for advanced control of a branch instruction in a data processing system
US4476525A (en) Pipeline-controlled data processing system capable of performing a plurality of instructions simultaneously
US5809294A (en) Parallel processing unit which processes branch instructions without decreased performance when a branch is taken
JPH0557616B2 (en)
JPH0283735A (en) Instruction prefetching device
US5961633A (en) Execution of data processing instructions
JPH02153428A (en) Cache device and instruction readout device
JPH05165638A (en) Information processor
KR950000088B1 (en) Data processing system
JPH04205448A (en) Information processor
JP2591325B2 (en) Branch control device
JPS60164842A (en) Instruction prefetching device
JP2503223B2 (en) Prior control method
JPH02206836A (en) Data processor
JPH0774992B2 (en) Data processing device
JPS6310451B2 (en)
JPS586972B2 (en) information processing equipment
JPH01263830A (en) Information processor
JPH04239324A (en) Branch destination estimating system
JPH0667881A (en) Branch forecasting address processing system
JPH03100842A (en) Information processor
JPH06168120A (en) Intruction prefetch device
JPH05313895A (en) Pipeline processor
JPH07113890B2 (en) Information processing equipment
JPH05127897A (en) Method and device for control of branch estimation