JPH05143340A - Method for conrolling register writing - Google Patents

Method for conrolling register writing

Info

Publication number
JPH05143340A
JPH05143340A JP30749891A JP30749891A JPH05143340A JP H05143340 A JPH05143340 A JP H05143340A JP 30749891 A JP30749891 A JP 30749891A JP 30749891 A JP30749891 A JP 30749891A JP H05143340 A JPH05143340 A JP H05143340A
Authority
JP
Japan
Prior art keywords
register
general
instruction
data
writing
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
JP30749891A
Other languages
Japanese (ja)
Inventor
Tetsuya Hagiwara
哲也 萩原
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP30749891A priority Critical patent/JPH05143340A/en
Publication of JPH05143340A publication Critical patent/JPH05143340A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To improve the performance of an EREG instruction without using a working register by controlling the selective restoration of specific contents from an old register saved in a stack area of a main storage. CONSTITUTION:The instruction code and register number of an EREG instruction are stored in an instruction buffer 3. Information for instructing register writing is stored in registers 8, 9. The leading register number stored in the buffer 3 is transmitted to a register number comparator 29 through registers 10 to 13 and the final register number is also transmitted to the comparator 29 through registers 14 to 17. Since register numbers correspording to selected general registers can be identified, a control signal for controlling whether writing operation in a general register corresponding to a certain applied register number is to be permitted or suppressed can be outputted.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、複数のレジスタ内容を
退避および復元する機構を有し、主記憶のスタック領域
に退避してある旧レジスタ内容の中から、特定の旧レジ
スタ内容を選択的に復元する命令を実行する情報処理装
置におけるレジスタ書き込み制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention has a mechanism for saving and restoring a plurality of register contents and selectively selects a specific old register contents from the old register contents saved in a stack area of the main memory. The present invention relates to a register write control method in an information processing device that executes an instruction to restore data.

【0002】複数の旧レジスタ内容を選択的に復元する
命令には、従来から使われていたLM(Load Mu
ltiple)命令と、近年用いられるようになったE
REG(Extract Stacked Regis
ter)命令とがある。LM命令とEREG命令とで
は、主記憶のスタック領域に退避してある復元すべきデ
ータの並び方が異なる。よって、特定の旧レジスタ内容
を選択するためのアドレス指定方法に大きな差があり、
同様のハードウェアで双方の命令を処理することは困難
である。
An instruction for selectively restoring the contents of a plurality of old registers is LM (Load Mu) which has been conventionally used.
(Lipple) command and E which has been used in recent years
REG (Extract Stacked Regis)
ter) command. The LM instruction and the EREG instruction differ in the arrangement of the data saved in the stack area of the main memory and to be restored. Therefore, there is a big difference in the addressing method for selecting a specific old register content,
It is difficult to process both instructions with similar hardware.

【0003】[0003]

【従来の技術】図4は、レジスタ書き込み命令について
示す図である。図4において、情報処理装置は四バイト
長の汎用レジスタを十六個有している。図4(a)は、
LM命令について示しており、命令“LM 14,0,
A”を実行する場合について示している。主記憶34の
スタック領域には、A番地にレジスタ番号“14”の汎
用レジスタ用データが、退避されており、これに続く領
域にレジスタ番号“15の汎用レジスタ用データが、そ
の後ろにレジスタ番号“0”の汎用レジスタ用データが
退避されている。前記命令は、A番地以降の領域に退避
してあるレジスタ番号“14”から“0”までの汎用レ
ジスタ用データを選択的に復元する命令である。この命
令によって、図4(a)の矢印が示すように、汎用レジ
スタ群35の中で選択された汎用レジスタへの書き込み
が行なわれる。
2. Description of the Related Art FIG. 4 is a diagram showing a register write instruction. In FIG. 4, the information processing device has sixteen general-purpose registers each having a length of 4 bytes. Figure 4 (a) shows
The LM instruction is shown and the instruction "LM 14,0,
A case in which A ”is executed is shown. In the stack area of the main memory 34, the general-purpose register data of the register number“ 14 ”is saved at the address A, and the area following the register number“ 15 ”is saved. The general-purpose register data and the general-purpose register data with the register number “0” are saved after that. The instruction is an instruction to selectively restore the general-purpose register data of register numbers "14" to "0" saved in the area after the address A. By this instruction, as shown by the arrow in FIG. 4A, writing to the general-purpose register selected in the general-purpose register group 35 is performed.

【0004】図4(b)は、EREG命令について示し
ており、命令“EREG14,0”を実行する場合につ
いて示している。主記憶36のスタック領域には、汎用
レジスタ群37を構成する各汎用レジスタに対して、退
避データを格納する領域が確保されている。退避データ
は、対応する汎用レジスタのレジスタ番号に関して昇順
に並んでおり、B番地から“B+63”番地の間に納め
られている。前記命令によって、“B+56”番地、
“B+60”番地、並びにB番地に退避してある旧レジ
スタ内容が復元し、命令で選択した汎用レジスタへの書
き込みが行なわれる。
FIG. 4B shows the EREG instruction, and shows the case where the instruction "EREG14,0" is executed. In the stack area of the main memory 36, an area for storing save data is secured for each general-purpose register that constitutes the general-purpose register group 37. The saved data are arranged in ascending order with respect to the register numbers of the corresponding general-purpose registers, and are stored between the addresses B and “B + 63”. According to the above command, the address "B + 56",
The contents of the old register saved in the address "B + 60" and the address B are restored, and writing to the general-purpose register selected by the instruction is performed.

【0005】図5は、LM命令によるレジスタ書き込み
方法について説明するタイミングチャートの図である。
図5において、LM命令を実行する情報処理装置は、パ
イプライン制御による処理を行なっている。パイプライ
ンは、デコードステージで始まり、アドレス生成ステー
ジ、トランスレーションステージ、バッファステージ、
実行ステージ、書き込みステージへと進む。図5では、
それぞれのステージをその頭文字をとってD,A,T,
B,E,Wで示してあるが、以下の説明では、それぞれ
のステージをD段、A段、T段、B段、E段、W段とい
うことにする。
FIG. 5 is a timing chart for explaining the register writing method by the LM instruction.
In FIG. 5, the information processing device that executes the LM instruction performs processing by pipeline control. The pipeline starts with the decode stage, then the address generation stage, the translation stage, the buffer stage,
Proceed to the execution stage and write stage. In FIG.
Taking each stage as its initials, D, A, T,
Although shown by B, E, and W, in the following description, the respective stages are referred to as D stage, A stage, T stage, B stage, E stage, and W stage.

【0006】LM命令では、復元する一連の汎用レジス
タの先頭のレジスタ番号と、最後尾のレジスタ番号と、
退避先のアドレスを示す値とをオペランドで指定する。
この内、先頭のレジスタ番号はレジスタ“R1”に格納
し、最後尾のレジスタ番号はレジスタ“R2”に、退避
先のアドレスを示す値は基底アドレスと変位としてレジ
スタBR(Base Register)およびレジス
タDR(Displacement Registe
r)に格納する。
In the LM instruction, the register number at the beginning and the register number at the end of a series of general-purpose registers to be restored,
Specify the value indicating the save destination address and the operand.
Of these, the first register number is stored in the register "R1", the last register number is stored in the register "R2", and the value indicating the save destination address is the base address and displacement as a register BR (Base Register) and a register DR. (Displacement Register
r).

【0007】旧レジスタ内容を復元するために、汎用レ
ジスタへの書き込みを命令する情報は、各段においてそ
の名称がWR(Write Register)で終わ
るレジスタ、すなわちレジスタAWR,TWR,BW
R,EWR,WWRに順次格納されていく。また、二つ
の汎用レジスタを単位として書き込みを行なうダブルワ
ードの指定情報は、各段において、その名称がDW(D
ouble Words)で終わるレジスタ、すなわち
レジスタADW,TDW,BDW,EDW,WDWに順
次格納されていく。そして、最初の書き込み対象である
汎用レジスタのレジスタ番号は、D段ではレジスタ“R
1”に格納され、A段でカウンタITC(I Tera
tion Counter)に、T段でレジスタ“TW
1”に、B段でレジスタ“BW1”に、E段でレジスタ
“EW1”に、W段でレジスタWA(Write Ad
dress)に順次格納されていく。
In order to restore the contents of the old register, the information instructing the writing to the general-purpose register is the register whose name ends with WR (Write Register) in each stage, that is, the registers AWR, TWR, BW.
It is sequentially stored in R, EWR, and WWR. In addition, the designation information of the double word which is written in units of two general-purpose registers has a name of DW (D
It is sequentially stored in registers ending with open Words), that is, registers ADW, TDW, BDW, EDW, WDW. Then, the register number of the general-purpose register that is the first write target is the register “R
1 ", and the counter ITC (ITera) at the A stage
function counter, the register “TW
1 ", the register" BW1 "in the B stage, the register" EW1 "in the E stage, and the register WA (Write Ad in the W stage.
Sequentially stored in (address).

【0008】カウンタITCは、書き込み対象である汎
用レジスタのレジスタ番号をカウントするためのもので
ある。図5では、ダブルワードの指定があるので値を
“2”ずつ加算する。また、カウンタITCは、レジス
タ番号の最大値を数えるとクリアして再び初めから加算
を始める。例えば、レジスタ番号が“0”から“15”
まであるとすると、“14”の値を持ったカウンタIT
Cに値“2”を加えるとカウンタITCの値は“0”に
なる。
The counter ITC is for counting the register number of the general purpose register to be written. In FIG. 5, since a double word is designated, the value is incremented by "2". Further, the counter ITC is cleared when the maximum value of the register numbers is counted, and the addition is started again from the beginning. For example, register numbers "0" to "15"
If there is a counter IT with a value of "14"
When the value "2" is added to C, the value of the counter ITC becomes "0".

【0009】汎用レジスタに書き込むデータを格納して
いる領域の論理アドレスは、A段において、その基底ア
ドレスがレジスタBRに、変位がレジスタDRに格納さ
れる。これらのレジスタBR,DRの内容に基づいて、
T段において動的アドレス変換が行なわれ、TLB(T
ranslation Lookaside Buff
er)を索引することによってその物理アドレスがレジ
スタ“WAR1”に格納される。レジスタ“WAR1”
が示すデータはフェッチされて、E段においてレジスタ
FDR(Fetch Data Register)に
格納される。
Regarding the logical address of the area storing the data to be written in the general-purpose register, the base address is stored in the register BR and the displacement is stored in the register DR in the A stage. Based on the contents of these registers BR and DR,
Dynamic address translation is performed in the T stage, and TLB (T
translation Lookaside Buff
er), its physical address is stored in the register "WAR1". Register "WAR1"
Is fetched and stored in the register FDR (Fetch Data Register) at the E stage.

【0010】レジスタFDRの内容は、W段においてレ
ジスタRDR(Result Data Regist
er)に格納される。そして、レジスタWWR,WDW
の内容に従って、レジスタWAが示す汎用レジスタGR
に対してレジスタRDRの内容を書き込む。ここでは、
ダブルワードを指定しているので、連続する二つの汎用
レジスタへの書き込みが行なわれる。A段のEND
OOPは、終了判定を示しており、ここで、レジスタ
“R2”の内容と、カウンタITCの内容とを比較して
いる。
The contents of the register FDR are stored in the register RDR (Result Data Register) in the W stage.
er). Then, the registers WWR and WDW
General register GR indicated by register WA in accordance with the contents of
The contents of the register RDR are written to. here,
Since a double word is specified, writing to two consecutive general-purpose registers is performed. END of A stage L
OOP indicates the end determination, in which the content of the register "R2" is compared with the content of the counter ITC.

【0011】次の書き込み動作では、最初の書き込み動
作で用いたカウンタITCの内容およびレジスタ“WA
R1”の内容をそのまま用いている。図5における情報
処理装置では、一つの汎用レジスタが四バイトで構成さ
れているものとしているので、物理アドレスを格納する
レジスタ“WAR1”の値は“8”ずつ加算する。ダブ
ルワードの指定がなければ“4”ずつ加算する。結局、
前回と同様に、W段において、レジスタRDRの内容が
レジスタWAが示す汎用レジスタGRに対して書き込ま
れる。また、前回と同様に終了判定を行ない、書き込み
動作を続行することとなった場合には同様の処理を繰り
返していく。
In the next write operation, the contents of the counter ITC used in the first write operation and the register "WA" are used.
The content of R1 "is used as it is. In the information processing apparatus in FIG. 5, since one general-purpose register is composed of 4 bytes, the value of the register" WAR1 "for storing the physical address is" 8 ". If you do not specify a double word, add "4" each.
Similar to the previous time, in the W stage, the content of the register RDR is written to the general register GR indicated by the register WA. Further, similarly to the previous time, the end determination is performed, and when the write operation is to be continued, the same processing is repeated.

【0012】一方のEREG命令では、LM命令のよう
に、単純に物理アドレスの値を加算していくことができ
ない。図5に示したレジスタ“WAR1”の値は単純に
“8”ずつ加算した。しかし、EREG命令では、レジ
スタ番号が最大値の汎用レジスタへの書き込みに続い
て、レジスタ番号“0”の汎用レジスタへの書き込みを
行なう場合に特別な考慮が必要である。これは、主記憶
のスタック領域に退避してあるレジスタ番号“0”の汎
用レジスタ用データは、レジスタ番号が最大値の汎用レ
ジスタ用データに続く番地にあるのではないためであ
る。そのため、LM命令と同様に物理アドレスの演算処
理をしようとすると特殊な回路を追加する必要がある。
On the other hand, unlike the LM instruction, the EREG instruction cannot simply add the physical address values. The value of the register "WAR1" shown in FIG. 5 is simply added by "8". However, the EREG instruction requires special consideration when writing to the general-purpose register having the maximum register number and then writing to the general-purpose register having the register number “0”. This is because the general-purpose register data with the register number “0” saved in the stack area of the main memory is not located at the address following the general-purpose register data with the maximum register number. For this reason, it is necessary to add a special circuit to the arithmetic processing of the physical address as in the case of the LM instruction.

【0013】図6は、従来におけるEREG命令による
レジスタ書き込み方法を示す図である。図6に示す方法
を用いることにより、新たにハードウェアを追加するこ
となくEREG命令を処理することができる。図6にお
いて、EREG命令を処理する場合には、主記憶38か
ら各汎用レジスタに対応する退避データを全て、ERE
G命令のオペランドで選択したか、しないかにかかわら
ず、一旦作業用レジスタ群39に転送する。この後に、
汎用レジスタ群40の内、EREG命令のオペランドで
選択した汎用レジスタへの書き込みを行なう。このとき
主記憶の物理アドレスを指定する必要はなく、作業用レ
ジスタのレジスタ番号を指定することができる。
FIG. 6 is a diagram showing a conventional register write method by an EREG instruction. By using the method shown in FIG. 6, it is possible to process the EREG instruction without adding new hardware. In FIG. 6, when the EREG instruction is processed, all the saved data corresponding to each general-purpose register is deleted from the main memory 38 by ERE.
Regardless of whether it is selected by the operand of the G instruction or not, it is temporarily transferred to the work register group 39. After this,
Write to the general-purpose register selected by the operand of the EREG instruction in the general-purpose register group 40. At this time, it is not necessary to specify the physical address of the main memory, and the register number of the work register can be specified.

【0014】図7は、図6に示す方法について説明する
タイミングチャートの図である。図7において、書き込
み対象である作業用レジスタのレジスタ番号をカウンタ
ITCに格納する。作業用レジスタへの書き込みデータ
は、スタック領域内の固定番地にあり、その先頭の物理
アドレスをレジスタ“WAR1”に格納する。A段にお
いて、カウンタITCに初期値“0”を、レジスタ“W
AR1”に初期値Bを設定する。値Bは、図6に示した
ように、レジスタ番号“0”の汎用レジスタ用データが
退避されている領域の物理アドレスを示すものである。
FIG. 7 is a timing chart for explaining the method shown in FIG. In FIG. 7, the register number of the work register to be written is stored in the counter ITC. The write data to the work register is at a fixed address in the stack area, and the top physical address is stored in the register "WAR1". In the A stage, the counter ITC is set to the initial value “0” and the register “W” is set.
The initial value B is set in AR1 ". The value B indicates the physical address of the area in which the general-purpose register data of the register number" 0 "is saved, as shown in FIG.

【0015】図7では、ダブルワードを指定して二つの
作業用レジスタを単位として書き込みを行っている。主
記憶にある退避データを十六個の作業用レジスタに対し
て書き込みをするので、カウンタITCの値を“0”か
ら“14”まで“2”ずつ加算してやればよい。作業用
レジスタへの書き込みを行なう繰り返し処理の終了判定
END LOOPにて、カウンタITCの値“14”を
検出すると、主記憶から作業用レジスタへのデータ転送
処理は終了し、作業用レジスタから汎用レジスタへのデ
ータ転送処理に移る。なお、図7では、カウンタITC
の値が“4”から“12”までの五回分の書き込み動作
のところを省略してある。
In FIG. 7, a double word is designated and writing is performed in units of two working registers. Since the save data in the main memory is written to the 16 work registers, the value of the counter ITC may be incremented by "2" from "0" to "14". End determination END of repetitive processing of writing to work register When the value "14" of the counter ITC is detected in LOOP, the data transfer process from the main memory to the work register ends, and the data transfer process from the work register to the general-purpose register starts. In FIG. 7, the counter ITC
The five write operations with the value of 4 from "4" to "12" are omitted.

【0016】作業用レジスタから汎用レジスタへのデー
タ転送は、ダブルワードを指定することなく一つのレジ
スタを単位として、同一レジスタ番号を有する作業用レ
ジスタ、汎用レジスタ間で行なっている。カウンタIT
Cには、まずデータ転送を行なう先頭のレジスタ番号を
格納する。その後、カウンタITCの値は一つの汎用レ
ジスタへの書き込みを行なう毎に一ずつ加算される。カ
ウンタITCの値は、レジスタ番号の最大値“15”を
数えるとクリアして“0”になるので特別な考慮は必要
ない。カウンタITCが示すレジスタ番号の作業用レジ
スタの内容が同一レジスタ番号の汎用レジスタGRに書
き込まれていき、カウンタITCの値が、レジスタ“R
2”の値と等しくなったところで処理を終える。
Data transfer from the work register to the general-purpose register is performed between the work register and the general-purpose register having the same register number in units of one register without designating a double word. Counter IT
First of all, the leading register number for data transfer is stored in C. After that, the value of the counter ITC is incremented by one each time writing to one general-purpose register is performed. The value of the counter ITC is cleared to "0" when the maximum register number "15" is counted, so that no special consideration is required. The contents of the work register having the register number indicated by the counter ITC are written into the general-purpose register GR having the same register number, and the value of the counter ITC is changed to the register “R”.
The processing is terminated when the value becomes equal to the value of 2 ".

【0017】[0017]

【発明が解決しようとする課題】以上説明したように、
従来におけるEREG命令によるレジスタ書き込み方法
では、汎用レジスタの全退避データを一旦作業用レジス
タにロードする必要がある。この方法は、新たにハード
ウェアを追加する必要がないという利点があるが、ER
EG命令の実行時における処理性能を著しく悪化させる
という欠点がある。またこの従来の方法では、EREG
命令実行時に、作業用レジスタの内容を破壊する。その
ため、一時的なデータを作業用レジスタに持たせておけ
ないという欠点がある。
As described above,
In the conventional register writing method using the EREG instruction, it is necessary to temporarily load all the save data of the general-purpose register into the work register. This method has the advantage that no additional hardware is required, but the ER
There is a drawback that the processing performance during execution of the EG instruction is significantly deteriorated. Also, in this conventional method, EREG
When the instruction is executed, the contents of the working register are destroyed. Therefore, there is a drawback that temporary data cannot be held in the work register.

【0018】本発明は、このような従来の問題点に鑑
み、作業用レジスタを使用せずに比較的簡単なハードウ
ェアを追加することにより、EREG命令の性能を改善
する手段を提供することを目的とする。
In view of such conventional problems, the present invention provides a means for improving the performance of the EREG instruction by adding relatively simple hardware without using a work register. To aim.

【0019】[0019]

【課題を解決するための手段】本発明によれば、上述の
目的は、前記特許請求の範囲に記載した手段により達成
される。
According to the invention, the above mentioned objects are achieved by the means recited in the patent claims.

【0020】すなわち、本発明は、オペランドでレジス
タ番号を示して一連の汎用レジスタを選択すると、主記
憶のスタック領域に退避してあるデータを選択的に復元
し、汎用レジスタへの書き込みを行なう命令を具備する
情報処理装置において、オペランドで選択した汎用レジ
スタか、選択しなかった汎用レジスタかを識別するため
の第一の回路と、スタック領域に退避してある各汎用レ
ジスタに対応するデータを全て読み出すための第二の回
路とを設け、前記命令で選択した汎用レジスタへの書き
込みを行なうとときに、前記第二の回路の制御に従って
主記憶から各データの読み出しを行ない、前記第一の回
路の制御に従って読み出したデータが前記命令で選択し
なかった汎用レジスタへのものであればこのデータの書
き込みを抑止し、読み出したデータが前記命令で選択し
た汎用レジスタへのものであればこのデータの書き込み
を行なうレジスタ書き込み制御方法である。
That is, according to the present invention, when a series of general-purpose registers are selected by indicating a register number with an operand, an instruction for selectively restoring the data saved in the stack area of the main memory and writing to the general-purpose registers. In an information processing device equipped with, a first circuit for identifying whether a general-purpose register selected by an operand or a general-purpose register not selected, and all data corresponding to each general-purpose register saved in the stack area A second circuit for reading is provided, and when writing to the general-purpose register selected by the instruction, each data is read from the main memory under the control of the second circuit. If the data read out according to the control of is for a general-purpose register not selected by the instruction, the writing of this data is suppressed, As long as to the general register look out data is selected by the instruction is a register write control method for writing of data.

【0021】[0021]

【作用】図1は、本発明の原理説明図である。図1にお
いて、情報処理装置は、四バイト長の汎用レジスタを十
六個有している。主記憶1のB番地から“B+63”番
地までの六十四バイト分の領域には、汎用レジスタ群2
を構成する各汎用レジスタ用の退避データが、レジスタ
番号に関して昇順に格納されている。従来は、この退避
データを全て作業用レジスタへ転送していたが、本発明
においては、各退避データがEREG命令のオペランド
で選択したものかを識別する手段を設けるので不必要な
データ転送を行なわない。
FIG. 1 is a diagram for explaining the principle of the present invention. In FIG. 1, the information processing device has 16 general-purpose registers each having a length of 4 bytes. In the area of 64 bytes from address B to address "B + 63" of main memory 1, general-purpose register group 2
Saved data for each of the general-purpose registers constituting the above are stored in ascending order of register numbers. In the past, all the saved data was transferred to the work register, but in the present invention, a means for identifying whether each saved data is selected by the operand of the EREG instruction is provided, so unnecessary data transfer is performed. Absent.

【0022】図1では、オペランドでいずれのレジスタ
番号を先頭とする汎用レジスタの選択があっても、まず
レジスタ番号が“0”である汎用レジスタへの書き込み
動作を行なう。次に、レジスタ番号が“1”である汎用
レジスタへの書き込み動作を行ない、続いてレジスタ番
号が“2”である汎用レジスタへの書き込み動作を行な
う。同様に、レジスタ番号を加算しながらレジスタ番号
が“15”である汎用レジスタへの書き込み動作まで行
なう。このようにすれば、一回の書き込み動作を行なう
ごとに、物理アドレスを単純に“4”ずつカウントアッ
プしながら退避データを読み出すことができる。
In FIG. 1, no matter which register number the leading general-purpose register is selected by the operand, the writing operation to the general-purpose register having the register number "0" is first performed. Next, the write operation to the general-purpose register having the register number "1" is performed, and then the write operation to the general-purpose register having the register number "2" is performed. Similarly, the operation of writing to the general-purpose register having the register number "15" is performed while adding the register numbers. By doing so, the saved data can be read while simply incrementing the physical address by "4" each time one write operation is performed.

【0023】EREG命令のオペランドで選択した汎用
レジスタのみに、実際の書き込みを行なうには、選択し
た汎用レジスタか否かを識別する手段からの指示に基づ
いて書き込みを制御すればよい。この識別する手段は、
オペランドで選択されなかった汎用レジスタへの書き込
み動作があると、この書き込みを抑止するための制御信
号を出力する。また、オペランドで選択された汎用レジ
スタへの書き込み動作があると、この書き込みを許可す
る制御信号を出力する。
In order to actually write only to the general-purpose register selected by the operand of the EREG instruction, the write may be controlled based on the instruction from the means for identifying whether or not the selected general-purpose register. This means of identification is
When there is a write operation to the general-purpose register that is not selected by the operand, a control signal for suppressing this write is output. Also, when there is a write operation to the general-purpose register selected by the operand, a control signal that permits this write is output.

【0024】[0024]

【実施例】図2は、本発明の実施例を示す図である。E
REG命令の命令コード、先頭のレジスタ番号、最後尾
のレジスタ番号は、命令バッファ3に蓄積される。この
内、命令コードは、デコードされてCS(Contro
l Storage)に記憶される。ここから、レジス
タ書き込みを命令する情報が、レジスタ4〜7を通し
て、最終的にレジスタ番号比較回路29の制御信号を受
けてレジスタ8またはレジスタ9に格納される。
FIG. 2 is a diagram showing an embodiment of the present invention. E
The instruction code of the REG instruction, the first register number, and the last register number are accumulated in the instruction buffer 3. Of these, the instruction code is decoded and CS (Contro
L Storage). From here, the information instructing the register writing is finally stored in the register 8 or the register 9 through the registers 4 to 7 upon receiving the control signal of the register number comparison circuit 29.

【0025】AND回路27は、偶数のレジスタ番号を
有する汎用レジスタへの書き込みを許可する制御信号を
レジスタ番号比較回路29から受けた場合に、レジスタ
書き込みを命令する情報をレジスタ9へ伝える。AND
回路8は、奇数のレジスタ番号を有する汎用レジスタへ
の書き込みを許可する制御信号をレジスタ番号比較回路
29から受けた場合に、レジスタ書き込みを命令する情
報をレジスタ8へ伝える。
When the AND circuit 27 receives from the register number comparison circuit 29 a control signal for permitting writing to a general-purpose register having an even register number, the AND circuit 27 transmits information for instructing register writing to the register 9. AND
When the circuit 8 receives from the register number comparison circuit 29 a control signal that permits writing to a general-purpose register having an odd number of registers, the circuit 8 transmits information for instructing register writing to the register 8.

【0026】命令バッファ3に蓄積された先頭のレジス
タ番号は、レジスタ10〜13を通してレジスタ番号比
較回路29に伝わる。また、最後尾のレジスタ番号は、
レジスタ14〜17を通してレジスタ番号比較回路29
に伝わる。よってレジスタ番号比較回路29は、選択さ
れた汎用レジスタが何番のレジスタ番号から何番のレジ
スタ番号までかを識別することができるので、あるレジ
スタ番号を与えられたときに、そのレジスタ番号の汎用
レジスタへの書き込み動作を許可するか、あるいは抑止
するかの制御信号を出力することができる。
The leading register number accumulated in the instruction buffer 3 is transmitted to the register number comparison circuit 29 through the registers 10 to 13. Also, the last register number is
Register number comparison circuit 29 through registers 14 to 17
Be transmitted to. Therefore, the register number comparison circuit 29 can identify the register number from the register number to the register number of the selected general-purpose register. Therefore, when a register number is given, the general-purpose register of the register number is registered. A control signal for permitting or inhibiting the write operation to the register can be output.

【0027】CSに記憶されたダブルワードの指定情報
は、レジスタ18、ループ制御回路30、レジスタ19
〜21を通してレジスタ番号比較回路29に伝わる。レ
ジスタ番号比較回路29は、ダブルワードの指定を検出
すると、AND回路27およびAND回路28の双方に
対して制御信号を出力する。また、ダブルワードの指定
がないときには、AND回路27またはAND回路28
のいずれか一方に対して制御信号を出力して、他の一方
への信号はオフとなる。
The double word designation information stored in the CS is stored in the register 18, the loop control circuit 30, and the register 19.
Through 21 to the register number comparison circuit 29. When detecting the designation of the double word, the register number comparison circuit 29 outputs a control signal to both the AND circuit 27 and the AND circuit 28. If no double word is specified, the AND circuit 27 or the AND circuit 28 is used.
The control signal is output to either one of the above, and the signal to the other one is turned off.

【0028】カウンタ22には、書き込み対象の汎用レ
ジスタのレジスタ番号が格納されている。カウンタ22
の初期値は“0”であり、この値は汎用レジスタへの書
き込み動作があるごとに“1”または“2”ずつ加算さ
れる。セレクタ32は、CSからの制御信号を受けて、
“0”または加算器31の出力値を出力する。CSは、
セレクタ32に対して、最初の汎用レジスタへの書き込
み動作では“0”を選択するように指示し、その後の書
き込み動作では、加算器31の出力値を選択するように
指示する。
The counter 22 stores the register number of the general-purpose register to be written. Counter 22
Has an initial value of "0", and this value is incremented by "1" or "2" each time there is a write operation to the general-purpose register. The selector 32 receives the control signal from CS,
It outputs “0” or the output value of the adder 31. CS is
The selector 32 is instructed to select "0" in the first write operation to the general-purpose register, and is instructed to select the output value of the adder 31 in the subsequent write operation.

【0029】加算器31は、カウンタ22の値に、
“1”または“2”を加えた値を出力する。“1”を加
えるか“2”を加えるかは、ループ制御回路30からの
制御信号に従う。ループ制御回路30は、ダブルワード
の指定を検出すると、加算器31に対して“2”を加え
るように指示する。ダブルワードの指定がないと“1”
を加えるように指示する。また、ループ制御回路30
は、カウンタ22値を参照して、EREG命令の終了判
定も行なっている。
The adder 31 adds the value of the counter 22 to
The value to which "1" or "2" is added is output. Whether to add “1” or “2” depends on the control signal from the loop control circuit 30. When detecting the designation of the double word, the loop control circuit 30 instructs the adder 31 to add "2". "1" if no double word is specified
Instruct to add. In addition, the loop control circuit 30
Also determines the end of the EREG instruction by referring to the counter 22 value.

【0030】カウンタ22が有する書き込み対象の汎用
レジスタのレジスタ番号は、レジスタ23〜25を通し
てレジスタ番号比較回路29およびレジスタ26に伝わ
る。レジスタ番号比較回路29は、レジスタ25から受
けるレジスタ番号がレジスタ13およびレジスタ17か
ら受けるレジスタ番号の範囲内にあるか否かを比較す
る。そして、この比較結果に基づいて、汎用レジスタへ
の書き込み動作を許可するか抑止するかの制御信号を出
力する。レジスタ26の内容は、レジスタファイル33
に伝わるので、このレジスタファイル33内にある書き
込み対象の汎用レジスタが定まる。レジスタファイル3
3は通称レジスタックともいわれているものであり、こ
の中に汎用レジスタや作業用レジスタなどが納められて
いる。
The register number of the general register to be written which the counter 22 has is transmitted to the register number comparison circuit 29 and the register 26 through the registers 23 to 25. The register number comparison circuit 29 compares whether the register number received from the register 25 is within the range of the register numbers received from the register 13 and the register 17. Then, based on the comparison result, a control signal for permitting or suppressing the write operation to the general-purpose register is output. The contents of the register 26 are stored in the register file 33.
Therefore, the general-purpose register to be written in this register file 33 is determined. Register file 3
Reference numeral 3 is also commonly called a register, in which general-purpose registers and work registers are contained.

【0031】図3は、本発明によるレジスタ書き込み方
法について説明するタイミングチャートの図である。図
3において、書き込み対象である汎用レジスタのレジス
タ番号は、カウンタITCに格納されている。A段にお
いて、カウンタITCに初期値“0”が設定されてお
り、その後、カウンタITCの値は、“2”ずつ加算さ
れている。終了判定END LOOPでは、このカウン
タITCの値が“14”になったかをみている。ここで
は、当然ダブルワードの指定がされている。
FIG. 3 is a timing chart for explaining the register writing method according to the present invention. In FIG. 3, the register number of the general-purpose register to be written is stored in the counter ITC. In the A stage, the initial value “0” is set in the counter ITC, and then the value of the counter ITC is incremented by “2”. End judgment END In LOOP, it is checked whether the value of this counter ITC has become "14". Of course, double word is specified here.

【0032】汎用レジスタへの書き込みデータである退
避データの主記憶上の物理アドレスはレジスタ“WAR
1”に格納されている。レジスタ“WAR1”の値は、
汎用レジスタへの書き込み動作があるごとに、単純に
“8”ずつ加算している。このレジスタ“WAR1”が
示す退避データは、W段においてレジスタRDRに格納
される。
The physical address on the main memory of the save data which is the write data to the general-purpose register is the register "WAR".
1 ”. The value of the register“ WAR1 ”is
Every time there is a write operation to the general-purpose register, "8" is simply added. The save data indicated by the register "WAR1" is stored in the register RDR in the W stage.

【0033】レジスタRDRに格納されているデータ
は、レジスタWAが示す汎用レジスタGRに書き込まれ
るが、この書き込みは、レジスタWWRおよびレジスタ
WDWの内容に従って許可あるいは抑止される。書き込
み対象である汎用レジスタのレジスタ番号を“EW1”
と、オペランドで選択した汎用レジスタの先頭のレジス
タ番号を“R1”と、最後尾のレジスタ番号を“R2”
とすると、レジスタ書き込みの許可または抑止の条件は
次のようになる。
The data stored in the register RDR is written in the general-purpose register GR indicated by the register WA, and this writing is permitted or inhibited according to the contents of the register WWR and the register WDW. Set the register number of the general-purpose register to be written to "EW1"
, The first register number of the general-purpose register selected by the operand is "R1", and the last register number is "R2".
Then, the conditions for permitting or suppressing register writing are as follows.

【0034】すなわち、レジスタWAが偶数のレジスタ
番号を示しているときにレジスタ書き込みを許可する条
件は、条件「R1≦EW1≦R2」または、条件「EW
1≦R2<R1」または、条件「R2<R1≦EW1」
のいずれかが成立したときである。一方、レジスタWA
が奇数のレジスタ番号を示しているときに、レジスタ書
き込みを許可する条件は、条件「R1≦EW1+1≦R
2」または、条件「EW1+1≦R2<R1」または、
条件「R2<R1≦EW1+1」のいずれかが成立した
ときである。条件が成立しないときには、レジスタ書き
込みは抑止される。
That is, when the register WA indicates an even register number, the condition for permitting register writing is the condition "R1≤EW1≤R2" or the condition "EW
1 ≦ R2 <R1 ”or condition“ R2 <R1 ≦ EW1 ”
When either of the above is established. On the other hand, register WA
Is an odd register number, the condition for permitting register writing is the condition “R1 ≦ EW1 + 1 ≦ R”.
2 ”or the condition“ EW1 + 1 ≦ R2 <R1 ”or
This is when any of the conditions “R2 <R1 ≦ EW1 + 1” is satisfied. When the condition is not satisfied, register writing is suppressed.

【0035】[0035]

【発明の効果】以上説明したように、本発明によれば、
作業用レジスタを使用せずに、比較的簡単なハードウェ
アを追加することにより、EREG命令の性能を大幅に
改善することができるという利点がある。
As described above, according to the present invention,
There is an advantage that the performance of the EREG instruction can be significantly improved by adding relatively simple hardware without using the work register.

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

【図1】本発明の原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】本発明の実施例を示す図である。FIG. 2 is a diagram showing an example of the present invention.

【図3】本発明によるレジスタ書き込み方法について説
明するタイミングチャートの図である。
FIG. 3 is a timing chart illustrating a register writing method according to the present invention.

【図4】レジスタ書き込み命令について示す図である。FIG. 4 is a diagram showing a register write instruction.

【図5】LM命令によるレジスタ書き込み方法について
説明するタイミングチャートの図である。
FIG. 5 is a timing chart illustrating a register writing method using an LM instruction.

【図6】従来におけるEREG命令によるレジスタ書き
込み方法を示す図である。
FIG. 6 is a diagram showing a conventional register write method using an EREG instruction.

【図7】図6に示す方法について説明するタイミングチ
ャートの図である。
FIG. 7 is a timing chart illustrating the method shown in FIG.

【符号の説明】[Explanation of symbols]

1、34、36、38 主記憶 2、35、37、40 汎用レジスタ群 3 命令バッファ 4〜21、23〜26 レジスタ 22 カウンタ 27、28 AND回路 29 レジスタ番号比較回路 30 ループ制御回路 31 加算器 32 セレクタ 33 レジスタファイル 39 作業用レジスタ群 1, 34, 36, 38 Main memory 2, 35, 37, 40 General-purpose register group 3 Instruction buffer 4-21, 23-26 register 22 Counter 27, 28 AND circuit 29 Register number comparison circuit 30 Loop control circuit 31 Adder 32 Selector 33 Register file 39 Working register group

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 オペランドでレジスタ番号を示して一連
の汎用レジスタを選択すると、主記憶のスタック領域に
退避してあるデータを選択的に復元し、汎用レジスタへ
の書き込みを行なう命令を具備する情報処理装置におい
て、 オペランドで選択した汎用レジスタか、選択しなかった
汎用レジスタかを識別するための第一の回路と、スタッ
ク領域に退避してある各汎用レジスタに対応するデータ
を全て読み出すための第二の回路とを設け、 前記命令で選択した汎用レジスタへの書き込みを行なう
ときに、前記第二の回路の制御に従って主記憶から各デ
ータの読み出しを行ない、前記第一の回路の制御に従っ
て読み出したデータが前記命令で選択しなかった汎用レ
ジスタへのものであればこのデータの書き込みを抑止
し、読み出したデータが前記命令で選択した汎用レジス
タへのものであればこのデータの書き込みを行なうこと
を特徴とするレジスタ書き込み制御方法。
1. Information comprising an instruction for selectively restoring data saved in a stack area of a main memory when a series of general-purpose registers is selected by indicating a register number by an operand and writing to the general-purpose register. In the processing unit, the first circuit for identifying the general-purpose register selected by the operand or the general-purpose register not selected, and the first circuit for reading all the data corresponding to each general-purpose register saved in the stack area Two circuits are provided, and when writing to the general-purpose register selected by the instruction, each data is read from the main memory under the control of the second circuit and read under the control of the first circuit. If the data is in a general-purpose register that was not selected by the above instruction, writing of this data is suppressed and the read data is As long as to the general register selected by the instruction register write control method characterized by writing the data.
JP30749891A 1991-11-22 1991-11-22 Method for conrolling register writing Pending JPH05143340A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30749891A JPH05143340A (en) 1991-11-22 1991-11-22 Method for conrolling register writing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30749891A JPH05143340A (en) 1991-11-22 1991-11-22 Method for conrolling register writing

Publications (1)

Publication Number Publication Date
JPH05143340A true JPH05143340A (en) 1993-06-11

Family

ID=17969811

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30749891A Pending JPH05143340A (en) 1991-11-22 1991-11-22 Method for conrolling register writing

Country Status (1)

Country Link
JP (1) JPH05143340A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59184943A (en) * 1983-04-05 1984-10-20 Nec Corp Information processor
JPS61150036A (en) * 1984-12-25 1986-07-08 Nec Corp Central processing unit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59184943A (en) * 1983-04-05 1984-10-20 Nec Corp Information processor
JPS61150036A (en) * 1984-12-25 1986-07-08 Nec Corp Central processing unit

Similar Documents

Publication Publication Date Title
US5881302A (en) Vector processing unit with reconfigurable data buffer
US4882701A (en) Lookahead program loop controller with register and memory for storing number of loop times for branch on count instructions
EP0155211A2 (en) System for by-pass control in pipeline operation of computer
US6009509A (en) Method and system for the temporary designation and utilization of a plurality of physical registers as a stack
US6003126A (en) Special instruction register including allocation field utilized for temporary designation of physical registers as general registers
JPH0682320B2 (en) Data processing device
EP0220990B1 (en) Buffer storage control system
US5678016A (en) Processor and method for managing execution of an instruction which determine subsequent to dispatch if an instruction is subject to serialization
US5715420A (en) Method and system for efficient memory management in a data processing system utilizing a dual mode translation lookaside buffer
EP0240606B1 (en) Pipe-line processing system and microprocessor using the system
US5732005A (en) Single-precision, floating-point register array for floating-point units performing double-precision operations by emulation
JPH05143340A (en) Method for conrolling register writing
US5276853A (en) Cache system
US4737908A (en) Buffer memory control system
US7779236B1 (en) Symbolic store-load bypass
KR960015231A (en) Enhanced Addressing Method and System
US5933856A (en) System and method for processing of memory data and communication system comprising such system
AU691593B2 (en) Vector processing unit with reconfigurable data buffer
KR950000088B1 (en) Data processing system
US6671781B1 (en) Data cache store buffer
JPS6240736B2 (en)
JPH03255530A (en) Parallel instruction fetching mechanism
JPH0814792B2 (en) Data processing device
JPS6242237A (en) Loading system to instruction buffer
JPH0740226B2 (en) Branch instruction control method

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19970819