JPH05313894A - Information processor - Google Patents

Information processor

Info

Publication number
JPH05313894A
JPH05313894A JP14367792A JP14367792A JPH05313894A JP H05313894 A JPH05313894 A JP H05313894A JP 14367792 A JP14367792 A JP 14367792A JP 14367792 A JP14367792 A JP 14367792A JP H05313894 A JPH05313894 A JP H05313894A
Authority
JP
Japan
Prior art keywords
instruction
branch
branch destination
operand
storage means
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
JP14367792A
Other languages
Japanese (ja)
Inventor
Tomoyuki Shotani
庄谷智之
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox 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 Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP14367792A priority Critical patent/JPH05313894A/en
Publication of JPH05313894A publication Critical patent/JPH05313894A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To execute instruction at a high speed by separating a branching destination instruction among the instruction executed by a pipeline system into an operation code and an operand to be stored along with the address of the branching destination. CONSTITUTION:In the information processor for executing an instruction set constituted of the instructions with the plural kinds of instruction lengths by the pipeline system, an instruction prefetch device 11 prefetches a variable length instruction and an instruction decoder 12 separates the instruction into the operation code and the operand to be temporarily stored in an instruction prefetch buffer 13. Then, the instruction decoder 16 of the pipeline system receives the operation code at every byte from the buffer 13 to be decoded. An instruction executing part 17 executes the instructions using the operand corresponding to the decoded instruction and separates the branching destination instruction among them into the operation code and the operand to be stored in a branch target cache 15 along with the branching destination address.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は情報処理装置に係り、特
にブランチターゲットキャッシュを備え分岐命令を高速
に実行する情報処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information processing apparatus, and more particularly to an information processing apparatus having a branch target cache for executing branch instructions at high speed.

【0002】[0002]

【従来の技術】従来、コンピュータ等の情報処理装置は
実行する命令をダイナミックランダムアクセスメモリを
用いて構成した主記憶装置に蓄えて、順次中央処理装置
に命令を取り出してデコードし、オペランドを用意して
実行し、結果を格納するという順序で処理を行ってい
る。一般的に処理を高速にするためにパイプライン方式
が採用されている。パイプライン方式を用いた場合、各
パイプラインステージ間で主記憶装置に対するアクセス
の競合が発生し、パイプラインの流れが乱れるのを防ぐ
ために、命令デコードステージの前に命令プリフェッチ
バッファを設け、常にこれから実行されるであろう命令
を数命令蓄えておく。ところが、上記のような命令プリ
フェッチバッファを有するパイプライン方式では分岐命
令やプロシージャコール、リターン等の命令の流れを変
える命令を実行した時に、その時点で命令プリフェッチ
バッファにおいて実行を待っていた命令群が実行される
ことなく無駄になってしまうばかりか、分岐先の命令を
フェッチするまでの間、パイプラインを停止させてしま
う。この問題を回避するために、命令をすべてキャッシ
ュしておく手段を設けたり(特開昭63−56731号
公報参照)、固定長の命令セットを持つRISCプロセ
ッサの場合であったならば、「Am29000(32−
Bit.Streamlined.Instructi
on Processor)32ビットRISCマイク
ロプロセッサユーザーズマニュアル(日本語版)上巻
(日本AMD株式会社、1989年1月)」に記載され
ているように、分岐命令が発生した時に分岐先の命令を
アドレスとともにブランチターゲットキャッシュにキャ
ッシュしておき、次に分岐命令が実行されたときには分
岐先のアドレスをブランチターゲットキャッシュにキャ
ッシュしてあるアドレスと比較して、分岐先のアドレス
の命令がキャッシュに存在する場合にはパイプラインの
流れを止めることなく処理を続けることができるように
工夫されている。
2. Description of the Related Art Conventionally, an information processing apparatus such as a computer stores instructions to be executed in a main memory constructed by using a dynamic random access memory, sequentially fetches and decodes the instructions to a central processing unit, and prepares operands. The process is performed in the order of executing and executing and storing the result. Generally, a pipeline method is adopted to increase the processing speed. When using the pipeline method, an instruction prefetch buffer is provided in front of the instruction decode stage in order to prevent the contention of access to the main memory between each pipeline stage and the disturbance of the flow of the pipeline. Store a few instructions that will be executed. However, in the pipeline method having the instruction prefetch buffer as described above, when an instruction that changes the flow of instructions such as a branch instruction, a procedure call, and a return is executed, the instruction group waiting for execution in the instruction prefetch buffer at that time is Not only is it wasted without being executed, but the pipeline is stopped until the instruction at the branch destination is fetched. In order to avoid this problem, a means for caching all the instructions is provided (see Japanese Patent Application Laid-Open No. 63-56731), and in the case of a RISC processor having a fixed length instruction set, "Am29000" is used. (32-
Bit. Streamlined. Instructi
on Processor) 32-bit RISC Microprocessor User's Manual (Japanese Version), Volume 1 (Japan AMD Co., Ltd., January 1989) ”, the branch destination instruction is branched together with the address when the branch instruction occurs. When the branch instruction is cached in the target cache and the branch instruction is executed next time, the branch target address is compared with the address cached in the branch target cache. It is devised so that processing can be continued without stopping the flow of the pipeline.

【0003】[0003]

【発明が解決しようとする課題】しかし、プログラムが
主記憶装置を占める領域を最小にするために命令の長さ
を可変長としたアーキテクチャでは命令デコードステー
ジに時間がかかってしまう。パイプライン方式において
各ステージの処理時間は等しくなるよう設定されるが、
その処理時間は最も処理時間の長いステージによって決
定される。したがって、上述のように命令デコードステ
ージの処理時間が大きいと、他のすべてのステージの処
理時間がそれに規定されるので、前述のパイプライン方
式において命令の長さを可変長としたアーキテクチャを
適用することは困難であった。この問題を解決するため
に、命令プリフェッチバッファに蓄えておく命令をあら
かじめ一部デコードしておくことが考えられる。これに
よれば、可変長の命令セットを実行するのであるから、
命令長の判定や、命令コードに含まれているオペランド
の分離などをあらかじめ行うので、パイプラインのデコ
ードステージを高速に実行できることが考えられる。し
かし、このようにあらかじめ命令の一部をデコードして
バッファに蓄えておく場合では、前述のブランチターゲ
ットキャッシュを有効に利用することができなかった。
すなわち、分岐命令が発生した時はキャッシュがヒット
しても、それからブランチターゲットキャッシュに入っ
ている命令の命令長の判定や、命令コードに含まれてい
るオペランドの分離などを実行する必要があるために、
ブランチターゲットキャッシュの効果を半減させてしま
うという問題があった。そこで、本発明においては上記
の事情を鑑み複数の種類の命令長の命令から構成される
命令セットをパイプライン方式により実行する情報処理
装置において、命令を一層高速に実行することができる
ようにすることを目的とする。本発明において、この目
的は、ブランチターゲットキャッシュにあらかじめプリ
デコードした命令をキャッシュしておき、分岐命令が発
生した時にブランチターゲットキャッシュに分岐先の命
令がキャッシュされている場合に、ブランチターゲット
キャッシュから命令バッファに各々の命令のオペレーシ
ョンコードとオペランドをプリデコードした形で入力す
るようにし、分岐命令によるパイプラインのオーバーヘ
ッドや、命令フェッチの待ち時間を減少させることによ
り、達成される。
However, in the architecture in which the instruction length is variable in order to minimize the area occupied by the program in the main memory, the instruction decoding stage takes a long time. In the pipeline method, the processing time of each stage is set to be equal,
The processing time is determined by the stage with the longest processing time. Therefore, if the processing time of the instruction decode stage is large as described above, the processing time of all the other stages is regulated to that. Therefore, the architecture in which the instruction length is variable in the pipeline method is applied. It was difficult. In order to solve this problem, it is conceivable to partially decode the instructions stored in the instruction prefetch buffer in advance. According to this, because it executes a variable length instruction set,
Since the instruction length is determined and the operands included in the instruction code are separated in advance, it is considered that the decode stage of the pipeline can be executed at high speed. However, in the case where a part of the instruction is decoded and stored in the buffer in advance as described above, the branch target cache described above cannot be effectively used.
In other words, even if the cache hits when a branch instruction occurs, it is necessary to determine the instruction length of the instruction in the branch target cache and to separate the operands included in the instruction code. To
There was a problem that the effect of the branch target cache was halved. Therefore, in the present invention, in view of the above circumstances, in an information processing apparatus that executes an instruction set including instructions of a plurality of types of instruction lengths by a pipeline method, it is possible to execute instructions at higher speed. The purpose is to In the present invention, an object of the present invention is to cache a predecoded instruction in a branch target cache in advance, and when the branch target cache caches a branch target instruction when a branch instruction occurs, an instruction from the branch target cache is stored. This is achieved by inputting the operation code and operand of each instruction in the buffer in a predecoded form, and reducing the pipeline overhead due to the branch instruction and the instruction fetch waiting time.

【0004】[0004]

【課題を解決するための手段】前記課題を解決するため
に、本発明の情報処理装置は、少なくとも一つの可変長
の命令をプリフェッチするプリフェッチ手段(図1の1
1)と、そのプリフェッチ手段によってプリフェッチさ
れた可変長の命令をオペレーションコードとオペランド
とに分離する分離手段(12)と、その分離手段によっ
て分離されたオペレーションコードおよびオペランドの
組からなる少なくとも一つの命令を一時的に格納する命
令格納手段(13)と、パイプライン方式により、命令
格納手段に格納された命令を実行する命令実行手段(1
6,17)と、この命令実行手段によって実行される命
令のうち、少なくとも一つの分岐先命令を、オペレーシ
ョンコードとオペランドに分離して、分岐先のアドレス
とともに格納しておく分岐先命令格納手段(15)とを
備えている。
In order to solve the above-mentioned problems, the information processing apparatus of the present invention comprises a prefetch means (1 in FIG. 1) for prefetching at least one variable length instruction.
1), a separating means (12) for separating a variable length instruction prefetched by the prefetching means into an operation code and an operand, and at least one instruction consisting of a set of an operation code and an operand separated by the separating means. And an instruction executing means (1) for executing the instruction stored in the instruction storing means by a pipeline method.
6, 17) and at least one branch destination instruction of the instructions executed by the instruction executing means is separated into an operation code and an operand and stored together with the branch destination address ( 15) and are provided.

【0005】前記プリフェッチ手段は、本発明の具体的
態様では、一度に複数の可変長の命令群をまとめてプリ
フェッチするようにすることができる。
According to a specific aspect of the present invention, the prefetch means can collectively prefetch a plurality of variable length instruction groups at a time.

【0006】また、前記分離手段は、本発明の具体的態
様では、プリフェッチ手段によりプリフェッチされた命
令群に含まれる各命令の命令長を判定して各々の命令の
オペレーションコードとオペランドを識別し、分離する
機能を有する。
Further, in a specific embodiment of the present invention, the separating means determines the instruction length of each instruction included in the instruction group prefetched by the prefetch means to identify the operation code and operand of each instruction, Has the function of separating.

【0007】また、前記命令格納手段に、本発明の具体
的態様では、前記分離手段によって分離されたオペレー
ションコードおよびオペランドの組からなる命令を所定
の複数個格納する容量を有するファーストイン・ファー
ストアウト・メモリを用いることができる。
In a specific embodiment of the present invention, the instruction storage means has a capacity of storing a predetermined plurality of instructions each consisting of a set of operation codes and operands separated by the separation means. -Memory can be used.

【0008】また、本発明の具体的態様では、前記分岐
先命令格納手段として、分岐先の先頭アドレスをキーと
するアソシエイティブ・メモリを用いることができる。
Further, in a specific aspect of the present invention, an associative memory having a branch destination head address as a key can be used as the branch destination instruction storage means.

【0009】また、前記命令実行手段は、本発明の具体
的態様では、分岐命令が発生したとき、分岐先の命令が
前記分岐先命令格納手段に格納されているかを調べ、前
記分岐先の命令が格納されていたときは、分岐先命令格
納手段の前記分岐先の命令を命令格納手段へ転送させる
機能を有する。
Further, in a specific aspect of the present invention, the instruction executing means checks whether or not a branch destination instruction is stored in the branch destination instruction storage means when a branch instruction occurs, and the branch destination instruction is stored. Is stored, it has a function of transferring the branch destination instruction of the branch destination instruction storage means to the instruction storage means.

【0010】また、前記命令格納手段は、本発明の具体
的態様では、前記分離手段によって分離されたオペレー
ションコードおよびオペランドの組からなる命令を所定
の複数個格納する容量を有し、前記分岐先命令格納手段
は、前記命令格納手段の所定の命令格納容量と同じ命令
格納容量を単位とするブロックを複数格納することがで
きる格納容量を有し、各ブロックごとに一つの分岐命令
を対応させて分岐先の命令群を格納するものであり、前
記分岐先命令格納手段から前記命令格納手段への情報の
転送を前記ブロック単位で一度に行うように構成され
る。
Further, in a specific embodiment of the present invention, the instruction storing means has a capacity for storing a predetermined plurality of instructions each consisting of a set of operation codes and operands separated by the separating means, and the branch destination. The instruction storage means has a storage capacity capable of storing a plurality of blocks in the same instruction storage capacity as the predetermined instruction storage capacity of the instruction storage means, and one branch instruction is associated with each block. It stores a branch destination instruction group, and is configured to transfer information from the branch destination instruction storage means to the instruction storage means at once in the block unit.

【0011】さらに、本発明の具体的態様では、前記命
令実行手段は、分岐命令が発生したとき分岐先の命令が
前記分岐先命令格納手段に格納されているかを調べ、前
記分岐先の命令が格納されていなかった場合は、前記分
岐先の命令が前記分離手段により分離されて命令格納手
段に格納されるとき、分岐先命令格納手段へも格納され
るようにすることを特徴とする。
Further, in a specific aspect of the present invention, the instruction execution means checks whether or not a branch destination instruction is stored in the branch destination instruction storage means when a branch instruction occurs, and the branch destination instruction is If not stored, when the branch destination instruction is separated by the separating means and stored in the instruction storing means, it is also stored in the branch destination instruction storing means.

【0012】[0012]

【作用】分岐先命令格納手段が空の場合に、分岐命令が
実行されるとプリフェッチ手段が分岐先の先頭からいく
つかの複数の命令をプリフェッチする。この分岐先の命
令は分離手段によりオペレーションコードとオペランド
に分離(プリデコード)される。その分離は、具体的に
は、プリフェッチ手段により主記憶装置から読み込まれ
た情報の各1バイトがオペレーションコードであるか否
かを識別し、またペレーションコードの命令長を判定す
ることによりオペランドを識別することができる。その
分離されたオペレーションコードとオペランドは一組に
して命令格納手段へロードされる。同時に、これらの分
離された命令は分岐先の先頭アドレスとともに分岐先命
令格納手段にロードされる。この分岐先命令手段として
は例えば先頭アドレスをキーとするアソシエーティブメ
モリを用いるとよい。このようにして分岐先命令格納手
段に分岐先の先頭の数命令がキャッシュされる。
When the branch instruction storage means is empty and the branch instruction is executed, the prefetch means prefetches a plurality of instructions from the beginning of the branch destination. This branch destination instruction is separated (predecoded) into an operation code and an operand by the separating means. Specifically, the separation is performed by identifying whether or not each 1 byte of the information read from the main storage device by the prefetch means is an operation code, and determining the instruction length of the peration code to determine the operand. Can be identified. The separated operation code and operand are paired and loaded into the instruction storage means. At the same time, these separated instructions are loaded into the branch destination instruction storage means together with the start address of the branch destination. As the branch destination instruction means, for example, an associative memory having a head address as a key may be used. In this way, the first few instructions at the branch destination are cached in the branch destination instruction storage means.

【0013】その後、分岐命令が実行されるとまず分岐
先のアドレスが分岐先命令格納手段にあるかどうかを比
較して、もしそのアドレスから始まる命令がキャッシュ
してあれば、分岐先命令格納手段の内容を命令格納手段
へ転送する。分岐先命令格納手段から命令格納手段への
分岐先命令群の転送をブロック単位で一度に行うように
することにより、分岐命令の処理がより高速化される。
この発明によれば、分岐先命令格納手段の内容はすでに
分離手段によってプリデコード済みであるから、パイプ
ライン方式のデコーダは短時間で命令のデコードを行う
ことができ、分岐命令によるパイプラインの無駄を無く
し、命令を高速に実行できるものである。
After that, when the branch instruction is executed, it is first compared whether or not the branch destination address is in the branch destination instruction storing means, and if the instruction starting from the address is cached, the branch destination instruction storing means. Is transferred to the instruction storage means. By executing the transfer of the branch destination instruction group from the branch destination instruction storage means to the instruction storage means at a time in block units, the processing speed of the branch instruction is further increased.
According to the present invention, the content of the branch destination instruction storage means has already been predecoded by the separation means, so that the pipeline type decoder can decode the instruction in a short time and waste of the pipeline due to the branch instruction. And the instructions can be executed at high speed.

【0014】[0014]

【実施例】図1は本発明の具体的な実施例である情報処
理装置のブロック図である。図1の実施例は中央処理装
置1、主記憶装置2およびシステムバス3を具備する。
さらに中央処理装置1は命令プリフェッチ装置11、命
令プリデコーダ12、命令プリフェッチバッファ13、
ブランチターゲットキャッシュ15、パイプライン方式
のデコーダ16、パイプライン方式の命令実行部17を
具備する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is a block diagram of an information processing apparatus which is a specific embodiment of the present invention. The embodiment shown in FIG. 1 comprises a central processing unit 1, a main memory 2 and a system bus 3.
Further, the central processing unit 1 includes an instruction prefetch unit 11, an instruction predecoder 12, an instruction prefetch buffer 13,
A branch target cache 15, a pipeline type decoder 16, and a pipeline type instruction execution unit 17 are provided.

【0015】本実施例において、命令の最小単位は1バ
イトとし、1バイト、2バイトおよび3バイトの3種類
の長さの命令から構成される命令セットを実行するもの
とする。図2に本実施例における命令の形式を示す。図
2に示したように、本実施例の命令には、オペレーショ
ンコードのみの1バイト命令、オペレーションコードと
オペランドAからなる2バイト命令、オペレーションコ
ードとオペランドAおよびオペランドBからなる3バイ
ト命令の3種類がある。これらの命令の何れにおいて
も、オペレーションコードは1バイトである。この最初
の1バイトのオペレーションコードから命令の長さを判
断することができる。なお本実施例においてシステムバ
ス3のデータ幅は16ビットすなわち2バイトとする。
In the present embodiment, it is assumed that the minimum unit of instruction is 1 byte, and an instruction set including instructions of three types of lengths of 1 byte, 2 bytes and 3 bytes is executed. FIG. 2 shows the format of the instruction in this embodiment. As shown in FIG. 2, the instructions of the present embodiment include 1-byte instruction having only the operation code, 2-byte instruction having the operation code and the operand A, and 3-byte instruction having the operation code and the operand A and the operand B. There are types. In any of these instructions, the operation code is 1 byte. The length of the instruction can be determined from this first 1-byte operation code. In this embodiment, the data width of the system bus 3 is 16 bits, that is, 2 bytes.

【0016】命令プリフェッチ装置11は、命令プリフ
ェッチバッファ13に蓄えられている命令の数がある値
よりも少なくなったときに、主記憶装置2から命令を2
ワード(4バイト)分読み込み、命令プリデコーダ12
に渡す。
When the number of instructions stored in the instruction prefetch buffer 13 becomes smaller than a certain value, the instruction prefetch device 11 fetches 2 instructions from the main memory 2.
Read word (4 bytes), instruction predecoder 12
Pass to.

【0017】命令プリデコーダ12は、1バイト毎に命
令のオペレーションコードであるか否か、およびそれが
オペレーションコードであるならその命令の種類を識別
し、命令の長さを判別する。その判別した長さを基にオ
ペランドの部分を識別する。このように命令プリデコー
ダ12は、フェッチした命令のプリデコードを行い、そ
の命令の構成を明らかにして、オペレーションコードと
それに対応するオペランド組にして命令プリフェッチバ
ッファ13に格納する。その際、オペレーションコード
はオペレーションコード格納部131に、オペランドを
オペランド格納部132にそれぞれ格納する。
The instruction predecoder 12 discriminates, for each byte, whether or not it is an operation code of an instruction, and if it is an operation code, the kind of the instruction, and determines the length of the instruction. The operand portion is identified based on the determined length. In this way, the instruction predecoder 12 predecodes the fetched instruction, clarifies the configuration of the instruction, and stores it in the instruction prefetch buffer 13 as an operation code and an operand set corresponding thereto. At this time, the operation code is stored in the operation code storage unit 131, and the operand is stored in the operand storage unit 132.

【0018】命令プリフェッチバッファ13は8エント
リのファーストイン・ファーストアウト・メモリ(FI
FO)であり、オペレーションコード部131は8ビッ
ト幅、オペランド格納部132は16ビット幅である。
従って、3バイト命令における2つのオペランドを同一
のエントリに格納できる。
The instruction prefetch buffer 13 is an 8-entry first-in first-out memory (FI).
FO), the operation code part 131 has an 8-bit width, and the operand storage part 132 has a 16-bit width.
Therefore, two operands in a 3-byte instruction can be stored in the same entry.

【0019】ブランチターゲットキャッシュ15は、分
岐先のアドレス(先頭アドレス)を格納するアドレス格
納部151と、オペレーションコード格納部152と、
オペランド格納部132とを有し、2ウエイセットアソ
シエーティブキャッシュを構成する。命令プリフェッチ
バッファ13と同じ容量(即ち、8エントリ)の情報の
組(ブロック)を16ブロック持っている。各ブロック
はそれぞれ一つの分岐先の命令群を記憶する。分岐命令
の分岐先のアドレスがヒットしたときには、キャッシュ
のどのブロック(組)からも命令プリフェッチバッファ
13に対して前記16ブロック(組)のうちのヒットし
たオペレーションコードを含むブロックを、専用の転送
線14を介して一度にロードすることができる。この情
報の転送はブロックごとの転送であるので高速に行われ
る。
The branch target cache 15 includes an address storage unit 151 for storing a branch destination address (head address), an operation code storage unit 152, and an operation code storage unit 152.
The two-way set associative cache has an operand storage unit 132. It has 16 blocks of information sets (blocks) of the same capacity as the instruction prefetch buffer 13 (that is, 8 entries). Each block stores one branch destination instruction group. When the address of the branch destination of the branch instruction is hit, the block containing the hit operation code of the 16 blocks (sets) is transferred to the instruction prefetch buffer 13 from any block (set) of the cache by a dedicated transfer line. It can be loaded all at once via 14. Since this information is transferred block by block, it is performed at high speed.

【0020】パイプライン方式のデコーダ16は、命令
プリフェッチバッファ13のオペレーションコード格納
部131から1バイトずつオペレーションコードをもら
いデコードを行ってパイプライン方式の命令実行部17
に渡す。パイプライン方式の命令実行部17は、デコー
ドされた命令とその命令に対応するオペランド格納部1
32からのオペランドを用いて命令を実行する。
The pipeline-type decoder 16 receives an operation code byte by byte from the operation code storage unit 131 of the instruction prefetch buffer 13 and decodes the operation code, thereby executing the pipeline-type instruction execution unit 17.
Pass to. The pipeline type instruction execution unit 17 includes a decoded instruction and an operand storage unit 1 corresponding to the instruction.
The instruction is executed using the operand from 32.

【0021】次に本実施例の動作を説明する。初めに中
央処理装置1が動作を開始した直後は命令プリフェッチ
バッファ13、データプリフェッチバッファ14および
ブランチターゲットキャッシュ15は空である。命令実
行部17が、命令プリフェッチ装置11に対し、主記憶
装置2から命令を読み込むように要求する。その要求に
応じて命令プリフェッチ装置11により読み込まれた命
令は、命令プリデコーダ12によってプリデコードされ
る。プリデコードにおいては、1バイト毎に、命令のオ
ペレーションコードであるか否か、およびそれがオペレ
ーションコードであるならその命令の種類を識別し、命
令の長さを判別する。その判別した長さを基にオペラン
ドの部分を識別する。このようにして命令プリデコーダ
12により分離されたオペレーションコードは命令プリ
フェッチバッファ13のオペレーションコード格納部1
31に、オペランドはオペランド格納部132に入れら
れる。この動作は命令プリフェッチバッファ13にオペ
レーションコードが一杯になるまで続けられる。
Next, the operation of this embodiment will be described. Immediately after the central processing unit 1 first starts operating, the instruction prefetch buffer 13, the data prefetch buffer 14, and the branch target cache 15 are empty. The instruction execution unit 17 requests the instruction prefetch device 11 to read an instruction from the main storage device 2. The instruction read by the instruction prefetch device 11 in response to the request is predecoded by the instruction predecoder 12. In the pre-decoding, whether or not it is the operation code of the instruction, and if it is the operation code, the type of the instruction is identified for each byte, and the length of the instruction is determined. The operand portion is identified based on the determined length. The operation code thus separated by the instruction predecoder 12 is the operation code storage unit 1 of the instruction prefetch buffer 13.
At 31, the operand is placed in the operand store 132. This operation is continued until the operation code is full in the instruction prefetch buffer 13.

【0022】パイプライン方式の命令デコーダ16は、
命令プリフェッチバッファ13から1バイトずつオペレ
ーションコードをもらい、デコードを行って命令実行部
17に渡す。パイプライン方式の命令実行部17は、デ
コードされた命令とデータプリフェッチバッファ14か
らのオペランドを用いて命令を実行する。また、パイプ
ライン方式の命令実行部17は、このようにして命令を
実行してゆくと、命令プリフェッチバッファ13に蓄え
られていたオペレーションコードが減少していく。オペ
レーションコードの数が一定の数よりも少なったなら
ば、また命令プリフェッチ装置11に対し、命令の読み
込みを要求する。分岐命令が無い場合は上記のように命
令が処理されてゆく。
The pipeline type instruction decoder 16 is
The operation code is received from the instruction prefetch buffer 13 byte by byte, decoded, and passed to the instruction execution unit 17. The pipeline-type instruction execution unit 17 executes the instruction using the decoded instruction and the operand from the data prefetch buffer 14. When the pipeline type instruction execution unit 17 executes instructions in this manner, the operation code stored in the instruction prefetch buffer 13 decreases. If the number of operation codes is less than a certain number, the instruction prefetch device 11 is requested to read an instruction. If there is no branch instruction, the instruction is processed as described above.

【0023】次に命令の流れの中に分岐命令が現れた場
合について図3のフローチャートにより説明する。分岐
命令が発生した時は、まず分岐先のアドレスの命令がブ
ランチターゲットキャッシュ15にキャッシュされてい
るかどうかを調べる。すなわち、命令実行部17は、分
岐命令が発生した時に(ステップ301)、分岐命令の
分岐先アドレスを計算し(ステップ302)、その計算
した分岐先アドレスをブランチターゲットキャッシュ1
5へ与える。ブランチターゲットキャッシュ15はその
アソシエーティブメモリの機能により、命令実行部17
から与えられた分岐先アドレスを、アドレス格納部15
1に記憶しているアドレスと比較し(ステップ30
3)、比較の結果の分岐先アドレスの有無を命令実行部
17へかえす。
Next, the case where a branch instruction appears in the instruction flow will be described with reference to the flow chart of FIG. When a branch instruction occurs, it is first checked whether or not the instruction at the branch destination address is cached in the branch target cache 15. That is, when a branch instruction occurs (step 301), the instruction executing section 17 calculates the branch destination address of the branch instruction (step 302), and uses the calculated branch destination address as the branch target cache 1
Give to 5. The branch target cache 15 uses the function of the associative memory to execute the instruction execution unit 17
The branch destination address given from the address storage unit 15
1 is compared with the address stored in step 1 (step 30
3) The presence / absence of a branch destination address as a result of the comparison is returned to the instruction execution unit 17.

【0024】分岐先のアドレスがブランチターゲットキ
ャッシュ15に無かった場合は、命令実行部17は、命
令プリフェッチ装置11に命令フェッチ要求を発行する
(ステップ308)。命令プリフェッチ装置11は、主
記憶装置2から分岐先のアドレスにある命令をプリフェ
ッチする(ステップ309)と同時に、命令プリフェッ
チバッファ13のすべてのエントリをクリアする。そし
て、プリフェッチされた命令は、命令プリデコーダ12
によってプリデコードされる(ステップ310)。プリ
デコードされたオペレーションコードとオペランドは命
令プリフェッチバッファ13のオペレーションコード格
納部131とオペランド格納部132に新たに蓄えられ
ていくと同時に無作為に選ばれたブランチターゲットキ
ャッシュ15のひとつのブロック(組)にも蓄えられて
いく(ステップ311)。パイプライン方式の命令デコ
ーダ16がデコードを開始してパイプラインが動作を開
始してもブランチターゲットキャッシュ15のひとつの
ブロック(組)が一杯になるまでは、ブランチターゲッ
トキャッシュ15のオペレーションコード格納部152
とオペランド格納部153にも命令プリデコーダ12に
よってプリデコードされたオペレーションコードとオペ
ランドが蓄えられてゆく。このようにしてブランチター
ゲットキャッシュ15に分岐先の先頭アドレスから始ま
る命令群がキャッシュされる。
If the branch target cache 15 does not have the branch destination address, the instruction executing section 17 issues an instruction fetch request to the instruction prefetch unit 11 (step 308). The instruction prefetch device 11 prefetches the instruction at the branch destination address from the main storage device 2 (step 309) and, at the same time, clears all the entries in the instruction prefetch buffer 13. The prefetched instruction is then transferred to the instruction predecoder 12
Is pre-decoded by (step 310). The predecoded operation code and operand are newly stored in the operation code storage unit 131 and the operand storage unit 132 of the instruction prefetch buffer 13, and at the same time, one block (set) of the branch target cache 15 randomly selected. Is also stored (step 311). Even if the pipeline-type instruction decoder 16 starts decoding and the pipeline starts operating, the operation code storage unit 152 of the branch target cache 15 remains until one block (set) of the branch target cache 15 is full.
The operation code and the operand predecoded by the instruction predecoder 12 are also stored in the operand storage unit 153. In this way, the branch target cache 15 caches the instruction group starting from the start address of the branch destination.

【0025】次に一度分岐命令によって分岐したアドレ
スへ再度分岐する場合は、分岐先のアドレスがブランチ
ターゲットキャッシュ15にキャッシュされているの
で、命令プリフェッチ装置11が主記憶装置2から分岐
先のアドレスにある命令をプリフェッチする必要はな
く、ブランチターゲットキャッシュ15に蓄えられてい
る分岐先命令群のオペレーションコードとオペランドの
すべての内容を命令プリフェッチバッファ13およびデ
ータプリフェッチバッファ14に、ブロック単位でロー
ドするだけでよい。また、もしブランチターゲットキャ
ッシュ15のすべてのエントリに命令がキャッシュされ
ていて、分岐命令によりキャッシュミスした場合にはブ
ランチターゲットキャッシュ15の一つのエントリが無
作為に選ばれ新しい内容に置き換わる。
When branching again to the address once branched by the branch instruction, the instruction prefetch unit 11 moves from the main memory 2 to the branch destination address because the branch target address is cached in the branch target cache 15. It is not necessary to prefetch a certain instruction, and it is sufficient to load all the operation codes and operand contents of the branch destination instruction group stored in the branch target cache 15 into the instruction prefetch buffer 13 and the data prefetch buffer 14 in block units. Good. If the instruction is cached in all the entries of the branch target cache 15 and a cache miss occurs due to the branch instruction, one entry of the branch target cache 15 is randomly selected and replaced with a new content.

【0026】本実施例においては、ブランチターゲット
キャッシュ15にあらかじめプリデコードした命令をキ
ャッシュしておき、分岐命令が発生した時にブランチタ
ーゲットキャッシュに分岐先の命令がキャッシュされて
いる場合に、ブランチターゲットキャッシュ15から命
令プリフェッチバッファ13に各々の命令のオペレーシ
ョンコードとオペランドをプリデコードした形で入力す
ることにより、命令をデコードする時間を減少させ、分
岐命令によるパイプラインのオーバーヘッドや、命令フ
ェッチの待ち時間を減少させることができ、命令を高速
に実行することができる。
In the present embodiment, the predecoded instruction is cached in the branch target cache 15 in advance, and when the branch target cache caches the branch target instruction when the branch instruction occurs, the branch target cache is cached. By inputting the operation code and operand of each instruction in pre-decoded form from 15 to the instruction prefetch buffer 13, the instruction decoding time is reduced, and the pipeline overhead due to the branch instruction and the instruction fetch waiting time are reduced. It can be reduced and instructions can be executed at high speed.

【0027】[0027]

【発明の効果】以上述べたように本発明によれば、複数
の種類の命令長の命令から構成される命令セットをパイ
プライン方式により実行する情報処理装置において、分
岐先命令格納手段(ブランチターゲットキャッシュ)に
あらかじめプリデコードした命令をキャッシュしてお
き、分岐命令が発生した時に分岐先命令格納手段に分岐
先の命令がキャッシュされている場合に、分岐先命令格
納手段から命令プリフェッチバッファに各々の命令のオ
ペレーションコードとオペランドの組をプリデコードし
た形で入力するようにして、命令をデコードする時間を
減少させ、分岐命令によるパイプラインのオーバーヘッ
ドを減少させることにより、命令を高速に実行すること
ができる。
As described above, according to the present invention, in an information processing apparatus for executing an instruction set composed of a plurality of types of instruction lengths by a pipeline method, a branch destination instruction storage means (branch target) is provided. Cache), predecoded instructions are cached in advance, and when the branch destination instruction storage means caches the branch destination instruction when the branch instruction occurs, the branch destination instruction storage means stores each instruction in the instruction prefetch buffer. By inputting the operation code and operand pair of an instruction in a pre-decoded form, the instruction decoding time is reduced and the pipeline overhead due to the branch instruction is reduced, so that the instruction can be executed at high speed. it can.

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

【図1】 この発明の実施例を示すブロック図FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】 実施例における命令の形式を示す図FIG. 2 is a diagram showing a format of an instruction in the embodiment.

【図3】 分岐命令があったときの動作を示すフロー図FIG. 3 is a flowchart showing the operation when there is a branch instruction.

【符号の説明】 1…中央処理装置、2…主記憶装置、3…システムバ
ス、11…命令プリフェッチ装置、12…命令プリデコ
ーダ、13…命令プリフェッチバッファ、15…ブラン
チターゲットキャッシュ、16…パイプライン方式の命
令デコーダ、17…パイプライン方式の命令実行部。
[Description of Codes] 1 ... Central processing unit, 2 ... Main memory unit, 3 ... System bus, 11 ... Instruction prefetch unit, 12 ... Instruction predecoder, 13 ... Instruction prefetch buffer, 15 ... Branch target cache, 16 ... Pipeline System instruction decoder 17 ... Pipeline system instruction execution unit.

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 少なくとも一つの可変長の命令をプリフ
ェッチするプリフェッチ手段と、 そのプリフェッチ手段によってプリフェッチされた可変
長の命令をオペレーションコードとオペランドとに分離
する分離手段と、 その分離手段によって分離されたオペレーションコード
およびオペランドの組からなる少なくとも一つの命令を
一時的に格納する命令格納手段と、 パイプライン方式により、命令格納手段に格納された命
令を実行する命令実行手段と、 この命令実行手段によって実行される命令のうち、少な
くとも一つの分岐先命令を、オペレーションコードとオ
ペランドに分離して、分岐先のアドレスとともに格納し
ておく分岐先命令格納手段とを備えたことを特徴とする
情報処理装置。
1. A prefetch means for prefetching at least one variable length instruction, a separating means for separating a variable length instruction prefetched by the prefetch means into an operation code and an operand, and a separating means for separating the operation code and the operand. Instruction storage means for temporarily storing at least one instruction consisting of an operation code and operand pair, instruction execution means for executing the instruction stored in the instruction storage means by a pipeline method, and execution by this instruction execution means An information processing apparatus comprising: a branch-destination instruction storage unit for separating at least one branch-destination instruction from among the instructions to be stored into an operation code and an operand and storing the branch-destination instruction together with the branch-destination address.
【請求項2】 前記プリフェッチ手段は、一度に複数の
可変長の命令群をまとめてプリフェッチすることを特徴
とする請求項1記載の情報処理装置。
2. The information processing apparatus according to claim 1, wherein the prefetch unit collectively prefetches a plurality of variable length instruction groups at a time.
【請求項3】 前記分離手段は、プリフェッチ手段によ
りプリフェッチされた命令群に含まれる各命令の命令長
を判定して各々の命令のオペレーションコードとオペラ
ンドを識別し、分離するものであることを特徴とする請
求項1記載の情報処理装置。
3. The separating means determines the instruction length of each instruction included in the instruction group prefetched by the prefetch means, identifies the operation code and operand of each instruction, and separates them. The information processing device according to claim 1.
【請求項4】 前記分離手段は、プリフェッチ手段によ
りプリフェッチされた命令群に含まれる各命令の命令長
を判定して各々の命令のオペレーションコードとオペラ
ンドを識別し、分離するものであることを特徴とする請
求項2記載の情報処理装置。
4. The separation means determines the instruction length of each instruction included in the instruction group prefetched by the prefetch means, identifies the operation code and operand of each instruction, and separates them. The information processing apparatus according to claim 2.
【請求項5】 前記命令格納手段に、前記分離手段によ
って分離されたオペレーションコードおよびオペランド
の組からなる命令を所定の複数個格納する容量を有する
ファーストイン・ファーストアウト・メモリを用いたこ
とを特徴とする請求項1記載の情報処理装置。
5. A first-in-first-out memory having a capacity for storing a predetermined plurality of instructions each consisting of a set of operation codes and operands separated by the separating means is used as the instruction storage means. The information processing device according to claim 1.
【請求項6】 前記分岐先命令格納手段は、分岐先のア
ドレスをキーとするアソシエイティブ・メモリであるこ
とを特徴とする請求項5記載の情報処理装置。
6. The information processing apparatus according to claim 5, wherein the branch destination instruction storage means is an associative memory having a branch destination address as a key.
【請求項7】 前記命令実行手段は、分岐命令が発生し
たとき、分岐先の命令が前記分岐先命令格納手段に格納
されているかを調べ、前記分岐先の命令が格納されてい
たときは、分岐先命令格納手段の前記分岐先の命令を命
令格納手段へ転送させることを特徴とする請求項1記載
の情報処理装置。
7. The instruction executing means, when a branch instruction is generated, checks whether or not the branch destination instruction is stored in the branch destination instruction storage means, and when the branch destination instruction is stored, 2. The information processing apparatus according to claim 1, wherein the instruction at the branch destination of the branch destination instruction storage means is transferred to the instruction storage means.
【請求項8】 前記命令格納手段は、前記分離手段によ
って分離されたオペレーションコードおよびオペランド
の組からなる命令を所定の複数個格納する容量を有し、 前記分岐先命令格納手段は、前記命令格納手段の所定の
命令格納容量と同じ命令格納容量を単位とするブロック
を複数格納することができる格納容量を有し、各ブロッ
クごとに一つの分岐命令を対応させて分岐先の命令群を
格納するものであり、 前記分岐先命令格納手段から前記命令格納手段への情報
の転送を前記ブロック単位で一度に行うようにしたこと
を特徴とする請求項7記載の情報処理装置。
8. The instruction storage means has a capacity to store a predetermined plurality of instructions each consisting of a set of operation codes and operands separated by the separation means, and the branch destination instruction storage means has the instruction storage. It has a storage capacity capable of storing a plurality of blocks in the same instruction storage capacity as the predetermined instruction storage capacity of the means, and stores a branch destination instruction group in association with one branch instruction for each block. The information processing apparatus according to claim 7, wherein the transfer of information from the branch destination instruction storage means to the instruction storage means is performed at once in the block unit.
【請求項9】 前記命令実行手段は、分岐命令が発生し
たとき分岐先の命令が前記分岐先命令格納手段に格納さ
れているかを調べ、前記分岐先の命令が格納されていな
かった場合は、前記分岐先の命令が前記分離手段により
分離されて命令格納手段に格納されるとき、分岐先命令
格納手段へも格納されるようにすることを特徴とする請
求項1記載の情報処理装置。
9. The instruction executing means checks whether or not a branch destination instruction is stored in the branch destination instruction storage means when a branch instruction occurs, and if the branch destination instruction is not stored, 2. The information processing apparatus according to claim 1, wherein when the instruction at the branch destination is separated by the separating means and stored in the instruction storage means, the instruction is also stored in the branch destination instruction storage means.
JP14367792A 1992-05-11 1992-05-11 Information processor Pending JPH05313894A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14367792A JPH05313894A (en) 1992-05-11 1992-05-11 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14367792A JPH05313894A (en) 1992-05-11 1992-05-11 Information processor

Publications (1)

Publication Number Publication Date
JPH05313894A true JPH05313894A (en) 1993-11-26

Family

ID=15344375

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14367792A Pending JPH05313894A (en) 1992-05-11 1992-05-11 Information processor

Country Status (1)

Country Link
JP (1) JPH05313894A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6209079B1 (en) 1996-09-13 2001-03-27 Mitsubishi Denki Kabushiki Kaisha Processor for executing instruction codes of two different lengths and device for inputting the instruction codes
JP2021089736A (en) * 2019-12-04 2021-06-10 ベイジン バイドゥ ネットコム サイエンス アンド テクノロジー カンパニー リミテッド Instruction prefetching method, device, equipment, and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6209079B1 (en) 1996-09-13 2001-03-27 Mitsubishi Denki Kabushiki Kaisha Processor for executing instruction codes of two different lengths and device for inputting the instruction codes
US6463520B1 (en) 1996-09-13 2002-10-08 Mitsubishi Denki Kabushiki Kaisha Processor for executing instruction codes of two different lengths and device for inputting the instruction codes
JP2021089736A (en) * 2019-12-04 2021-06-10 ベイジン バイドゥ ネットコム サイエンス アンド テクノロジー カンパニー リミテッド Instruction prefetching method, device, equipment, and medium
US11327762B2 (en) 2019-12-04 2022-05-10 Kunlunxin Technology (Beijing) Company Limited Method and apparatus for instruction prefetching with alternating buffers and sequential instruction address matching

Similar Documents

Publication Publication Date Title
US4847753A (en) Pipelined computer
EP0391517B1 (en) Method and apparatus for ordering and queueing multiple memory access requests
JP3095802B2 (en) Data processing system with performance-enhancing instruction cache
JP3182740B2 (en) A method and system for fetching non-consecutive instructions in a single clock cycle.
US20060242365A1 (en) Method and apparatus for suppressing duplicative prefetches for branch target cache lines
JPH03147022A (en) Branch instruction processing apparatus and method
JPH11510287A (en) Instruction buffer configuration method and system
US6684319B1 (en) System for efficient operation of a very long instruction word digital signal processor
US7447883B2 (en) Allocation of branch target cache resources in dependence upon program instructions within an instruction queue
JP2560889B2 (en) Microprocessor
JPS6356731A (en) Data processor
US20060242394A1 (en) Processor and processor instruction buffer operating method
JP2596712B2 (en) System and method for managing execution of instructions, including adjacent branch instructions
EP1413953A2 (en) Instruction prefetch method and apparatus for conditional branch instructions
EP1358551B1 (en) Computer instruction with instruction fetch control bits
JPH05313894A (en) Information processor
JP2723238B2 (en) Information processing device
KR19990003937A (en) Prefetch device
JP2508021B2 (en) Data processing device
JPH01126732A (en) Information processor
JP2902847B2 (en) Self-modifying code execution method
JPH05324318A (en) Information processor
JPH01193938A (en) Instruction pre-reader
JPH1153188A (en) Instruction cache control method
JPH08286914A (en) Memory controller