JPH05224925A - Instruction prefetching system - Google Patents
Instruction prefetching systemInfo
- Publication number
- JPH05224925A JPH05224925A JP1048092A JP1048092A JPH05224925A JP H05224925 A JPH05224925 A JP H05224925A JP 1048092 A JP1048092 A JP 1048092A JP 1048092 A JP1048092 A JP 1048092A JP H05224925 A JPH05224925 A JP H05224925A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- branch
- conditional branch
- address
- register
- 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
Links
Landscapes
- Advance Control (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、情報処理装置に使用さ
れる先行制御装置の命令先取り方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an instruction prefetch system for a preceding control device used in an information processing device.
【0002】[0002]
【従来の技術】従来のこの種の命令先取り方式には、条
件付分岐命令を実行したときの分岐方向や分岐先アドレ
スを記憶しておき、条件付分岐命令を取り出した場合に
同一の条件分岐命令について、前回と同じ方向または分
岐先アドレスに基づいて、後続の命令を取り出す方式、
または分岐成功側,分岐不成功側のいずれか一方の方向
に基づいて後続の命令を取り出す方式がある。2. Description of the Related Art A conventional instruction prefetching method of this kind stores a branch direction and a branch destination address when a conditional branch instruction is executed and stores the same conditional branch when the conditional branch instruction is taken out. For instructions, a method that fetches subsequent instructions based on the same direction as the previous time or the branch destination address,
Alternatively, there is a method of fetching a subsequent instruction based on either the branch success side or the branch failure side.
【0003】[0003]
【発明が解決しようとする課題】上述した従来の命令先
取り方式では、前回と同一の分岐先方向,または分岐先
アドレスを記憶する方式の場合には、実現する為のハー
ドウェア量が膨大になるという欠点がある。しかも、分
岐先方向あるいは分岐先アドレスを記憶するテーブル
に、取り出した条件付分岐命令が登録されていなかった
場合には、効果が半減してしまうという欠点がある。In the above-mentioned conventional instruction prefetching method, in the case of the method of storing the same branch destination direction or the same branch destination address as the previous one, the amount of hardware to realize becomes enormous. There is a drawback. Moreover, if the fetched conditional branch instruction is not registered in the table that stores the branch destination direction or the branch destination address, the effect is halved.
【0004】また、分岐成功側か分岐不成功側かいずれ
も一方の方向に基づいて、条件付分岐命令の後続の命令
を先取りする方式の場合には、条件付分岐命令を実行し
た結果、先取りした方向とは逆の方向となる場合が多い
プログラムを実行した場合には性能が低下する欠点があ
る。Further, in the case of the method of prefetching the instruction subsequent to the conditional branch instruction based on the direction of either the branch successful side or the branch unsuccessful side, as a result of executing the conditional branch instruction, the prefetch is performed. There is a drawback in that the performance decreases when a program is executed in many cases in the opposite direction to the above direction.
【0005】[0005]
【課題を解決するための手段】本発明の命令先取り方式
は、命令の先取りを行い、取り出した命令が条件付分岐
命令である場合に、分岐成功側または分岐不成功側のい
ずれかの方向を予測して、後続の命令の先取りを行う情
報処理装置における命令先取り方式において、前記情報
処理装置で実行される命令群中に、前記条件付分岐命令
の後続の命令の先取り方向を指示する機能を有する命令
を有し、該命令により予め指示された方向に基づいて、
条件付分岐命令の後続の命令の先取りを行うことを特徴
とする。According to the instruction prefetching method of the present invention, when the instruction is prefetched and the fetched instruction is a conditional branch instruction, either the branch success side or the branch unsuccessful side is directed. In the instruction prefetching method in the information processing device that predicts and prefetches the subsequent instruction, a function of instructing the prefetching direction of the instruction subsequent to the conditional branch instruction in the instruction group executed by the information processing device is provided. Having a command that has, and based on the direction previously designated by the command,
It is characterized in that the instruction subsequent to the conditional branch instruction is prefetched.
【0006】[0006]
【実施例】次に、本発明の一実施例について図面を参照
して説明する。An embodiment of the present invention will be described with reference to the drawings.
【0007】図2は本発明が適用されるパイプライン構
成の情報処理装置のブロック図である。FIG. 2 is a block diagram of an information processing apparatus having a pipeline structure to which the present invention is applied.
【0008】図2において、2−1は先行制御ユニット
であり、命令フェッチユニット2−2とアドレス計算ユ
ニット2−3により構成される。命令フェッチユニット
2−2は命令キャッシュメモリを有しており、命令の取
り出しを行うアドレス計算ユニット2−3に供給する。
アドレス計算ユニット2−3は、オペランドを取り出す
ためにオペランドの論理アドレスを計算する。In FIG. 2, 2-1 is a preceding control unit, which is composed of an instruction fetch unit 2-2 and an address calculation unit 2-3. The instruction fetch unit 2-2 has an instruction cache memory and supplies it to the address calculation unit 2-3 which fetches an instruction.
The address calculation unit 2-3 calculates the logical address of the operand to fetch the operand.
【0009】2−4はアドレス変換ユニットであり、ア
ドレス計算ユニット2−3により求められたオペランド
の論理アドレスが供給され、絶対アドレスへの変換を行
う。変換された絶対アドレスはオペランドキャッシュ2
−5に供給されるが命令フェッチユニット2−2で取り
出された命令が分岐命令であった場合には、分岐先アド
レスとして命令フェッチユニット2−2に供給される。An address conversion unit 2-4 is supplied with the logical address of the operand obtained by the address calculation unit 2-3 and converts it to an absolute address. The converted absolute address is operand cache 2
If the instruction fetched by the instruction fetch unit 2-2 is a branch instruction, it is fed to the instruction fetch unit 2-2 as a branch destination address.
【0010】オペランドキャッシュ2−5は、アドレス
変換ユニット2−4により求められたオペランドの絶対
アドレスに基づいてオペランドキャッシュを索引し、オ
ペランドの取り出しを行う。The operand cache 2-5 indexes the operand cache based on the absolute address of the operand obtained by the address translation unit 2-4 and fetches the operand.
【0011】2−6は演算実行ユニットであり、オペラ
ンドキャッシュ2−5よりオペランドが供給され演算の
実行を行う。実行する命令が条件付分岐命令である場合
には分岐判定情報を命令フェッチユニット2−2に送出
する。Reference numeral 2-6 is an operation execution unit, which receives operands from the operand cache 2-5 and executes the operation. When the instruction to be executed is a conditional branch instruction, branch determination information is sent to the instruction fetch unit 2-2.
【0012】図1は、図2に示した命令フェッチユニッ
ト2−2の詳細ブロック図であり、本発明の一実施例を
示す。FIG. 1 is a detailed block diagram of the instruction fetch unit 2-2 shown in FIG. 2, showing an embodiment of the present invention.
【0013】図1において、1−1は命令が格納される
命令キャッシュメモリであり、読み出しアドレスレジス
タ1−2の出力により索引され、その出力はリードデー
タレジスタ1−3に格納され、図2のアドレス計算ユニ
ット2−3に供給される。また、リードデータレジスタ
1−3に格納され、図2のアドレス計算ユニット2−3
に供給される。また、リードデータレジスタ1−3に格
納された命令は、デコーダ1−4により無条件分岐命令
か、条件付分岐命令か、または条件付分岐命令の後続の
命令の先取り方向を指示する命令かデコードされ条件付
分岐命令の後続の命令の先取り方向を指示する命令であ
った場合には指示された方向の値をレジスタ1−13に
設定する。また、デコードした結果、リードデータレジ
スタ1−3に格納された命令が無条件分岐命令か、条件
付分岐命令か、また、そのいずれでも無いかにより、下
記の様に後続の命令取り出し動作が異なる。In FIG. 1, reference numeral 1-1 is an instruction cache memory in which an instruction is stored, which is indexed by the output of the read address register 1-2, the output of which is stored in the read data register 1-3. It is supplied to the address calculation unit 2-3. The address calculation unit 2-3 of FIG. 2 is stored in the read data register 1-3.
Is supplied to. The decoder 1-4 stores an instruction stored in the read data register 1-3 as an unconditional branch instruction, a conditional branch instruction, or an instruction indicating a prefetch direction of an instruction subsequent to the conditional branch instruction or a decode instruction. If the instruction indicates the prefetch direction of the instruction subsequent to the conditional branch instruction, the value of the designated direction is set in the register 1-13. Further, as a result of decoding, the subsequent instruction fetch operation differs as described below depending on whether the instruction stored in the read data register 1-3 is an unconditional branch instruction, a conditional branch instruction, or neither of them. ..
【0014】デコードした結果、無条件分岐命令,条件
付分岐命令のいずれでもない場合には、読み出しアドレ
スレジスタ1−2の入力として、加算器1−5により読
み出しアドレスレジスタ1−2の値に+1加算された値
がセレクタ1−6により選択され、シーケンシャルに後
続の命令が取り出される。このときセレクタ1−6の選
択信号1−7は論理回路1−8により生成される。When the result of decoding is neither an unconditional branch instruction nor a conditional branch instruction, the value of the read address register 1-2 is incremented by +1 by the adder 1-5 as an input of the read address register 1-2. The added value is selected by the selector 1-6, and subsequent instructions are sequentially fetched. At this time, the selection signal 1-7 of the selector 1-6 is generated by the logic circuit 1-8.
【0015】次に、無条件分岐命令であった場合には、
その旨を示すデコード信号1−9が論理回路1−8に入
力されセレクタ1−6に於いて、アドレス変換ユニット
2−4からの分岐アドレス先信号1−10を選択する様
に選択信号1−7が生成され、無条件分岐命令の分岐先
の絶対アドレスが図2のアドレス計算ユニット2−3お
よびアドレス変換ユニット2−4により求まる迄の間、
待ち合わせた後に、後続の命令の取り出しが行われる。Next, if the instruction is an unconditional branch instruction,
A decode signal 1-9 indicating that is input to the logic circuit 1-8, and the selector 1-6 selects the branch address destination signal 1-10 from the address conversion unit 2-4 so that the selection signal 1- 7 is generated and until the absolute address of the branch destination of the unconditional branch instruction is obtained by the address calculation unit 2-3 and the address conversion unit 2-4 in FIG.
After waiting, the subsequent instruction is fetched.
【0016】最後に、条件付分岐命令であった場合につ
いて説明する。Finally, the case of a conditional branch instruction will be described.
【0017】デコーダ1−4により、リードデータレジ
スタ1−3に格納された命令が条件付分岐命令である
と、その旨を示すデコード信号1−11がアンドゲート
1−12の一方の入力に印加される。アンドゲート1−
12の他方の入力には、分岐方向指示レジスタ1−13
の出力が印加され、これらの論理積が論理回路1−8に
入力される。When the instruction stored in the read data register 1-3 is a conditional branch instruction by the decoder 1-4, a decode signal 1-11 indicating that is applied to one input of the AND gate 1-12. To be done. AND gate 1-
The other input of 12 is connected to the branch direction instruction register 1-13.
Is applied and the logical product of these is input to the logic circuit 1-8.
【0018】ここで分岐方向指示レジスタ1−13の値
は、“1”で分岐成功側を、“0”で分岐不成功側を先
取りすることを意味する。従って、分岐方向指示レジス
タ1−13の値が“0”の場合は、アンドゲート1−1
2の出力がデコード信号1−11の値に拘らず“0”と
なり、論理回路1−8により生成される選択信号1−7
によりセレクタ1−6の入力として加算器1−5の出力
を選択し、無条件分岐命令,条件付分岐命令のいずれで
も無い場合と同様にシーケンシャルに後続の命令の先取
りが行われる。Here, the value of the branch direction instruction register 1-13 means "1" to preempt the branch successful side and "0" to preempt the branch unsuccessful side. Therefore, if the value of the branch direction instruction register 1-13 is "0", the AND gate 1-1
The output of 2 becomes "0" regardless of the value of the decode signal 1-11, and the selection signal 1-7 generated by the logic circuit 1-8.
Thus, the output of the adder 1-5 is selected as the input of the selector 1-6, and the subsequent instructions are sequentially prefetched in the same manner as in the case of neither the unconditional branch instruction nor the conditional branch instruction.
【0019】分岐方向指示レジスタ1−13の値が
“1”である場合には、デコード信号1−11が“1”
であればアンドゲート1−12の出力“1”となり、論
理回路1−8で生成される選択信号1−7によりセレク
タ1−6の入力としてアドレス変換ユニット2−4から
の分岐先アドレス信号1−10を選択し、無条件命令の
場合と同様に、アドレス変換ユニット2−4に於いて分
岐先の絶対アドレスが求まる迄の間、待ち合わせた後
に、後続の命令の先取りが行われる。When the value of the branch direction instruction register 1-13 is "1", the decode signal 1-11 is "1".
If so, the output of the AND gate 1-12 becomes "1", and the branch destination address signal 1 from the address conversion unit 2-4 is input as the input of the selector 1-6 by the selection signal 1-7 generated by the logic circuit 1-8. When -10 is selected, as in the case of the unconditional instruction, the address translation unit 2-4 waits until the absolute address of the branch destination is obtained, and then the subsequent instruction is prefetched.
【0020】また、条件付分岐命令の後続の命令の先取
りを上述の様に行った場合、予測した方向とは逆の方向
のアドレス、即ち分岐成功側を予測した場合は、分岐不
成功側のアドレスを、分岐不成功側を予測した場合は分
岐成功側のアドレスをそれぞれセレクタ1−14に於い
てアンドゲート1−12の出力結果により選択し、バッ
ファ1−15にバッファするとともに、予測した方向を
バッファ2−15にバッファする。When the instruction subsequent to the conditional branch instruction is prefetched as described above, the address in the direction opposite to the predicted direction, that is, when the branch successful side is predicted, the branch unsuccessful side is detected. When the branch unsuccessful side is predicted, the address of the branch successful side is selected by the output result of the AND gate 1-12 in the selector 1-14, buffered in the buffer 1-15, and the predicted direction Buffer in buffer 2-15.
【0021】条件付分岐命令の分岐判定に必要な情報
は、条件付分岐命令が図2の演算実行ユニット2−6で
実行されるときに、演算実行ユニット2−6より分岐判
定情報信号1−16として命令フェッチユニット2−2
に送られこの情報とバッファ1−15にバッファされて
いる予測した方向とが論理回路1−8内で比較され、分
岐判定が行われる。この分岐判定の結果、予測した方向
と実際の分岐方向とが一致した場合には、そそまま後続
の命令の取り出しが続行され、不一致の場合には予測し
た方向で取り出した命令を取り消し、論理回路1−8に
於いてセレクタ1−6の入力として、バッファ1−15
に記憶されている予測と反対側のアドレスを選択するよ
うに選択信号1−7が生成され、正しい方向の命令の再
取り出しが行われる。The information necessary for the branch judgment of the conditional branch instruction is the branch judgment information signal 1-from the operation execution unit 2-6 when the conditional branch instruction is executed by the operation execution unit 2-6 of FIG. Instruction fetch unit 2-2 as 16
Sent to the buffer 1-15 and the predicted direction buffered in the buffer 1-15 are compared in the logic circuit 1-8 to make a branch decision. As a result of this branch determination, if the predicted direction and the actual branch direction match, the fetching of the subsequent instruction continues as it is, and if they do not match, the fetched instruction in the predicted direction is canceled and the logic circuit is canceled. The buffer 1-15 is input to the selector 1-6 at 1-8.
The select signals 1-7 are generated to select the address on the opposite side of the prediction stored in, and the refetch of the instruction in the correct direction is performed.
【0022】以上説明したように、本発明によれば、命
令によって条件付分岐命令の後続の命令の先取り方向を
指定できるので、あるプログラム中の条件付分岐命令の
分岐方向の統計をとり、またはプログラム作成時に事前
にわかれば分岐成功か不成功かいずれか頻度の多い方を
予め指示方向を指示する命令により指定すれば、予測を
誤る頻度が減少し、パイプライン構成の情報処理装置の
条件付分岐命令の乱れを減少させ性能を向上させること
が可能である。As described above, according to the present invention, the prefetch direction of the instruction subsequent to the conditional branch instruction can be specified by the instruction. Therefore, the branch direction statistics of the conditional branch instruction in a certain program can be obtained, or If a branch is successful or unsuccessful, whichever is more frequent, is specified in advance by an instruction to instruct the designated direction when the program is created, the frequency of misprediction is reduced, and the condition of the pipelined information processing device is conditional. It is possible to reduce the disorder of the branch instruction and improve the performance.
【0023】[0023]
【発明の効果】以上説明したように、本発明は、プログ
ラム毎に条件付分岐命令の後続の命令の先取り方向を指
定することが可能な為、パイプライン構成の情報処理装
置に於いても条件付分岐命令によるパイプラインの乱れ
を低下させることができ、しかも非常に少量のハードウ
ェアで性能を向上させることができる効果がある。As described above, according to the present invention, since it is possible to specify the prefetch direction of the instruction subsequent to the conditional branch instruction for each program, the condition can be satisfied even in the information processing apparatus having the pipeline structure. It is possible to reduce the disturbance of the pipeline due to the branch instruction and improve the performance with a very small amount of hardware.
【図1】本発明の一実施例の命令フェッチユニットのブ
ロック図である。FIG. 1 is a block diagram of an instruction fetch unit according to an embodiment of the present invention.
【図2】本発明が適用される情報処理装置の全体ブロッ
ク図である。FIG. 2 is an overall block diagram of an information processing apparatus to which the present invention is applied.
1−1 命令キャッシュメモリ 1−2 読み出しアドレスレジスタ 1−3 リードデータレジスタ 1−4 デコーダ 1−5 加算器 1−6 セレクタ 1−7 選択信号 1−8 論理回路 1−9 デコード信号 1−10 分岐先アドレス信号 1−11 デコード信号 1−12 アンドゲート 1−13 分岐方向指示レジスタ 1−14 セレクタ 1−15 バッファ 1−16 分岐判定情報信号 1-1 Instruction cache memory 1-2 Read address register 1-3 Read data register 1-4 Decoder 1-5 Adder 1-6 Selector 1-7 Selection signal 1-8 Logic circuit 1-9 Decode signal 1-10 Branch Destination address signal 1-11 Decode signal 1-12 AND gate 1-13 Branch direction instruction register 1-14 Selector 1-15 Buffer 1-16 Branch determination information signal
Claims (1)
条件付分岐命令である場合に、分岐成功側または分岐不
成功側のいずれかの方向を予測して、後続の命令の先取
りを行う情報処理装置における命令先取り方式におい
て、 前記情報処理装置で実行される命令群中に、前記条件付
分岐命令の後続の命令の先取り方向を指示する機能を有
する命令を有し、 該命令により予め指示された方向に基づいて、条件付分
岐命令の後続の命令の先取りを行うことを特徴とした命
令先取り方式。1. Information that prefetches an instruction and, when the fetched instruction is a conditional branch instruction, predicts the direction of either the branch successful side or the branch unsuccessful side and prefetches the subsequent instruction. In an instruction prefetching method in a processing device, a group of instructions executed by the information processing device has an instruction having a function of instructing a prefetching direction of an instruction subsequent to the conditional branch instruction, and is preliminarily designated by the instruction. The instruction prefetching method is characterized in that the instruction following the conditional branch instruction is prefetched based on the direction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1048092A JPH05224925A (en) | 1992-01-24 | 1992-01-24 | Instruction prefetching system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1048092A JPH05224925A (en) | 1992-01-24 | 1992-01-24 | Instruction prefetching system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH05224925A true JPH05224925A (en) | 1993-09-03 |
Family
ID=11751327
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP1048092A Pending JPH05224925A (en) | 1992-01-24 | 1992-01-24 | Instruction prefetching system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH05224925A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5790845A (en) * | 1995-02-24 | 1998-08-04 | Hitachi, Ltd. | System with reservation instruction execution to store branch target address for use upon reaching the branch point |
JP2013250593A (en) * | 2012-05-30 | 2013-12-12 | Renesas Electronics Corp | Semiconductor device |
US9794504B2 (en) | 2013-10-08 | 2017-10-17 | Canon Kabushiki Kaisha | Image capturing apparatus with an image sensor comprising one or more semiconductor substrates and control method thereof |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0342723A (en) * | 1989-07-11 | 1991-02-22 | Nec Corp | Data processor |
-
1992
- 1992-01-24 JP JP1048092A patent/JPH05224925A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0342723A (en) * | 1989-07-11 | 1991-02-22 | Nec Corp | Data processor |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5790845A (en) * | 1995-02-24 | 1998-08-04 | Hitachi, Ltd. | System with reservation instruction execution to store branch target address for use upon reaching the branch point |
US5878254A (en) * | 1995-02-24 | 1999-03-02 | Hitachi, Ltd. | Instruction branching method and a processor |
JP2013250593A (en) * | 2012-05-30 | 2013-12-12 | Renesas Electronics Corp | Semiconductor device |
US9794504B2 (en) | 2013-10-08 | 2017-10-17 | Canon Kabushiki Kaisha | Image capturing apparatus with an image sensor comprising one or more semiconductor substrates and control method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6338136B1 (en) | Pairing of load-ALU-store with conditional branch | |
EP0219203B1 (en) | Computer control providing single-cycle branching | |
US6209086B1 (en) | Method and apparatus for fast response time interrupt control in a pipelined data processor | |
US7266676B2 (en) | Method and apparatus for branch prediction based on branch targets utilizing tag and data arrays | |
US20040255103A1 (en) | Method and system for terminating unnecessary processing of a conditional instruction in a processor | |
US20060242394A1 (en) | Processor and processor instruction buffer operating method | |
JP2002041284A (en) | Device for contracting extended instruction word | |
JPH05224925A (en) | Instruction prefetching system | |
US6308263B1 (en) | Pipeline processing apparatus for reducing delays in the performance of processing operations | |
EP0889394B1 (en) | Program control method | |
US7010670B2 (en) | Data processing device that controls an overriding of a subsequent instruction in accordance with a conditional execution status updated by a sequencer | |
JPH05233284A (en) | Instruction prefetch system | |
US20050144427A1 (en) | Processor including branch prediction mechanism for far jump and far call instructions | |
JP3721002B2 (en) | Processor and instruction fetch method for selecting one of a plurality of fetch addresses generated in parallel to form a memory request | |
JP3335735B2 (en) | Arithmetic processing unit | |
US20020069351A1 (en) | Memory data access structure and method suitable for use in a processor | |
JP4728877B2 (en) | Microprocessor and pipeline control method | |
JP2508021B2 (en) | Data processing device | |
JP2772100B2 (en) | Parallel instruction fetch mechanism | |
JPH0793151A (en) | Instruction supplying device | |
JPH02157939A (en) | Instruction processing method and instruction processor | |
JPS60117335A (en) | Information processor | |
JP2534674B2 (en) | Information processing device | |
JP3431503B2 (en) | Information processing apparatus and program control method | |
JPH0433021A (en) | Branching instruction control system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 19980519 |