JP2793342B2 - Arithmetic processing unit - Google Patents

Arithmetic processing unit

Info

Publication number
JP2793342B2
JP2793342B2 JP2209098A JP20909890A JP2793342B2 JP 2793342 B2 JP2793342 B2 JP 2793342B2 JP 2209098 A JP2209098 A JP 2209098A JP 20909890 A JP20909890 A JP 20909890A JP 2793342 B2 JP2793342 B2 JP 2793342B2
Authority
JP
Japan
Prior art keywords
condition
condition code
branch
instruction
pipeline processing
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
JP2209098A
Other languages
Japanese (ja)
Other versions
JPH0496133A (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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2209098A priority Critical patent/JP2793342B2/en
Publication of JPH0496133A publication Critical patent/JPH0496133A/en
Application granted granted Critical
Publication of JP2793342B2 publication Critical patent/JP2793342B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) この発明は、並列に動作可能な複数のパイプライン処
理機構を備えた演算処理装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Industrial application field) The present invention relates to an arithmetic processing device provided with a plurality of pipeline processing mechanisms that can operate in parallel.

(従来の技術) 近年、命令を処理するパイプライン処理機構をn個
(nは2以上の整数)備え、このn個のパイプライン処
理機構を用いて1つのロートモジュールの命令ストリー
ムから命令をn個ずつ並列に実行していく演算処理装置
が開発されている。この種の演算処理装置(並列演算処
理装置)は、1サイクルにn個の命令を実行できること
から、高い処理性能を実現できるものである。
(Prior Art) In recent years, there are provided n (n is an integer of 2 or more) pipeline processing mechanisms for processing instructions, and the n pipeline processing mechanisms are used to convert instructions from an instruction stream of one load module into n. Arithmetic processing units that execute the programs one by one in parallel have been developed. This type of arithmetic processing device (parallel arithmetic processing device) can execute n instructions in one cycle, and thus can achieve high processing performance.

さて、演算処理装置では、条件分岐のための条件を表
わすコード(条件コード)を保持するのに用いられる条
件コードレジスタが必要となる。従来、この条件コード
レジスタは、上記したn個のパイプライン処理機構を持
つ演算処理装置では、PSW(プログラムステータスワー
ド)レジスタの一部を割当てることで実現されていた。
即ち条件コードレジスタは1つであった。この条件コー
ドレジスタへの条件コード設定は、n個のパイプライン
処理機構で並列に実行されているn個の命令のいずれか
によって指定される。条件分岐は、条件コードレジスタ
に設定された条件コードに従って処理される。
The arithmetic processing unit requires a condition code register used to hold a code (condition code) representing a condition for conditional branching. Conventionally, this condition code register has been realized by allocating a part of a PSW (program status word) register in an arithmetic processing device having the above-mentioned n pipeline processing mechanisms.
That is, there was one condition code register. The setting of the condition code in the condition code register is specified by one of n instructions executed in parallel by the n pipeline processing mechanisms. The conditional branch is processed according to the condition code set in the condition code register.

これに対し、条件コードレジスタを持たないで、演算
結果の条件コードを汎用レジスタに格納する演算処理装
置も知られている。このような演算処理装置では、条件
分岐命令は、命令語中で指定されるか或は予め定められ
ている所定の番号の汎用レジスタに格納された条件コー
ドに従って処理される。
On the other hand, there is also known an arithmetic processing device which does not have a condition code register but stores a condition code of an operation result in a general-purpose register. In such an arithmetic processing unit, a conditional branch instruction is processed in accordance with a condition code specified in an instruction word or stored in a general-purpose register having a predetermined number.

(発明が解決しようとする課題) 上記したように並列に動作可能なn個(n≧2)のパ
イプライン処理機構を備えた従来の演算処理装置では、
条件コードレジスタは1つであり、したがって同時に処
理されるn個の命令のうちで条件コードが設定できる命
令の個数は1つに制限されていた。即ち、n個の命令を
並列に実行でき、且つそれぞれが条件コードを生成でき
るものであっても、条件コードとして利用できるものは
1つに限られていた。このため、複数の条件により分岐
するには、各サイクル毎にそれぞれ1つの条件による分
岐を繰返す必要があり、n個のパイプライン処理機構を
効率的に使用できないという問題があった。
(Problems to be Solved by the Invention) As described above, in a conventional arithmetic processing device having n (n ≧ 2) pipeline processing mechanisms operable in parallel,
There is only one condition code register, and therefore, the number of instructions for which a condition code can be set is limited to one out of n instructions processed simultaneously. That is, even if n instructions can be executed in parallel and each can generate a condition code, only one can be used as a condition code. Therefore, in order to branch under a plurality of conditions, it is necessary to repeat branching under one condition for each cycle, and there is a problem that n pipeline processing mechanisms cannot be used efficiently.

一方、条件コードレジスタを持たないで、汎用レジス
タに条件コードを格納する方式の従来の演算処理装置で
は、条件コードを格納する汎用レジスタをパイプライン
処理機構毎に違えることによって、n個の条件コードを
同時に設定することが可能となる。しかしながら、条件
分岐命令で参照されるレジスタは、命令語中で或いは予
め(暗黙的に)1つに指定されているので、たとえ複数
の条件生成を並列して行えたとしても、それらの条件を
組合せた条件による分岐を行うには、上記した1つの条
件コードレジスタを持つ演算処理装置の場合と同様に条
件分岐を繰返す必要があった。
On the other hand, in a conventional arithmetic processing device in which a condition code is stored in a general-purpose register without having a condition code register, a general-purpose register for storing a condition code is different for each pipeline processing mechanism, whereby n condition codes are stored. Can be set at the same time. However, since the registers referred to by the conditional branch instruction are specified as one in the instruction word or in advance (implicitly), even if a plurality of condition generations can be performed in parallel, the conditions are not changed. In order to perform the branch based on the combined condition, it is necessary to repeat the conditional branch as in the case of the arithmetic processing device having one condition code register described above.

この発明は上記事情に鑑みてなされたものでその目的
は、命令を処理するパイプライン処理機構をn個(nは
2以上の整数)備え、このn個のパイプライン処理機構
を用いて1つの命令ストリームから命令をn個ずつ並列
に実行していく演算処理装置において、各パイプライン
処理機構で並列に条件コードを生成すると共に、この生
成された各条件コードをまとめた1つの複合条件コード
を生成することができ、この複合条件コードに従って処
理を選択することにより、複合条件による条件処理を高
速に行えるようにすることにある。
SUMMARY OF THE INVENTION The present invention has been made in view of the above circumstances, and has as its object to provide n (n is an integer of 2 or more) pipeline processing mechanisms for processing instructions, and to provide one pipeline processing mechanism using the n pipeline processing mechanisms. In an arithmetic processing unit that executes n instructions in parallel from an instruction stream, a condition code is generated in parallel by each pipeline processing mechanism, and one composite condition code obtained by combining the generated condition codes is obtained. An object of the present invention is to make it possible to perform condition processing based on a complex condition at high speed by selecting a process according to the complex condition code.

[発明の構成] (課題を解決するための手段) この発明の第1の観点に係る構成は、命令を処理する
パイプライン処理機構をn個(nは2以上の整数)備
え、このn個のパイプライン処理機構を用いて1つの命
令ストリームから命令をn個ずつ並列に実行していく演
算処理装置において、各パイプライン処理機構毎に設け
られ、対応するパイプライン処理機構で生成される条件
コードを保持するための条件コードレジスタと、次のよ
うな複合条件生成手段、即ち上記n個のパイプライン処
理機構の1つで、当該各パイプライン処理機構毎の上記
条件コードレジスタにそれぞれ保持されている各条件コ
ードに対して行うべき論理演算の共通の条件を指定する
共通指定ビットデータを含み、上記各条件コードをまと
めて1つの複合条件コードを生成するための分岐条件を
有する条件分岐命令が実行された場合、上記各パイプラ
イン処理機構毎の条件コードレジスタにそれぞれ保持さ
れている各条件コードに対して上記条件分岐命令の分岐
条件に含まれている上記共通指定ビットデータに応じた
共通の論理演算を行い、その論理演算後の各条件コード
を、当該条件分岐命令の分岐条件の他のビットデータに
応じてまとめて1つの複合条件コードを生成する複合条
件生成手段とを設け、条件分岐命令を実行中のパイプラ
イン処理機構では、上記複合条件生成手段によって生成
された複合条件コードに従って分岐成立/不成立の判定
を行うことを特徴とする。
[Configuration of the Invention] (Means for Solving the Problems) A configuration according to a first aspect of the present invention includes n pipeline processing mechanisms (n is an integer of 2 or more) for processing instructions, and the n pipeline processing mechanisms are provided. In an arithmetic processing unit that executes n instructions from one instruction stream in parallel using one pipeline processing mechanism, a condition provided for each pipeline processing mechanism and generated by the corresponding pipeline processing mechanism A condition code register for holding a code, and one of the following complex condition generating means, that is, one of the n pipeline processing mechanisms, which is stored in the condition code register for each of the pipeline processing mechanisms. Includes common specification bit data for specifying a common condition of a logical operation to be performed on each condition code, and combines the above condition codes into one composite condition code. When a conditional branch instruction having a branch condition to execute is executed, each condition code held in the condition code register of each pipeline processing mechanism is included in the branch condition of the conditional branch instruction. A common logical operation corresponding to the common designation bit data is performed, and each condition code after the logical operation is grouped according to other bit data of the branch condition of the conditional branch instruction to form one composite condition code. A composite condition generating means for generating the condition is provided, and the pipeline processing mechanism executing the conditional branch instruction determines whether the branch is taken / not taken according to the compound condition code generated by the compound condition generating means.

この発明の第2の観点に係る構成は、上記第1の観点
に係る構成で適用される条件分岐命令に代えて、上記各
パイプライン処理機構毎の条件コードレジスタにそれぞ
れ保持されている各条件コードに対して行うべき論理演
算の条件を個々に指定する個別指定ビットデータを含
み、各条件コードをまとめて1つの複合条件コードを生
成するための分岐条件を有する条件分岐命令を用い、上
記n個のパイプライン処理機構の1つで条件分岐命令が
実行される場合、上記複合条件生成手段では、上記各パ
イプライン処理機構毎の条件コードレジスタにそれぞれ
保持されている各条件コードに対して上記条件分岐命令
の分岐条件に含まれている上記個別指定ビットデータに
応じた独立した論理演算を行い、その論理演算後の各条
件コードを、当該条件分岐命令の分岐条件の他のビット
データに応じてまとめて1つの複合条件コードを生成す
るようにしたことを特徴とする。
According to a second aspect of the present invention, there is provided a configuration according to the first aspect, wherein the conditional branch instruction applied in the configuration according to the first aspect is replaced by a condition code stored in a condition code register for each pipeline processing mechanism. A conditional branch instruction including individually designated bit data for individually designating conditions of a logical operation to be performed on the code, and having a branch condition for generating one composite condition code by combining the condition codes; When the conditional branch instruction is executed by one of the pipeline processing mechanisms, the complex condition generating means performs the above-described processing on each condition code held in the condition code register for each of the pipeline processing mechanisms. Performs an independent logical operation according to the individually specified bit data included in the branch condition of the conditional branch instruction, and replaces each condition code after the logical operation with the condition code. Characterized in that so as generate a single composite condition codes are summarized in accordance with the other bit data of 岐命 old branch condition.

(作用) この発明によれば、n個のパイプライン処理機構に、
それぞれ条件コード生成が可能な命令語がフェッチさ
れ、各命令語が並列に実行されると、各パイプライン処
理機構でそれぞれ条件コードが生成される。各パイプラ
イン処理機構で並列に生成された条件コードは対応する
条件コードレジスタに設定される。各条件コードレジス
タに設定された条件コードは複合条件生成手段に供給さ
れる。この複合条件生成手段は、n個のパイプライン処
理機構のいずれか1つ(例えば先頭のパイプライン処理
機構)にフェッチされた条件分岐命令(の分岐条件フィ
ールド)に設定されている分岐条件中の共通指定ビット
データ(または個別指定ビットデータ)の指定する条件
に従って、上記各条件コードレジスタに設定された条件
コードに対して共通の論理演算(または独立した論理演
算)を行い、その論理演算後の各条件コードを、当該条
件分岐命令の分岐条件中の他のビットデータに応じてま
とめて1つの複合条件コードを生成する。そして、この
複合条件コードに従って上記の条件分岐命令がパイプラ
イン処理機構で実行されることにより、複合条件による
条件処理が効率的に行われる。
(Operation) According to the present invention, the n pipeline processing mechanisms include:
When an instruction word capable of generating a condition code is fetched and each instruction word is executed in parallel, a condition code is generated by each pipeline processing mechanism. Condition codes generated in parallel by each pipeline processing mechanism are set in corresponding condition code registers. The condition code set in each condition code register is supplied to the complex condition generating means. The complex condition generating means is configured to execute a branch condition set in (a branch condition field of) a conditional branch instruction fetched by any one of the n pipeline processing mechanisms (for example, the first pipeline processing mechanism). A common logical operation (or an independent logical operation) is performed on the condition code set in each of the condition code registers according to the condition specified by the common specified bit data (or the individually specified bit data), and the logical operation after the logical operation is performed. Each condition code is grouped according to other bit data in the branch condition of the conditional branch instruction to generate one composite condition code. Then, the conditional branch instruction is executed by the pipeline processing mechanism in accordance with the composite condition code, so that the conditional processing based on the composite condition is efficiently performed.

(実施例) 第1図はこの発明の一実施例に係る演算処理装置のブ
ロック構成図である。同図において、11は図示せぬ主記
憶から先取りされた命令ストリームが格納される命令バ
ッファ、命令バッファ11に格納されている命令ストリー
ムをn命令、例えば4命令ずつ並列に実行するための命
令処理機構である。命令処理機構12は、命令処理をそれ
ぞれパイプライン方式で行う4つのパイプライン処理機
構(以下、単にパイプラインと称する)13−1(#
1),13−2(#2),13−3(#3),13−4(#4)
を有している。14−1〜14−4はパイプライン13−1〜
13−4の演算結果を一時保持するための結果レジスタ
(R)、15−1〜15−4はパイプライン13−1〜13−4
で生成された条件コードを保持するための条件コードレ
ジスタである。この条件コードは、演算結果が0よりも
大きい場合に真となるGビットと、0より小さい場合に
真となるLビットから成る。16は結果レジスタ14−1〜
14−4に保持されているパイプライン13−1〜13−4の
演算結果の格納等に用いられるレジスタファイル、17は
条件コードレジスタ15−1〜15−4に保持されている条
件コードを、例えばパイプライン13−1で実行される条
件分岐命令中の分岐条件BCに従ってまとめ、1つの条件
コード(以下、複合条件コードと称する)を新たに生成
する複合条件生成回路である。分岐命令は、この複合条
件生成回路17で生成された複合条件コードに従ってパイ
プライン13−1にて実行される。
(Embodiment) FIG. 1 is a block diagram of an arithmetic processing unit according to an embodiment of the present invention. In the figure, reference numeral 11 denotes an instruction buffer in which an instruction stream prefetched from a main memory (not shown) is stored, and instruction processing for executing n instructions, for example, four instructions in parallel, in the instruction stream stored in the instruction buffer 11 Mechanism. The instruction processing mechanism 12 has four pipeline processing mechanisms (hereinafter, simply referred to as pipelines) 13-1 (#
1), 13-2 (# 2), 13-3 (# 3), 13-4 (# 4)
have. 14-1 to 14-4 are pipelines 13-1 to
Result register (R) for temporarily holding the operation result of 13-4, 15-1 to 15-4 are pipelines 13-1 to 13-4
Is a condition code register for holding the condition code generated in step (1). This condition code includes G bits that are true when the operation result is larger than 0, and L bits that are true when the operation result is smaller than 0. 16 is the result register 14-1
A register file used for storing the operation results of the pipelines 13-1 to 13-4 held in 14-4, and 17 is a condition code held in the condition code registers 15-1 to 15-4. For example, it is a composite condition generation circuit that collects according to a branch condition BC in a conditional branch instruction executed in the pipeline 13-1, and newly generates one condition code (hereinafter, referred to as a composite condition code). The branch instruction is executed in the pipeline 13-1 according to the complex condition code generated by the complex condition generation circuit 17.

第2図は複合条件の指定が可能な条件分岐命令のフォ
ーマットを示す。第2図に示す条件分岐命令は、条件分
岐命令であることを指定するための命令コードOPと、分
岐条件BCと、条件成立時の分岐先を指定するための分岐
先アドレスBAとを有している。分岐条件BCは、ビットb0
〜b9の10ビットから成る。b0は条件コードレジスタ15−
1〜15−4のGビットをマスク(選択)することを共通
に指定するビット(MGビット)、b1は条件コードレジス
タ15−1〜15−4のLビットをマスクすることを共通に
指定するビット(MLビット)として、それぞれ用いられ
る。b2はマスク後のG,Lビットをパイプライン別に1ビ
ットにまとめるための演算(ANDまたはOR演算)を共通
に指定するビット(A/Oビット)、b3はビットb2の指定
でパイプライン別にまとめられたビットのレベル反転を
共通に指定するビット(Nビット)として、それぞれ用
いられる。b4〜b7はビットb3の指定で処理されたパイプ
ライン13−1〜13−4別のビットをマスクすることを指
定するビット(M1〜M4ビット)、b8はパイプライン別の
マスク後の各ビットを1ビットにまとめるための演算
(ANDまたOR演算)を指定するビット(A/Oビット)、b9
はビットb8の指定でまとめられたビットのレベル反転を
指定するビット(Nビット)として、それぞれ用いられ
る。
FIG. 2 shows a format of a conditional branch instruction capable of specifying a complex condition. The conditional branch instruction shown in FIG. 2 has an instruction code OP for designating a conditional branch instruction, a branch condition BC, and a branch destination address BA for designating a branch destination when the condition is satisfied. ing. The branch condition BC is determined by the bit b0
It consists of 10 bits of ~ b9. b0 is the condition code register 15−
A bit (MG bit) commonly specifying masking (selection) of G bits 1 to 15-4, and b1 commonly specifying masking of L bits of condition code registers 15-1 to 15-4. Each bit is used as a bit (ML bit). b2 is a bit (A / O bit) that commonly specifies an operation (AND or OR operation) to combine the masked G and L bits into one bit for each pipeline, and b3 is a bit for each pipeline by specifying bit b2 These bits are used as bits (N bits) commonly specifying the level inversion of the given bit. b4 to b7 are bits (M1 to M4 bits) for specifying masking of another bit of the pipeline 13-1 to 13-4 processed by the specification of the bit b3, and b8 is each bit after masking for each pipeline (A / O bit) that specifies the operation (AND or OR operation) to combine the data into one bit, b9
Are used as bits (N bits) for designating the level inversion of the bits combined by the designation of the bit b8.

第3図は複合条件生成回路17の内部構成を示す。第3
図に示す複合条件生成回路17は、条件コードレジスタ15
−1〜15−4のGビットを第2図に示す条件分岐命令中
の分岐条件BCのビットb0(MGビット)によってマスク
(選択)するANDゲート31−1〜31−4と、条件コード
レジスタ15−1〜15−4のLビットを第2図に示す分岐
条件BCのビットb1(MLビット)によってマスクするAND
ゲート32−1〜32−4と、AND/OR回路33−1〜33−4と
を有している。AND/OR回路33−i(i=1〜4)は(パ
イプライン13−iに対応する)ANDゲート31−i,32−i
の出力ビット間のANDまたはOR演算を第2図に示す分岐
条件BCのビットb2(A/Oビット)に応じて行うものであ
る。第3図の複合条件生成回路17はまた、AND/OR回路33
−1〜33−4の出力ビットを第2図に示す分岐条件BCの
ビットb3(Nビット)に応じて反転するEXORゲート(排
他的論理和ゲート)34−1〜34−4と、EXORゲート34−
1〜34−4の出力ビットを第2図に示す分岐条件BCのビ
ットb4〜b7(M1〜M4ビット)に応じてマスクするANDゲ
ート35−1〜35−4とを有している。第3図の複合条件
生成回路17は更に、ANDゲート35−1〜35−4の出力ビ
ット間のANDまたはOR演算を第2図に示す分岐条件BCの
ビットb8(A/Oビット)に応じて行って1ビットにまと
めるAND/OR回路36と、AND/OR回路36の出力ビットを第2
図に示す分岐条件BCのビットb9(Nビット)に応じて反
転するEXORゲート37とを有している。このEXORゲート37
の出力が複合条件ゴードとしてパイプライン13−1に供
給される。
FIG. 3 shows the internal configuration of the complex condition generation circuit 17. Third
The complex condition generation circuit 17 shown in the figure
AND gates 31-1 to 31-4 for masking (selecting) the G bits -1 to 15-4 with bit b0 (MG bit) of the branch condition BC in the conditional branch instruction shown in FIG. 2, and a condition code register AND masking L bits 15-1 to 15-4 with bit b1 (ML bit) of branch condition BC shown in FIG.
It has gates 32-1 to 32-4 and AND / OR circuits 33-1 to 33-4. AND / OR circuits 33-i (i = 1 to 4) are AND gates 31-i and 32-i (corresponding to the pipeline 13-i).
AND or OR operation between the output bits is performed according to the bit b2 (A / O bit) of the branch condition BC shown in FIG. The composite condition generating circuit 17 of FIG.
EXOR gates (exclusive OR gates) 34-1 to 34-4 for inverting output bits -1 to 33-4 in accordance with the bit b3 (N bit) of the branch condition BC shown in FIG. 2, and an EXOR gate 34−
AND gates 35-1 to 35-4 for masking output bits 1 to 34-4 in accordance with bits b4 to b7 (M1 to M4 bits) of the branch condition BC shown in FIG. The complex condition generation circuit 17 of FIG. 3 further performs an AND or OR operation between the output bits of the AND gates 35-1 to 35-4 according to the bit b8 (A / O bit) of the branch condition BC shown in FIG. And an output bit of the AND / OR circuit 36 to be combined into one bit.
It has an EXOR gate 37 that inverts according to the bit b9 (N bits) of the branch condition BC shown in the figure. This EXOR gate 37
Is supplied to the pipeline 13-1 as a complex condition card.

次に、この発明の一実施例の動作を説明する。 Next, the operation of the embodiment of the present invention will be described.

まず、命令バッファ11に先読みされている命令ストリ
ームから条件コードが生成可能な例えば4つの比較命令
が命令処理機構12に取出され、それぞれ命令処理機構12
内のパイプライン13−1〜13−4に取込まれたものとす
る。これにより各パイプライン13−1〜13−4は自パイ
プラインに取込まれた比較命令をそれぞれ並列に実行
し、その比較結果に応じてG,Lの2ビットから成る条件
コードを生成する。パイプライン13−1〜13−4によっ
て生成された条件コードは、それぞれ対応する条件コー
ドレジスタ15−1〜15−4に保持される。条件コードレ
ジスタ15−1〜15−4に保持された条件コードは複合条
件生成回路17に供給される。
First, for example, four comparison instructions capable of generating a condition code from the instruction stream prefetched in the instruction buffer 11 are taken out by the instruction processing unit 12, and each of the comparison instructions is extracted by the instruction processing unit 12.
Inside the pipelines 13-1 to 13-4. As a result, each of the pipelines 13-1 to 13-4 executes the comparison instruction taken into its own pipeline in parallel, and generates a condition code consisting of two bits of G and L according to the comparison result. The condition codes generated by the pipelines 13-1 to 13-4 are held in corresponding condition code registers 15-1 to 15-4, respectively. The condition codes held in the condition code registers 15-1 to 15-4 are supplied to the complex condition generation circuit 17.

さて、パイプライン13−1〜13−4での比較命令処理
は、命令デコード、オペランドフェッチ、演算、(レジ
スタファイル16への)結果書込みの各ステージから成る
パイプライン処理で行われる。この比較命令のデコード
ステージが終了した際に、第2図に示す条件分岐命令を
先頭とする4つの命令(ここでは、後続の3命令がノー
オペレション命令であるものとする)が命令バッファ11
から命令処理機構12に取出されたものとする。この先頭
の条件分岐命令はパイプライン13−1に取込まれ、残り
の3命令はそれぞれ対応するパイプライン13−2〜13−
4に取込まれる。これりより各パイプライン13−1〜13
−4では、比較命令のオペランドフェッチステージが行
われると共に、後続命令のデコードステージが行われ
る。ここでパイプライン13−1での条件分岐命令処理
は、命令デコード、オペランドフェッチ、分岐先アドレ
スBAに基づく分岐先アドレス計算ステージ、分岐先命令
取出しステージの各ステージから成るパイプライン処理
で行われる。したがって、パイプライン13−1〜13−4
において比較命令の演算ステージが終了し、同ステージ
で生成された条件コードが上記の如く対応する条件コー
ドーレジスタ15−1〜15−4に保持されると、パイプラ
イン13−1では後続の条件分岐命令のアドレス計算ステ
ージが開始される。
The comparison instruction processing in the pipelines 13-1 to 13-4 is performed by pipeline processing including each stage of instruction decoding, operand fetch, operation, and result writing (to the register file 16). When the decode stage of the comparison instruction is completed, four instructions starting with the conditional branch instruction shown in FIG. 2 (here, the following three instructions are assumed to be no operation instructions) are stored in the instruction buffer 11.
To the instruction processing mechanism 12. The first conditional branch instruction is taken into the pipeline 13-1, and the remaining three instructions are respectively assigned to the corresponding pipelines 13-2 to 13-13.
It is taken into 4. From this, each pipeline 13-1 to 13-13
At -4, the operand fetch stage of the comparison instruction is performed, and the decoding stage of the subsequent instruction is performed. Here, the conditional branch instruction processing in the pipeline 13-1 is performed by pipeline processing including an instruction decode, an operand fetch, a branch destination address calculation stage based on the branch destination address BA, and a branch destination instruction fetch stage. Therefore, pipelines 13-1 to 13-4
When the operation stage of the comparison instruction is completed and the condition code generated in the stage is held in the corresponding condition code registers 15-1 to 15-4 as described above, the pipeline 13-1 executes the subsequent conditional branch. The instruction address calculation stage is started.

条件分岐命令処理のアドレス計算ステージでは、分岐
先アドレスの計算と共に、以下に述べるように複合条件
生成回路17を用いた複合条件コードの生成が行われる。
まず条件分岐命令処理のアドレス計算ステージでは、条
件分岐命令中の分岐条件BC(第2図参照)がパイプライ
ン13−1から複合条件生成回路17に供給される。この複
合条件生成回路17には、条件コードレジスタ15−1〜15
−4の保持内容、即ち先行する比較命令の比較結果に応
じた各条件コードも供給される。複合条件生成回路17
は、条件コードレジスタ15−1〜15−4に保持されてい
る各条件コードに、パイプライン13−1から与えられる
分岐条件BCに伴う演算を施し(第3図参照)、1つの複
合条件コード(ここでは1ビット)にまとめる。この複
合条件コードはパイプライン13−1に供給され、アドレ
ス計算ステージが終了する。
In the address calculation stage of the conditional branch instruction processing, the calculation of the branch destination address and the generation of a complex condition code using the complex condition generation circuit 17 are performed as described below.
First, in the address calculation stage of the conditional branch instruction processing, the branch condition BC (see FIG. 2) in the conditional branch instruction is supplied from the pipeline 13-1 to the complex condition generation circuit 17. The complex condition generation circuit 17 includes condition code registers 15-1 to 15-15.
-4, that is, each condition code corresponding to the comparison result of the preceding comparison instruction is also supplied. Complex condition generation circuit 17
Performs an operation associated with the branch condition BC provided from the pipeline 13-1 on each condition code held in the condition code registers 15-1 to 15-4 (see FIG. 3). (Here, 1 bit). This composite condition code is supplied to the pipeline 13-1, and the address calculation stage ends.

パイプライン13−1では、条件分岐命令処理のアドレ
ス計算ステージが終了すると、分岐先命令取出しステー
ジが開始される。この分岐先命令取出しステージでは、
複合条件生成回路17から供給される複合条件コードに従
って分岐成立/不成立の判定が行われ、分岐成立であれ
ば分岐先命令を先頭とする4命令の取出しが行われる。
したがって本実施例によれば、例えばA>B且つC>D
且つE>F且つG>Hといった複数の条件が成立した場
合の分岐処理を1回の条件分岐で実行することができ
る。
In the pipeline 13-1, when the address calculation stage of the conditional branch instruction processing ends, the branch destination instruction fetch stage starts. In this branch destination instruction fetch stage,
It is determined whether the branch is taken / not taken according to the complex condition code supplied from the complex condition generating circuit 17, and if the branch is taken, four instructions starting with the branch destination instruction are taken out.
Therefore, according to the present embodiment, for example, A> B and C> D
In addition, the branch processing when a plurality of conditions such as E> F and G> H is satisfied can be executed by one conditional branch.

なお、第2図に示す分岐条件BCでは、そのビットb0〜
b3(共通指定ビットデータ)のように同じ条件を全ての
条件コードに適用するようになっているが、第4図に示
す分岐条件BC′のビットb0〜b3,b4〜b7,b8〜b11,b12〜b
15(個別指定ビットデータ)のように,パイプライン13
−1,13−2,13−3,13−4で生成される各条件コード(条
件コードレジスタ15−1,15−2,15−3,15−4の各保持内
容)について独立した条件生成を指定することも可能で
ある。即ち、第2図に示す分岐条件BCに代えて第4図に
示す分岐条件BC′を第1図の演算処理装置に適用するこ
とも可能である。この場合、複合条件生成回路17に代え
て、第5図に示す構成の複合条件生成回路17′を用いる
必要がある。
In the branch condition BC shown in FIG.
The same condition as b3 (common designation bit data) is applied to all condition codes. However, bits b0 to b3, b4 to b7, b8 to b11, b12-b
Pipeline 13 like 15 (individually specified bit data)
Independent condition generation for each condition code (contents held in condition code registers 15-1, 15-2, 15-3, 15-4) generated by -1, 13-2, 13-3, 13-4 Can also be specified. That is, the branch condition BC 'shown in FIG. 4 can be applied to the arithmetic processing unit shown in FIG. 1 instead of the branch condition BC shown in FIG. In this case, it is necessary to use a composite condition generation circuit 17 'having the configuration shown in FIG.

第5図の複合条件生成回路17′は条件コードレジスタ
15−1〜15−4に保持された各条件コードを第4図に示
す分岐条件BC′に従って1つの複合条件コードにまとめ
るもので、条件コードレジスタ15−1,15−2,15−3,15−
4のGビットを分岐条件BC′中のビットb0,b4,b8,b12
(MGビット)に応じてマスク(選択)するANDゲート51
−1,51−2,51−3,51−4と、条件コードレジスタ15−1,
15−2,15−3,15−4のLビットを分岐条件BC′中のビッ
トb1,b5,b9,b13(MLビット)に応じてマスクするANDゲ
ート52−1,52−2,52−3,52−4とを有している。複合条
件生成回路17′はまた、ANDゲート51−1,52−1の出力
ビット間,ANDゲート51−2,52−2の出力ビット間,ANDゲ
ート51−3,52−3の出力ビット間,ANDゲート51−4,52−
4の出力ビット間のそれぞれANDまたはOR演算を分岐条
件BC′中のビットb2,b6,b10,b14(A/Oビット)に応じて
行って1ビットにまとめるAND/OR回路53−1,53−2,53−
3,53−4を有している。複合条件生成回路17′は更に、
AND/OR回路53−1,53−2,53−3,53−4の出力ビットの分
岐条件BC′中のビットb3,b7,b11,b15(Nビット)に応
じて反転するEXORゲート54−1,54−2,54−3,54−4と、
EXORゲート54−1,54−2,54−3,54−4の出力ビット間の
ANDまたはOR演算を分岐条件BC′中のビットb16(A/Oビ
ット)に応じて行って1ビットの複合条件コードにまと
めるAND/OR回路55とを有している。
The complex condition generation circuit 17 'in FIG.
Each of the condition codes held in 15-1 to 15-4 is combined into one composite condition code according to the branch condition BC 'shown in FIG. 4, and the condition code registers 15-1, 15-2, 15-3, 15−
4 G bits into the bits b0, b4, b8, b12 in the branch condition BC '
AND gate 51 masks (selects) according to (MG bit)
-1,51-2,51-3,51-4 and condition code register 15-1,
AND gates 52-1, 52-2, 52- that mask the L bits of 15-2, 15-3, 15-4 according to bits b1, b5, b9, b13 (ML bits) in branch condition BC ' 3,52-4. The complex condition generation circuit 17 'also provides a signal between the output bits of the AND gates 51-1 and 52-1, a signal between the output bits of the AND gates 51-2 and 52-2, and a signal between the output bits of the AND gates 51-3 and 52-3. , AND gate 51−4, 52−
AND / OR circuits 53-1 and 53 for performing AND and OR operations between the four output bits according to bits b2, b6, b10 and b14 (A / O bits) in the branch condition BC 'into one bit. −2,53−
3,53-4. The composite condition generation circuit 17 'further includes
An EXOR gate 54-which inverts according to the bits b3, b7, b11, b15 (N bits) in the branch condition BC 'of the output bits of the AND / OR circuits 53-1, 53-2, 53-3, 53-4. 1,54-2,54-3,54-4,
Between the output bits of the EXOR gates 54-1, 54-2, 54-3, 54-4
An AND / OR circuit 55 that performs an AND or OR operation in accordance with the bit b16 (A / O bit) in the branch condition BC 'to combine the result into a 1-bit composite condition code.

第2図に示す分岐条件BCと第4図に示す分岐条件BC′
とを比較すると、分岐条件BCではビットb0〜b3のように
同じ条件を全ての条件コードに適用するため、複合条件
コード生成に組入れる条件コードを選択するビットb4〜
b7(M1〜M4ビット)が必要となるが、全体の構成ビット
数は分岐条件BC′より少なくて済む。一方、分岐条件B
C′は各条件コードについて独立した条件生成を指定す
るために、分岐条件BCより多くのビット数を必要となる
ものの、細かな条件生成指定が可能となる。
The branch condition BC shown in FIG. 2 and the branch condition BC 'shown in FIG.
When the branch condition BC applies the same condition to all the condition codes as the bits b0 to b3, the bits b4 to b4 to select the condition codes to be incorporated in the complex condition code generation
Although b7 (M1 to M4 bits) is required, the total number of constituent bits is smaller than the branch condition BC '. On the other hand, branch condition B
C 'requires a larger number of bits than the branch condition BC in order to specify independent condition generation for each condition code, but allows detailed specification of condition generation.

以上は、並列に動作可能なパイプライン(パイプライ
ン処理機構)が4つの場合について説明したが、本発明
はパイプライン数が複数の演算処理装置全般に適用可能
である。また、複合条件コードが1ビットである場合に
ついて説明したが、複数ビット構成の複合条件コードを
生成して、1回の分岐処理で多方向分岐を行うようにす
ることも可能である。
In the above, the case where there are four pipelines (pipeline processing mechanisms) that can operate in parallel has been described. However, the present invention is applicable to all types of arithmetic processing devices having a plurality of pipelines. Also, the case where the composite condition code is 1 bit has been described, but it is also possible to generate a composite condition code having a plurality of bits and perform multidirectional branching in one branching process.

[発明の効果] 以上詳述したようにこの発明によれば、命令を処理す
るパイプライン処理機構をn個(n≧2)備え、このn
個のパイプライン処理機構を用いて1つの命令ストリー
ムから命令をn個ずつ並列に実行していく演算処理装置
において、各パイプライン処理機構で並列に条件コード
を生成して、対応する条件コードレジスタに一時保持
し、各条件コードレジスタに保持された条件コードに対
し、条件分岐命令中の分岐条件に含まれている共通指定
にビットデータまたは個別指定ビットデータに従って、
共通の論理演算または独立した論理演算を行い、その論
理演算後の各条件コードを、当該分岐条件中の他のビッ
トデータに応じてまとめて1つの複合条件コードを生成
する構成としたので、この複合条件コードに従って処理
を選択することにより、複合条件による条件処理を高速
に行うことができる。
[Effects of the Invention] As described above in detail, according to the present invention, there are provided n (n ≧ 2) pipeline processing mechanisms for processing instructions.
In an arithmetic processing unit for executing n instructions from one instruction stream in parallel using one pipeline processing mechanism, a condition code is generated in parallel by each pipeline processing mechanism, and a corresponding condition code register is generated. In accordance with the bit data or individually specified bit data in the common specification included in the branch condition in the conditional branch instruction,
Since a common logical operation or an independent logical operation is performed, and each condition code after the logical operation is collectively generated according to other bit data in the branch condition, one composite condition code is generated. By selecting a process according to the complex condition code, the condition process based on the complex condition can be performed at high speed.

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

第1図はこの発明の一実施例に係る演算処理装置のブロ
ック構成図、第2図は同実施例で適用される条件分岐命
令のフォーマット図、第3図は同実施例で適用される複
合条件生成回路の内部構成を示す図、第4図は第2図に
示す条件分岐命令中の分岐条件の変形例を示すフォーマ
ット図、第5図は第4図に示すフォーマットの分岐条件
を適用する場合の複合条件生成回路の内部構成を示す図
である。 11……命令バッファ、12……命令処理機構、13−1〜13
−4……パイプライン(パイプライン処理機構)、15−
1〜15−4……条件コードレジスタ、16……レジスタフ
ァイル、17,17′……複合条件生成回路、BC,BC′……分
岐条件。
FIG. 1 is a block diagram of an arithmetic processing unit according to an embodiment of the present invention, FIG. 2 is a format diagram of a conditional branch instruction applied in the embodiment, and FIG. 3 is a complex diagram applied in the embodiment. FIG. 4 is a diagram showing the internal configuration of the condition generating circuit, FIG. 4 is a format diagram showing a modified example of the branch condition in the conditional branch instruction shown in FIG. 2, and FIG. 5 applies a branch condition in the format shown in FIG. FIG. 9 is a diagram illustrating an internal configuration of a complex condition generation circuit in the case. 11: Instruction buffer, 12: Instruction processing mechanism, 13-1 to 13
-4 ... Pipeline (pipeline processing mechanism), 15-
1 to 15-4: condition code register, 16: register file, 17, 17 ': complex condition generation circuit, BC, BC': branch condition.

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】命令を処理するパイプライン処理機構をn
個(nは2以上の整数)備え、このn個のパイプライン
処理機構を用いて1つの命令ストリームから命令をn個
ずつ並列に実行していく演算処理装置において、 上記各パイプライン処理機構毎に設けられ、対応するパ
イプライン処理機構で生成される条件コードを保持する
ための条件コードレジスタと、 上記n個のパイプライン処理機構の1つで、当該各パイ
プライン処理機構毎の上記条件コードレジスタにそれぞ
れ保持されている各条件コードに対して行うべき論理演
算の共通の条件を指定する共通指定ビットデータを含
み、上記各条件コードをまとめて1つの複合条件コード
を生成するための分岐条件を有する条件分岐命令が実行
された場合に、上記各パイプライン処理機構毎の条件コ
ードレジスタにそれぞれ保持されている各条件コードに
対して上記条件分岐命令の分岐条件に含まれている上記
共通指定ビットデータに応じた共通の論理演算を行い、
その論理演算後の各条件コードを、当該条件分岐命令の
分岐条件の他のビットデータに応じてまとめて1つの複
合条件コードを生成する複合条件生成手段とを具備し、 上記条件分岐命令を実行中の上記パイプライン処理機構
は、上記複合条件生成手段によって生成された複合条件
コードに従って分岐成立/不成立の判定を行うように構
成されていることを特徴とする演算処理装置。
1. A pipeline processing mechanism for processing an instruction is represented by n
(N is an integer equal to or greater than 2) in an arithmetic processing device that executes instructions from an instruction stream in parallel by n at a time using the n pipeline processing mechanisms. And a condition code register for holding a condition code generated by a corresponding pipeline processing mechanism; and one of the n pipeline processing mechanisms, wherein the condition code for each of the pipeline processing mechanisms is provided. A branch condition for generating common compound condition codes by combining common condition bit data for specifying common conditions of a logical operation to be performed on each condition code held in a register. When a conditional branch instruction having the following condition is executed, each condition code stored in the condition code register of each pipeline processing mechanism is stored. Performs a common logical operation in accordance with the common designation bit data included in the branch condition of the conditional branch instruction to de,
A complex condition generating means for combining each condition code after the logical operation in accordance with other bit data of the branch condition of the conditional branch instruction to generate one complex condition code, and executing the conditional branch instruction The arithmetic processing device, wherein the pipeline processing mechanism is configured to determine whether a branch is taken / not taken according to a complex condition code generated by the complex condition generating means.
【請求項2】命令を処理するパイプライン処理機構をn
個(nは2以上の整数)備え、このn個のパイプライン
処理機構を用いて1つの命令ストリームから命令をn個
ずつ並列に実行していく演算処理装置において、 上記各パイプライン処理機構毎に設けられ、対応するパ
イプライン処理機構で生成される条件コードを保持する
ための条件コードレジスタと、 上記n個のパイプライン処理機構の1つで、上記各パイ
プライン処理機構毎の条件コードレジスタにそれぞれ保
持されている各条件コードに対して行うべき論理演算の
条件を個々に指定する個別指定ビットデータを含み、上
記各条件コードをまとめて1つの複合条件コードを生成
するための分岐条件を有する条件分岐命令が実行される
場合に、上記各パイプライン処理機構毎の条件コードレ
ジスタにそれぞれ保持されている各条件コードに対して
上記条件分岐命令の分岐条件に含まれている上記個別指
定ビットデータに応じた独立した論理演算を行い、その
論理演算後の各条件コードを、当該条件分岐命令の分岐
条件の他のビットデータに応じてまとめて1つの複合条
件コードを生成する複合条件生成手段とを具備し、 上記条件分岐命令を実行中の上記パイプライン処理機構
は、上記複合条件生成手段によって生成された複合条件
コードに従って分岐成立/不成立の判定を行うように構
成されていることを特徴とする演算処理装置。
2. A pipeline processing mechanism for processing an instruction is represented by n
(N is an integer equal to or greater than 2) in an arithmetic processing device that executes instructions from an instruction stream in parallel by n at a time using the n pipeline processing mechanisms. And a condition code register for holding a condition code generated by a corresponding pipeline processing mechanism; and a condition code register for each of the pipeline processing mechanisms in one of the n pipeline processing mechanisms. Contains individually designated bit data for individually designating the condition of the logical operation to be performed on each condition code held therein, and includes a branch condition for generating one composite condition code by combining the above condition codes. When the conditional branch instruction having the condition code is executed, each condition code stored in the condition code register for each of the pipeline processing mechanisms is provided. Performs an independent logical operation according to the individually specified bit data included in the branch condition of the conditional branch instruction, and replaces each condition code after the logical operation with another bit of the branch condition of the conditional branch instruction. Compound condition generating means for collectively generating one compound condition code in accordance with data, wherein the pipeline processing mechanism executing the conditional branch instruction includes a compound condition code generated by the compound condition generating means. An arithmetic processing device configured to determine whether a branch is taken / not taken according to the following.
JP2209098A 1990-08-09 1990-08-09 Arithmetic processing unit Expired - Fee Related JP2793342B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2209098A JP2793342B2 (en) 1990-08-09 1990-08-09 Arithmetic processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2209098A JP2793342B2 (en) 1990-08-09 1990-08-09 Arithmetic processing unit

Publications (2)

Publication Number Publication Date
JPH0496133A JPH0496133A (en) 1992-03-27
JP2793342B2 true JP2793342B2 (en) 1998-09-03

Family

ID=16567259

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2209098A Expired - Fee Related JP2793342B2 (en) 1990-08-09 1990-08-09 Arithmetic processing unit

Country Status (1)

Country Link
JP (1) JP2793342B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2793357B2 (en) * 1990-11-20 1998-09-03 株式会社東芝 Parallel processing unit
US5659722A (en) * 1994-04-28 1997-08-19 International Business Machines Corporation Multiple condition code branching system in a multi-processor environment
WO1998033115A1 (en) * 1997-01-24 1998-07-30 Mitsubishi Denki Kabushiki Kaisha A data processor
US7219213B2 (en) * 2004-12-17 2007-05-15 Intel Corporation Flag bits evaluation for multiple vector SIMD channels execution
CN101120310B (en) 2005-02-14 2010-06-09 皇家飞利浦电子股份有限公司 An electronic circuit for parallel processing a plurality of operands
US8086830B2 (en) 2005-03-31 2011-12-27 Panasonic Corporation Arithmetic processing apparatus
US7676647B2 (en) * 2006-08-18 2010-03-09 Qualcomm Incorporated System and method of processing data using scalar/vector instructions

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6043751A (en) * 1983-08-18 1985-03-08 Hitachi Ltd Information processor
JPH047711A (en) * 1990-04-26 1992-01-13 Toyoda Mach Works Ltd Automatic tool route creating device

Also Published As

Publication number Publication date
JPH0496133A (en) 1992-03-27

Similar Documents

Publication Publication Date Title
US9383999B2 (en) Conditional compare instruction
US6334176B1 (en) Method and apparatus for generating an alignment control vector
US5790854A (en) Efficient stack utilization for compiling and executing nested if-else constructs in a vector data processing system
US5995748A (en) Three input arithmetic logic unit with shifter and/or mask generator
US5696959A (en) Memory store from a selected one of a register pair conditional upon the state of a selected status bit
US6032170A (en) Long instruction word controlling plural independent processor operations
US5680339A (en) Method for rounding using redundant coded multiply result
US6016538A (en) Method, apparatus and system forming the sum of data in plural equal sections of a single data word
Yu et al. Vector processing as a soft-core CPU accelerator
US6026484A (en) Data processing apparatus, system and method for if, then, else operation using write priority
KR102584001B1 (en) Vector arithmetic instructions
US5712999A (en) Address generator employing selective merge of two independent addresses
US5442581A (en) Iterative division apparatus, system and method forming plural quotient bits per iteration
US5479166A (en) Huffman decoding method, circuit and system employing conditional subtraction for conversion of negative numbers
US8706795B2 (en) SIMD integer addition including mathematical operation on masks
JP2793342B2 (en) Arithmetic processing unit
CN112650471A (en) Processor and method for processing masked data
JP4390211B2 (en) Custom LSI development platform, instruction set architecture, logic circuit configuration information generation method, and program
CN110914801B (en) Vector interleaving in a data processing device
US20090083361A1 (en) Shift-add based multiplication
US5689695A (en) Conditional processor operation based upon result of two consecutive prior processor operations
JP5732139B2 (en) Conditional selection of data elements
US7133959B2 (en) Data-driven information processing device and method to access multiple bank memories according to multiple addresses
CN113015958A (en) System and method for implementing mask vector instructions
JP2004334297A (en) Parallel operation processor and parallel operation processing method

Legal Events

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