JP7078129B2 - Arithmetic processing device and control method of arithmetic processing device - Google Patents

Arithmetic processing device and control method of arithmetic processing device Download PDF

Info

Publication number
JP7078129B2
JP7078129B2 JP2020552440A JP2020552440A JP7078129B2 JP 7078129 B2 JP7078129 B2 JP 7078129B2 JP 2020552440 A JP2020552440 A JP 2020552440A JP 2020552440 A JP2020552440 A JP 2020552440A JP 7078129 B2 JP7078129 B2 JP 7078129B2
Authority
JP
Japan
Prior art keywords
value
calculation
register
address
arithmetic
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.)
Active
Application number
JP2020552440A
Other languages
Japanese (ja)
Other versions
JPWO2020084721A1 (en
Inventor
洋征 和田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Publication of JPWO2020084721A1 publication Critical patent/JPWO2020084721A1/en
Application granted granted Critical
Publication of JP7078129B2 publication Critical patent/JP7078129B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/02Digital function generators
    • G06F1/03Digital function generators working, at least partly, by table look-up
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/80Architectures of general purpose stored program computers comprising an array of processing units with common control, e.g. single instruction multiple data processors

Description

本発明は、演算処理装置及び演算処理装置の制御方法に関する。 The present invention relates to an arithmetic processing apparatus and a control method for the arithmetic processing apparatus.

近年、画像処理等で使用するデータをCPU(Central Processing Unit)等のプロセッサを用いて効率的に処理するために、1つの命令コードに基づいて複数のデータを並列に演算するSIMD(Single Instruction Multiple Data)と称する手法が提案されている。以下では、SIMDを用いた演算をSIMD演算という。 In recent years, SIMD (Single Instruction Multiple) that calculates a plurality of data in parallel based on one instruction code in order to efficiently process data used in image processing using a processor such as a CPU (Central Processing Unit). A method called Data) has been proposed. Hereinafter, the operation using SIMD is referred to as a SIMD operation.

例えば、SIMD演算は、深層学習(ディープラーニング)の畳み込み演算などで用いられる。具体的には、深層学習を実行する演算処理装置は、1つの命令に対して複数の積和演算器を用いて並列に畳み込み演算を行うといったSIMD演算を行う。 For example, the SIMD operation is used in a convolution operation of deep learning. Specifically, the arithmetic processing apparatus that executes deep learning performs SIMD operations such as performing convolution operations in parallel using a plurality of product-sum arithmetic units for one instruction.

一方、SIMD演算を行う場合に、配列の各要素の値に応じて表を参照するような場合がある。例えば、配列の各要素に対して、個々に関数値を求める場合が考えられる。この場合、関数値を求める対象の関数を区間毎に傾きが異なる直線を繋いだ折れ線により近似し、各要素が属する区間における直線を用いて個々の関数値の近似値を算出する方法がある。関数値を求める対象の関数が区間毎に傾きが異なる直線を繋いだ折れ線により近似する処理は、線形補間と呼ばれる場合がある。 On the other hand, when performing a SIMD operation, the table may be referred to according to the value of each element of the array. For example, it is conceivable to obtain the function value individually for each element of the array. In this case, there is a method of approximating the target function for which the function value is to be obtained by a broken line connecting straight lines having different slopes for each section, and calculating the approximate value of each function value using the straight line in the section to which each element belongs. The process of approximating the target function for which the function value is obtained by a polygonal line connecting straight lines having different slopes for each interval may be called linear interpolation.

このような折れ線による近似では、要素の値によって折れ線で表されるグラフのどの区分に属するかが決まるため、属する区分は要素毎に別々となる。そこで、要素毎に異なる傾きと切片を有する1次式を使用して、要素毎の関数の近似値が算出される。そのため、区分毎の傾きと切片とを組にして並べたルックアップテーブル(LUT:Look Up Table)を用意し、要素の値を上位桁だけで打ち切った値を入力としてその表を参照し、表から得られて値に基づいて1次式を計算して近似値を得る方法が考えられる。 In such an approximation by a polygonal line, the division to which the graph belongs is determined by the value of the element, so that the division to which the graph belongs is different for each element. Therefore, an approximate value of the function for each element is calculated using a linear equation having a different slope and intercept for each element. Therefore, prepare a look-up table (LUT: Look Up Table) in which the slope and intercept of each division are arranged as a set, and refer to the table by inputting the value obtained by dividing the element value only by the upper digit. A method of calculating a linear equation based on the value obtained from the above to obtain an approximate value can be considered.

例えば、近年の命令セットの中には、SIMD演算において要素毎にルックアップテーブルを参照する命令が用意されている場合がある。また、GPU(Graphical Processing Unit)では、補間演算専用の補間器が搭載される場合もある。 For example, in a recent instruction set, an instruction that refers to a look-up table for each element in a SIMD operation may be prepared. Further, the GPU (Graphical Processing Unit) may be equipped with an interpolator dedicated to interpolation calculation.

また、インデックスレジスタ内部に記憶されたインデックス値から更新される1つ以上のテーブルレジスタに記憶されたデータ要素を選択し、選択したデータ要素に対応する結果レジスタ内部の位置を決定する従来技術がある。また、レジスタファイルを4つのバンクに分け、1個のオペランドで複数個のレジスタを指定して4個のレジスタに同時にアクセスする従来技術がある。 Further, there is a prior art technique in which a data element stored in one or more table registers to be updated is selected from an index value stored in the index register, and a position in the result register corresponding to the selected data element is determined. .. Further, there is a conventional technique of dividing a register file into four banks, designating a plurality of registers with one operand, and accessing the four registers at the same time.

特開2005-174294号公報Japanese Unexamined Patent Publication No. 2005-174294 特開2002-149400号公報Japanese Unexamined Patent Publication No. 2002-149400

J. A. Pineiro, S. F. Oberman, J. M. Muller, and J. D. Bruguera, “High-speed function approximation using a minimax quadratic interpolator,” IEEE Trans. Computers, vol. 54, no. 3, pp. 304-318, 2005.J. A. Pineiro, S. F. Oberman, J. M. Muller, and J. D. Bruguera, “High-speed function approximation using a minimax quadratic interpolator,” IEEE Trans. Computers, vol. 54, no. 3, pp. 304-318, 2005.

しかしながら従来の技術では、大きなデメリットを伴うことがある。例えば、命令セットに用意された命令を使用する場合、従来は、要素の値が確定した後に、メモリから対象の表の該当エントリのアドレスの内容が読み出される。この場合、各要素のアドレス計算、メモリからの読み出し及び対象のSIMD要素に対応する位置へのデータ配送のオーバヘッドが大きく、ルックアップテーブル参照を高速にSIMDに処理する場合、大きな遅延が発生するおそれがある。 However, conventional techniques may have significant disadvantages. For example, when the instruction provided in the instruction set is used, conventionally, the contents of the address of the corresponding entry in the target table are read from the memory after the value of the element is fixed. In this case, the overhead of address calculation of each element, reading from memory, and data delivery to the position corresponding to the target SIMD element is large, and when the lookup table reference is processed to SIMD at high speed, a large delay may occur. There is.

また、GPUに搭載の補間器では、演算器をベースに、パラメータのテーブルを格納するために、大きな専用回路を追加したものが一般的である。しかし、LSIへの演算器の搭載密度を極力向上させたいという要望は大きく、追加回路の多い専用補間器の搭載は困難である。 Further, in the interpolator mounted on the GPU, it is common to add a large dedicated circuit in order to store a table of parameters based on the arithmetic unit. However, there is a great demand to improve the mounting density of the arithmetic unit on the LSI as much as possible, and it is difficult to mount a dedicated interpolator with many additional circuits.

また、更新されるテーブルレジスタを介して結果レジスタを選択する従来技術を用いても、テーブルレジスタの領域を確保することから回路規模を小さく抑えることは困難である。また、1個のオペランドで複数のレジスタに同時にアクセスする従来技術であっても、各レジスタに格納されるテーブルのサイズによりレジスタサイズが大きくなるため、複数のレジスタを配置することで回路規模が大きくなるおそれがある。 Further, even if the conventional technique of selecting the result register via the updated table register is used, it is difficult to keep the circuit scale small because the area of the table register is secured. Further, even in the conventional technique of accessing a plurality of registers at the same time with one operand, the register size becomes large depending on the size of the table stored in each register, so that the circuit scale becomes large by arranging a plurality of registers. There is a risk of becoming.

開示の技術は、上記に鑑みてなされたものであって、回路規模を小さく抑えつつ処理効率を向上させた演算処理装置及び演算処理装置の制御方法を提供することを目的とする。 The disclosed technique has been made in view of the above, and an object of the present invention is to provide an arithmetic processing apparatus and a control method of the arithmetic processing apparatus in which the processing efficiency is improved while keeping the circuit scale small.

本願の開示する演算処理装置及び演算処理装置の制御方法は、一つの態様において、記憶部は、複数の要素記憶領域を有し、複数の演算値を1つずつ前記要素記憶領域のそれぞれに格納する。演算部は、乗算器及び加算器を有する積和演算機であり、入力された要素データを基に第1選択値を生成し、前記第1選択値を基に前記要素記憶領域に格納された前記演算値の中から第1演算値を取得し、前記第1演算値を基に演算結果を取得する処理を前記乗算器及び前記加算器を用いて行うIn one embodiment of the arithmetic processing apparatus and the control method of the arithmetic processing apparatus disclosed in the present application, the storage unit has a plurality of element storage areas, and the plurality of arithmetic values are stored one by one in each of the element storage areas. do. The arithmetic unit is a product-sum arithmetic unit having a multiplier and an adder, generates a first selection value based on the input element data, and stores the first selection value in the element storage area based on the first selection value. The process of acquiring the first calculated value from the calculated values and acquiring the calculated result based on the first calculated value is performed by using the multiplier and the adder .

1つの側面では、本発明は、回路規模を小さく抑えつつ処理効率を向上させることができる。 In one aspect, the present invention can improve processing efficiency while keeping the circuit scale small.

図1は、情報処理装置の全体構成図である。FIG. 1 is an overall configuration diagram of an information processing device. 図2は、積和演算部の詳細な回路図である。FIG. 2 is a detailed circuit diagram of the product-sum calculation unit. 図3は、実施例1で使用する折れ線近似を表す図である。FIG. 3 is a diagram showing a polygonal line approximation used in the first embodiment. 図4は、直線近似関数の関数値を求めるために使用されるルックアップテーブルの一例の図である。FIG. 4 is an example of a look-up table used to obtain the function value of the linear approximation function. 図5は、実施例1に係る要素レジスタが格納する値を示した図である。FIG. 5 is a diagram showing values stored in the element register according to the first embodiment. 図6は、与えられた要素データに対応する切片の値を取得するまでの要素レジスタの状態の遷移を説明するための図である。FIG. 6 is a diagram for explaining the transition of the state of the element register until the value of the intercept corresponding to the given element data is acquired. 図7は、切片の値の取得後から演算結果取得までの要素レジスタの状態の遷移を説明するための図である。FIG. 7 is a diagram for explaining the transition of the state of the element register from the acquisition of the intercept value to the acquisition of the operation result. 図8は、図5~7で示した演算を積和演算部に行わせるためのプログラムの一例の図である。FIG. 8 is a diagram of an example of a program for causing the product-sum calculation unit to perform the operations shown in FIGS. 5 to 7. 図9は、SIMD演算命令の処理のフローチャートである。FIG. 9 is a flowchart of processing of SIMD operation instructions. 図10は、SIMD演算で要素データ毎のテーブル検索演算を実行する処理のフローチャートである。FIG. 10 is a flowchart of a process for executing a table search operation for each element data in a SIMD operation. 図11は、実施例2に係るベクタレジスタに格納されるテーブルの値の一例を示す図である。FIG. 11 is a diagram showing an example of the values of the table stored in the vector register according to the second embodiment. 図12は、2の冪乗を求める演算を積和演算部に行わせるためのプログラムの一例の図である。FIG. 12 is a diagram of an example of a program for causing the product-sum calculation unit to perform an operation for obtaining the power of 2.

以下に、本願の開示する演算処理装置及び演算処理装置の制御方法の実施例を図面に基づいて詳細に説明する。なお、以下の実施例により本願の開示する演算処理装置及び演算処理装置の制御方法が限定されるものではない。 Hereinafter, examples of the arithmetic processing apparatus and the control method of the arithmetic processing apparatus disclosed in the present application will be described in detail with reference to the drawings. The following embodiments do not limit the arithmetic processing apparatus and the control method of the arithmetic processing apparatus disclosed in the present application.

図1は、情報処理装置の全体構成図である。情報処理装置50は、PCI(Peripheral Component Interconnect)カード1及びホストコンピュータ2を有する。PCIカード1とホストコンピュータ2とはPCIバスで接続され、互いにデータの送受信を行う。 FIG. 1 is an overall configuration diagram of an information processing device. The information processing apparatus 50 includes a PCI (Peripheral Component Interconnect) card 1 and a host computer 2. The PCI card 1 and the host computer 2 are connected by a PCI bus, and data is transmitted to and received from each other.

ホストコンピュータ2は、例えば、深層学習を実行する際の全体的な管理を行う。深層学習を実行する場合、ホストコンピュータ2は、PCIカード1に対して畳み込み演算などの深層学習における所定の演算の実行を指示する。また、ホストコンピュータ2は、SIMD演算に用いる配列に含まれる要素データ毎にテーブルを参照して関数値を取得するなどのSIMD演算の実行をPCIカード1に対して指示する。 The host computer 2, for example, performs overall management when performing deep learning. When executing deep learning, the host computer 2 instructs the PCI card 1 to execute a predetermined operation in deep learning such as a convolution operation. Further, the host computer 2 instructs the PCI card 1 to execute the SIMD operation such as referring to the table for each element data included in the array used for the SIMD operation and acquiring the function value.

PCIカード1は、ホストコンピュータ2からの指示を受けて演算を実行し、演算結果をホストコンピュータ2に出力する。PCIカード1は、図1に示すように、複数の処理ユニット10、全体命令制御部11、メモリコントローラ12、メモリ13及びPCI制御部14を有する。このPCIカード1が、「演算処理装置」の一例にあたる。 The PCI card 1 receives an instruction from the host computer 2, executes an operation, and outputs the operation result to the host computer 2. As shown in FIG. 1, the PCI card 1 has a plurality of processing units 10, an overall instruction control unit 11, a memory controller 12, a memory 13, and a PCI control unit 14. This PCI card 1 corresponds to an example of a "arithmetic processing device".

PCI制御部14は、演算の実行を指示する演算命令や演算で使用する演算データの入力をホストコンピュータ2から受ける。そして、PCI制御部14は、取得した演算命令や演算データをメモリコントローラ12へ出力する。 The PCI control unit 14 receives from the host computer 2 an operation command instructing execution of an operation and an input of operation data used in the operation. Then, the PCI control unit 14 outputs the acquired arithmetic instructions and arithmetic data to the memory controller 12.

また、PCI制御部14は、指示された演算に対する演算結果の入力をメモリコントローラ12から受ける。そして、PCI制御部14は、演算結果をホストコンピュータ2へ出力する。 Further, the PCI control unit 14 receives the input of the calculation result for the instructed calculation from the memory controller 12. Then, the PCI control unit 14 outputs the calculation result to the host computer 2.

メモリコントローラ12は、演算命令や演算で使用する演算データの入力をPCI制御部14から受ける。そして、メモリコントローラ12は、取得した演算命令及び演算データをメモリ13へ格納する。 The memory controller 12 receives input of calculation instructions and calculation data used in the calculation from the PCI control unit 14. Then, the memory controller 12 stores the acquired calculation instruction and calculation data in the memory 13.

また、メモリコントローラ12は、演算を実行する際に用いる演算データのベクタレジスタ111への格納の指示を全体命令制御部11から受ける。そして、メモリコントローラ12は、指定された演算データを指定された積和演算部100のベクタレジスタ111へ格納する。ここで、メモリコントローラ12は、直列に並んだ処理ユニット10のうちの後段の処理ユニット10に対してデータを送信する場合、積和演算部100を迂回させてマルチプレクサ103へ演算データを出力する。 Further, the memory controller 12 receives an instruction from the general instruction control unit 11 to store the calculation data used when executing the calculation in the vector register 111. Then, the memory controller 12 stores the designated calculation data in the vector register 111 of the designated product-sum calculation unit 100. Here, when the memory controller 12 transmits data to the processing unit 10 in the subsequent stage among the processing units 10 arranged in series, the memory controller 12 bypasses the product-sum calculation unit 100 and outputs the calculation data to the multiplexer 103.

また、メモリコントローラ12は、演算結果の格納指示を全体命令制御部11から受けると、指定された積和演算部100のベクタレジスタ111から演算結果を取得しメモリ13へ格納する。さらに、メモリコントローラ12は、ホストコンピュータ2からPCI制御部14を介して指示を受けると、メモリ13に格納された演算結果を読み出し、PCI制御部14へ出力する。 Further, when the memory controller 12 receives an instruction to store the calculation result from the general instruction control unit 11, the memory controller 12 acquires the calculation result from the vector register 111 of the designated product-sum calculation unit 100 and stores it in the memory 13. Further, when the memory controller 12 receives an instruction from the host computer 2 via the PCI control unit 14, the memory controller 12 reads out the calculation result stored in the memory 13 and outputs it to the PCI control unit 14.

全体命令制御部11は、ホストコンピュータ2から実行が指示された演算の全体の統括管理を行う。全体命令制御部11は、ホストコンピュータ2からの指示をPCI制御部14経由で受け、メモリ13に格納された全体命令列を次々と読んでは実行する。全体命令には、メモリ13から演算命令バッファ102に演算命令列を転送する命令、メモリ13から演算データをベクタレジスタ111に格納する命令、演算命令バッファ102に格納された演算命令列を演算命令制御部101に実行開始させる命令、ベクタレジスタ111に格納された演算結果をメモリ13に格納する命令、命令列の実行を終了する命令などがある。 The general instruction control unit 11 manages the entire operation instructed to be executed by the host computer 2. The general instruction control unit 11 receives an instruction from the host computer 2 via the PCI control unit 14, reads the entire instruction sequence stored in the memory 13 one after another, and executes the instruction. The whole instruction includes an instruction to transfer an operation instruction sequence from the memory 13 to the operation instruction buffer 102, an instruction to store operation data from the memory 13 in the vector register 111, and an operation instruction sequence stored in the operation instruction buffer 102 to control the operation instruction. There are an instruction to start execution in the unit 101, an instruction to store the operation result stored in the vector register 111 in the memory 13, an instruction to end the execution of the instruction sequence, and the like.

全体命令制御部11は、演算命令列を処理ユニット10に実行させる。演算を処理ユニット10に実行させる場合、全体命令制御部11は、演算を実行する際に用いる演算データの取得をメモリコントローラ12に指示する。また、処理ユニット10における演算が完了すると、全体命令制御部11は、演算結果の格納をメモリコントローラ12に指示する。さらに、実行が指示された演算の全ての処理が完了すると、全体命令制御部11は、演算完了をメモリコントローラ12へ通知する。 The general instruction control unit 11 causes the processing unit 10 to execute the operation instruction sequence. When the processing unit 10 is made to execute the calculation, the general instruction control unit 11 instructs the memory controller 12 to acquire the calculation data used when executing the calculation. Further, when the calculation in the processing unit 10 is completed, the general instruction control unit 11 instructs the memory controller 12 to store the calculation result. Further, when all the processes of the operations instructed to be executed are completed, the general instruction control unit 11 notifies the memory controller 12 of the completion of the operations.

次に、処理ユニット10について説明する。処理ユニット10は、図1に示すように1つのPCIカード1に複数搭載される。各処理ユニット10は、並列及び直列に複数接続される。処理ユニット10は、ある態様においては128個である。処理ユニット10は、積和演算部100、演算命令制御部101、演算命令バッファ102及びマルチプレクサ103を有する。 Next, the processing unit 10 will be described. As shown in FIG. 1, a plurality of processing units 10 are mounted on one PCI card 1. A plurality of each processing unit 10 are connected in parallel and in series. The number of processing units 10 is 128 in one embodiment. The processing unit 10 includes a product-sum calculation unit 100, a calculation instruction control unit 101, a calculation instruction buffer 102, and a multiplexer 103.

演算命令制御部101は、演算命令の実行処理を管理制御する。演算命令制御部101は、個々の演算の実行の指示を全体命令制御部11から受ける。処理ユニット10で実行できる命令を、全体命令と対比させて演算命令と呼んでいるが、命令には、積和演算部に演算を行わせる狭義の演算命令のほか、汎用レジスタ(図示しない)の操作命令、分岐命令、繰り返し命令、命令列の実行を停止する命令などが含まれる。 The operation instruction control unit 101 manages and controls the execution process of the operation instruction. The operation command control unit 101 receives instructions for executing individual operations from the overall instruction control unit 11. The instructions that can be executed by the processing unit 10 are called arithmetic instructions in comparison with the whole instructions. The instructions include arithmetic instructions in the narrow sense that cause the product-sum calculation unit to perform operations, as well as general-purpose registers (not shown). It includes operation instructions, branch instructions, repeat instructions, instructions to stop the execution of an instruction sequence, and the like.

演算命令制御部101は、演算命令バッファ102に格納された演算命令を実行順に取得する。次に、演算命令制御部101は、取得した演算命令で指定された演算データの出力をベクタレジスタ111に指示する。また、演算命令制御部101は、取得した演算命令にしたがい、演算実行の指示を積和演算器112へ出力する。その後、演算命令制御部101は、積和演算器112の内で演算結果を用いた演算をループさせる。また、演算命令制御部101は、例えば、要素データ毎にテーブルを参照して関数値を取得するSIMD演算の実行命令を発行する。 The operation instruction control unit 101 acquires the operation instructions stored in the operation instruction buffer 102 in the order of execution. Next, the operation instruction control unit 101 instructs the vector register 111 to output the operation data specified by the acquired operation instruction. Further, the arithmetic instruction control unit 101 outputs an instruction to execute the arithmetic to the multiply-accumulate arithmetic unit 112 according to the acquired arithmetic instruction. After that, the arithmetic instruction control unit 101 loops the arithmetic using the arithmetic result in the multiply-accumulate arithmetic unit 112. Further, the operation instruction control unit 101 issues, for example, an execution instruction of a SIMD operation that refers to a table for each element data and acquires a function value.

演算命令バッファ102は、演算命令列を格納する記憶領域である。演算命令バッファ102は、メモリコントローラ12から入力された演算命令列を指示されたアドレスから入力順に格納する。その後、演算命令制御部101からの演算命令の取得要求を受けて、演算命令バッファ102は、演算命令制御部101に要求されたアドレスの演算命令を出力する。 The operation instruction buffer 102 is a storage area for storing an operation instruction sequence. The operation instruction buffer 102 stores the operation instruction sequence input from the memory controller 12 in the order of input from the instructed address. After that, in response to the operation instruction acquisition request from the operation instruction control unit 101, the operation instruction buffer 102 outputs the operation instruction of the requested address to the operation instruction control unit 101.

積和演算部100は、ベクタレジスタ111及び積和演算器112を有する。ただし、積和演算部100が有するベクタレジスタ111は、処理ユニット10に搭載されたベクタレジスタ全体の一部にあたる。 The product-sum calculation unit 100 has a vector register 111 and a product-sum calculation unit 112. However, the vector register 111 included in the product-sum calculation unit 100 corresponds to a part of the entire vector register mounted on the processing unit 10.

ベクタレジスタ111は、演算を実行する際に用いる演算データの入力をメモリコントローラ12から受けて、入力された演算データを格納する。その後、ベクタレジスタ111は、演算命令制御部101からの指示を受けて、演算で使用する演算データを積和演算器112に出力する。また、積和演算器112による演算のループ処理が完了後、ベクタレジスタ111は、積和演算器112の演算結果を受け取る。そして、メモリ13への出力の指示をメモリコントローラ12から受けると、ベクタレジスタ111は、指示された領域に格納された演算結果を、マルチプレクサ103へ出力する。 The vector register 111 receives the input of the calculation data used when executing the calculation from the memory controller 12, and stores the input calculation data. After that, the vector register 111 receives an instruction from the arithmetic instruction control unit 101 and outputs the arithmetic data used in the arithmetic to the multiply-accumulate arithmetic unit 112. Further, after the loop processing of the calculation by the multiply-accumulate calculator 112 is completed, the vector register 111 receives the calculation result of the product-sum calculator 112. Then, when an instruction to output to the memory 13 is received from the memory controller 12, the vector register 111 outputs the calculation result stored in the instructed area to the multiplexer 103.

また、要素データ毎にテーブルを参照して関数値を取得するSIMD演算の場合、ベクタレジスタ111は、要素データが属する区間に対応するテーブルの値を保持する。 Further, in the case of a SIMD operation in which a function value is acquired by referring to a table for each element data, the vector register 111 holds the value of the table corresponding to the section to which the element data belongs.

積和演算器112は、演算命令制御部101からの演算実行の指示を受ける。そして、積和演算器112は、ベクタレジスタ111から入力された演算データを用いて積和演算を実行する。その後、積和演算器112は、演算結果をベクタレジスタ111へ出力する。命令により累積を指示された場合は、積和演算器112は、累積演算結果を演算器内のレジスタ(アキュムレータ)に保持し、後続の累積演算命令で使用する。 The product-sum calculation unit 112 receives an instruction to execute a calculation from the calculation instruction control unit 101. Then, the product-sum calculation unit 112 executes the product-sum calculation using the calculation data input from the vector register 111. After that, the product-sum calculation unit 112 outputs the calculation result to the vector register 111. When the cumulative operation is instructed by the instruction, the multiply-accumulate operation unit 112 holds the cumulative operation result in a register (accumulator) in the operation unit and uses it in the subsequent cumulative operation instruction.

積和累積演算の場合、積和演算器112は、全ての演算が完了するまでベクタレジスタ111から入力された値に対する積和演算を繰返す。その後、積和累積演算のループ処理が終了すると、積和演算器112は、演算結果をベクタレジスタ111へ出力し、格納させる。 In the case of the product-sum accumulation operation, the product-sum calculator 112 repeats the product-sum operation on the value input from the vector register 111 until all the operations are completed. After that, when the loop processing of the product-sum accumulation operation is completed, the product-sum calculation unit 112 outputs the calculation result to the vector register 111 and stores it.

また、要素データ毎にテーブルを参照して関数値を取得するSIMD演算の場合、積和演算器112は、入力された要素データに対応する関数に含まれる係数をベクタレジスタ111の参照先を切替えつつベクタレジスタ111から順次取得する。そして、積和演算器112は、取得した因子を用いて要素データ毎の関数値を算出する。その後、積和演算器112は、演算結果をベクタレジスタ111へ出力して格納させる。 Further, in the case of the SIMD operation in which the function value is acquired by referring to the table for each element data, the multiply-accumulate unit 112 switches the reference destination of the vector register 111 to the coefficient included in the function corresponding to the input element data. At the same time, it is sequentially acquired from the vector register 111. Then, the product-sum calculator 112 calculates the function value for each element data using the acquired factor. After that, the product-sum calculation unit 112 outputs the calculation result to the vector register 111 and stores it.

ここで、図2を参照して、積和演算部100による要素データ毎にテーブルを参照して関数値を取得するSIMD演算の処理について詳細に説明する。図2は、積和演算部の詳細な回路図である。図2では、分かり易いように、演算命令制御部101から、ベクタレジスタ111A、積和演算器112A及びマルチプレクサ122Aへ延びる信号入力経路を記載した。ただし、実際には、演算命令制御部101からの入力経路は、他のベクタレジスタ111B~111C、積和演算器112B~112C及びマルチプレクサ122B~122Cへも延びる。 Here, with reference to FIG. 2, the processing of the SIMD operation for acquiring the function value by referring to the table for each element data by the product-sum calculation unit 100 will be described in detail. FIG. 2 is a detailed circuit diagram of the product-sum calculation unit. In FIG. 2, for easy understanding, a signal input path extending from the arithmetic instruction control unit 101 to the vector register 111A, the product-sum arithmetic unit 112A, and the multiplexer 122A is described. However, in reality, the input path from the arithmetic instruction control unit 101 extends to the other vector registers 111B to 111C, the multiply-accumulate arithmetic units 112B to 112C, and the multiplexers 122B to 122C.

積和演算部100は、図2に示すように、図1に示した積和演算器112を複数有する。ここでは、それぞれの積和演算器112を、積和演算器112A~112Cと表す。また、積和演算部100は、バンクと呼ばれる単位に分割されたベクタレジスタ111を有する。ここでは、バンク単位に分割された各ベクタレジスタ111を、ベクタレジスタ111A~111Cと表す。ベクタレジスタ111A~111Cは、それぞれ積和演算器112A~112Cに1対1で対応する。さらに、さらに、積和演算部100は、各ベクタレジスタ111A~111Cに対応させて、間接アドレスレジスタ121A~121C及びマルチプレクサ122A~122Cが配置される。以下の説明では、それぞれを区別しない場合、要素レジスタ113、積和演算器112、間接アドレスレジスタ121及びマルチプレクサ122と称する。 As shown in FIG. 2, the product-sum calculation unit 100 has a plurality of product-sum calculation units 112 shown in FIG. Here, each product-sum calculator 112 is represented as a product-sum calculator 112A to 112C. Further, the product-sum calculation unit 100 has a vector register 111 divided into units called banks. Here, each vector register 111 divided into bank units is represented as vector registers 111A to 111C. The vector registers 111A to 111C correspond to the multiply-accumulate calculators 112A to 112C on a one-to-one basis, respectively. Further, in the product-sum calculation unit 100, the indirect address registers 121A to 121C and the multiplexers 122A to 122C are arranged corresponding to the vector registers 111A to 111C. In the following description, when they are not distinguished, they are referred to as an element register 113, a product-sum calculator 112, an indirect address register 121, and a multiplexer 122.

ベクタレジスタ111A~111Cは、例えばRAM(Random Acccess Memory)である。ベクタレジスタ111A~111Cは、本実施例では、全部で8つ配置される。そして、ベクタレジスタ111Aがバンク#0にあたり、ベクタレジスタ111Bがバンク#1にあたり、ベクタレジスタ111Cがバンク#7にあたる場合で説明する。 The vector registers 111A to 111C are, for example, RAM (Random Acccess Memory). In this embodiment, a total of eight vector registers 111A to 111C are arranged. The case where the vector register 111A corresponds to the bank # 0, the vector register 111B corresponds to the bank # 1, and the vector register 111C corresponds to the bank # 7 will be described.

さらに、ベクタレジスタ111Aは、複数の要素レジスタ113Aを有する。また、ベクタレジスタ111Bは、複数の要素レジスタ113Bを有する。ベクタレジスタ111Cは、複数の要素レジスタ113Cを有する。ここでは、ベクタレジスタ111Aを例に説明する。 Further, the vector register 111A has a plurality of element registers 113A. Further, the vector register 111B has a plurality of element registers 113B. The vector register 111C has a plurality of element registers 113C. Here, the vector register 111A will be described as an example.

各要素レジスタ113Aは、それぞれレジスタ番号が割り当てられたラインと呼ばれる単位と対応する。ここでは、レジスタ番号を表す数値を、ベクタレジスタ111の「アドレス」という。すなわち、各要素レジスタ113Aには、それぞれアドレスが割り当てられる。ここでは、ライン##0~##511に対応する各要素レジスタ113Aが存在する場合で説明する。 Each element register 113A corresponds to a unit called a line to which a register number is assigned. Here, the numerical value representing the register number is referred to as the "address" of the vector register 111. That is, an address is assigned to each element register 113A. Here, the case where each element register 113A corresponding to the lines ## 0 to ## 511 exists will be described.

ベクタレジスタ111Aは、各サイクルで演算に用いる複数のオペランドを積和演算器112Aに供給し、また、各サイクルで演算結果をいずれかの要素レジスタ113Aに書き戻すためのリードポート及びライトポートを有する。本実施例では、ベクタレジスタ111Aは、積和演算器112Aに対して3本のリードポートを有する。 The vector register 111A has a read port and a write port for supplying a plurality of operands used for calculation in each cycle to the multiply-accumulate calculator 112A and writing back the calculation result to any element register 113A in each cycle. .. In this embodiment, the vector register 111A has three read ports for the multiply-accumulate unit 112A.

ここで、本実施例では、ベクタレジスタ111Aの各リードポートが、積和演算器112Aに直接接続されているが、接続はこれに限らず、ルータを経由してもよい。ルータを経由するにあたり、1つのリードポートがルータを経由して積和演算器112A~112Cへ接続され、他のリードポートは直接積和演算器112Aに接続されてもよい。また、複数のリードポートがルータを経由して積和演算器112A~112Cへ接続されてもよい。ルータを経由した場合、そのリードポートから出力されるデータは、積和演算器112A~112Cの何れかにオペランドとして供給されることが可能となる。 Here, in this embodiment, each read port of the vector register 111A is directly connected to the product-sum calculator 112A, but the connection is not limited to this and may be via a router. When passing through the router, one read port may be connected to the multiply-accumulate calculator 112A to 112C via the router, and the other read port may be directly connected to the product-sum calculator 112A. Further, a plurality of read ports may be connected to the multiply-accumulate calculators 112A to 112C via a router. When passing through a router, the data output from the read port can be supplied as an operand to any of the multiply-accumulate calculators 112A to 112C.

ここで、本実施例では、図3に示す折れ線近似を行った場合の関数値の取得を例に説明する。図3は、実施例1で使用する折れ線近似を表す図である。 Here, in this embodiment, the acquisition of the function value when the polygonal line approximation shown in FIG. 3 is performed will be described as an example. FIG. 3 is a diagram showing a polygonal line approximation used in the first embodiment.

本実施例では、積和演算部100は、グラフ201で示すy=f(x)を直線近似して求めたグラフ202で示すような関数に対する関数値を取得する命令を受ける。グラフ202に示すように直線近似後の関数は、区間D1ではf(x)=-0.5(x-1)+1の1次関数である。すなわち、直線近似後の関数は、区間D1では、傾きが-0.5であり切片が1.5の1次関数である。また、直線近似後の関数は、区間D2ではf(x)=0(x-2)+0.5の1次関数である。すなわち、直線近似後の関数は、区間D2では、傾きが0であり切片が0.5の1次関数である。また、直線近似後の関数は、区間D3ではf(x)=0.5(x-3)+0.5の1次関数である。すなわち、直線近似後の関数は、区間D3では、傾きが0.5であり切片が-1.0の1次関数である。また、直線近似後の関数は、区間D4ではf(x)=2(x-4)+1の1次関数である。すなわち、直線近似後の関数は、区間D4では、傾きが2であり切片が-7.0の1次関数である。また、直線近似後の関数は、区間D5ではf(x)=0.5(x-5)+3の1次関数である。すなわち、直線近似後の関数は、区間D5では、傾きが0.5であり切片が0.5の1次関数である。この直線近似後の各関数が、「所定数の同型の関数」の一例にあたる。この場合、同型の関数とは、それぞれで係数が異なる関数を指す。In this embodiment, the product-sum calculation unit 100 receives an instruction to acquire a function value for a function as shown in the graph 202 obtained by linearly approximating y = f (x) shown in the graph 201. As shown in Graph 202, the function after linear approximation is a linear function of f 1 (x) = −0.5 (x-1) + 1 in the interval D1. That is, the function after linear approximation is a linear function having a slope of −0.5 and an intercept of 1.5 in the interval D1. The function after linear approximation is a linear function of f 2 (x) = 0 (x-2) + 0.5 in the interval D2. That is, the function after linear approximation is a linear function having a slope of 0 and an intercept of 0.5 in the interval D2. The function after linear approximation is a linear function of f 3 (x) = 0.5 (x-3) + 0.5 in the interval D3. That is, the function after linear approximation is a linear function having a slope of 0.5 and an intercept of −1.0 in the interval D3. The function after linear approximation is a linear function of f 4 (x) = 2 (x-4) + 1 in the interval D4. That is, the function after linear approximation is a linear function having a slope of 2 and an intercept of −7.0 in the interval D4. The function after linear approximation is a linear function of f 5 (x) = 0.5 (x-5) + 3 in the interval D5. That is, the function after linear approximation is a linear function having a slope of 0.5 and an intercept of 0.5 in the interval D5. Each function after this linear approximation corresponds to an example of "a predetermined number of functions of the same type". In this case, a function of the same type refers to a function having a different coefficient.

区間の値を入力とした場合、グラフ202で表される直線近似関数の関数値を得るために用いられるテーブルは、図4に示すルックアップテーブル210となる。図4は、直線近似関数の関数値を求めるために使用されるルックアップテーブルの一例の図である。この場合、要素レジスタ113A~113Cには、ルックアップテーブル210に示される傾きの値及び切片の値が格納される。このベクタレジスタ111に格納された各傾きの値及び切片の値が、「演算値」の一例にあたる。 When the value of the interval is input, the table used to obtain the function value of the linear approximation function represented by the graph 202 is the look-up table 210 shown in FIG. FIG. 4 is an example of a look-up table used to obtain the function value of the linear approximation function. In this case, the element registers 113A to 113C store the slope value and the intercept value shown in the lookup table 210. The value of each slope and the value of the intercept stored in the vector register 111 correspond to an example of the "calculated value".

より具体的には、図5に示す値が要素レジスタ113A~113Cに格納される。図5は、実施例1に係る要素レジスタが格納する値を示した図である。図5では、それぞれを表すバンク#1~#7の呼称で、ベクタレジスタ111A~111Cを表した。ここでは、グラフ202の直線近似関数が全部で16区画に分かれる場合で説明する。すなわち、直線近似関数は、16個の1次関数で表される。 More specifically, the values shown in FIG. 5 are stored in the element registers 113A to 113C. FIG. 5 is a diagram showing values stored in the element register according to the first embodiment. In FIG. 5, the vector registers 111A to 111C are represented by the names of banks # 1 to # 7 representing each. Here, the case where the linear approximation function of the graph 202 is divided into 16 sections in total will be described. That is, the linear approximation function is represented by 16 linear functions.

直線近似関数の関数値を取得する場合、図5に示すように、ベクタレジスタ111A~111Cのアドレス0x000~0x00Fの各要素レジスタ113A~113Cに、直線近似関数の各区間D1~D5における1次関数の切片の値が格納される。ここでは、アドレス0x000~0x00Fの各要素レジスタ113A~113Cを切片アドレス部301とする。また、ベクタレジスタ111A~111Cのアドレス0x010~0x01Fの各要素レジスタ113A~113Cに、直線近似関数の各区間D1~D5における1次関数の傾きの値が格納される。ここでは、アドレス0x010~0x01Fの各要素レジスタ113A~113Cを、傾きアドレス部302とする。 When acquiring the function value of the linear approximation function, as shown in FIG. 5, the linear function in each interval D1 to D5 of the linear approximation function is stored in the element registers 113A to 113C of the vector registers 111A to 111C at the addresses 0x000 to 0x00F. The intercept value of is stored. Here, the element registers 113A to 113C at addresses 0x000 to 0x00F are used as the intercept address unit 301. Further, the values of the slopes of the linear functions in the sections D1 to D5 of the linear approximation function are stored in the element registers 113A to 113C at the addresses 0x010 to 0x01F of the vector registers 111A to 111C. Here, the element registers 113A to 113C at the addresses 0x010 to 0x01F are used as the tilted address unit 302.

このように、切片アドレス部301と傾きアドレス部302とは、先頭から数えた同じ位置に同じ直線近似関数の係数が格納される。この状態が、「各関数の各項に応じた所定数の係数を位置毎に連続して保持」する状態に当たる。本実施例の場合、所定数の係数は、切片の値と傾きの値の2つの係数である。関数の各項とは、一次関数における傾きを表す項及び切片を表す項にあたる。 In this way, the intercept address unit 301 and the slope address unit 302 store the coefficients of the same linear approximation function at the same positions counted from the beginning. This state corresponds to the state of "continuously holding a predetermined number of coefficients corresponding to each term of each function for each position". In the case of this embodiment, the predetermined number of coefficients are two coefficients, the intercept value and the slope value. Each term of the function corresponds to a term representing the slope and a term representing the intercept in the linear function.

また、ベクタレジスタ111A~111Cのアドレスmの各要素レジスタ113A~113CにSIMD演算に用いる配列に含まれる各要素データの値がメモリコントローラ12により格納される。より具体的には、アドレスmの各要素レジスタ113A~113Cの下位に固定小数16ビット値の要素データが格納される。ここでは、16ビットの固定小数点値の下位12ビットが小数部である場合で説明する。この固定小数点の形式は、「Q12」と表現される場合がある。また、ベクタレジスタ111A~111Cには、演算が進むことで、各要素データに対応する切片のアドレス、切片の値、傾きのアドレス及び演算結果である関数値が格納される。ここで、乗算結果及び累積値は、32ビットの固定小数点であり、下位24ビットが小数となる場合で説明する。この固定小数点の形式は、「Q24」と表現される場合がある。 Further, the value of each element data included in the array used for the SIMD operation is stored in the element registers 113A to 113C at the addresses m of the vector registers 111A to 111C by the memory controller 12. More specifically, element data having a fixed decimal value of 16 bits is stored in the lower ranks of the element registers 113A to 113C at the address m. Here, the case where the lower 12 bits of the 16-bit fixed-point value is a fractional part will be described. This fixed-point format may be expressed as "Q12". Further, as the operation progresses, the vector registers 111A to 111C store the intercept address, the intercept value, the slope address, and the function value which is the operation result corresponding to each element data. Here, the case where the multiplication result and the cumulative value are 32-bit fixed-point numbers and the lower 24 bits are decimal numbers will be described. This fixed-point format may be expressed as "Q24".

また、ベクタレジスタ111A~111Cは、対応する間接アドレスレジスタ121A~121Cからアドレスの入力を受ける。そして、ベクタレジスタ111A~111Cは、入力されたアドレスの要素レジスタ113A~113Cに格納された値を積和演算器112A~112Cへ出力する。 Further, the vector registers 111A to 111C receive an address input from the corresponding indirect address registers 121A to 121C. Then, the vector registers 111A to 111C output the values stored in the element registers 113A to 113C of the input address to the multiply-accumulate arithmetic units 112A to 112C.

ベクタレジスタ111A~111Cは、演算が終了すると、メモリコントローラ12からの指示に応じて、演算結果をメモリコントローラ12へ出力する。このベクタレジスタ111A~111Cが、「記憶部」の一例にあたる。そして、要素レジスタ113A~113Cが、「要素記憶領域」の一例にあたる。 When the calculation is completed, the vector registers 111A to 111C output the calculation result to the memory controller 12 in response to an instruction from the memory controller 12. The vector registers 111A to 111C correspond to an example of the "storage unit". The element registers 113A to 113C correspond to an example of the "element storage area".

間接アドレスレジスタ121A~121Cは、例えばFF(Flip-Flop)である。直線近似関数を用いたSIMD計算を実行する場合、計算開始前の間接アドレスレジスタ121A~121Cにはデータは未格納である。そして、間接アドレスレジスタ121A~121Cは、関数値を求める演算の途中で発生する、ベクタレジスタ111A~111Cにおける切片又は傾きが格納されたアドレスを示す間接アドレスを格納する。その後、間接アドレスレジスタ121A~121Cは、保持する値をマルチプレクサ122A~122Cを介してベクタレジスタ111Aへ出力する。この間接アドレスレジスタ121A~121Cが、「間接記憶部」の一例にあたる。 The indirect address registers 121A to 121C are, for example, FF (Flip-Flop). When the SIMD calculation using the linear approximation function is executed, the data is not stored in the indirect address registers 121A to 121C before the start of the calculation. Then, the indirect address registers 121A to 121C store indirect addresses indicating the addresses in which the intercepts or slopes in the vector registers 111A to 111C, which are generated in the middle of the operation for obtaining the function value, are stored. After that, the indirect address registers 121A to 121C output the holding values to the vector registers 111A via the multiplexers 122A to 122C. The indirect address registers 121A to 121C correspond to an example of the "indirect storage unit".

マルチプレクサ122A~122Cは、間接アドレスレジスタ121A~121Cからの入力とメモリコントローラ12からの入力の2つの入力を受ける。そして、マルチプレクサ122A~122Cは、演算命令制御部101からの指示を受けて、2つの入力のいずれかを選択する。その後、マルチプレクサ122A~122Cは、選択した入力をベクタレジスタ111A~111Cへ出力する。 The multiplexers 122A to 122C receive two inputs, an input from the indirect address registers 121A to 121C and an input from the memory controller 12. Then, the multiplexers 122A to 122C select one of the two inputs in response to an instruction from the arithmetic instruction control unit 101. After that, the multiplexers 122A to 122C output the selected input to the vector registers 111A to 111C.

次に、図6及び7を参照して積和演算器112A~112Cの機能を説明する。図6は、与えられた要素データに対応する切片の値を取得するまでの要素レジスタの状態の遷移を説明するための図である。また、図7は、切片の値の取得後から演算結果取得までの要素レジスタの状態の遷移を説明するための図である。この積和演算器112A~112Cが、「演算部」の一例にあたる。 Next, the functions of the multiply-accumulate calculators 112A to 112C will be described with reference to FIGS. 6 and 7. FIG. 6 is a diagram for explaining the transition of the state of the element register until the value of the intercept corresponding to the given element data is acquired. Further, FIG. 7 is a diagram for explaining the transition of the state of the element register from the acquisition of the intercept value to the acquisition of the operation result. The multiply-accumulate calculators 112A to 112C correspond to an example of the "calculation unit".

図6に示すように、積和演算器112Aは、ベクタレジスタ111Aのアドレスmに格納された要素データの値を12ビット右シフトさせ上位4ビットを取得する。そして、積和演算器112Aは、取得した4ビットのデータをアドレスnの要素レジスタ113Aに格納する(ステップS1)。このアドレスnの要素レジスタ113Aに格納された4ビットのデータは、要素データに対応する切片の値を保持する要素レジスタ113Aのアドレスである。以下では、このアドレスnの要素レジスタ113Aに格納された4ビットのデータを切片アドレスと言う。この切片アドレスが、「第1選択値」及び「第1番号」の一例にあたる。 As shown in FIG. 6, the multiply-accumulate calculator 112A shifts the value of the element data stored in the address m of the vector register 111A to the right by 12 bits and acquires the upper 4 bits. Then, the multiply-accumulate calculator 112A stores the acquired 4-bit data in the element register 113A at the address n (step S1). The 4-bit data stored in the element register 113A at the address n is the address of the element register 113A that holds the value of the intercept corresponding to the element data. Hereinafter, the 4-bit data stored in the element register 113A of the address n is referred to as an intercept address. This intercept address corresponds to an example of the "first selection value" and the "first number".

次に、積和演算器112は、アドレスnの要素レジスタ113Aに格納された切片アドレスを取得し間接アドレスレジスタ121Aにセットする(ステップS2)。次に、アドレスpの要素レジスタ113Aに、メモリコントローラ12から入力された値である1.0が格納される。その後、間接アドレスレジスタ121Aにセットされた切片アドレスがベクタレジスタ111Aに入力されることで(ステップS3)、積和演算器112は、切片アドレスの要素レジスタ113Aから出力された切片の値を取得する。さらに、積和演算器112は、アドレスpの要素レジスタ113Aから1.0を取得する。そして、積和演算器112は、切片の値に1.0を乗算した値をアドレスqの要素レジスタ113Aへ格納する(ステップS4)。この積和演算器112により格納された切片の値が、「第1演算値」及び「第1係数」の一例にあたる。 Next, the multiply-accumulate calculator 112 acquires the intercept address stored in the element register 113A of the address n and sets it in the indirect address register 121A (step S2). Next, 1.0, which is a value input from the memory controller 12, is stored in the element register 113A at the address p. After that, the intercept address set in the indirect address register 121A is input to the vector register 111A (step S3), and the multiply-accumulate unit 112 acquires the intercept value output from the element register 113A of the intercept address. .. Further, the product-sum calculator 112 acquires 1.0 from the element register 113A at the address p. Then, the product-sum calculator 112 stores the value obtained by multiplying the intercept value by 1.0 in the element register 113A at the address q (step S4). The value of the intercept stored by the product-sum calculator 112 corresponds to an example of the "first calculated value" and the "first coefficient".

次に、図7に示すように、積和演算器112は、アドレスnの要素レジスタ113Aに格納された値を取得する。そして、積和演算器112は、取得した値に直線近似関数に含まれる一次関数の数である16を付加し、アドレスnの要素レジスタ113Aに再度格納する(ステップS5)。このときアドレスnの要素レジスタ113Aに格納されたデータは、要素データに対応する傾きの値を保持する要素レジスタ113Aのアドレスである。以下では、このときアドレスnの要素レジスタ113Aに格納された値を傾きアドレスと言う。ここで、各切片の値及び傾きの値は、ベクタレジスタ111において16個ごとに格納される。すなわち、16を足すことで、切片アドレスで指定された要素レジスタ113Aの切片アドレス部301における位置と同じ傾きアドレス部302における位置を示す傾きアドレスが生成できる。この傾きアドレスが、「第2選択値」及び「第2番号」の一例にあたる。 Next, as shown in FIG. 7, the multiply-accumulate calculator 112 acquires the value stored in the element register 113A at the address n. Then, the product-sum calculator 112 adds 16 which is the number of linear functions included in the linear approximation function to the acquired value, and stores it in the element register 113A of the address n again (step S5). At this time, the data stored in the element register 113A at the address n is the address of the element register 113A holding the value of the slope corresponding to the element data. In the following, the value stored in the element register 113A of the address n at this time is referred to as a tilted address. Here, the value of each intercept and the value of the slope are stored in the vector register 111 every 16 pieces. That is, by adding 16, it is possible to generate a tilted address indicating a position in the tilted address section 302 that is the same as the position in the section address section 301 of the element register 113A specified by the intercept address. This tilt address corresponds to an example of the "second selection value" and the "second number".

次に、積和演算器112は、アドレスnの要素レジスタ113Aに格納された傾きアドレスを取得し間接アドレスレジスタ121Aにセットする(ステップS6)。 Next, the multiply-accumulate calculator 112 acquires the tilted address stored in the element register 113A of the address n and sets it in the indirect address register 121A (step S6).

その後、間接アドレスレジスタ121Aにセットされた傾きアドレスがベクタレジスタ111Aに入力されることで(ステップS7)、積和演算器112は、傾きアドレスの要素レジスタ113Aから出力された傾きの値を取得する。この傾きの値が、「第2演算値」及び「第2係数」の一例にあたる。 After that, the tilt address set in the indirect address register 121A is input to the vector register 111A (step S7), so that the multiply-accumulate calculator 112 acquires the tilt value output from the element register 113A of the tilt address. .. The value of this slope corresponds to an example of the "second calculated value" and the "second coefficient".

また、積和演算器112Aは、アドレスmの要素レジスタ113Aから要素データを取得する。さらに、積和演算器112Aは、アドレスqの要素レジスタ113Aから切片の値を取得する。そして、積和演算器112は、傾きの値と要素データとを掛け合わせ、掛けあわせた結果に切片の値を加算して、要素データに対応する直線近似関数の関数値を求める。その後、積和演算器112は、求めた関数値をアドレスqの要素レジスタ113Aに格納する(ステップS6)。 Further, the product-sum calculator 112A acquires element data from the element register 113A at the address m. Further, the multiply-accumulate calculator 112A acquires the intercept value from the element register 113A at the address q. Then, the product-sum calculator 112 multiplies the slope value and the element data, adds the intercept value to the multiplied result, and obtains the function value of the linear approximation function corresponding to the element data. After that, the product-sum calculator 112 stores the obtained function value in the element register 113A at the address q (step S6).

図8は、図5~7で示した演算を積和演算部に行わせるためのプログラムの一例の図である。以下では、紙面に向かって左端の行番号を用いてプログラムが積和演算部100に実行させる処理を説明する。図8のプログラムでは、アドレスm、n、p、qの要素レジスタ113AをそれぞれFR#m、#n、#p、#qとして表した。また、間接アドレスレジスタ121AをIND_REGと表した。 FIG. 8 is a diagram of an example of a program for causing the product-sum calculation unit to perform the operations shown in FIGS. 5 to 7. In the following, a process of causing the product-sum calculation unit 100 to execute the program using the line number on the left end of the paper will be described. In the program of FIG. 8, the element registers 113A of the addresses m, n, p, and q are represented as FR # m, # n, # p, and # q, respectively. Further, the indirect address register 121A is represented as IND_REG.

1行目は、アドレスmの要素レジスタ113Aから固定小数点値を取得し、取得した固定小数点値を12ビット右にシフトさせ上位4ビットを取得し、取得した4ビットのデータをアドレスnの要素レジスタ113Aの下位4ビットにセットさせる処理を表す。この4ビットのデータは、切片アドレスである。 The first line acquires a fixed-point value from the element register 113A at address m, shifts the acquired fixed-point value to the right by 12 bits, acquires the upper 4 bits, and uses the acquired 4-bit data as the element register at address n. It represents the process of setting to the lower 4 bits of 113A. This 4-bit data is the intercept address.

2行目は、アドレスnの要素レジスタ113Aにセットされた切片アドレスを間接アドレスレジスタ121Aへ格納させる処理を表す。 The second line represents a process of storing the intercept address set in the element register 113A of the address n in the indirect address register 121A.

3行目は、1.0をアドレスpの要素レジスタ113Aに格納させる処理を表す。 The third line represents a process of storing 1.0 in the element register 113A at the address p.

4行目は、間接アドレスレジスタ121Aに格納された値に、アドレスpの要素レジスタ113Aに格納された値に乗算させ、乗算結果をアドレスqの要素レジスタ113Aに格納させる処理を表す。すなわち、4行目は、間接アドレスレジスタ121Aに格納された切片の値をアドレスqの要素レジスタ113Aに格納させる処理にあたる。ここまでで、図6に示した処理が終了する。 The fourth line represents a process of multiplying the value stored in the indirect address register 121A by the value stored in the element register 113A of the address p and storing the multiplication result in the element register 113A of the address q. That is, the fourth line corresponds to the process of storing the intercept value stored in the indirect address register 121A in the element register 113A of the address q. Up to this point, the process shown in FIG. 6 is completed.

5行目は、アドレスnの要素レジスタ113Aに格納された値に0x010を加算して、加算結果である傾きアドレスを間接アドレスレジスタ121Aに格納させる処理を表す。0x010は、アドレス16個分にあたり、5行目は、アドレスを16ずらす処理にあたる。 The fifth line represents a process of adding 0x010 to the value stored in the element register 113A of the address n and storing the tilted address as the addition result in the indirect address register 121A. 0x010 corresponds to 16 addresses, and the fifth line corresponds to the process of shifting the addresses by 16.

6行目は、アドレスnの要素レジスタ113Aに格納された傾きアドレスを取得し、間接アドレスレジスタ121Aに格納させる処理にあたる。 The sixth line corresponds to a process of acquiring the tilted address stored in the element register 113A of the address n and storing it in the indirect address register 121A.

7行目は、以下の処理を表す。まず1つの処理は、間接アドレスレジスタ121Aに格納された傾きアドレスを取得し傾きアドレスの要素レジスタ113Aに格納された傾きを取得し、アドレスmの要素レジスタ113Aに格納された要素データに乗算する処理である。次に、2つ目の処理は、アドレスqの要素レジスタ113Aに格納された切片に乗算結果を加算する処理である。これにより、アドレスqの要素レジスタ113Aに演算結果が格納される。 The seventh line represents the following processing. First, one process is to acquire the tilt address stored in the indirect address register 121A, acquire the tilt stored in the element register 113A of the tilt address, and multiply it by the element data stored in the element register 113A of the address m. Is. Next, the second process is a process of adding the multiplication result to the intercept stored in the element register 113A at the address q. As a result, the calculation result is stored in the element register 113A at the address q.

次に、図9を参照して、SIMD演算命令の処理の流れを説明する。図9は、SIMD演算命令の処理のフローチャートである。ここでは、任意のバンク#iとして表される各ベクタレジスタ111における処理を例に説明する。 Next, the flow of processing of the SIMD operation instruction will be described with reference to FIG. FIG. 9 is a flowchart of processing of SIMD operation instructions. Here, processing in each vector register 111 represented as an arbitrary bank #i will be described as an example.

バンク#iのベクタレジスタ111は、演算命令制御部101から入力された命令が間接アドレスレジスタ121からの読み出し命令か否かを判定する(ステップS101)。 The vector register 111 of the bank # i determines whether or not the instruction input from the operation instruction control unit 101 is a read instruction from the indirect address register 121 (step S101).

命令が間接アドレスレジスタ121からの読み出し命令の場合(ステップS101:肯定)、ベクタレジスタ111は、アドレスをマルチプレクサ122から読み出す。そして、ベクタレジスタ111は、間接アドレスレジスタ121から読み出したアドレスをマルチプレクサ122に繋がる入力ポートに対応する出力ポートにおける読み出しアドレスにセットする(ステップS102)。 If the instruction is a read instruction from the indirect address register 121 (step S101: affirmative), the vector register 111 reads the address from the multiplexer 122. Then, the vector register 111 sets the address read from the indirect address register 121 to the read address in the output port corresponding to the input port connected to the multiplexer 122 (step S102).

これに対して、命令が間接アドレスレジスタ121からの読み出し命令でない場合(ステップS101:否定)、ベクタレジスタ111は、以下の処理を行う。すなわち、ベクタレジスタ111は、命令により与えられ修飾されたアドレスをマルチプレクサ122に繋がる入力ポートに対応する出力ポートにおける読み出しアドレスにセットする(ステップS103)。 On the other hand, when the instruction is not a read instruction from the indirect address register 121 (step S101: negation), the vector register 111 performs the following processing. That is, the vector register 111 sets the address given and modified by the instruction to the read address in the output port corresponding to the input port connected to the multiplexer 122 (step S103).

次に、ベクタレジスタ111は、命令により与えられ修飾されたアドレスを他の出力ポートにおける読み出しアドレスにセットする(ステップS104)。 Next, the vector register 111 sets the address given and modified by the instruction to the read address in the other output port (step S104).

ベクタレジスタ111は、読み出しアドレスとしてセットされたアドレスにしたがい要素レジスタ113の内容を読み出し各出力ポートから出力しオペランドとしてセットする(ステップS105)。 The vector register 111 reads out the contents of the element register 113 according to the address set as the read address, outputs the contents from each output port, and sets them as an operand (step S105).

次に、積和演算器112は、演算命令制御部101から入力された命令が間接アドレスレジスタ121への書き込み命令か否かを判定する(ステップS106)。 Next, the multiply-accumulate arithmetic unit 112 determines whether or not the instruction input from the arithmetic instruction control unit 101 is a write instruction to the indirect address register 121 (step S106).

命令が間接アドレスレジスタ121への書き込み命令でない場合(ステップS106:否定)、積和演算器112は、ベクタレジスタ111の各出力ポートに対応する自己の入力ポートから各オペランドの入力を受ける。そして、積和演算器112は、各オペランドを用いて命令で指定された演算を実行し、演算結果を自己が有する演算結果レジスタにセットする(ステップS107)。 If the instruction is not a write instruction to the indirect address register 121 (step S106: negation), the multiply-accumulate unit 112 receives the input of each operand from its own input port corresponding to each output port of the vector register 111. Then, the product-sum calculator 112 executes the operation specified by the instruction using each operand, and sets the operation result in the operation result register owned by itself (step S107).

次に、積和演算器112は、命令により与えられ修飾されたアドレスを書き込み用のポートにおける書き込みアドレスとする(ステップS108)。 Next, the multiply-accumulate calculator 112 sets the qualified address given by the instruction as the write address in the write port (step S108).

その後、積和演算器112は、演算結果レジスタの内容を書き込み用のポートを用いて書き込みアドレスで指定された要素レジスタ113に書き込む(ステップS109)。 After that, the multiply-accumulate calculator 112 writes the contents of the calculation result register to the element register 113 designated by the write address using the write port (step S109).

これに対して、命令が間接アドレスレジスタ121への書き込み命令の場合(ステップS106:肯定)、ベクタレジスタ111は、所定のオペランドを間接アドレスレジスタ121にセットする(ステップS110)。 On the other hand, when the instruction is a write instruction to the indirect address register 121 (step S106: affirmative), the vector register 111 sets a predetermined operand in the indirect address register 121 (step S110).

次に、図10を参照して、SIMD演算で要素データ毎のテーブル検索演算を実行する処理の流れを説明する。図10は、SIMD演算で要素データ毎のテーブル検索演算を実行する処理のフローチャートである。 Next, with reference to FIG. 10, the flow of the process of executing the table search operation for each element data in the SIMD operation will be described. FIG. 10 is a flowchart of a process for executing a table search operation for each element data in a SIMD operation.

管理者は、演算において参照対象となるテーブルの値をベクタレジスタ111の所定の番号の要素レジスタ113に配置する(ステップS201)。 The administrator arranges the value of the table to be referred to in the operation in the element register 113 having a predetermined number in the vector register 111 (step S201).

積和演算器112は、入力値をベクタレジスタ111の参照に用いるアドレスとなるように加工する(ステップS202)。ここで、入力値は、演算の開始時であれば例えば要素データであり、演算の途中であれば例えば演算結果である。 The product-sum calculator 112 processes the input value so that it becomes an address used for reference to the vector register 111 (step S202). Here, the input value is, for example, element data at the start of the operation, and is, for example, the operation result during the operation.

その後、積和演算器112は、ベクタレジスタ111の参照に用いるアドレスをベクタレジスタ111に格納する。ベクタレジスタ111は、格納されたベクタレジスタ111の参照に用いるアドレスを間接アドレスレジスタ121に書き込む(ステップS203)。 After that, the multiply-accumulate calculator 112 stores the address used for reference to the vector register 111 in the vector register 111. The vector register 111 writes an address used for reference to the stored vector register 111 to the indirect address register 121 (step S203).

次に、積和演算器112は、間接アドレスレジスタ121に格納された値をアドレスとして要素レジスタ113の内容を読み出し他のオペランドとともに演算に使用する(ステップS204)。 Next, the multiply-accumulate calculator 112 reads out the contents of the element register 113 with the value stored in the indirect address register 121 as an address, and uses it for the calculation together with other operands (step S204).

その後、積和演算器112は、演算が完了したか否かを判定する(ステップS205)。演算が完了していない場合(ステップS205:否定)、積和演算器112は、ステップS202へ戻る。 After that, the product-sum calculator 112 determines whether or not the calculation is completed (step S205). If the calculation is not completed (step S205: negation), the multiply-accumulate calculator 112 returns to step S202.

これに対して、演算が完了した場合(ステップS205:肯定)、積和演算器112は、演算結果をベクタレジスタ111に格納して演算処理を完了する。 On the other hand, when the calculation is completed (step S205: affirmative), the multiply-accumulate calculator 112 stores the calculation result in the vector register 111 and completes the calculation process.

以上に説明したように、本実施例に係る積和演算部は、テーブルを参照して計算を行う演算を実行する場合に、ベクタレジスタにテーブルの値を登録し、要素データ又は他の入力値を用いて積和演算によりベクタレジスタの参照に用いるアドレスを生成する。そして、積和演算部は、生成したアドレスを間接アドレスレジスタに格納する。そして、積和演算部は、間接アドレスに格納された値を読み出しアドレスとしてベクタレジスタからテーブルの値を取得し演算を行う。このように、バンクごとに間接アドレスレジスタを設けたことで、少ない命令数で効率よくテーブルを参照して計算を行う演算を実行することができる。そして、バンクごとに別々の内容を読み出すことができ、SIMD要素データ毎の計算を高速に処理することが可能となる。すなわち、回路規模を小さく抑えつつ処理効率を向上させることができる。 As described above, the product-sum calculation unit according to the present embodiment registers the value of the table in the vector register when executing the calculation by referring to the table, and the element data or other input values. Is used to generate the address used to refer to the vector register by multiply-accumulate operation. Then, the product-sum calculation unit stores the generated address in the indirect address register. Then, the product-sum calculation unit acquires the value of the table from the vector register using the value stored in the indirect address as the read address and performs the calculation. By providing the indirect address register for each bank in this way, it is possible to efficiently refer to the table and execute the calculation with a small number of instructions. Then, different contents can be read out for each bank, and the calculation for each SIMD element data can be processed at high speed. That is, the processing efficiency can be improved while keeping the circuit scale small.

ここで、本実施例では、区分毎に係数の異なる多項式を用いた近似又は補間を行う関数を用いた演算を例に説明したが、使用できる演算はこれに限らず、テーブルを参照して計算を行う演算、すなわち要素データ毎に表検索を行う演算であれば他の演算でもよい。例えば、ニュートン法その他の収束演算における、区分毎に異なる初期値やパラメータの取得などを行う演算を用いてもよい。 Here, in this embodiment, an operation using a function that performs approximation or interpolation using a polynomial having a different coefficient for each division has been described as an example, but the operation that can be used is not limited to this, and the calculation is performed with reference to a table. Any other operation may be used as long as it is an operation for performing a table search for each element data. For example, in Newton's method or other convergence operations, operations that acquire different initial values and parameters for each division may be used.

次に、実施例2について説明する。本実施例に係る積和演算部は、要素データを冪数として2の冪乗を求める演算を実行する。本実施例に係る情報処理装置も図1及び2で示される構成を有する。本実施例では、SIMD演算に用いられる各要素データが8ビットの固定小数点である場合で説明する。具体的には、各要素データは、2の補数表現を用いて表されるものとし、下位7ビットが小数である(「Q7表現」)とする。すなわち、各要素データは、sxxxyyyyの8ビット表現で表され、s=0であれば、2進数である0.xxxyyyyを表し、s=1であれば、2進数である0.xxxyyyy-1.0000000を表す。また、演算結果は単精度浮動小数点であるFP32形式で求める場合で説明する。 Next, Example 2 will be described. The product-sum calculation unit according to this embodiment executes an operation for obtaining a power of 2 using the element data as a power. The information processing apparatus according to this embodiment also has the configurations shown in FIGS. 1 and 2. In this embodiment, the case where each element data used in the SIMD operation has an 8-bit fixed point number will be described. Specifically, each element data is represented using a two's complement representation, and the lower 7 bits are decimals (“Q7 representation”). That is, each element data is represented by an 8-bit representation of sxxxxyyy, and if s = 0, it is a binary number 0. It represents xxxyyyy, and if s = 1, it is a binary number 0. Represents xxxyyyy-1000000000. Further, the calculation result will be described in the case of obtaining in the FP32 format which is a single precision floating point number.

図11は、実施例2に係るベクタレジスタに格納されるテーブルの値の一例を示す図である。ベクタレジスタ111の各要素レジスタ113には、図11に示すように、アドレス00~0Fに、要素データの上位4ビットの数を冪数とした場合の2の冪乗の計算結果となり得る16個の値が格納される。また、要素レジスタ113のアドレス10~1Fには、要素データの下位4ビットの数を冪数とした場合の2の冪乗数の計算結果となり得る16個の値が格納される。演算実行前に、アドレス#mの要素レジスタ113に要素データが格納される。 FIG. 11 is a diagram showing an example of table values stored in the vector register according to the second embodiment. As shown in FIG. 11, each element register 113 of the vector register 111 has 16 powers that can be calculated as a power of 2 when the number of the upper 4 bits of the element data is a power number at addresses 00 to 0F. The value of is stored. Further, in the addresses 10 to 1F of the element register 113, 16 values that can be the calculation result of a power of two when the number of the lower 4 bits of the element data is taken as a power are stored. Before executing the operation, the element data is stored in the element register 113 at the address #m.

積和演算器112は、アドレス#mの要素レジスタ113から要素データを取得する。そして、積和演算器112は、取得した要素データと0x000000F0との論理積をとり、要素データの上位4ビットより下位のビットを0としたデータを取得する。以下では、要素データの上位4ビットより下位のビットを0としたデータを要素データの上位4ビットを表すデータという。その後、積和演算器112は、取得した要素データの上位4ビットを表すデータをアドレス#xの要素レジスタ113に格納する。 The product-sum calculator 112 acquires element data from the element register 113 at address #m. Then, the product-sum calculator 112 takes the logical product of the acquired element data and 0x0000000F0, and acquires the data in which the bits lower than the upper 4 bits of the element data are 0. In the following, the data in which the bits lower than the upper 4 bits of the element data are 0 are referred to as data representing the upper 4 bits of the element data. After that, the multiply-accumulate calculator 112 stores the data representing the upper 4 bits of the acquired element data in the element register 113 of the address # x.

次に、積和演算器112は、アドレス#mの要素レジスタ113から要素データを取得する。そして、積和演算器112は、取得した要素データと0x0000000Fの論理積をとり、要素データの下位4ビットより上位のビットを0としたデータを取得する。以下では、要素データの下位4ビットより上位のビットを0としたデータを要素データの下位4ビットを表すデータという。その後、積和演算器112は、取得した要素データの下位4ビットを表すデータをアドレス#yの要素レジスタ113に格納する。 Next, the product-sum calculator 112 acquires element data from the element register 113 at address #m. Then, the product-sum calculator 112 takes the acquired element data and the logical product of 0x00000000F, and acquires the data in which the bits higher than the lower 4 bits of the element data are set to 0. In the following, the data in which the bits higher than the lower 4 bits of the element data are 0 are referred to as the data representing the lower 4 bits of the element data. After that, the multiply-accumulate calculator 112 stores the data representing the lower 4 bits of the acquired element data in the element register 113 of the address #y.

次に、積和演算器112は、結果レジスタであるアドレス#rの要素レジスタ113に1.0を格納する。 Next, the product-sum calculator 112 stores 1.0 in the element register 113 of the address #r, which is a result register.

次に、積和演算器112は、アドレス#xの要素レジスタ113に格納された要素データの上位4ビットを表すデータを取得する。そして、積和演算器112は、要素データの上位4ビットを最下位までシフトし、アドレス#mで上位4ビットにあったデータを下位4ビットに移動させたデータを生成する。その後、積和演算器112は、上位4ビットを下位4ビットに移動させたデータをアドレス#xの要素レジスタ113に格納する。 Next, the multiply-accumulate calculator 112 acquires data representing the upper 4 bits of the element data stored in the element register 113 of the address #x. Then, the multiply-accumulate calculator 112 shifts the upper 4 bits of the element data to the lowest bit, and generates data in which the data in the upper 4 bits at the address #m is moved to the lower 4 bits. After that, the multiply-accumulate calculator 112 stores the data obtained by moving the upper 4 bits to the lower 4 bits in the element register 113 of the address # x.

また、積和演算器112は、アドレス#yの要素レジスタ113に格納された要素データの下位4ビットを表すデータを取得する。そして、積和演算器112は、要素データの下位4ビットを表すデータに下位4ビットの計算に用いるテーブルの値の先頭のアドレスである0x010を加算する。その後、積和演算器112は、要素データの下位4ビットを表すデータに0x010を加算したデータをアドレス#yの要素レジスタ113に格納する。 Further, the multiply-accumulate calculator 112 acquires data representing the lower 4 bits of the element data stored in the element register 113 of the address #y. Then, the multiply-accumulate calculator 112 adds 0x010, which is the first address of the value of the table used for the calculation of the lower 4 bits, to the data representing the lower 4 bits of the element data. After that, the multiply-accumulate calculator 112 stores the data obtained by adding 0x010 to the data representing the lower 4 bits of the element data in the element register 113 of the address #y.

次に、積和演算器112は、アドレス#xの要素レジスタ113に格納された要素データの上位4ビットを下位4ビットに移動させたデータを取得する。次に、積和演算器112は、上位4ビットを下位4ビットに移動させたデータを間接アドレスレジスタ121へ格納する。このデータが、要素データの上位4ビットを冪数として2の冪乗を算出した場合の演算結果が格納されたアドレスにあたる。 Next, the multiply-accumulate calculator 112 acquires data obtained by moving the upper 4 bits of the element data stored in the element register 113 of the address #x to the lower 4 bits. Next, the product-sum calculator 112 stores the data obtained by moving the upper 4 bits to the lower 4 bits in the indirect address register 121. This data corresponds to the address where the calculation result when the power of 2 is calculated with the upper 4 bits of the element data as the power is stored.

その後、積和演算器112は、間接アドレスレジスタ121に格納された値をアドレスとする要素レジスタ113の内容を取得する。この取得した値が、要素データの上位4ビットを冪数として2の冪乗を算出した場合の演算結果にあたる。そして、積和演算器112は、取得した値をアドレス#rの要素レジスタ113に格納された値に乗算してアドレス#rの要素レジスタ113に格納する。 After that, the product-sum calculator 112 acquires the contents of the element register 113 whose address is the value stored in the indirect address register 121. This acquired value corresponds to the calculation result when the power of 2 is calculated with the upper 4 bits of the element data as the power. Then, the product-sum calculator 112 multiplies the acquired value by the value stored in the element register 113 of the address # r and stores it in the element register 113 of the address # r.

次に、積和演算器112は、アドレス#yの要素レジスタ113に格納された要素データの下位4ビットのデータに0x010を加算した値を取得する。次に、積和演算器112は、要素データの下位4ビットのデータに0x010を加算した値を間接アドレスレジスタ121へ格納する。この要素データの下位4ビットのデータに0x010を加算した値が、要素データの下位4ビットを冪数として2の冪乗を算出した場合の演算結果が格納されたアドレスにあたる。 Next, the multiply-accumulate calculator 112 acquires a value obtained by adding 0x010 to the data of the lower 4 bits of the element data stored in the element register 113 of the address #y. Next, the multiply-accumulate calculator 112 stores the value obtained by adding 0x010 to the data of the lower 4 bits of the element data in the indirect address register 121. The value obtained by adding 0x010 to the data of the lower 4 bits of the element data corresponds to the address where the calculation result when the power of 2 is calculated with the lower 4 bits of the element data as the power is stored.

その後、積和演算器112は、間接アドレスレジスタ121に格納された値をアドレスとする要素レジスタ113の内容を取得する。この取得した値が、要素データの下位4ビットを冪数として2の冪乗を算出した場合の演算結果にあたる。そして、積和演算器112は、取得した値をアドレス#rの要素レジスタ113に格納された値に乗算してアドレス#rの要素レジスタ113に格納する。これにより、要素データを冪数とした2の冪乗の演算が完了する。 After that, the product-sum calculator 112 acquires the contents of the element register 113 whose address is the value stored in the indirect address register 121. This acquired value corresponds to the calculation result when the power of 2 is calculated with the lower 4 bits of the element data as the power. Then, the product-sum calculator 112 multiplies the acquired value by the value stored in the element register 113 of the address # r and stores it in the element register 113 of the address # r. As a result, the operation of the power of 2 with the element data as the power is completed.

ここで、本実施例に係る積和演算部100は、EXP2(X+Y)=EXP2(X)×EXP2(Y)の関係を利用して要素データを冪数とする2の冪乗を求める。具体的には、積和演算部100は、上位4ビットの数と下位4ビットの数の和に要素データを分解し、それぞれを冪数とする2の冪乗の値をベクタレジスタ111に格納された値から取得して掛け合わせることで、要素データを冪数とする2の冪乗を求める。 Here, the product-sum calculation unit 100 according to this embodiment uses the relationship of EXP2 (X + Y) = EXP2 (X) × EXP2 (Y) to obtain the power of 2 with the element data as the power. Specifically, the product-sum calculation unit 100 decomposes the element data into the sum of the number of the upper 4 bits and the number of the lower 4 bits, and stores the value of the power of 2 having each as the power in the vector register 111. By acquiring from the obtained values and multiplying them, the power of 2 with the element data as the power is obtained.

図12は、2の冪乗を求める演算を積和演算部に行わせるためのプログラムの一例の図である。 FIG. 12 is a diagram of an example of a program for causing the product-sum calculation unit to perform an operation for obtaining the power of 2.

1行目は、要素データの上位4ビットを表すデータをアドレスxの要素レジスタ113に格納させる処理を表す。 The first line represents a process of storing data representing the upper 4 bits of the element data in the element register 113 of the address x.

2行目は、要素データの下位4ビットを表すデータをアドレスyの要素レジスタ113に格納させる処理を表す。 The second line represents a process of storing data representing the lower 4 bits of the element data in the element register 113 of the address y.

3行目は、結果レジスタであるアドレス#rの要素レジスタ113に1.0を格納させる処理を表す。 The third line represents a process of storing 1.0 in the element register 113 of address # r, which is a result register.

4行目は、要素データの上位4ビットを表すデータを最下位までシフトさせる処理を表す。 The fourth line represents a process of shifting the data representing the upper 4 bits of the element data to the lowest.

5行目は、要素データの下位4ビットを表すデータに下位4ビットの計算に用いるテーブルの値の開始位置のアドレスを加算させる処理を表す。 The fifth line represents a process of adding the address of the start position of the value of the table used for the calculation of the lower 4 bits to the data representing the lower 4 bits of the element data.

6行目は、要素データの上位4ビットを表すデータを間接アドレスレジスタ121にセットさせる処理を表す。 The sixth line represents a process of setting the data representing the upper 4 bits of the element data in the indirect address register 121.

7行目は、間接アドレスレジスタ121にセットされた値をアドレスとする要素レジスタ113から値を取得させ、結果レジスタであるアドレス#rの要素レジスタ113の値に乗算させる処理を表す。 The seventh line represents a process of acquiring a value from the element register 113 whose address is the value set in the indirect address register 121 and multiplying it by the value of the element register 113 of the address # r which is the result register.

8行目は、要素データの下位4ビットを表すデータに0x010を加算した値を間接アドレスレジスタ121にセットさせる処理を表す。 The eighth line represents a process of setting the value obtained by adding 0x010 to the data representing the lower four bits of the element data in the indirect address register 121.

9行目は、間接アドレスレジスタ121にセットされた値をアドレスとする要素レジスタ113から値を取得させ、結果レジスタであるアドレス#rの要素レジスタ113の値に乗算させる処理を表す。 The ninth line represents a process of acquiring a value from the element register 113 whose address is the value set in the indirect address register 121 and multiplying it by the value of the element register 113 of the address # r which is the result register.

この場合、要素データの上位4ビットを表すデータが、「第1選択値」の一例にあたる。そして、要素データの上位4ビットを冪数として2の冪乗を算出した場合の演算結果が、「第1演算値」の一例にあたる。また、要素データの下位4ビットを表すデータが、「第2選択値」の一例にあたる。そして、要素データの上位4ビットを冪数として2の冪乗を算出した場合の演算結果が、「第2演算値」の一例にあたる。 In this case, the data representing the upper 4 bits of the element data corresponds to an example of the "first selection value". Then, the calculation result when the power of 2 is calculated with the upper 4 bits of the element data as the power is an example of the "first calculation value". Further, the data representing the lower 4 bits of the element data corresponds to an example of the "second selection value". Then, the calculation result when the power of 2 is calculated with the upper 4 bits of the element data as the power is an example of the "second calculation value".

以上に説明したように、本実施例に係る積和演算部は、要素データの上位4ビットの数と下位4ビットの数をそれぞれ冪数とした場合の、冪乗の結果として取り得る値をベクトルレジスタに格納する。そして、本実施例に係る積和演算部は、要素データの上位4ビットの数と下位4ビットの数を間接アドレスレジスタに格納し、格納した値を用いてベクトルレジスタを検索して、要素データの上位4ビットの数と下位4ビットの数をそれぞれ冪数とした場合の2の冪乗の計算結果を取得する。その後、積和演算部は、取得した2つの値を乗算することで要素データを冪数とした場合の2の冪乗の演算結果を取得する。 As described above, the product-sum calculation unit according to the present embodiment determines a value that can be taken as a result of exponentiation when the number of the upper 4 bits and the number of the lower 4 bits of the element data are each set to the power. Store in a vector register. Then, the product-sum calculation unit according to the present embodiment stores the number of the upper 4 bits and the number of the lower 4 bits of the element data in the indirect address register, searches the vector register using the stored values, and performs the element data. The calculation result of the power of 2 is acquired when the number of the upper 4 bits and the number of the lower 4 bits of are used as the register. After that, the product-sum calculation unit acquires the calculation result of the power of 2 when the element data is used as a power by multiplying the two acquired values.

この場合も、少ない命令数で効率よくテーブルを参照して計算を行う演算を実行することができ、SIMD要素毎の計算を高速に処理することが可能となる。すなわち、回路規模を小さく抑えつつ処理効率を向上させることができる。 In this case as well, it is possible to efficiently execute the calculation by referring to the table with a small number of instructions, and it is possible to process the calculation for each SIMD element at high speed. That is, the processing efficiency can be improved while keeping the circuit scale small.

1 PCIカード
2 ホストコンピュータ
10 処理ユニット
11 全体命令制御部
12 メモリコントローラ
13 メモリ
14 PCI制御部
101 演算命令制御部
102 演算命令バッファ
103 マルチプレクサ
111,111A~111C ベクタレジスタ
112,112A~112C 積和演算器
113,113A~113C 要素レジスタ
121,121A~121C 間接アドレスレジスタ
122,122A~122C マルチプレクサ
1 PCI card 2 Host computer 10 Processing unit 11 Overall instruction control unit 12 Memory controller 13 Memory 14 PCI control unit 101 Operation instruction control unit 102 Operation instruction buffer 103 Multiplexer 111, 111A to 111C Vector register 112, 112A to 112C Product sum operation unit 113, 113A to 113C Element register 121, 121A to 121C Indirect address register 122, 122A to 122C multiplexer

Claims (6)

複数の要素記憶領域を有し、複数の演算値のそれぞれが各前記要素記憶領域に格納される記憶部と、
乗算器及び加算器を有する積和演算機であり、入力された要素データを基に第1選択値を生成し、前記第1選択値を基に前記要素記憶領域に格納された前記演算値の中から第1演算値を取得し、前記第1演算値を基に演算結果を取得する処理を前記乗算器及び前記加算器を用いて行う演算部と
を備えたことを特徴とする演算処理装置。
A storage unit having a plurality of element storage areas and storing each of the plurality of calculated values in each of the element storage areas.
It is a product-sum calculation machine having a multiplier and an adder, generates a first selection value based on input element data, and of the calculation value stored in the element storage area based on the first selection value. An arithmetic processing apparatus including a arithmetic unit that acquires a first arithmetic value from the inside and acquires an arithmetic result based on the first arithmetic value by using the multiplier and the adder. ..
演算部は、前記要素データ又は前記第1選択値を基に第2選択値を生成し、前記第2選択値を基に前記要素記憶領域に格納された前記演算値から第2演算値を取得し、前記第1演算値及び前記第2演算値を基に演算結果を取得することを特徴とする請求項1に記載の演算処理装置。 The calculation unit generates a second selection value based on the element data or the first selection value, and acquires the second calculation value from the calculation value stored in the element storage area based on the second selection value. The arithmetic processing apparatus according to claim 1, wherein the arithmetic result is acquired based on the first operational value and the second operational value. 前記演算部が取得する演算結果は、所定数の同型の関数であって複数の係数を含む関数の中から前記要素データに対応する関数を選択して、選択した関数を用いて演算を行った結果であって、
前記要素記憶領域は連番で番号が振られ、且つ、前記番号が連続する前記要素記憶領域は、各前記関数に含まれる各項に応じた前記所定数の係数を前記項毎に連続して保持し、
前記演算部は、前記要素データを基に前記番号の1つである第1番号を生成し、前記第1番号に対応する前記要素記憶領域に格納された第1係数を取得し、前記第1番号に前記所定数を加算して第2番号を生成し、前記第2番号に対応する前記要素記憶領域に格納された第2係数を取得し、前記要素データ、前記第1係数及び前記第2係数を基に演算結果を取得する
ことを特徴とする請求項2に記載の演算処理装置。
The calculation result acquired by the calculation unit is a function of the same type in a predetermined number, and a function corresponding to the element data is selected from the functions including a plurality of coefficients, and the calculation is performed using the selected function. The result,
The element storage areas are numbered sequentially, and the element storage areas in which the numbers are continuous have the predetermined number of coefficients corresponding to each term included in each term continuously for each term. Hold and
The calculation unit generates a first number, which is one of the numbers, based on the element data, acquires a first coefficient stored in the element storage area corresponding to the first number, and obtains the first coefficient. The predetermined number is added to the number to generate the second number, the second coefficient stored in the element storage area corresponding to the second number is acquired, and the element data, the first coefficient and the second coefficient are obtained. The arithmetic processing apparatus according to claim 2, wherein the arithmetic result is acquired based on a coefficient.
前記記憶部は特定数存在し、
前記演算部は、各前記記憶部に対応させて前記特定数が配置され、
各前記演算部は、それぞれが前記要素データを複数含む配列から前記要素データを1つ取得する
ことを特徴とする請求項1に記載の演算処理装置。
There are a specific number of the storage units,
In the calculation unit, the specific number is arranged corresponding to each storage unit.
The arithmetic processing apparatus according to claim 1, wherein each arithmetic unit acquires one element data from an array including a plurality of the element data.
保持する値を前記記憶部へ入力することで、保持する値に対応する対応値を前記記憶部から前記演算部へ出力させる間接記憶部をさらに有し、
前記記憶部は、前記第1選択値の入力を前記間接記憶部から受けて前記第1演算値を前記演算部へ出力し、
前記演算部は、前記第1選択値を前記間接記憶部に格納することで前記記憶部から前記第1演算値を取得する
ことを特徴とする請求項1に記載の演算処理装置。
Further, it has an indirect storage unit that outputs a corresponding value corresponding to the value to be held from the storage unit to the calculation unit by inputting the value to be held into the storage unit.
The storage unit receives the input of the first selection value from the indirect storage unit and outputs the first calculation value to the calculation unit.
The arithmetic processing device according to claim 1, wherein the arithmetic unit acquires the first operational value from the storage unit by storing the first selected value in the indirect storage unit.
複数の要素記憶領域を有する記憶装置、並びに、乗算器及び加算器を有する積和演算機を備えた演算処理装置の制御方法であって、
複数の演算値のそれぞれを各前記要素記憶領域に格納させ、
入力された要素データを基に第1選択値を生成し、
前記第1選択値を基に前記要素記憶領域に格納された前記演算値から第1演算値を取得し、
前記第1演算値を基に演算結果を取得する
処理を前記乗算器及び前記加算器を用いて行わせることを特徴とする演算処理装置の制御方法。
It is a control method of a storage device having a plurality of element storage areas, and a calculation processing device including a product-sum calculation machine having a multiplier and an adder.
Each of the plurality of calculated values is stored in each of the element storage areas.
Generate the first selection value based on the input element data,
The first calculated value is acquired from the calculated value stored in the element storage area based on the first selected value.
Acquire the calculation result based on the first calculation value.
A control method of an arithmetic processing apparatus, characterized in that processing is performed using the multiplier and the adder .
JP2020552440A 2018-10-24 2018-10-24 Arithmetic processing device and control method of arithmetic processing device Active JP7078129B2 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/039567 WO2020084721A1 (en) 2018-10-24 2018-10-24 Computation processing device and computation processing device control method

Publications (2)

Publication Number Publication Date
JPWO2020084721A1 JPWO2020084721A1 (en) 2021-09-24
JP7078129B2 true JP7078129B2 (en) 2022-05-31

Family

ID=70331924

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020552440A Active JP7078129B2 (en) 2018-10-24 2018-10-24 Arithmetic processing device and control method of arithmetic processing device

Country Status (2)

Country Link
JP (1) JP7078129B2 (en)
WO (1) WO2020084721A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001093800A (en) 1999-09-20 2001-04-06 Hitachi Ltd Electron beam lithography equipment
JP2001100991A (en) 1999-09-28 2001-04-13 Matsushita Electric Ind Co Ltd Digital signal processor
JP2002063152A (en) 2000-08-17 2002-02-28 Sony Corp Processor and data processing method therefor
JP2008217359A (en) 2007-03-02 2008-09-18 Fujitsu Ltd Fast fourier transform device and fast fourier transform processing method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03113653A (en) * 1989-09-28 1991-05-15 Nec Corp Address generation circuit
WO2013183096A1 (en) * 2012-06-08 2013-12-12 日本電気株式会社 Multi-stage filter processing device and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001093800A (en) 1999-09-20 2001-04-06 Hitachi Ltd Electron beam lithography equipment
JP2001100991A (en) 1999-09-28 2001-04-13 Matsushita Electric Ind Co Ltd Digital signal processor
JP2002063152A (en) 2000-08-17 2002-02-28 Sony Corp Processor and data processing method therefor
JP2008217359A (en) 2007-03-02 2008-09-18 Fujitsu Ltd Fast fourier transform device and fast fourier transform processing method

Also Published As

Publication number Publication date
WO2020084721A1 (en) 2020-04-30
JPWO2020084721A1 (en) 2021-09-24

Similar Documents

Publication Publication Date Title
US9753695B2 (en) Datapath circuit for digital signal processors
Pineiro et al. High-speed function approximation using a minimax quadratic interpolator
EP0976027B1 (en) ARITHMETIC PROCESSOR combining finite field arithmetic and modular integer arithmetic
US4075704A (en) Floating point data processor for high speech operation
US6138135A (en) Propagating NaNs during high precision calculations using lesser precision hardware
CN111353126A (en) Block matrix multiplication system
JP2001516916A (en) Data processing device with digital signal processing capability
US10114795B2 (en) Processor in non-volatile storage memory
US10255041B2 (en) Unified multiply unit
US6009450A (en) Finite field inverse circuit
JP2001067206A (en) System and method for executing modular multiplication
US4065666A (en) Multiply-divide unit
JPH05250146A (en) Arithmetic operation circuit executing integer involution processing
JP7078129B2 (en) Arithmetic processing device and control method of arithmetic processing device
JP7038608B2 (en) Semiconductor device
JP6604393B2 (en) Vector processor, operation execution method, program
JP2003241960A (en) Processor, and computation instruction processing method and computation control method therein
JP7140201B2 (en) Arithmetic processing device and method of controlling arithmetic processing device
JP2003244190A (en) Processor for data flow control switch and data flow control switch
US20210288650A1 (en) Semiconductor device and circuit layout method
JP7120885B2 (en) Semiconductor device and division method
JP4309216B2 (en) Arithmetic processing circuit
US20030037088A1 (en) Speed of execution of a conditional subtract instruction and increasing the range of operands over which the instruction would be performed correctly
JP2010033275A (en) Data processing method and data processor
JPH05290080A (en) Parallel processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210224

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211124

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220119

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220419

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220502

R150 Certificate of patent or registration of utility model

Ref document number: 7078129

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150