JPH0991139A - Information processor - Google Patents

Information processor

Info

Publication number
JPH0991139A
JPH0991139A JP25059795A JP25059795A JPH0991139A JP H0991139 A JPH0991139 A JP H0991139A JP 25059795 A JP25059795 A JP 25059795A JP 25059795 A JP25059795 A JP 25059795A JP H0991139 A JPH0991139 A JP H0991139A
Authority
JP
Japan
Prior art keywords
instruction
register
branch
address
branch destination
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.)
Withdrawn
Application number
JP25059795A
Other languages
Japanese (ja)
Inventor
Akihiro Nakatani
明洋 中谷
Tomonaga Itoi
朋永 糸井
Tsukasa Inoue
司 井上
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.)
Hitachi Microcomputer System Ltd
Hitachi Ltd
Hitachi Information Technology Co Ltd
Original Assignee
Hitachi Microcomputer System Ltd
Hitachi Ltd
Hitachi Information Technology 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 Hitachi Microcomputer System Ltd, Hitachi Ltd, Hitachi Information Technology Co Ltd filed Critical Hitachi Microcomputer System Ltd
Priority to JP25059795A priority Critical patent/JPH0991139A/en
Publication of JPH0991139A publication Critical patent/JPH0991139A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To increase pipe-line processing speed by selectively using either precedence operation or the preread of branching destination instruction at the time of the unused cycle of an instruction address adder. SOLUTION: When an instruction stored in an instruction register 4 for precedence instruction is an LR instruction, at an instruction address adder use method discrimination circuit 18, a value (such as a bit '1', for example) showing the preceding reading of the branching destination instruction is outputted to a line 18A but in the case of LA instruction, a value (such as a bit '0', for example) showing the precedence operation is outputted to a line 18 and applied to an adder input select signal generating circuit 17. Therefore, when the precedence instruction is the LR instruction and a following instruction is a BC instruction, the adder input select signal generating circuit 17 allows an instruction address adder 13 to execute branching destination instruction pre-reading function so that the processing of the BC instruction can be started earlier one cycle and an instruction 3 of a branching destination instruction example is put into the pipeline in the 7th cycle.

Description

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

【0001】[0001]

【発明が属する技術分野】本発明は、パイプライン方式
の情報処理装置に関し、特に、分岐命令を含む命令列を
高速に処理する情報処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pipeline type information processing apparatus, and more particularly to an information processing apparatus that processes an instruction string including branch instructions at high speed.

【0002】[0002]

【従来の技術】図2は、従来技術によるパイプライン方
式の情報処理装置を説明するブロック図、図3は、使用
される命令の例を説明する図、図4〜図7は、命令列の
パイプラインを説明するタイムチャートであり、以下、
これらの図面を参照して従来の情報処理装置について説
明する。
2. Description of the Related Art FIG. 2 is a block diagram for explaining a pipeline type information processing device according to the prior art, FIG. 3 is a diagram for explaining an example of an instruction to be used, and FIGS. It is a time chart explaining the pipeline, below,
A conventional information processing apparatus will be described with reference to these drawings.

【0003】図2において、1は命令バッファレジス
タ、2は命令切出しアライナA、3は命令切出しアライ
ナB、4は先行命令用命令レジスタ、5は後続命令用命
令レジスタ、6は先行演算可能命令検出回路、7は分岐
命令検出回路、8は汎用レジスタ、9はオペランドアド
レス加算器、10はオペランド用TLB、11はオペラ
ンドバッファ記憶装置、12は演算器、13は命令アド
レス加算器、14は命令用TLB、15は命令バッファ
記憶装置、16は先行演算結果レジスタ、17は加算器
入力セレクト信号生成回路である。
In FIG. 2, 1 is an instruction buffer register, 2 is an instruction cutout aligner A, 3 is an instruction cutout aligner B, 4 is an instruction register for a preceding instruction, 5 is an instruction register for a succeeding instruction, and 6 is an instruction capable of performing a preceding operation. Circuit, 7 branch instruction detection circuit, 8 general-purpose register, 9 operand address adder, 10 operand TLB, 11 operand buffer storage device, 12 arithmetic unit, 13 instruction address adder, 14 instruction TLB, 15 is an instruction buffer storage device, 16 is a preceding operation result register, and 17 is an adder input select signal generation circuit.

【0004】図2に示す従来の情報処理装置は、図示の
ような機能ブロックを備えて構成され、各機能ブロック
は、次に説明する機能を備えるように構成されている。
The conventional information processing apparatus shown in FIG. 2 is configured to include the functional blocks shown in the figure, and each functional block is configured to have the functions described below.

【0005】命令バッファレジスタ1は、命令の高速ア
クセスを可能とするために命令を保持しているレジスタ
であり、命令切出しアライナA2は、次に処理を開始す
べき命令を命令バッファレジスタ1から切出すための機
能を備える。命令切出しアライナB3は、命令切出しア
ライナA2で切出した命令に続く命令を切出すための機
能を備える。
The instruction buffer register 1 is a register that holds an instruction to enable high-speed access of the instruction, and the instruction cutout aligner A2 cuts the instruction buffer register 1 from which an instruction to be processed next is started. It has a function to put out. The instruction cutout aligner B3 has a function of cutting out an instruction following the instruction cut out by the instruction cutout aligner A2.

【0006】先行命令用命令レジスタ4は、命令切出し
アライナA2から供給される命令が格納されるレジスタ
である。後続命令用命令レジスタ5は、命令切出しアラ
イナB3から供給される命令が格納されるレジスタであ
る。先行演算可能命令検出回路6は、先行命令用命令レ
ジスタ4に格納された命令が、先行演算可能な命令であ
るか否かを判定する。先行演算可能な命令については後
述する。なお、各命令レジスタ内の命令は、図示しない
デコーダで解読される。
The instruction register 4 for the preceding instruction is a register for storing the instruction supplied from the instruction cutout aligner A2. The instruction register 5 for the subsequent instruction is a register in which the instruction supplied from the instruction cutout aligner B3 is stored. The preceding operation possible instruction detection circuit 6 determines whether or not the instruction stored in the instruction register 4 for the preceding instruction is an instruction capable of preceding operation. Instructions that can be calculated in advance will be described later. The instruction in each instruction register is decoded by a decoder (not shown).

【0007】分岐命令検出回路7は、後続命令用命令レ
ジスタ5に格納された命令が、分岐命令であるか否かを
検出する。加算器入力セレクト信号生成回路17は、先
行命令用命令レジスタ4に格納された命令、および、先
行演算可能命令検出回路6、分岐命令検出回路7で求め
た情報を基に、命令アドレス加算器13に入力するデー
タをセレクトする機能を備える。
The branch instruction detection circuit 7 detects whether the instruction stored in the instruction register 5 for the subsequent instruction is a branch instruction. The adder input select signal generation circuit 17 uses the instruction stored in the instruction register 4 for the preceding instruction and the information obtained by the preceding operation enable instruction detection circuit 6 and the branch instruction detection circuit 7 to add the instruction address adder 13 It has a function to select the data to be input to.

【0008】オペランドアドレス加算器9は、先行命令
用命令レジスタ4に格納された命令により、その演算内
容が決定され、例えば16本のレジスタ群で構成された
汎用レジスタ8から供給される指標または基底レジスタ
データ、または、先行命令用命令レジスタ4の一部等を
用いてオペランドの論理アドレスの計算を行う。オペラ
ンド用TLB10は、オペランドアドレス加算器9から
の論理アドレスを物理アドレスに変換する機能を備え
る。オペランドバッファ記憶装置11は、オペランド用
TLB10からの物理アドレスにより指定されるデータ
を演算器12に供給する。演算器12は、オペランドバ
ッファ記憶装置11、汎用レジスタ8から供給されるオ
ペランドデータを用いて演算を実行する機能を備える。
The operation contents of the operand address adder 9 are determined by the instruction stored in the instruction register 4 for the preceding instruction, and the index or base supplied from the general-purpose register 8 composed of, for example, 16 register groups. The logical address of the operand is calculated by using the register data or a part of the instruction register 4 for the preceding instruction. The operand TLB 10 has a function of converting the logical address from the operand address adder 9 into a physical address. The operand buffer storage device 11 supplies the data specified by the physical address from the operand TLB 10 to the arithmetic unit 12. The arithmetic unit 12 has a function of executing an arithmetic operation using the operand data supplied from the operand buffer storage device 11 and the general-purpose register 8.

【0009】命令アドレス加算器13は、先行命令用命
令レジスタ4に格納された命令が分岐命令である場合、
例えば汎用レジスタ8から供給される指標または基底レ
ジスタデータ、または、先行命令用命令レジスタ4の一
部等を用いて分岐先論理アドレスを計算する機能を備え
る。
When the instruction stored in the instruction register 4 for the preceding instruction is a branch instruction, the instruction address adder 13
For example, it has a function of calculating a branch destination logical address by using an index or base register data supplied from the general-purpose register 8 or a part of the instruction register 4 for the preceding instruction.

【0010】また、先行命令用命令レジスタ4に格納さ
れた命令が分岐命令でなく、かつ、分岐命令検出回路7
において、後続命令用命令レジスタ5に格納された命令
が分岐命令であると検出した場合、後続命令用命令レジ
スタ5に格納された分岐命令の分岐先論理アドレスを命
令アドレス加算器13で計算する機能を備える。
The instruction stored in the instruction register 4 for the preceding instruction is not a branch instruction, and the branch instruction detection circuit 7
In, when the instruction stored in the instruction register 5 for the subsequent instruction is detected to be a branch instruction, the instruction address adder 13 calculates the branch destination logical address of the branch instruction stored in the instruction register 5 for the subsequent instruction. Equipped with.

【0011】命令用TLB14は、命令アドレス加算器
13からの論理アドレスを物理アドレスに変換し、命令
バッファ記憶装置15は、命令用TLB14からの物理
アドレスにより指定される命令列を、命令バッファレジ
スタ1と先行命令用命令レジスタ4に供給する機能を備
える。
The instruction TLB 14 converts the logical address from the instruction address adder 13 into a physical address, and the instruction buffer storage device 15 stores the instruction string designated by the physical address from the instruction TLB 14 into the instruction buffer register 1. And a function for supplying to the instruction register 4 for the preceding instruction.

【0012】先行命令が分岐命令でなく、後続命令が分
岐命令であり、各命令のオペランドで指定される汎用レ
ジスタが異なるとき、先行命令と後続命令を同時にパイ
プラインに投入し、分岐命令の分岐先アドレスを命令ア
ドレス加算器13で計算する。これにより、分岐先の命
令列を、通常よりも1サイクル先に供給することができ
る。この機能を分岐先命令先行読出しという。
When the preceding instruction is not a branch instruction and the succeeding instruction is a branch instruction, and the general-purpose registers designated by the operands of the respective instructions are different, the preceding instruction and the succeeding instruction are simultaneously put into the pipeline to branch the branch instruction. The destination address is calculated by the instruction address adder 13. As a result, the instruction sequence at the branch destination can be supplied one cycle ahead of the normal sequence. This function is called branch destination instruction read-ahead.

【0013】命令アドレス加算器13の別の機能とし
て、先行演算機能を備えている。先行演算可能命令検出
回路6は、先行命令用命令レジスタ4に格納された命令
が、汎用レジスタ8のデータのみを演算に用いる命令で
あることを検出し、先行演算可能な命令であるか否かを
判定する。すなわち、先行演算可能な命令とは、演算器
12で得られる値と同じ値を、命令アドレス加算器13
で得ることが可能な命令である。
Another function of the instruction address adder 13 has a preceding operation function. The preceding operation possible instruction detection circuit 6 detects that the instruction stored in the instruction register 4 for the preceding instruction is an instruction that uses only the data of the general-purpose register 8 for the operation, and determines whether the instruction can execute the preceding operation. To judge. That is, the instruction arithmetically operable instruction has the same value as the value obtained by the arithmetic unit 12 as the instruction address adder 13
It is an instruction that can be obtained at.

【0014】先行演算可能命令検出回路6において、先
行命令用命令レジスタ4に格納された命令が、先行演算
可能な命令であることを検出すると、加算器入力セレク
ト信号生成回路17では、先行命令用命令レジスタ4に
格納された命令が必要とするデータをセレクトすべき信
号を生成する。このため、命令アドレス加算器13にお
いて、先行命令用命令レジスタ4に格納された命令の演
算結果が求まり、演算結果を先行演算結果レジスタ16
に格納する。よって、演算器12で演算して汎用レジス
タ8に格納するよりも前のサイクルで、先行演算結果レ
ジスタ16に演算結果が格納される。
When the preceding operation enabling instruction detection circuit 6 detects that the instruction stored in the instruction register 4 for the preceding instruction is an instruction capable of performing the preceding operation, the adder input select signal generation circuit 17 detects the instruction for the preceding instruction. A signal for selecting the data required by the instruction stored in the instruction register 4 is generated. Therefore, the instruction address adder 13 obtains the operation result of the instruction stored in the instruction register 4 for the preceding instruction, and the operation result is stored in the preceding operation result register 16
To be stored. Therefore, the calculation result is stored in the preceding calculation result register 16 in a cycle before the calculation by the calculator 12 and the storage in the general-purpose register 8.

【0015】その後、加算器入力信号セレクト回路17
が、後続の分岐先アドレス計算に用いるべき汎用レジス
タの番号と、先行演算結果レジスタ16に格納された演
算結果の格納先汎用レジスタ番号の一致を検出すると、
汎用レジスタ8の代わりに先行演算結果レジスタ16の
データを、命令アドレス加算器13に供給する。
After that, the adder input signal select circuit 17
Detects a match between the general-purpose register number to be used in the subsequent branch-destination address calculation and the general-purpose register number to which the operation result stored in the preceding operation result register 16 is stored,
The data of the preceding operation result register 16 instead of the general-purpose register 8 is supplied to the instruction address adder 13.

【0016】次に、前述した機能を備える情報処理装置
で使用される命令の例を、図3に示すフォーマットを使
用して説明する。
Next, an example of instructions used in the information processing apparatus having the above-mentioned functions will be described using the format shown in FIG.

【0017】L命令(ロード命令)は、第2オペランド
により指定される主記憶のデータを、第1オペランドに
より指定される汎用レジスタに転送するという命令であ
る。OPはこの命令がL命令であることを示すオペレー
ションコード、R1は前述の第1オペランドを示すフィ
ールド、X2は第2オペランドの指標アドレスレジスタ
を指定するフィールド、B2は第2オペランドの基底ア
ドレスレジスタを指定するフィールド、D2は第2オペ
ランドの変位アドレスを示すフィールドである。この命
令において、第2オペランドにより指定されるアドレス
は、X2フィールドにより指定される指標アドレスレジ
スタの内容とB2フィールドにより指定される基底アド
レスレジスタの内容とD2フィールドの内容とを加算す
ることにより得ることができる。
The L instruction (load instruction) is an instruction to transfer the data in the main memory designated by the second operand to the general-purpose register designated by the first operand. OP is an operation code indicating that this instruction is an L instruction, R1 is a field indicating the above-mentioned first operand, X2 is a field specifying the index address register of the second operand, and B2 is a base address register of the second operand. A designated field, D2, is a field indicating the displacement address of the second operand. In this instruction, the address specified by the second operand is obtained by adding the contents of the index address register specified by the X2 field, the contents of the base address register specified by the B2 field, and the contents of the D2 field. You can

【0018】LR命令(ロード・レジスタ・ツー・レジ
スタ命令)は、第2オペランドにより指定される汎用レ
ジスタの内容を第1オペランドにより指定される汎用レ
ジスタに転送する命令である。OPはこの命令がLR命
令であることを示すオペレーションコード、R1、R2
は前述の第1、第2オペランドを示すフィールドであ
る。
The LR instruction (load register-to-register instruction) is an instruction to transfer the contents of the general-purpose register specified by the second operand to the general-purpose register specified by the first operand. OP is an operation code indicating that this instruction is an LR instruction, R1, R2
Is a field indicating the above-mentioned first and second operands.

【0019】LA命令(ロードアドレス命令)は、第2
オペランドにより指定されるアドレス値を、第1オペラ
ンドにより指定される汎用レジスタに転送するという命
令である。OPはこの命令がLA命令であることを示す
オペレーションコード、R1は前述の第1オペランドを
示すフィールド、X2は第2オペランドの指標アドレス
レジスタを指定するフィールド、B2は第2オペランド
の基底アドレスレジスタを指定するフィールド、D2は
第2オペランドの変位アドレスを示すフィールドであ
る。この命令において、第2オペランドにより指定され
るアドレス値は、X2フィールドにより指定される指標
アドレスレジスタの内容とB2フィールドにより指定さ
れる基底アドレスレジスタの内容とD2フィールドの内
容とを加算することにより得ることができる。
The LA instruction (load address instruction) is the second
This is an instruction to transfer the address value specified by the operand to the general-purpose register specified by the first operand. OP is an operation code indicating that this instruction is an LA instruction, R1 is a field indicating the above-mentioned first operand, X2 is a field specifying the index address register of the second operand, and B2 is a base address register of the second operand. A designated field, D2, is a field indicating the displacement address of the second operand. In this instruction, the address value designated by the second operand is obtained by adding the contents of the index address register designated by the X2 field, the contents of the base address register designated by the B2 field, and the contents of the D2 field. be able to.

【0020】BC命令は、条件コードがマスクフィール
ドにより指定されている状態にセットされているとき
に、第2オペランドにより指定される分岐先アドレスに
分岐するという条件付分岐命令である。OPはこの命令
がBC命令であることを示すオペレーションコード、M
1はマスクフィールド、X2は第2オペランドの指標ア
ドレスレジスタを指定するフィールド、B2は第2オペ
ランドの基底アドレスレジスタを指定するフィールド、
D2は第2オペランドの変位アドレスを示すフィールド
である。
The BC instruction is a conditional branch instruction that branches to the branch destination address designated by the second operand when the condition code is set in the state designated by the mask field. OP is an operation code indicating that this instruction is a BC instruction, M
1 is a mask field, X2 is a field that specifies the index address register of the second operand, B2 is a field that specifies the base address register of the second operand,
D2 is a field indicating the displacement address of the second operand.

【0021】この命令において、第2オペランドにより
指定される分岐先アドレスは、X2フィールドにより指
定される指標アドレスレジスタの内容とB2フィールド
により指定される基底アドレスレジスタの内容とD2フ
ィールドの内容とを加算することにより得ることができ
る。M1は、BC命令実行時点におけるコンディション
コードと比較され、両者が一致すれば分岐が行われる
が、不一致ならば、BC命令の次の命令が実行される。
In this instruction, the branch destination address specified by the second operand adds the contents of the index address register specified by the X2 field, the contents of the base address register specified by the B2 field, and the contents of the D2 field. It can be obtained by M1 is compared with the condition code at the time of executing the BC instruction, and if they match, the branch is taken. If they do not match, the instruction next to the BC instruction is executed.

【0022】なお、上記した分岐命令は、条件付分岐命
令に限定されないが、ここでは、分岐命令の一例である
BC命令を例に挙げて説明する。
Although the above branch instruction is not limited to the conditional branch instruction, a BC instruction which is an example of the branch instruction will be described here as an example.

【0023】次に、図4〜図7を参照して、前述のよう
に構成される従来技術において、前述したような命令を
含む命令列を処理する場合の処理動作を説明する。これ
らの図において、上部の横軸は、パイプラインの実行サ
イクルを示している。また、図中のD、A、T、B、
L、Eはパイプラインステージを表し、それぞれ、次の
ような処理を行う。
Next, with reference to FIGS. 4 to 7, description will be given of a processing operation in the case of processing an instruction string including the above-mentioned instruction in the conventional technique configured as described above. In these figures, the upper horizontal axis indicates the pipeline execution cycle. In addition, D, A, T, B, and
L and E represent pipeline stages, and perform the following processes, respectively.

【0024】Dステージは、先行命令用命令レジスタ4
に格納された命令を解読して、Aステージで行うオペラ
ンドまたは命令アドレス生成用の汎用レジスタ8を参照
する処理を行う。
The D stage is the instruction register 4 for the preceding instruction.
The instruction stored in 1 is decoded, and the processing for referring to the general register 8 for generating an operand or instruction address performed in the A stage is performed.

【0025】Aステージは、Dステージで参照した汎用
レジスタ8の内容、先行命令用命令レジスタ4の一部を
用いて、オペランドアドレス加算器9によりオペランド
の論理アドレスを求める処理を行う。また、分岐命令の
場合、Aステージで命令アドレス加算器13により分岐
先の論理アドレスを求める処理を行う。
In the A stage, the operand address adder 9 is used to obtain the logical address of the operand using the contents of the general-purpose register 8 referred to in the D stage and a part of the instruction register 4 for the preceding instruction. In the case of a branch instruction, the instruction address adder 13 in the A stage performs a process of obtaining the logical address of the branch destination.

【0026】Tステージは、Aステージにおいて、オペ
ランドアドレス加算器9で求めたオペランドの論理アド
レスを、オペランド用TLB10によって物理アドレス
に変換する処理を行う。また、分岐命令の場合、命令ア
ドレス加算器13で求めた分岐先命令の論理アドレス
を、命令用TLB14によって物理アドレスに変換する
処理を行う。
At the T stage, the logical address of the operand obtained by the operand address adder 9 at the A stage is converted into a physical address by the TLB 10 for the operand. In the case of a branch instruction, the instruction TLB 14 converts the logical address of the branch destination instruction obtained by the instruction address adder 13 into a physical address.

【0027】Bステージは、Tステージにおいて、オペ
ランド用TLB10で求められたオペランドの物理アド
レスにより、オペランドバッファ記憶装置11を参照し
て、オペランドデータを得る処理を行う。また、分岐命
令の場合、Tステージにおいて、命令用TLB14で求
められた分岐先命令の物理アドレスにより、命令バッフ
ァ記憶装置15を参照して、分岐先の命令列を得る処理
を行う。
The B stage refers to the operand buffer storage device 11 by the physical address of the operand obtained by the TLB for operand 10 in the T stage and performs a process of obtaining operand data. Further, in the case of a branch instruction, in the T stage, a process of obtaining a branch destination instruction string is performed by referring to the instruction buffer storage device 15 with the physical address of the branch destination instruction obtained by the instruction TLB 14.

【0028】Lステージは、Bステージにおいて、オペ
ランドバッファ記憶装置11で得たオペランドデータを
演算器12に転送する。汎用レジスタ8に格納されたデ
ータをオペランドデータとして使用する命令の場合、汎
用レジスタ8の内容を演算器12に転送する処理を行
う。また、分岐命令の場合、Bステージにおいて、命令
バッファ記憶装置15から得た分岐先命令列を命令バッ
ファレジスタ1に転送する処理を行う。そして、分岐命
令の分岐が成立している場合、分岐先命令を先行命令用
命令レジスタ4に格納する。すなわち、分岐命令の分岐
が成立している場合、分岐先命令がパイプラインに投入
されDステージが開始されるのは、この分岐命令のLス
テージの次サイクルとなる。
The L stage transfers the operand data obtained in the operand buffer storage device 11 to the arithmetic unit 12 in the B stage. In the case of an instruction that uses the data stored in the general-purpose register 8 as operand data, a process of transferring the contents of the general-purpose register 8 to the arithmetic unit 12 is performed. Further, in the case of a branch instruction, in the B stage, processing of transferring the branch target instruction sequence obtained from the instruction buffer storage device 15 to the instruction buffer register 1 is performed. If the branch of the branch instruction is taken, the branch destination instruction is stored in the instruction register 4 for the preceding instruction. That is, when the branch of the branch instruction is taken, the branch destination instruction is input to the pipeline and the D stage is started in the cycle next to the L stage of this branch instruction.

【0029】Eステージは、演算器12により、先に求
めたオペランドデータを使用し、演算を実行する処理を
行う。その演算結果は命令によって、汎用レジスタ8、
または、オペランドバッファ記憶装置11に書き込まれ
る。
The E stage uses the operand data previously obtained by the arithmetic unit 12 to perform a process of executing an arithmetic operation. The operation result is a general register 8,
Alternatively, it is written in the operand buffer storage device 11.

【0030】前述した処理の各ステージは、使用される
論理の競合がなく処理できるので、これを利用した各ス
テージをオーバラップさせて処理を実行することができ
る。
Since each stage of the above-mentioned processing can be processed without conflict of the logic used, it is possible to execute the processing by overlapping each stage utilizing this.

【0031】以下に、命令アドレス加算器13の使用方
法のうち、従来の情報処理装置における分岐先命令先行
読出し機能と先行演算機能について説明する。
Of the method of using the instruction address adder 13, the branch destination instruction advance read function and the advance operation function in the conventional information processing apparatus will be described below.

【0032】(分岐先命令先行読出し機能)まず、従来
の情報処理装置で分岐先命令先行読出しを実行した場合
について説明する。図4に示すタイムチャートは、L命
令、BC命令が連続していて、L命令が変更するR1フ
ィールドで示された汎用レジスタと、BC命令のX2ま
たはB2フィールドで示された汎用レジスタが一致しな
い時で、かつ、BC命令の分岐が成立する場合のパイプ
ラインフローを示している。
(Branch Destination Instruction Preceding Read Function) First, the case where the branch destination instruction leading read is executed in the conventional information processing apparatus will be described. In the time chart shown in FIG. 4, the L instruction and the BC instruction are consecutive, and the general register indicated by the R1 field changed by the L instruction does not match the general register indicated by the X2 or B2 field of the BC instruction. The pipeline flow is shown when the branch of the BC instruction is taken at time.

【0033】図2の情報処理装置において、命令レジス
タは、先行命令用命令レジスタ4と後続命令用命令レジ
スタ5の、2命令分のレジスタを備えている。そして、
上記したように、先行するL命令は分岐命令ではなく、
かつ、先行するL命令のR1フィールドで示された汎用
レジスタ番号と、後続するBC命令のX2またはB2フ
ィールドで示された汎用レジスタ番号が一致しないの
で、分岐先命令先行読出しが可能となる。
In the information processing apparatus shown in FIG. 2, the instruction register includes two instruction registers, that is, the instruction register 4 for the preceding instruction and the instruction register 5 for the subsequent instruction. And
As mentioned above, the preceding L instruction is not a branch instruction,
Moreover, since the general-purpose register number indicated in the R1 field of the preceding L instruction and the general-purpose register number indicated in the X2 or B2 field of the following BC instruction do not match, the branch destination instruction preceding read is possible.

【0034】すなわち、図4の第2サイクルで、先行命
令用命令レジスタ4のL命令、後続命令用命令レジスタ
5のBC命令のDステージが開始される。上記した条件
にないBC命令は、これより1サイクル遅れた第3サイ
クルでDステージの処理が開始される。
That is, in the second cycle of FIG. 4, the D stage of the L instruction of the instruction register 4 for the preceding instruction and the BC instruction of the instruction register 5 for the subsequent instruction is started. For the BC instruction not satisfying the above conditions, the processing of the D stage is started in the third cycle which is delayed by one cycle.

【0035】パイプラインに投入されたL命令は、オペ
ランドアドレス加算器9に入力されてAステージの処理
が行われ、前述したように以下T、B、L、Eの処理が
行われる。一方、L命令と同時にパイプラインに投入さ
れたBC命令(分岐先命令先行読出しが可能)は、命令
アドレス加算器13に入力されて、Aステージの処理が
行われ、以下、Lステージまでの処理が行われる。な
お、加算器入力セレクト信号生成回路17は、分岐命令
検出回路7の分岐命令の検出に応じて、BC命令の分岐
先アドレスを計算するために、命令アドレス加算器13
への入力を選択制御する。
The L instruction input to the pipeline is input to the operand address adder 9 to be processed in the A stage, and as described above, the processing of T, B, L and E is performed. On the other hand, a BC instruction (preceding read of branch destination instruction is possible) input to the pipeline at the same time as the L instruction is input to the instruction address adder 13 and processed in the A stage. Is done. The adder input select signal generation circuit 17 calculates the branch destination address of the BC instruction in response to the detection of the branch instruction by the branch instruction detection circuit 7, and thus the instruction address adder 13
Selectively control input to.

【0036】上記したように、BC命令(分岐先命令先
行読出し)が第2サイクルから開始できるので、BC命
令の分岐先命令である命令3は、第7サイクルからパイ
プラインに投入され、通常のBC命令に比べて1サイク
ル早くパイプラインに投入されることになる。
As described above, since the BC instruction (branch destination instruction read-ahead) can be started from the second cycle, the branch destination instruction of the BC instruction, instruction 3, is input to the pipeline from the seventh cycle, and the normal operation is performed. It is inserted into the pipeline one cycle earlier than the BC instruction.

【0037】このように、上記した分岐先命令先行読出
し機能の起動条件は、先行命令用命令レジスタ4に格納
された命令が分岐命令でなく、後続命令用命令レジスタ
5に格納された命令が分岐命令のときである。
As described above, the activation condition of the branch destination instruction preceding read function is that the instruction stored in the instruction register 4 for the preceding instruction is not the branch instruction but the instruction stored in the instruction register 5 for the subsequent instruction branches. It is time to order.

【0038】(先行演算機能)先行演算が可能なケース
と不可能なケースとを対比するため、まず先行演算が不
可能なケースを説明する。
(Preceding Calculation Function) In order to compare the case where the preceding calculation is possible and the case where the preceding calculation is not possible, first, the case where the preceding calculation is impossible will be described.

【0039】図5に示すタイムチャートは、L命令、B
C命令が連続していて、L命令が変更するR1フィール
ドで示された汎用レジスタと、BC命令のX2またはB
2フィールドで示された汎用レジスタが一致し、かつ、
BC命令の分岐が成立する場合のパイプラインフローを
示している。
The time chart shown in FIG. 5 shows the L instruction and the B instruction.
The C instruction is continuous and the L instruction changes the general-purpose register indicated by the R1 field and the BC instruction X2 or B.
General-purpose registers indicated by 2 fields match, and
The pipeline flow when a branch of a BC instruction is taken is shown.

【0040】L命令は、第2オペランドにより指定され
る主記憶のデータを第1オペランドで指定される汎用レ
ジスタに書き込む。書き込むデータは、第7サイクルの
Eステージにおいて求めた結果を、第8サイクルで汎用
レジスタ8に転送し、第9サイクルで汎用レジスタ8に
書き込まれる。BC命令は、第3サイクルにパイプライ
ンに投入されるが、L命令の汎用レジスタへの書き込み
が完了するまで、分岐先アドレスを計算できない。この
ため、BC命令の分岐先アドレス計算は第10サイクル
で実行可能になる。その後、分岐先命令の命令3が第1
4サイクルからパイプラインに投入される。
The L instruction writes the data in the main memory designated by the second operand into the general-purpose register designated by the first operand. As the data to be written, the result obtained in the E stage of the seventh cycle is transferred to the general-purpose register 8 in the eighth cycle, and is written in the general-purpose register 8 in the ninth cycle. Although the BC instruction is input to the pipeline in the third cycle, the branch destination address cannot be calculated until the writing of the L instruction to the general register is completed. Therefore, the branch destination address calculation of the BC instruction can be executed in the 10th cycle. After that, the instruction 3 of the branch destination instruction is the first
It is put into the pipeline from 4 cycles.

【0041】先行演算が可能なケースは次のようにな
る。図6は、図5に示した命令列のうちL命令をLA命
令に変更したもので、命令アドレス加算器13で先行演
算を実行した場合のパイプラインフローを示している。
The case where the preceding calculation is possible is as follows. FIG. 6 shows a pipeline flow when the L instruction is changed to the LA instruction in the instruction sequence shown in FIG. 5, and the instruction address adder 13 executes the preceding operation.

【0042】LA命令は、第2オペランドにより指定さ
れるアドレス値を第1オペランドで指定される汎用レジ
スタに書き込む命令で、L命令とは異なり主記憶のデー
タを必要としないため、命令アドレス加算器13で先行
演算の処理が可能である。この処理は、第3サイクルで
命令アドレス加算器13によるLA命令の第2オペラン
ドの演算結果を得て、先行演算結果レジスタ16に格納
される。
The LA instruction is an instruction for writing the address value designated by the second operand to the general-purpose register designated by the first operand, and unlike the L instruction, it does not require the data in the main memory, so that the instruction address adder is used. In 13, it is possible to process the preceding calculation. In this process, the operation result of the second operand of the LA instruction by the instruction address adder 13 is obtained in the third cycle and stored in the preceding operation result register 16.

【0043】第4サイクルにおいて、加算器入力セレク
ト信号生成回路17が、BC命令の分岐先アドレス計算
に用いるべき汎用レジスタの番号と、先行演算結果レジ
スタ16に格納された演算結果の格納先汎用レジスタ番
号の一致を検出すると、汎用レジスタ8の代わりに先行
演算結果レジスタ16のデータをセレクトするように制
御し、命令アドレス加算器13に供給し、BC命令の分
岐先アドレス計算が可能となる。分岐先命令の命令3は
第8サイクルからパイプラインに投入される。
In the fourth cycle, the adder input select signal generation circuit 17 stores the general-purpose register number to be used for the calculation of the branch destination address of the BC instruction and the general-purpose storage destination register of the operation result stored in the preceding operation result register 16. When the coincidence of the numbers is detected, the data of the preceding operation result register 16 is controlled to be selected instead of the general-purpose register 8 and is supplied to the instruction address adder 13 so that the branch destination address of the BC instruction can be calculated. Instruction 3 of the branch destination instruction is input to the pipeline from the eighth cycle.

【0044】図5と図6を比較すると、図6の先行演算
機能によって5サイクルのオーバヘッドが削減されるこ
とがわかる。上記した先行演算機能の起動条件は、先行
命令用命令レジスタ4に格納された命令が分岐命令でな
く、主記憶装置のデータを必要としない命令のときであ
る。後続命令用命令レジスタ5に格納された命令が分岐
命令でない場合は、先行演算機能を起動して問題ない。
しかし、図6で説明した命令列のように後続命令が分岐
命令のときは、前述した分岐先命令先行読出し機能の起
動条件と競合することになる。そして、起動条件が競合
したとき、従来の情報処理装置では、図6に示したよう
に、先行演算機能を実行するように制御していた。
Comparing FIG. 5 and FIG. 6, it can be seen that the preceding operation function of FIG. 6 reduces the overhead of 5 cycles. The activation condition of the preceding operation function described above is when the instruction stored in the instruction register 4 for the preceding instruction is not a branch instruction and does not require the data in the main storage device. When the instruction stored in the instruction register 5 for the subsequent instruction is not a branch instruction, the preceding operation function is activated and there is no problem.
However, when the subsequent instruction is a branch instruction as in the instruction sequence described in FIG. 6, it conflicts with the activation condition of the branch destination instruction preceding read function described above. Then, when the activation conditions conflict, the conventional information processing apparatus controls to execute the preceding calculation function, as shown in FIG.

【0045】図7に示すタイムチャートは、LR命令、
BC命令が連続していて、LR命令が変更するR1フィ
ールドで示された汎用レジスタと、BC命令のX2また
はB2フィールドで示された汎用レジスタが一致せず、
かつ、BC命令の分岐が成立する場合のパイプラインフ
ローを示している。
The time chart shown in FIG. 7 shows the LR instruction,
When the BC instruction is continuous and the general register indicated by the R1 field changed by the LR instruction does not match the general register indicated by the X2 or B2 field of the BC instruction,
Moreover, the pipeline flow when the branch of the BC instruction is taken is shown.

【0046】図7の第2サイクルで先行命令用命令レジ
スタ4にLR命令が、第3サイクルで後続命令用命令レ
ジスタ5にBC命令が格納されている。先行するLR命
令は、分岐命令ではなく主記憶装置のデータを必要とし
ない命令であるので、先行するLR命令のR1フィール
ドで示された汎用レジスタと、後続するBC命令のX2
またはB2フィールドで示された汎用レジスタの一致に
関係なく、先行演算機能を実行するように制御してい
た。
In the second cycle of FIG. 7, the LR instruction is stored in the instruction register 4 for the preceding instruction, and the BC instruction is stored in the instruction register 5 for the subsequent instruction in the third cycle. Since the preceding LR instruction is not a branch instruction and does not require the data in the main storage device, the general register indicated by the R1 field of the preceding LR instruction and the following BC instruction X2.
Alternatively, the preceding operation function is controlled regardless of whether the general-purpose register indicated by the B2 field matches.

【0047】従って、BC命令の分岐先命令の命令列読
出しは、上記した図4のように第2サイクルから開始さ
れず、第3サイクルから開始され(つまり、分岐先命令
先行読み出しが行われない)、BC命令の分岐先命令で
ある命令3は、第8サイクルからパイプラインに投入さ
れることになる。
Therefore, the instruction string read of the branch destination instruction of the BC instruction is not started from the second cycle as shown in FIG. 4 described above, but is started from the third cycle (that is, the branch destination instruction preceding read is not performed. ), The instruction 3 which is the branch destination instruction of the BC instruction is input to the pipeline from the eighth cycle.

【0048】なお、上記した従来技術は、例えば、特開
昭62−262141号公報および特開昭63−195
736号公報に記載されている。
The above-mentioned conventional techniques are disclosed, for example, in Japanese Patent Laid-Open Nos. 62-262141 and 63-195.
No. 736.

【0049】[0049]

【発明が解決しようとする課題】上記したように先行演
算機能を実行しても、先行するLR命令のR1フィール
ドで示された汎用レジスタと、後続するBC命令のX2
またはB2フィールドで示された汎用レジスタが一致し
ていないときは、先行演算機能の効果がない。このよう
な場合には、分岐先命令先行読出し機能を実行した方が
性能が向上するが、従来の情報処理装置では、分岐先命
令先行読出し機能を起動できず、図7に示したパイプラ
インフローとなり、パイプラインの処理速度を向上させ
ることができないという問題があった。
Even if the preceding operation function is executed as described above, the general-purpose register indicated by the R1 field of the preceding LR instruction and the following X2 of the BC instruction.
Alternatively, when the general-purpose registers indicated by the B2 field do not match, the preceding operation function has no effect. In such a case, the performance is improved by executing the branch target instruction advance read function, but the conventional information processing device cannot activate the branch target instruction advance read function, and the pipeline flow shown in FIG. Therefore, there is a problem that the processing speed of the pipeline cannot be improved.

【0050】本発明の目的は、命令アドレス加算器の未
使用サイクル時に、先行演算または分岐先命令先行読み
出しの何れかを選択して使用することにより、パイプラ
インの処理速度を向上させた情報処理装置を提供するこ
とにある。
An object of the present invention is to perform information processing in which the processing speed of a pipeline is improved by selecting and using either a preceding operation or a branch destination instruction preceding read in an unused cycle of the instruction address adder. To provide a device.

【0051】[0051]

【課題を解決するための手段】前記目的を達成するため
に、本発明では、メモリから逐次読出される命令列を一
時的に保持する命令バッファ手段と、該命令バッファ手
段から命令を逐次取出してパイプライン処理を起動する
第1の命令取出し手段と、該第1の命令取出し手段によ
り取出される命令に後続する命令を前記命令バッファ手
段から取出す第2の命令取出し手段と、分岐先アドレス
を求めるための分岐先アドレス加算手段と、該分岐先ア
ドレス加算手段で演算した結果を保持し前記分岐先アド
レス加算手段に供給する手段と、前記第1の命令取出し
手段によって取出された命令が先行演算可能な命令であ
ることを検出する手段と、前記第2の命令取出し手段に
よって取出された命令が分岐命令であることを検出する
手段と、前記第2の命令取出し手段によって取出された
分岐命令の処理の少なくとも一部の処理が、先行する命
令のパイプライン処理と並行して実行される手段とを備
えたパイプライン方式の情報処理装置において、前記第
1の命令取出し手段によって取出された命令が主記憶の
データを使用しない第1の命令であり、前記第2の命令
取出し手段によって取出された命令が分岐命令であると
き、前記分岐先アドレス加算手段に対して、分岐先命令
先行読み出しを指示し、前記第1の命令取出し手段によ
って取出された命令が主記憶のデータを使用しない第2
の命令であり、前記第2の命令取出し手段によって取出
された命令が分岐命令であるとき、前記分岐先アドレス
加算手段に対して、先行演算を指示する手段を設けたこ
とを特徴としている。
In order to achieve the above object, according to the present invention, an instruction buffer means for temporarily holding an instruction sequence sequentially read from a memory, and an instruction fetched sequentially from the instruction buffer means. First instruction fetching means for activating a pipeline process, second instruction fetching means for fetching an instruction following the instruction fetched by the first instruction fetching means from the instruction buffer means, and a branch destination address A branch destination address adding means, a means for holding a result calculated by the branch destination address adding means and supplying the result to the branch destination address adding means, and an instruction fetched by the first instruction fetching means can be pre-calculated. A second instruction, a means for detecting that the instruction fetched by the second instruction fetching means is a branch instruction, and a second instruction In the pipeline type information processing apparatus, a means for executing at least a part of the processing of the branch instruction fetched by the instruction fetching means in parallel with the pipeline processing of the preceding instruction, When the instruction fetched by the instruction fetching means is a first instruction that does not use data in the main memory and the instruction fetched by the second instruction fetching means is a branch instruction, the branch destination address adding means On the other hand, a second instruction that instructs the branch destination instruction read-ahead and the instruction fetched by the first instruction fetching means does not use the data in the main memory.
When the instruction fetched by the second instruction fetching means is a branch instruction, the branch destination address adding means is provided with means for instructing a preceding operation.

【0052】上記したように、命令アドレス計算用の加
算器の主たる機能は、先行命令が分岐命令のとき、分岐
先アドレスを計算することである。しかし、この機能の
みでは命令アドレス計算用の加算器は、先行命令が分岐
命令以外のとき使用されない状態となる。命令アドレス
加算器使用方法判定回路は、連続した2命令の先行命令
が分岐命令でなく、後続命令が分岐命令であることを検
出して、または、先行命令が変更する汎用レジスタと後
続命令が使用する汎用レジスタが一致することを検出し
て、先行演算機能または分岐先命令先行読出し機能の一
方を選択する。これにより、命令アドレス計算用の加算
器を有効に利用することができ、命令列の処理時間を短
縮できる。
As described above, the main function of the adder for calculating the instruction address is to calculate the branch destination address when the preceding instruction is a branch instruction. However, with this function alone, the adder for calculating the instruction address is not used when the preceding instruction is other than the branch instruction. The instruction address adder usage determination circuit detects that the preceding two consecutive instructions are not branch instructions and the subsequent instructions are branch instructions, or the general instructions and the subsequent instructions that the preceding instructions change are used. It is detected that the general-purpose registers are matched, and one of the preceding operation function and the branch destination instruction preceding read function is selected. As a result, the adder for calculating the instruction address can be effectively used, and the processing time of the instruction sequence can be shortened.

【0053】[0053]

【発明の実施の形態】以下、本発明の一実施例を図面を
用いて具体的に説明する。図1は、本発明の実施例に係
るパイプライン方式の情報処理装置の構成を示す。図8
は、本発明のパイプラインフローを説明する図である。
図1において、18は、本発明によって設けられた命令
アドレス加算器使用方法判定回路である。他の構成要素
は図2のものと同一であるので、その説明を省略する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be specifically described below with reference to the drawings. FIG. 1 shows the configuration of a pipeline type information processing apparatus according to an embodiment of the present invention. FIG.
FIG. 6 is a diagram illustrating a pipeline flow of the present invention.
In FIG. 1, reference numeral 18 is an instruction address adder use method determination circuit provided by the present invention. The other constituent elements are the same as those in FIG. 2, and therefore their explanations are omitted.

【0054】命令アドレス加算器使用方法判定回路18
の一方の入力には、先行命令用命令レジスタ4の出力が
接続され、他方の入力には、後続命令用命令レジスタ5
の出力が接続され、判定回路18の出力18Aが加算器
入力セレクト信号生成回路17に入力されている。本発
明によって設けられた命令アドレス加算器使用方法判定
回路18は、先行命令用命令レジスタ4と後続命令用命
令レジスタ5を基に、命令アドレス加算器13で計算す
る内容を決定する回路である。
Instruction address adder usage decision circuit 18
One of the inputs is connected to the output of the instruction register 4 for the preceding instruction, and the other input is connected to the instruction register 5 for the subsequent instruction.
Are connected to each other, and the output 18A of the determination circuit 18 is input to the adder input select signal generation circuit 17. The instruction address adder usage determination circuit 18 provided by the present invention is a circuit that determines the contents to be calculated by the instruction address adder 13 based on the instruction register 4 for the preceding instruction and the instruction register 5 for the subsequent instruction.

【0055】また、命令アドレス加算器使用方法判定回
路18には、先行命令用命令レジスタ4に格納された先
行命令の命令コードを解読する回路が設けられ、図3で
示したLR命令、LA命令等を認識し、この認識された
命令コードによって命令アドレス加算器の使用方法を判
定する論理回路も設けられている。
Further, the instruction address adder usage determination circuit 18 is provided with a circuit for decoding the instruction code of the preceding instruction stored in the instruction register 4 for the preceding instruction, and the LR instruction and LA instruction shown in FIG. Etc., and a logic circuit for deciding the usage of the instruction address adder based on the recognized instruction code is also provided.

【0056】前述したように、命令アドレス加算器入力
セレクト信号生成回路17は、先行演算機能と分岐先命
令先行読出し機能の起動条件のうち、一方の条件のみ成
立した場合に、その成立した条件の計算を命令アドレス
加算器13で行うように制御するものである。
As described above, when the instruction address adder input select signal generating circuit 17 satisfies only one of the starting conditions of the preceding operation function and the branch destination instruction preceding read function, the condition is satisfied. The instruction address adder 13 controls the calculation.

【0057】本発明は、先行演算機能の起動条件と分岐
先命令先行読出し機能の起動条件の両者が成立した場合
における、命令アドレス加算器13の使用方法の判定回
路を備えたことを特徴とするものであって、以下に、そ
の使用方法の判定について説明する。
The present invention is characterized in that it is provided with a judging circuit for determining how to use the instruction address adder 13 when both the starting condition of the preceding operation function and the starting condition of the branch destination instruction preceding read function are satisfied. The determination of the method of use will be described below.

【0058】先行演算と分岐先命令先行読出しの両者の
起動条件が成立したとき、従来技術では前述したとお
り、命令の内容に関係なく先行演算を実行していた。こ
のため、先行命令が変更した汎用レジスタを、後続の分
岐命令のアドレス計算に使用しない場合でも、分岐先命
令先行読出しを行わないことから、図7のタイムチャー
トに示すように処理時間の短縮を図ることができないこ
とは前述した通りである。
When the activation conditions for both the preceding operation and the preceding read of the branch destination instruction are satisfied, the prior art executes the preceding operation regardless of the contents of the instruction, as described above. Therefore, even if the general-purpose register changed by the preceding instruction is not used for the address calculation of the subsequent branch instruction, the branch destination instruction precedent reading is not performed, so that the processing time can be shortened as shown in the time chart of FIG. What cannot be achieved is as described above.

【0059】ところで、一般の命令列において、LR命
令が変更する汎用レジスタR1と、LR命令に続く分岐
命令の分岐先アドレス計算に使用する汎用レジスタX2
またはB2が競合することは少ない。これに対し、LA
命令が変更する汎用レジスタR1は、分岐命令の分岐先
アドレス計算に使用する汎用レジスタX2またはB2と
一致する場合が多い。
By the way, in the general instruction sequence, the general-purpose register R1 changed by the LR instruction and the general-purpose register X2 used for calculating the branch destination address of the branch instruction following the LR instruction.
Or B2 rarely competes. On the other hand, LA
The general-purpose register R1 changed by the instruction often coincides with the general-purpose register X2 or B2 used for calculating the branch destination address of the branch instruction.

【0060】本発明はこの点に着目し、先行命令用命令
レジスタ4に格納された命令がLR命令で、後続命令用
命令レジスタ5に格納された命令が分岐命令であって、
先行演算と分岐先命令先行読出しの両者の起動条件が成
立したときは、図8に示すように分岐先命令先行読出し
を実行する。また、先行命令用命令レジスタ4に格納さ
れた命令がLA命令で、後続命令用命令レジスタ5に格
納された命令が分岐命令であるときは、図6に示すよう
に先行演算を実行する。
The present invention pays attention to this point, and the instruction stored in the instruction register 4 for the preceding instruction is the LR instruction, and the instruction stored in the instruction register 5 for the subsequent instruction is the branch instruction.
When the activation conditions for both the preceding operation and the branch destination instruction read-ahead are satisfied, the branch destination instruction read-ahead is executed as shown in FIG. When the instruction stored in the instruction register 4 for the preceding instruction is the LA instruction and the instruction stored in the instruction register 5 for the subsequent instruction is the branch instruction, the preceding operation is executed as shown in FIG.

【0061】すなわち、命令アドレス加算器使用方法判
定回路18では、先行命令用命令レジスタ4に格納され
た命令がLR命令の場合は、分岐先命令先行読出しを示
す値(例えばビット1)をライン18Aに出力し、LA
命令の場合は先行演算を示す値(例えばビット0)をラ
イン18Aに出力し、加算器入力セレクト信号生成回路
17に与える。従って、先行命令がLR命令で、後続命
令がBC命令であるとき、加算器入力セレクト信号生成
回路17は、命令アドレス加算器13を分岐先命令先行
読み出し機能として実行させるので、図8に示すよう
に、BC命令の処理が1サイクル速く開始され、その分
岐先命令列である命令3が第7サイクルでパイプライン
に投入される。
That is, in the instruction address adder usage determining circuit 18, when the instruction stored in the instruction register 4 for the preceding instruction is the LR instruction, the value (for example, bit 1) indicating the branch destination instruction preceding reading is given to the line 18A. Output to LA
In the case of an instruction, a value indicating the preceding operation (for example, bit 0) is output to the line 18A and given to the adder input select signal generation circuit 17. Therefore, when the preceding instruction is the LR instruction and the subsequent instruction is the BC instruction, the adder input select signal generation circuit 17 causes the instruction address adder 13 to execute as the branch destination instruction preceding read function, and therefore, as shown in FIG. In addition, the processing of the BC instruction is started one cycle earlier, and the branch destination instruction sequence, instruction 3, is input to the pipeline in the seventh cycle.

【0062】このように、本実施例では、先行演算と分
岐先命令先行読出しの成立条件の両者が成立した場合
に、命令アドレス加算器を有効に利用することができ、
情報処理装置の処理速度を向上させることができる。
As described above, in the present embodiment, the instruction address adder can be effectively used when both the preceding operation and the branch destination instruction preceding read are satisfied.
The processing speed of the information processing device can be improved.

【0063】ところで、LR命令、BC命令が連続する
ケースにおいて、LR命令が変更する汎用レジスタR1
と、BC命令の分岐先アドレス計算に使用する汎用レジ
スタX2またはB2が衝突することがある。このような
ケースでは、分岐先命令先行読出しを実行しようとする
が、LR命令が変更する汎用レジスタR1が求まるまで
分岐先アドレスを計算することができない。この場合の
タイムチャートは、図5のL命令をLR命令に置き換え
たものと同じになる。
By the way, in the case where the LR instruction and the BC instruction are consecutive, the general-purpose register R1 changed by the LR instruction
And the general-purpose register X2 or B2 used for calculating the branch destination address of the BC instruction may collide. In such a case, the branch-destination instruction read-ahead is executed, but the branch-destination address cannot be calculated until the general-purpose register R1 to be changed by the LR instruction is obtained. The time chart in this case is the same as that in which the L instruction in FIG. 5 is replaced with the LR instruction.

【0064】また、LA命令、BC命令が連続するケー
スにおいて、LA命令が変更する汎用レジスタR1と、
BC命令の分岐先アドレス計算に使用する汎用レジスタ
X2またはB2が一致しない場合もある。このようなケ
ースでは、先行演算を実行しLA命令の結果が先行演算
結果レジスタに書き込まれるが、LA命令が変更する汎
用レジスタR1を分岐先アドレスの計算に使用しない。
この場合のタイムチャートは図6と同じになり、汎用レ
ジスタの衝突があるなしに係らず同じになってしまう。
Further, in the case where the LA instruction and the BC instruction are consecutive, the general-purpose register R1 changed by the LA instruction,
The general-purpose register X2 or B2 used for calculating the branch destination address of the BC instruction may not match. In such a case, the preceding operation is executed and the result of the LA instruction is written in the preceding operation result register, but the general-purpose register R1 changed by the LA instruction is not used for calculating the branch destination address.
The time chart in this case is the same as that in FIG. 6, and is the same regardless of the collision of general-purpose registers.

【0065】そこで、命令アドレス加算器の使用方法を
決定する他の実施例を説明する。命令アドレス加算器使
用方法判定回路18において、先行命令用命令レジスタ
4に格納された命令が変更する汎用レジスタの番号と、
後続命令用命令レジスタ5に格納された後続分岐命令の
アドレス計算に使用する汎用レジスタの番号が一致して
いるか否か検出する。命令アドレス加算器使用方法判定
回路18は、加算器入力セレクト信号生成回路17に対
して、汎用レジスタの番号が一致している場合は、先行
演算機能の実行を出力信号18A(例えばビット1)で
報告し、また汎用レジスタの番号が一致していない場合
は、分岐先命令先行読出し機能の実行を出力信号18A
(例えばビット0)で報告する。
Therefore, another embodiment for determining how to use the instruction address adder will be described. In the instruction address adder usage determination circuit 18, the number of the general-purpose register changed by the instruction stored in the instruction register 4 for the preceding instruction,
It is detected whether or not the numbers of the general-purpose registers used for the address calculation of the subsequent branch instruction stored in the instruction register 5 for the subsequent instruction match. The instruction address adder usage determination circuit 18 uses the output signal 18A (for example, bit 1) to execute the preceding arithmetic function when the number of the general-purpose register matches the adder input select signal generation circuit 17. If it is reported and the numbers of the general-purpose registers do not match, the execution of the branch destination instruction preceding read function is output signal 18A.
(For example, bit 0).

【0066】先行演算機能を実行する場合は、図6に示
したタイムチャートのようになり、命令0の次命令はL
A命令に限らず、LR命令等でも同じタイムチャートに
なる。図5の先行演算を実行しない場合に比べて、分岐
先命令の命令3が、6サイクル早くパイプラインに投入
される。
When the preceding operation function is executed, the time chart shown in FIG. 6 is obtained, and the instruction following the instruction 0 is L
Not only the A instruction but also the LR instruction and the like have the same time chart. As compared with the case where the preceding operation in FIG. 5 is not executed, the branch destination instruction, instruction 3, is inserted into the pipeline 6 cycles earlier.

【0067】一方、分岐先命令先行読出し機能を実行す
る場合は、図8に示したタイムチャートのようになり、
命令0の次命令はLR命令に限らず、LA命令等でも同
じタイムチャートになる。図7の分岐先命令先行読出し
を実行しない場合に比べて、分岐先命令の命令3が、1
サイクル早くパイプラインに投入される。この結果、本
実施例では命令アドレス加算器が有効に利用され、情報
処理装置の処理速度を向上させることができる。
On the other hand, when executing the branch destination instruction read-ahead function, the time chart shown in FIG.
The instruction following the instruction 0 is not limited to the LR instruction, but the LA instruction or the like has the same time chart. As compared to the case where the branch destination instruction read-ahead in FIG. 7 is not executed, the instruction 3 of the branch destination instruction is 1
It is put into the pipeline early in the cycle. As a result, in this embodiment, the instruction address adder is effectively used, and the processing speed of the information processing device can be improved.

【0068】[0068]

【発明の効果】以上、説明したように、本発明によれ
ば、命令アドレス加算器の使用方法を制御することによ
って、命令が変更する汎用レジスタの番号とアドレス計
算に必要な汎用レジスタの番号が一致したときのアドレ
ス計算オーバヘッド、または、汎用レジスタ番号が一致
しないときの分岐先命令読出しのオーバヘッドを削減で
き、情報処理装置の処理速度の向上を図ることができ
る。
As described above, according to the present invention, by controlling the method of using the instruction address adder, the number of the general-purpose register to be changed by the instruction and the number of the general-purpose register necessary for the address calculation are determined. It is possible to reduce the address calculation overhead when the addresses match or the overhead of reading the branch destination instruction when the general-purpose register numbers do not match, and to improve the processing speed of the information processing device.

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

【図1】本発明の実施例に係るパイプライン方式の情報
処理装置の構成を示す。
FIG. 1 shows the configuration of a pipeline type information processing apparatus according to an embodiment of the present invention.

【図2】従来の情報処理装置の構成を示す。FIG. 2 shows a configuration of a conventional information processing device.

【図3】使用される命令の例を示す。FIG. 3 shows an example of instructions used.

【図4】従来技術における、命令アドレス加算器で実行
する分岐先命令先行読み出しのパイプラインフローを説
明する図である。
FIG. 4 is a diagram for explaining a pipeline flow of a branch destination instruction preceding read executed by an instruction address adder in the related art.

【図5】従来技術における、命令アドレス加算器で先行
演算を実行できない場合のパイプラインフローを説明す
る図である。
FIG. 5 is a diagram for explaining a pipeline flow in the case where the instruction address adder cannot execute the preceding operation in the related art.

【図6】従来技術における、命令アドレス加算器で先行
演算を実行できる場合のパイプラインフローを説明する
図である。
FIG. 6 is a diagram for explaining a pipeline flow in the case where an instruction address adder can execute a preceding operation in the conventional technique.

【図7】従来技術における、命令アドレス加算器で先行
演算機能と分岐先命令先行読出し機能の起動条件が競合
した場合のパイプラインフローを説明する図である。
FIG. 7 is a diagram for explaining a pipeline flow in the case where the start condition of the preceding operation function and the branch destination instruction preceding read function compete in the instruction address adder in the prior art.

【図8】本発明のパイプラインフローを説明する図であ
る。
FIG. 8 is a diagram illustrating a pipeline flow of the present invention.

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

1 命令バッファレジスタ 2 命令切出しアライナA 3 命令切出しアライナB 4 先行命令用命令レジスタ 5 後続命令用命令レジスタ 6 先行演算可能命令検出回路 7 分岐命令検出回路 8 汎用レジスタ 9 オペランドアドレス加算器 10 オペランド用TLB 11 オペランドバッファ記憶装置 12 演算器 13 命令アドレス加算器 14 命令用TLB 15 命令バッファ記憶装置 16 先行演算結果レジスタ 17 加算器入力セレクト信号生成回路 18 命令アドレス加算器使用方法判定回路 1 instruction buffer register 2 instruction cutout aligner A 3 instruction cutout aligner B 4 instruction register for preceding instruction 5 instruction register for subsequent instruction 6 instruction calculation circuit for preceding instruction 7 branch instruction detection circuit 8 general-purpose register 9 operand address adder 10 TLB for operand 11 Operand Buffer Storage Device 12 Operation Unit 13 Instruction Address Adder 14 Instruction TLB 15 Instruction Buffer Storage Device 16 Preceding Operation Result Register 17 Adder Input Select Signal Generation Circuit 18 Instruction Address Adder Usage Determination Circuit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 中谷 明洋 東京都小平市上水本町5丁目22番1号 株 式会社日立マイコンシステム内 (72)発明者 糸井 朋永 神奈川県秦野市堀山下1番地 株式会社日 立製作所汎用コンピュータ事業部内 (72)発明者 井上 司 神奈川県秦野市堀山下1番地 株式会社日 立コンピュータエレクトロニクス内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Akihiro Nakatani 5-22-1 Kamisuihoncho, Kodaira-shi, Tokyo Inside Hitachi Microcomputer System Co., Ltd. (72) Inventor Tsukasa Inoue 1 Horiyamashita, Horiyamashita, Hadano-shi, Kanagawa

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 メモリから逐次読出される命令列を一時
的に保持する命令バッファ手段と、該命令バッファ手段
から命令を逐次取出してパイプライン処理を起動する第
1の命令取出し手段と、該第1の命令取出し手段により
取出される命令に後続する命令を前記命令バッファ手段
から取出す第2の命令取出し手段と、分岐先アドレスを
求めるための分岐先アドレス加算手段と、該分岐先アド
レス加算手段で演算した結果を保持し前記分岐先アドレ
ス加算手段に供給する手段と、前記第1の命令取出し手
段によって取出された命令が先行演算可能な命令である
ことを検出する手段と、前記第2の命令取出し手段によ
って取出された命令が分岐命令であることを検出する手
段と、前記第2の命令取出し手段によって取出された分
岐命令の処理の少なくとも一部の処理が、先行する命令
のパイプライン処理と並行して実行される手段とを備え
たパイプライン方式の情報処理装置において、前記第1
の命令取出し手段によって取出された命令が主記憶のデ
ータを使用しない第1の命令であり、前記第2の命令取
出し手段によって取出された命令が分岐命令であると
き、前記分岐先アドレス加算手段に対して、分岐先命令
先行読み出しを指示し、前記第1の命令取出し手段によ
って取出された命令が主記憶のデータを使用しない第2
の命令であり、前記第2の命令取出し手段によって取出
された命令が分岐命令であるとき、前記分岐先アドレス
加算手段に対して、先行演算を指示する手段を設けたこ
とを特徴とする情報処理装置。
1. An instruction buffer means for temporarily holding an instruction sequence sequentially read from a memory, a first instruction fetch means for fetching instructions from the instruction buffer means and activating pipeline processing, and a first instruction fetch means. A second instruction fetching means for fetching an instruction following the instruction fetched by the first instruction fetching means from the instruction buffer means, a branch destination address adding means for obtaining a branch destination address, and the branch destination address adding means. A means for holding the operation result and supplying it to the branch destination address adding means, a means for detecting that the instruction fetched by the first instruction fetching means is a precalculable instruction, and a second instruction Means for detecting that the instruction fetched by the fetching means is a branch instruction, and less processing of the branch instruction fetched by the second instruction fetching means. In the pipeline type information processing apparatus, at least a part of the processing includes means for executing the pipeline processing of the preceding instruction in parallel.
When the instruction fetched by the instruction fetching means is a first instruction that does not use data in the main memory and the instruction fetched by the second instruction fetching means is a branch instruction, the branch destination address adding means On the other hand, a second instruction that instructs the branch destination instruction read-ahead and the instruction fetched by the first instruction fetching means does not use the data in the main memory.
And the instruction fetched by the second instruction fetching means is a branch instruction, the branch destination address adding means is provided with means for instructing a preceding operation. apparatus.
JP25059795A 1995-09-28 1995-09-28 Information processor Withdrawn JPH0991139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25059795A JPH0991139A (en) 1995-09-28 1995-09-28 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25059795A JPH0991139A (en) 1995-09-28 1995-09-28 Information processor

Publications (1)

Publication Number Publication Date
JPH0991139A true JPH0991139A (en) 1997-04-04

Family

ID=17210253

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25059795A Withdrawn JPH0991139A (en) 1995-09-28 1995-09-28 Information processor

Country Status (1)

Country Link
JP (1) JPH0991139A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009104614A (en) * 2008-11-25 2009-05-14 Renesas Technology Corp Information processor
US8578135B2 (en) 2004-01-29 2013-11-05 Renesas Electronics Corporation Apparatus for calculating and prefetching a branch target address
US10162631B2 (en) 2016-10-28 2018-12-25 Sanken Electric Co., Ltd. Micro controller unit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8578135B2 (en) 2004-01-29 2013-11-05 Renesas Electronics Corporation Apparatus for calculating and prefetching a branch target address
JP2009104614A (en) * 2008-11-25 2009-05-14 Renesas Technology Corp Information processor
US10162631B2 (en) 2016-10-28 2018-12-25 Sanken Electric Co., Ltd. Micro controller unit

Similar Documents

Publication Publication Date Title
JP2559399B2 (en) Information processing device
JP2000222206A (en) Data processor
JPS63136138A (en) Information processor
KR100259306B1 (en) Data processor having a branch command buffer
EP0093430B1 (en) Pipeline data processing system
EP0094535B1 (en) Pipe-line data processing system
US6055628A (en) Microprocessor with a nestable delayed branch instruction without branch related pipeline interlocks
JPH0743648B2 (en) Information processing equipment
JP2580396B2 (en) Branch instruction control method in pipeline
JPH0991139A (en) Information processor
JPH04321130A (en) Branch estimating device
JPH06168263A (en) Vector processor
JP2591325B2 (en) Branch control device
JP3493110B2 (en) High-speed branch processing unit
JPH06131180A (en) Instruction processing system and instruction processor
JP3954159B2 (en) Synchronous RAM access control circuit, data processor and control method thereof
JP2819733B2 (en) Information processing device
JP2924735B2 (en) Pipeline operation device and decoder device
JPH09274566A (en) Information processor
JP3525985B2 (en) Central processing unit
JPH02206836A (en) Data processor
JPH0619705A (en) Pipeline control system
JPH06332701A (en) Information processor
JPH06314196A (en) Method and device for processing information
JPH10283182A (en) Pipeline information processor

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20021203