JP2534674B2 - Information processing device - Google Patents

Information processing device

Info

Publication number
JP2534674B2
JP2534674B2 JP61169132A JP16913286A JP2534674B2 JP 2534674 B2 JP2534674 B2 JP 2534674B2 JP 61169132 A JP61169132 A JP 61169132A JP 16913286 A JP16913286 A JP 16913286A JP 2534674 B2 JP2534674 B2 JP 2534674B2
Authority
JP
Japan
Prior art keywords
instruction
branch
unit
conditional branch
conditional
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.)
Expired - Lifetime
Application number
JP61169132A
Other languages
Japanese (ja)
Other versions
JPS6324421A (en
Inventor
▲隆▼ 堀川
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
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP61169132A priority Critical patent/JP2534674B2/en
Publication of JPS6324421A publication Critical patent/JPS6324421A/en
Application granted granted Critical
Publication of JP2534674B2 publication Critical patent/JP2534674B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は命令の先取りを行う情報処理装置に関し、特
に、効果的に命令の先取りを実行するために行う条件分
岐命令の分岐方向予測を、少ないハードウェアで実現す
る情報処理装置に関する。
The present invention relates to an information processing apparatus for prefetching instructions, and more particularly to predicting a branch direction of a conditional branch instruction for effectively prefetching instructions. The present invention relates to an information processing device realized with a small amount of hardware.

(従来の技術) 一般に、情報処理装置では、命令コードの取り込み
(以下、命令フェッチ)、命令コードの解読(以下、命
令デコード)、命令実行という操作を各命令について行
うことにより、プログラムを実行している。命令によっ
ては、この他に、主記憶からのオペランドのアクセス
(以下、オペランド・リード)や命令実行結果の主記憶
への書き戻し(以下、オペランド・ライト)という操作
を必要とするものもある。
(Prior Art) Generally, in an information processing apparatus, a program is executed by performing an operation of fetching an instruction code (hereinafter, instruction fetch), decoding an instruction code (hereinafter, instruction decode), and executing an instruction for each instruction. ing. In addition to this, some instructions require operations such as accessing an operand from the main memory (hereinafter, operand read) and writing back the instruction execution result to the main memory (hereinafter, operand write).

これらの情報処理装置では、命令フェッチ・オペラン
ド・リード、オペランド・ライトを主記憶制御部、命令
デコードを命令デコード部、命令の実行を命令実行部で
行っている。これらの操作は、情報処理装置内の各部分
で分担して処理されるため、連続する数命令についてこ
れらの各操作をオーバーラップさせて並列に行うことが
可能である。この点に着目し、命令を高速に実行するた
めに、数命令分の操作を並列に処理するように制御する
ことが広く行われている。これをパイプライン制御とい
い、このような制御をとっている情報処理装置をパイプ
ライン型情報処理装置と呼ぶ。
In these information processing apparatuses, the main memory control unit performs instruction fetch / operand read and operand write, the instruction decode unit performs instruction decode, and the instruction execution unit performs instruction execution. Since these operations are shared and processed by the respective parts in the information processing apparatus, it is possible to perform these operations in parallel by overlapping these operations for several consecutive instructions. Focusing on this point, in order to execute instructions at high speed, it is widely practiced to control operations of several instructions in parallel. This is called pipeline control, and an information processing apparatus that takes such control is called a pipeline type information processing apparatus.

パイプライン型情報処理装置で処理を高速に行うため
には、装置内の各部分が並列に動作する必要がある。し
かし、条件分岐命令では、その直前の命令実行が終了し
て条件コードに有効な値を設定するまで、分岐条件が成
立して分岐が行われたか否かを決められないことから、
条件分岐命令に続く命令のフェッチ、デコードを行うこ
とができない。このため、情報処理装置内の各ユニット
に空き時間が生じ、命令実行速度向上の妨げになってい
た。
In order to perform high-speed processing in the pipeline type information processing device, it is necessary that the respective parts in the device operate in parallel. However, with a conditional branch instruction, it is not possible to determine whether or not the branch condition was met and the branch was taken until the execution of the instruction immediately before that was completed and a valid value was set in the condition code.
The instruction following the conditional branch instruction cannot be fetched or decoded. Therefore, each unit in the information processing device has an idle time, which hinders the improvement of the instruction execution speed.

分岐命令には、1)命令コード中に設定された分岐距
離を現在のプログラム・カウンタに加えて分岐先アドレ
スを求める相対分岐と、2)現在のプログラム・カウン
タの値に関係なく命令コードで指定された情報および汎
用レジスタの値から分岐先アドレスを求める絶対分岐の
2種類がある。一般には、条件分岐命令では、相対分岐
が用いられることが多い。この場合、命令コード(第4
図)中に指定する分岐距離は、実行可能な機械語プログ
ラムを作成する時に決められる。分岐距離が負の場合
は、現在のプログラム・カウンタを減算する、すなわ
ち、プログラムにおいて後方への分岐を意味している。
逆に、分岐距離が正の値の場合は、現在のプログラム・
カウンタを加算する、すなわち、プログラムにおいて前
方への分岐を意味している。
For a branch instruction, 1) a relative branch in which the branch distance set in the instruction code is added to the current program counter to obtain the branch destination address, and 2) the instruction code is specified regardless of the current program counter value. There are two types of absolute branching in which the branch destination address is obtained from the stored information and the value of the general-purpose register. In general, a conditional branch instruction often uses a relative branch. In this case, the instruction code (4th
The branch distance specified in the figure is determined when creating an executable machine language program. If the branch distance is negative, it means that the current program counter is subtracted, that is, the branch is backward in the program.
Conversely, if the branch distance is a positive value, the current program
It means to increment the counter, that is, to branch forward in the program.

この問題点を解決するために、条件分岐命令で指定さ
れる分岐距離の正負から分岐するか否かの分岐予測をし
て命令の先取り方向を決める方式や、分岐命令の履歴情
報を情報処理装置内に残しておき、これをもとに命令の
先取り方向を制御する方式が提案されている。
In order to solve this problem, a method of determining a prefetch direction of an instruction by predicting whether to branch based on whether the branch distance specified by a conditional branch instruction is positive or negative, and history information of the branch instruction are used as an information processing device. A method of controlling the instruction prefetch direction based on this is proposed.

(発明が解決しようとする問題点) パイプライン型情報処理装置の処理速度を向上させる
ための条件分岐命令予測を、条件分岐命令で指定される
分岐距離の正負から分岐予測をして命令の先取り方向を
決める方式では、予測精度が低いという問題があった。
また、分岐命令の履歴情報をもとにして行う方式では、
複雑な処理を行うために多量のハードウェアを必要とす
る欠点があった。
(Problems to be Solved by the Invention) A conditional branch instruction prediction for improving the processing speed of a pipeline type information processing apparatus is prefetched by predicting a branch from a positive or negative branch distance specified by a conditional branch instruction. The method of determining the direction has a problem that the prediction accuracy is low.
Also, in the method that is performed based on the history information of branch instructions,
There is a drawback that a large amount of hardware is required to perform complicated processing.

(問題点を解決するための手段) 本発明による情報処理装置では、前記の問題点を解決
するため、分岐命令の種類および分岐距離を入力として
分岐予測を行う条件分岐予測部を持たせることにより、
少ないハードウェアで精度の良い分岐予測を行って命令
の先取り方向を決める。
(Means for Solving Problems) In the information processing apparatus according to the present invention, in order to solve the above problems, by providing a conditional branch prediction unit that performs branch prediction with the type of the branch instruction and the branch distance as inputs. ,
Decide the instruction prefetch direction by performing accurate branch prediction with less hardware.

(作用) 本発明の基本構成を第1図に示す。第1図においてプ
ログロムの実行中に、条件分岐命令が命令レジスタ3に
セットされると、条件分岐認識部4より分岐の条件、分
岐距離認識部5より分岐距離に対応する値が出力される
ので、これを条件分岐予測部6に入力する。条件分岐予
測部では、与えられた情報から条件分岐命令の分岐予測
を行い、この結果を命令先取り部7に送る。この分岐予
測により分岐されると判断されると、命令先取り部7で
は、分岐先より命令コードのフェッチを行う。また、分
岐予測により分岐しないと判断されると、命令先取り部
7では、条件分岐命令の次の命令から命令コードフェッ
チを行う。
(Operation) The basic configuration of the present invention is shown in FIG. In FIG. 1, when a conditional branch instruction is set in the instruction register 3 during execution of the program, the conditional branch recognition unit 4 outputs a branch condition and the branch distance recognition unit 5 outputs a value corresponding to the branch distance. , And inputs this to the conditional branch prediction unit 6. The conditional branch prediction unit performs branch prediction of the conditional branch instruction from the given information, and sends the result to the instruction prefetching unit 7. When it is determined by the branch prediction that the branch is taken, the instruction prefetching unit 7 fetches the instruction code from the branch destination. If the branch prediction determines that the branch is not taken, the instruction prefetch unit 7 fetches the instruction code from the instruction next to the conditional branch instruction.

このような制御を行うことにより、条件分岐命令実行
時において情報処理装置内の各部分に生じる空き時間を
少なくして、命令実行速度を向上させることができる。
By performing such control, it is possible to reduce the idle time that occurs in each part in the information processing device when the conditional branch instruction is executed, and improve the instruction execution speed.

(実施例) 本実施例では、情報処理装置の内部を第2図に示すよ
うに分割して説明する。図において、主記憶制御部12
は、主記憶のアクセスを行う部分であり、命令先取り部
2を内部に持つ。主記憶制御部12の内部にメモリ管理機
構やキャッシュ・メモリを持つ情報処理装置もある。命
令デコーダ13は命令のデコードを行う部分であり、条件
分岐認識部4、分岐距離認識部5、条件分岐予測部6を
内部に持つ。命令実行部14は命令を実行する部分であ
る。
(Embodiment) In the present embodiment, the inside of the information processing apparatus will be divided as shown in FIG. In the figure, the main memory control unit 12
Is a part for accessing the main memory, and has the instruction prefetching part 2 inside. There is also an information processing device having a memory management mechanism and a cache memory inside the main memory control unit 12. The instruction decoder 13 is a portion that decodes instructions, and has a conditional branch recognition unit 4, a branch distance recognition unit 5, and a conditional branch prediction unit 6 inside. The instruction execution unit 14 is a portion that executes an instruction.

第3図は、本実施例における命令デコーダ13の構成を
示す図である。図において、条件分岐認識部4の内部に
おかれている条件分岐命令判定部20は、命令レジスタ3
に格納された命令コードが条件分岐命令かどうかを判定
する部分、ゲート21は、条件分岐判定部20により、命令
レジスタ3に格納された命令コードが条件分岐命令であ
ると判定されたときに、分岐の条件を条件分岐予測部に
出力する部分である。分岐距離認識部5の内部におかれ
ている否定部22は分岐距離の各ビットについて論理否定
を行う部分、セレクタ部23は2つの入力のうち一方を出
力する部分、FF1部24は入力データの最上位ビットから
サーチを行い最初に1が見つかったビットの位置を2進
数で出力する部分である。条件分岐予測部6の内部にお
かれている分岐予測テーブル25は、例えば、負の分岐距
離でしかも近ければ分岐する可能性が高い、といったよ
うなあらかじめ調査された分岐特性を記録させたメモリ
であり、このメモリに対して入力される分岐条件、分岐
距離に応じて1ビットの分岐予測結果を出力する。な
お、このメモリの内容は、プログラム実行を通して変化
しない。この点が、過去に実行された分岐命令の履歴を
記録するためのヒストリ・テーブルと異なっている。
FIG. 3 is a diagram showing the configuration of the instruction decoder 13 in this embodiment. In the figure, the conditional branch instruction determination unit 20 provided inside the conditional branch recognition unit 4 is the instruction register 3
The gate 21 determines whether the instruction code stored in the instruction branch instruction is a conditional branch instruction. When the conditional branch determination unit 20 determines that the instruction code stored in the instruction register 3 is a conditional branch instruction, It is a part that outputs the condition of the branch to the conditional branch prediction unit. The NOT unit 22 inside the branch distance recognition unit 5 performs a logical NOT operation on each bit of the branch distance, the selector unit 23 outputs one of the two inputs, and the FF1 unit 24 inputs the input data. This is a part for performing a search from the most significant bit and outputting the position of the bit where the first 1 is found in a binary number. The branch prediction table 25 provided inside the conditional branch prediction unit 6 is a memory in which branch characteristics investigated in advance, such as a high possibility of branching if the branch distance is negative and short, are recorded. Yes, a 1-bit branch prediction result is output according to the branch condition and the branch distance input to this memory. The contents of this memory do not change during the execution of the program. This point is different from the history table for recording the history of branch instructions executed in the past.

第4図は、本実施例で説明する情報処理装置における
条件分岐命令の命令形式を示す図である。図において、
命令コード31は8ビットであり、その内、上位4ビット
は、条件分岐命令であることを示す値32、下位4ビット
は分岐する条件を示す値33である。また、分岐距離は2
の補数で表現され、この最上位ビットは符号ビット35で
ある。
FIG. 4 is a diagram showing an instruction format of a conditional branch instruction in the information processing apparatus described in this embodiment. In the figure,
The instruction code 31 is 8 bits, of which the upper 4 bits have a value 32 indicating a conditional branch instruction, and the lower 4 bits have a value 33 indicating a branching condition. The branch distance is 2
The most significant bit is the sign bit 35.

なお、本発明では、相対分岐命令の場合にプログラム
カウンタに加えるという意味で“分岐距離”を用いてい
るが、このような概念は、例えば、文献(A CASE STUDY
OF VAX−11 INSTRUCTION SET USAGE FOR COMPILER EXE
CUTION,PP177−184,PROCEEDINGS OF SYMPOSIUM ON ARCH
ITECTUAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPE
RATING SYSTEMS,MARCH 1−3,1982)の中に“BRANCH DIS
PLACEMENT"として用いられているように周知である。ま
た“条件分岐命令の命令形式”についても、例えば、イ
ンテル8086マイクロプロセッサ(16ビット・マイクロプ
ロセッサ、1982年bit5月号別冊、30頁の図)にあるとお
り、相対分岐命令の場合、分岐コードと分岐距離からな
ることは周知である。
In the present invention, “branch distance” is used in the sense that it is added to the program counter in the case of a relative branch instruction, but such a concept is described in, for example, the literature (A CASE STUDY
OF VAX-11 INSTRUCTION SET USAGE FOR COMPILER EXE
CUTION, PP177−184, PROCEEDINGS OF SYMPOSIUM ON ARCH
ITECTUAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPE
RATING SYSTEMS, MARCH 1-3-2,1982) in “BRANCH DIS
It is well known as being used as "PLACEMENT". Also, regarding "instruction format of conditional branch instruction", for example, Intel 8086 microprocessor (16-bit microprocessor, 1982 bit May issue, supplement, page 30) It is well known that a relative branch instruction is composed of a branch code and a branch distance, as described in 1.

まず、本実施例における情報処理装置で通常の命令を
実行する手順を示す。
First, a procedure for executing a normal instruction in the information processing apparatus according to this embodiment will be described.

主記憶11に格納されている命令コードは、命令先取り
部2により制御される主記憶制御部12によって主記憶ア
クセス・バス15を通して取り出され、命令コード・バス
16を通して命令デコーダ13内の命令レジスタ3に送られ
る。命令デコーダ13では、命令レジスタ3に設定された
命令コードをデコードし、次に実行すべき命令で扱うオ
ペランドのアドレスおよびオペランドのリード、ライト
の区別を主記憶制御部12にアドレス・バス17を通して送
ると共に、命令で行う操作に関する情報を、命令デコー
ダ結果バス18を通して命令実行部14に送る。主記憶制御
部12では、リードすべきオペランドについて、命令デコ
ーダ13から送られたオペランド・アドレスを主記憶バス
15を通してアクセスし、次の命令実行に必要なオペラン
ドを用意する。命令実行部14では、命令デコード結果バ
ス18を通して指定される「命令で行う操作」を、主記憶
制御部12が用意したオペランドをデータ・バス19を通し
て取り出し、これを用いて実行する。さらに、命令の実
行結果を主記憶11に格納する必要のあるときには、デー
タ・バス19を通して実行結果を主記憶制御部12に送る。
主記憶制御部12では、ライトする必要のあるオペランド
が命令実行部14から送られると、あらかじめ命令デコー
ダ13から送られたオペランド・アドレスで指定される位
置に、主記憶バス15を通して、このオペランドをライト
する。
The instruction code stored in the main memory 11 is fetched through the main memory access bus 15 by the main memory control unit 12 controlled by the instruction prefetching unit 2, and the instruction code bus
It is sent to the instruction register 3 in the instruction decoder 13 through 16. The instruction decoder 13 decodes the instruction code set in the instruction register 3 and sends the address of the operand handled by the instruction to be executed next and the distinction between read and write of the operand to the main memory control unit 12 through the address bus 17. At the same time, information regarding the operation performed by the instruction is sent to the instruction execution unit 14 through the instruction decoder result bus 18. In the main memory control unit 12, for the operand to be read, the operand address sent from the instruction decoder 13 is transferred to the main memory bus.
Access through 15 and prepare the operands required to execute the next instruction. The instruction execution unit 14 fetches the operands prepared by the main memory control unit 12 through the data bus 19 and executes the "operation performed by the instruction" designated through the instruction decode result bus 18 using this. Further, when it is necessary to store the execution result of the instruction in the main memory 11, the execution result is sent to the main memory control unit 12 through the data bus 19.
In the main memory control unit 12, when the operand that needs to be written is sent from the instruction execution unit 14, the operand is sent to the position specified by the operand address sent from the instruction decoder 13 in advance through the main memory bus 15. To write.

実行すべき命令が分岐命令の場合、命令デコーダ13よ
り分岐先アドレスがアドレス・バス17を通して主記憶制
御部12に送られる。主記憶制御部12では、分岐先アドレ
スより命令フェッチを行うことで分岐が行なわれる。
When the instruction to be executed is a branch instruction, the instruction decoder 13 sends the branch destination address to the main memory control unit 12 through the address bus 17. The main memory control unit 12 branches by fetching an instruction from the branch destination address.

次に、この情報処理装置により、条件分岐命令の分岐
予測の手順を示す。
Next, the procedure of branch prediction of a conditional branch instruction by this information processing apparatus will be shown.

命令レジスタ3の上位4ビットは、条件分岐判定部20
に入力されており、第4図に示す条件分岐命令30が命令
レジスタ3に判定されると、条件分岐命令判定部20の出
力が有効になるため、ゲート21を通して命令レジスタの
下位4ビットが条件分岐認識部4の出力となる。条件分
岐命令判定部20の出力が無効のときには、条件分岐認識
部4の出力は無効になる。
The upper 4 bits of the instruction register 3 are the conditional branch determination unit 20.
When the conditional branch instruction 30 shown in FIG. 4 is judged by the instruction register 3, the output of the conditional branch instruction judgment unit 20 becomes valid, so that the lower 4 bits of the instruction register are processed through the gate 21. It is the output of the branch recognition unit 4. When the output of the conditional branch instruction determination unit 20 is invalid, the output of the conditional branch recognition unit 4 is invalid.

命令レジスタ3の内、分岐距離を表すフィールドは分
岐距離認識部5に入力される。分岐距離のうち符号ビッ
ト35が0のときは正の分岐距離を表しており、符号ビッ
ト35が1のときは負の分岐距離を表している。この符号
ビット35により、セレクタ部23を制御する。すなわち、
符号ビット35が0のときは分岐距離のフィールドをFF1
部24に入力し、符号ビットが1のときは分岐距離を示す
フィールドの各ビットを否定部22によって反転したもの
をFF1部24に入力するようにセレクタ部23によって切り
換える。FF1部24では、最上位のビットからサーチを行
って、最初に1が見つかったビット位置を出力する。こ
の操作によって、分岐距離の有効ビット長がFF1部24よ
り出力され、符号ビット35と共に分岐処理認識部5の出
力となる。
A field indicating the branch distance in the instruction register 3 is input to the branch distance recognition unit 5. When the sign bit 35 of the branch distance is 0, it represents a positive branch distance, and when the sign bit 35 is 1, it represents a negative branch distance. The sign unit 35 controls the selector unit 23. That is,
When the sign bit 35 is 0, the branch distance field is FF1.
When the sign bit is 1, the selector unit 23 switches so that each bit of the field indicating the branch distance is inverted by the negating unit 22 and is input to the FF1 unit 24. The FF1 unit 24 searches from the most significant bit, and outputs the bit position where 1 is first found. By this operation, the effective bit length of the branch distance is output from the FF1 unit 24 and is output together with the sign bit 35 to the branch processing recognition unit 5.

この分岐距離の有効ビット長は、分岐距離の絶対値の
大きさを2のべき乗で表している。すなわち、この有効
ビット長がnの場合は、分岐距離の絶対値は、2n-1
ら、2n−1の範囲にあることを示している。
The effective bit length of the branch distance represents the magnitude of the absolute value of the branch distance as a power of 2. That is, when the effective bit length is n, the absolute value of the branch metric from 2 n-1, indicates that the range of 2 n -1.

条件分岐予測部6内部の分岐予測テーブル25には、条
件分岐認識部4から送られる分岐条件と分岐距離認識部
5から送られる分岐距離の有効ビット長を示す値がアド
レスとして入力されている。このテーブルには、あらか
じめ調査された分岐特性から、分岐条件と分岐距離の有
効ビット長をもとにして行う条件分岐予測が設定されて
いる。予測結果は、条件分岐命令において分岐すると予
想されるときに有効になるように定義される。条件分岐
認識部4から送られる分岐条件を示す値が有効であると
きに、分岐予測テーブル25から予測結果が出力される。
条件分岐認識部4からの入力が無効のときには分岐予測
テーブル25からの出力も無効となる。分岐予測テーブル
25からの出力は、条件分岐予測部6の出力として命令先
取り部2に送られる。
In the branch prediction table 25 inside the conditional branch prediction unit 6, a value indicating an effective bit length of a branch condition sent from the conditional branch recognition unit 4 and a branch distance sent from the branch distance recognition unit 5 is input as an address. In this table, the conditional branch prediction is set based on the branch condition and the effective bit length of the branch distance from the branch characteristics investigated in advance. The prediction result is defined to be valid when it is expected to branch in the conditional branch instruction. When the value indicating the branch condition sent from the conditional branch recognition unit 4 is valid, the prediction result is output from the branch prediction table 25.
When the input from the conditional branch recognition unit 4 is invalid, the output from the branch prediction table 25 is also invalid. Branch prediction table
The output from 25 is sent to the instruction prefetching unit 2 as the output of the conditional branch prediction unit 6.

したがって、命令先取り部2に送られる予測結果7の
有効、無効はそれぞれ以下の意味を持つ。
Therefore, the validity and invalidity of the prediction result 7 sent to the instruction prefetching unit 2 have the following meanings.

予測結果7が有効:命令レジスタ3に格納されている
命令が条件分岐命令であり、かつ、この分岐命令で分岐
すると予想される。
Prediction result 7 is valid: the instruction stored in instruction register 3 is a conditional branch instruction, and it is expected that a branch will occur at this branch instruction.

予測結果7が無効:命令レジスタ3に格納されている
命令が条件分岐命令でない、または、分岐命令で分岐し
ないと予想される。
Prediction result 7 is invalid: It is expected that the instruction stored in the instruction register 3 is not a conditional branch instruction or does not branch with a branch instruction.

命令先取り部2では、条件分岐予測部6から出力され
た予測結果7が有効のときには、アドレス・バス17を通
して送られる分岐先アドレスより命令フェッチを開始す
るように主記憶制御部12を制御する。また、条件分岐予
測部6から出力された予測結果7が無効であるときに
は、後続命令をフェッチするように主記憶制御部12を制
御する。
When the prediction result 7 output from the conditional branch prediction unit 6 is valid, the instruction prefetching unit 2 controls the main memory control unit 12 to start the instruction fetch from the branch destination address sent through the address bus 17. When the prediction result 7 output from the conditional branch prediction unit 6 is invalid, the main memory control unit 12 is controlled to fetch the subsequent instruction.

このような制御を行うことにより、分岐すると予想さ
れる条件分岐命令において、分岐が成立するより前に命
令コートをフェッチすることを可能とする。
By performing such control, it becomes possible to fetch the instruction code before the branch is taken in the conditional branch instruction expected to branch.

(発明の効果) 本発明による情報処理装置では、分岐命令の履歴情報
を基にして分岐予測を行う方式に比較して少ないハード
ウェアで条件分岐命令の予測を行うことができる。ま
た、分岐距離の正負のみから分岐予測を行う方式と比較
すると、本発明では、分岐距離の大きさに応じて分岐予
測を設定できるため、これにより精度の良い予測ができ
る。このため、少ないハードウェアにより、条件分岐命
令を高速に実行できる情報処理装置を構成することが可
能になる。
(Effect of the Invention) In the information processing apparatus according to the present invention, it is possible to predict a conditional branch instruction with less hardware as compared with a method of performing branch prediction based on history information of branch instructions. Further, in the present invention, the branch prediction can be set according to the size of the branch distance, as compared with the method in which the branch prediction is performed only from the positive or negative of the branch distance. Therefore, it is possible to configure an information processing device capable of executing a conditional branch instruction at high speed with a small amount of hardware.

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

第1図は、本発明の構成要素を示す図、第2図は、本発
明の一実施例における情報処理装置の構成を示す図、第
3図は、本発明の一実施例における命令デコーダの構成
を示す図、第4図は、本発明の一実施例における情報処
理装置で実行可能な機械語命令の内、条件分岐命令の命
令形式、すなわち、命令コードに含まれる情報、およ
び、その指定方法を示す図である。 図において、 2……命令先取り部、3……命令レジスタ 4……条件分岐認識部、5……分岐距離認識部 6……条件分岐予測部、7……予測結果 10……プロセッサ、11……主記憶 12……主記憶制御部、13……命令デコーダ 14……命令実行部、15……主記憶アクセス・バス 16……命令コード・バス、17……アドレス・バス 18……命令デコード結果バス、19……データ・バス 20……条件分岐判定部、21……ゲート 22……否定部、23……セレクタ部 24……FF1部、25……分岐予測テーブル 30……条件分岐命令、31……命令コード 32……条件分岐であることを示す値 33……分岐する条件を示す値 34……分岐距離、35……符号ビット。
FIG. 1 is a diagram showing components of the present invention, FIG. 2 is a diagram showing a configuration of an information processing device in one embodiment of the present invention, and FIG. 3 is a diagram of an instruction decoder in one embodiment of the present invention. FIG. 4 and FIG. 4 show the configuration of the instruction format of the conditional branch instruction, that is, the information included in the instruction code among the machine language instructions that can be executed by the information processing apparatus according to the embodiment of the present invention, and its designation. It is a figure which shows the method. In the figure, 2 ... Instruction prefetch unit, 3 ... Instruction register 4 ... Conditional branch recognition unit, 5 ... Branch distance recognition unit 6 ... Conditional branch prediction unit, 7 ... Prediction result 10 ... Processor, 11 ... … Main memory 12 …… Main memory control unit, 13 …… Instruction decoder 14 …… Instruction execution unit, 15 …… Main memory access bus 16 …… Instruction code bus, 17 …… Address bus 18 …… Instruction decode Result bus, 19 ... Data bus 20 ... Conditional branch judgment unit, 21 ... Gate 22 ... Negation unit, 23 ... Selector unit 24 ... FF1 unit, 25 ... Branch prediction table 30 ... Conditional branch instruction , 31 ...... Instruction code 32 ...... Value indicating conditional branch 33 ...... Value indicating branching condition 34 ...... Branch distance, 35 …… Sign bit.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】命令の先取りを行う命令先取り部、命令を
格納するための命令レジスタを持つ情報処理装置におい
て、命令レジスタに格納された命令を入力として、これ
が条件分岐命令であることを認識し分岐の条件を出力す
る条件分岐認識部、命令レジスタに格納された命令を入
力し分岐距離に対応する値を出力する分岐距離認識部、
前記の条件分岐認識部と分岐距離認識部からの出力をも
とに分岐方向の予測を行う条件分岐予測部を持たせ、条
件分岐予測部から出力される予測結果を命令先取り部に
入力することにより、命令先取り部で行う命令の先取り
方向を制御することを特徴とする情報処理装置。
1. An information processing device having an instruction prefetching unit for prefetching instructions and an instruction register for storing instructions, recognizing that the instruction stored in the instruction register is an input and is a conditional branch instruction. A conditional branch recognition unit that outputs a branch condition, a branch distance recognition unit that inputs an instruction stored in an instruction register and outputs a value corresponding to a branch distance,
A conditional branch prediction unit for predicting a branch direction based on outputs from the conditional branch recognition unit and the branch distance recognition unit is provided, and the prediction result output from the conditional branch prediction unit is input to the instruction prefetch unit. An information processing apparatus, wherein the instruction prefetching direction is controlled by the instruction prefetching unit.
JP61169132A 1986-07-17 1986-07-17 Information processing device Expired - Lifetime JP2534674B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61169132A JP2534674B2 (en) 1986-07-17 1986-07-17 Information processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61169132A JP2534674B2 (en) 1986-07-17 1986-07-17 Information processing device

Publications (2)

Publication Number Publication Date
JPS6324421A JPS6324421A (en) 1988-02-01
JP2534674B2 true JP2534674B2 (en) 1996-09-18

Family

ID=15880874

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61169132A Expired - Lifetime JP2534674B2 (en) 1986-07-17 1986-07-17 Information processing device

Country Status (1)

Country Link
JP (1) JP2534674B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2734091B2 (en) * 1989-05-31 1998-03-30 ソニー株式会社 Laser drive circuit

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5991552A (en) * 1982-11-17 1984-05-26 Nec Corp Instruction prefetch device having set associative type history table
JPS6051948A (en) * 1983-08-31 1985-03-23 Hitachi Ltd Branch destination buffer storage device

Also Published As

Publication number Publication date
JPS6324421A (en) 1988-02-01

Similar Documents

Publication Publication Date Title
KR100208889B1 (en) Parallel processing device amd parallel processing method
EP0368332B1 (en) Pipeline data processor
JP3599409B2 (en) Branch prediction device
US6654875B1 (en) Dual microcode RAM address mode instruction execution using operation code RAM storing control words with alternate address indicator
US20160055004A1 (en) Method and apparatus for non-speculative fetch and execution of control-dependent blocks
JPS6393038A (en) Computer
US7984280B2 (en) Storing branch information in an address table of a processor
JPH07120284B2 (en) Data processing device
JP2534674B2 (en) Information processing device
JP3599499B2 (en) Central processing unit
JP2002342075A (en) Microprocessor
JP3335735B2 (en) Arithmetic processing unit
WO1984000833A1 (en) Pre-execution next address calculating mechanism
JP2591325B2 (en) Branch control device
US6289439B1 (en) Method, device and microprocessor for performing an XOR clear without executing an XOR instruction
JP3471691B2 (en) Branch instruction control method in micro instruction
JP2503223B2 (en) Prior control method
JP3147884B2 (en) Storage device and information processing device
KS Central processing unit
JPS61273637A (en) Information processor
JPH01239638A (en) Information processor performing branch prediction
JPS63221427A (en) Information processor for branch estimation
JPS6336336A (en) Information processor
Ibbett et al. Instruction Buffers
JPS63168730A (en) Branching instruction processor