JP2987281B2 - Processor - Google Patents

Processor

Info

Publication number
JP2987281B2
JP2987281B2 JP5285253A JP28525393A JP2987281B2 JP 2987281 B2 JP2987281 B2 JP 2987281B2 JP 5285253 A JP5285253 A JP 5285253A JP 28525393 A JP28525393 A JP 28525393A JP 2987281 B2 JP2987281 B2 JP 2987281B2
Authority
JP
Japan
Prior art keywords
instruction
register
code
instruction code
registers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP5285253A
Other languages
Japanese (ja)
Other versions
JPH07141173A (en
Inventor
正人 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP5285253A priority Critical patent/JP2987281B2/en
Publication of JPH07141173A publication Critical patent/JPH07141173A/en
Application granted granted Critical
Publication of JP2987281B2 publication Critical patent/JP2987281B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は情報処理装置のCPUとし
て用いられるプロセッサにおけるレジスタの読出し書込
み機構およびパイプライン構造をとるプロセッサにおけ
るレジスタ干渉検出機構に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a register read / write mechanism in a processor used as a CPU of an information processing apparatus and a register interference detection mechanism in a processor having a pipeline structure.

【0002】[0002]

【従来の技術】近年、電子技術の発展により、マイクロ
プロセッサ等の情報処理装置が普及し、あらゆる分野で
用いられている。従来のプロセッサとしては、例えば、
特開平5-46383号(発明の名称:「データ処理装置と命
令コード割り当て方式」)および特開5-173778号(発明
の名称:「データ処理装置」)に示されているものがあ
る。
2. Description of the Related Art In recent years, with the development of electronic technology, information processing devices such as microprocessors have become widespread and used in all fields. As a conventional processor, for example,
Some are disclosed in JP-A-5-46383 (title of the invention: "data processing device and instruction code allocation system") and in JP-A-5-73778 (title of the invention: "data processing device").

【0003】図5はこの従来のプロセッサの全体の構成
図を示す。同図において、50はプロセッサ、51はプ
ロセッサ50と外界との間でデータのやり取りを行う入
出力バス、52は入出力バス51の制御を行うバスイン
タフェース回路、53はバスインタフェース回路52を
介して命令を読み出す命令読出し回路、54は命令読出
し回路53から受け取った命令を解読するとともにメモ
リオペランドのアクセスを伴う場合はそのオペランドア
ドレスの計算を行う解読・アドレス計算回路、55は解
読・アドレス計算回路54の指示によりメモリオペラン
ドのアクセスを含む演算の実行を行うとともに、メモリ
オペランドのアクセスを伴う場合はバスインタフェース
回路52を介して行う。演算実行回路55は内部に算術
論理演算を行う演算器とレジスタR0〜R3を持ち、R
3はスタックポインタとして割り当てられている。また
解読・アドレス計算回路54もこれらのレジスタR0〜
R3を用いてオペランドアドレスの計算を行う。命令読
出し回路53はプログラムカウンタPCを持つ。このプ
ロセッサは3つのステージからなるパイプラン構造をと
り、命令読出し回路53、解読・アドレス計算回路5
4、演算実行回路55での処理がそれぞれのステージに
相当する。
FIG. 5 shows an overall configuration diagram of this conventional processor. In the figure, 50 is a processor, 51 is an input / output bus for exchanging data between the processor 50 and the outside world, 52 is a bus interface circuit for controlling the input / output bus 51, and 53 is a bus interface circuit 52 An instruction reading circuit for reading an instruction, a decoding / address calculation circuit for decoding an instruction received from the instruction reading circuit 53 and calculating an operand address when a memory operand is accessed, and a decoding / address calculation circuit 54 The operation including the access of the memory operand is executed in accordance with the instruction, and when the access of the memory operand is involved, the operation is performed via the bus interface circuit 52. The arithmetic execution circuit 55 has an arithmetic unit for performing arithmetic and logical operations and registers R0 to R3.
3 is allocated as a stack pointer. The decryption / address calculation circuit 54 also uses these registers R0 to R0.
The operand address is calculated using R3. The instruction reading circuit 53 has a program counter PC. This processor has a pipeline structure consisting of three stages, an instruction read circuit 53, a decoding / address calculation circuit 5
4. The processing in the arithmetic execution circuit 55 corresponds to each stage.

【0004】以上のように構成された従来のプロセッサ
の動作を図6を用いて説明する。同図は、命令読出し、
解読・アドレス計算、演算実行の各ステージの処理内容
をサイクル毎に示した説明図である。同図(a)は、以
下に示す命令1に続いて命令2が処理される場合であ
る。 命令1:レジスタR0に1を加え、結果をレジスタR0
に格納する。
The operation of the conventional processor configured as described above will be described with reference to FIG. The figure shows instruction reading,
FIG. 9 is an explanatory diagram showing the processing contents of each stage of decoding / address calculation and operation execution for each cycle. FIG. 9A shows a case where an instruction 2 is processed following an instruction 1 described below. Instruction 1: Add 1 to register R0 and store result in register R0
To be stored.

【0005】命令2:レジスタR0に2を加えた結果を
アドレスとしてメモリを読出し、その内容をレジスタR
1に格納する。 ここで注目すべきは、命令1の演算と命令2のアドレス
計算が同時に実行されようとすることである。即ち、サ
イクルt3で、演算実行回路55と解読・アドレス計算
回路54とにおいてそれぞれ命令1の加算実行と命令2
のアドレス計算とが行われようとするが、ともに共通の
レジスタR0を読出す必要があるため、前者が終了した
後でなければ正しく後者を行うことはできない。そこで
同図の×印のように、サイクルt3での命令2の解読・
アドレス計算およびサイクルt4での命令2の演算実行
をキャンセルし、それぞれ次のサイクルで処理される。
このような現象をレジスタオペランド干渉あるいは単に
レジスタ干渉といい、干渉による誤動作を回避するため
にパイプラインの流れを一時的に止める措置をパイプラ
インインタロックという。
Instruction 2: A memory is read with the result obtained by adding 2 to the register R0 as an address, and the contents thereof are stored in the register R0.
1 is stored. It should be noted here that the operation of the instruction 1 and the address calculation of the instruction 2 are to be executed simultaneously. That is, in the cycle t3, the arithmetic execution circuit 55 and the decryption / address calculation circuit 54 execute the addition of the instruction 1 and the instruction 2
However, since it is necessary to read the common register R0, the latter cannot be correctly performed unless the former is completed. Therefore, as indicated by the mark x in FIG.
The address calculation and the execution of the operation of the instruction 2 in the cycle t4 are cancelled, and each is processed in the next cycle.
Such a phenomenon is called register operand interference or simply register interference, and a measure for temporarily stopping the flow of the pipeline to avoid a malfunction due to the interference is called a pipeline interlock.

【0006】同図(b)は、以下に示す命令3と命令4
が処理される場合である。 命令3:レジスタR3に2を加え、結果をレジスタR3
に格納する。 命令4:サブルーチンからリターンする。 この命令4は解読・アドレス計算の処理サイクルで、ス
タックポインタであるレジスタR3の内容をアドレスと
してメモリを読出し、その内容をプログラムカウンタP
Cに格納する処理を行うため、同図(a)と同様にレジ
スタR3の読出しと書込みとに起因するレジスタ干渉が
発生し、サイクルt3とサイクルt4でそれぞれ解読・
アドレス計算ステージと演算実行ステージとをインタロ
ックさせなければならない。
FIG. 1B shows an instruction 3 and an instruction 4 shown below.
Is processed. Instruction 3: Add 2 to register R3 and store result in register R3
To be stored. Instruction 4: Return from subroutine. This instruction 4 is a decoding / address calculation processing cycle in which the memory is read using the contents of the register R3, which is the stack pointer, as an address, and the contents are read by the program counter P
In order to perform the process of storing data in the register C, register interference occurs due to reading and writing of the register R3, as in FIG.
The address calculation stage and the operation execution stage must be interlocked.

【0007】同図(c)は、以下に示す命令5と命令6
が連続して処理される場合である。 命令5:割込み処理サブルーチンからリターンする。 命令6:レジスタR3に2を加えた結果をアドレスとし
てメモリを読出し、その内容をレジスタR1に格納す
る。 この命令5は演算実行のサイクルで、スタックポインタ
であるレジスタR3に6を加え、結果をレジスタR3に
格納する処理を行うため、同図(a)と同様にレジスタ
R3の読出しと書込みとに起因するレジスタ干渉が発生
し、サイクルt2とサイクルt3でそれぞれ解読・アド
レス計算ステージと演算実行ステージとをインタロック
させなければならない。
FIG. 1C shows an instruction 5 and an instruction 6 shown below.
Are continuously processed. Instruction 5: Return from interrupt processing subroutine. Instruction 6: The memory is read with the result of adding 2 to register R3 as an address, and the contents are stored in register R1. This instruction 5 is a cycle of operation execution, in which 6 is added to the register R3 which is a stack pointer, and the result is stored in the register R3. Therefore, the instruction 5 is caused by reading and writing of the register R3 as in FIG. Therefore, it is necessary to interlock the decryption / address calculation stage and the operation execution stage in cycles t2 and t3, respectively.

【0008】そこで次に、レジスタ干渉の検出をこの従
来のプロセッサではどのように実現しているかを説明す
る。図7はこの従来のプロセッサの命令フォーマットを
表す説明図である。図7(a)はアドレス計算に用いる
レジスタと書込みレジスタとを明示的に指定する命令の
フォーマットで、opのフィールドでオペレーションを、
srcのフィールドでソースオペランドとなるメモリのア
ドレス計算に用いるレジスタの番号を、destのフィール
ドでデスティネーションオペランドのレジスタの番号を
指定する。opのフィールドに記載する2進数コードを特
にオペコードと呼ぶ。レジスタ番号は、R0なら00、
R1なら01、R2なら10、R3なら11とする。図
6の命令2や命令6がこの形式をとる。一方、図7
(b)は明示的に指定するレジスタがない命令のフォー
マットで、すべてのフィールドがオペレーションを指定
する。図6の命令4や命令5がこの形式をとる。命令4
ではレジスタR3をアドレス計算に用い、命令5ではレ
ジスタR3にデータの書込みを行うがいずれもレジスタ
R3の番号11は命令に現われないので、以降ではスタ
ックポインタとして割り当てられているレジスタR3が
暗黙に指定されると表現する。
Next, how the conventional processor detects register interference will be described. FIG. 7 is an explanatory diagram showing an instruction format of this conventional processor. FIG. 7A shows an instruction format for explicitly specifying a register and a write register used for address calculation.
In the src field, specify the number of the register used for calculating the address of the memory as the source operand, and in the dest field, specify the register number of the destination operand. The binary code described in the op field is particularly called an operation code. The register number is 00 for R0,
01 is set for R1, 10 for R2, and 11 for R3. Instruction 2 and instruction 6 in FIG. 6 take this form. On the other hand, FIG.
(B) is an instruction format in which there is no register to explicitly specify, and all fields specify an operation. Instruction 4 and instruction 5 in FIG. 6 take this form. Instruction 4
Uses the register R3 for address calculation, and in the instruction 5, data is written to the register R3. However, since the register R3 number 11 does not appear in the instruction, the register R3 assigned as a stack pointer is implicitly specified thereafter. Express as being done.

【0009】図8は図5に示した解読・アドレス計算回
路54に含まれるプロセッサのレジスタ干渉検出機構の
構成図である。同図において、81は図7に示したフォ
ーマットの命令を格納する命令レジスタで、下位から3
ビット目と4ビット目をsrcフィールド、下位2ビット
をdestフィールドである。82は命令レジスタ81の内
容を解読し、その命令が解読・アドレス計算の処理サイ
クルでsrcフィールドに示すレジスタをアドレス計算に
用いる命令であること(そのときレジスタリード信号で
あるRRD=1)、その命令が解読・アドレス計算の処理サ
イクルでレジスタR3をアドレス計算に用いる命令であ
ること(そのときスタックポインタリード信号であるSP
RD=1)、その命令が演算実行の処理サイクルでdestフィ
ールドに示すレジスタにデータを書込む命令であること
(そのときレジスタライト信号であるRWT=1)、その命
令が演算実行の処理サイクルでレジスタR3にデータを
書込む命令であること(そのときスタックポインタライ
ト信号SPWT=1)を判定する。RRDとSPRDおよびRWTとSPWT
は排他的(共に1にはなり得ない)である。83から8
5は1サイクルの期間だけその内容を保持するラッチ、
86は組合せ論理回路で、レジスタ干渉が検出されると
最下段のORゲートが1を出力する。
FIG. 8 is a block diagram of a register interference detection mechanism of a processor included in the decoding / address calculation circuit 54 shown in FIG. In the figure, reference numeral 81 denotes an instruction register for storing an instruction in the format shown in FIG.
The 4th and 4th bits are a src field, and the lower 2 bits are a dest field. 82 decodes the contents of the instruction register 81, and if the instruction is an instruction that uses the register indicated in the src field for address calculation in the decoding / address calculation processing cycle (the register read signal RRD = 1 at that time), The instruction is an instruction that uses the register R3 for address calculation in the decoding / address calculation processing cycle (at this time, the stack pointer read signal SP
RD = 1), the instruction is an instruction to write data to the register indicated in the dest field in the operation execution processing cycle (RWT = 1 which is a register write signal at that time), and the instruction is executed in the operation execution processing cycle. It is determined that the instruction is for writing data to the register R3 (at that time, the stack pointer write signal SPWT = 1). RRD and SPRD and RWT and SPWT
Are exclusive (both cannot be 1). 83 to 8
5 is a latch that holds its contents only for one cycle,
Reference numeral 86 denotes a combinational logic circuit. When a register interference is detected, the OR gate at the lowermost stage outputs "1".

【0010】図9は図8に示すレジスタ干渉検出機構の
組合せ論理回路86の真理値表を表す。LRWT、LSPWT、L
DESTはそれぞれラッチ83、ラッチ84、ラッチ85の
内容を示す。次の4つの場合にレジスタ干渉が検出され
る。 (その1)SPRD=1かつLSPWT=1の時。 (その2)SPRD=1かつLRWT=1かつLDEST=SP(レジスタ番
号が11)の時。
FIG. 9 shows a truth table of the combinational logic circuit 86 of the register interference detecting mechanism shown in FIG. LRWT, LSPWT, L
DEST indicates the contents of the latch 83, the latch 84, and the latch 85, respectively. Register interference is detected in the following four cases. (Part 1) When SPRD = 1 and LSPWT = 1. (Part 2) When SPRD = 1, LRWT = 1 and LDEST = SP (register number 11).

【0011】(その3)RRD=1かつLSPWT=1かつSRC=SP
(レジスタ番号が11)の時。 (その4)RRD=1かつLRWT=1かつSRC=LDESTの時。 図6(a)に示すレジスタ干渉は、命令1により書き替
えられるレジスタと命令2により読出されるレジスタと
がともに明示的に指定される場合で、上記の(その4)
の機構により検出される。同図(b)に示すレジスタ干
渉は、命令3により書き替えられるレジスタが明示的に
指定されて命令4により読出されるレジスタが暗黙に指
定される場合で、上記の(その2)の機構により検出さ
れる。同図(c)に示すレジスタ干渉は、命令5により
書き替えられるレジスタが暗黙に指定されて命令6によ
り読出されるレジスタが明示的に指定される場合で、上
記の(その3)の機構により検出される。上記の(その
1)の機構は、書き替えられるレジスタと読出されるレ
ジスタとがともに暗黙に指定される場合で、図6におけ
る命令5と命令4とを連続して処理した場合に機能す
る。
(Part 3) RRD = 1, LSPWT = 1 and SRC = SP
(Register number is 11). (Part 4) When RRD = 1, LRWT = 1 and SRC = LDEST. The register interference shown in FIG. 6A is when the register rewritten by the instruction 1 and the register read by the instruction 2 are both explicitly specified.
Mechanism. The register interference shown in FIG. 9B is a case where the register to be rewritten by the instruction 3 is explicitly specified and the register to be read by the instruction 4 is implicitly specified. Is detected. The register interference shown in FIG. 11C is a case where the register to be rewritten by the instruction 5 is implicitly specified and the register to be read by the instruction 6 is explicitly specified. Is detected. The mechanism (part 1) described above functions when the register to be rewritten and the register to be read are both implicitly specified, and the instruction 5 and the instruction 4 in FIG. 6 are successively processed.

【0012】次に、暗黙に指定されるレジスタがどのよ
うにして読出しまたは書込まれるかを説明する。図10
は図5に示した演算実行回路55に含まれるプロセッサ
のレジスタ読出し書込み機構の構成図である。同図にお
いて、101はレジスタR0、102はレジスタR1、
103はレジスタR2、104はレジスタR3、105
および106は2ビットの入力をデコードしていずれか
1つが1で残りを0とする4ビットを出力するデコー
ダ、107はデコーダ106の4ビットの出力に対応し
てレジスタR0からレジスタR3のいずれか1つを選択
して出力するセレクタ、108はセレクタ107の出力
を他に伝えるドライバ、109および111はORゲー
ト、110はANDゲートである。左端の制御信号はい
ずれも図8のレジスタ干渉検出機構から入力される。レ
ジスタR3が暗黙にアドレス計算に用いられる際は、O
Rゲート111によりデコーダ106の’11’の出力
が1になりセレクタ107およびドライバ108を介し
てレジスタR3の内容が読出される。またレジスタR3
に暗黙にデータが書込まれる際は、ORゲート109に
よりデコーダ105の’11’の出力が1になりAND
ゲート110を介してレジスタR3に書込みクロックが
加えられ書込みが行われる。
Next, how an implicitly specified register is read or written will be described. FIG.
6 is a configuration diagram of a register read / write mechanism of a processor included in the operation execution circuit 55 shown in FIG. In the figure, 101 is a register R0, 102 is a register R1,
103 is a register R2, 104 is a register R3, 105
And 106 are decoders for decoding a 2-bit input and outputting 4 bits in which one of them is 1 and the remaining is 0, and 107 is any of the registers R0 to R3 corresponding to the 4-bit output of the decoder 106. A selector for selecting and outputting one of them, 108 is a driver for transmitting the output of the selector 107 to another, 109 and 111 are OR gates, and 110 is an AND gate. All of the control signals at the left end are input from the register interference detection mechanism of FIG. When register R3 is used implicitly for address calculation, O
The output of '11' of the decoder 106 becomes 1 by the R gate 111, and the contents of the register R3 are read out via the selector 107 and the driver 108. Also, register R3
When data is implicitly written to the OR gate 109, the output of '11' of the decoder 105 becomes 1 by the OR gate 109 and AND
A write clock is applied to the register R3 via the gate 110 to perform writing.

【0013】[0013]

【発明が解決しようとする課題】しかしながら、上記従
来技術のプロセッサによれば、レジスタ干渉の発生の要
因となる、書込み時の2通りの指定(レジスタが明示的
に指定される場合と暗黙に指定される場合)と読出し時
の2通りの指定(同)との4通りの組合せをすべて検出
する必要があり、そのためにハードウェアが複雑にな
り、ハードウェアの規模、コストおよび消費電力が増大
するという問題点があった。
However, according to the above-mentioned prior art processor, there are two types of specification at the time of writing (a case where a register is explicitly specified and a case where a register is explicitly specified) which causes the occurrence of register interference. ) And two designations (the same) at the time of reading, it is necessary to detect all four combinations, which complicates the hardware and increases the scale, cost and power consumption of the hardware. There was a problem.

【0014】より具体的に説明すると、暗黙に指定され
るレジスタR3の読出しと書込みとに起因する干渉の検
出のために設けられた、図8における解読回路82の内
のレジスタR3の読出しと書込みを検出する部分と後者
を保持するラッチ84と組合せ論理回路86のSPRDとLS
PWTを入力とする部分とによってハードウェアのコスト
および消費電力が増大するという問題点を有している。
More specifically, the reading and writing of register R3 in decoding circuit 82 in FIG. 8 provided for detecting interference caused by reading and writing of register R3 implicitly specified. , The latch 84 for holding the latter, and the SPRD and LS of the combinational logic circuit 86.
There is a problem that the cost and power consumption of the hardware increase due to the portion that receives the PWT.

【0015】また暗黙に指定されるレジスタの読み書き
を実現するためにも特別な制御ハードウェアが必要にな
り、ハードウェアの規模、コストおよび消費電力の増大
をさらに助長するという問題点があった。より具体的に
説明すると、暗黙に指定されるレジスタR3の書込みの
ために設けられた図10におけるORゲート109と読
出しのために設けられたORゲート111とによってハ
ードウェアのコストおよび消費電力が増大するという問
題点を有している。
In addition, special control hardware is required to realize reading and writing of registers implicitly specified, which further increases the size, cost and power consumption of the hardware. More specifically, hardware cost and power consumption are increased by OR gate 109 in FIG. 10 provided for writing register R3 which is implicitly specified and OR gate 111 provided for reading. There is a problem in that.

【0016】本発明はかかる問題点に鑑み、回路を簡略
化することにより、ハードウェアの規模、コストと消費
電力とを削減することができるプロセッサを提供するこ
とを目的とする。
The present invention has been made in view of the above problems, and has as its object to provide a processor capable of reducing the scale, cost, and power consumption of hardware by simplifying a circuit.

【0017】上記目標を達成するため、本発明に係るプ
ロセッサは、複数のレジスタと、前記複数のレジスタの
一つを特定するレジスタ番号を指定位置に明示して当該
レジスタのアクセスを行う第1の命令コード及び前記複
数のレジスタのうちの固有のレジスタのアクセスを行う
第2の命令コードを解読する命令解読手段とを備えるプ
ロセッサであって、前記第1の命令コードの前記指定位
置に相当する前記第2の命令コードの位置が、オペコー
ドの一部であって、前記固有のレジスタのレジスタ番号
と同じビットパターンであることを特徴とする。
[0017] In order to achieve the above goal, the program
The processor includes a plurality of registers, and the plurality of registers.
Specify the register number specifying one at the specified position and
A first instruction code for accessing a register;
Access a unique register of a number of registers
Command decoding means for decoding the second command code.
A designated position of the first instruction code.
The position of the second instruction code corresponding to the
Register number of the unique register
And the same bit pattern.

【0018】ここで、前記命令解読手段は、前記第2の
命令コードを解読するとき、前記第2の命令コード中
の、前記オペコードの一部をそのまま取り出して当該オ
ペコードの一部に基づいてアクセスすべきレジスタを選
択することを特徴としてもよい。ここで、前記プロセッ
サはパイプライン構造を持つプロセッサであり、前記命
令解読手段は前記第2の命令コードを解読するとき前記
第2の命令コード中の前記オペコードの一部をそのまま
取り出して当該オペコードの一部に基づいて当該命令コ
ードと他の命令コードとによるレジスタ干渉の発生の有
を検出すること特徴としてもよい。
Here, the instruction decoding means, when decoding the second instruction code, takes out a part of the operation code in the second instruction code as it is and accesses it based on the part of the operation code. It may be characterized by selecting a register to be executed. Here, the processor is a processor having a pipeline structure, and the instruction decoding means extracts a part of the operation code in the second instruction code as it is when decoding the second instruction code, and If there is a possibility of register interference between the instruction code and another instruction code
It may be a feature to detect absence .

【0019】ここで、前記第1の命令コードは当該レジ
スタの読み出しを伴う命令である場合には前記レジスタ
番号をソースオペランドの指定位置に明示し当該レジス
タの書き込みを伴う命令である場合には前記レジスタ番
号をディスティネーションオペランドの指定位置に明示
し、前記第2の命令コードが前記固有のレジスタの読み
出しを伴う命令である場合には前記第1の命令コードの
前記ソースオペランドの指定位置に相当する前記第2の
命令コードの位置がオペコードの一部であって前記固有
のレジスタのレジスタ番号と同じビットパターンであ
り、前記第2の命令コードが前記固有のレジスタの書き
込みを伴う命令である場合には前記第1の命令コードの
前記ディスティネーションオペランドの指定位置に相当
する前記第2の命令コードの位置がオペコードの一部で
あって前記固有のレジスタのレジスタ番号と同じビット
パターンであることを特徴としてもよい。
Here, the first instruction code is stored in the register.
If the instruction involves reading the
Specify the number in the specified position of the source operand and
If the instruction involves writing data,
Signal at the specified position of the destination operand
And the second instruction code reads the unique register.
In the case of the instruction accompanied by the first instruction code,
The second position corresponding to the designated position of the source operand
The position of the instruction code is a part of the operation code
The same bit pattern as the register number of the register
And the second instruction code writes the unique register.
If the instruction is accompanied by an
Corresponds to the specified position of the destination operand
The position of the second instruction code is a part of the operation code.
And the same bit as the register number of the unique register
It may be characterized by being a pattern .

【0020】ここで、前記第2の命令コードはスタック
ポインタのアクセスを指示する命令であることを特徴と
していてもよい。
Here, the second instruction code is a stack
It may be characterized in that the instruction is an instruction for accessing a pointer .

【0021】また上記目標を達成するため、本発明に係
るプロセッサは、命令コードを読み出して命令レジスタ
に保持する命令読み出し手段と、前記命令レジスタに保
持された命令コードを直接解読する命令解読手段と、複
数のレジスタとを備えるプロセッサであって、前記命令
解読手段は、前記複数のレジスタの一つを特定するレジ
スタ番号を指定位置に明示して当該レジスタのアクセス
を行う第1の命令コード及び前記複数のレジスタのうち
の固有のレジスタのアクセスを行う第2の命令コードを
解読し、前記第1の命令コードの前記指定位置に相当す
る前記第2の命令コードの位置がオペコードの一部であ
って前記固有のレジスタのレジスタ番号と同じビットパ
ターンであることを特徴としていてもよい。ここで、前
記命令解読手段は前記第2の命令コードを解読するとき
も前記命令レジスタに保持された命令コード中の前記指
定位置に相当する位置にあるビットパターンをそのまま
取り出して当該ビットパターンに基づいてアクセスすべ
きレジスタを選択することを特徴としていてもよい。こ
こで、前記プロセッサはパイプライン構造を持つプロセ
ッサであり、前記命令解読手段は前記第2の命令コード
を解読するときも前記命令レジスタに保持された命令コ
ード中の前記指定位置に相当する位置にあるビットパタ
ーンをそのまま取り出して当該ビットパターンに基づい
て当該命令コードと他の命令コードとによるレジスタ干
渉の発生の有無を検出することを特徴としていてもよ
い。ここで、前記第1の命令コードは、当該レジスタの
読み出しを伴う命令である場合には前記レジスタ番号を
ソースオペランドの指定位置に明示し当該レジスタの書
き込みを伴う命令である場合には前記レジスタ番号をデ
ィスティネーションオペランドの指定位置に明示し、前
記命令解読手段は、前記命令レジスタに保持された命令
コード中の前記第1の命令コードの前記ディスティネー
ションオペランドの指定位置に相当する位置にあるビッ
トパターンを保持する保持手段と、前記命令レジスタに
保持された新たな命令コード中の前記第1の命令コード
の前記ソースオペランドの指定位置に相当する位置にあ
るビットパターンと前記保持手段の保持内容とが一致し
ているか否かにより2つの命令コードが同じレジスタに
同時にアクセスしようとするかどうかを検出する一致検
出手段とを備えることを特徴としていてもよい。また上
記目標を達成するため、本発明に係るプロセッサは、複
数のレジスタと、第1、第2、第3の部分からなるとと
もに少なくとも第1の部分にはオペコードを有する命令
コードを読み出して命令レジスタに保持する命令読み出
し手段と、前記命令コードが前記複数のレジスタの一つ
を特定するレジスタ番号を指定位置に明示して当該レジ
スタの読み出しを伴う操作を示す場合には前記命令レジ
スタに保持された命令コードの第2の部分をソースオペ
ランドとなるレジスタ番号として用いることを決定し、
前記命令コードが前記複数のレジスタの一つを特定する
レジスタ番号を指定位置に明示して当該レジスタの書き
込みを伴う操作を示す場合には前記命令レジスタに保持
された命令コードの第3の部分をディスティネーション
オペランドとなるレジスタ番号として用いることを決定
し、前記命令コードが前記命令コードの第2の部分もオ
ペコードであり前記複数のレジスタのうち固有のレジス
タの読み出しを伴う操作を示す場合には前記命令レジス
タに保持された命令コードの第2の部分をソースオペラ
ンドとなるレジスタ番号として用いることを決定する命
令解読手段と、前記命令解読手段から実行すべき操作の
内容とソースオペランドとなるレジスタ番号とディステ
ィネーションオペランドとなるレジスタ番号とを受け取
って実行する実行手段とを備えることを特徴としていて
もよい。また上記目標を達成するため、本発明に係るプ
ロセッサは、複数のレジスタと、第1、第2、第3の部
分からなるとともに少なくとも第1の部分にはオペコー
ドを有する命令コードを読み出して命令レジスタに保持
する命令読み出し手段と、前記命令コードが前記複数の
レジスタの一つを特定するレジスタ番号を指定位置に明
示して当該レジスタの読み出しを伴う操作を示す場合に
は前記命令レジスタに保持された命令コードの第2の部
分をソースオペランドとなるレジスタ番号として用いる
ことを決定し、前記命令コードが前記複数のレジスタの
一つを特定するレジスタ番号を指定位置に明示して当該
レジスタの書き込みを伴う操作を示す場合には前記命令
レジスタに保持された命令コードの第3の部分をディス
ティネーションオペランドとなるレジスタ番号として用
いることを決定し、前記命令コードが前記命令コード
3の部分もオペコードであり前記複数のレジスタのう
ち固有のレジスタの書き込みを伴う操作を示す場合には
前記命令レジスタに保持された命令コードの第3の部分
をディスティネーションオペランドとなるレジスタ番号
として用いることを決定する命令解読手段と、前記命令
解読手段から実行すべき操作の内容とソースオペランド
となるレジスタ番号とディスティネーションオペランド
となるレジスタ番号とを受け取って実行する実行手段と
を備えることを特徴としていてもよい。また上記目標を
達成するため、本発明に係るプロセッサは、複数のレジ
スタと、前記複数のレジスタの一つを特定するレジスタ
番号を指定位置に明示して当該レジスタのアクセスを行
う第1の命令コード及び前記複数のレジスタのうちの固
有のレジスタのアクセスを行う第2の命令コードを解読
し前記第1の命令コードの前記指定位置に相当する位置
にあって前記第2の命令コードのオペコードの一部をな
すビットパターンに基づいて前記固有のレジスタを選択
する命令解読手段とを備えることを特徴とする。
In order to achieve the above object, a processor according to the present invention comprises: an instruction reading means for reading an instruction code and holding it in an instruction register; and an instruction decoding means for directly decoding the instruction code held in the instruction register. A plurality of registers, wherein the instruction decoding means specifies a register number specifying one of the plurality of registers at a designated position to access the register, A second instruction code for accessing a unique register among the plurality of registers is decoded, and a position of the second instruction code corresponding to the designated position of the first instruction code is a part of an operation code. The bit pattern may be the same as the register number of the unique register. Here, even when decoding the second instruction code, the instruction decoding means takes out a bit pattern at a position corresponding to the designated position in the instruction code held in the instruction register as it is, and based on the bit pattern. And selecting a register to be accessed. Here, the processor is a processor having a pipeline structure, and the instruction decoding means is configured to decode the second instruction code at a position corresponding to the designated position in the instruction code held in the instruction register. A certain bit pattern is taken out as it is, and a register error based on the instruction code and another instruction code is performed based on the bit pattern.
It may be characterized by detecting the presence or absence of interference. Here, when the first instruction code is an instruction accompanied by reading of the register, the register number is specified at a designated position of a source operand, and when the instruction code involves writing of the register, the register number is designated by the register number. At the designated position of the destination operand, and the instruction decoding means includes a bit pattern at a position corresponding to the designated position of the destination operand of the first instruction code in the instruction code held in the instruction register. Holding means, and a bit pattern at a position corresponding to the designated position of the source operand of the first instruction code in the new instruction code held in the instruction register and the content held by the holding means are Two instruction codes will access the same register at the same time depending on whether they match It may be characterized in that it comprises a coincidence detecting means for detecting whether. In order to achieve the above object, a processor according to the present invention reads an instruction code including a plurality of registers, an instruction code including first, second, and third portions, and at least a first portion having an operation code. The instruction reading means held in the instruction register when the instruction code explicitly indicates a register number specifying one of the plurality of registers at a designated position and indicates an operation involving reading of the register; Deciding to use the second part of the instruction code as the source operand register number;
When the instruction code clearly indicates a register number specifying one of the plurality of registers at a designated position and indicates an operation involving writing to the register, the third part of the instruction code held in the instruction register is written. When the instruction code is determined to be used as a register number serving as a destination operand, and the instruction code indicates an operation involving reading of a unique register among the plurality of registers, the second part of the instruction code is also an operation code. Instruction decoding means for determining that the second part of the instruction code held in the instruction register is to be used as a register number serving as a source operand, contents of an operation to be executed from the instruction decoding means, and a register number serving as a source operand; Execution that receives and executes the register number that is the destination operand It may be characterized in that it comprises a stage. In order to achieve the above object, a processor according to the present invention reads an instruction code including a plurality of registers, an instruction code including first, second, and third portions, and at least a first portion having an operation code. Instruction reading means for holding the instruction register when the instruction code explicitly indicates a register number specifying one of the plurality of registers at a designated position and indicates an operation involving reading of the register. It is determined that the second part of the instruction code is to be used as a register number serving as a source operand, and the instruction code specifies a register number specifying one of the plurality of registers at a specified position, and involves writing the register. When indicating an operation, the third part of the instruction code held in the instruction register is used as a destination operand. It was determined to be used as comprising a register number, the instruction code of the instruction code
The third part is also an operation code, and when indicating an operation involving writing of a unique register among the plurality of registers, the third part of the instruction code held in the instruction register is set as a register number serving as a destination operand. Instruction decoding means for deciding to use, and execution means for receiving and executing the contents of the operation to be executed, the register number as the source operand, and the register number as the destination operand from the instruction decoding means. It may be. In addition,
To achieve this, the processor according to the present invention comprises a plurality of registers.
And a register for specifying one of the plurality of registers
Specify the number at the specified position to access the register.
A first instruction code and a fixed one of the plurality of registers.
Decodes second instruction code for accessing existing registers
And a position corresponding to the designated position of the first instruction code.
And a part of the operation code of the second instruction code.
Select the unique register based on the bit pattern
And a command decoding means.

【0022】[0022]

【作用】上記構成によれば、オペコードの一部が固有の
レジスタのレジスタ番号と同じビットパターンである第
2の命令コードが、命令解読手段によって解読される。
According to the above arrangement, a part of the operation code is unique.
The same bit pattern as the register number of the register
Second instruction code is decoded by the instruction decoding means.

【0023】また、第2の命令コードが解読されると
き、第2の命令コード中のオペコードの一部がそのまま
取り出され、当該オペコードの一部に基づいてアクセス
すべきレジスタが命令解読手段によって選択される。ま
た、第2の命令コードが解読されるとき、第2の命令コ
ード中のオペコードの一部がそのまま取り出され、当該
オペコードの一部に基づいて当該命令コードと他の命令
コードとによるレジスタ干渉の発生の有無が命令解読手
段によって検出される。また、第1の命令コードは、当
該レジスタの読み出しを伴う命令である場合には前記レ
ジスタ番号がソースオペランドの指定位置に明示され、
当該レジスタの書き込みを伴う命令である場合には前記
レジスタ番号がディスティネーションオペランドの指定
位置に明示され、前記第2の命令コードが前記固有のレ
ジスタの読み出しを伴う命令である場合には前記第1の
命令コードの前記ソースオペランドの指定位置に相当す
る前記第2の命令コードの位置がオペコードの一部であ
って前記固有のレジスタのレジスタ番号と同じビットパ
ターンであり、前記第2の命令コードが前記固有のレジ
スタの書き込みを伴う命令である場合には前記第1の命
令コードの前記ディスティネーションオペランドの指定
位置に相当する前記第2の命令コードの位置がオペコー
ドの一部であって前記固有のレジスタのレジスタ番号と
同じビットパターンであってもよい。
Also, when the second instruction code is decoded, a part of the operation code in the second instruction code is taken out as it is, and a register to be accessed is selected by the instruction decoding means based on the part of the operation code. Is done. Further, when the second instruction code is decoded, a part of the operation code in the second instruction code is taken out as it is, and based on a part of the operation code, the register interference between the instruction code and another instruction code is prevented . The occurrence is detected by the instruction decoding means. Further, when the first instruction code is an instruction that involves reading of the register, the register number is specified at a specified position of a source operand,
If the instruction involves writing to the register, the register number is specified at the designated position of the destination operand. If the second instruction code is an instruction involving reading of the unique register, the first The position of the second instruction code corresponding to the designated position of the source operand of the instruction code is a part of an operation code and has the same bit pattern as the register number of the unique register, and the second instruction code is When the instruction involves writing of the unique register, the position of the second instruction code corresponding to the designated position of the destination operand of the first instruction code is a part of an operation code, and The bit pattern may be the same as the register number of the register.

【0024】また、第2の命令コードはスタックポイン
タのアクセスを指示する命令であってもよい。
The second instruction code is a stack point
May be an instruction instructing access to the data.

【0025】また、上記構成によれば、命令読み出し手
段によって命令コードが読み出されて命令レジスタに保
持され、命令レジスタに保持された命令コードが命令解
読手段によって直接解読され、オペコードの一部が固有
のレジスタのレジスタ番号と同じビットパターンである
第2の命令コードが、命令解読手段によって解読され
る。また、第2の命令コードが解読されるとき、命令レ
ジスタに保持された命令コード中の指定位置に相当する
位置にあるビットパターンがそのまま取り出され、当該
ビットパターンに基づいてアクセスすべきレジスタが命
令解読手段によって選択される。また、第2の命令コー
ドが解読されるとき、命令レジスタに保持された命令コ
ード中の指定位置に相当する位置にあるビットパターン
がそのまま取り出され、当該ビットパターンに基づいて
当該命令コードと他の命令コードとによるレジスタ干渉
の発生の有無が命令解読手段によって検出される。ま
た、第1の命令コードは、当該レジスタの読み出しを伴
う命令である場合には前記レジスタ番号がソースオペラ
ンドの指定位置に明示され、当該レジスタの書き込みを
伴う命令である場合には前記レジスタ番号がディスティ
ネーションオペランドの指定位置に明示され、命令レジ
スタに保持された命令コード中の第1の命令コードのデ
ィスティネーションオペランドの指定位置に相当する位
置にあるビットパターンが保持手段によって保持され、
命令レジスタに保持された新たな命令コード中の第1の
命令コードのソースオペランドの指定位置に相当する位
置にあるビットパターンと保持手段の保持内容とが一致
しているか否かにより2つの命令コードが同じレジスタ
に同時にアクセスしようとするかどうかが一致検出手段
によって検出される。また、上記構成によれば、第1、
第2、第3の部分からなるとともに少なくとも第1の部
分にはオペコードを有する命令コードが命令読み出し手
段によって読み出されて命令レジスタに保持され、命令
コードが複数のレジスタの一つを特定するレジスタ番号
を指定位置に明示して当該レジスタの読み出しを伴う操
作を示す場合には命令レジスタに保持された命令コード
の第2の部分をソースオペランドとなるレジスタ番号と
して用いることが命令解読手段により決定され、命令コ
ードが複数のレジスタの一つを特定するレジスタ番号を
指定位置に明示して当該レジスタの書き込みを伴う操作
を示す場合には命令レジスタに保持された命令コードの
第3の部分をディスティネーションオペランドとなるレ
ジスタ番号として用いることが命令解読手段により決定
され、命令コードが命令コードの第2の部分もオペコー
ドであり複数のレジスタのうち固有のレジスタの読み出
しを伴う操作を示す場合には命令レジスタに保持された
命令コードの第2の部分をソースオペランドとなるレジ
スタ番号として用いることが命令解読手段により決定さ
れ、命令解読手段から実行すべき操作の内容とソースオ
ペランドとなるレジスタ番号とディスティネーションオ
ペランドとなるレジスタ番号とが実行手段により受け取
られて実行される。また、上記構成によれば、第1、第
2、第3の部分からなるとともに少なくとも第1の部分
にはオペコードを有する命令コードが命令読み出し手段
によって読み出されて命令レジスタに保持され、命令コ
ードが複数のレジスタの一つを特定するレジスタ番号を
指定位置に明示して当該レジスタの読み出しを伴う操作
を示す場合には命令レジスタに保持された命令コードの
第2の部分をソースオペランドとなるレジスタ番号とし
て用いることが命令解読手段により決定され、命令コー
ドが複数のレジスタの一つを特定するレジスタ番号を指
定位置に明示して当該レジスタの書き込みを伴う操作を
示す場合には命令レジスタに保持された命令コードの第
3の部分をディスティネーションオペランドとなるレジ
スタ番号として用いることが命令解読手段により決定さ
れ、命令コードが命令コードの第3の部分もオペコード
であり複数のレジスタのうち固有のレジスタの書き込み
を伴う操作を示す場合には命令レジスタに保持された命
令コードの第3の部分をディスティネーションオペラン
ドとなるレジスタ番号として用いることが命令解読手段
により決定され、命令解読手段から実行すべき操作の内
容とソースオペランドとなるレジスタ番号とディスティ
ネーションオペランドとなるレジスタ番号とが実行手段
により受け取られて実行される。また上記構成によれ
ば、命令解読手段によって第2の命令コードが解読され
た場合に、第1の命令コードの指定位置に相当する位置
にある第2の命令コードの ビットパターンに基づいて固
有のレジスタが選択される。
Further, according to the above configuration, the instruction code is read by the instruction reading means and held in the instruction register, and the instruction code held in the instruction register is directly decoded by the instruction decoding means, and a part of the operation code is obtained. The second instruction code having the same bit pattern as the register number of the unique register is decoded by the instruction decoding means. Further, when the second instruction code is decoded, the bit pattern at the position corresponding to the designated position in the instruction code held in the instruction register is extracted as it is, and the register to be accessed based on the bit pattern specifies the instruction. Selected by decryption means. Further, when the second instruction code is decoded, the bit pattern at the position corresponding to the designated position in the instruction code held in the instruction register is taken out as it is, and the instruction code and another Register interference due to instruction code
Whether the occurrence is detected by the instruction decoding means. Further, in the first instruction code, when the instruction involves reading of the register, the register number is specified at the designated position of the source operand, and when the instruction code involves writing of the register, the register number is A bit pattern that is specified at the designated position of the destination operand and that is at a position corresponding to the designated position of the destination operand of the first instruction code in the instruction code held in the instruction register is held by the holding unit;
The two instruction codes are determined based on whether or not the bit pattern at the position corresponding to the designated position of the source operand of the first instruction code in the new instruction code held in the instruction register matches the content held by the holding means. Are simultaneously detected by the coincidence detecting means. Further, according to the above configuration, the first,
An instruction code, which includes second and third parts and has an operation code in at least a first part, is read by an instruction reading means and held in an instruction register, and the instruction code specifies one of a plurality of registers. When the operation is accompanied by reading of the register by specifying the number in the designated position, the instruction decoding means determines that the second part of the instruction code held in the instruction register is used as the register number serving as the source operand. If the instruction code explicitly indicates a register number specifying one of a plurality of registers at a specified position to indicate an operation involving writing to the register, the third part of the instruction code held in the instruction register is destined. It is determined by the instruction decoding means to use the register number as an operand, and the instruction code As register number of the second portion of the instruction code held in the instruction register becomes the source operand to indicate operation involving the reading of specific registers of the second portion is also opcode plurality of registers of the instruction code The use of the instruction is determined by the instruction decoding means, and the content of the operation to be executed, the register number as the source operand, and the register number as the destination operand are received from the instruction decoding means and executed. Further, according to the above configuration, an instruction code including the first, second, and third portions and having an operation code in at least the first portion is read by the instruction reading means and held in the instruction register. If a register number specifying one of a plurality of registers is specified at a specified position to indicate an operation involving reading of the register, the second part of the instruction code held in the instruction register is used as a source operand register It is determined by the instruction decoding means to be used as a number, and if the instruction code clearly indicates a register number specifying one of the plurality of registers at a specified position and indicates an operation involving writing to the register, the instruction code is held in the instruction register. Using the third part of the instruction code as the register number to be the destination operand Is determined by the stage, a third portion of the instruction code held in the instruction register when the instruction code indicating an operation that writes specific registers of the third portion is also opcode plurality of registers of the instruction code Is used by the instruction decoding means to determine the contents of the operation to be executed, the register number serving as the source operand, and the register number serving as the destination operand. And executed. Also according to the above configuration
If the second instruction code is decoded by the instruction decoding means,
The position corresponding to the position specified by the first instruction code
Based on the bit pattern of the second instruction code in
An existing register is selected.

【0026】[0026]

【実施例】本発明の実施例におけるプロセッサの全体の
構成図を図5に示し、プロセッサ50、入出力バス51
から構成されている。さらに、プロセッサ50は、バス
インタフェース回路52、命令読出し回路53、解読・
アドレス計算回路54、演算実行回路55から構成され
ていて、3つのステージからなるパイプラン構造をと
り、命令読出し回路53、解読・アドレス計算回路5
4、演算実行回路55での処理がそれぞれのステージに
相当する。
FIG. 5 is a block diagram showing the overall arrangement of a processor according to an embodiment of the present invention.
It is composed of Further, the processor 50 includes a bus interface circuit 52, an instruction reading circuit 53,
It comprises an address calculation circuit 54 and an operation execution circuit 55, has a pipeline structure consisting of three stages, and has an instruction reading circuit 53, a decoding / address calculation circuit 5
4. The processing in the arithmetic execution circuit 55 corresponds to each stage.

【0027】プロセッサ50は、バスインタフェース回
路52、命令読出し回路53、解読・アドレス計算回路
54、演算実行回路55から構成されている。入出力バ
ス51は、プロセッサ50と外界との間でデータのやり
取りを行う。バスインタフェース回路52は入出力バス
51の制御を行う。命令読出し回路53はプログラムカ
ウンタPCを持ち、バスインタフェース回路52を介し
て命令を読み出す。
The processor 50 comprises a bus interface circuit 52, an instruction reading circuit 53, a decoding / address calculation circuit 54, and an operation execution circuit 55. The input / output bus 51 exchanges data between the processor 50 and the outside world. The bus interface circuit 52 controls the input / output bus 51. The instruction reading circuit 53 has a program counter PC, and reads an instruction through the bus interface circuit 52.

【0028】解読・アドレス計算回路54は命令読出し
回路53から受け取った命令を解読するとともにメモリ
オペランドのアクセスを伴う場合はそのオペランドアド
レスの計算を行う。オペランドアドレスの計算を行う場
合は、演算実行回路55の内部にあるレジスタを使用す
る。演算実行回路55は、解読・アドレス計算回路54
の指示によりメモリオペランドのアクセスを含む演算の
実行を行う。その際メモリオペランドのアクセスをバス
インタフェース回路52を介して行う。また内部に算術
論理演算を行う演算器とレジスタR0〜R3を持ち、R
3がスタックポインタとして割り当てられている。
The decoding / address calculation circuit 54 decodes the instruction received from the instruction reading circuit 53, and calculates the operand address when the memory operand is accessed. When calculating the operand address, a register inside the arithmetic execution circuit 55 is used. The operation execution circuit 55 includes a decryption / address calculation circuit 54
The operation including the access of the memory operand is executed in accordance with the instruction. At this time, access to the memory operand is performed via the bus interface circuit 52. It also has an arithmetic unit for performing arithmetic and logical operations and registers R0 to R3 inside.
3 is allocated as a stack pointer.

【0029】図1は本実施例におけるプロセッサの命令
フォーマットを表す説明図である。同図(a)はアドレ
ス計算に用いるレジスタと書込みレジスタとを明示的に
指定する命令のフォーマットで、opのフィールドでオペ
レーションを、srcのフィールドでソースオペランドと
なるメモリのアドレス計算に用いるレジスタの番号を、
destのフィールドでデスティネーションオペランドのレ
ジスタの番号を指定する。レジスタ番号は、R0なら0
0、R1なら01、R2なら10、R3なら11とす
る。
FIG. 1 is an explanatory diagram showing an instruction format of a processor in this embodiment. FIG. 11A shows an instruction format for explicitly specifying a register and a write register used for address calculation. The operation is performed in an op field, and the number of a register used for calculating the address of a memory serving as a source operand in a src field. To
Specify the register number of the destination operand in the dest field. Register number is 0 for R0
0, 01 for R1, 10 for R2, and 11 for R3.

【0030】同図(b)は従来技術では暗黙にレジスタ
R3を指定する命令の内、解読・アドレス計算の処理ス
テージでレジスタR3をアドレス計算に用いる命令のフ
ォーマットで、すべてのフィールドがオペレーションを
指定するものであるが、オペコードの下位から3ビット
目と4ビット目とが1に限定されている。見方を変える
と、下位から3ビット目と4ビット目は、レジスタR3
を指定するフィールドと見てもよい。
FIG. 2B shows the format of an instruction in which the register R3 is used for address calculation in the decoding / address calculation processing stage among the instructions that implicitly specify the register R3 in the prior art, and all fields specify operations. However, the third and fourth bits from the lower order of the operation code are limited to 1. In other words, the third and fourth bits from the low-order register R3
May be viewed as a field for specifying

【0031】同図(c)は従来技術では暗黙にレジスタ
R3を指定する命令の内、演算実行の処理ステップでレ
ジスタR3にデータを書込む命令のフォーマットで、す
べてのフィールドがオペレーションを指定するものであ
るが、オペコードの下位の2ビットが1に限定されてい
る。見方を変えると、下位から3ビット目と4ビット目
は、レジスタR3を指定するフィールドと見てもよい。
FIG. 3C shows the format of an instruction in which data is written to the register R3 in the processing step of execution of an operation among instructions for implicitly specifying the register R3 in the prior art, in which all fields specify an operation. However, the lower two bits of the operation code are limited to 1. In other words, the third and fourth bits from the lower order may be regarded as a field for specifying the register R3.

【0032】図2は図5に示した解読・アドレス計算回
路54に含まれるのレジスタ干渉検出機構の構成図であ
り、命令レジスタ21、解読回路22、ラッチ23、ラ
ッチ24、組合せ論理回路25から構成されている。命
令レジスタ21は図1に示すフォーマットの命令を格納
するレジスタであり上位4ビットをOPフィールド、下位
から3ビット目と4ビット目をsrcフィールド、下位2
ビットをdestフィールド、または8ビット全てをOPフィ
ールドとする。
FIG. 2 is a block diagram of a register interference detecting mechanism included in the decoding / address calculation circuit 54 shown in FIG. 5, and includes a command register 21, a decoding circuit 22, a latch 23, a latch 24, and a combinational logic circuit 25. It is configured. The instruction register 21 is a register for storing an instruction in the format shown in FIG. 1. The upper 4 bits are an OP field, the third and fourth bits from the lower are a src field, and the lower 2
Let the bits be the dest field or all 8 bits the OP field.

【0033】解読回路22は、命令レジスタ21の内容
を解読し、その命令が解読・アドレス計算の処理サイク
ルでsrcフィールドに示すレジスタをアドレス計算に用
いる命令であること(そのときレジスタリード信号RRD=
1)と、その命令が演算実行の処理サイクルでdestフィ
ールドに示すレジスタにデータを書込む命令であること
(そのときレジスタライト信号RWT=1)とを判定する。
The decoding circuit 22 decodes the contents of the instruction register 21 and determines that the instruction is an instruction that uses the register indicated in the src field for the address calculation in the decoding / address calculation processing cycle (the register read signal RRD =
1) and that the instruction is an instruction for writing data to the register indicated in the dest field in the processing cycle of the operation execution (at that time, the register write signal RWT = 1).

【0034】ラッチ23は、1サイクルの期間だけRWT
を保持する。ラッチ24は、1サイクルの期間だけDEST
を保持する。25は組合せ論理回路で、レジスタ干渉が
検出されるとANDゲートが1を出力する。図3は図2
に示すレジスタ干渉検出機構の組合せ論理回路25の真
理値表を示す。LRWT、LDESTはそれぞれラッチ23、ラ
ッチ24の内容を示す。レジスタ干渉は、RRD=1かつLRW
T=1かつSRC=LDESTの時に検出される。
The latch 23 has the RWT for only one cycle.
Hold. Latch 24 is DEST only for one cycle
Hold. Reference numeral 25 denotes a combinational logic circuit. When register interference is detected, the AND gate outputs "1". FIG. 3 is FIG.
3 shows a truth table of the combinational logic circuit 25 of the register interference detection mechanism shown in FIG. LRWT and LDEST indicate the contents of the latch 23 and the latch 24, respectively. Register interference is RRD = 1 and LRW
Detected when T = 1 and SRC = LDEST.

【0035】以上のように構成された本実施例のプロセ
ッサについて、レジスタ干渉の検出をどのように実現し
ているかを説明する。従来のプロセッサとの差異を明確
にするために図6に示した例を用いて説明する。(a)
に示すレジスタ干渉は、書き替えられるレジスタ(命令
1のR0)と読出されるレジスタ(命令2のR0)とが
ともに明示的に指定される場合である。この場合の動作
は従来のプロセッサと同じである。サイクルt3におい
て命令2を解読すると、この命令が解読・アドレス計算
の処理サイクルでsrcフィールドに示すレジスタをアド
レス計算に用いる命令であるため解読回路22はRRD=1
を出力し、srcのフィールドはSRC[1:0]=00になってい
る。一方、直前の命令1が演算実行の処理サイクルでde
stフィールドに示すレジスタにデータを書込む命令であ
るためラッチ23はLRWT=1を保持し、命令1のdestのフ
ィールドによりラッチ24はLDEST[1:0]=00を保持して
いる。その結果、組合せ論理回路25のANDゲートの
出力が1になりレジスタ干渉が検出される。
A description will be given of how the detection of register interference is realized in the processor of the present embodiment configured as described above. An explanation will be given using an example shown in FIG. 6 to clarify the difference from the conventional processor. (A)
The register interference shown in (1) is a case where a register to be rewritten (R0 of instruction 1) and a register to be read out (R0 of instruction 2) are both explicitly specified. The operation in this case is the same as that of the conventional processor. When the instruction 2 is decoded in the cycle t3, the decoding circuit 22 uses the register indicated in the src field for address calculation in the decoding / address calculation processing cycle, so that the decoding circuit 22 determines that RRD = 1
And the src field is SRC [1: 0] = 00. On the other hand, the immediately preceding instruction 1
The latch 23 holds LRWT = 1 because the instruction writes data into the register indicated by the st field, and the latch 24 holds LDEST [1: 0] = 00 by the dest field of the instruction 1. As a result, the output of the AND gate of the combinational logic circuit 25 becomes 1, and register interference is detected.

【0036】(b)に示すレジスタ干渉は、書き替えら
れるレジスタが明示的に指定されて(命令3のR3)読
出されるレジスタが暗黙に指定される(命令4のR3)
場合である。この場合の動作は従来のプロセッサとは異
なる。命令4は、解読・アドレス計算の処理サイクルで
レジスタR3を暗黙にアドレス計算に用いる命令である
が、オペコードの内のsrcのフィールドに位置する部分
が図1(b)に示すように11になっているため、これ
をsrcフィールドに示すレジスタをアドレス計算に用い
ると解釈することができる。そこでサイクルt3におい
て命令4を解読すると、この命令が解読・アドレス計算
の処理サイクルでsrcフィールドに示すレジスタをアド
レス計算に用いる命令であると見なして解読回路22は
RRD=1を出力し、srcのフィールドに位置する部分が11
であるためSRC[1:0]=11になっている。一方、直前の命
令3が演算実行の処理サイクルでdestフィールドに示す
レジスタにデータを書込む命令であるためラッチ23は
LRWT=1を保持し、命令3のdestのフィールドによりラッ
チ24はLDEST[1:0]=11を保持している。その結果、組
合せ論理回路25のANDゲートの出力が1になりレジ
スタ干渉が検出される。
In the register interference shown in (b), the register to be rewritten is explicitly specified (R3 of instruction 3), and the register to be read is implicitly specified (R3 of instruction 4).
Is the case. The operation in this case is different from a conventional processor. The instruction 4 is an instruction that uses the register R3 for address calculation implicitly in the decryption / address calculation processing cycle, and the portion of the opcode located in the src field becomes 11 as shown in FIG. Therefore, it can be interpreted that the register indicated in the src field is used for address calculation. Then, when the instruction 4 is decoded in the cycle t3, the decoding circuit 22 regards this instruction as an instruction that uses the register indicated in the src field for the address calculation in the decoding / address calculation processing cycle, and
RRD = 1 is output, and the part located in the src field is 11
Therefore, SRC [1: 0] = 11. On the other hand, since the immediately preceding instruction 3 is an instruction for writing data to the register indicated by the dest field in the processing cycle of the operation execution, the latch 23
LRWT = 1 is held, and the latch 24 holds LDEST [1: 0] = 11 by the dest field of the instruction 3. As a result, the output of the AND gate of the combinational logic circuit 25 becomes 1, and register interference is detected.

【0037】(c)に示すレジスタ干渉は、書き替えら
れるレジスタが暗黙に指定されて(命令5のR3)読出
されるレジスタが明示的に指定される(命令6のR3)
場合である。この場合の動作も従来のプロセッサとは異
なる。命令5は、演算実行の処理サイクルでレジスタR
3に暗黙にデータを書込む命令であるが、オペコードの
内のdestのフィールドに相当する部分が図1(c)に示
すように11になっているため、これをdestフィールド
に示すレジスタにデータを書込むと解釈することができ
る。そこでサイクルt2において命令6を解読すると、
この命令が解読・アドレス計算の処理サイクルでsrcフ
ィールドに示すレジスタをアドレス計算に用いる命令で
あるため解読回路22はRRD=1を出力し、srcのフィール
ドはSRC[1:0]=11になっている。一方、直前の命令5が
演算実行の処理サイクルでdestフィールドに示すレジス
タにデータを書込む命令であると見なして解読回路22
が出力したRWT=1によりラッチ23はLRWT=1を保持し、
命令5のdestのフィールドに位置する部分が11である
ためラッチ24はLDEST[1:0]=11を保持している。その
結果、組合せ論理回路25のANDゲートの出力が1に
なりレジスタ干渉が検出される。
In the register interference shown in (c), the register to be rewritten is implicitly specified (R3 of instruction 5), and the register to be read is explicitly specified (R3 of instruction 6).
Is the case. The operation in this case is also different from the conventional processor. Instruction 5 has a register R
3 is an instruction for writing data implicitly. Since the portion corresponding to the dest field in the operation code is 11, as shown in FIG. 1C, the data is stored in the register indicated in the dest field. Can be interpreted as writing. Then, when the instruction 6 is decoded in the cycle t2,
Since this instruction is an instruction that uses the register indicated in the src field for address calculation in the decoding / address calculation processing cycle, the decoding circuit 22 outputs RRD = 1, and the src field is SRC [1: 0] = 11. ing. On the other hand, the decoding circuit 22 considers that the immediately preceding instruction 5 is an instruction for writing data to the register indicated by the dest field in the processing cycle of the operation execution, and
The latch 23 holds LRWT = 1 by the output RWT = 1,
Since the portion located in the dest field of the instruction 5 is 11, the latch 24 holds LDEST [1: 0] = 11. As a result, the output of the AND gate of the combinational logic circuit 25 becomes 1, and register interference is detected.

【0038】図4は本実施例におけるプロセッサのレジ
スタ読出し書込み機構の構成図であり、41のレジスタ
R0、42のレジスタR1、43のレジスタR2、44
のレジスタR3、デコーダ45およびデコーダ46、セ
レクタ47、ドライバ48、ANDゲート49から構成
されている。41〜44は、レジスタであり、44のレ
ジスタR3のみスタックポインタとして割当てられてい
る。
FIG. 4 is a block diagram of the register read / write mechanism of the processor according to the present embodiment. The register R0 of 41, the register R1 of 42, the registers R2 and 44 of 43 are provided.
, A decoder 45 and a decoder 46, a selector 47, a driver 48, and an AND gate 49. 41 to 44 are registers, and only the register R3 of 44 is allocated as a stack pointer.

【0039】デコーダ45およびデコーダ46は、2ビ
ットの入力をデコードしていずれか1つが1で残りを0
とする4ビットを出力する。セレクタ47は、デコーダ
46の4ビットの出力に対応してレジスタR0からレジ
スタR3のいずれか1つを選択して出力する。ドライバ
48は、セレクタ47の出力を他に伝える。
The decoder 45 and the decoder 46 decode a 2-bit input so that one of them is 1 and the other is 0
Is output. The selector 47 selects and outputs any one of the registers R0 to R3 in accordance with the 4-bit output of the decoder 46. The driver 48 transmits the output of the selector 47 to another.

【0040】ANDゲート49は、2入力の論理和をと
る。また、左端の制御信号はいずれも図2のレジスタ干
渉検出機構から入力される。次に、本実施例のプロセッ
サが、暗黙に指定されるレジスタの読出し書込みをどの
ようにして実現しているかを説明する。
The AND gate 49 takes a logical sum of two inputs. The control signals at the left end are all input from the register interference detection mechanism of FIG. Next, a description will be given of how the processor of this embodiment implements reading and writing of registers implicitly specified.

【0041】解読・アドレス計算の処理サイクルでレジ
スタR3を暗黙にアドレス計算に用いる命令では、オペ
コードの内のsrcのフィールドに位置する部分は図1
(b)に示すように11であり、SRC[1:0]=11がデコー
ダ46に入力される。一方、図2の解読回路22は、同
命令を解読・アドレス計算の処理サイクルでsrcフィー
ルドに示すレジスタをアドレス計算に用いる命令である
と見なして、RRD=1をドライバ48に出力する。これら
を受けて、デコーダ46の11の出力が1になりセレク
タ47およびドライバ48を介してレジスタR3の内容
が読出される。
In the instruction that uses the register R3 for address calculation implicitly in the decoding / address calculation processing cycle, the portion of the opcode located in the src field is shown in FIG.
11B, SRC [1: 0] = 11 is input to the decoder 46 as shown in FIG. On the other hand, the decoding circuit 22 shown in FIG. 2 outputs RRD = 1 to the driver 48 assuming that the same instruction is an instruction that uses the register indicated in the src field for address calculation in a decoding / address calculation processing cycle. In response, the output of 11 of the decoder 46 becomes 1 and the contents of the register R3 are read via the selector 47 and the driver 48.

【0042】演算実行の処理サイクルでレジスタR3に
暗黙にデータを書込む命令では、オペコードの内のdest
のフィールドに位置する部分は図1(c)に示すように
11であり、DEST[1:0]=11が、デコーダ46に入力され
る。一方、図2の解読回路22は、同命令を演算実行の
処理サイクルでdestフィールドに示すレジスタにデータ
を書込む命令であると見なして、RWT=1をANDゲート
49に出力する。これらを受けて、デコーダ45の11
の出力が1になりANDゲート49を介してレジスタR
3に書込みクロックが加えられ書込みが行われる。
In the instruction for implicitly writing data to the register R3 in the processing cycle of the operation execution, dest in the operation code
1C is 11 as shown in FIG. 1C, and DEST [1: 0] = 11 is input to the decoder 46. On the other hand, the decoding circuit 22 in FIG. 2 regards the instruction as an instruction for writing data to the register indicated in the dest field in the processing cycle of the operation execution, and outputs RWT = 1 to the AND gate 49. In response to these, 11 of the decoder 45
Becomes 1 and the register R is output via the AND gate 49.
3, a write clock is applied to perform write.

【0043】以上のように本実施例によれば、明示的に
指定されるレジスタの読出しと書込みを行うハードウェ
アを用いることにより、従来では暗黙に指定されたレジ
スタを読出しまたは書込むことができる。従って、従来
のプロセッサに比べて、暗黙に指定されるレジスタの読
出し書込みのために専用に設けられたハードウェアの分
(図10に示すORゲート109とANDゲート11
0)だけコストと消費電力が削減される。
As described above, according to the present embodiment, by using the hardware for reading and writing the explicitly designated register, conventionally, the implicitly designated register can be read or written. . Therefore, as compared with the conventional processor, hardware dedicated to reading and writing of registers implicitly specified (OR gate 109 and AND gate 11 shown in FIG. 10) is provided.
0) reduces cost and power consumption.

【0044】また、明示的に指定されるレジスタの読出
しと書込みとに起因するレジスタ干渉を検出するハード
ウェアを用いることにより、従来では、暗黙に指定され
たレジスタの読出しと書込みとに起因するレジスタ干渉
を、検出することができる。従って、従来のプロセッサ
に比べて、暗黙に指定されるレジスタの読出しと書込み
とに起因するレジスタ干渉を検出するために専用に設け
られたハードウェアの分(図8に示す解読回路82のSP
RDとSPWTとを生成する部分とラッチ84と組合せ論理回
路86の内のORゲートと3つのANDゲート)だけコ
ストと消費電力が削減される。
Conventionally, by using hardware for detecting register interference caused by reading and writing of explicitly designated registers, conventionally, registers caused by reading and writing of implicitly designated registers are conventionally used. Interference can be detected. Therefore, as compared with the conventional processor, hardware dedicated to detecting register interference caused by reading and writing of registers implicitly designated (SP of the decoding circuit 82 shown in FIG. 8) is used.
The cost and power consumption are reduced only by the part that generates RD and SPWT, the latch 84, and the OR gate and three AND gates in the combinational logic circuit 86.

【0045】なお本実施例は、命令のフォーマットのsr
cとdestのフィールドで指定するレジスタをR0からR
3の4本とし、暗黙に指定されるレジスタをその内のR
3にしているが、これらをいかなる本数のいかなるレジ
スタにしてもよい。その際は、命令のフォーマットのsr
cとdestのフィールドをレジスタの本数に対応するビッ
ト幅(例えば、8本なら3ビット、16本なら4ビッ
ト)とし、レジスタを暗黙に読出す命令ではsrcのフィ
ールドの位置がそのレジスタの番号となるオペコード
に、レジスタに暗黙にデータを書込む命令ではdestのフ
ィールドの位置がそのレジスタの番号となるオペコード
とする。
In this embodiment, the instruction format sr
Registers specified in c and dest fields from R0 to R
3 and the register specified implicitly is R
Although three, these may be any number of any registers. In that case, the instruction format sr
The field of c and dest is set to a bit width corresponding to the number of registers (for example, 3 bits for 8 registers, 4 bits for 16 registers), and in an instruction for implicitly reading a register, the position of the src field is the register number and the register number. In an instruction that implicitly writes data to a register, the operation code is such that the position of the dest field is the register number.

【0046】また本実施例は、命令のフォーマットを2
オペランドとしているが、これを3オペランドとしても
よい。その際、レジスタを暗黙に読出す命令では、2つ
のソースオペランドを指定するフィールドのいずれか対
応する一方の位置がそのレジスタの番号となるオペコー
ドとする。また本実施例は、命令読出しと解読・アドレ
ス計算と演算実行との3ステージからなるパイプライン
構成をとるプロセッサで発生するアドレス計算ステージ
でのレジスタ読出しと演算実行ステージでのレジスタ書
込みとのレジスタ干渉を対象にしているが、このパイプ
ライン構成に限定されるものではなく、内部に有するレ
ジスタの読出しと書込みとが複数のステージで行われる
いかなるパイプライン構成にも適応できる。例えば、命
令読出しと解読とレジスタ読出しと演算実行(アドレス
計算を含むとする)との4ステージからなるパイプライ
ン構成をとるプロセッサでは、レジスタ読出しステージ
でのレジスタ読出しと演算実行ステージでのレジスタ書
込みとの間でレジスタ干渉が発生する可能性がある。そ
の際も、レジスタを暗黙に読出す命令ではsrcのフィー
ルドの位置がそのレジスタの番号となるオペコードに、
レジスタに暗黙にデータを書込む命令ではdestのフィー
ルドの位置がそのレジスタの番号となるオペコードとす
る。
In this embodiment, the format of the instruction is 2
Although the operands are used, these may be three operands. At this time, in an instruction that reads a register implicitly, one of the fields corresponding to one of the two source operand designating fields is an operation code whose number is the register number. Also, in the present embodiment, the register interference between the register read at the address calculation stage and the register write at the operation execution stage occurs in a processor having a pipeline configuration consisting of three stages of instruction reading, decoding, address calculation, and operation execution. However, the present invention is not limited to this pipeline configuration, and can be applied to any pipeline configuration in which reading and writing of an internal register are performed in a plurality of stages. For example, in a processor having a pipeline configuration including four stages of instruction reading, decoding, register reading, and operation execution (including address calculation), a register read at a register read stage and a register write at an operation execution stage are performed. May cause register interference. At that time, in the instruction that reads the register implicitly, the position of the field of src becomes the operation code whose number is the register,
For an instruction that implicitly writes data to a register, the position of the dest field is an opcode whose register number is the register number.

【0047】[0047]

【発明の効果】以上説明したように本発明によれば、専
用のハードウェアを設けることなく明示的に指定される
レジスタの読出しと書込みを行うハードウェアを用いる
ことにより、従来では暗黙に指定されたレジスタを読出
しまたは書込むことができ、従って、従来のプロセッサ
に比べて、暗黙に指定されるレジスタの読出し書込みの
ために専用に設けられたハードウェアの分(図10に示
すORゲート109とANDゲート110)だけ回路規
模と、コストと消費電力が削減される。
As described above, according to the present invention, by using the hardware for reading and writing the register explicitly specified without providing dedicated hardware, conventionally, the hardware which is implicitly specified is used. Registers can be read or written, and therefore, compared to conventional processors, hardware dedicated to reading and writing of registers implicitly specified (OR gate 109 shown in FIG. Only the AND gate 110) reduces the circuit size, cost, and power consumption.

【0048】また明示的に指定されるレジスタの読出し
と書込みとに起因するレジスタ干渉を検出するハードウ
ェアを用いることにより、暗黙に指定されるレジスタの
読出しと書込みとに起因するレジスタ干渉を検出するこ
とができるので、従来のプロセッサに比べて、暗黙に指
定されるレジスタの読出しと書込みとに起因するレジス
タ干渉を検出するために専用に設けられたハードウェア
の分(図8に示す解読回路82のSPRDとSPWTとを生成す
る部分とラッチ84と組合せ論理回路86の内のORゲ
ートと3つのANDゲート)だけコストと消費電力が削
減されハードウェアの回路規模と、コストと消費電力と
を削減することができ、その実用的効果は大きい。
Also, by using hardware for detecting register interference caused by reading and writing of explicitly designated registers, register interference caused by reading and writing of implicitly designated registers is detected. As compared with a conventional processor, hardware dedicated to detecting register interference caused by reading and writing of a register implicitly specified (decoding circuit 82 shown in FIG. 8) can be used. And the OR gate and the three AND gates of the latch 84 and the combinational logic circuit 86) that reduce the cost and power consumption, and reduce the hardware circuit scale and the cost and power consumption. The practical effect is great.

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

【図1】本発明の実施例におけるプロセッサの命令フォ
ーマットを表す説明図である。
FIG. 1 is an explanatory diagram showing an instruction format of a processor according to an embodiment of the present invention.

【図2】本実施例におけるプロセッサのレジスタ干渉検
出機構の構成図である。
FIG. 2 is a configuration diagram of a register interference detection mechanism of a processor in the present embodiment.

【図3】本実施例におけるプロセッサのレジスタ干渉検
出機構の組合せ論理回路25の真理値表を表す説明図で
ある。
FIG. 3 is an explanatory diagram showing a truth table of the combinational logic circuit 25 of the register interference detection mechanism of the processor in the embodiment.

【図4】本実施例におけるプロセッサのレジスタ読出し
書込み機構の構成図である。
FIG. 4 is a configuration diagram of a register read / write mechanism of a processor in the present embodiment.

【図5】本実施例におけるプロセッサおよび従来のプロ
セッサに共通する、プロセッサの全体の構成図を示すも
のである。
FIG. 5 shows an overall configuration diagram of a processor which is common to the processor in the present embodiment and a conventional processor.

【図6】本実施例におけるプロセッサおよび従来のプロ
セッサに共通する、プロセッサのパイプラインの各ステ
ージの処理内容の例を示す説明図である。
FIG. 6 is an explanatory diagram showing an example of processing contents of each stage of a pipeline of the processor, which is common to the processor in the present embodiment and a conventional processor.

【図7】従来のプロセッサの命令フォーマットを表す説
明図である。
FIG. 7 is an explanatory diagram showing an instruction format of a conventional processor.

【図8】従来のプロセッサのレジスタ干渉検出機構の構
成図である。
FIG. 8 is a configuration diagram of a register interference detection mechanism of a conventional processor.

【図9】従来のプロセッサのレジスタ干渉検出機構の組
合せ論理回路86の真理値表を表す説明図である。
FIG. 9 is an explanatory diagram showing a truth table of the combinational logic circuit 86 of the conventional register interference detection mechanism of the processor.

【図10】従来のプロセッサのレジスタ読出し書込み機
構の構成図である。
FIG. 10 is a configuration diagram of a register read / write mechanism of a conventional processor.

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

21 命令レジスタ 22 解読回路 23 ラッチ 24 ラッチ 25 組合せ論理回路 41 レジスタR0 42 レジスタR1 43 レジスタR2 44 レジスタR3 45 デコーダ 46 デコーダ 47 セレクタ 48 ドライバ 49 ANDゲート 50 プロセッサ 51 入出力バス 52 バスインタフェース回路 53 命令読出し回路 54 解読・アドレス計算回路 55 演算実行回路 81 命令レジスタ 82 解読回路 83 ラッチ 84 ラッチ 85 ラッチ 86 組合せ論理回路 101 レジスタR0 102 レジスタR1 103 レジスタR2 104 レジスタR3 105 デコーダ 106 デコーダ 107 セレクタ 108 ドライバ 109 ORゲート 111 ORゲート 110 ANDゲート 21 Instruction Register 22 Decoding Circuit 23 Latch 24 Latch 25 Combinational Logic Circuit 41 Register R0 42 Register R1 43 Register R2 44 Register R3 45 Decoder 46 Decoder 47 Selector 48 Driver 49 AND Gate 50 Processor 51 Input / Output Bus 52 Bus Interface Circuit 53 Instruction Read Circuit 54 Decoding / Address Calculation Circuit 55 Arithmetic Execution Circuit 81 Instruction Register 82 Decoding Circuit 83 Latch 84 Latch 85 Latch 86 Combinational Logic Circuit 101 Register R0 102 Register R1 103 Register R2 104 Register R3 105 Decoder 106 Decoder 107 Selector 108 Driver 109 OR Gate 111 OR gate 110 AND gate

Claims (12)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 複数のレジスタと、 前記複数のレジスタの一つを特定するレジスタ番号を指
定位置に明示して、当該レジスタのアクセスを行う第1
の命令コード、及び、前記複数のレジスタのうちの固有
のレジスタのアクセスを行う第2の命令コードを解読す
る命令解読手段とを備えるプロセッサであって、 前記第1の命令コードの前記指定位置に相当する前記第
2の命令コードの位置が、オペコードの一部であって、
前記固有のレジスタのレジスタ番号と同じビットパター
ンであることを特徴とするプロセッサ。
A first register that specifies a plurality of registers and a register number that specifies one of the plurality of registers at a designated position to access the register;
And an instruction decoding means for decoding a second instruction code for accessing a unique register of the plurality of registers, wherein the instruction code is located at the designated position of the first instruction code. The position of the corresponding second instruction code is a part of an operation code,
A processor having the same bit pattern as the register number of the unique register.
【請求項2】 前記命令解読手段は、前記第2の命令コ
ードを解読するとき、前記第2の命令コード中の、前記
オペコードの一部をそのまま取り出して、当該オペコー
ドの一部に基づいてアクセスすべきレジスタを選択する
ことを特徴とする請求項1記載のプロセッサ。
2. The instruction decoding means, when decoding the second instruction code, takes out a part of the operation code in the second instruction code as it is and accesses based on the part of the operation code. 2. The processor according to claim 1, wherein a register to be selected is selected.
【請求項3】 前記プロセッサは、パイプライン構造を
持つプロセッサであり、 前記命令解読手段は、前記第2の命令コードを解読する
とき、前記第2の命令コード中の、前記オペコードの一
部をそのまま取り出して、当該オペコードの一部に基づ
いて当該命令コードと他の命令コードとによるレジスタ
干渉の発生の有無を検出することを特徴とする請求項1
に記載のプロセッサ。
3. The processor according to claim 1, wherein the processor is a processor having a pipeline structure, and the instruction decoder decodes a part of the operation code in the second instruction code when decoding the second instruction code. Take out the register as it is and register it with the instruction code and other instruction codes based on a part of the operation code.
2. The method according to claim 1, wherein the presence or absence of interference is detected.
A processor according to claim 1.
【請求項4】 前記第1の命令コードは、 当該レジスタの読み出しを伴う命令である場合には、前
記レジスタ番号をソースオペランドの指定位置に明示
し、当該レジスタの書き込みを伴う命令である場合に
は、前記レジスタ番号をディスティネーションオペラン
ドの指定位置に明示し、 前記第2の命令コードが前記固有のレジスタの読み出し
を伴う命令である場合には、前記第1の命令コードの前
記ソースオペランドの指定位置に相当する前記第2の命
令コードの位置が、オペコードの一部であって、前記固
有のレジスタのレジスタ番号と同じビットパターンであ
り、 前記第2の命令コードが前記固有のレジスタの書き込み
を伴う命令である場合には、前記第1の命令コードの前
記ディスティネーションオペランドの指定位置に相当す
る前記第2の命令コードの位置が、オペコードの一部で
あって、前記固有のレジスタのレジスタ番号と同じビッ
トパターンであることを特徴とする請求項1から3のい
ずれか1項に記載のプロセッサ。
4. When the first instruction code is an instruction involving reading of the register, the register number is specified at a designated position of a source operand, and when the instruction code involves writing of the register, Specifies the register number at a designated position of a destination operand, and specifies the source operand of the first instruction code when the second instruction code is an instruction that involves reading of the unique register. The position of the second instruction code corresponding to the position is a part of an operation code, and has the same bit pattern as the register number of the unique register, and the second instruction code writes the unique register. If the instruction is an associated instruction, the first instruction code corresponds to the designated position of the destination operand. 4. The processor according to claim 1, wherein the position of the second instruction code is a part of an operation code and has the same bit pattern as the register number of the unique register.
【請求項5】 前記第2の命令コードは、スタックポイ
ンタのアクセスを指示する命令であることを特徴とする
請求項4記載のプロセッサ。
5. The processor according to claim 4, wherein said second instruction code is an instruction for instructing access of a stack pointer.
【請求項6】 命令コードを読み出して命令レジスタに
保持する命令読み出し手段と、 前記命令レジスタに保持された命令コードを直接、解読
する命令解読手段と、複数のレジスタとを備えるプロセ
ッサであって、 前記命令解読手段は、 前記複数のレジスタの一つを特定するレジスタ番号を指
定位置に明示して、当該レジスタのアクセスを行う第1
の命令コード、及び、前記複数のレジスタのうちの固有
のレジスタのアクセスを行う第2の命令コードを解読
し、 前記第1の命令コードの前記指定位置に相当する前記第
2の命令コードの位置が、オペコードの一部であって、
前記固有のレジスタのレジスタ番号と同じビットパター
ンであることを特徴とするプロセッサ。
6. A processor comprising: an instruction reading unit that reads an instruction code and holds the instruction code in an instruction register; an instruction decoding unit that directly decodes the instruction code held in the instruction register; and a plurality of registers. The instruction decoding means specifies a register number specifying one of the plurality of registers at a designated position, and performs a first access to the register.
And a second instruction code for accessing a unique register among the plurality of registers, and a position of the second instruction code corresponding to the designated position of the first instruction code Is part of the opcode,
A processor having the same bit pattern as the register number of the unique register.
【請求項7】 前記命令解読手段は、前記第2の命令コ
ードを解読するときも、前記命令レジスタに保持された
命令コード中の、前記指定位置に相当する位置にあるビ
ットパターンをそのまま取り出して、当該ビットパター
ンに基づいてアクセスすべきレジスタを選択することを
特徴とする請求項6記載のプロセッサ。
7. The instruction decoding means, when decoding the second instruction code, extracts a bit pattern at a position corresponding to the designated position in the instruction code held in the instruction register as it is. 7. The processor according to claim 6, wherein a register to be accessed is selected based on the bit pattern.
【請求項8】 前記プロセッサは、パイプライン構造を
持つプロセッサであり、 前記命令解読手段は、前記第2の命令コードを解読する
ときも、前記命令レジスタに保持された命令コード中
の、前記指定位置に相当する位置にあるビットパターン
をそのまま取り出して、当該ビットパターンに基づいて
当該命令コードと他の命令コードとによるレジスタ干渉
の発生の有無を検出することを特徴とする請求項6に記
載のプロセッサ。
8. The processor according to claim 1, wherein said processor is a processor having a pipeline structure, and said instruction decoding means, when decoding said second instruction code, outputs said instruction code in said instruction code held in said instruction register. The bit pattern at the position corresponding to the position is directly taken out, and the register interference between the instruction code and another instruction code is performed based on the bit pattern.
7. The processor according to claim 6, wherein the presence / absence of the occurrence is detected.
【請求項9】 前記第1の命令コードは、 当該レジスタの読み出しを伴う命令である場合には、前
記レジスタ番号をソースオペランドの指定位置に明示
し、当該レジスタの書き込みを伴う命令である場合に
は、前記レジスタ番号をディスティネーションオペラン
ドの指定位置に明示し、 前記命令解読手段は、 前記命令レジスタに保持された命令コード中の、前記第
1の命令コードの前記ディスティネーションオペランド
の指定位置に相当する位置にあるビットパターンを保持
する保持手段と、 前記命令レジスタに保持された新たな命令コード中の、
前記第1の命令コードの前記ソースオペランドの指定位
置に相当する位置にあるビットパターンと、前記保持手
段の保持内容とが一致しているか否かにより、2つの命
令コードが同じレジスタに同時にアクセスしようとする
かどうかを検出する一致検出手段とを備えることを特徴
とする請求項8に記載のプロセッサ。
9. When the first instruction code is an instruction accompanied by reading of the register, the register number is specified at a designated position of a source operand, and when the instruction code involves writing of the register, Specifies the register number at the designated position of the destination operand, and the instruction decoding means corresponds to the designated position of the destination operand of the first instruction code in the instruction code held in the instruction register. Holding means for holding a bit pattern at a position to be executed, and a new instruction code held in the instruction register,
The two instruction codes may access the same register at the same time, depending on whether or not the bit pattern at the position corresponding to the designated position of the source operand of the first instruction code matches the content held by the holding means. 9. The processor according to claim 8, further comprising: a coincidence detecting unit configured to detect whether or not the setting is made.
【請求項10】 複数のレジスタと、 第1、第2、第3の部分からなるとともに、少なくとも
第1の部分にはオペコードを有する命令コードを読み出
して命令レジスタに保持する命令読み出し手段と、 前記命令コードが前記複数のレジスタの一つを特定する
レジスタ番号を指定位置に明示して当該レジスタの読み
出しを伴う操作を示す場合には、前記命令レジスタに保
持された命令コードの第2の部分をソースオペランドと
なるレジスタ番号として用いることを決定し、 前記命令コードが前記複数のレジスタの一つを特定する
レジスタ番号を指定位置に明示して当該レジスタの書き
込みを伴う操作を示す場合には、前記命令レジスタに保
持された命令コードの第3の部分をディスティネーショ
ンオペランドとなるレジスタ番号として用いることを決
定し、 前記命令コードが前記命令コードの第2の部分もオペコ
ードであり、前記複数のレジスタのうち固有のレジスタ
の読み出しを伴う操作を示す場合には、前記命令レジス
タに保持された命令コードの第2の部分をソースオペラ
ンドとなるレジスタ番号として用いることを決定する命
令解読手段と、 前記命令解読手段から、実行すべき操作の内容と、ソー
スオペランドとなるレジスタ番号と、ディスティネーシ
ョンオペランドとなるレジスタ番号とを受け取って実行
する実行手段とを備えることを特徴とするプロセッサ。
10. An instruction reading means, comprising: a plurality of registers; first, second, and third parts; an instruction reading means for reading an instruction code having an operation code in at least a first part and holding the read instruction code in an instruction register; When the instruction code explicitly indicates a register number for specifying one of the plurality of registers at a designated position and indicates an operation involving reading of the register, the second part of the instruction code held in the instruction register is written. If the instruction code is determined to be used as a register number serving as a source operand, and the instruction code indicates a register number specifying one of the plurality of registers at a specified position and indicates an operation involving writing of the register, The third part of the instruction code held in the instruction register is used as a register number serving as a destination operand. When the instruction code is an operation code also in the second part of the instruction code and indicates an operation involving reading of a unique register among the plurality of registers, the instruction held in the instruction register is determined. Instruction decoding means for deciding to use the second part of the code as a register number serving as a source operand; and from the instruction decoding means, contents of an operation to be executed, a register number serving as a source operand, and a destination operand. And an execution means for receiving and executing the register number.
【請求項11】 複数のレジスタと、 第1、第2、第3の部分からなるとともに、少なくとも
第1の部分にはオペコードを有する命令コードを読み出
して命令レジスタに保持する命令読み出し手段と、 前記命令コードが前記複数のレジスタの一つを特定する
レジスタ番号を指定位置に明示して当該レジスタの読み
出しを伴う操作を示す場合には、前記命令レジスタに保
持された命令コードの第2の部分をソースオペランドと
なるレジスタ番号として用いることを決定し、 前記命令コードが前記複数のレジスタの一つを特定する
レジスタ番号を指定位置に明示して当該レジスタの書き
込みを伴う操作を示す場合には、前記命令レジスタに保
持された命令コードの第3の部分をディスティネーショ
ンオペランドとなるレジスタ番号として用いることを決
定し、 前記命令コードが前記命令コードの第3の部分もオペコ
ードであり、前記複数のレジスタのうち固有のレジスタ
の書き込みを伴う操作を示す場合には、前記命令レジス
タに保持された命令コードの第3の部分をディスティネ
ーションオペランドとなるレジスタ番号として用いるこ
とを決定する命令解読手段と、 前記命令解読手段から、実行すべき操作の内容と、ソー
スオペランドとなるレジスタ番号と、ディスティネーシ
ョンオペランドとなるレジスタ番号とを受け取って実行
する実行手段とを備えることを特徴とするプロセッサ。
11. An instruction reading means comprising: a plurality of registers; first, second, and third portions; an instruction code having an operation code in at least a first portion; and reading the instruction code in an instruction register; When the instruction code explicitly indicates a register number for specifying one of the plurality of registers at a designated position and indicates an operation involving reading of the register, the second part of the instruction code held in the instruction register is written. If the instruction code is determined to be used as a register number serving as a source operand, and the instruction code indicates a register number specifying one of the plurality of registers at a specified position and indicates an operation involving writing of the register, The third part of the instruction code held in the instruction register is used as a register number serving as a destination operand. When the instruction code is an operation code also in a third part of the instruction code and indicates an operation involving writing of a unique register among the plurality of registers, the instruction held in the instruction register is determined. Instruction decoding means for deciding to use the third part of the code as a register number serving as a destination operand; from the instruction decoding means, contents of an operation to be executed, a register number serving as a source operand, and a destination operand And an executing means for receiving and executing the register number.
【請求項12】 複数のレジスタと、 前記複数のレジスタの一つを特定するレジスタ番号を指
定位置に明示して、当該レジスタのアクセスを行う第1
の命令コード、及び、前記複数のレジスタのうちの固有
のレジスタのアクセスを行う第2の命令コードを解読
し、前記第1の命令コードの前記指定位置に相当する位
置にあって前記第2の命令コードのオペコードの一部を
なすビットパターンに基づいて前記固有のレジスタを選
択する命令解読手段とを備えることを特徴とするプロセ
ッサ。
12. A plurality of registers and a register number for specifying one of the plurality of registers are designated.
The first to access the register explicitly at the fixed position
Instruction code and a unique code among the plurality of registers.
The second instruction code that accesses the register of
And a position corresponding to the designated position of the first instruction code.
Part of the operation code of the second instruction code
The unique register is selected based on the bit pattern
Command decoding means for selecting
Ssa.
JP5285253A 1993-11-15 1993-11-15 Processor Expired - Fee Related JP2987281B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5285253A JP2987281B2 (en) 1993-11-15 1993-11-15 Processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5285253A JP2987281B2 (en) 1993-11-15 1993-11-15 Processor

Publications (2)

Publication Number Publication Date
JPH07141173A JPH07141173A (en) 1995-06-02
JP2987281B2 true JP2987281B2 (en) 1999-12-06

Family

ID=17689109

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5285253A Expired - Fee Related JP2987281B2 (en) 1993-11-15 1993-11-15 Processor

Country Status (1)

Country Link
JP (1) JP2987281B2 (en)

Also Published As

Publication number Publication date
JPH07141173A (en) 1995-06-02

Similar Documents

Publication Publication Date Title
US5499380A (en) Data processor and read control circuit, write control circuit therefor
US6055625A (en) Pipeline computer with a scoreboard control circuit to prevent interference between registers
EP0148478A2 (en) A data processor with control of the significant bit lenghts of general purpose registers
US7546442B1 (en) Fixed length memory to memory arithmetic and architecture for direct memory access using fixed length instructions
US5502827A (en) Pipelined data processor for floating point and integer operation with exception handling
EP0094535B1 (en) Pipe-line data processing system
JP2620511B2 (en) Data processor
US5859994A (en) Apparatus and method for modifying instruction length decoding in a computer processor
US6449713B1 (en) Implementation of a conditional move instruction in an out-of-order processor
EP0354740B1 (en) Data processing apparatus for performing parallel decoding and parallel execution of a variable word length instruction
US5461715A (en) Data processor capable of execution of plural instructions in parallel
JPH1165839A (en) Instruction control mechanism of processor
EP0223150B1 (en) Information processing apparatus
US20020116599A1 (en) Data processing apparatus
KR100314484B1 (en) Information processor
US5742842A (en) Data processing apparatus for executing a vector operation under control of a master processor
JP2987281B2 (en) Processor
US5293499A (en) Apparatus for executing a RISC store and RI instruction pair in two clock cycles
KR100241970B1 (en) Data processing apparatus for performing pipeline processing
US6233675B1 (en) Facility to allow fast execution of and, or, and test instructions
JP2553200B2 (en) Information processing device
KR100278136B1 (en) Data processing device and data processing method
EP0177712B1 (en) Masked data fetch and modifying device
KR20010050812A (en) A method and system for selecting and using source operands in computer system instructions
JPH0222413B2 (en)

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees