JPH0895784A - Arithmetic processing apparatus and method - Google Patents

Arithmetic processing apparatus and method

Info

Publication number
JPH0895784A
JPH0895784A JP22763894A JP22763894A JPH0895784A JP H0895784 A JPH0895784 A JP H0895784A JP 22763894 A JP22763894 A JP 22763894A JP 22763894 A JP22763894 A JP 22763894A JP H0895784 A JPH0895784 A JP H0895784A
Authority
JP
Japan
Prior art keywords
instruction
branch
address
cache memory
pipeline
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
JP22763894A
Other languages
Japanese (ja)
Inventor
Hiroshi Shinkai
浩 新海
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP22763894A priority Critical patent/JPH0895784A/en
Publication of JPH0895784A publication Critical patent/JPH0895784A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

(57)【要約】 【目的】簡単な構成で分岐命令発生時でもパイプライン
を高速で処理する。 【構成】インクリメンタ42の値と外部からのアドレスの
一方を選択してキャッシュメモリ(13)をアクセスし、
当該位置の命令をフェッチするフェッチ処理回路31と、
フェッチした命令をデコードし、分岐命令では分岐先ア
ドレスも出力するデコード処理回路32と、デコード結果
に基く演算を実行し、分岐命令では分岐先アドレスと以
前の分岐先アドレスとの一致及び分岐条件成立の有無に
より分岐の実行を判定し(46〜49)、判定結果によりフ
ェッチ処理回路31へ選択信号及びアドレスを、書込処理
回路34に書込制御信号及び分岐先アドレスを夫々送出す
る実行処理回路33と、演算結果を所定記憶位置に書込
み、該書込制御信号により上記キャッシュメモリ(13)
中の分岐命令の次位置の命令を分岐先の命令に、次々位
置の命令を分岐先の次のアドレスに夫々書換える書込処
理回路34とを備える。
(57) [Summary] [Purpose] With a simple configuration, the pipeline is processed at high speed even when a branch instruction occurs. [Configuration] Accessing the cache memory (13) by selecting one of the value of the incrementer 42 and the address from the outside,
A fetch processing circuit 31 for fetching the instruction at the position,
Decodes the fetched instruction, outputs the branch destination address in the branch instruction, and the operation based on the decoding result. In the branch instruction, the branch destination address matches the previous branch destination address and the branch condition is satisfied. Execution processing circuit for judging execution of branch based on presence / absence of (46 to 49), and sending selection signal and address to fetch processing circuit 31 and writing control signal and branch destination address to write processing circuit 34 according to the judgment result. 33, write the operation result to a predetermined storage location, and use the write control signal to cause the cache memory (13)
A write processing circuit 34 for rewriting an instruction at a position next to a middle branch instruction to a branch destination instruction and an instruction at a next position to a branch destination next address, respectively.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、パイプライン処理方式
により演算を実行する演算処理装置及び方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic processing device and method for executing an arithmetic operation by a pipeline processing method.

【0002】[0002]

【従来の技術】従来より、マイクロプロセッサの性能向
上を図るために、マイクロプロセッサの行なう種々の命
令(演算)を連続した4〜5段階(ステージ)に細分化
して並列処理を行なうパイプライン処理方式のものが多
く採用されている。
2. Description of the Related Art Conventionally, in order to improve the performance of a microprocessor, various instructions (operations) performed by the microprocessor are subdivided into continuous 4 to 5 stages (stages) to perform parallel processing. Many are used.

【0003】図8はこのパイプライン処理による1つの
命令の処理段階を示すもので、ここでは1つの命令を例
えば4ステージに分けるものとする。図中、「F」がフ
ェッチ(取込み)ステージ、「D」がデコード(解釈と
メモリからのデータ読出し)ステージ、「E」が実行
(演算の実行)ステージ、「W」がメモリへの書込み
(演算結果の出力)ステージである。
FIG. 8 shows a processing stage of one instruction by this pipeline processing. Here, one instruction is divided into four stages, for example. In the figure, “F” is a fetch stage, “D” is a decode (interpretation and data read from memory) stage, “E” is an execution (arithmetic execution) stage, and “W” is a memory write ( This is the output stage of the calculation result) stage.

【0004】続く図9は上記図8のパイプライン処理方
式での分岐命令の実行を例示するもので、横方向が1つ
の命令に関する時間の流れ、縦方向が一連のプログラム
の処理に従った時間の流れを示している。同図中、
「J」が分岐命令、「J+1」及び「J+2」が一連の
プログラム上で上記分岐命令「J」の次及びその次に位
置し、分岐実行時に無効となる通常の命令、「A」が分
岐先の命令である。
Next, FIG. 9 exemplifies the execution of a branch instruction in the pipeline processing system of FIG. 8 above. The flow of time relating to one instruction is in the horizontal direction, and the time according to the processing of a series of programs is in the vertical direction. Shows the flow of. In the figure,
“J” is a branch instruction, and “J + 1” and “J + 2” are located on the next and subsequent to the above-mentioned branch instruction “J” in a series of programs, and a normal instruction that becomes invalid at the time of branch execution, “A” is branched. It is a previous command.

【0005】分岐命令「J」のデコードステージでその
命令が分岐を示すものであると解釈した時点で、すでに
次の「J+1」命令のフェッチステージを終えており、
また分岐命令「J」の実行ステージで分岐を実行する際
にはその前にさらに続く命令「J+2」のフェッチステ
ージと命令「J+1」のデコードステージとを終えてい
ることとなる。したがって、次いで分岐先の命令「A」
の処理に移行する際には上記命令「J+1」「J+2」
に関する処理は放棄され、その処理及び時間が無駄なも
のとなる。
When the decode stage of the branch instruction "J" interprets the instruction as indicating a branch, the fetch stage of the next "J + 1" instruction has already been completed,
Further, when the branch is executed at the execution stage of the branch instruction “J”, the fetch stage of the instruction “J + 2” and the decode stage of the instruction “J + 1” that follow further are completed. Therefore, the next branch instruction “A”
When the processing shifts to the above processing
Processing is abandoned, and the processing and time are wasted.

【0006】[0006]

【発明が解決しようとする課題】上記のような不具合を
解消すべく、分岐命令等があると1回目のプログラム実
行時に分岐先の命令を分岐先のアドレスと共に予め用意
した分岐命令保持回路(分岐バッファ)にて保持させ、
2回目以降のプログラム実行時には分岐先のアドレスを
上記分岐命令保持回路に渡すことでアドレスが一致した
場合に命令を取出し、分岐命令の後に挿入するという方
法が考えられた。
In order to solve the above problems, if there is a branch instruction or the like, a branch instruction holding circuit (branch instruction holding circuit prepared in advance with the branch destination address at the time of the first program execution) Buffer),
A method has been considered in which, when the program is executed for the second time and thereafter, the branch destination address is passed to the branch instruction holding circuit to fetch the instruction when the addresses match and to insert the instruction after the branch instruction.

【0007】しかしながら、この分岐命令保持回路を持
つ方法では、アドレスを直接与えるのではなく、記憶内
容を検索情報として与えることでそれに等しい記憶情報
を持つ記憶位置のアドレスを求めるような連想メモリが
必要となり、装置が複雑で高価となり、さらには演算速
度を高速化しにくいものとなってしまうという欠点を生
じる。
However, in the method having this branch instruction holding circuit, an associative memory is required which, instead of directly giving an address, gives the memory content as search information to obtain the address of the memory location having the same memory information. Therefore, the device becomes complicated and expensive, and it is difficult to increase the calculation speed.

【0008】本発明は上記のような実情に鑑みてなされ
たもので、その目的とするところは、分岐命令実行時の
タイムラグが少なく、連想メモリを用いないでパイプラ
インを大きく乱すことなしに高速で分岐命令を実行する
ことが可能なパイプライン処理による演算処理装置及び
方法を提供することにある。
The present invention has been made in view of the above situation, and an object of the present invention is to reduce a time lag during execution of a branch instruction, to use a high speed without significantly disturbing a pipeline without using an associative memory. It is an object of the present invention to provide an arithmetic processing unit and method by pipeline processing capable of executing a branch instruction.

【0009】[0009]

【課題を解決するための手段】すなわち本発明は、キャ
ッシュメモリに読出したプログラム中の命令をパイプラ
イン処理する演算処理装置であって、パイプラインの実
行ステージでその命令が始めて実行する分岐命令である
か否か判定する実行処理回路と、パイプラインの上記実
行ステージより後に位置する書込みステージで上記キャ
ッシュメモリ中の上記実行処理回路により始めて実行す
ると判定された分岐命令の次に位置する命令を分岐先に
位置する命令に、その次に位置する命令を分岐先の命令
のアドレスにそれぞれ書換える書込処理回路とを備える
ようにしたものである。
That is, the present invention is an arithmetic processing unit for pipeline processing an instruction in a program read to a cache memory, and a branch instruction executed first by the instruction at the execution stage of the pipeline. In the execution processing circuit that determines whether or not there is, and in the write stage that is located after the execution stage of the pipeline, branch the instruction that is located next to the branch instruction that is determined to be first executed by the execution processing circuit in the cache memory. A write processing circuit is provided for rewriting an instruction located first, to the address of a branch destination instruction, respectively.

【0010】[0010]

【作用】上記のような構成によれば、連想メモリ等を使
用せず、簡単な回路構成で2回目以降の分岐命令実行時
にパイプラインを大きく乱すことなく高速で処理するこ
とが可能となる。
According to the above configuration, it is possible to perform high-speed processing without significantly disturbing the pipeline during the second and subsequent executions of branch instructions with a simple circuit configuration without using an associative memory or the like.

【0011】[0011]

【実施例】以下図面を参照して本発明の一実施例を説明
する。図1はシステム全体の回路構成を示すもので、11
がシステムの各構成要素を接続するシステムバスであ
り、ここではこのシステムバス11を介して、後述するパ
イプライン構造によりプログラムを実行するCPU12、
このCPU12で実行するプログラムを部分的に読出して
記憶するキャッシュメモリ13、プログラム及びデータを
記憶したメインメモリ14、種々画像データを表示出力す
るCRT15、ユーザによる入力指示を受け付けるキーボ
ード16及びプログラムやデータ等を格納するハードディ
スク装置(図では「HDD」と示す)17等が統括接続さ
れるものとする。
An embodiment of the present invention will be described below with reference to the drawings. Figure 1 shows the circuit configuration of the entire system.
Is a system bus that connects each component of the system, and here, via this system bus 11, a CPU 12 that executes a program by a pipeline structure described later,
A cache memory 13 that partially reads and stores the program executed by the CPU 12, a main memory 14 that stores the program and data, a CRT 15 that displays and outputs various image data, a keyboard 16 that accepts input instructions from the user, programs and data, etc. It is assumed that a hard disk device (indicated as “HDD” in the figure) 17 and the like for storing the data are integrally connected.

【0012】続く図2は例えばユーザによって作成され
たソースプログラム21と、CPU12の解読可能な形式で
記述されたオブジェクトプログラム23の関係を示す図で
ある。例えばPASCALやsmalltalk等の高
級言語で記述されたソースプログラム21は、CPU12の
命令コードに対応したコンパイラ22によりオブジェクト
プログラム23へと一括変換(翻訳)されるもので、得ら
れたオブジェクトプログラム23が上記ハードディスク装
置17に保存格納され、必要に応じて選択されてメインメ
モリ14へ読出される。コンパイラ22による変換の際、オ
ブジェクトプログラム23中の分岐命令の後には、予め定
められた他に影響しない余分な命令、例えばNOP(N
o Operation)命令を2つ以上書込んでおく
ものとする。
Next, FIG. 2 is a diagram showing the relationship between a source program 21 created by a user and an object program 23 written in a format readable by the CPU 12, for example. For example, a source program 21 written in a high-level language such as PASCAL or smalltalk is collectively converted (translated) into an object program 23 by a compiler 22 corresponding to the instruction code of the CPU 12, and the obtained object program 23 is The data is stored and stored in the hard disk device 17, selected as necessary, and read to the main memory 14. During the conversion by the compiler 22, after the branch instruction in the object program 23, a predetermined extra instruction that does not affect other things such as NOP (N
o Operation) command is written two or more times.

【0013】図3は上記CPU12内の特にパイプライン
処理を行なう各ステージ毎の回路構成を例示するもので
ある。ここでは、本願発明が特徴とする分岐命令に関す
る処理回路のみ図示することとし、その他の回路につい
ては図示及びその説明を省略することとする。同図で、
CPU12内にはフェッチ(F)処理回路31、デコード
(D)処理回路32、実行(E)処理回路33及び書込
(W)処理回路34が備えられる。
FIG. 3 exemplifies a circuit configuration of each stage in the CPU 12 which particularly performs pipeline processing. Here, only the processing circuit relating to the branch instruction, which is a feature of the present invention, will be illustrated, and the other circuits will not be illustrated and described. In the figure,
A fetch (F) processing circuit 31, a decode (D) processing circuit 32, an execution (E) processing circuit 33, and a write (W) processing circuit 34 are provided in the CPU 12.

【0014】フェッチ処理回路31はシステムバス11を介
してキャッシュメモリ13に対してアドレスを指定するこ
とでそのアドレス位置にある命令を取出してくるもの
で、マルチプレクサ(MPX)41、インクリメンタ(I
NC)42及びフリップフロップ(F/F)43を有する。
The fetch processing circuit 31 fetches an instruction at the address position by designating an address to the cache memory 13 via the system bus 11. The multiplexer (MPX) 41 and the incrementer (I
It has an NC) 42 and a flip-flop (F / F) 43.

【0015】マルチプレクサ41は、後述する実行処理回
路33から送られてくる選択信号に従い、同じく実行処理
回路33から送られてくるアドレス値とインクリメンタ42
の出力するアドレス値のいずれかを選択してインクリメ
ンタ42及び上記システムバス11へ送出する。インクリメ
ンタ42は、プログラムカウンタ(PC)として設けられ
るものであり、マルチプレクサ41からのアドレス値を逐
次「+1」した後に上述した如くマルチプレクサ41へ帰
還出力する。
The multiplexer 41, in accordance with a selection signal sent from an execution processing circuit 33 described later, also has an address value and an incrementer 42 also sent from the execution processing circuit 33.
Any of the address values output by the above is selected and sent to the incrementer 42 and the system bus 11. The incrementer 42 is provided as a program counter (PC), and sequentially increments the address value from the multiplexer 41 by "+1" and then outputs it to the multiplexer 41 as described above.

【0016】フリップフロップ43は、システムバス11を
介してキャッシュメモリ13から与えられる命令を1クロ
ック分保持し、デコード処理回路32へ出力する。デコー
ド処理回路32は、フェッチ処理回路31から与えられる命
令をデコードして実行処理回路33に送出するもので、特
にデコードした命令が分岐命令であった場合にはその分
岐先のアドレスも実行処理回路33へ送出する。
The flip-flop 43 holds the instruction given from the cache memory 13 via the system bus 11 for one clock and outputs it to the decoding processing circuit 32. The decode processing circuit 32 decodes the instruction given from the fetch processing circuit 31 and sends it to the execution processing circuit 33. In particular, when the decoded instruction is a branch instruction, the address of the branch destination is also executed. Send to 33.

【0017】実行処理回路33は、デコード処理回路32で
デコードされた命令に応じた加算などの整数演算を実行
するもので、インクリメンタ44、マルチプレクサ45、コ
ンパレータ46、条件判断器47及びアンド回路48,49を有
する。デコード処理回路32から送られてきた分岐先のア
ドレスは、インクリメンタ44、マルチプレクサ45及びコ
ンパレータ46に与えられると共に、次ステージの書込処
理回路34へも与えられる。
The execution processing circuit 33 executes an integer operation such as addition according to the instruction decoded by the decoding processing circuit 32. The execution processing circuit 33 includes an incrementer 44, a multiplexer 45, a comparator 46, a condition judging device 47 and an AND circuit 48. , 49. The address of the branch destination sent from the decoding processing circuit 32 is given to the incrementer 44, the multiplexer 45 and the comparator 46, and is also given to the writing processing circuit 34 of the next stage.

【0018】インクリメンタ44は、デコード処理回路32
からの命令の内容に従い、デコード処理回路32から送ら
れてくるアドレスを逐次「+1」した後にマルチプレク
サ45へ出力する。マルチプレクサ45は、デコード処理回
路32から直接送られてくるアドレスとインクリメンタ44
で「+1」されたアドレスの一方を選択して上記フェッ
チ処理回路31のマルチプレクサ41へ送出する。
The incrementer 44 includes a decoding processing circuit 32.
The address sent from the decoding processing circuit 32 is sequentially incremented by "+1" in accordance with the content of the instruction from, and then output to the multiplexer 45. The multiplexer 45 includes an address and an incrementer 44 which are directly sent from the decoding processing circuit 32.
One of the addresses "+1" is selected and sent to the multiplexer 41 of the fetch processing circuit 31.

【0019】上記コンパレータ46は、分岐命令による分
岐先のアドレスが同分岐命令の以前の分岐先のアドレス
と同一であるか否かを比較判定するためのものであり、
デコード処理回路32から送られてくるアドレスとシステ
ムバス11を介して送られてくるアドレスとを比較し、両
者が一致した場合に“H”レベルとなる信号をアンド回
路48へ、これを反転した信号をアンド回路49へそれぞれ
送出する。
The comparator 46 is for comparing and judging whether or not the address of the branch destination of the branch instruction is the same as the address of the previous branch destination of the branch instruction.
The address sent from the decode processing circuit 32 and the address sent via the system bus 11 are compared, and when they match, the signal which becomes "H" level is inverted to the AND circuit 48. The signal is sent to the AND circuit 49, respectively.

【0020】条件判断器47は、分岐命令発生時に当該分
岐命令の分岐条件が成立するか否かを判定するもので、
条件が成立した場合に“H”レベルとなる信号をアンド
回路48,49へそれぞれ送出する。
The condition judging unit 47 judges whether or not the branch condition of the branch instruction is satisfied when the branch instruction is generated.
When the condition is satisfied, the signals which become "H" level are sent to the AND circuits 48 and 49, respectively.

【0021】しかるに、アンド回路48の出力が上記フェ
ッチ処理回路31のマルチプレクサ41への選択信号となる
もので、このアンド回路48の出力が“H”レベルとなる
場合、すなわち今回と以前の分岐先のアドレス値が一致
し、且つ分岐条件が成立した場合には上記フェッチ処理
回路31内でマルチプレクサ41が実行処理回路33のマルチ
プレクサ45から送られてくるアドレスを選択して出力す
ることとなる。一方、アンド回路49の出力は書込処理回
路34へ送出される。
However, when the output of the AND circuit 48 serves as a selection signal to the multiplexer 41 of the fetch processing circuit 31 and the output of the AND circuit 48 becomes the "H" level, that is, the current and previous branch destinations. When the address values of 1 and 2 match and the branch condition is satisfied, the multiplexer 41 in the fetch processing circuit 31 selects and outputs the address sent from the multiplexer 45 of the execution processing circuit 33. On the other hand, the output of the AND circuit 49 is sent to the write processing circuit 34.

【0022】書込処理回路34は、実行処理回路33で得ら
れた演算の結果をシステムバス11を介して適宜レジスタ
ないしはメモリに書込むためのものであり、書込制御部
50、マルチプレクサ51及び書込みデータ保持部52を有す
る。
The write processing circuit 34 is for writing the result of the operation obtained by the execution processing circuit 33 into a register or a memory via the system bus 11 as appropriate.
It has 50, a multiplexer 51, and a write data holding unit 52.

【0023】書込制御部50は、上記実行処理回路33のア
ンド回路49からの信号により書込み条件を判断し、制御
信号をマルチプレクサ51に与える。マルチプレクサ51
は、この書込制御部50からの制御信号に従って、通常の
書込みデータを保持する書込みデータ保持部52の保持内
容、実行処理回路33を介してデコード処理回路32から直
接送られてくるアドレス及び実行処理回路33から送られ
てくるアドレスのいずれか1つを選択してシステムバス
11へ出力する。
The write control unit 50 determines the write condition based on the signal from the AND circuit 49 of the execution processing circuit 33, and gives a control signal to the multiplexer 51. Multiplexer 51
In accordance with the control signal from the write control unit 50, the contents held in the write data holding unit 52 that holds normal write data, the address directly sent from the decoding processing circuit 32 via the execution processing circuit 33, and the execution Select one of the addresses sent from the processing circuit 33 to select the system bus
Output to 11.

【0024】上記のような構成にあって、次にその動作
について説明する。ここでは、図4に示すようなオブジ
ェクトプログラム23の一部がキャッシュメモリ13に記憶
され、CPU12で順次パイプライン処理方式により実行
されるものとする。同図でも上記図9と同様に横方向が
1つの命令に関する時間の流れ、縦方向が一連のプログ
ラムの処理に従った時間の流れを示している。同図中、
「J」が分岐命令、「J−1」、「J+1」及び「J+
2」が一連のオブジェクトプログラム23上で上記分岐命
令「J」の前、次及びその次に位置する命令、「A」が
分岐先の命令、「A+1」が分岐先の命令の次に位置す
る命令である。
The operation of the above arrangement will be described below. Here, it is assumed that a part of the object program 23 as shown in FIG. 4 is stored in the cache memory 13 and is sequentially executed by the CPU 12 by the pipeline processing method. Also in this figure, as in the case of FIG. 9 above, the horizontal direction shows the time flow for one instruction, and the vertical direction shows the time flow according to the processing of a series of programs. In the figure,
"J" is a branch instruction, "J-1", "J + 1" and "J +"
2 "is an instruction located before, next and next to the branch instruction" J "on the series of object programs 23," A "is a branch destination instruction, and" A + 1 "is next to a branch destination instruction. It is an instruction.

【0025】図5(A)はメインメモリ14から読出さ
れ、キャッシュメモリ13へ記憶された当初の、まだ実行
されていない状態での上記オブジェクトプログラム23の
一部を示す。同図(A)中の分岐命令「J」は、具体的
には分岐先の命令「A」のアドレス「n」へジャンプせ
よという命令(図では「jmp n」と示す)である。
また、この時点で分岐命令「J」の次及びその次に位置
する命令「J+1」及び「J+2」は、上記図2の説明
でも示した如く具体的にはそれぞれNOP命令である。
FIG. 5A shows a part of the object program 23 which is read from the main memory 14 and stored in the cache memory 13 in an initial state where the object program 23 is not yet executed. The branch instruction “J” in FIG. 7A is specifically an instruction to jump to the address “n” of the branch destination instruction “A” (indicated as “jmp n” in the figure).
Further, at this point, the instructions “J + 1” and “J + 2” next to and next to the branch instruction “J” are specifically NOP instructions as shown in the description of FIG.

【0026】図6及び図7は上記図3の構成回路による
パイプライン処理中の特に分岐命令に関する処理内容を
示すものである。上記キャッシュメモリ13の内容に従っ
てCPU12がプログラムを実行する場合、命令「J−
1」を実行し、続く命令「J」がデコード処理回路32に
おいて分岐命令であると判明すると(ステップS1 ,S
2 、S4 〜S6 )、デコード処理回路32は当該分岐命令
中の分岐先のアドレス「n」を取出して実行処理回路33
及び書込処理回路34へ送出すると共に(ステップS7
)、そのデコード結果を実行処理回路33へ送出する
(ステップS8 )。
FIG. 6 and FIG. 7 show the contents of processing especially regarding branch instructions during the pipeline processing by the configuration circuit of FIG. When the CPU 12 executes a program according to the contents of the cache memory 13, the instruction "J-
1 "is executed and the succeeding instruction" J "is found to be a branch instruction in the decode processing circuit 32 (steps S1 and S).
2, S4 to S6), the decode processing circuit 32 fetches the address "n" of the branch destination in the branch instruction and executes the execution processing circuit 33.
And to the write processing circuit 34 (step S7
), And sends the decoding result to the execution processing circuit 33 (step S8).

【0027】これを受けた実行処理回路33では、コンパ
レータ46がこのアドレスとシステムバス11より送られて
くる同分岐命令の以前の分岐先のアドレスとが同一であ
るか否かを比較判定するもので(ステップS9 ,S1
0)、ここではこの分岐命令が始めての実行であって以
前の分岐先のアドレスはないため、必ず両者は不一致と
なり、その出力は“L”レベルの信号となる。このコン
パレータ46の出力により続く命令「J+1」の実行が中
断されると共に(ステップS13)、このとき、条件判断
器47により分岐条件が成立していると判定されると(ス
テップS14)、アンド回路49ではコンパレータ46からの
入力が反転して共に“H”レベルとなるため、書込処理
回路34の書込制御部50への出力信号を“H”レベルとす
る(ステップS15)。
In the execution processing circuit 33 which has received this, the comparator 46 judges whether this address and the address of the previous branch destination of the same branch instruction sent from the system bus 11 are the same or not. (Steps S9, S1
0) In this case, since this branch instruction is the first execution and there is no previous branch destination address, both are always inconsistent, and the output is an "L" level signal. The execution of the subsequent instruction "J + 1" is interrupted by the output of the comparator 46 (step S13), and when the condition determiner 47 determines that the branch condition is satisfied (step S14), the AND circuit At 49, since the input from the comparator 46 is inverted and both become "H" level, the output signal to the write control unit 50 of the write processing circuit 34 is set to "H" level (step S15).

【0028】書込処理回路34の書込制御部50では、この
アンド回路49からの信号に応じてマルチプレクサ51に対
し、実行処理回路33から送られてくるデコード処理回路
32で取出された分岐先の命令のアドレス「n」を選択し
てシステムバス11へ出力し、キャッシュメモリ13の命令
「J+2」のアドレス位置に書込ませる(ステップS1
6)。この書込み動作は中断された命令「J+1」の書
込みステージにて行なう。
In the write control section 50 of the write processing circuit 34, the decode processing circuit sent from the execution processing circuit 33 to the multiplexer 51 in response to the signal from the AND circuit 49.
The address "n" of the branch destination instruction fetched in 32 is selected and output to the system bus 11, and written in the address position of the instruction "J + 2" in the cache memory 13 (step S1
6). This write operation is performed at the write stage of the interrupted instruction "J + 1".

【0029】続いて、フェッチ処理回路31が分岐先の命
令「A」をフェッチし(ステップS1 ,S2 、S4 )、
デコードして実行した後に(ステップS5 ,S6 ,S8
,S9 ,S18)、この命令「A」が上記分岐命令
「J」の分岐先に位置する命令であると判定すると(ス
テップS18)、この命令「A」をキャッシュメモリ13内
の命令「J+1」に相当するアドレス位置に書込ませる
(ステップS19)。この書込み動作は命令「A」の書込
みステージにて行なう。
Then, the fetch processing circuit 31 fetches the branch destination instruction "A" (steps S1, S2, S4),
After decoding and executing (steps S5, S6, S8
, S9, S18), if it is determined that this instruction "A" is located at the branch destination of the branch instruction "J" (step S18), this instruction "A" is assigned to the instruction "J + 1" in the cache memory 13. Is written in the address position corresponding to (step S19). This write operation is performed at the write stage of the instruction "A".

【0030】図5(B)はこのようにして書換えられた
キャッシュメモリ13の状態を示すものである。図示する
如く、図5(A)の実行前のプログラムと比較して分岐
命令「J」の次に位置する命令「J+1」が分岐命令
「J」に対応した分岐先の命令「A」に、さらにその次
に位置する命令「J+2」が分岐命令「J」に対応した
分岐先の命令「A」のアドレス「n」に書換えられてい
ることが分かる。
FIG. 5B shows the state of the cache memory 13 thus rewritten. As shown in the figure, the instruction “J + 1” located next to the branch instruction “J” is compared to the pre-execution program of FIG. Further, it can be seen that the instruction "J + 2" located next to the instruction is rewritten to the address "n" of the branch destination instruction "A" corresponding to the branch instruction "J".

【0031】このように書換えられたキャッシュメモリ
13のプログラムを2回目以降実行する場合には、命令
「J」がデコード処理回路32において分岐命令であると
判明した時点で、当該分岐命令中の分岐先のアドレス
「n」を取出して実行処理回路33及び書込処理回路34へ
送出する(ステップS1 ,S2 、S4 〜S7 )。
Cache memory rewritten in this way
When the program of 13 is executed for the second time and thereafter, when the instruction "J" is found to be a branch instruction in the decode processing circuit 32, the branch destination address "n" in the branch instruction is taken out and executed. It is sent to the circuit 33 and the write processing circuit 34 (steps S1, S2, S4 to S7).

【0032】これを受けた実行処理回路33では、コンパ
レータ46がこのアドレスとシステムバス11より送られて
くる同分岐命令の以前の分岐先のアドレスと同一である
か否かを比較判定するもので(ステップS8 〜S10)、
ここで両者が一致するとその出力は“H”レベルの信号
となる。このとき、同時に条件判断器47により分岐条件
が成立していると判定されると(ステップS11)、アン
ド回路48の両入力が“H”レベルとなるためにその出力
信号も“H”レベルとなり(ステップS12)、分岐命令
「J」の次に位置する命令「A」の実行が継続する。
In the execution processing circuit 33 that receives this, the comparator 46 determines whether or not this address is the same as the address of the previous branch destination of the same branch instruction sent from the system bus 11. (Steps S8 to S10),
If the two match, the output becomes an "H" level signal. At this time, if the condition determiner 47 determines that the branch condition is satisfied at the same time (step S11), both inputs of the AND circuit 48 become "H" level, and therefore the output signal also becomes "H" level. (Step S12), execution of the instruction "A" located next to the branch instruction "J" continues.

【0033】これと共に同アンド回路48の出力信号によ
りフェッチ処理回路31のマルチプレクサ41では、実行処
理回路33のマルチプレクサ45より出力される分岐先のア
ドレス「n」に「+1」した値を選択してプログラムカ
ウンタとしてのインクリメンタ42及びシステムバス11へ
出力し(ステップS1 ,S3 )、当該アドレスにある命
令をフェッチすることで(ステップS4 )分岐を実行さ
せる。この際、すでに分岐命令「J」の次に書込まれて
いる命令「A」の実行が継続されているため、大きなタ
イムラグを生じることなく分岐動作を実行することがで
きるものである。
At the same time, the output signal of the AND circuit 48 causes the multiplexer 41 of the fetch processing circuit 31 to select a value obtained by adding "+1" to the branch destination address "n" output from the multiplexer 45 of the execution processing circuit 33. The program is output to the incrementer 42 as a program counter and the system bus 11 (steps S1 and S3), and the instruction at the address is fetched (step S4) to execute the branch. At this time, since the instruction “A” already written after the branch instruction “J” is still being executed, the branch operation can be executed without causing a large time lag.

【0034】なお、上述した如くキャッシュメモリ13に
読出した初回のプログラム実行時に分岐条件が成立した
場合にのみこれを条件判断器47で判定してキャッシュメ
モリ13の内容を書換えるのではなく、キャッシュメモリ
13に読出したプログラムの初回実行時には分岐命令に対
応して条件の成立/不成立に拘らずキャッシュメモリ13
の内容を書換えるような構成としてもよい。
As described above, only when the branch condition is satisfied during the first execution of the program read to the cache memory 13, the condition judgment unit 47 judges this and the contents of the cache memory 13 are not rewritten, but the cache memory 13 is rewritten. memory
When the program read to 13 is executed for the first time, the cache memory 13 is responsive to the branch instruction regardless of whether the condition is satisfied or not satisfied.
The content may be rewritten.

【0035】この場合、プログラム実行時に分岐命令
「J」で取出された分岐先のアドレスを命令「J+2」
の位置に書込み、分岐先の命令「A」を命令「J+1」
の位置に書込む。このときに命令「A」は必ずフェッチ
することとなるが、分岐条件が成立しない際にはその実
行が中断される。
In this case, the address of the branch destination fetched by the branch instruction "J" when the program is executed is the instruction "J + 2".
Write to the position of, and branch destination instruction “A” to instruction “J + 1”
Write in the position. At this time, the instruction "A" is always fetched, but its execution is suspended when the branch condition is not satisfied.

【0036】そして、2回目以降の分岐命令の実行で
は、この分岐命令の次及びその次に位置する命令やアド
レスを書換えずにおくこともできるし、分岐先が異なる
場合にのみ書換えるようにしてもよい。
In the execution of the branch instruction for the second time and thereafter, it is possible to leave the instruction next to this branch instruction and the instruction and address located next to this branch instruction without rewriting, or to rewrite only when the branch destination is different. May be.

【0037】2回目以降の分岐命令の実行では書換えな
い方式において、分岐条件が成立しながらも分岐先のア
ドレスが一致しない場合には、その分岐命令の次に位置
する分岐先の命令は無効となり、プログラムカウンタの
値が分岐先のアドレスとなった時点で当該命令があらた
めてフェッチされることとなる。その際には命令やアド
レスの書換えは行なわれない。
In the method in which the branch instruction is not rewritten in the second and subsequent executions, if the branch destination address does not match even though the branch condition is satisfied, the branch destination instruction located next to the branch instruction becomes invalid. The instruction is fetched again when the value of the program counter reaches the branch destination address. In that case, the instruction and address are not rewritten.

【0038】また、上記実施例ではソースプログラム21
からコンパイラ22によりオブジェクトプログラム23に変
換する際に、オブジェクトプログラム23中の分岐命令の
後には例えば2つのNOP命令を書込んでおき、上述し
た処理により分岐命令の次を分岐先の命令に、その次を
分岐先のアドレスに書換えるものとして説明したが、こ
れに限らず、オブジェクトプログラム23中の分岐命令の
後に3つあるいはそれ以上の処理に関係ない余分な命令
を書込んでおき、分岐先のさらに2番目の命令、3番目
の命令、…に書換えてもよく、このようにすることでパ
イプラインの乱れを極力抑えることができる。この場
合、分岐命令の後のいずれかの位置に分岐先の命令のア
ドレスを書込むこととなるが、必要に応じてその位置を
変えるようにしてもよく、その際には分岐先の命令を書
込む位置も変わるようになるものである。
In the above embodiment, the source program 21
When converting from the compiler 22 to the object program 23, for example, two NOP instructions are written after the branch instruction in the object program 23, and the branch instruction next to the branch instruction is changed to the branch destination instruction by the processing described above. Although the following description is made by rewriting the address of the branch destination, the present invention is not limited to this, and after the branch instruction in the object program 23, three or more extra instructions unrelated to the processing are written to make the branch destination. May be rewritten to the second instruction, the third instruction, ..., And by doing so, the disturbance of the pipeline can be suppressed as much as possible. In this case, the address of the branch destination instruction is written at any position after the branch instruction, but the position may be changed if necessary. The writing position will also change.

【0039】さらに、上記実施例ではCPU12とキャッ
シュメモリ13及びメインメモリ14とを別々の構成として
説明したが、CPU12のチップ内部にキャッシュメモリ
13及びメインメモリ14を一体にして構成するものとして
も同等の効果を得ることができるのはいうでもない。
Furthermore, in the above embodiment, the CPU 12, the cache memory 13 and the main memory 14 are described as separate components, but the cache memory is provided inside the chip of the CPU 12.
It goes without saying that the same effect can be obtained even if the 13 and the main memory 14 are integrally configured.

【0040】[0040]

【発明の効果】以上詳記した如く本発明によれば、連想
メモリ等を使用せず、簡単な回路構成で2回目以降の分
岐命令実行時にパイプラインを大きく乱すことなく高速
で処理することが可能なパイプライン処理による演算処
理装置及び方法を提供することができる。
As described above in detail, according to the present invention, it is possible to perform high-speed processing without significantly disturbing the pipeline at the time of executing the second and subsequent branch instructions with a simple circuit configuration without using an associative memory. It is possible to provide an arithmetic processing device and method by possible pipeline processing.

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

【図1】本発明の一実施例に係るシステム構成を示すブ
ロック図。
FIG. 1 is a block diagram showing a system configuration according to an embodiment of the present invention.

【図2】同実施例に係るプログラムの変換状態を示す
図。
FIG. 2 is a diagram showing a conversion state of a program according to the embodiment.

【図3】図1のCPU内の具体回路構成を例示するブロ
ック図。
FIG. 3 is a block diagram illustrating a specific circuit configuration in the CPU of FIG.

【図4】同実施例に係るパイプライン処理を示す図。FIG. 4 is a diagram showing pipeline processing according to the embodiment.

【図5】同実施例に係るキャッシュメモリ上のプログラ
ムの書換状態を示す図。
FIG. 5 is a diagram showing a rewriting state of a program on the cache memory according to the embodiment.

【図6】同実施例に係る動作を説明するためのフローチ
ャート。
FIG. 6 is a flowchart for explaining an operation according to the embodiment.

【図7】同実施例に係る動作を説明するためのフローチ
ャート。
FIG. 7 is a flowchart for explaining an operation according to the embodiment.

【図8】一般的なパイプライン処理を例示する図。FIG. 8 is a diagram illustrating an example of general pipeline processing.

【図9】一般的な連続したパイプライン処理を例示する
図。
FIG. 9 is a diagram illustrating a general continuous pipeline process.

【符号の説明】 11…システムバス、12…CPU、13…キャッシュメモ
リ、14…メインメモリ、15…CRT、16…キーボード、
17…ハードディスク装置(HDD)、21…ソースプログ
ラム、22…コンパイラ、23…オブジェクトプログラム、
31…フェッチ(F)処理回路、32…デコード(D)処理
回路、33…実行(E)処理回路、34…書込(W)処理回
路、41,45,51…マルチプレクサ(MPX)、42,44…
インクリメンタ(INC)、43…フリップフロップ(F
/F)、46…コンパレータ(CMP)、47…条件判断
器、48,49…アンド回路、50…書込制御部、52…書込み
データ保持部。
[Explanation of Codes] 11 ... System Bus, 12 ... CPU, 13 ... Cache Memory, 14 ... Main Memory, 15 ... CRT, 16 ... Keyboard,
17 ... Hard disk device (HDD), 21 ... Source program, 22 ... Compiler, 23 ... Object program,
31 ... Fetch (F) processing circuit, 32 ... Decode (D) processing circuit, 33 ... Execution (E) processing circuit, 34 ... Write (W) processing circuit, 41, 45, 51 ... Multiplexer (MPX), 42, 44 ...
Incrementer (INC), 43 ... Flip-flop (F
/ F), 46 ... Comparator (CMP), 47 ... Condition determiner, 48, 49 ... AND circuit, 50 ... Write control section, 52 ... Write data holding section.

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理装置であっ
て、 パイプラインの実行ステージでその命令が始めて実行す
る分岐命令であるか否か判定する判定手段と、 パイプラインの上記実行ステージより後に位置する書込
みステージで、上記キャッシュメモリ中の上記判定手段
により始めて実行すると判定された分岐命令の次に位置
する命令を分岐先に位置する命令に、その次に位置する
命令を分岐先の命令の次に位置するアドレスにそれぞれ
書換える書込処理手段とを具備したことを特徴とする演
算処理装置。
1. An arithmetic processing unit that pipelines an instruction in a program read to a cache memory, and a determining unit that determines whether or not the instruction is a branch instruction to be executed first in an execution stage of the pipeline. In the write stage located after the execution stage of the pipeline, the instruction located next to the branch instruction determined to be executed for the first time by the determination means in the cache memory to the instruction located at the branch destination, An arithmetic processing unit comprising: a writing processing unit that rewrites a positioned instruction to an address positioned next to a branch destination instruction.
【請求項2】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理装置であっ
て、 パイプラインの実行ステージでその命令が分岐条件が成
立した分岐命令であるか否か判定する判定手段と、 パイプラインの上記実行ステージより後に位置する書込
みステージで、上記キャッシュメモリ中の上記判定手段
により分岐条件が成立したと判定された分岐命令の次に
位置する命令を分岐先に位置する命令に、その次に位置
する命令を分岐先の命令の次に位置するアドレスにそれ
ぞれ書換える書込処理手段とを具備したことを特徴とす
る演算処理装置。
2. An arithmetic processing unit that pipelines an instruction in a program read to a cache memory, and determines whether or not the instruction is a branch instruction in which a branch condition is satisfied at an execution stage of the pipeline. And a write stage located after the execution stage of the pipeline, an instruction located next to the branch instruction determined to satisfy the branch condition by the determination means in the cache memory at the branch destination. And a write processing means for respectively rewriting an instruction located next to the address located next to the branch destination instruction.
【請求項3】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理装置であっ
て、 パイプラインの実行ステージでその命令が分岐条件が成
立し、且つ以前と分岐先のアドレスが異なる分岐命令で
あるか否か判定する判定手段と、 パイプラインの上記実行ステージより後に位置する書込
みステージで、上記キャッシュメモリ中の上記判定手段
により分岐条件が成立し、且つ以前と分岐先のアドレス
が異なると判定された分岐命令の次に位置する命令を分
岐先に位置する命令に、その次に位置する命令を分岐先
の命令の次に位置するアドレスにそれぞれ書換える書込
処理手段とを具備したことを特徴とする演算処理装置。
3. An arithmetic processing unit for pipeline processing an instruction in a program read to a cache memory, wherein the branch condition is satisfied for the instruction at the execution stage of the pipeline, and the branch destination address is different from the previous one. In the write stage positioned after the execution stage of the pipeline, the determination means for determining whether the instruction is a branch instruction, the branch condition is satisfied by the determination means in the cache memory, and the address of the previous branch destination And a write processing unit for rewriting an instruction located next to a branch instruction determined to be different to an instruction located at a branch destination and an instruction located next to an address located next to an instruction at a branch destination. An arithmetic processing unit characterized by the above.
【請求項4】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理装置であっ
て、 以前に上記キャッシュメモリに記録した分岐命令の2つ
先にある分岐先のアドレスと実行中の分岐命令の分岐先
のアドレスとを比較する比較手段と、 パイプラインの実行ステージで当該分岐命令の2回目以
降の実行時に上記比較手段によりアドレスが一致した場
合にのみ当該分岐命令の次に位置する命令を実行する実
行処理手段とを具備したことを特徴とする演算処理装
置。
4. An arithmetic processing unit for pipeline processing an instruction in a program read to a cache memory, wherein an address of a branch destination two ahead of a branch instruction previously recorded in the cache memory and a branch instruction being executed. It is positioned next to the branch instruction only when the address is matched by the comparing means for comparing the branch destination address of the branch instruction with the comparing means during the second and subsequent executions of the branch instruction in the execution stage of the pipeline. An arithmetic processing unit comprising: an execution processing unit that executes an instruction.
【請求項5】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理装置であっ
て、 以前に上記キャッシュメモリに記録した分岐命令の2つ
先にある分岐先のアドレスと実行中の分岐命令の分岐先
のアドレスとを比較する比較手段と、 パイプラインの実行ステージで当該分岐命令の2回目以
降の実行時に上記比較手段によりアドレスが不一致の場
合に当該分岐命令の次に位置する命令を無効化する実行
処理手段とを具備したことを特徴とする演算処理装置。
5. An arithmetic processing unit for pipeline processing an instruction in a program read to a cache memory, wherein an address of a branch destination which is two ahead of a branch instruction previously recorded in the cache memory and a branch instruction being executed. Comparing means for comparing the branch destination address of the branch instruction, and an instruction positioned next to the branch instruction when the addresses do not match by the comparing means during the second and subsequent executions of the branch instruction in the pipeline execution stage And an execution processing unit for invalidating.
【請求項6】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理装置であっ
て、 与えられる選択信号に応じてプログラムカウンタのカウ
ント値と外部から入力されるアドレスのいずれか一方を
用いて上記キャッシュメモリをアクセスし、当該アドレ
スに位置する命令をフェッチするフェッチ処理手段と、 このフェッチ処理手段で得た命令をデコードし、命令が
分岐命令である際にはその分岐先のアドレスも出力する
デコード処理手段と、 このデコード処理手段でデコードした結果に基づいて演
算を実行すると共に、命令が分岐命令である際には分岐
先のアドレスと以前の保存していた当該分岐先のアドレ
スとの一致及び分岐条件の成立の有無に応じて分岐の実
行を判定し、判定結果に応じて上記フェッチ処理手段へ
アドレスの選択信号及びアドレスを、後段の書込処理手
段に書込制御信号及び分岐先のアドレスをそれぞれ送出
する実行処理手段と、 この実行処理手段で得た演算結果を所定の記憶位置に書
込むと共に、実行処理手段からの書込制御信号に従って
上記キャッシュメモリ中の分岐命令の次に位置する命令
を分岐先に位置する命令に、その次に位置する命令を分
岐先の命令の次に位置するアドレスにそれぞれ書換える
書込処理手段と、を具備したことを特徴とする演算処理
装置。
6. An arithmetic processing unit for pipeline processing an instruction in a program read to a cache memory, wherein either one of a count value of a program counter and an address inputted from the outside is supplied according to a given selection signal. Fetch processing means for accessing the cache memory by using the fetch processing means to fetch an instruction located at the address, and decoding the instruction obtained by the fetch processing means. When the instruction is a branch instruction, the branch destination address is also The decode processing means for outputting and the operation executed based on the result decoded by the decode processing means, and when the instruction is a branch instruction, the branch destination address and the previously stored branch destination address. Branch execution is determined according to whether the two match and whether the branch condition is satisfied, and the fetch processing is performed according to the determination result. Means for outputting an address selection signal and an address to the means, and a write control signal and a branch destination address to the write processing means in the subsequent stage, and an operation result obtained by the execution processing means in a predetermined storage position. In addition to writing, in accordance with the write control signal from the execution processing means, the instruction located next to the branch instruction in the cache memory is the instruction located at the branch destination, and the instruction located next is the instruction next to the branch destination. An arithmetic processing unit, comprising: a writing processing unit that rewrites each address.
【請求項7】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理方法であっ
て、 パイプラインの実行ステージでその命令が始めて実行す
る分岐命令であるか否か判定する判定処理と、 パイプラインの上記実行ステージより後に位置する書込
みステージで、上記キャッシュメモリ中の上記判定処理
により始めて実行すると判定された分岐命令の次に位置
する命令を分岐先に位置する命令に、その次に位置する
命令を分岐先の命令の次に位置するアドレスにそれぞれ
書換える書込処理とを有したことを特徴とする演算処理
方法。
7. An arithmetic processing method for pipeline processing an instruction in a program read to a cache memory, comprising a determination processing for determining whether the instruction is a branch instruction to be executed first in an execution stage of the pipeline. , At the write stage located after the execution stage of the pipeline, the instruction located next to the branch instruction determined to be executed for the first time by the determination processing in the cache memory becomes the instruction located at the branch destination, And a write process for rewriting a located instruction to an address located next to a branch destination instruction, respectively.
【請求項8】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理方法であっ
て、 パイプラインの実行ステージでその命令が分岐条件が成
立した分岐命令であるか否か判定する判定処理と、 パイプラインの上記実行ステージより後に位置する書込
みステージで、上記キャッシュメモリ中の上記判定処理
により分岐条件が成立したと判定された分岐命令の次に
位置する命令を分岐先に位置する命令に、その次に位置
する命令を分岐先の命令の次に位置するアドレスにそれ
ぞれ書換える書込処理とを有したことを特徴とする演算
処理方法。
8. An arithmetic processing method for pipeline processing an instruction in a program read to a cache memory, wherein a determination is made at a pipeline execution stage whether or not the instruction is a branch instruction satisfying a branch condition. In the processing and the write stage located after the execution stage of the pipeline, the instruction located next to the branch instruction determined to satisfy the branch condition by the determination processing in the cache memory is located at the branch destination. And a write process for rewriting the instruction located next to the address located next to the instruction at the branch destination, respectively.
【請求項9】 キャッシュメモリに読出したプログラム
中の命令をパイプライン処理する演算処理方法であっ
て、 パイプラインの実行ステージでその命令が分岐条件が成
立し、且つ以前と分岐先のアドレスが異なる分岐命令で
あるか否か判定する判定処理と、 パイプラインの上記実行ステージより後に位置する書込
みステージで、上記キャッシュメモリ中の上記判定処理
により分岐条件が成立し、且つ以前と分岐先のアドレス
が異なると判定された分岐命令の次に位置する命令を分
岐先に位置する命令に、その次に位置する命令を分岐先
の命令の次に位置するアドレスにそれぞれ書換える書込
処理とを有したことを特徴とする演算処理方法。
9. An arithmetic processing method for pipeline processing an instruction in a program read to a cache memory, wherein the branch condition is satisfied for the instruction at an execution stage of the pipeline, and a branch destination address is different from that before. In the determination process for determining whether the instruction is a branch instruction, and in the write stage located after the execution stage of the pipeline, the branch condition is satisfied by the determination process in the cache memory, and the addresses of the previous and branch destinations are The instruction located next to the branch instruction determined to be different is written to the instruction located at the branch destination, and the instruction located next is rewritten to the address located next to the instruction at the branch destination. An arithmetic processing method characterized by the above.
【請求項10】 キャッシュメモリに読出したプログラ
ム中の命令をパイプライン処理する演算処理方法であっ
て、 以前に上記キャッシュメモリに記録した分岐命令の2つ
先にある分岐先のアドレスと実行中の分岐命令の分岐先
のアドレスとを比較する比較処理と、 パイプラインの実行ステージで当該分岐命令の2回目以
降の実行時に上記比較処理によりアドレスが一致した場
合にのみ当該分岐命令の次に位置する命令を実行する実
行処理とを有したことを特徴とする演算処理方法。
10. An arithmetic processing method for pipeline processing an instruction in a program read to a cache memory, comprising: a branch destination address two ahead of a branch instruction previously recorded in the cache memory; It is positioned next to the branch instruction only when the address is matched by the comparison processing that compares the branch destination address of the branch instruction and the second and subsequent executions of the branch instruction in the pipeline execution stage. An arithmetic processing method comprising: an execution process for executing an instruction.
【請求項11】 キャッシュメモリに読出したプログラ
ム中の命令をパイプライン処理する演算処理方法であっ
て、 以前に上記キャッシュメモリに記録した分岐命令の2つ
先にある分岐先のアドレスと実行中の分岐命令の分岐先
のアドレスとを比較する比較処理と、 パイプラインの実行ステージで当該分岐命令の2回目以
降の実行時に上記比較処理によりアドレスが不一致の場
合に当該分岐命令の次に位置する命令を無効化する実行
処理とを有したことを特徴とする演算処理方法。
11. An arithmetic processing method for pipeline processing an instruction in a program read to a cache memory, comprising: a branch destination address two ahead of a branch instruction previously recorded in the cache memory; A comparison process that compares the branch destination address of the branch instruction, and an instruction located next to the branch instruction if the addresses do not match due to the comparison process during the second and subsequent executions of the branch instruction in the pipeline execution stage. And an execution process for invalidating.
【請求項12】 キャッシュメモリに読出したプログラ
ム中の命令をパイプライン処理する演算処理方法であっ
て、 与えられる選択信号に応じてプログラムカウンタのカウ
ント値と外部から入力されるアドレスのいずれか一方を
用いて上記キャッシュメモリをアクセスし、当該アドレ
スに位置する命令をフェッチするフェッチ処理と、 このフェッチ処理で得た命令をデコードし、命令が分岐
命令である際にはその分岐先のアドレスも出力するデコ
ード処理と、 このデコード処理でデコードした結果に基づいて演算を
実行すると共に、命令が分岐命令である際には分岐先の
アドレスと以前の保存していた当該分岐先のアドレスと
の一致及び分岐条件の成立の有無に応じて分岐の実行を
判定し、判定結果に応じて上記フェッチ処理へアドレス
の選択信号及びアドレスを、後段の書込処理に書込制御
信号及び分岐先のアドレスをそれぞれ送出する実行処理
と、 この実行処理で得た演算結果を所定の記憶位置に書込む
と共に、実行処理からの書込制御信号に従って上記キャ
ッシュメモリ中の分岐命令の次に位置する命令を分岐先
に位置する命令に、その次に位置する命令を分岐先の命
令の次に位置するアドレスにそれぞれ書換える書込処理
と、を有したことを特徴とする演算処理方法。
12. An arithmetic processing method for pipeline processing an instruction in a program read to a cache memory, wherein either one of a count value of a program counter and an address inputted from the outside according to a given selection signal. The cache memory is accessed by using the fetch process for fetching the instruction located at the address, the instruction obtained by this fetch process is decoded, and when the instruction is a branch instruction, the branch destination address is also output. In addition to performing a decoding process and an operation based on the result decoded in this decoding process, when the instruction is a branch instruction, the branch destination address matches the previously stored branch destination address and the branch is performed. The branch execution is judged according to whether the condition is satisfied, and the address is selected for the fetch processing according to the judgment result. Execution processing for sending the selection signal and address to the write processing of the subsequent stage, respectively, and the write control signal and the address of the branch destination, and the calculation result obtained in this execution processing is written in a predetermined storage location and A rewrite instruction for rewriting the instruction located next to the branch instruction in the cache memory to the instruction located at the branch destination and the instruction located next to the address located next to the instruction at the branch destination according to the write control signal of And an arithmetic processing method.
JP22763894A 1994-09-22 1994-09-22 Arithmetic processing apparatus and method Pending JPH0895784A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22763894A JPH0895784A (en) 1994-09-22 1994-09-22 Arithmetic processing apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22763894A JPH0895784A (en) 1994-09-22 1994-09-22 Arithmetic processing apparatus and method

Publications (1)

Publication Number Publication Date
JPH0895784A true JPH0895784A (en) 1996-04-12

Family

ID=16864026

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22763894A Pending JPH0895784A (en) 1994-09-22 1994-09-22 Arithmetic processing apparatus and method

Country Status (1)

Country Link
JP (1) JPH0895784A (en)

Similar Documents

Publication Publication Date Title
US4827402A (en) Branch advanced control apparatus for advanced control of a branch instruction in a data processing system
JPH0527143B2 (en)
US6631459B1 (en) Extended instruction word folding apparatus
JP3130446B2 (en) Program conversion device and processor
JPH0527971A (en) Information processing equipment
JPH03129432A (en) Branch control circuit
JPH02287626A (en) Pipeline system branch instruction controller
JP3741870B2 (en) Instruction and data prefetching method, microcontroller, pseudo instruction detection circuit
JP3490005B2 (en) Instruction control apparatus and method
JPH0651984A (en) Microprocessor
JP2503223B2 (en) Prior control method
JP2856703B2 (en) Processor
JP2878526B2 (en) Prefetch control method
JP3493110B2 (en) High-speed branch processing unit
JP3739556B2 (en) Information processing device
JPH0646381B2 (en) Instruction fetching device
JPH0241770B2 (en)
JPH05250156A (en) RISC processor
JPH06162067A (en) Device and method for controlling vector instruction
JPS61273637A (en) Information processor
JPH01263830A (en) Information processor
JPS60179844A (en) Instruction rereading control system
JPH0481218B2 (en)
JPH05158734A (en) Microprocessor
JPH07191879A (en) Microprocessor having debugging instruction execution function and debugging method