JPH0863459A - Arithmetic processing method and arithmetic processing device - Google Patents
Arithmetic processing method and arithmetic processing deviceInfo
- Publication number
- JPH0863459A JPH0863459A JP19438394A JP19438394A JPH0863459A JP H0863459 A JPH0863459 A JP H0863459A JP 19438394 A JP19438394 A JP 19438394A JP 19438394 A JP19438394 A JP 19438394A JP H0863459 A JPH0863459 A JP H0863459A
- Authority
- JP
- Japan
- Prior art keywords
- processing unit
- vector
- partial
- arithmetic
- instruction
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 10
- 238000000034 method Methods 0.000 claims description 12
- 238000010586 diagram Methods 0.000 description 9
- 230000000694 effects Effects 0.000 description 2
- 230000000630 rising effect Effects 0.000 description 2
- 230000006866 deterioration Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
Landscapes
- Complex Calculations (AREA)
Abstract
(57)【要約】
【目的】 本発明は、高速で且つ大量の演算処理を行な
う必要がある場合に用いて好適で、特に、CPUと、こ
のCPUからのベクトル演算命令を受けて複数の演算を
同時に実行しうるVUとを用い、所定ベクトルデータに
対する総和演算,総積演算等を行なう演算処理方法およ
び演算処理装置に関し、物量の増大を招くことなく収束
動作により後続命令が待機するという状況を解消し、ベ
クトル処理の高速化を実現することを目的とする。
【構成】 所定ベクトルデータに対する部分演算をVU
2により実行した後、VU2による部分演算結果に対す
る収束動作をCPU1により実行するように構成する。
(57) [Summary] [Object] The present invention is suitable for use in the case where it is necessary to perform a large amount of arithmetic processing at a high speed. The present invention relates to an arithmetic processing method and an arithmetic processing apparatus for performing a summation operation, a summation operation, etc. on predetermined vector data by using VU capable of simultaneously executing the following, and a situation in which a subsequent instruction waits due to a convergence operation without increasing the physical quantity. The purpose is to solve the problem and to realize a high-speed vector processing. [Structure] VU for partial operation on predetermined vector data
After being executed by the CPU 2, the CPU 1 executes the convergence operation for the partial calculation result by the VU 2.
Description
【0001】(目次) 産業上の利用分野 従来の技術(図11,図12) 発明が解決しようとする課題(図11,図12) 課題を解決するための手段(図1) 作用(図1) 実施例(図2〜図10) 発明の効果(Table of Contents) Industrial Application Conventional Technology (FIGS. 11 and 12) Problem to be Solved by the Invention (FIGS. 11 and 12) Means for Solving the Problem (FIG. 1) Operation (FIG. 1) ) Example (FIGS. 2-10) Effect of the invention
【0002】[0002]
【産業上の利用分野】本発明は、高速で且つ大量の演算
処理を行なう必要がある場合に用いて好適の演算処理方
法および演算処理装置に関し、特に、中央処理部(CP
U)と、この中央処理部からのベクトル演算命令を受け
て複数の演算を同時に実行しうるベクトル処理部(V
U)とを用いて、所定ベクトルデータに対する演算処理
(例えば総和演算,総積演算等)を行なう演算処理方法
および演算処理装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic processing method and an arithmetic processing device suitable for use in the case where it is necessary to perform a large amount of arithmetic processing at high speed, and more particularly to a central processing unit (CP).
U) and a vector processing unit (V) capable of simultaneously executing a plurality of calculations in response to a vector calculation instruction from the central processing unit.
U) and an arithmetic processing method and an arithmetic processing device for performing arithmetic processing (for example, total sum arithmetic, total product arithmetic etc.) on predetermined vector data.
【0003】[0003]
【従来の技術】近年、高速で且つ大量の演算処理を行な
う必要がある情報処理装置では、中央処理部〔以下CP
U(Central Processor Unit)という場合もある)のほ
かにベクトル処理部〔以下VU(Vector Unit)という場
合もある〕をそなえ、このVUに対してCPUからベク
トル演算命令を与えることにより、VUにより所定ベク
トルデータに対する演算処理を行なっている。2. Description of the Related Art In recent years, in an information processing apparatus that needs to perform a large amount of arithmetic processing at high speed, a central processing unit [hereinafter referred to as CP
In addition to U (Central Processor Unit), a vector processing unit [hereinafter also referred to as VU (Vector Unit)] is provided, and a vector operation instruction is given from the CPU to this VU Performs arithmetic processing on vector data.
【0004】このVUとしては、例えば図11もしくは
図12に示すごとく構成されたものがある。これらの図
11,図12では、いずれも総和演算処理を行なうため
の加算処理系が示されており、加算用の演算器が4つそ
なえられ、4つの加算処理(並列度4)を同時に行なえ
るようになっている。図11に示すVU30Aでは、加
算を行なうための4つの演算器31−1〜31−4と、
各演算器31−1〜31−4からの演算結果を一旦格納
するレジスタ32−1〜32−4と、演算器31−1の
入力側において後述する切換機能を果たすセレクタ33
とがそなえられている。As this VU, there is a VU configured as shown in FIG. 11 or 12, for example. 11 and 12 each show an addition processing system for performing a summation processing, and four arithmetic units for addition are provided, and four addition processing (parallelism degree 4) can be performed at the same time. It has become so. In the VU 30A shown in FIG. 11, four arithmetic units 31-1 to 31-4 for performing addition,
Registers 32-1 to 32-4 that temporarily store the calculation results from the arithmetic units 31-1 to 31-4 and a selector 33 that performs a switching function to be described later on the input side of the arithmetic unit 31-1.
Is provided.
【0005】各演算器31−1〜31−4には、図11
に示すように、それぞれ、ベクトルデータのうち、4i
+1番目,4i+2番目,4i+3番目,4i+4番目
(i=0〜n)のデータが順次入力され、部分和S1〜
S4が演算されるようになっている。つまり、各演算器
31−1〜31−4では、レジスタ32−1〜32−4
に一旦格納された前回までの加算結果〔それぞれ4i−
3番目,4i−2番目,4i−1番目,4i番目のデー
タまでの加算結果〕に、今回入力される4i+1番目,
4i+2番目,4i+3番目,4i+4番目のデータを
加算する処理を繰り返し実行することで、部分和S1〜
S4が演算される。Each of the arithmetic units 31-1 to 31-4 has a configuration shown in FIG.
As shown in FIG.
+ 1st, 4i + 2nd, 4i + 3rd, 4i + 4th (i = 0 to n) data is sequentially input, and partial sums S1 to
S4 is calculated. That is, in each of the arithmetic units 31-1 to 31-4, the registers 32-1 to 32-4 are provided.
The result of addition up to the previous time once stored in [4i-
Result of addition up to the 3rd, 4i−2nd, 4i−1th, and 4ith data].
By repeating the process of adding the 4i + 2nd, 4i + 3rd, and 4i + 4th data, the partial sum S1 to
S4 is calculated.
【0006】なお、このとき、演算器31−1の入力側
にそなえられるセレクタ33は、ベクトルデータのうち
4i+1番目のデータを順次入力するように切り換えら
れている。各演算器31−1〜31−4による部分和S
1〜S4の演算処理を終了すると、次に、演算器31−
1により、これらの部分和S1〜S4を加算する収束動
作を実行する。At this time, the selector 33 provided on the input side of the arithmetic unit 31-1 is switched to sequentially input the 4i + 1th data of the vector data. Partial sum S by each computing unit 31-1 to 31-4
When the arithmetic processing of 1 to S4 is completed, the arithmetic unit 31-
By 1, the convergence operation for adding these partial sums S1 to S4 is executed.
【0007】つまり、1サイクル目には、セレクタ33
により演算器31−2からの部分和S2を選択すること
で、この部分和S2と、レジスタ32−1に格納された
自演算器31−1による部分和S1とを演算器31−1
により加算する。2サイクル目には、セレクタ33によ
り演算器31−3からの部分和S3を選択することで、
この部分和S3と、レジスタ32−1に格納された部分
和S1+S2とを演算器31−1により加算する。That is, in the first cycle, the selector 33
By selecting the partial sum S2 from the arithmetic unit 31-2, the partial sum S2 and the partial sum S1 by the own arithmetic unit 31-1 stored in the register 32-1 are calculated by the arithmetic unit 31-1.
Add by. In the second cycle, the selector 33 selects the partial sum S3 from the arithmetic unit 31-3,
The partial sum S3 and the partial sum S1 + S2 stored in the register 32-1 are added by the calculator 31-1.
【0008】そして、3サイクル目には、セレクタ33
により演算器31−4からの部分和S4を選択すること
で、この部分和S4と、レジスタ32−1に格納された
部分和S1+S2+S3とを演算器31−1により加算
し、最終和つまり総和S=S1+S2+S3+S4が算
出され、その総和SはCPUへ通知される。また、図1
2に示すVU30Bでは、図11により前述したものと
同様の4つの演算器31−1〜31−4およびレジスタ
32−1〜32−4のほかに、演算器31−1〜31−
4による部分和S1〜S4を加算するための収束動作専
用演算器34と、この演算器34からの演算結果を一旦
格納するレジスタ35と、演算器34の入力側において
後述する切換機能を果たす2つのセレクタ36A,36
Bとがそなえられている。Then, in the third cycle, the selector 33
By selecting the partial sum S4 from the arithmetic unit 31-4 by means of this, the partial sum S4 and the partial sum S1 + S2 + S3 stored in the register 32-1 are added by the arithmetic unit 31-1, and the final sum, that is, the total sum S = S1 + S2 + S3 + S4 is calculated, and the sum S is notified to the CPU. Also, FIG.
The VU 30B shown in FIG. 2 includes four computing units 31-1 to 31-4 and registers 32-1 to 32-4 similar to those described above with reference to FIG. 11, and computing units 31-1 to 31-31.
4 dedicated arithmetic operation unit 34 for adding the partial sums S1 to S4, a register 35 for temporarily storing the operation result from this arithmetic unit 34, and a switching function to be described later on the input side of the arithmetic unit 34 One selector 36A, 36
B is provided.
【0009】演算器31−1〜31−4により、図11
により説明したものと全く同様に、部分和S1〜S4が
それぞれ算出されるが、この図12に示すVU30Bで
は、これらの部分和S1〜S4を加算する収束動作が、
演算器31−1ではなく、収束動作専用演算器34およ
びレジスタ35により実行される。つまり、1サイクル
目には、セレクタ36Aにより演算器31−1からの部
分和S1を選択するとともに、セレクタ36Bにより演
算器31−2からの部分和S2を選択することで、これ
らの部分和S1とS2とを収束動作専用演算器34によ
り加算する。The operation units 31-1 to 31-4 shown in FIG.
The partial sums S1 to S4 are calculated in exactly the same manner as described above, but in the VU 30B shown in FIG. 12, the convergence operation for adding these partial sums S1 to S4 is
It is executed by the arithmetic unit 34 for exclusive use of the convergence operation and the register 35 instead of the arithmetic unit 31-1. That is, in the first cycle, the selector 36A selects the partial sum S1 from the arithmetic unit 31-1, and the selector 36B selects the partial sum S2 from the arithmetic unit 31-2, whereby the partial sum S1. And S2 are added by the arithmetic unit 34 dedicated to the convergence operation.
【0010】2サイクル目には、セレクタ36Aにより
レジスタ34の部分和S1+S2を選択するとともに、
セレクタ36Bにより演算器31−3からの部分和S3
を選択することで、部分和S3とレジスタ35からの部
分和S1+S2とを収束動作専用演算器34により加算
する。そして、3サイクル目には、セレクタ36Aによ
りレジスタ34の部分和S1+S2+S3を選択すると
ともに、セレクタ36Bにより演算器31−4からの部
分和S4を選択することで、部分和S4とレジスタ35
からの部分和S1+S2+S3とを収束動作専用演算器
34により加算し、最終和つまり総和S=S1+S2+
S3+S4が算出され、その総和SはCPUへ通知され
る。In the second cycle, the selector 36A selects the partial sum S1 + S2 of the register 34, and
The partial sum S3 from the calculator 31-3 by the selector 36B
By selecting, the partial sum S3 and the partial sum S1 + S2 from the register 35 are added by the convergence operation dedicated arithmetic unit 34. Then, in the third cycle, the selector 36A selects the partial sum S1 + S2 + S3 of the register 34, and the selector 36B selects the partial sum S4 from the arithmetic unit 31-4, whereby the partial sum S4 and the register 35 are selected.
And the partial sum S1 + S2 + S3 from the above are added by the operation unit dedicated to the convergence operation 34, and the final sum, that is, the total sum S = S1 + S2 +
S3 + S4 is calculated, and the sum S thereof is notified to the CPU.
【0011】なお、図11,図12により上述したVU
30A,30Bでは総和演算処理を行なう場合について
説明しているが、全く同様にして総積演算処理を行なう
こともできる。The VU described above with reference to FIGS.
30A and 30B describe the case where the total sum calculation process is performed, but the total product calculation process can be performed in exactly the same manner.
【0012】[0012]
【発明が解決しようとする課題】ところで、複数の演算
を同時に行なうベクトル処理部では、部分和を算出した
後、これらの部分和をさらに全て加算する収束動作を行
なう必要がある。そこで、図11により上述したベクト
ル処理部30Aでは、収束動作を演算器31−1で行な
っているが、このベクトル処理部30Aでは、収束動作
が終わるまで、次の演算命令の実行が待たされることに
なる。この収束動作には通常数十τを要するため、その
間、次の演算命令の実行が待たされるということは、ベ
クトル処理の性能低下の大きな要因になっている。By the way, in a vector processing section for simultaneously performing a plurality of operations, it is necessary to calculate a partial sum and then perform a converging operation of further adding all the partial sums. Therefore, in the vector processing unit 30A described above with reference to FIG. 11, the converging operation is performed by the arithmetic unit 31-1. However, in the vector processing unit 30A, execution of the next arithmetic instruction is waited until the converging operation ends. become. Since this convergence operation normally requires several tens of τ, waiting for the execution of the next arithmetic instruction during that time is a major factor in the deterioration of the vector processing performance.
【0013】また、図12により上述したベクトル処理
部30Bでは、収束動作専用演算器34をそなえること
により、収束動作を見せなくしている。これにより、図
11に示すベクトル処理部30Aのように、収束動作の
ために次の演算命令が待たされることはなくなるが、収
束動作専用の演算器34やレジスタ35が必要になるた
めに、物量の増加を招くことになり好ましくない。Further, in the vector processing unit 30B described above with reference to FIG. 12, the convergence operation dedicated arithmetic unit 34 is provided so that the convergence operation is not shown. As a result, unlike the vector processing unit 30A shown in FIG. 11, the next operation instruction does not have to wait for the convergence operation, but since the operation unit 34 and the register 35 dedicated to the convergence operation are required, the physical quantity is increased. Is increased, which is not preferable.
【0014】本発明は、このような課題に鑑み創案され
たもので、物量の増大を招くことなく収束動作により後
続命令が待機するという状況を解消し、ベクトル処理の
高速化を実現した、演算処理方法および演算処理装置を
提供することを目的とする。The present invention was devised in view of such a problem, and solves the situation that the subsequent instruction waits due to the convergence operation without increasing the physical quantity and realizes the speedup of vector processing. It is an object to provide a processing method and an arithmetic processing device.
【0015】[0015]
【課題を解決するための手段】図1は本発明の原理ブロ
ック図で、この図1において、1は中央処理部(CP
U)、2は中央処理部1からのベクトル演算命令を受け
て複数の演算を同時に実行しうるベクトル処理部(V
U)で、これらの中央処理部1およびベクトル処理部2
とにより演算処理装置が構成されている。FIG. 1 is a block diagram showing the principle of the present invention. In FIG. 1, 1 is a central processing unit (CP).
U) and 2 are vector processing units (V) that can execute a plurality of operations at the same time by receiving a vector operation instruction from the central processing unit 1.
U), these central processing unit 1 and vector processing unit 2
An arithmetic processing unit is constituted by and.
【0016】そして、本発明では、所定ベクトルデータ
に対する演算処理を行なう際に、ベクトル処理部2が、
所定ベクトルデータに対する部分演算を実行し、中央処
理部1が、ベクトル処理部2による部分演算結果に対す
る収束動作を実行するようになっている(請求項1,
5)。このとき、所定ベクトルデータに対する演算処理
が総和演算処理である場合、ベクトル処理部2が、所定
ベクトルデータの部分和を求める部分演算を実行し、中
央処理部1が、ベクトル処理部2による部分和を加算す
る収束動作を実行する(請求項2,6)。In the present invention, the vector processing section 2 is configured to perform the arithmetic processing on the predetermined vector data.
The central processing unit 1 executes a partial operation on predetermined vector data, and the central processing unit 1 executes a convergence operation on the result of the partial operation by the vector processing unit 2 (claim 1,
5). At this time, when the arithmetic processing for the predetermined vector data is the total sum arithmetic processing, the vector processing unit 2 executes the partial arithmetic for obtaining the partial sum of the predetermined vector data, and the central processing unit 1 causes the partial sum by the vector processing unit 2 to be executed. A convergence operation of adding is executed (claims 2 and 6).
【0017】また、所定ベクトルデータに対する演算処
理が総積演算処理である場合も、同様に、ベクトル処理
部2が、所定ベクトルデータの部分積を求める部分演算
を実行し、中央処理部1が、ベクトル処理部2による部
分積を乗算する収束動作を実行する(請求項3,7)。
なお、ベクトル処理部2による部分演算結果を格納する
レジスタをそなえるとともに、ベクトル処理部2による
部分演算を全て終了すると中央処理部1へ部分演算終了
信号を出力する部分演算終了信号出力部をベクトル処理
部2にそなえ、中央処理部1が、部分演算終了信号出力
部からの部分演算終了信号を受けると、レジスタに格納
された部分演算結果に対する収束動作を実行するように
構成してもよい(請求項4,8)。Also, when the arithmetic processing for the predetermined vector data is the total product arithmetic processing, similarly, the vector processing unit 2 executes the partial arithmetic for obtaining the partial product of the predetermined vector data, and the central processing unit 1 A convergence operation for multiplying the partial products by the vector processing unit 2 is executed (claims 3 and 7).
The vector processing unit 2 is provided with a register for storing a partial calculation result, and a partial calculation end signal output unit that outputs a partial calculation end signal to the central processing unit 1 when all the partial calculation by the vector processing unit 2 is completed is provided with a vector processing unit. In addition to the unit 2, the central processing unit 1 may be configured to execute a convergence operation for the partial operation result stored in the register when receiving the partial operation end signal from the partial operation end signal output unit (claim). Items 4, 8).
【0018】このとき、部分演算終了信号出力部は、ベ
クトルデータのベクトル長(中央処理部1からベクトル
データやベクトル演算命令とともに送信されるもの)を
格納するベクトル長レジスタと、部分演算処理を1サイ
クル行なう毎にベクトル長レジスタに格納された値から
ベクトル処理部2の並列度(1サイクルで同時に行なわ
れる部分演算処理の数)を減算しベクトル長レジスタに
格納し直す減算部と、この減算部による減算結果を0と
比較しその減算結果が0以下になった場合に部分演算終
了信号を出力する比較部とから構成することができる
(請求項9)。At this time, the partial operation end signal output unit stores the vector length of the vector data (which is transmitted from the central processing unit 1 together with the vector data and the vector operation instruction) with the vector length register and the partial operation processing by 1. A subtraction unit that subtracts the degree of parallelism of the vector processing unit 2 (the number of partial operation processes simultaneously performed in one cycle) from the value stored in the vector length register every cycle, and stores it again in the vector length register, and this subtraction unit And a comparator for outputting a partial operation end signal when the subtraction result becomes 0 or less (claim 9).
【0019】また、中央処理部1からの演算命令を格納
する演算キューをそなえ、中央処理部1が、ベクトル処
理部2へベクトル演算命令を出力すると同時に、演算キ
ューにベクトル処理部2からレジスタに格納された部分
演算結果に対する収束動作を実行すべき旨の命令を格納
し、部分演算終了信号出力部からの部分演算終了信号を
受けると、演算キューに格納されている命令に従って、
レジスタに格納された部分演算結果に対する収束動作を
実行するように構成してもよい(請求項10)。Further, it is provided with an arithmetic queue for storing arithmetic instructions from the central processing unit 1, and the central processing unit 1 outputs the vector arithmetic instruction to the vector processing unit 2 and at the same time, the vector processing unit 2 registers in the arithmetic queue. When the instruction to execute the convergence operation for the stored partial operation result is stored and the partial operation end signal from the partial operation end signal output unit is received, according to the instruction stored in the operation queue,
You may comprise so that a convergence operation may be performed with respect to the partial calculation result stored in the register (Claim 10).
【0020】[0020]
【作用】図1により上述した本発明の演算処理方法およ
び演算処理装置では、所定ベクトルデータに対する総和
演算処理や総積演算処理といった演算処理を行なう際
に、所定ベクトルデータに対する部分演算(部分和演
算,部分積演算)を通常通りベクトル処理部2により実
行してから、ベクトル処理部2による部分演算結果に対
する収束動作(部分和の加算,部分積の乗算)が中央処
理部1により実行される。In the arithmetic processing method and the arithmetic processing apparatus of the present invention described above with reference to FIG. 1, when performing arithmetic processing such as total sum arithmetic processing and total product arithmetic processing on predetermined vector data, partial arithmetic (partial sum arithmetic) on predetermined vector data is performed. , Partial product calculation) by the vector processing unit 2 as usual, and then the central processing unit 1 executes a convergence operation (addition of partial sums, multiplication of partial products) for the partial calculation result by the vector processing unit 2.
【0021】従って、ベクトル処理部2において後続の
ベクトル演算命令が収束動作によって待機させることが
なくなるほか、ベクトル処理部2に収束動作専用の演算
器等を別途そなえる必要もなくなる(請求項1〜3,5
〜7)。なお、ベクトル処理部2において全ての部分演
算を終了しその部分演算結果がレジスタに格納される
と、このベクトル処理部2の部分演算終了信号出力部か
ら部分演算終了信号が出力される。そして、中央処理部
1においては、その部分演算終了信号を受けると、レジ
スタに格納された部分演算結果に対する収束動作が実行
される(請求項4,8)。Therefore, in the vector processing unit 2, subsequent vector operation instructions are not made to wait by the convergence operation, and it is not necessary to separately provide the vector processing unit 2 with an arithmetic unit dedicated to the convergence operation (claims 1 to 3). , 5
~ 7). When all the partial calculations are completed in the vector processing unit 2 and the partial calculation results are stored in the register, the partial calculation end signal output unit of the vector processing unit 2 outputs the partial calculation end signal. When the central processing unit 1 receives the partial operation end signal, the central processing unit 1 executes the convergence operation for the partial operation result stored in the register (claims 4 and 8).
【0022】このとき、ベクトル処理部2の部分演算終
了信号出力部では、中央処理部1から通知されたベクト
ルデータのベクトル長がベクトル長レジスタに予め格納
されており、部分演算処理を1サイクル行なう毎に、減
算部によりベクトル長レジスタの値からベクトル処理部
2の並列度が減算される。そして、その減算結果が0以
下になった場合に、全てのベクトルデータに対する部分
演算処理を終了したものと判断することができ、比較部
から部分演算終了信号を出力する(請求項9)。At this time, in the partial calculation end signal output section of the vector processing section 2, the vector length of the vector data notified from the central processing section 1 is stored in advance in the vector length register, and the partial calculation processing is performed for one cycle. For each time, the subtraction unit subtracts the parallelism of the vector processing unit 2 from the value of the vector length register. Then, when the subtraction result becomes 0 or less, it can be determined that the partial operation processing for all the vector data has been completed, and a partial operation end signal is output from the comparison section (claim 9).
【0023】また、中央処理部1がベクトル処理部2に
対してベクトル演算命令を発行すると同時に、演算キュ
ーに、レジスタに格納された部分演算結果に対する収束
動作を実行すべき旨の命令を投入することにより、中央
処理部1側では、ベクトル演算命令が突き放し制御さ
れ、その他の演算処理を続行することができる(請求項
10)。Further, the central processing unit 1 issues a vector operation instruction to the vector processing unit 2, and at the same time, inputs an instruction to execute a convergence operation for the partial operation result stored in the register into the operation queue. As a result, on the side of the central processing unit 1, the vector operation instruction is released and controlled, and other operation processing can be continued (claim 10).
【0024】[0024]
【実施例】以下、図面を参照して本発明の実施例を説明
する。図2は本発明の一実施例としての演算処理装置の
全体構成を示すブロック図であり、この図2において、
1は中央処理部(以下CPUという)、2はCPU1か
らのベクトル演算命令を受けて複数の演算を同時に実行
しうるベクトル処理部(以下VUという)である。Embodiments of the present invention will be described below with reference to the drawings. FIG. 2 is a block diagram showing the overall configuration of an arithmetic processing unit as an embodiment of the present invention. In FIG.
Reference numeral 1 is a central processing unit (hereinafter referred to as CPU), and 2 is a vector processing unit (hereinafter referred to as VU) capable of receiving a vector calculation instruction from the CPU 1 and simultaneously executing a plurality of calculations.
【0025】そして、CPU1は、このCPU1を制御
すべく図7にて後述するフローチャートに従って動作す
る制御部3と、図4により後述するごとく構成され図8
にて後述するフローチャートに従って動作する演算処理
部4とを含んで構成されている。同様に、VU2は、こ
のVU2を制御すべく図9にて後述するフローチャート
に従って動作する制御部5と、図3により後述するごと
く構成され図10にて後述するフローチャートに従って
動作する演算処理部6とを含んで構成されている。The CPU 1 is configured as described below with reference to FIG. 4 and the control unit 3 that operates according to the flowchart described later in FIG. 7 to control the CPU 1.
The calculation processing unit 4 that operates according to the flow chart described later is included. Similarly, the VU 2 includes a control unit 5 that operates according to a flowchart described below with reference to FIG. 9 to control the VU 2, and an arithmetic processing unit 6 that is configured as described below according to FIG. 3 and operates according to a flowchart described below with reference to FIG. It is configured to include.
【0026】また、7はVU2の演算処理部6にそなえ
られる部分和終了信号出力部(部分演算終了信号出力
部)で、この部分和終了信号出力部7は、VU2による
部分和演算を全て終了するとCPU1へ部分和終了信号
を出力して、CPU1にVU2にて部分和を全て求め終
わったことを知らせるためのもので、本実施例では、図
5にて後述するごとく構成されている。Reference numeral 7 denotes a partial sum end signal output unit (partial operation end signal output unit) provided in the operation processing unit 6 of the VU2. The partial sum end signal output unit 7 completes all partial sum operations by the VU2. Then, a partial sum end signal is output to the CPU 1 to notify the CPU 1 that the VU 2 has obtained all the partial sums, and this embodiment is configured as described later with reference to FIG.
【0027】さらに、8−1〜8−4はそれぞれVU2
により後述するごとく算出された部分和S1〜S4を一
旦格納するための部分和レジスタ、9は演算キューで、
この演算キュー9は、CPU1からの演算命令を格納す
るもので、CPU1がVU2へベクトル演算命令を出力
すると同時に、CPU1により、VU2から部分和レジ
スタ8−1〜8−4に格納された部分和S1〜S4の加
算(収束動作)を実行すべき旨の加算命令を格納(キュ
ーイング)されるものである。Further, 8-1 to 8-4 are VU2, respectively.
The partial sum register for temporarily storing the partial sums S1 to S4 calculated as will be described later, 9 is an operation queue,
The operation queue 9 stores the operation command from the CPU 1. When the CPU 1 outputs the vector operation command to the VU 2, the CPU 1 outputs the partial sum stored in the partial sum registers 8-1 to 8-4 from the VU 2 at the same time. An addition instruction to execute the addition (convergence operation) of S1 to S4 is stored (queuing).
【0028】ところで、本実施例では、ベクトル演算処
理として総和演算処理を行なう場合について説明するた
め、図3,図4では、それぞれ、VU2の演算処理部6
およびCPU1の演算処理部4の加算処理系の構成が示
されている。図3に示すように、VU2の演算処理部6
は、図11,図12に示した従来のものと同様に、4つ
の加算用の演算器10−1〜10−4がそなえられ、4
つの加算処理(並列度4)を同時に行なえるようになっ
ている。また、演算処理部6には、各演算器10−1〜
10−4からの演算結果を一旦格納するレジスタ11−
1〜11−4とがそなえられるほか、図5により後述す
る部分和終了信号出力部7がそなえられている。By the way, in the present embodiment, in order to explain the case of performing the total sum calculation process as the vector calculation process, the calculation processing unit 6 of the VU 2 is shown in FIGS.
Also, the configuration of the addition processing system of the arithmetic processing unit 4 of the CPU 1 is shown. As shown in FIG. 3, the arithmetic processing unit 6 of the VU 2
Is provided with four arithmetic units 10-1 to 10-4 for addition, like the conventional one shown in FIGS.
One addition process (parallelism 4) can be performed at the same time. Further, the arithmetic processing unit 6 includes each arithmetic unit 10-1 to 10-1.
Register 11- for temporarily storing the calculation result from 10-4
1 to 11-4, a partial sum end signal output unit 7 described later with reference to FIG. 5 is provided.
【0029】ここで、本実施例のVU2の演算処理部6
の動作について簡単に説明すると、図11,図12に示
した従来のものと同様に、VU2では、総和命令の起動
により、総和命令を実行して4つの部分和S1〜S4が
算出される。なお、図3に示す本実施例のVU2の演算
処理部6では、4つ並列(並列度4)で部分和S1〜S
4を作成する場合を説明しているが、並列度は2でも8
でもまたそれ以上でも構わない。Here, the arithmetic processing unit 6 of the VU 2 of the present embodiment.
To briefly explain the operation of the above, the VU2 executes the total sum instruction to calculate the four partial sums S1 to S4 as in the conventional one shown in FIGS. In addition, in the arithmetic processing unit 6 of the VU 2 of this embodiment shown in FIG.
Although the case of creating 4 is explained, even if the degree of parallelism is 2 even 8
But it can be more than that.
【0030】並列度4の本実施例の場合、例えば、4つ
の演算器10−1〜10−4のうち演算器10−1に
は、ベクトルデータのうち1,5,9,…,4n+1番
目のデータが順次取り込まれ、演算器10−2には、ベ
クトルデータのうち2,6,10,…,4n+2番目の
データが順次取り込まれる。同様に、演算器10−3に
は、ベクトルデータのうち3,7,11,…,4n+3
番目のデータが順次取り込まれ、演算器10−4には、
ベクトルデータのうち4,8,12,…,4n+4番目
のデータが順次取り込まれる。In the case of the present embodiment with the parallel degree of 4, for example, the arithmetic unit 10-1 among the four arithmetic units 10-1 to 10-4 has the 1,5,9, ..., 4n + 1th of the vector data. Of the vector data are sequentially fetched into the arithmetic unit 10-2. Similarly, in the arithmetic unit 10-3, among the vector data, 3, 7, 11, ..., 4n + 3
The th data is sequentially fetched, and the arithmetic unit 10-4
Of the vector data, the 4,8,12, ..., 4n + 4th data are sequentially fetched.
【0031】各演算器10−1〜10−4に取り込まれ
たデータは、それぞれ、レジスタ11−1〜11−4を
介しループバックパスでループしてくるデータと加算さ
れ、各演算器10−1〜10−4への入力データがなく
なるまで加算処理が行なわれて、各演算器10−1〜1
0−4により部分和S1〜S4が算出される。そして、
各演算器10−1〜10−4により算出された部分和S
1〜S4は、それぞれ、部分和レジスタ8−1〜8−4
にセットされ、同時に部分和終了信号が部分和終了信号
出力部7から出力され、CPU1へ通知されるようにな
っている。The data fetched by each of the arithmetic units 10-1 to 10-4 is added to the data looped on the loop back path via the registers 11-1 to 11-4, and each arithmetic unit 10- The addition processing is performed until there is no input data to each of the arithmetic units 10-1 to 10-4.
The partial sums S1 to S4 are calculated from 0-4. And
Partial sum S calculated by each of the arithmetic units 10-1 to 10-4
1 to S4 are partial sum registers 8-1 to 8-4, respectively.
The partial sum end signal is simultaneously output from the partial sum end signal output unit 7 to notify the CPU 1.
【0032】一方、図4に示すように、CPU1の演算
処理部4は、部分和S1〜S4を加算する収束動作を実
行すべく、部分和レジスタ8−1〜8−4に格納された
部分和S1〜S4を加算するための演算器12と、この
演算器12からの演算結果を一旦格納するレジスタ13
と、演算器12の入力側において後述する切換機能を果
たす2つのセレクタ14A,14Bとがそなえられてい
る。On the other hand, as shown in FIG. 4, the arithmetic processing unit 4 of the CPU 1 stores the parts stored in the partial sum registers 8-1 to 8-4 so as to execute the convergence operation of adding the partial sums S1 to S4. An arithmetic unit 12 for adding the sums S1 to S4 and a register 13 for temporarily storing the arithmetic result from the arithmetic unit 12.
And two selectors 14A and 14B that perform a switching function described later on the input side of the arithmetic unit 12.
【0033】なお、図4に示す演算処理部4の構成は、
図12に示した従来の収束動作専用演算器34,レジス
タ35,セレクタ36A,36Bと同一構成となってお
り、その動作・機能も同様になっている。ただし、本実
施例において、演算器12,レジスタ13,セレクタ1
4A,14Bは、収束動作を行なうために従来のように
別途そなえられたものではなく、CPU1内に通常そな
えられた部分を使用して構成されている。The configuration of the arithmetic processing unit 4 shown in FIG.
It has the same configuration as the conventional operation unit 34 for exclusive use of the convergence operation, the register 35, and the selectors 36A and 36B shown in FIG. 12, and their operations and functions are also the same. However, in the present embodiment, the arithmetic unit 12, the register 13, the selector 1
4A and 14B are not separately provided as in the conventional case for performing the converging operation, but are configured by using a portion normally provided in the CPU 1.
【0034】ここで、本実施例のCPU1の演算処理部
4の収束動作について簡単に説明すると、CPU1の演
算処理部4は、VU2の部分和終了信号出力部7から部
分演算終了信号を受けると、演算キュー9に格納されて
いる命令に従って、部分和レジスタ8−1〜8−4に格
納された部分和S1〜S4を加算する収束動作を実行す
るようになっている。The convergence operation of the arithmetic processing unit 4 of the CPU 1 of this embodiment will be briefly described below. When the arithmetic processing unit 4 of the CPU 1 receives the partial arithmetic end signal from the partial sum end signal output unit 7 of the VU 2. A convergence operation for adding the partial sums S1 to S4 stored in the partial sum registers 8-1 to 8-4 is executed in accordance with the instruction stored in the operation queue 9.
【0035】この収束動作に際して、本実施例の演算処
理部4では、1サイクル目には、セレクタ14Aにより
部分和レジスタ8−1からの部分和S1を選択するとと
もに、セレクタ14Bにより部分和レジスタ8−2から
の部分和S2を選択することで、これらの部分和S1と
S2とを演算器12により加算し、その加算結果をレジ
スタ13に格納する。In the convergence operation, in the arithmetic processing unit 4 of the present embodiment, in the first cycle, the selector 14A selects the partial sum S1 from the partial sum register 8-1 and the selector 14B selects the partial sum register 8-1. By selecting the partial sum S2 from -2, these partial sums S1 and S2 are added by the arithmetic unit 12, and the addition result is stored in the register 13.
【0036】2サイクル目には、セレクタ14Aによ
り、レジスタ13からループバックパスでループしてく
るデータ(部分和S1+S2)を選択するとともに、セ
レクタ14Bにより部分和レジスタ8−3からの部分和
S3を選択することで、部分和S3とレジスタ13から
の部分和S1+S2とを演算器12により加算し、その
加算結果をレジスタ13に格納する。In the second cycle, the selector 14A selects the data (partial sum S1 + S2) looped by the loopback path from the register 13, and the selector 14B selects the partial sum S3 from the partial sum register 8-3. By selecting, the partial sum S3 and the partial sum S1 + S2 from the register 13 are added by the arithmetic unit 12, and the addition result is stored in the register 13.
【0037】そして、3サイクル目には、セレクタ14
Aによりレジスタ13の部分和S1+S2+S3を選択
するとともに、セレクタ14Bにより部分和レジスタ8
−4からの部分和S4を選択することで、部分和S4と
レジスタ13からの部分和S1+S2+S3とを演算器
12により加算し、最終和つまり総和S=S1+S2+
S3+S4が算出され、CPU1の演算処理部4による
収束動作を完了する。Then, in the third cycle, the selector 14
The partial sum S1 + S2 + S3 of the register 13 is selected by A, and the partial sum register 8 is selected by the selector 14B.
By selecting the partial sum S4 from -4, the partial sum S4 and the partial sum S1 + S2 + S3 from the register 13 are added by the calculator 12, and the final sum, that is, the total sum S = S1 + S2 +
S3 + S4 is calculated, and the convergence operation by the arithmetic processing unit 4 of the CPU 1 is completed.
【0038】さて、次に、VU2の演算処理部6にそな
えられる部分和終了信号出力部7の構成を、図5により
説明する。この図5において、15はVLカウンタレジ
スタ(ベクトル長レジスタ)で、このVLカウンタレジ
スタ15は、CPU1からベクトルデータやベクトル演
算命令とともに送信されてくるベクトルデータのベクト
ル長VL〔ベクトル処理する要素の長さ(データ数)〕
を格納し、その後、後述する加算器16による演算結果
を更新・格納するものである。Now, the configuration of the partial sum end signal output unit 7 provided in the arithmetic processing unit 6 of the VU 2 will be described with reference to FIG. In FIG. 5, reference numeral 15 is a VL counter register (vector length register), and the VL counter register 15 is a vector length VL of vector data transmitted from the CPU 1 together with vector data and a vector operation instruction [length of vector processing element. (The number of data)]
Is stored, and then the calculation result by the adder 16 described later is updated and stored.
【0039】16は加算器(ADD,減算部)で、この
加算器16は、各演算器10−1〜10−4により部分
演算処理を1サイクル行なう毎に、VLカウンタレジス
タ15に格納された値からVU2の並列度(1サイクル
で同時に行なわれる部分演算処理の数)を減算すべく、
本実施例では−4を加算するものである。この加算器1
6による演算結果は、後述するセレクタ17を介してV
Lカウンタレジスタ15に更新・書込されるようになっ
ている。なお、VU2の並列度が8であれば、当然、加
算器16により加算される値は−8となる。Reference numeral 16 is an adder (ADD, subtraction unit), and this adder 16 is stored in the VL counter register 15 every time one cycle of partial operation processing is performed by each of the operation units 10-1 to 10-4. In order to subtract the parallelism of VU2 (the number of partial arithmetic operations performed simultaneously in one cycle) from the value,
In this embodiment, -4 is added. This adder 1
The calculation result of 6 is V through a selector 17 described later.
It is adapted to be updated / written in the L counter register 15. If the parallelism of VU2 is 8, naturally, the value added by the adder 16 is -8.
【0040】17はセレクタで、このセレクタ17は、
ベクトル命令のスタート時には、CPU1からのベクト
ル長VLを選択してVLカウンタレジスタ15に書き込
む一方、それ以降は加算器16からの演算結果を選択し
てVLカウンタレジスタ15に書き込むものである。1
8はVLカウンタチェック部(比較部)で、このVLカ
ウンタチェック部18は、加算器16による演算結果を
0と比較しその演算結果が0以下になった場合に、全て
のベクトルデータに対する部分和演算処理を終了したも
のと判断し、命令終了信号を1τ(1制御周期)間だけ
オン(High)として出力するものである。Reference numeral 17 is a selector, and this selector 17 is
At the start of the vector instruction, the vector length VL from the CPU 1 is selected and written in the VL counter register 15, and thereafter, the operation result from the adder 16 is selected and written in the VL counter register 15. 1
Reference numeral 8 denotes a VL counter checking unit (comparing unit). The VL counter checking unit 18 compares the operation result of the adder 16 with 0, and when the operation result becomes 0 or less, the partial sum for all vector data is obtained. It is determined that the arithmetic processing has been completed, and the instruction end signal is output as ON (High) for 1τ (1 control cycle).
【0041】なお、本実施例では、VLカウンタチェッ
ク部18からの出力(命令終了信号)が立ち上がった場
合にこれを直ちに部分和終了信号としては出力せず、こ
のときの命令が総和命令であるか否かを考慮し、総和命
令である場合にのみ、VLカウンタチェック部18から
の出力(命令終了信号)を部分和終了信号として出力す
べく、オペコードレジスタ19,デコーダ20およびA
NDゲート21がそなえられている。In this embodiment, when the output (instruction end signal) from the VL counter check unit 18 rises, this is not immediately output as the partial sum end signal, and the instruction at this time is the sum total instruction. Considering whether or not it is the sum instruction, the operation code register 19, the decoder 20 and the A code are output so that the output (instruction end signal) from the VL counter check unit 18 is output as the partial sum end signal only when it is the sum instruction.
An ND gate 21 is provided.
【0042】つまり、オペコードレジスタ19は、CP
U1からの命令コード(オペコード)を格納するもので
あり、デコーダ20は、オペコードレジスタ19に格納
された命令コードを解読し、総和命令である場合に立ち
上がる信号を出力するものである。そして、ANDゲー
ト21は、VLカウンタチェック部18からの出力(命
令終了信号)とデコーダ20からの出力との論理積をと
って部分和終了信号としてCPU1へ出力するものであ
る。つまり、CPU1からの命令が総和命令である場合
に、VLカウンタチェック部18からの出力(命令終了
信号)が立ち上がると、その信号が部分和終了信号とし
てCPU1へ出力されるようになっている。That is, the operation code register 19 is
The instruction code (operation code) from U1 is stored, and the decoder 20 decodes the instruction code stored in the operation code register 19 and outputs a signal that rises when it is a sum instruction. The AND gate 21 takes the logical product of the output from the VL counter check unit 18 (instruction end signal) and the output from the decoder 20 and outputs it as a partial sum end signal to the CPU 1. That is, when the instruction from the CPU 1 is the sum instruction, when the output (instruction end signal) from the VL counter check unit 18 rises, the signal is output to the CPU 1 as the partial sum end signal.
【0043】ここで、本実施例の部分和終了信号出力部
7の動作について、図6により簡単に説明する。例えば
ベクトル長VL=17,並列度が4で、CPU1から総
和命令が与えられた場合には、その命令開始時に、VL
カウンタレジスタ15にV値として“17”が書き込ま
れ、各演算器10−1〜10−4により部分和演算処理
を1サイクル行なう毎に、加算器16によって、VLカ
ウンタレジスタ15に格納される値から並列度4が減算
され、加算器16の出力およびVLカウンタレジスタ1
5の値は、“13”,“9”,“5”,“1”,“−
3”,“−7”と更新されていく。The operation of the partial sum end signal output unit 7 of this embodiment will be briefly described with reference to FIG. For example, if the vector length VL = 17, the degree of parallelism is 4, and the sum instruction is given from the CPU 1, at the start of the instruction, VL
The value stored in the VL counter register 15 by the adder 16 every time the arithmetic unit 10-1 to 10-4 performs a partial sum operation process by writing "17" as the V value into the counter register 15. The parallel degree of 4 is subtracted from the output of the adder 16 and the VL counter register 1
The values of 5 are "13", "9", "5", "1", "-".
It is updated as 3 ”and“ −7 ”.
【0044】そして、加算器16の出力が“−3”にな
った時点で、VLカウンタチェック部18からの出力
(命令終了信号)が1τの間だけ立ち上がる。このと
き、CPU1からの命令は総和命令であるので、デコー
ダ20からの出力も立ち上がっており、ANDゲート2
0からの部分和終了信号が1τ間立ち上がって、CPU
1に部分和演算を終了した旨が通知される。When the output of the adder 16 becomes "-3", the output (command end signal) from the VL counter check unit 18 rises for 1τ. At this time, since the instruction from the CPU 1 is the sum instruction, the output from the decoder 20 is also rising, and the AND gate 2
The partial sum end signal from 0 rises for 1τ and the CPU
1 is notified that the partial sum operation is completed.
【0045】次に、上述のごとく構成された本実施例の
演算処理装置における、CPU1の制御部3,演算処理
部4の動作、および、VU2の制御部5,演算処理部6
の動作をそれぞれ図7〜図10により説明する。まず、
CPU1の制御部3において制御動作が開始されると、
図7に示すように、外部から与えられた命令の解読が行
なわれ(ステップA1)、その命令がベクトル命令であ
るか否かを判定する(ステップA2)。ベクトル命令で
ない場合には、スカラ命令であると判断してそのスカラ
命令を実行した後(ステップA3)、プログラムカウン
タを更新する(ステップA4)。Next, in the arithmetic processing unit of the present embodiment configured as described above, the operations of the control unit 3 and the arithmetic processing unit 4 of the CPU 1 and the control unit 5 and the arithmetic processing unit 6 of the VU 2 are performed.
The operation will be described with reference to FIGS. First,
When the control operation is started in the control unit 3 of the CPU 1,
As shown in FIG. 7, an externally applied instruction is decoded (step A1), and it is determined whether the instruction is a vector instruction (step A2). If it is not a vector instruction, it is judged to be a scalar instruction and the scalar instruction is executed (step A3), and then the program counter is updated (step A4).
【0046】一方、ステップA2でベクトル命令である
と判定された場合には、その命令が総和命令であるか否
かを判定し(ステップA5)、総和命令である場合に
は、演算キュー9に、部分和の加算命令を投入するとと
もに(ステップA6)、VU(ベクトルユニット)2に
対してその総和命令を投入し、総和命令を実行する(ス
テップA7)。なお、ステップA5で総和命令でないと
判定された場合には、ステップA6による処理を省略し
て、そのベクトル命令をVU2へ投入してそのベクトル
命令に応じたベクトル演算処理を実行する(ステップA
7)。ベクトル命令をVU2に投入した後には、プログ
ラムカウンタを更新してから(ステップA4)、ステッ
プA1に戻る。On the other hand, if it is determined in step A2 that it is a vector instruction, it is determined whether or not the instruction is a summation instruction (step A5). If it is a summation instruction, it is stored in the operation queue 9. , A partial sum addition instruction is input (step A6), the total addition instruction is input to the VU (vector unit) 2, and the total addition instruction is executed (step A7). If it is determined in step A5 that it is not the sum instruction, the processing in step A6 is omitted, the vector instruction is input to VU2, and the vector operation processing corresponding to the vector instruction is executed (step A).
7). After the vector instruction is input to VU2, the program counter is updated (step A4), and the process returns to step A1.
【0047】さて、VU2の制御部5においては、常
時、未実行のベクトル命令があるか否かを判定しており
(ステップC1)、未実行のベクトル命令が無い場合に
は、CPU1からベクトル命令が投入されるまで待機し
ている。ステップC1で未実行のベクトル命令があると
判定された場合には、その命令を解読し(ステップC
2)、そのベクトル命令を実行できる状態であるか否か
を判定する(ステップC3)。実行できない状態である
場合、つまり、演算器10−1〜10−4等で演算処理
実行中である場合には、実行できる状態になるまで待機
する。そして、ベクトル命令を実行できる状態であれ
ば、そのベクトル命令を起動する(ステップC4)。The control unit 5 of the VU 2 constantly determines whether or not there is an unexecuted vector instruction (step C1). If there is no unexecuted vector instruction, the CPU 1 sends the vector instruction. Is waiting until is input. If it is determined in step C1 that there is an unexecuted vector instruction, that instruction is decoded (step C
2) It is determined whether the vector instruction can be executed (step C3). When it is in a non-executable state, that is, when the arithmetic processing is being executed by the arithmetic units 10-1 to 10-4, etc., it waits until it becomes the executable state. Then, if the vector instruction can be executed, the vector instruction is activated (step C4).
【0048】そして、VU2の演算処理部6では、常
時、制御部5からベクトル命令が起動されたか否かを判
定しており(ステップD1)、ベクトル命令が起動され
るまで待機している。ベクトル命令が起動されると、そ
のベクトル命令を実行し(ステップD2)、そのベクト
ル命令が終了したか否かを、図5により前述した部分和
終了信号出力部7のVLカウンタチェック部18の出力
(命令終了信号)の立ち上がりに基づいて判定する(ス
テップD3)。Then, the arithmetic processing unit 6 of the VU 2 always determines whether or not the vector instruction is activated from the control unit 5 (step D1), and stands by until the vector instruction is activated. When the vector instruction is activated, the vector instruction is executed (step D2), and whether or not the vector instruction is finished is output from the VL counter check unit 18 of the partial sum end signal output unit 7 described above with reference to FIG. The determination is made based on the rising edge of the (command end signal) (step D3).
【0049】VLカウンタチェック部18の出力(命令
終了信号)が立ち上がると、そのベクトル命令が終了し
たものと判断するが、本実施例では、さらに、VLカウ
ンタチェック部18から出力された命令終了信号が、総
和命令に基づくものであるか否かを判定する(ステップ
D4)。つまり、総和命令を終了した場合には、図5,
図6により前述した通り、デコーダ20の出力が立ち上
がり、ANDゲート21から、VLカウンタチェック部
18の命令終了信号が部分和終了信号としてCPU1へ
通知される(ステップD5)。When the output (instruction end signal) of the VL counter check unit 18 rises, it is determined that the vector instruction has ended. In the present embodiment, the instruction end signal output from the VL counter check unit 18 is further determined. Is based on the sum instruction (step D4). That is, when the summation instruction is completed, as shown in FIG.
As described above with reference to FIG. 6, the output of the decoder 20 rises, and the AND gate 21 notifies the CPU 1 of the instruction end signal of the VL counter check unit 18 as a partial sum end signal (step D5).
【0050】さらに、CPU1の演算処理部4では、常
時、VU2から部分和終了信号が送られてきたかどうか
を判定しており(ステップB1)、部分和終了信号が送
られてくるまで待機している。部分和終了信号が送られ
てくると、VU2で求められた部分和S1〜S4がそれ
ぞれ部分和レジスタ8−1〜8−4に格納されている状
態であるので、演算処理部4は、演算キュー9に入って
いる部分和の加算命令(収束動作命令)を図4により前
述したように実行する(ステップB2)。収束動作を終
了すると、演算処理部4は、部分和の加算命令を演算キ
ュー9から排出(デキュー)して(ステップB3)、再
び、部分和終了信号の待機状態となる。Further, the arithmetic processing unit 4 of the CPU 1 always determines whether or not the partial sum end signal is sent from the VU 2 (step B1), and waits until the partial sum end signal is sent. There is. When the partial sum end signal is sent, the partial sums S1 to S4 obtained by the VU2 are in the states stored in the partial sum registers 8-1 to 8-4, respectively. The partial sum addition instruction (convergence operation instruction) in the queue 9 is executed as described above with reference to FIG. 4 (step B2). When the converging operation is completed, the arithmetic processing unit 4 discharges (dequeues) the partial sum addition instruction from the arithmetic queue 9 (step B3), and again enters the partial sum end signal standby state.
【0051】このように、本発明の一実施例によれば、
所定ベクトルデータに対する部分和演算を通常通りVU
2により実行してから、その部分和S1〜S4を加算す
る収束動作をCPU1により実行することで、VU2に
おいて後続のベクトル演算命令が収束動作によって待機
させることがなくなり、ベクトル処理の大幅な高速化を
実現できるほか、収束動作をCPU1で行なうことによ
り、VU2に従来のような収束動作専用の演算器等を別
途そなえる必要もなくなり、物量の増大も招かない。Thus, according to one embodiment of the present invention,
VU for normal partial sum operation on predetermined vector data
By executing the converging operation of adding the partial sums S1 to S4 by the CPU 1 after being executed by 2, the subsequent vector operation instruction in the VU 2 is not made to wait by the converging operation, and the vector processing is significantly speeded up. In addition, since the CPU 1 performs the converging operation, it is not necessary to separately provide the VU 2 with an arithmetic unit dedicated to the converging operation, and the physical quantity is not increased.
【0052】また、本実施例によれば、VU2の部分和
終了信号出力部7により、ベクトル長VLおよびVU2
の並列度に基づいて、全てのベクトルデータに対する部
分和演算処理を終了したか否かを確実に判断することが
できるので、部分和終了信号を正確に出力でき、CPU
1において収束動作を確実に開始・実行することができ
る。Further, according to this embodiment, the vector length VL and VU2 are controlled by the partial sum end signal output unit 7 of VU2.
Since it is possible to reliably determine whether or not the partial sum calculation processing for all vector data has been completed based on the degree of parallelism of the CPU, the partial sum end signal can be accurately output, and the CPU
In 1, the convergence operation can be reliably started and executed.
【0053】さらに、本実施例によれば、CPU1がベ
クトル演算命令を発行すると同時に、演算キュー9に、
部分和の加算命令(収束動作命令)を投入することによ
り、CPU1側では、ベクトル演算命令が突き放し制御
され、その他の演算処理を続行できる。つまり、ベクト
ル演算処理をCPU1とVU2とで分担することによ
り、物量の増加を招くことなく、VU2を効率良く使用
して処理性能を大幅に向上させることができるのであ
る。Further, according to this embodiment, at the same time when the CPU 1 issues a vector operation instruction, the operation queue 9
By inputting a partial sum addition instruction (convergence operation instruction), the CPU 1 side controls the vector operation instruction to be ejected, and other operation processing can be continued. In other words, by sharing the vector operation processing between the CPU 1 and the VU 2, it is possible to efficiently use the VU 2 and significantly improve the processing performance without increasing the physical quantity.
【0054】なお、上述した実施例では、ベクトル演算
命令が総和命令である場合について説明したが、本発明
は、これに限定されるものではなく、ベクトル演算命令
が演算順序を変えても演算結果の変わらない演算命令
(例えば総積命令等)であれば、上述した実施例と同様
に適用され、上記実施例と同様の作用効果を得ることが
できる。In the above-described embodiment, the case where the vector operation instruction is the sum instruction is explained, but the present invention is not limited to this, and the operation result can be obtained even if the vector operation instruction changes the operation order. If it is an arithmetic instruction that does not change (for example, a total product instruction), it is applied in the same manner as in the above-mentioned embodiment, and the same effect as the above-mentioned embodiment can be obtained.
【0055】[0055]
【発明の効果】以上詳述したように、本発明の演算処理
方法および演算処理装置によれば、所定ベクトルデータ
に対する部分演算(部分和演算,部分積演算)を通常通
りベクトル処理部により実行してから、その部分演算結
果に対する収束動作(部分和の加算,部分積の乗算)を
中央処理部により実行することで、ベクトル処理部にお
いて後続のベクトル演算命令が収束動作によって待機さ
せることがなくなり、ベクトル処理の大幅な高速化を実
現できるほか、収束動作を中央処理部で行なうことによ
りベクトル処理部に収束動作専用の演算器等を別途そな
える必要もなくなり、物量の増大を招くこともない(請
求項1〜3,5〜7)。As described above in detail, according to the arithmetic processing method and the arithmetic processing apparatus of the present invention, the partial arithmetic operation (the partial sum arithmetic operation, the partial product arithmetic operation) on the predetermined vector data is executed by the vector processing section as usual. Then, the central processing unit executes the convergence operation (addition of partial sums, multiplication of partial products) for the partial operation result, so that the subsequent vector operation instruction in the vector processing unit does not wait by the convergence operation. Not only can the vector processing speed be significantly increased, but since the central processing unit performs the convergence operation, it is no longer necessary to separately provide an arithmetic unit or the like dedicated to the convergence operation in the vector processing unit, which does not lead to an increase in the physical quantity. Items 1-3, 5-7).
【0056】また、ベクトル処理部で全ての部分演算を
終了しその部分演算結果がレジスタに格納されると、ベ
クトル処理部から部分演算終了信号が出力されるので、
中央処理部では、その部分演算終了信号に応じ、レジス
タに格納された部分演算結果に対する収束動作を確実に
実行することができる(請求項4,8)。さらに、本発
明の演算処理装置によれば、ベクトル処理部の部分演算
終了信号出力部により、ベクトルデータのベクトル長お
よびベクトル処理部の並列度に基づいて、全てのベクト
ルデータに対する部分演算処理を終了したか否かを確実
に判断することができるので、部分演算終了信号を正確
に出力でき、中央処理部において収束動作を確実に開始
することができる(請求項9)。When all the partial calculations are completed in the vector processing section and the partial calculation results are stored in the registers, the vector processing section outputs a partial calculation end signal.
The central processing unit can surely execute the convergence operation for the partial operation result stored in the register in accordance with the partial operation end signal (claims 4 and 8). Further, according to the arithmetic processing unit of the present invention, the partial arithmetic end signal output unit of the vector processing unit ends the partial arithmetic processing for all vector data based on the vector length of the vector data and the parallelism of the vector processing unit. Since it is possible to reliably determine whether or not the partial operation is completed, the partial operation end signal can be accurately output, and the central processing unit can reliably start the converging operation (claim 9).
【0057】また、中央処理部がベクトル演算命令を発
行すると同時に、演算キューに、収束動作を実行すべき
旨の命令を投入することにより、中央処理部側では、ベ
クトル演算命令が突き放し制御され、その他の演算処理
を続行することができる。即ち、ベクトル演算処理を中
央処理部とベクトル処理部とで分担することにより、物
量の増加を招くことなく、ベクトル処理部を効率良く使
用して処理性能を大幅に向上させることができる(請求
項10)。Further, at the same time that the central processing unit issues the vector operation instruction, the instruction to execute the convergence operation is input to the operation queue, so that the vector operation instruction is released and controlled on the side of the central processing unit. Other arithmetic processing can be continued. That is, by sharing the vector calculation processing between the central processing unit and the vector processing unit, it is possible to efficiently use the vector processing unit and significantly improve the processing performance without increasing the physical quantity. 10).
【図1】本発明の原理ブロック図である。FIG. 1 is a principle block diagram of the present invention.
【図2】本発明の一実施例としての演算処理装置の全体
構成を示すブロック図である。FIG. 2 is a block diagram showing an overall configuration of an arithmetic processing unit as one embodiment of the present invention.
【図3】本実施例のベクトル処理部の要部構成を示すブ
ロック図である。FIG. 3 is a block diagram showing a main configuration of a vector processing unit according to the present embodiment.
【図4】本実施例の中央処理部の要部構成を示すブロッ
ク図である。FIG. 4 is a block diagram showing a main configuration of a central processing unit of the present embodiment.
【図5】本実施例のベクトル処理部における部分和終了
信号出力部の構成を示すブロック図である。FIG. 5 is a block diagram showing a configuration of a partial sum end signal output unit in the vector processing unit of the present embodiment.
【図6】本実施例のベクトル処理部における部分和終了
信号出力部の動作を説明するためのタイムチャートであ
る。FIG. 6 is a time chart for explaining the operation of the partial sum end signal output unit in the vector processing unit of this embodiment.
【図7】本実施例の中央処理部における制御部の動作を
説明するためのフローチャートである。FIG. 7 is a flowchart for explaining the operation of the control unit in the central processing unit of this embodiment.
【図8】本実施例の中央処理部における演算処理部の動
作を説明するためのフローチャートである。FIG. 8 is a flowchart for explaining the operation of the arithmetic processing unit in the central processing unit of the present embodiment.
【図9】本実施例のベクトル処理部における制御部の動
作を説明するためのフローチャートである。FIG. 9 is a flowchart for explaining the operation of the control unit in the vector processing unit of this embodiment.
【図10】本実施例のベクトル処理部における演算処理
部の動作を説明するためのフローチャートである。FIG. 10 is a flowchart for explaining the operation of the arithmetic processing unit in the vector processing unit of this embodiment.
【図11】従来のベクトル処理部およびその総和演算処
理動作を説明するためのブロック図である。FIG. 11 is a block diagram for explaining a conventional vector processing unit and its summing operation processing operation.
【図12】従来のベクトル処理部およびその総和演算処
理動作の他例を説明するためのブロック図である。FIG. 12 is a block diagram for explaining another example of a conventional vector processing unit and its total operation processing operation.
1 中央処理部(CPU) 2 ベクトル処理部(VU) 3,5 制御部 4,6 演算処理部 7 部分和終了信号出力部(部分演算終了信号出力部) 8 部分和レジスタ 9 演算キュー 10−1〜10−4,12 演算器 11−1〜11−4,13 レジスタ 14A,14B,17 セレクタ 15 VLカウンタレジスタ(ベクトル長レジスタ) 16 加算器(ADD,減算部) 18 VLカウンタチェック部(比較部) 19 オペコードレジスタ 20 デコーダ 21 ANDゲート 1 Central Processing Unit (CPU) 2 Vector Processing Unit (VU) 3, 5 Control Unit 4, 6 Arithmetic Processing Unit 7 Partial Sum End Signal Output Unit (Partial Operation End Signal Output Unit) 8 Partial Sum Register 9 Arithmetic Queue 10-1 -10-4,12 arithmetic unit 11-1-11-4,13 register 14A, 14B, 17 selector 15 VL counter register (vector length register) 16 adder (ADD, subtraction unit) 18 VL counter check unit (comparison unit) ) 19 opcode register 20 decoder 21 AND gate
Claims (10)
トル演算命令を受けて複数の演算を同時に実行しうるベ
クトル処理部とをそなえてなる演算処理装置により、所
定ベクトルデータに対する演算処理を行なう際に、 該所定ベクトルデータに対する部分演算を、該ベクトル
処理部により実行した後、 該ベクトル処理部による部分演算結果に対する収束動作
を、該中央処理部により実行することを特徴とする、演
算処理方法。1. An arithmetic processing device comprising a central processing unit and a vector processing unit capable of receiving a vector arithmetic instruction from the central processing unit and simultaneously executing a plurality of arithmetic operations, thereby performing arithmetic processing on predetermined vector data. When performing, the central processing unit performs a partial operation on the predetermined vector data by the vector processing unit, and then performs a convergence operation on the partial operation result by the vector processing unit by the central processing unit. Method.
が総和演算処理である場合、該所定ベクトルデータの部
分和を求める部分演算を該ベクトル処理部により実行し
た後、該ベクトル処理部による部分和を加算する収束動
作を該中央処理部により実行することをことを特徴とす
る、請求項1記載の演算処理方法。2. When the arithmetic processing for the predetermined vector data is a total sum arithmetic processing, a partial arithmetic operation for obtaining a partial sum of the predetermined vector data is executed by the vector processing unit, and then the partial sum by the vector processing unit is added. The arithmetic processing method according to claim 1, wherein the convergence operation is performed by the central processing unit.
が総積演算処理である場合、該所定ベクトルデータの部
分積を求める部分演算を該ベクトル処理部により実行し
た後、該ベクトル処理部による部分積を乗算する収束動
作を該中央処理部により実行することをことを特徴とす
る、請求項1記載の演算処理方法。3. When the calculation process for the predetermined vector data is a total product calculation process, a partial calculation for obtaining a partial product of the predetermined vector data is executed by the vector processing unit, and then the partial product is calculated by the vector processing unit. 2. The arithmetic processing method according to claim 1, wherein the convergence operation for multiplication is executed by the central processing unit.
終了すると、該ベクトル処理部から該中央処理部へ部分
演算終了信号を出力し、該中央処理部が該部分演算終了
信号を受けると前記収束動作を実行することを特徴とす
る、請求項1〜3のいずれかに記載の演算処理方法。4. When all the partial operations by the vector processing unit are completed, a partial operation end signal is output from the vector processing unit to the central processing unit, and the convergence occurs when the central processing unit receives the partial operation end signal. The arithmetic processing method according to any one of claims 1 to 3, wherein an operation is executed.
トル演算命令を受けて複数の演算を同時に実行しうるベ
クトル処理部とをそなえてなる演算処理装置において、 所定ベクトルデータに対する演算処理を行なう際に、該
ベクトル処理部が、該所定ベクトルデータに対する部分
演算を実行し、該中央処理部が、該ベクトル処理部によ
る部分演算結果に対する収束動作を実行することを特徴
とする、演算処理装置。5. An arithmetic processing device comprising a central processing unit and a vector processing unit capable of receiving a vector arithmetic instruction from the central processing unit and executing a plurality of arithmetic operations at the same time. When performing, the vector processing unit executes a partial operation on the predetermined vector data, and the central processing unit executes a convergence operation on the result of the partial operation by the vector processing unit. .
が総和演算処理である場合、該ベクトル処理部が、該所
定ベクトルデータの部分和を求める部分演算を実行し、
該中央処理部が、該ベクトル処理部による部分和を加算
する収束動作を実行することをことを特徴とする、請求
項5記載の演算処理装置。6. When the arithmetic processing for the predetermined vector data is a summation arithmetic processing, the vector processing unit executes a partial arithmetic operation for obtaining a partial sum of the predetermined vector data,
The arithmetic processing device according to claim 5, wherein the central processing unit executes a converging operation for adding partial sums by the vector processing unit.
が総積演算処理である場合、該ベクトル処理部が、該所
定ベクトルデータの部分積を求める部分演算を実行し、
該中央処理部が、該ベクトル処理部による部分積を乗算
する収束動作を実行することをことを特徴とする、請求
項5記載の演算処理装置。7. When the arithmetic processing on the predetermined vector data is a total product arithmetic processing, the vector processing unit executes a partial arithmetic operation for obtaining a partial product of the predetermined vector data,
The arithmetic processing unit according to claim 5, wherein the central processing unit executes a converging operation for multiplying a partial product by the vector processing unit.
格納するレジスタをそなえるとともに、 該ベクトル処理部による部分演算を全て終了すると、該
中央処理部へ部分演算終了信号を出力する部分演算終了
信号出力部を該ベクトル処理部にそなえ、 該中央処理部が、該部分演算終了信号出力部からの該部
分演算終了信号を受けると、該レジスタに格納された部
分演算結果に対する収束動作を実行することを特徴とす
る、請求項5〜7のいずれかに記載の演算処理装置。8. A partial calculation end signal output for providing a register for storing a partial calculation result by the vector processing unit, and outputting a partial calculation end signal to the central processing unit when all the partial calculations by the vector processing unit are completed. A vector processing unit, the central processing unit, when receiving the partial operation end signal from the partial operation end signal output unit, executes a convergence operation for the partial operation result stored in the register. The arithmetic processing unit according to any one of claims 5 to 7, which is characterized.
令とともに送られてくる、該ベクトルデータについての
ベクトル長を格納するベクトル長レジスタと、 部分演算処理を1サイクル行なう毎に、該ベクトル長レ
ジスタに格納された値から該ベクトル処理部の並列度を
減算し、該ベクトル長レジスタに格納し直す減算部と、 該減算部による減算結果を0と比較し、該減算結果が0
以下になった場合に前記部分演算終了信号を出力する比
較部とを有して構成されていることを特徴とする、請求
項8記載の演算処理装置。9. A vector length register for storing the vector length of the vector data sent from the central processing unit together with the vector data and the vector operation instruction to the partial operation end signal output section, and the partial operation processing. Every time one cycle is performed, the parallelism of the vector processing unit is subtracted from the value stored in the vector length register, and the subtraction unit re-stores the value in the vector length register, and the subtraction result by the subtraction unit is compared with 0. , The subtraction result is 0
9. The arithmetic processing device according to claim 8, further comprising: a comparison unit that outputs the partial calculation end signal when the following occurs.
る演算キューをそなえ、 該中央処理部が、該ベクトル処理部へベクトル演算命令
を出力すると同時に、該演算キューに該ベクトル処理部
から該レジスタに格納された部分演算結果に対する収束
動作を実行すべき旨の命令を格納し、 該中央処理部が、該部分演算終了信号出力部からの該部
分演算終了信号を受けると、該演算キューに格納されて
いる命令に従って、該レジスタに格納された部分演算結
果に対する収束動作を実行することを特徴とする、請求
項8または請求項9に記載の演算処理装置。10. An arithmetic queue for storing arithmetic instructions from the central processing unit, wherein the central processing unit outputs the vector arithmetic instruction to the vector processing unit, and at the same time, the vector processing unit outputs the vector arithmetic instruction to the arithmetic queue. When the central processing unit receives the partial operation end signal from the partial operation end signal output unit, an instruction to execute a convergence operation for the partial operation result stored in the register is stored in the operation queue. The arithmetic processing unit according to claim 8 or 9, wherein a converging operation is performed on the partial operation result stored in the register according to the stored instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19438394A JPH0863459A (en) | 1994-08-18 | 1994-08-18 | Arithmetic processing method and arithmetic processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19438394A JPH0863459A (en) | 1994-08-18 | 1994-08-18 | Arithmetic processing method and arithmetic processing device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0863459A true JPH0863459A (en) | 1996-03-08 |
Family
ID=16323692
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP19438394A Withdrawn JPH0863459A (en) | 1994-08-18 | 1994-08-18 | Arithmetic processing method and arithmetic processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0863459A (en) |
-
1994
- 1994-08-18 JP JP19438394A patent/JPH0863459A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2645669B2 (en) | Data processing system | |
US4594655A (en) | (k)-Instructions-at-a-time pipelined processor for parallel execution of inherently sequential instructions | |
AU639953B2 (en) | Data processing system with instruction tag apparatus | |
JP3607476B2 (en) | Method and processing apparatus for communicating integer data and floating point data via a shared data path in a microprocessor | |
JPS63131230A (en) | Information processor | |
US20130007421A1 (en) | Methods and Apparatus for Efficient Complex Long Multiplication and Covariance Matrix Implementation | |
US4683547A (en) | Special accumulate instruction for multiple floating point arithmetic units which use a putaway bus to enhance performance | |
JP3336987B2 (en) | Pipelined floating point store | |
US5428810A (en) | Allocation of resources of a pipelined processor by clock phase for parallel execution of dependent processes | |
US20130247058A1 (en) | System for scheduling the execution of tasks based on logical time vectors | |
JP7124608B2 (en) | Calculator and calculation method | |
JP2643087B2 (en) | Program processing method and computer system | |
Wang et al. | Implementing precise interruptions in pipelined RISC processors | |
JPH0863459A (en) | Arithmetic processing method and arithmetic processing device | |
US20040215937A1 (en) | Dynamically share interrupt handling logic among multiple threads | |
US5446909A (en) | Binary multiplication implemented by existing hardware with minor modifications to sequentially designate bits of the operand | |
JPH09138748A (en) | Method and apparatus for early completion of floating-point instruction | |
JPS60178580A (en) | Command control method | |
US6944750B1 (en) | Pre-steering register renamed instructions to execution unit associated locations in instruction cache | |
JPH04116726A (en) | Information processor | |
JPH07110769A (en) | Vliw type computer | |
JP2001229135A (en) | Simd type parallel computer | |
JPH0475143A (en) | Processor with task switching function | |
JP2013539144A (en) | System for scheduling task execution based on logical time vector | |
JPH031234A (en) | 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: 20011106 |