JPH03164935A - Arithmetic processor - Google Patents
Arithmetic processorInfo
- Publication number
- JPH03164935A JPH03164935A JP30624589A JP30624589A JPH03164935A JP H03164935 A JPH03164935 A JP H03164935A JP 30624589 A JP30624589 A JP 30624589A JP 30624589 A JP30624589 A JP 30624589A JP H03164935 A JPH03164935 A JP H03164935A
- Authority
- JP
- Japan
- Prior art keywords
- register
- arithmetic
- instruction
- address
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000000034 method Methods 0.000 description 1
Landscapes
- Advance Control (AREA)
Abstract
Description
【発明の詳細な説明】
産業上の利用分野
本発明は、演算実行をパイプライン処理する演算処理装
置に関する。DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to an arithmetic processing device that performs pipeline processing of arithmetic execution.
従来の技術 第3図は従来の演算処理装置の概略構成を示している。Conventional technology FIG. 3 shows a schematic configuration of a conventional arithmetic processing device.
1は命令コードであり、演算命令部OPと、命令実行に
より更新されるレジスタ・アドレスWと命令実行により
更新されないレジスタ・アドレスSの二つからなるレジ
スタ・アドレス部laが格納されている。2はアドレス
・デコーダでアリ、命令コード1のレジスタ・アドレス
部1aを入力として、レジスタ・アドレスのデコードを
行ない、レジスタの選択を行なう。3は演算レジスタで
あり、演算に必要なデータを格納しておくものである。1 is an instruction code, which stores an arithmetic instruction section OP, and a register address section la consisting of two register addresses W, which are updated by executing an instruction, and a register address S, which is not updated by executing an instruction. Reference numeral 2 denotes an address decoder which inputs the register address portion 1a of instruction code 1, decodes the register address, and selects a register. 3 is an arithmetic register which stores data necessary for arithmetic operations.
4は演算器であり、演算レジスタ3からの二つのデータ
を人力としパイプライン処理により演算を行ない、一つ
のデータを演算レジスタ3に向けて出力するものである
。Reference numeral 4 denotes an arithmetic unit which performs arithmetic operations on two data from the arithmetic register 3 by manual pipeline processing and outputs one piece of data to the arithmetic register 3.
次に上記従来例の動作について説明する。まず命令コー
ドのレジスタ・アドレス部1aをアドレス・デコーダ2
に入力することにより、アドレス・デコーダ2が演算レ
ジスタ3において二つのレジスタを選択する。次に、演
算器4は選択された二つのレジスタに格納されているデ
ータを入力とし、命令コード1の演算命令部OPによる
演算を2ステージからなるパイプライン処理により実行
し、実行後は一つの出力データを、アドレス・デコーダ
2によって選択されている演算レジスタ3のレジスタ・
アドレスWに格納する。Next, the operation of the above conventional example will be explained. First, the register address part 1a of the instruction code is transferred to the address decoder 2.
By inputting , the address decoder 2 selects two registers in the arithmetic register 3. Next, the arithmetic unit 4 takes as input the data stored in the two selected registers, executes the arithmetic operation by the arithmetic instruction part OP of instruction code 1 by pipeline processing consisting of two stages, and after execution, one The output data is sent to the register of the arithmetic register 3 selected by the address decoder 2.
Store at address W.
発明が解決しようとする課題
しかしながら上記従来装置では、命令実行時にデータが
更新されたレジスタにおいて更新前のデータが保存でき
ないという問題があった。したかって、更新前のデータ
が必要な時には、更新されるレジスタのデータを他のレ
ジスタに複写する命令をあらかじめ実行しておく必要が
あり、命令数が増加するという問題を有していた。Problems to be Solved by the Invention However, the conventional device described above has a problem in that data before update cannot be saved in a register whose data has been updated when an instruction is executed. Therefore, when the data before update is required, it is necessary to execute an instruction to copy the data of the register to be updated to another register in advance, resulting in a problem that the number of instructions increases.
また条件分岐命令直後の、分岐の如何にかかわらず実行
する命令は、分岐命令実行後の分岐先命令を考えてレジ
スタの内容を保存しておくために、無実行命令や使用可
能演算レジスタが制限された命令としなければならない
という問題を有していた。In addition, instructions that are executed immediately after a conditional branch instruction regardless of whether the branch is executed are limited to non-executable instructions or usable arithmetic registers in order to save the contents of the register in consideration of the branch destination instruction after the branch instruction is executed. The problem was that it had to be taken as a given order.
本発明は、このような従来の問題を解決するものであり
、命令実行により更新されるレジスタのデータを命令実
行によらず退避できるとともに、演算レジスタのアドレ
スを考慮せずに復帰することができる演算処理装置を提
供することを第1の目的とする。The present invention solves these conventional problems, and makes it possible to save data in registers that are updated by executing an instruction, regardless of the execution of an instruction, and to restore data without considering the address of an arithmetic register. The first objective is to provide an arithmetic processing device.
本発明の第2の目的は、命令実行をパイプライン処理す
る場合には必ず存在する条件分岐命令直後の分岐の如何
にかかわらず実行する命令に対して、使用可能演算レジ
スタの制限がない演算処理装置を提供することにある。A second object of the present invention is to provide arithmetic processing that does not limit the number of usable arithmetic registers for instructions that are executed regardless of the branch immediately after a conditional branch instruction, which always exists when instruction execution is pipelined. The goal is to provide equipment.
課題を解決するための手段
本発明は、上記目的を達成するために、演算レジスタの
他に、実行命令ごとに更新される演算レジスタの値およ
びレジスタ・アドレスを格納する一つ以上の退避レジス
タと、命令実行後に演算レジスタの出力と退避レジスタ
の値とからいずれか一つを選択して演算レジスタに出力
するデータ・セレクタと、命令コードのレジスタ・アド
レス部と退避レジスタに格納されているレジスタ・アド
レスとからいずれか一つを選択してアドレス・デコーダ
へ出力するアドレス・セレクタとを備えている。Means for Solving the Problems In order to achieve the above object, the present invention provides, in addition to the arithmetic register, one or more save registers that store the value and register address of the arithmetic register that are updated for each executed instruction. , a data selector that selects either the output of the calculation register or the value of the save register after execution of the instruction and outputs it to the calculation register, and the register address part of the instruction code and the register address part stored in the save register. and an address selector that selects one of the addresses and outputs it to the address decoder.
また、本発明による他の実施例では、上記構成に加えて
、退避レジスタに格納されているデータを演算レジスタ
に書き込むためのレジスタ復帰命令実行時に、条件分岐
命令実行後か否かを判断してアドレス・セレクタとデー
タ・セレクタにおいて退避レジスタからの入力を選択す
る条件分岐判断手段を備えている。Further, in another embodiment according to the present invention, in addition to the above configuration, when executing a register restore instruction for writing data stored in a save register to an arithmetic register, it is determined whether or not a conditional branch instruction has been executed. The address selector and data selector are provided with conditional branch judgment means for selecting input from the save register.
作用
本発明は、上記のような構成により、次のような作用を
有する。すなわち、演算レジスタのデータの退避を行な
う場合には、まず始めに命令コードのレジスタ・アドレ
ス部がアドレス・デコーダに人力される。これと同時に
、命令実行により更新されるレジスタのレジスタ・アド
レスを退避レジスタに格納してお(。次に、人力された
アドレスをアドレス・デコーダがデコードし、演算レジ
スタの選択を行なった後、選択されたレジスタのデータ
を演算器に入力するとともに、畠令実行により更新され
るレジスタのデータを退避レジスタに格納しておく。そ
の後、演算器は演算を終了し、データを演算レジスタに
格納するが、この時、更新されたレジスタの更新前のデ
ータは、レジスタ・アドレスとともに退避レジスタに格
納されており、特別な命令実行によらずにそのデータを
退避させることができる。Effects The present invention has the following effects due to the above configuration. That is, when saving data in an operation register, first the register address part of the instruction code is manually entered into the address decoder. At the same time, the register address of the register updated by the instruction execution is stored in the save register (.Next, the address decoder decodes the manually entered address, selects the operation register, and then The data in the registers that have been updated are input to the arithmetic unit, and the data in the registers updated by the execution of the instruction is stored in the save register.After that, the arithmetic unit finishes the operation and stores the data in the arithmetic register. , At this time, the data before updating of the updated register is stored in the save register together with the register address, and the data can be saved without executing a special instruction.
また、退避レジスタに格納されているデータの演算レジ
スタへの復帰を行なう場合には、アドレス・セレクタが
退避レジスタに格納されているレジスタ・アドレスを選
択してアドレス・デコーダに入゛力することにより演算
レジスタの選択を行なった後、データ・セレクタが退避
レジスタのデータを選択して演算レジスタに格納するこ
とにより、復帰する演算レジスタのレジスタ・アドレス
を指定することなく、退避レジスタに格納されているデ
ータの演算レジスタへの復帰を行なうことができる。Also, when restoring data stored in the save register to the calculation register, the address selector selects the register address stored in the save register and inputs it to the address decoder. After selecting the arithmetic register, the data selector selects the data in the save register and stores it in the arithmetic register, so that the data is stored in the save register without specifying the register address of the arithmetic register to be restored. Data can be returned to the operation register.
また、本発明の別の実施例では、上記のようなレジスタ
の退避を常に行ないながら、条件分岐命令実行時には条
件分岐判断手段に分岐を実行するか否かを記憶させてお
き、条件分岐命令直後の分岐の如何にかかわらず実行す
る命令が実行された後に分岐した時には、分岐先命令と
して条件分岐判断手段に条件分岐が実行されたことが記
憶されているときのみ、上記のような退避レジスタの復
帰を行なう退避レジスタ復帰命令を実行する。これによ
り、命令実行をパイプライン処理する演算器には必ず存
在する条件分岐命令直後の分岐の如何にかかわらず実行
する命令に対する使用可能演算レジスタの制限をなくす
ことができる。Further, in another embodiment of the present invention, while always saving the registers as described above, when executing a conditional branch instruction, the conditional branch judgment means stores whether or not to execute the branch, and immediately after the conditional branch instruction When a branch is made after an instruction to be executed regardless of branching is executed, the above-mentioned save register is saved only when the conditional branch determination means remembers that the conditional branch has been executed as the branch destination instruction. Execute the save register restore instruction that performs the restore. As a result, it is possible to eliminate the limitation on usable arithmetic registers for instructions to be executed regardless of the branch immediately after a conditional branch instruction, which always exists in an arithmetic unit that performs pipeline processing of instruction execution.
実施例
(実施例1)
第1図は本発明の第1の実施例における演算処理装置の
概略構成を示している。第1図において、11は命令コ
ードであり、演算命令部oPと、命令実行により更新さ
れるレジスタ・アドレスWと命令実行により更新されな
いレジスタ・アドレスSの二つからなるレジスタ・アド
レス部11aが格納されている。12はアドレス・デコ
ーダであり、命令コート11のレジスタ・アドレス部1
1aを人力として、レジスタ・アドレスのデコードを行
ない、レジスタの選択を行なう。13は演算レジスタで
あり、演算に必要なデータを格納しておく。14は演算
器であり、演算レジスタ13からの二つのデータを入力
とし2ステージからなるパイプライン処理により演算を
行ない、つのデータを出力する。15は退避レジスタで
あり、演算レジスタ13に格納されているデータと同一
ビット幅のデータとレジスタ・アドレスWを格納する。Embodiment (Embodiment 1) FIG. 1 shows a schematic configuration of an arithmetic processing device in a first embodiment of the present invention. In FIG. 1, 11 is an instruction code, and a register address section 11a is stored, which consists of an arithmetic instruction section oP, a register address W that is updated by executing an instruction, and a register address S that is not updated by executing an instruction. has been done. 12 is an address decoder, and register address section 1 of instruction code 11
1a is used manually to decode register addresses and select registers. Reference numeral 13 is an arithmetic register that stores data necessary for the arithmetic operation. 14 is an arithmetic unit which inputs two data from the arithmetic register 13, performs arithmetic operations through pipeline processing consisting of two stages, and outputs two pieces of data. A save register 15 stores data having the same bit width as the data stored in the arithmetic register 13 and a register address W.
16はデータ・セレクタであり、演算器14の出力デー
タと退避レジスタ15に格納されているデータとから一
つを選択して演算レジスタ13のレジスタ・アドレスW
への書き込みを行なう。17はアドレス・セレクタであ
り、命令コード11のレジスタ・アドレスWと、退避レ
ジスタ15に格納されているレジスタ・アドレスWとか
ら一つを選択し、アドレス・デコーダ2ヘアドレスを出
力する。16 is a data selector which selects one from the output data of the arithmetic unit 14 and the data stored in the save register 15, and selects the register address W of the arithmetic register 13.
Write to. An address selector 17 selects one of the register address W of the instruction code 11 and the register address W stored in the save register 15, and outputs the address to the address decoder 2.
次に上記第1の実施例の動作について説明する。命令コ
ード11の演算命令部opの内容が、演算実行によって
演算レジスタ13へのデータの書き込みがなされる命令
の時には、命令コード11のレジスタ・アドレス部11
aがアドレス・デコーダ12に入力される。これと同時
に、命令実行により更新されるレジスタのレジスタ・ア
ドレスWを退避レジスタ15に格納しておく。次に、入
力されたアドレスをアドレス・デコーダ12がデコード
し、演算レジスタ13の選択を行なった後、選択された
レジスタのデータを演算器14に入力するとともに、命
令実行により更新されるレジスタのデータを退避レジス
タ15に格納してお(。その後、演算器14は演算を終
了し、データを演算レジスタ13に格納することにより
、更新されたレジスタの更新前データはレジスタ・アド
レスWとともに退避レジスタ15に格納されており、退
避が終了している。また、命令コード11の演算命令部
OPの内容が演算実行によって演算レジスタ13へのデ
ータ書き込みが生じない命令の時には、上記のような退
避は行なわない。Next, the operation of the first embodiment will be explained. When the contents of the arithmetic instruction part OP of the instruction code 11 are instructions for writing data to the arithmetic register 13 by executing an operation, the register address part 11 of the instruction code 11
a is input to the address decoder 12. At the same time, the register address W of the register updated by the instruction execution is stored in the save register 15. Next, the address decoder 12 decodes the input address and selects the arithmetic register 13, and then inputs the data of the selected register to the arithmetic unit 14, and the data of the register that is updated by executing the instruction. is stored in the save register 15 (.Then, the arithmetic unit 14 finishes the operation and stores the data in the arithmetic register 13, so that the pre-update data of the updated register is saved in the save register 15 along with the register address W. , and the saving has been completed.Furthermore, when the contents of the operation instruction part OP of the instruction code 11 are instructions that do not cause data to be written to the operation register 13 by execution of the operation, the above-mentioned saving is not performed. do not have.
次に、命令コード11の演算命令部opの内容が退避レ
ジスタ15に退避させたデータの復帰命令である時には
、アドレス・セレクタ17が、退避レジスタ15に格納
されているレジスタ・アドレスWを選択してアドレス・
デコーダ12に出力することにより演算レジスタ13の
レジスタの選択をし、かつデータ・セレクタ16が、退
避レジスタ15のデータを選択して演算レジスタ13に
出力し、演算レジスタ13にデータを書き込むこ]、0
とにより、データの復帰が終了する。Next, when the content of the operation instruction part OP of the instruction code 11 is an instruction to restore the data saved in the save register 15, the address selector 17 selects the register address W stored in the save register 15. Address
selecting a register in the arithmetic register 13 by outputting it to the decoder 12, and the data selector 16 selecting data in the save register 15 and outputting it to the arithmetic register 13, and writing the data in the arithmetic register 13]; 0, the data restoration ends.
このように上記第1の実施例によれば、演算レジスタの
他に、退避レジスタ15とデーターセレクタ16とアド
レス・セレクタ17とを設けることにより、演算実行に
よって演算レジスタ13への書き込みがなされる命令の
時には、更新前のデータは必ず退避され、最後に更新さ
れた演算レジスタ13の更新前データを復帰する命令の
時には、演算レジスタ13のレジスタ・アドレスを指定
することなく、演算レジスタ13への復帰を行なうこと
ができる。In this manner, according to the first embodiment, by providing the save register 15, data selector 16, and address selector 17 in addition to the arithmetic register, an instruction that writes to the arithmetic register 13 by executing an arithmetic operation can be written to the arithmetic register 13. In this case, the data before update is always saved, and when the instruction is to restore the data before update of the arithmetic register 13 that was last updated, the data is returned to the arithmetic register 13 without specifying the register address of the arithmetic register 13. can be done.
なお、本実施例では退避レジスタ15に格納できるデー
タは一つだけであるが、退避レジスタ15に複数のデー
タを格納する構成としてもよく、その際には退避レジス
タ15内のデータを常に時間順に並べておく手段を付加
すればよい。In this embodiment, only one piece of data can be stored in the save register 15, but a configuration may be adopted in which multiple pieces of data can be stored in the save register 15. In this case, the data in the save register 15 is always arranged in chronological order. All you need to do is add a means to arrange them.
(実施例2)
第2図は、本発明の第2の実施例における演算処理装置
の概略構成を示しており、第1図に示した実施例と同じ
要素には同じ符号が付しである。(Embodiment 2) FIG. 2 shows a schematic configuration of an arithmetic processing device in a second embodiment of the present invention, and the same elements as in the embodiment shown in FIG. 1 are given the same reference numerals. .
第2図において、11は命令コートであり、演算命令部
OPと、命令実行により更新されるレジスタ・アドレス
Wと命令実行により更新されないレジスタ・アドレスS
の二つからなるレジスタ・アドレス部113が格納され
ている。912はアドレス・デコーダであり、命令コー
ド11のレジスタ・アドレス部11aを人力として、レ
ジスタ・アドレスのデコードを行ない、レジスタの選択
を行なう。13は演算レジスタであり、演算に必要なデ
ータを格納しておく。↓4は演算器であり、演算レジス
タ13からの二つのデータを人力とし2ステージからな
るパイプライン処理により演算を行ない、一つのデータ
を出力する。15は退避レジスタであり、演算レジスタ
13に格納されているデータと同一ビット幅のデータと
レジスタ・アドレスWを格納する。16はデータ・セレ
クタであり、演算器14の出力データと退避レジスタ1
5に格納されているデータとから一つを選択して演算レ
ジスタ13のレジスタ・アドレスWへの書き込みを行な
う。17はアドレス・セレクタであり、命令コード11
のレジスタ・アドレスWと、退避レジスタ15に格納さ
れているレジスタ・アドレスWとから一つを選択し、ア
ドレス・デコーダ2ヘアドレスを出力する。18は条件
分岐判断手段であり、条件分岐命令実行時に分岐を実行
したか否かを記憶しておき、退避レジスタ復帰命令が実
行される時には、分岐したか否かを判断して分岐が実行
されたときにのみ、アドレス・セレクタ17とデータ・
セレクタ16において退避レジスタ15からの入力を選
択する。In FIG. 2, 11 is an instruction code, which includes an arithmetic instruction section OP, a register address W that is updated by executing an instruction, and a register address S that is not updated by executing an instruction.
A register address field 113 consisting of two is stored. Reference numeral 912 denotes an address decoder, which manually decodes the register address using the register address section 11a of the instruction code 11 and selects a register. Reference numeral 13 is an arithmetic register that stores data necessary for the arithmetic operation. ↓ 4 is an arithmetic unit which manually performs arithmetic operations on two data from the arithmetic register 13 through pipeline processing consisting of two stages, and outputs one piece of data. A save register 15 stores data having the same bit width as the data stored in the arithmetic register 13 and a register address W. 16 is a data selector which selects the output data of the arithmetic unit 14 and the save register 1.
One of the data stored in 5 is selected and written to the register address W of the arithmetic register 13. 17 is an address selector, and instruction code 11
and the register address W stored in the save register 15, and outputs the address to the address decoder 2. Reference numeral 18 denotes a conditional branch determination means, which stores whether or not a branch has been executed when a conditional branch instruction is executed, and when a save register restoration instruction is executed, determines whether or not a branch has been taken and executes the branch. Address selector 17 and data
The selector 16 selects the input from the save register 15.
次に−F記第2の実施例の動作について説明する。命令
コード11の演算命令部OPの内容が、演算実行によっ
て演算レジスタ13へのデータの書き込みがなされる命
令の時には、命令コード11のレジスタ・アドレス部1
1aがアドレス・デコーダ12に入力される。これと同
時に、命令実行により更新されるレジスタのレジスタ・
アドレスWを退避レジスタ15に格納しておく。次に、
入力されたアドレスをアドレス・デコーダ12がデコー
ドし、演算レジスタ13の選択を行なった後、選択され
たレジスタのデータを演算器14に入力するとともに、
命令実行により更新されるレジスタのデータを退避レジ
スタ15に格納しておく。その後、演算器14は演算を
終了し、データを演算レジスタ13に格納することによ
り、更新されたレジスタの更新前データはレジスタ・ア
ドレスWとともに退避レジスタ15に格納されており、
退避が終了している。また、命令コード11の演算命令
部OPの内容が演算実行によって演算レジスタ13への
データ書き込みが生じない命令の時には、上記のような
退避は行なわないが、条件分岐命令で分岐を行なう時に
は、条件分岐判断手段18は分岐を実行したことを記憶
し、分岐を行なった後の分岐先l命令を実行後に記憶の
消去を行なう。Next, the operation of the second embodiment described in -F will be explained. When the contents of the arithmetic instruction part OP of the instruction code 11 are instructions for writing data to the arithmetic register 13 by executing an operation, the register address part 1 of the instruction code 11 is
1a is input to address decoder 12. At the same time, registers of registers updated by instruction execution
The address W is stored in the save register 15. next,
After the address decoder 12 decodes the input address and selects the arithmetic register 13, the data of the selected register is input to the arithmetic unit 14, and
The data of the register updated by the execution of an instruction is stored in the save register 15. Thereafter, the arithmetic unit 14 finishes the arithmetic operation and stores the data in the arithmetic register 13, so that the pre-update data of the updated register is stored in the save register 15 along with the register address W.
Evacuation is complete. Furthermore, when the contents of the arithmetic instruction section OP of the instruction code 11 are instructions that do not cause data to be written to the arithmetic register 13 upon execution of an arithmetic operation, the above-mentioned saving is not performed. The branch determining means 18 stores the fact that the branch has been executed, and erases the memory after executing the branch destination l instruction after the branch.
次に、命令コード11の演算命令部○Pの内容が退避レ
ジスタ復帰命令である時は、条件分岐判断手段18に分
岐が実行されたことが記憶されている時にのみ、アドレ
ス・セレクタ17が、退避レジスタ15に格納されてい
るレジスタ・アドレ 4
スWを選択してアドレス・デコーダ12に出力すること
により演算レジスタ13のレジスタの選択をし、かつデ
ータ・セレクタ16が、退避レジスタ15のデータを選
択して演算レジスタ13に出力し、演算レジスタ13に
データを書き込むことにより、データの復帰が終了する
。Next, when the content of the arithmetic instruction part ○P of the instruction code 11 is a save register restoration instruction, the address selector 17 only when the conditional branch judgment means 18 stores that the branch has been executed. By selecting the register address W stored in the save register 15 and outputting it to the address decoder 12, the register of the arithmetic register 13 is selected, and the data selector 16 selects the data of the save register 15. Data restoration is completed by selecting and outputting to the calculation register 13 and writing the data to the calculation register 13.
このように、上記第2の実施例によれば、演算レジスタ
の他に、退避レジスタ15とデーターセレクタ16とア
ドレス・セレクタ17と条件分岐判断手段18とを設け
ることにより、演算実行によって演算レジスタ13への
書き込みがされる時には、更新前のデータは必ず退避さ
れ、退避データの復帰命令時には、条件分岐命令実行に
よる分岐を行なった時にのみ、演算レジスタ13のレジ
スタ・アドレスを指定することなく、最後に更新された
演算レジスタ13の更新前データの演算レジスタ13へ
の復帰を行なうことができる。これにより、命令実行を
パイプライン処理する時には必ず存在する条件分岐命令
直後の分岐の如何にかかわらず実行する命令が、分岐し
ないことを前提としたような演算レジスタ13のデータ
を更新する命令として実行された後、分岐が実行された
時でも、分岐先命令に退避レジスタ復帰命令を付加して
おくことにより、演算レジスタ13のデータを分岐実行
前の状態に復帰させてから分岐後の命令実行を行なうこ
とができる。また、分岐先命令以外として退避レジスタ
復帰命令を実行した時には、条件分岐判断手段18によ
り復帰を実行しないため、演算レジスタ13の状態を変
化させることはなく、退避レジスタ復帰命令は条件分岐
命令と完全に対として使用することができる。As described above, according to the second embodiment, by providing the save register 15, the data selector 16, the address selector 17, and the conditional branch determination means 18 in addition to the arithmetic register, the arithmetic register 13 is When data is written to, the data before updating is always saved, and when the saved data is restored, only when a branch is executed by executing a conditional branch instruction, the last data is saved without specifying the register address of the arithmetic register 13. The pre-update data of the arithmetic register 13 that has been updated can be returned to the arithmetic register 13. As a result, the instruction that is executed regardless of the branch immediately after the conditional branch instruction, which always exists when executing pipeline processing of instruction execution, is executed as an instruction that updates the data in the calculation register 13 on the assumption that there will be no branch. Even when a branch is executed after a branch is executed, by adding a save register restore instruction to the branch destination instruction, the data in the arithmetic register 13 can be restored to the state before the branch execution before executing the instruction after the branch. can be done. Furthermore, when a save register return instruction is executed as a non-branch destination instruction, the conditional branch judgment means 18 does not execute the return, so the state of the arithmetic register 13 does not change, and the save register return instruction is completely different from a conditional branch instruction. Can be used as a pair.
なお、本実施例では2ステージからなるパイプライン処
理により演算を実行する演算器14を使用しているため
、条件分岐命令直後の分岐の如何にかかわらず実行する
命令は1命令のみとなり、退避レジスタ15に格納でき
るデータは−っだけでよいが、さらにステージ数の多い
パイプライン処理により演算を実行する演算器を使用す
る場合には、退避レジスタ15に複数のデータを格納す
る構成とし、退避レジスタ15内のデータを常に時間順
に並べておく手段を付加すればよい。その際でも、退避
レジスタに格納しておくデータの数は、条件分岐命令直
後の分岐の如何にかかわらず実行する命令の数と同数で
よい。Note that since this embodiment uses the arithmetic unit 14 that executes arithmetic operations by a two-stage pipeline process, only one instruction is executed regardless of the branch immediately after the conditional branch instruction, and the save register is The data that can be stored in the save register 15 is only -, but when using an arithmetic unit that executes operations by pipeline processing with a large number of stages, the save register 15 should be configured to store multiple pieces of data. What is necessary is to add a means for always arranging the data in 15 in chronological order. Even in this case, the number of data stored in the save register may be the same as the number of instructions to be executed regardless of the branch immediately after the conditional branch instruction.
発明の詳細
な説明したように、本発明によれば、演算実行によって
演算レジスタへの書き込みがなされる時には更新前のデ
ータは必ず退避され、最後に更新された演算レジスタの
更新前データを復帰する時には、演算レジスタのレジス
タ・アドレスを指定することなく、演算レジスタへの復
帰を行なうことができるため、命令数の増加を防ぐこと
ができる。As described in detail, according to the present invention, when data is written to an arithmetic register by execution of an arithmetic operation, the pre-update data is always saved, and the pre-update data of the last updated arithmetic register is restored. In some cases, it is possible to return to the arithmetic register without specifying the register address of the arithmetic register, thereby preventing an increase in the number of instructions.
本発明によればまた、条件分岐命令実行による分岐を行
なった時にのみ、演算レジスタのレジスタ・アドレスを
指定することなく、最後に更新された演算レジスタの更
新前データの演算レジスタへの復帰を行なうことができ
るため、命令実行をパイプライン処理する時には必ず存
在する条件分岐命令直後の分岐の如何にかかわらず実行
する命7
令として、演算レジスタのデータを更新するような命令
を配置することができ、分岐が実行されて、演算レジス
タのデータを分岐命令実行前の状態に復帰させる必要が
ある場合でも、分岐先命令に退避レジスタ復帰命令を配
置しておくことによってデータの復帰が可能となる。こ
のため、従来はとんどの場合無実行命令を配置していた
条件分岐命令直後の分岐の如何にかかわらず実行する命
令の位置に、使用可能演算レジスタの制限の無い通常の
演算命令を配置することができ、特に、条件分岐命令が
ほとんどの場合分岐せず、まれに分岐するだけというよ
うに命令配置がなされている場合には、復帰のための命
令数を差し引いても大幅に命令数を減らすことができ、
その効果は大きい。さらに、命令配置を自動化して行な
うような場合でも、条件分岐命令が分岐するしないを考
慮せずに連続して演算命令を配置することができ、命令
配置の自動化が容易になるという優れた効果を有する。According to the present invention, only when a branch is executed by executing a conditional branch instruction, the data before update of the last updated arithmetic register is returned to the arithmetic register without specifying the register address of the arithmetic register. Therefore, it is possible to place an instruction that updates data in an operation register as an instruction that is executed regardless of the branch immediately after the conditional branch instruction that always exists when executing instructions in a pipeline. Even if a branch is executed and it is necessary to restore the data in the arithmetic register to the state before execution of the branch instruction, the data can be restored by placing a save register restoration instruction in the branch destination instruction. For this reason, a normal arithmetic instruction with no restrictions on the usable arithmetic registers is placed at the position of the instruction that is executed regardless of the branch immediately after the conditional branch instruction, whereas conventionally a non-executable instruction was placed in most cases. This can significantly reduce the number of instructions even if the number of instructions for return is subtracted, especially if the instruction arrangement is such that conditional branch instructions do not branch most of the time and only occasionally branch. can be reduced,
The effect is great. Furthermore, even when automating instruction placement, it is possible to place arithmetic instructions consecutively without considering whether a conditional branch instruction will branch or not, making it easier to automate instruction placement. has.
8
第1図は本発明の第1の実施例における演算処理装置の
概略ブロック図、第2図は本発明の第2の実施例におけ
る演算処理装置の概略ブロック図、第3図は従来の演算
処理装置の概略ブロック図である。
11・・・命令コード、lla・・・レジスタ・アドレ
ス部、12・・・アドレス・デコーダ、13・・・演算
レジスタ、14・・・演算器、15・・・退避レジスタ
、16・・・アドレス・セレクタ、17・・・データ・
セレクタ、18・・・条件分岐判断手段。8. FIG. 1 is a schematic block diagram of the arithmetic processing device in the first embodiment of the present invention, FIG. 2 is a schematic block diagram of the arithmetic processing device in the second embodiment of the present invention, and FIG. 3 is a schematic block diagram of the arithmetic processing device in the second embodiment of the present invention. FIG. 2 is a schematic block diagram of a processing device. DESCRIPTION OF SYMBOLS 11... Instruction code, lla... Register address part, 12... Address decoder, 13... Arithmetic register, 14... Arithmetic unit, 15... Save register, 16... Address・Selector, 17...Data・
Selector, 18... Conditional branch judgment means.
Claims (2)
アドレス・デコーダと、前記アドレス・デコーダにより
選択される一つ以上の演算レジスタと、前記演算レジス
タの値を入力として命令実行をパイプライン処理する演
算器と、実行命令ごとに更新される前記演算レジスタの
値およびレジスタ・アドレスを格納する一つ以上の退避
レジスタと、命令実行後に前記演算器の出力と前記退避
レジスタの値とからいずれか一つを選択して前記演算レ
ジスタに出力するデータ・セレクタと、前記命令コード
のレジスタ・アドレス部と前記退避レジスタに格納され
ているレジスタ・アドレスとからいずれか一つを選択し
て前記アドレス・デコーダへ出力するアドレス・セレク
タとを備えた演算処理装置。(1) An address decoder that receives the register address part of the instruction code as an input, one or more arithmetic registers selected by the address decoder, and pipeline processing of instruction execution using the values of the arithmetic registers as inputs. an arithmetic unit, one or more save registers that store the value of the arithmetic register and the register address that are updated for each executed instruction, and one or more of the output of the arithmetic unit and the value of the save register after the instruction is executed. a data selector that selects one and outputs it to the arithmetic register, and a data selector that selects one from the register address part of the instruction code and the register address stored in the save register and outputs it to the arithmetic register; An arithmetic processing unit equipped with an address selector that outputs to.
スタに書き込むためのレジスタ復帰命令実行時に、条件
分岐命令実行後か否かを判断してアドレス・セレクタと
データ・セレクタにおいて前記退避レジスタからの入力
を選択する条件分岐判断手段を備えた請求項(1)記載
の演算処理装置。(2) When executing a register restore instruction to write data stored in a save register to an arithmetic register, it is determined whether a conditional branch instruction has been executed or not, and the address selector and data selector input from the save register. 2. The arithmetic processing device according to claim 1, further comprising conditional branch determination means for selecting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30624589A JPH03164935A (en) | 1989-11-24 | 1989-11-24 | Arithmetic processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30624589A JPH03164935A (en) | 1989-11-24 | 1989-11-24 | Arithmetic processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH03164935A true JPH03164935A (en) | 1991-07-16 |
Family
ID=17954750
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP30624589A Pending JPH03164935A (en) | 1989-11-24 | 1989-11-24 | Arithmetic processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH03164935A (en) |
-
1989
- 1989-11-24 JP JP30624589A patent/JPH03164935A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5596733A (en) | System for exception recovery using a conditional substitution instruction which inserts a replacement result in the destination of the excepting instruction | |
JPH0673105B2 (en) | Instruction pipeline type microprocessor | |
JPH03286332A (en) | Digital data processor | |
US4212060A (en) | Method and apparatus for controlling the sequence of instructions in stored-program computers | |
JPH05150979A (en) | Immediate operand expansion system | |
US5390306A (en) | Pipeline processing system and microprocessor using the system | |
US5819081A (en) | Method of executing a branch instruction of jumping to a subroutine in a pipeline control system | |
JPH03164935A (en) | Arithmetic processor | |
US5812845A (en) | Method for generating an object code for a pipeline computer process to reduce swapping instruction set | |
JPH0222413B2 (en) | ||
JPS6116334A (en) | Data processor | |
JPH0495130A (en) | Arithmetic processing device | |
JP2843844B2 (en) | Parallel processing unit | |
JP2989830B2 (en) | Vector processing method | |
JP3705263B2 (en) | Sequencer | |
JPS5995646A (en) | Arithmetic control system | |
JPS623341A (en) | Conditional control method | |
JPS5875250A (en) | Digital information processor | |
JPH01267731A (en) | System for preparing segment overlay program | |
JPS6149695B2 (en) | ||
JPS59223846A (en) | Arithmetic processor | |
JPH0667879A (en) | Pipeline processing computer | |
JPS63298633A (en) | Instruction fetching control system in pipeline processor | |
JPH0588890A (en) | Data processing method | |
JPH04317130A (en) | Data processor |