JPH02204861A - Vector data processor - Google Patents

Vector data processor

Info

Publication number
JPH02204861A
JPH02204861A JP2460389A JP2460389A JPH02204861A JP H02204861 A JPH02204861 A JP H02204861A JP 2460389 A JP2460389 A JP 2460389A JP 2460389 A JP2460389 A JP 2460389A JP H02204861 A JPH02204861 A JP H02204861A
Authority
JP
Japan
Prior art keywords
vector
address
mask
register
read
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.)
Granted
Application number
JP2460389A
Other languages
Japanese (ja)
Other versions
JPH0812660B2 (en
Inventor
Yasuhiro Nakai
康博 中井
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2460389A priority Critical patent/JPH0812660B2/en
Publication of JPH02204861A publication Critical patent/JPH02204861A/en
Publication of JPH0812660B2 publication Critical patent/JPH0812660B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To process a vector operation containing a vector mask in a simple constitution and at a high speed by performing the writing/reading operations of vector data to the lowest or highest rank address of a vector register based on the value of the corresponding vector mask. CONSTITUTION:When the vector data is written, the vector data on a memory is given to a vector register 1 via an input crossbar. Then the vector elements having the value of the corresponding vector mask equal to '1' are written ascendingly via the lowest rank address of the register 1. At the same time, the vector elements having the value of the corresponding vector mask equal to '0' are written descendingly via the highest rank address of the register 1. Then the vector data is read out with a reading vector mask signal set at '1'. Thus the vector data can be read out in their original arrangement. On the contrary, only the vector data having its vector mask equal to '1' can be read out when the reading vector mask signal is set at '0'. As a result, the vector data can be calculated in a simple constitution and at a high speed.

Description

【発明の詳細な説明】 1五欠ヱ 本発明ベクトルデータ処理装置に関し、特にマスク付き
ベクトルデータのベクトルレジスタへの書込み読出し制
御に関する。
DETAILED DESCRIPTION OF THE INVENTION (1) The present invention relates to a vector data processing device, and particularly relates to control of writing and reading of masked vector data to and from a vector register.

疋困弦韮 従来のベクトルデータ処理装置では、マスク付きのベク
トルデータに対してマスクを有効としてベクトル演算を
行う場合、全てのベクトルデータを各々のベクトル要素
のマスクが演算有効であるか無効であるかにかかわらず
読出してベクトル演算を行い、演算結果のベクトルデー
タのうちマスクが演算有効となるベクトル要素のみ書込
みを行う方法や、ベクトルマスクレジスタのマスクが演
算有効であるベクトル要素間の要素数の計算を各々行い
ベクトルデータの読出し、書込み時にその要素数を順々
に加算し、ベクトルデータの演算有効なベクトル要素の
読出し、書込みを行う方法がとられている。
In conventional vector data processing devices, when performing vector operations on masked vector data with the mask enabled, all vector data must be operated on to determine whether the mask of each vector element is valid or invalid. There is a method of reading and performing vector operations regardless of the operation result, and then writing only the vector elements for which the mask is valid for operation among the vector data of the operation result, and for the number of elements between vector elements for which the mask of the vector mask register is valid for operation. A method is used in which each calculation is performed and the number of elements is sequentially added when reading and writing vector data, and vector elements that are valid for calculation of vector data are read and written.

このような従来の方法では以下のような欠点がある。ま
ず、上述の第1の方法では、制御構成は簡単であるが、
実際には演算が必要でないベクトル要素に対しても演算
を行うため演算時間がかかる欠点がある。また上述第2
の方法では、第1の方法の様に演算時間がかかることは
ないが、マスクが演算有効であるベクトル要素間の要素
数を計算して読出し、書込みアドレスに加算するために
、大きなハードウェア量が必要であり、制御構成共に複
雑になる欠点がある。
Such conventional methods have the following drawbacks. First, in the first method described above, the control configuration is simple, but
This method has the disadvantage that calculation time is required because calculations are performed even on vector elements that do not actually require calculations. Also, the second
This method does not take as much calculation time as the first method, but it requires a large amount of hardware to calculate the number of elements between vector elements for which the mask is valid for calculation, read it, and add it to the write address. This has the disadvantage that both the control structure and the control structure are complicated.

え匪曵亘司 本発明の目的は、ベクトルデータの演算を簡単な構成で
かつ高速に行えるようにしたベクトル処理装置を提供す
ることである。
SUMMARY OF THE INVENTION An object of the present invention is to provide a vector processing device that has a simple configuration and can perform operations on vector data at high speed.

北1m戊 本発明によるベクトルデータ処理装置は、複数のベクト
ル要素を格納するベクトルレジスタと、前記ベクトル要
素の各々に対応するベクトルマスクデータを保持するベ
クトルマスクレジスタと、最下位アドレスから最上位ア
ドレスまで昇順に書込みアドレスを生成する第1の書込
みアドレス生成手段と、前記最上位アドレスから前記最
下位アドレスまで降順に書込みアドレスを生成する第2
の書込みアドレス生成手段と、書込むべきベクトル要素
に対応する前記ベクトルマスクデータの値に応じて前記
第1及び第2の書込みアドレス生成手段の書込みアドレ
スを選択して前記ベクトルレジスタの書込みアドレスと
する選択手段と、最下位アドレスから最上位アドレスま
で昇順に読出しアドレスを生成する第1の読出しアドレ
ス生成手段と、前記最上位アドレスから前記最下位アド
レスまで降順に読出しアドレスを生成する第2の読出し
アドレス生成手段と、読出すべきベクトル要素に対応す
る前記ベクトルマスクデータの値に応じて前記第1及び
第2の読出しアドレス生成手段の読出しアドレスを選択
する選択手段とを含むことを特徴とする。
1m North A vector data processing device according to the present invention includes a vector register that stores a plurality of vector elements, a vector mask register that holds vector mask data corresponding to each of the vector elements, and a vector data processing device that stores vector data from the lowest address to the highest address. a first write address generating means for generating write addresses in ascending order; and a second write address generating means for generating write addresses in descending order from the highest address to the lowest address.
and the write address of the first and second write address generation means is selected according to the value of the vector mask data corresponding to the vector element to be written, and the write address is set as the write address of the vector register. a selection means, a first read address generating means for generating read addresses in ascending order from the lowest address to the highest address, and a second read address generating means for generating read addresses in descending order from the highest address to the lowest address. The method is characterized in that it includes a generating means and a selecting means for selecting read addresses of the first and second read address generating means according to the value of the vector mask data corresponding to the vector element to be read.

哀崖週 次に本発明について図面を参照して説明する。sad cliff week Next, the present invention will be explained with reference to the drawings.

第1図は本発明の一実施例のブロック図である。FIG. 1 is a block diagram of one embodiment of the present invention.

1はベクトルレジスタ、2はベクトルマスクレジスタ、
3はベクトルマスクレジスタのベクトルマスクを取出す
マスク選択手段である。
1 is a vector register, 2 is a vector mask register,
Reference numeral 3 denotes mask selection means for extracting a vector mask from the vector mask register.

4は第1書込みアドレス生成手段のためのカウンタであ
り、5は第2書込みアドレス生成手段のためのカウンタ
である。6は書込みアドレス選択のためのセレクタ、7
は第1読出しアドレス生成手段のためのカウンタ、8は
第2読出しアドレス生成手段のためのカウンタ、9は読
出しアドレス選択のためのセレクタである。10から2
1までは制御のためのアンドゲート、オアゲートまたは
インバータである。
4 is a counter for the first write address generation means, and 5 is a counter for the second write address generation means. 6 is a selector for selecting a write address, 7
8 is a counter for the first read address generating means, 8 is a counter for the second read address generating means, and 9 is a selector for selecting a read address. 10 to 2
Up to 1 are AND gates, OR gates, or inverters for control.

第2図は第1図に示した本発明の一実施例を含むベクト
ルデータ処理装置のブロック図であり、第1図のベクト
ルレジスタ1は第2図のおいてはla、lb、lcで表
される。第1図におけるカウンタ、ゲート群、セレクタ
等の部分はアドレス制#4a、4b、4cで表される。
FIG. 2 is a block diagram of a vector data processing device including one embodiment of the present invention shown in FIG. 1, and the vector register 1 in FIG. be done. Portions such as the counter, gate group, and selector in FIG. 1 are represented by address systems #4a, 4b, and 4c.

また、うは演算結果またはメモリからのベクトルデータ
を選択してベクトルレジスタla、lb、lcへ択一的
に入力する入力りロスバ、6はベクトルレジスタla、
lb、lcから出力されるベクトルデータをベクトル演
算器7.8へ入力する出力クロスバ、7.8はベクトル
演算器である。
In addition, 6 is an input loss bar that selects the calculation result or vector data from the memory and inputs it alternatively to vector registers la, lb, and lc; 6 is a vector register la;
An output crossbar 7.8 inputs vector data output from lb and lc to a vector calculator 7.8.

第3図及び第4図は本発明の実施例の動作を説明する図
であり、これ等図面を参照しつつ本発明の動作について
説明する。まず、ベクトルマスクが有効とならない場合
、書込みマスク有効信号と読出しマスク有効信号とが“
0″となり、ゲート10.12により書込みアドレスカ
ウント信号はアドレスカウンタ4にのみ与えられ、ゲー
ト14゜16により読出しアドレスカウント信号はアド
レスカウンタ7にのみ与えられる。
3 and 4 are diagrams for explaining the operation of the embodiment of the present invention, and the operation of the present invention will be explained with reference to these drawings. First, if the vector mask is not valid, the write mask valid signal and read mask valid signal are “
0'', the write address count signal is applied only to the address counter 4 by the gates 10.12, and the read address count signal is applied only to the address counter 7 by the gates 14.16.

また、ゲート20によりセレクタ6はアドレスカウンタ
4の出力のみを選択して書込みアドレスとし、ゲート2
1によりセレクタ9はアドレスカランタフの出力のみを
選択して読出しアドレスとする。そのなめ、ベクトルレ
ジスタ1の書込み、読出しは最下位アドレスから最上位
アドレスへ順々に行われる。これは従来の通常のベクト
ルレジスタの書込み、読出し動作と同じである。
Further, the selector 6 selects only the output of the address counter 4 as a write address by the gate 20, and the gate 20
1, the selector 9 selects only the output of the address carantuff and uses it as the read address. Therefore, writing and reading of the vector register 1 is performed sequentially from the lowest address to the highest address. This is the same as the conventional normal vector register write and read operations.

次に、本発明の特徴であるベクトルマスクが有効である
場合の動作について説明する。書込みマスク有効信号が
“1“となると、書込みアドレスカウント信号はゲート
11.12によりカウンタ4に与えられ、ベクトルマス
クレジスタ2からマスク選択手段3により読出されたベ
クトルマスクが“1”の場合のみカウンタ4をカウント
アツプする。また、書込みアドレスカウント信号はゲー
ト13.18によりカウンタ5にも与えられ、この場合
は逆にベクトルマスクレジスタ2からマスク選択手段3
により読出されたベクトルマスクが“0″の場合のみカ
ウンタ5をカウントダウンする。
Next, the operation when the vector mask, which is a feature of the present invention, is effective will be described. When the write mask valid signal becomes "1", the write address count signal is applied to the counter 4 by the gates 11 and 12, and the counter is activated only when the vector mask read from the vector mask register 2 by the mask selection means 3 is "1". Count up 4. Further, the write address count signal is also given to the counter 5 by the gate 13.18, and in this case, conversely, from the vector mask register 2 to the mask selection means 3
Counter 5 is counted down only when the vector mask read by is "0".

また、セレクタ6はゲート2oにより制御され、ベクト
ルマスクが1ltHの場合カウンタ4を選択し、“0”
の場合カウンタ5を選択して書込みアドレスとしてベク
トルレジスタ1に与える。
Further, the selector 6 is controlled by the gate 2o, and when the vector mask is 1ltH, selects the counter 4 and sets it to "0".
In this case, counter 5 is selected and given to vector register 1 as a write address.

読出しに関しても書込みの場合と同様であり、読出しマ
スク有効信号が“1”となると、読出しアドレスカウン
ト信号はゲート15.16によりカウンタ7に与えられ
、ベクトルマスクレジスタ2からマスク選択手段3によ
り読出されたベクトルマスクが“1”の場合のみカウン
タ7をカウントアツプする。また、読出しアドレス信号
はゲート17.18によりカウンタ8にも与えられ、こ
の場合は逆にベクトルマスクレジスタ2がらマスク選択
手段3により読出されたベクトルマスクが“0”の場合
のみカウンタ8をカウントダウンする。セレクタ9はゲ
ート21により制御されベクトルマスクが“1”の場合
カウンタ7を選択し、“0”の場合カウンタ8を選択し
て読出しアドレスとしてベクトルレジスタ1に与えられ
る。
The read operation is similar to the write operation, and when the read mask valid signal becomes "1", the read address count signal is applied to the counter 7 by the gates 15 and 16, and is read out from the vector mask register 2 by the mask selection means 3. The counter 7 is counted up only when the vector mask obtained is "1". Further, the read address signal is also given to the counter 8 by the gates 17 and 18, and in this case, conversely, the counter 8 is counted down only when the vector mask read by the mask selection means 3 from the vector mask register 2 is "0". . The selector 9 is controlled by the gate 21, and selects the counter 7 when the vector mask is "1", and selects the counter 8 when the vector mask is "0", and provides the selected signal to the vector register 1 as a read address.

したがって、今このベクトルレジスタ1が16ワードで
あるとし、第3図に示すベクトルマスクにより、a1〜
a16のベクトルデータを書込む場合を考えると、メモ
リ上にあるベクトルデータa1〜a16はメモリから入
力クロスバよりベクトルレジスタに与えられ、第3図に
示すように対応するベクトルマスクの値が“INである
ベクトル要素a1 、 a3 、 a4 、 a5 、
 a8 、−=−1−がベクトルレジスタ1の最下位ア
ドレスにより昇順に書込まれる。
Therefore, assuming that this vector register 1 is now 16 words, using the vector mask shown in FIG.
Considering the case of writing the vector data of a16, the vector data a1 to a16 in the memory are given from the memory to the vector register from the input crossbar, and the value of the corresponding vector mask is "IN" as shown in Figure 3. Certain vector elements a1, a3, a4, a5,
a8, -=-1- are written in ascending order by the lowest address of vector register 1.

逆に対応するベクトルマスクの値が“oパであるベクト
ル要素a2 、 a6 、 a7 、 alo、 al
3゜・・・・・・が、ベクトルレジスタ1の最上位アド
レスにより降順に書込まれる。このときマスク選択手段
3により読出されるベクトルマスクの値とカウンタ4、
カウンタ5の値ならびにセレクタ6がら出力される書込
みアドレスの値は第4図に示すようになる。
Conversely, vector elements a2, a6, a7, alo, al whose corresponding vector mask value is "opa"
3° . . . are written in descending order according to the most significant address of vector register 1. At this time, the value of the vector mask read by the mask selection means 3 and the counter 4,
The value of the counter 5 and the value of the write address output from the selector 6 are as shown in FIG.

ここで、このベクトルレジスタ1に書込まれたベクトル
データと読出しベクトルマスク信号を“1”として読出
すと、書込みの場合と同様な動作が行われ、al 、 
a2 、 a3 、 a4 、 a5 、・・・・・・
と本来のベクトルデータの並びでベクトルデータを読出
すことができる。逆に読出しベクトルマスク信号“0″
として読出すと、al 、 a3 、 a4 、 a5
 、 a8 、・・・・・・とベクトルマスクが1″で
あるベクトルデータのみを読出すことができる。
Here, when the vector data written in this vector register 1 and the read vector mask signal are read as "1", the same operation as in the case of writing is performed, and al,
a2, a3, a4, a5,...
The vector data can be read in the original vector data arrangement. Conversely, read vector mask signal “0”
When read as al , a3 , a4 , a5
, a8, . . . only vector data whose vector mask is 1'' can be read.

よって、この様に読出されたベクトルデータを出力クロ
バスによりベクトル演算器に与えることにより、ベクト
ルマスクが有効であるベクトル要素のみを演算すること
ができる。このとき、この演算結果のベクトルデータの
書込みは、書込みが行われるベクトルレジスタに対して
書込みマスク信号を0として行わなければならないのは
明らかであろう、また、その演算結果のベクトルデータ
の格納されたベクトルレジスタに対して、読出しベクト
ルマスク信号を“1“とじて読出しを行えば、本来のベ
クトル要素の順にベクトルデータを読出せることも明ら
かである。
Therefore, by supplying the vector data read out in this manner to the vector computing unit through the output Klobus, it is possible to compute only the vector elements for which the vector mask is valid. At this time, it is obvious that the vector data of the operation result must be written with the write mask signal set to 0 for the vector register to which the operation is written. It is also clear that by reading out the vector register with the read vector mask signal set to "1", the vector data can be read out in the order of the original vector elements.

九乳ム皇J このように、本発明のベクトルデータ処理装置によれば
、ベクトルデータを対応するベクトルマスクの値により
ベクトルレジスタの最下位アドレスまたは最上位アドレ
スのいずれからか書込み読出しが行なえる構成とするこ
とにより、ベクトルマスク付きのベクトル演算を簡単な
構成でかつ高速に処理できるという効果がある。
As described above, according to the vector data processing device of the present invention, vector data can be written and read from either the lowest address or the highest address of the vector register depending on the value of the corresponding vector mask. This has the effect that vector operations with vector masks can be processed at high speed with a simple configuration.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の実施例のブロック図、第2図は第1図
の実施例を含むベクトルデータ処理装置の全体ブロック
図、第3図及び第4図は本発明の実施例の動作を説明す
るための図である。 主要部分の符号の説明 1・・・・・・ベクトルレジスタ 2・・・・・・ベクトルマスクレジスタ4.5.7.8
・・・・・・カウンタ 6.9・・・・・・セレクタ
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is an overall block diagram of a vector data processing device including the embodiment of FIG. 1, and FIGS. 3 and 4 illustrate the operation of the embodiment of the present invention. It is a figure for explaining. Explanation of symbols of main parts 1...Vector register 2...Vector mask register 4.5.7.8
...Counter 6.9 ...Selector

Claims (1)

【特許請求の範囲】[Claims] (1)複数のベクトル要素を格納するベクトルレジスタ
と、前記ベクトル要素の各々に対応するベクトルマスク
データを保持するベクトルマスクレジスタと、最下位ア
ドレスから最上位アドレスまで昇順に書込みアドレスを
生成する第1の書込みアドレス生成手段と、前記最上位
アドレスから前記最下位アドレスまで降順に書込みアド
レスを生成する第2の書込みアドレス生成手段と、書込
むべきベクトル要素に対応する前記ベクトルマスクデー
タの値に応じて前記第1及び第2の書込みアドレス生成
手段の書込みアドレスを選択して前記ベクトルレジスタ
の書込みアドレスとする選択手段と、最下位アドレスか
ら最上位アドレスまで昇順に読出しアドレスを生成する
第1の読出しアドレス生成手段と、前記最上位アドレス
から前記最下位アドレスまで降順に読出しアドレスを生
成する第2の読出しアドレス生成手段と、読出すべきベ
クトル要素に対応する前記ベクトルマスクデータの値に
応じて前記第1及び第2の読出しアドレス生成手段の読
出しアドレスを選択する選択手段とを含むことを特徴と
するベクトルデータ処理装置。
(1) A vector register that stores a plurality of vector elements, a vector mask register that holds vector mask data corresponding to each of the vector elements, and a first register that generates write addresses in ascending order from the lowest address to the highest address. a second write address generating means for generating write addresses in descending order from the highest address to the lowest address; selection means for selecting the write addresses of the first and second write address generation means to be the write addresses of the vector register; and a first read address for generating read addresses in ascending order from the lowest address to the highest address. generating means; second read address generating means for generating read addresses in descending order from the highest address to the lowest address; and selection means for selecting a read address of the second read address generation means.
JP2460389A 1989-02-02 1989-02-02 Vector data processor Expired - Lifetime JPH0812660B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2460389A JPH0812660B2 (en) 1989-02-02 1989-02-02 Vector data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2460389A JPH0812660B2 (en) 1989-02-02 1989-02-02 Vector data processor

Publications (2)

Publication Number Publication Date
JPH02204861A true JPH02204861A (en) 1990-08-14
JPH0812660B2 JPH0812660B2 (en) 1996-02-07

Family

ID=12142726

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2460389A Expired - Lifetime JPH0812660B2 (en) 1989-02-02 1989-02-02 Vector data processor

Country Status (1)

Country Link
JP (1) JPH0812660B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003510682A (en) * 1999-09-20 2003-03-18 インテル・コーポレーション Selectively writing data elements from packed data based on mask using predication

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003510682A (en) * 1999-09-20 2003-03-18 インテル・コーポレーション Selectively writing data elements from packed data based on mask using predication
JP4921665B2 (en) * 1999-09-20 2012-04-25 インテル・コーポレーション Selective writing of data elements from packed data based on mask using predication

Also Published As

Publication number Publication date
JPH0812660B2 (en) 1996-02-07

Similar Documents

Publication Publication Date Title
JPH02204861A (en) Vector data processor
US4723258A (en) Counter circuit
EP0342674B1 (en) Pipeline circuit for timing adjustment
JPS6237737A (en) Microprocessor circuit
JPH05225060A (en) Information processor
JPS619766A (en) Data transfer device
JP2812610B2 (en) Pipeline control method
JP2976418B2 (en) Pattern matching processing device
JP2895892B2 (en) Data processing device
SU826340A1 (en) Device for sorting mn-digit numbers
JP3693873B2 (en) Mask bit number arithmetic unit, vector processing unit, information processing unit
JPH0588887A (en) Data processor
JP3001545B1 (en) Vector data processing device
JPS58203532A (en) Circuit for generating timing pulse
JPH04343132A (en) Central processing unit
JPH033047A (en) Memory with arithmetic function
JPS62111329A (en) Method and circuit for preventing abnormal output of control circuit
JPH0668055A (en) Digital signal processor
JPH06103303A (en) Vector arithmetic processor
JPH01284926A (en) Instruction reading system for arithmetic unit
JPS60144874A (en) Vector data processor
JPS6316785B2 (en)
JPS63197264A (en) Simulator
JPH0412491B2 (en)
JPH0673106B2 (en) Pipeline circuit