JP2008165279A - Vector arithmetic unit and its method - Google Patents
Vector arithmetic unit and its method Download PDFInfo
- Publication number
- JP2008165279A JP2008165279A JP2006350809A JP2006350809A JP2008165279A JP 2008165279 A JP2008165279 A JP 2008165279A JP 2006350809 A JP2006350809 A JP 2006350809A JP 2006350809 A JP2006350809 A JP 2006350809A JP 2008165279 A JP2008165279 A JP 2008165279A
- Authority
- JP
- Japan
- Prior art keywords
- vector data
- vector
- comparison
- holding
- maximum value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 14
- 238000004364 calculation method Methods 0.000 claims description 15
- 238000012423 maintenance Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 4
- 230000014759 maintenance of location Effects 0.000 description 1
Images
Landscapes
- Complex Calculations (AREA)
Abstract
Description
本発明はベクトル演算装置及びその方法に関し、特に複数のベクトルデータを入力としてこれらベクトルデータを連続して演算するベクトル演算装置及びその方法に関するものである。 The present invention relates to a vector operation apparatus and method, and more particularly to a vector operation apparatus and method for continuously calculating a plurality of vector data as input.
従来のベクトル演算装置において、要素毎に最大値または最小値を求めるためには、要素値の比較演算処理、この比較結果値の正負からのマスク生成処理、このマスク値に従った要素の選択処理、という一連の処理を複数の命令で実現している(特許文献1〜3等参照)。 In a conventional vector operation device, in order to obtain the maximum value or the minimum value for each element, a comparison operation process of element values, a mask generation process from the positive / negative of this comparison result value, and an element selection process according to this mask value Is realized by a plurality of instructions (see Patent Documents 1 to 3, etc.).
ここで、特許文献4を参照すると、データの最大値や最小値を求めるための技術が開示されており、データの比較処理と、この比較結果によるデータの選択処理とを、一つの命令で実行するようにした構成が示されている。 Here, referring to Patent Document 4, a technique for obtaining the maximum value and the minimum value of data is disclosed, and a data comparison process and a data selection process based on the comparison result are executed with one instruction. The configuration is shown as follows.
ベクトル演算装置において、複数のベクトルデータの最大値や最小値を算出するためには、上述したように、要素毎に複数の命令を実行することが必要であり、よって演算時間の増大や命令生成の機能が複雑となるという欠点があり、また、これら複数の処理の間の長い時間、ベクトルデータレジスタ内要素の保持が必要であるという欠点もある。 In the vector arithmetic unit, in order to calculate the maximum value and the minimum value of a plurality of vector data, as described above, it is necessary to execute a plurality of instructions for each element. There is a disadvantage that the functions of the vector data register are complicated, and that the elements in the vector data register need to be held for a long time between the plurality of processes.
また、特許文献4に記載の技術は、単なるデータの最大値または最小値を求めるためのものであり、複数のベクトルデータを入力としてこれらベクトルデータを連続して演算するベクトル演算装置に関するものではない。 The technique described in Patent Document 4 is merely for obtaining the maximum value or the minimum value of data, and does not relate to a vector operation device that continuously calculates these vector data by using a plurality of vector data as inputs. .
本発明の目的は、一つのベクトル命令のみで、最大値や最小値を、要素毎に算出可能とすると共に、長時間ベクトルデータレジスタ内要素の保持を不要としたベクトル演算装置及びその方法を提供することである。 An object of the present invention is to provide a vector operation apparatus and method capable of calculating the maximum value and the minimum value for each element with only one vector instruction and not requiring the retention of elements in the vector data register for a long time. It is to be.
本発明によるベクトル演算装置は、ベクトルデータを連続して演算して最大値(または最小値)を求めるベクトル演算装置であって、前記ベクトルデータの各々を保持する保持手段と、前記入力ベクトルデータの比較演算をなす比較手段と、この比較手段の比較結果に応じて前記保持手段に保持されているベクトルデータの一つを選択して最大値(または最小値)として導出する選択手段とを含むことを特徴とする。 A vector arithmetic device according to the present invention is a vector arithmetic device for continuously calculating vector data to obtain a maximum value (or minimum value), a holding means for holding each of the vector data, Comparing means for performing a comparison operation, and selecting means for selecting one of the vector data held in the holding means according to the comparison result of the comparing means and deriving it as a maximum value (or minimum value). It is characterized by.
本発明によるベクトル演算方法は、ベクトルデータを連続して演算して最大値(または最小値)を求めるベクトル演算方法であって、前記ベクトルデータの各々を保持する保持ステップと、前記入力ベクトルデータの比較演算をなす比較ステップと、この比較結果に応じて前記保持ステップで保持されたベクトルデータの一つを選択して最大値(または最小値)として導出する選択ステップとを含むことを特徴とする。 A vector calculation method according to the present invention is a vector calculation method for continuously calculating vector data to obtain a maximum value (or minimum value), a holding step for holding each of the vector data, A comparison step for performing a comparison operation, and a selection step for selecting one of the vector data held in the holding step according to the comparison result and deriving it as a maximum value (or a minimum value). .
本発明によれば、一つのベクトル命令のみで、最大値や最小値を、要素毎に算出することが可能になり、その結果、長時間ベクトルデータレジスタ内要素の保持を不要とし得るという効果がある。 According to the present invention, it becomes possible to calculate the maximum value and the minimum value for each element with only one vector instruction, and as a result, there is an effect that it is not necessary to hold elements in the vector data register for a long time. is there.
以下に、本発明の実施の形態について図面を用いて説明する。図1は本発明の実施の形態を説明するための機能ブロック図である。図1を参照すると、本発明の実施の形態は、ベクトルデータA,Bを要素毎に比較する比較回路20と、ベクトルデータA,Bを保持するベクトルデータ保持回路30と、比較回路20の比較結果を示す情報から、ベクトルデータ保持回路30のベクトルデータA,Bのどちらか一方を選択する選択回路40とを有している。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a functional block diagram for explaining an embodiment of the present invention. Referring to FIG. 1, in the embodiment of the present invention, a
比較回路20は(A−B)の減算を行うものであり、最大値演算の場合、減算結果が0以上のときA≧Bを示す情報(“0”)を生成し、減算結果が負の値のときA<Bを示す情報(“1”)を生成する。選択回路40は、この比較情報がA≧Bを示す情報のとき、ベクトルデータ保持回路30からベクトルデータAを選択し、A<Bを示す情報のとき、ベクトルデータ保持回路30からベクトルデータBを選択する。
The
最小値演算の場合には、選択回路40は、比較情報がA≧Bを示す情報(“0”)のとき、ベクトルデータ保持回路30からベクトルデータBを選択し、A<Bを示す情報(“1”)のとき、ベクトルデータ保持回路30からベクトルデータAを選択する。この選択回路40の出力が演算結果Cとなる。
In the case of the minimum value calculation, the
このようにして、本発明では、ベクトルデータを連続して演算するベクトル演算回路において、入力される複数のベクトルデータの各々を比較に要する時間だけ保持するベクトルデータ保持回路30と、比較演算回路20の比較結果に応じて、ベクトルデータ保持回路30に保持されるベクトルデータの内最も大きい要素(小さい要素)を選択する選択回路40を設けているので、最大値(最小値)を要素毎に、一つのベクトル命令で算出できることになる。
Thus, according to the present invention, in the vector operation circuit that continuously calculates the vector data, the vector
図2は本発明の具体的構成を示す実施例の回路図であり、図1と同等部分は同一符号により示している。図2を参照すると、本実施例のベクトル演算装置は、複数のベクトルデータを保持するベクトルデータレジスタ41,42,43と、ベクトルデータレジスタ41及び42からそれぞれ連続して読み出されるベクトルデータA及びBの各々を保持するレジスタ10及び11と、これらレジスタ10及び11に保持されたベクトルデータA及びBを2入力とするベクトル比較回路20とを有する。レジスタ10,11はベクトルデータA,Bの各々を入力として保持し、比較回路20へ供給することを要素数だけ連続して行うものである。
FIG. 2 is a circuit diagram of an embodiment showing a specific configuration of the present invention, and the same parts as those in FIG. 1 are denoted by the same reference numerals. Referring to FIG. 2, the vector arithmetic unit of this embodiment includes
ベクトル比較回路20は、ベクトルデータAを保持するレジスタ10と、ベクトルデータBを保持するレジスタ11との2入力オペランドを受けて、(A−B)の減算を行って比較情報(“0”または“1”)を生成し、選択回路40に出力するものである。レジスタ31はベクトルデータAを保持し、またレジスタ32はベクトルデータBを保持し、それぞれ選択回路40に出力するものである。
The
選択回路40は、ベクトル比較回路20による(A−B)の減算結果、すなわち比較情報から、最大値演算の場合、比較情報が0以上のとき(A≧Bを示す“0”のとき)ベクトルデータAを選択し、また負の値のとき(A<Bを示す“1”のとき)Bを選択する。最小値演算の場合には、選択回路40は、ベクトル比較回路20による比較情報が0以上のとき(A≧Bを示す“0”のとき)ベクトルデータBを、負の値のとき(A<Bを示す“1”のとき)Aを選択して、演算結果Cとして出力する。この演算結果Cはベクトルデータレジスタ43及び41,42のいずれかに格納されることになる。
When the maximum value is calculated from the subtraction result of (A−B) by the
図2において、最大値演算を行う命令について動作を説明する。ベクトルデータA,Bは、それぞれ、要素数が連続してレジスタ10,11に保持されて比較回路20に供給される。同時に、ベクトルデータ保持回路30のレジスタ31にベクトルデータAが、レジスタ32にベクトルデータBが、それぞれ保持された後、選択回路40に供給される。
In FIG. 2, the operation of the instruction for performing the maximum value calculation will be described. The vector data A and B are supplied to the
ベクトル比較回路20では、供給されるベクトルデータAとベクトルデータBとが減算されて比較され、ベクトルデータAがBより大きい、またはBと一致した場合には“0”を出力し、またベクトルデータAがBより小さい場合には“1”を生成して比較情報として選択回路40に供給する。
In the
選択回路40において、比較対象に対応するベクトルデータ保持回路30で保持されたベクトルデータA,Bは選択回路40によって次のように選択される。すなわち、最大値演算の場合には、比較情報が“0”のときレジスタ31のベクトルデータAが、“1”のときレジスタ32のベクトルデータBが、それぞれ選択される。
In the
また、最小値演算の場合には、比較情報が“0”のときレジスタ32のベクトルデータBが、“1”のときレジスタ31のベクトルデータAが、それぞれ選択されることになる。これにより、最大値または最小値としての演算結果が得られるのである。以上の動作は要素数分を連続して行われ、要素毎に最大値(最小値)を算出することができる。
In the case of the minimum value calculation, the vector data B of the
以上述べたように、要素毎に最大値(最小値)演算を算出するベクトル命令を生成して供給することにより、最大値(最小値)演算が一つのベクトル命令で要素毎に可能になるのである。また、この演算が行われ次第、ベクトルデータレジスタでの要素の保持の必要がなくなり、よって次の要素のベクトルデータレジスタへの書込みが可能となり、処理速度の大幅な向上が可能となる。 As described above, by generating and supplying a vector instruction that calculates the maximum (minimum) operation for each element, the maximum (minimum) operation can be performed for each element with one vector instruction. is there. Further, as soon as this operation is performed, it is not necessary to hold the element in the vector data register, so that the next element can be written to the vector data register, and the processing speed can be greatly improved.
上記の実施例では、ベクトル比較回路20は、(A−B)の減算結果である比較情報が0以上のとき“0”を生成し、負の値のとき“1”を生成しているが、逆に、比較情報が0以上のとき“1”を生成し、負の値のとき“0”を生成してもよいことは明白である。
In the above embodiment, the
本発明はスーパーコンピュータのベクトル計算機におけるベクトル演算装置に適用可能であるが、広く一般のベクトル演算に適用できることは勿論である。 The present invention can be applied to a vector calculation device in a supercomputer vector computer, but it is needless to say that the present invention can be widely applied to general vector calculations.
10,11,31,32 レジスタ
20 比較回路
30 ベクトルデータ保持回路
40 選択回路
41〜43 ベクトルデータレジスタ
10, 11, 31, 32 registers
20 Comparison circuit
30 Vector data holding circuit
40 selection circuit
41-43 vector data register
Claims (4)
前記ベクトルデータの各々を保持する保持手段と、
前記ベクトルデータの比較演算をなす比較手段と、
この比較手段の比較結果に応じて前記保持手段に保持されているベクトルデータの一つを選択して最大値(または最小値)として導出する選択手段とを含むことを特徴とするベクトル演算装置。 A vector arithmetic device for continuously calculating vector data to obtain a maximum value (or minimum value),
Holding means for holding each of the vector data;
A comparison means for performing a comparison operation of the vector data;
And a selection means for selecting one of the vector data held in the holding means in accordance with the comparison result of the comparison means and deriving it as a maximum value (or minimum value).
前記ベクトルデータの各々を保持する保持ステップと、
前記ベクトルデータの比較演算をなす比較ステップと、
この比較結果に応じて前記保持ステップで保持されたベクトルデータの一つを選択して最大値(または最小値)として導出する選択ステップとを含むことを特徴とするベクトル演算方法。 A vector calculation method for continuously calculating vector data to obtain a maximum value (or minimum value),
Holding step for holding each of the vector data;
A comparison step for performing a comparison operation of the vector data;
A selection step of selecting one of the vector data held in the holding step according to the comparison result and deriving it as a maximum value (or minimum value).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006350809A JP2008165279A (en) | 2006-12-27 | 2006-12-27 | Vector arithmetic unit and its method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006350809A JP2008165279A (en) | 2006-12-27 | 2006-12-27 | Vector arithmetic unit and its method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008165279A true JP2008165279A (en) | 2008-07-17 |
Family
ID=39694751
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006350809A Pending JP2008165279A (en) | 2006-12-27 | 2006-12-27 | Vector arithmetic unit and its method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008165279A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016537726A (en) * | 2013-11-15 | 2016-12-01 | クゥアルコム・インコーポレイテッドQualcomm Incorporated | Vector processing engine with merging circuit between execution unit and vector data memory and associated method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS622363A (en) * | 1985-06-27 | 1987-01-08 | Nec Corp | Arithmetic unit |
JPH02162419A (en) * | 1988-12-15 | 1990-06-22 | Koufu Nippon Denki Kk | Data retrieving circuit |
JPH0398163A (en) * | 1989-09-11 | 1991-04-23 | Koufu Nippon Denki Kk | Vector data processor |
JPH05324699A (en) * | 1991-11-13 | 1993-12-07 | Nec Corp | Vector arithmetic device |
-
2006
- 2006-12-27 JP JP2006350809A patent/JP2008165279A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS622363A (en) * | 1985-06-27 | 1987-01-08 | Nec Corp | Arithmetic unit |
JPH02162419A (en) * | 1988-12-15 | 1990-06-22 | Koufu Nippon Denki Kk | Data retrieving circuit |
JPH0398163A (en) * | 1989-09-11 | 1991-04-23 | Koufu Nippon Denki Kk | Vector data processor |
JPH05324699A (en) * | 1991-11-13 | 1993-12-07 | Nec Corp | Vector arithmetic device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016537726A (en) * | 2013-11-15 | 2016-12-01 | クゥアルコム・インコーポレイテッドQualcomm Incorporated | Vector processing engine with merging circuit between execution unit and vector data memory and associated method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101105474B1 (en) | Instructions and logic to perform range detection | |
JP2008071130A (en) | Simd type microprocessor | |
US9678716B2 (en) | Apparatus and method for performing absolute difference operation | |
KR102266303B1 (en) | Controlling the operation speed of stages in an asynchronous pipeline | |
JP2010271818A (en) | Device and method of instruction fusion calculation | |
KR20180035211A (en) | Vector arithmetic instruction | |
JP2013543175A (en) | General logic operation method and apparatus | |
CN101320324A (en) | Processor device and composite condition processing method | |
JP4892022B2 (en) | Compiling device and compiling program | |
CN111752613A (en) | Processing of iterative operations | |
JP2009271598A (en) | Processor | |
WO2017014892A1 (en) | Mixed-width simd operations having even-element and odd-element operations using register pair for wide data elements | |
JP2009048367A (en) | Circuit design method, and integrated circuit manufactured by the method | |
JP6428488B2 (en) | Adder / Subtractor and Control Method of Adder / Subtractor | |
JP2008165279A (en) | Vector arithmetic unit and its method | |
CN105630680B (en) | Random test program generation method | |
JP2007334563A (en) | Vector processing device with mask | |
JP6555005B2 (en) | Optimization device, method and program | |
JP2009086870A (en) | Vector processing device | |
CN114035848A (en) | A method, device and processor for branch prediction | |
US11080054B2 (en) | Data processing apparatus and method for generating a status flag using predicate indicators | |
JP4289277B2 (en) | Electronic device, computer, cooling control method, and cooling control program | |
JP2011060048A (en) | Apparatus, method and program for processing information | |
JP2009267606A (en) | Computing unit | |
JP2010204913A (en) | Vector processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20091113 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110207 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110301 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110404 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20110621 |