WO2020084694A1 - 演算処理装置及び演算処理装置の制御方法 - Google Patents

演算処理装置及び演算処理装置の制御方法 Download PDF

Info

Publication number
WO2020084694A1
WO2020084694A1 PCT/JP2018/039387 JP2018039387W WO2020084694A1 WO 2020084694 A1 WO2020084694 A1 WO 2020084694A1 JP 2018039387 W JP2018039387 W JP 2018039387W WO 2020084694 A1 WO2020084694 A1 WO 2020084694A1
Authority
WO
WIPO (PCT)
Prior art keywords
destination
bank
byte
line
storage area
Prior art date
Application number
PCT/JP2018/039387
Other languages
English (en)
French (fr)
Inventor
洋征 和田
Original Assignee
富士通株式会社
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 富士通株式会社 filed Critical 富士通株式会社
Priority to PCT/JP2018/039387 priority Critical patent/WO2020084694A1/ja
Priority to JP2020551750A priority patent/JP7140201B2/ja
Publication of WO2020084694A1 publication Critical patent/WO2020084694A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/3001Arithmetic instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30032Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30036Instructions to perform operations on packed data, e.g. vector, tile or matrix operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements
    • G06F9/30105Register structure
    • G06F9/30109Register structure having multiple operands in a single register
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements
    • G06F9/3012Organisation of register space, e.g. banked or distributed register file

Definitions

  • the present invention relates to an arithmetic processing device and a control method for the arithmetic processing device.
  • the operation layer converts the expression format of a huge operation data array.
  • the conversion of the representation format includes, for example, conversion between a floating point format and a fixed point format.
  • the conversion of the expression format of a huge arithmetic data array not only the format but also the data size of each element used for calculation often changes. Therefore, for efficient arithmetic operation, it is desirable that the converted data is rearranged as an array of elements of the converted size.
  • each element used for the operation may be a low-precision fixed point such as 8 bits or 16 bits, but the operation itself is a highly parallel operation. Is desirable. Fully combined layers tend to be similar.
  • the amount of calculation in the softmax calculation layer is relatively small compared to the convolutional calculation layer and the total connection layer, but the dynamic range of the numerical values handled is large. Therefore, floating-point calculation processing is desired in the softmax calculation layer. Since the floating-point number expresses the exponent part that does not exist in the fixed-point format in the data, the size of each element tends to be larger than that of the fixed-point number.
  • the arithmetic processing unit converts the number expressed in FP32 into INT8 having a proper decimal point position.
  • the arithmetic processing unit performs processing of packing four pieces of INT8 data into continuous 32-bit areas.
  • the arithmetic processing unit will be able to collectively send or transfer four pieces of data to the arithmetic unit in 32-bit processing units in the subsequent arithmetic layers. That is, the arithmetic processing and the data transfer processing can be efficiently executed with a high degree of parallelism.
  • Such an operation of packing a plurality of elements into a predetermined area may be called packing. Since packing involves moving a large amount of data, it is desirable to process it efficiently.
  • the storage area called a register that stores data cannot be randomly accessed at the same time without limitation due to the hardware configuration.
  • storage areas are divided into several individually accessed areas, commonly referred to as banks. Then, there is a limitation that one or several reading / writing operations are simultaneously performed in the same bank.
  • registers are interleaved in eight banks in which either reading or writing in element units can be simultaneously executed.
  • the elements of the array are sequentially and repeatedly arrayed in eight banks that can be read or written simultaneously.
  • One bank has a size of 32 bits.
  • the packing process is performed four times and the process of moving 32 elements is handled as one unit, the arithmetic process becomes a repeating unit for the entire 8 banks.
  • the entire bank from the first bank to the last bank is called a line. That is, here, one line has 32 ⁇ 8 bits.
  • 32-bit data is converted into 8-bit data, so the data size becomes 1/4.
  • the data is stored in a 32-bit area. That is, the movement from four lines before conversion to one line at the conversion destination is the repeating unit of the arithmetic processing in this case.
  • the arithmetic processing unit expands the array including the elements of INT8 from an array of 8 bits per element to an array of 32 bits per element.
  • the arithmetic processing unit converts the data of INT8, which is one element in the 4-byte array, into the representation of FP32.
  • the operation to scatter multiple elements packed in a predetermined area into a wider area for each element is sometimes called unpacking.
  • the unpacking process involves moving a large amount of data, so that efficient processing is also desired.
  • the instructions for moving or assembling data are created by combining existing instructions for which patterns used for other purposes are assumed, for example.
  • An existing instruction for which a pattern is assumed is, for example, a shuffle instruction.
  • a technique for performing operations in parallel there is a conventional technique in which a register file is divided into four banks and four operands are simultaneously accessed by one operand. Further, as a technique of packing and unpacking processing, there is a conventional technique of reading packed data from a memory, performing unpacking processing, and performing format conversion for each unpacked data in parallel. Further, there is a conventional technique in which data stored in a register having a small size is read and a plurality of read data is stored in a register having a large size and used for SIMD operation.
  • the disclosed technology has been made in view of the above, and an object thereof is to provide an arithmetic processing device and a control method for the arithmetic processing device that make packing and unpacking processing efficient.
  • the arithmetic processing device and the method for controlling the arithmetic processing device disclosed in the present application are, in one aspect, an arithmetic processing device that repeats data transfer a predetermined number of times to move element data between two storage areas of different sizes. Then, the transfer unit, based on the information of the first storage area in which the element data is stored in one storage area of the transmission source and the number of times of repetition, the second of the element data in the other storage area of the transmission destination. Determine the storage area. The storage unit stores the element data stored in the first storage area at a predetermined position in the second storage area based on the information in the second storage area and the number of times of repetition.
  • FIG. 1 is an overall configuration diagram of an information processing device.
  • FIG. 2 is a detailed circuit diagram of the product-sum calculation unit.
  • FIG. 3 is a diagram illustrating an outline of the packing process according to the first embodiment.
  • FIG. 4 is a diagram for explaining an area used in the packing process.
  • FIG. 5 is a diagram illustrating an outline of the unpacking process according to the first embodiment.
  • FIG. 6 is a diagram of an example of a read line selection table for packing processing according to the first embodiment.
  • FIG. 7 is a schematic diagram of the circuit configuration of the read line changing circuit according to the first embodiment.
  • FIG. 8 is a diagram of an example of a destination bank selection table for packing processing according to the first embodiment.
  • FIG. 1 is an overall configuration diagram of an information processing device.
  • FIG. 2 is a detailed circuit diagram of the product-sum calculation unit.
  • FIG. 3 is a diagram illustrating an outline of the packing process according to the first embodiment.
  • FIG. 4 is a diagram for explaining an area used
  • FIG. 9 is a diagram illustrating an outline of a circuit configuration for determining a storage destination bank at the time of packing included in the router according to the first embodiment.
  • FIG. 10 is a diagram of an example of a destination bank selection table for unpacking processing.
  • FIG. 11 is a diagram illustrating an outline of a circuit configuration that determines a storage destination bank at the time of unpacking included in the router according to the first embodiment.
  • FIG. 12 is a diagram showing an example of a definition pattern for determining the read source bank corresponding to the storage destination bank.
  • FIG. 13 is a diagram of an example of a byte selection table for packing processing according to the first embodiment.
  • FIG. 14 is a diagram of an example of a byte selection table for unpacking processing.
  • FIG. 10 is a diagram of an example of a destination bank selection table for unpacking processing.
  • FIG. 11 is a diagram illustrating an outline of a circuit configuration that determines a storage destination bank at the time of unpacking included in the router
  • FIG. 15 is a diagram for explaining a destination byte determination process at the time of packing by the byte shuffle circuit according to the second embodiment.
  • FIG. 16 is a diagram for explaining a destination byte determination process at the time of unpacking by the byte shuffle circuit according to the first embodiment.
  • FIG. 17 is a diagram showing an outline of a circuit configuration for selecting a destination byte at the time of packing included in the destination byte write enable / disable selection circuit according to the first embodiment.
  • FIG. 18 is a diagram for explaining the destination byte selection processing at the time of unpacking by the destination byte write enable / disable selection circuit according to the first embodiment.
  • FIG. 19 is a diagram of an example of a destination line selection table for unpacking processing according to the first embodiment.
  • FIG. 20 is a diagram illustrating an outline of a circuit configuration of the destination line selection circuit according to the first embodiment that determines a destination line at the time of unpacking.
  • FIG. 21 is a diagram illustrating a relationship between a storage position of element data of a transmission source and a storage position of element data of a destination during packing according to the first embodiment.
  • FIG. 22 is a diagram of a list of source and destination information at the time of packing by the product-sum calculation unit according to the first embodiment.
  • FIG. 23 is a diagram for explaining a generalized transmission source and destination determination method at the time of packing.
  • FIG. 24 is a diagram showing a relationship between a storage position of element data of a transmission source and a storage position of element data of a destination during unpacking.
  • FIG. 21 is a diagram illustrating a relationship between a storage position of element data of a transmission source and a storage position of element data of a destination during packing according to the first embodiment.
  • FIG. 22 is a diagram of a
  • FIG. 25 is a diagram for explaining a generalized method of determining a transmission source and a destination at the time of unpacking.
  • FIG. 26 is a flowchart of packing processing by the processing unit according to the first embodiment.
  • FIG. 27 is a flowchart of the unpacking process performed by the processing unit according to the first embodiment.
  • FIG. 28 is a diagram showing an example of an instruction for causing the processing unit to execute the packing process and the unpacking process according to the present embodiment.
  • FIG. 29 is a diagram illustrating an outline of the packing process according to the second embodiment.
  • FIG. 30 is a diagram of an example of a read line selection table for packing processing according to the second embodiment.
  • FIG. 31 is a diagram illustrating an outline of the circuit configuration of the read line changing circuit according to the second embodiment.
  • FIG. 32 is a diagram of an example of a destination bank selection table for packing processing according to the second embodiment.
  • FIG. 33 is a diagram illustrating an outline of a circuit configuration that determines a storage destination bank at the time of packing included in the router according to the second embodiment.
  • FIG. 34 is a diagram illustrating an outline of a circuit configuration that determines a storage destination bank at the time of unpacking included in the router according to the second embodiment.
  • FIG. 35 is a diagram of an example of the byte selection table for packing processing according to the second embodiment.
  • FIG. 36 is a diagram for explaining a destination byte determination process at the time of packing by the byte shuffle circuit according to the second embodiment.
  • FIG. 37 is a diagram for explaining a destination byte determination process at the time of unpacking by the byte shuffle circuit according to the second embodiment.
  • FIG. 38 is a diagram showing an outline of a circuit configuration for selecting a destination byte at the time of packing included in the destination byte write enable / disable selection circuit according to the second embodiment.
  • FIG. 39 is a diagram for explaining the destination byte selection processing at the time of unpacking by the destination byte write enable / disable selection circuit according to the second embodiment.
  • FIG. 40 is a diagram of an example of a destination line selection table for unpacking processing according to the second embodiment.
  • FIG. 41 is a diagram illustrating the outline of the circuit configuration of the destination line selection circuit according to the second embodiment that determines the destination line during unpacking.
  • FIG. 42 is a diagram illustrating a relationship between a storage position of element data of a transmission source and a storage position of element data of a destination during packing according to the second embodiment.
  • FIG. 43 is a diagram of a list of source and destination information at the time of packing by the product-sum calculation unit according to the second embodiment.
  • the information processing device 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 exchange data with each other.
  • the host computer 2 performs overall management when executing deep learning.
  • the host computer 2 instructs the PCI card 1 to execute a predetermined calculation in deep learning such as a convolution calculation.
  • the host computer 2 instructs the PCI card 1 to execute packing and unpacking processing that involves changing the data size of element data. For example, when exchanging data between the layer that performs the full join operation and the layer that performs the softmax operation, the host computer 2 executes the packing and unpacking processing that involves changing the data size of the element data. Instruct card 1.
  • the PCI card 1 receives a command from the host computer 2, executes a calculation, and outputs the calculation result to the host computer 2. For example, the PCI card 1 executes arithmetic processing in deep learning. As shown in FIG. 1, the PCI card 1 has a plurality of processing units 10, an overall command control unit 11, a memory controller 12, a memory 13 and a PCI control unit 14. The PCI card 1 corresponds to an example of “arithmetic processing device”.
  • the PCI control unit 14 receives from the host computer 2 an input of an operation instruction for instructing execution of operation and operation data used in the operation. Then, the PCI control unit 14 outputs the acquired operation command and operation data to the memory controller 12.
  • the PCI control unit 14 receives the input of the calculation result for the designated calculation from the memory controller 12. Then, the PCI control unit 14 outputs the calculation result to the host computer 2.
  • the memory controller 12 receives, from the PCI control unit 14, input of operation instructions and operation data used in the operation. Then, the memory controller 12 stores the acquired operation instruction and operation data in the memory 13.
  • the memory controller 12 receives from the overall instruction control unit 11 an instruction to store the operation data used when executing the operation 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 transmitting data to the subsequent processing unit 10 of 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.
  • the memory controller 12 when the memory controller 12 receives the instruction to store the operation result from the overall instruction control unit 11, the memory controller 12 acquires the operation result from the vector register 111 of the designated product-sum operation 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 operation result stored in the memory 13 and outputs it to the PCI control unit 14.
  • the overall command control unit 11 performs overall management of the operations instructed to be executed by the host computer 2.
  • the overall command control unit 11 receives an instruction from the host computer 2 via the PCI control unit 14, and sequentially reads and executes the overall command sequence stored in the memory 13.
  • As the overall instruction an instruction for transferring an operation instruction sequence from the memory 13 to the operation instruction buffer 102, an instruction for storing operation data from the memory 13 in the vector register 111, and an operation instruction control for the operation instruction sequence stored in the operation instruction buffer 102
  • the overall instruction control unit 11 causes the processing unit 10 to execute the arithmetic instruction sequence.
  • the overall instruction control unit 11 instructs the memory controller 12 to send the operation data used when executing the operation. Further, when the calculation in the processing unit 10 is completed, the overall command control unit 11 instructs the memory controller 12 to store the calculation result. Further, when all the processes of the operation instructed to be executed are completed, the overall instruction control unit 11 notifies the memory controller 12 of the completion of the operation.
  • the overall command control unit 11 When executing deep learning, the overall command control unit 11 also controls data exchange between layers. In that case, the overall instruction control unit 11 instructs the arithmetic instruction control unit 101 to execute the packing and unpacking processing that involves changing the data size of the element data. At that time, the overall command control unit 11 instructs the memory controller 12 to transmit the element data stored in the array to be packed and unpacked. For example, when exchanging data between the layer that performs the full join operation and the softmax operation layer, the overall instruction control unit 11 executes the packing and unpacking processing that involves changing the data size of the element data. To the arithmetic instruction control unit 101.
  • 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.
  • the processing unit 10 of FIG. 1 is described in a simplified manner, and details thereof will be described later.
  • the arithmetic instruction control unit 101 manages and controls the execution processing of arithmetic instructions.
  • the arithmetic instruction control unit 101 receives an instruction to execute an individual arithmetic from the overall instruction control unit 11.
  • the instruction that can be executed by the processing unit 10 is called an arithmetic instruction in comparison with the whole instruction.
  • the instruction includes an arithmetic instruction in a narrow sense that causes the product-sum operation unit to perform an operation, and a general-purpose register (not shown).
  • An operation instruction, a branch instruction, a repeat instruction, an instruction to stop the execution of an instruction sequence, etc. are included.
  • the arithmetic instruction control unit 101 acquires the arithmetic instruction stored in the arithmetic instruction buffer 102. Next, the arithmetic instruction control unit 101 instructs the vector register 111 to output the arithmetic data designated by the acquired arithmetic instruction. Further, the arithmetic instruction control unit 101 outputs an instruction to execute arithmetic to the product-sum arithmetic unit 112 according to the acquired arithmetic instruction. After that, the operation instruction control unit 101 loops the operation using the operation result in the product-sum operation unit 112. Further, the arithmetic instruction control unit 101 issues, for example, an execution instruction of packing and unpacking processing that involves changing the data size of element data.
  • the arithmetic instruction buffer 102 is a storage area for storing an arithmetic instruction sequence.
  • the arithmetic instruction buffer 102 stores the arithmetic instruction sequence input from the memory controller 12 in the input order from the designated address. After that, in response to a request to acquire the arithmetic instruction from the arithmetic instruction controller 101, the arithmetic instruction buffer 102 outputs the arithmetic instruction of the requested address to the arithmetic instruction controller 101.
  • 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 in the processing unit 10.
  • the vector register 111 receives an input of operation data used when executing an operation from the memory controller 12, and stores the input operation data. After that, the vector register 111 receives the instruction from the arithmetic instruction control unit 101 and outputs the arithmetic data used in the arithmetic to the product-sum arithmetic unit 112. Further, the vector register 111 acquires and stores the calculation result of the product-sum calculation unit 112. When the instruction of output to the memory 13 is received from the memory controller 12 after the loop processing of the operation by the product-sum operation unit 112 is completed, the vector register 111 causes the vector-sum register 111 of the product-sum operation unit 112 stored in the area instructed to output. The calculation result is output to the multiplexer 103.
  • the vector register 111 stores the element data to be packed or unpacked and the element data after the packing or unpacking processing.
  • the product-sum calculator 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 calculator 112 outputs the calculation result to the vector register 111. When the accumulation is instructed by the instruction, the product-sum calculation unit 112 holds the accumulation calculation result in a register (accumulator) in the calculation unit and uses it in the subsequent accumulation calculation instruction.
  • the product-sum operator 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 process of the product-sum accumulation calculation is completed, the product-sum calculation unit 112 outputs the calculation result to the vector register 111 and stores it.
  • FIG. 2 is a detailed circuit diagram of the product-sum calculation unit.
  • the product-sum operation unit 112A from the operation instruction control unit 101 to the vector register 111A, the product-sum operation unit 112A, the read line change circuit 121A, the byte shuffle circuit 122A, the destination byte write enable / disable selection circuit 123A, the destination line selection circuit 124A, and the router 125.
  • the extended signal path has been described.
  • the signal path from the arithmetic instruction control unit 101 also extends to other vector registers 111B to 111C, product-sum arithmetic units 112B to 112C, read line changing circuits 121B to 121C, and byte shuffle circuits 122B to 122C.
  • the signal path from the arithmetic command control unit 101 also extends to the destination byte write enable / disable selection circuits 123B to 123C and the destination line selection circuits 124B to 124C.
  • the product-sum calculation unit 100 has a plurality of product-sum calculation units 112 shown in FIG.
  • the respective product-sum calculators 112 are referred to as product-sum calculators 112A to 112C.
  • the product-sum calculation unit 100 also has a vector register 111 divided into units called banks.
  • the vector registers 111 divided into banks are represented as vector registers 111A to 111C.
  • the vector registers 111A to 111C have a one-to-one correspondence with the product-sum calculators 112A to 112C, respectively.
  • read line changing circuits 121A to 121C and destination line selecting circuits 124A to 124C are arranged corresponding to the vector registers 111A to 111C.
  • Byte shuffle circuits 122A to 122C and destination byte write enable / disable selection circuits 123A to 123C are arranged corresponding to the product-sum calculators 112A to 112C.
  • the element register 113, the product-sum calculator 112 the read line change circuit 121, the byte shuffle circuit 122, the destination byte write enable / disable selection circuit 123, and the destination line selection circuit 124, unless otherwise distinguished from each other.
  • a router 125 is arranged on a path connecting the vector registers 111A to 111C to the product-sum calculators 112A to 112C via the byte shuffle circuits 122A to 122C.
  • the router 125 selectively outputs the data output from the vector registers 111A to 111C to any of the byte shuffle circuits 122A to 122C.
  • the router 125 is arranged on the path connecting the vector register 111 and the byte shuffle circuit 122.
  • another path connecting the vector register 111 and the product-sum calculator 112 also passes through the router 125. You may.
  • the vector register 111 is, for example, a RAM (Random Access Memory). In this embodiment, a total of eight vector registers 111 are arranged.
  • the case where the vector register 111A corresponds to the bank number # 0, the vector register 111B corresponds to the bank number # 1, and the vector register 111C corresponds to the bank number # 7 will be described.
  • the vector register 111 has a plurality of element registers 113.
  • Each element register 113 included in the vector register 111 corresponds to a unit called a line to which a number is assigned.
  • the numerical value representing each line is called a line number. That is, a line number is assigned to each element register 113.
  • the vector register 111 has four ports connected to the route extending from the arithmetic instruction control unit 101. Of the four ports connected to the path extending from the arithmetic instruction control unit 101, three are ports to which read addresses are input. Then, one of the three ports to which the read address is input is connected to the operation instruction control unit 101 via the read line change circuit 121. The remaining one of the four ports connected to the path extending from the arithmetic instruction control unit 101 is a port to which the write address is input.
  • the vector register 111 supplies a plurality of operands used for calculation in each cycle to the product-sum calculation unit 112, and a read port and a write port for writing back the calculation result to any of the element registers 113 in each cycle.
  • the vector register has three read ports and one write port. Each of the three read ports corresponds to one of the ports to which three write addresses connected to the path extending from the operation instruction control unit 101 are input.
  • the port connected to the read line change circuit 121 and the port connected to the byte shuffle circuit 122 via the router correspond to each other.
  • the vector register 111 outputs the value stored in the element register 113 corresponding to the read address input to the port connected to the operation instruction control unit 101, from the read port corresponding to the port to which the read address is input. Specifically, the vector register 111A outputs the value stored in the element register 113 corresponding to the read address input from the read line change circuit 121 to the router 125.
  • the element register 113 has a size of 32 bits for each line. Then, in the present embodiment, as shown in FIG. 3, after converting the 32-bit data stored for each line of the element register 113 into 8 bits, four data are stored in any one line of the element register 113.
  • the packing process will be described as an example.
  • FIG. 3 is a diagram illustrating an outline of the packing process according to the first embodiment.
  • FIG. 4 is a diagram for explaining an area used in the packing process.
  • each column divided vertically in the plane of the drawing represents a bank having a bank number # 0 to # 7.
  • the horizontal direction represents a line toward the paper surface. That is, the areas 21 to 23 in FIG. 4 are the areas of the transmission source for each repeating unit. Then, the destination area in each repeating unit becomes the areas 24 to 26. That is, the processing unit 10 stores the 32 pieces of element data stored in the area 21 in the area 24. Further, the processing unit 10 stores the 32 pieces of element data stored in the area 22 in the area 25. The processing unit 10 stores the 32 pieces of element data stored in the area 23 in the area 26.
  • Each of the areas 21 to 23 and the areas 24 to 26 corresponds to an example of “two storage areas”.
  • the areas 21 to 23 are examples of “one storage area”
  • the areas 24 to 26 are examples of “the other storage area”.
  • the areas 24 to 26 are examples of “one storage area”
  • the areas 21 to 23 are examples of “the other storage area”.
  • FIG. 5 is a diagram illustrating an outline of the unpacking process according to the first embodiment.
  • the unpacking process is a process in which the packing process is reversed. That is, also in the unpacking process, the process of 4 steps is performed. Since the destination lines are the same, the movement of the element data of the 32 transmission source areas stored in one line is one repetitive unit of the unpacking process.
  • the read line changing circuit 121 outputs the data input from the arithmetic instruction control unit 101 to the vector register 111 as it is, when performing processing other than the packing and unpacking processing described here.
  • the read line changing circuit 121 receives the instruction of the destination determination, the information of the source area in the vector register 111 and the information of the destination area in the vector register 111. .
  • the read line changing circuit 121 receives, from the arithmetic instruction control unit 101, for example, the information indicating the area 21 as the information of the area that is the transmission source in FIG. Further, the read line changing circuit 121 receives the step number from the arithmetic instruction control unit 101.
  • the read line changing circuit 121 since four steps are performed in the processing of one repeating unit, the read line changing circuit 121 receives the input of any information of 0 to 3 as the step number.
  • the step number 0 indicates that it is the first step.
  • the read line change circuit 121 determines the read line according to the read line selection table 201 shown in FIG. 6 based on the input step number information and the bank number of the vector register 111 to which the read line change circuit 121 is connected. Get the line number.
  • FIG. 6 is a diagram of an example of a read line selection table for packing processing according to the first embodiment.
  • the read line selection table 201 represents the information of the read line as the read source according to each source bank for each packing process that is repeated four times in this embodiment.
  • the read line change circuit 121 uses the line number of the vector register 111 to which it is connected and the step number 0 to obtain the information of the read line that is the read source.
  • the information of this read line matches the information of the read line when the step number of bank number # 0 in the read line selection table 201 is 0.
  • the read line changing circuit 121 inputs the obtained line number to the vector register 111 as a read address.
  • FIG. 7 is a schematic diagram of the circuit configuration of the read line changing circuit according to the first embodiment.
  • the bank number 302 is 3-bit information representing the bank number of the vector register 111 connected to the read line changing circuit 121 in binary.
  • the step number 301 is 2-bit information that represents the four step numbers in binary.
  • the read line changing circuit 121 acquires the bank number 302 of the vector register 111 corresponding to itself represented by “a, b, c”. For example, the read line changing circuit 121A acquires “0,0,0” as the bank number 302.
  • the read line change circuit 121 receives the input of the step number 301 represented by “u, v” from the arithmetic instruction control unit 101. For example, when the step number 301 is 2, the read line changing circuit 121 receives “1,0”.
  • the read line changing circuit 121 uses the exclusive OR circuit 303 to obtain the exclusive OR of the second least significant bit of the bank number 302 and the upper bit of the step number 301. Further, the read line changing circuit 121 uses the exclusive OR circuit 304 to obtain the exclusive OR of the least significant bit of the bank number 302 and the least significant bit of the step number 301. As a result, the read line change circuit 121A acquires the read line number 305.
  • the capital alphabet in the read line number 305 indicates a value obtained by inverting the bit value. For example, when the step number is 2, the read line changing circuit 121A acquires 1 from the exclusive OR circuit 303 and 0 from the exclusive OR circuit 304. That is, the read line change circuit 121A acquires “1,0” as the read line number 305.
  • the line represented by “1,0” corresponds to the line with line number ## 2.
  • the read line change circuit 121 adds the read line number 305 to the lower 2 bits of the line information 306 of the line to be read specified by the instruction, and generates the read line information 307. After that, the read line changing circuit 121 outputs the generated read line information 307 to the vector register 111. As a result, the read line changing circuit 121 can output the line number corresponding to the bank number and the step number in the read line selection table 201 shown in FIG. In this case, the read line changing circuit 121 can output the read data output from the element register 113 corresponding to the line number represented by the lower 2 bits included in the read line information 307 to the vector register 111.
  • the read data includes all values stored in the element register 113, that is, four element data.
  • the read line changing circuit 121 outputs the information of the transmission source including the input read address to the vector register 111 as it is. As a result, the read line changing circuit 121 can output the read data output from the element register 113 having the line number represented by the read address to the vector register 111.
  • the read line changing circuit 121 corresponds to an example of the “first determining unit”.
  • the source bank corresponds to an example of the “first storage area”, and the read line corresponds to an example of the “first storage position”.
  • the router 125 receives input of read data from each vector register 111.
  • the router 125 also receives the input of the step number from the arithmetic instruction control unit 101.
  • the router 125 acquires the bank number of the transmission source according to the destination bank selection table 202 shown in FIG. 8 based on the bank number and step number of the storage destination vector register 111.
  • FIG. 8 is a diagram of an example of a destination bank selection table for packing processing according to the first embodiment.
  • the destination bank selection table 202 represents information on the transmission source bank that is the transmission source according to each storage destination bank for each packing process that is repeated four times in this embodiment. For example, if the storage-destination bank is bank number # 0, the router 125 sets the bank numbers # 0, # 1, # 2, and # 3 to the source bank in each of the step numbers 0 to 3. To choose as.
  • FIG. 9 is a diagram illustrating an outline of a circuit configuration for determining a storage destination bank at the time of packing included in the router according to the first embodiment.
  • the bank number 311 is 3-bit information in which the bank number of the storage destination bank is represented by a binary number.
  • the step number 312 is 2-bit information in which four step numbers are represented by a binary number.
  • the router 125 selects the bank number represented by “a, b, c” as the storage destination.
  • the router 125 rotates the bits of the bank number of the selected storage destination bank two bits to the left.
  • the 2-bit left rotate is a process of moving each bit by 2 bits toward the upper bit side, and in the case of moving beyond the most significant bit, it is a process of moving to the least significant bit and circulating. is there. That is, the router 125 moves the value of the least significant bit of the bank number 311 to the most significant bit, moves the value of the most significant bit to the second bit from the bottom, and the value of the second bit from the bottom. To the least significant bit.
  • the router 125 acquires the post-tour number 313. For example, when the bank number 311 of the storage destination vector register 111 is “0,1,1”, the router 125 acquires “1,0,1” as the post-tour number 313.
  • the router 125 receives the input of the step number 312 represented by a binary number “u, v” from the arithmetic instruction control unit 101. For example, when the step number is 2, the router 125 receives the input of "1,0".
  • the router 125 uses the exclusive OR circuit 314 to obtain the exclusive OR of the second bit from the bottom of the post-cycle number 313 and the upper bit of the step number. Further, the router 125 uses the exclusive OR circuit 315 to obtain the exclusive OR of the least significant bit of the post-cycle number 313 and the least significant bit of the step number. Then, the router 125 arranges the most significant bit of the post-tour number 313, the output from the exclusive OR circuit 314, and the output from the exclusive OR circuit 315 to obtain the bank number 316 of the transmission source bank.
  • the capital letters in the bank number 316 are the values obtained by inverting the original values.
  • the router 125 acquires 1 from the exclusive OR circuit 314 and the exclusive OR circuit 315, and acquires “1,1,1” as the bank number 316 of the transmission source bank.
  • the bank number 316 being "1, 1, 1” means that the bank number # 7 is the transmission source bank.
  • the router 125 can acquire the bank number of the transmission source corresponding to the storage destination bank number and the step number in the destination bank selection table 202 shown in FIG.
  • the router 125 inputs the value input from the vector register 111 of the determined source bank number to the byte shuffle circuit 122 connected to the product-sum calculator 112 corresponding to the vector register 111 of the selected storage destination bank number. Is output.
  • the router 125 acquires the bank number of the destination bank according to the destination bank selection table 203 shown in FIG. 10 based on the bank number and the step number of the storage destination vector register 111.
  • FIG. 10 is a diagram showing an example of a destination bank selection table for unpacking processing.
  • the destination bank selection table 203 represents information on a source bank that is a source corresponding to each storage destination bank for each packing process that is repeated four times in this embodiment. For example, when the storage destination bank is the bank number # 0, the router 125 sets the bank numbers # 0, # 2, # 4, and # 6 to the bank of the transmission source bank in each of the step numbers 0 to 3. Select as a number.
  • FIG. 11 is a diagram illustrating an outline of a circuit configuration that determines a storage destination bank at the time of unpacking included in the router according to the first embodiment.
  • the bank number 321 is 3-bit information in which the bank number of the storage destination bank is represented by a binary number.
  • the step number 322 is 2-bit information that represents the four step numbers in binary.
  • the router 125 selects the bank number represented by “a, b, c” as the storage destination.
  • the router 125 right rotates the bits of the selected storage destination bank number by 2 bits.
  • the 2-bit right rotate is a process of moving each bit by 2 bits toward the lower bit side, and in the case of moving beyond the least significant bit, it is a process of moving to the most significant bit and circulating. is there. That is, the router 125 moves the value of the most significant bit of the bank number 321 to the least significant bit, moves the value of the least significant bit to the second bit from the bottom, and the value of the second bit from the bottom. To the most significant bit. As a result, the router 125 acquires the post-patrol number 323. For example, when the bank number 321 of the storage destination vector register 111 is “1, 0, 1”, the router 125 acquires “0, 1, 1” as the post-tour number 323.
  • the router 125 receives the input of the step number 322 represented by a binary number “u, v” from the arithmetic instruction control unit 101. For example, when the step number is 2, the router 125 receives the input of "1,0".
  • the router 125 uses the exclusive OR circuit 324 to obtain the exclusive OR of the most significant bit of the post-cycle number 323 and the upper bit of the step number. Further, the router 125 uses the exclusive OR circuit 325 to obtain the exclusive OR of the second lowest bit of the post-cycle number 323 and the lower bit of the step number. Then, the router 125 arranges the output from the exclusive OR circuit 324, the output from the exclusive OR circuit 325, and the least significant bit of the post-cycle number 323 to obtain the bank number 326 of the transmission source bank.
  • the capital letters in the bank number 326 are the values obtained by inverting the original values.
  • the router 125 acquires 1 from the exclusive OR circuit 324 and the exclusive OR circuit 325, and acquires “1,1,1” as the bank number 326 of the transmission source bank.
  • the bank number 326 being “1,1,1” means that the bank number # 7 is the transmission source bank.
  • the router 125 can obtain the source bank number corresponding to the storage destination bank number and the step number in the destination bank selection table 203 shown in FIG.
  • the router 125 causes the byte shuffle circuit 122 connected to the product-sum calculator 112 corresponding to the vector register 111 of the selected storage destination bank number to read the data input from the vector register 111 of the determined transmission source bank number. Output the data.
  • the router 125 stores, for example, the definition pattern 251 shown in FIG.
  • FIG. 12 is a diagram showing an example of a definition pattern for determining the read source bank corresponding to the storage destination bank.
  • the definition pattern 251 a read source bank corresponding to each storage source bank is registered for each pattern.
  • the number on the left side of each read source bank in the definition pattern 251 is the offset of the read source line number. That is, +1 means to move to the next line.
  • each pattern usually rotate and broadcast. Usually, this is the case where the read source bank and the storage destination bank are the same. Rotate is a case where the bank bank number of the read source bank is equal to each storage destination bank plus the same number. Broadcast is a case where data from one read source bank is stored in all storage destination banks.
  • the router 125 can realize data transfer according to the determined combination of the read source bank and the storage destination bank.
  • the definition pattern 252 is an example, and the router 125 may use another pattern, or may transfer without using the definition pattern.
  • the router 125 is an example of the “transfer unit”.
  • the storage destination bank is an example of the “second storage area”.
  • the 32-bit area for each line in the element register 113 that is the read source and the write destination can be individually handled as four 8-bit areas. These four 8-bit areas are referred to as bytes B0 to B3, respectively. B0 to B3 represent byte numbers, but here, the bytes having the respective byte numbers are represented as bytes B0 to B3.
  • the byte shuffle circuit 122, the sum-of-products calculator 112, and the destination byte write enable / disable selection circuit 123 will be described.
  • the byte shuffle circuit 122, the product-sum calculator 112, and the destination byte write enable / disable selection circuit 123 determine the byte to be written in the write destination element register 113 by combining the respective processes. Specifically, since the byte where the element in the read source is stored and the byte where the element in the write destination is stored are different in position, the byte shuffle circuit 122 corresponds to the element data stored in each read byte of the read data. Determines the position of the destination byte to The product-sum calculator 112 is a circuit that simply passes data here.
  • the destination byte write enable / disable selection circuit 123 is a circuit that selects a destination byte into which element data is actually written.
  • the byte shuffle circuit 122 receives the read data output from the vector register 111 from the router 125. Further, the byte shuffle circuit 122 and the destination byte write enable / disable selection circuit 123 receive the input of the step number from the arithmetic instruction control unit 101.
  • the byte shuffle circuit 122, the product-sum calculation unit 112, and the destination byte write enable / disable selection circuit 123 use the byte selection table shown in FIG. 13 based on the bank number and step number of the storage destination vector register 111. A destination byte number and a read source byte number according to 204 are acquired.
  • FIG. 13 is a diagram of an example of a byte selection table for packing processing according to the first embodiment.
  • the byte selection table 204 represents information of a destination byte as a write destination and a read byte as a read source according to each storage destination bank for each packing process that is repeated four times in the present embodiment.
  • all the element data is stored in the position of the byte B0 in the read line, so that the byte B0 is designated as the read byte.
  • the byte shuffle circuit 122, the product-sum calculator 112, and the destination byte write enable / disable selection circuit 123 set the byte B2 as the destination byte and the byte B0 as the destination byte. Read byte.
  • the byte shuffle circuit 122, the product-sum calculator 112, and the destination byte write enable / disable selection circuit 123 use the byte selection table shown in FIG. 14 based on the bank number and step number of the storage destination vector register 111. The byte number of the destination byte and the byte number of the read byte corresponding to 205 are acquired.
  • FIG. 14 is a diagram of an example of a byte selection table for unpacking processing.
  • the byte selection table 205 represents information of a read byte as a write destination and a read bank as a read source according to each storage destination bank for each packing process that is repeated four times in the present embodiment.
  • all the element data is stored at the position of the byte B0 in the destination line of the write destination, so the byte number B0 is designated as the destination byte.
  • the byte shuffle circuit 122, the product-sum calculator 112, and the destination byte write enable / disable selection circuit 123 set the byte number B0 as the destination byte, and the byte number. Let B0 be the read byte.
  • FIG. 15 is a diagram for explaining a destination byte determination process at the time of packing by the byte shuffle circuit according to the second embodiment.
  • the byte shuffle circuit 122 sets the read source byte to “00” as shown in the table 331 of FIG. 15 regardless of the destination byte number B0 to B3 regardless of the bank number of the storage destination vector register 111. To decide.
  • “00” indicates the byte of the byte number B0. This is because in the present embodiment, element data obtained by compressing 32-bit data into 8-bit data is stored in the byte B0 in any line of any bank.
  • FIG. 16 is a diagram for explaining a destination byte determination process at the time of unpacking by the byte shuffle circuit according to the first embodiment.
  • the bank number 332 is 3-bit information that represents the bank number of the storage destination bank in binary.
  • the byte shuffle circuit 122 has the bank number of the vector register 111 corresponding to itself in advance.
  • the bank number of the vector register 111 corresponding to this self is the bank number of the storage destination bank.
  • the element data is written in the least significant byte B0 of the line. Therefore, the byte shuffle circuit 122 sets the byte B0 as the destination byte.
  • the byte shuffle circuit 122 acquires the lower 2 bits of the bank number 332 of the storage destination vector register 111, and as shown in the table 333, the byte of the read byte corresponding to the byte of the byte number B0 that is the destination byte. Number.
  • the byte shuffle circuit 122 outputs the read data and the information of the destination byte corresponding to each read byte in the read data to the product-sum calculator 112.
  • the sum-of-products calculator 112 receives input of read data and information of a destination byte corresponding to each read byte in the read data from the byte shuffle circuit 122. Then, the product-sum calculation unit 112 performs a calculation for passing the input information through it, and outputs the calculation result to the destination byte write enable / disable selection circuit 123. That is, the sum-of-products calculator 112 performs the same process as outputting the input read data information to the destination byte write enable / disable selecting circuit 123 as it is.
  • FIG. 17 is a diagram showing an outline of a circuit configuration for selecting a destination byte at the time of packing included in the destination byte write enable / disable selection circuit according to the first embodiment.
  • the bank number 342 is 3-bit information that represents the bank number of the storage destination bank in binary.
  • the step number 341 is 2-bit information in which four step numbers are represented by a binary number.
  • the destination byte writability selection circuit 123 acquires the bank number represented by “a, b, c” as the storage destination. Next, the destination byte write enable / disable selection circuit 123 receives the input of the step number 341 represented by “u, v” from the arithmetic instruction control unit 101. For example, when the step number is 2, the destination byte write enable / disable selection circuit 123 receives an input of "1, 0".
  • the destination byte write enable / disable selection circuit 123 uses the exclusive OR circuit 343 to obtain the exclusive OR of the most significant bit of the bank number 342 and the upper bit of the step number. Further, the destination byte write enable / disable selection circuit 123 uses the exclusive OR circuit 344 to obtain the exclusive OR of the second least significant bit of the bank number 342 and the lower bit of the step number. Then, the destination byte write enable / disable selection circuit 123 inputs a value obtained by arranging the output from the exclusive OR circuit 343 and the output from the exclusive OR circuit 344 into a binary number to the determination circuits 345 to 348.
  • the determination circuits 345 to 348 can be realized by combining an AND circuit and an inverter. Then, when 1 is output from any of the determination circuits 345 to 348, the writing to any of the bytes B0 to B3 is enabled as described in the square frame connected to it. Then, the data is written in the enabled bank, and the data is not written in the other banks.
  • FIG. 18 is a diagram for explaining the destination byte writability selection processing at the time of unpacking by the destination byte writability selection circuit according to the first embodiment.
  • the destination byte write enable / disable selection circuit 123 invalidates the write to the bytes B1 to B3 as shown in the table 349 of FIG. 15 regardless of the bank number of the storage destination vector register 111. Further, the destination byte write enable / disable selection circuit 123 validates the write to the byte B0 as shown in the table 349. This is because in the present embodiment, at the time of unpacking, element data is stored in the least significant bit of the 32-bit area in any line of any bank.
  • the byte shuffle circuit 122, the product-sum calculator 112, and the destination byte write enable / disable selection circuit 123 output information corresponding to the bank number and step number of the destination byte in the byte selection table 204 shown in FIG. 13 during packing. It can be performed. Further, the byte shuffle circuit 122, the product-sum calculator 112, and the destination byte write enable / disable selection circuit 123 output information corresponding to the bank number and step number of the destination byte in the byte selection table 205 shown in FIG. 14 during unpacking. It can be performed.
  • the byte shuffle circuit 122 and the destination byte write enable / disable selection circuit 123 correspond to an example of a “storage unit”. The destination byte corresponds to an example of “predetermined position”.
  • the destination line selection circuit 124 receives the input of the information of the destination area from the arithmetic instruction control unit 101. For example, the destination line selection circuit 124 receives input of information indicating the area 24 shown in FIG. 5 from the arithmetic instruction control unit 101 as information on the area to be the destination. Further, the destination line selection circuit 124 receives the input of the step number from the arithmetic instruction control unit 101. Further, the destination line selection circuit 124 holds the bank number of the vector register 111 connected to itself as the bank number of the storage destination vector register 111.
  • the element data is packed in a specific line at the time of packing. Therefore, in the case of the packing processing, the destination line selection circuit 124 sets the line indicated by the destination area designated by the instruction input from the arithmetic instruction control unit 101 as the destination line.
  • the destination line selection circuit 124 acquires the line number according to the destination bank selection table 202 shown in FIG. 19 based on the bank number and step number of the storage destination bank.
  • FIG. 19 is a diagram of an example of a destination line selection table for unpacking processing according to the first embodiment.
  • the destination line selection table 206 represents the information of the destination line that is the storage destination of the element data according to each destination bank for each unpacking process that is repeated four times in this embodiment. For example, when the destination bank is the bank number # 0, the destination line selection circuit 124 determines the line numbers ## 0, ## 1, ## 2, and ## 3 for the step numbers 0 to 3, respectively. Line is selected as the destination line.
  • FIG. 20 is a diagram illustrating an outline of a circuit configuration of the destination line selection circuit according to the first embodiment that determines a destination line at the time of unpacking.
  • the bank number 352 is 3-bit information that represents the bank number of the storage destination bank in binary.
  • the step number 351 is 2-bit information that represents the four step numbers in binary.
  • the destination line selection circuit 124 acquires the bank number 352 of the vector register 111, which is represented by “a, b, c”, to which it connects. For example, the destination line selection circuit 124A acquires “0,0,0” as the bank number 352.
  • the destination line selection circuit 124 receives the input of the step number 351 represented by “u, v” from the arithmetic instruction control unit 101. For example, when the step number 351 is 2, the destination line selection circuit 124 receives the input of "1,0".
  • the destination line selection circuit 124 uses the exclusive OR circuit 353 to obtain the exclusive OR of the second lowest bit of the bank number 352 and the upper bit of the step number 351. Further, the destination line selection circuit 124 uses the exclusive OR circuit 354 to obtain the exclusive OR of the least significant bit of the bank number 352 and the least significant bit of the step number 351. As a result, the destination line selection circuit 124 acquires the destination line number 355.
  • the uppercase alphabet in the destination line number 355 indicates a value obtained by inverting the bit value. For example, when the step number is 2, the destination line selection circuit 124A acquires 1 from the exclusive OR circuit 353 and 0 from the exclusive OR circuit 354. That is, the destination line selection circuit 124 acquires “1,0” as the destination line number 355.
  • the line represented by "1,0" is the line with line number ## 2.
  • the destination line selection circuit 124 adds the destination line number 355 to the lower 2 bits of the line information 356 of the line designated as the destination by the instruction, and generates the destination line information 357. After that, the destination line selection circuit 124 outputs the generated destination line information 357 to the vector register 111. Thereby, the destination line selection circuit 124 can output the information corresponding to the bank number and the step number in the destination line selection table 206 shown in FIG. In this case, the destination line selection circuit 124 can cause the vector register 111 to write the element data to the element register 113 of the line number represented by the lower 2 bits included in the destination line information 357.
  • the destination line selection circuit 124 corresponds to an example of the “second selection unit”.
  • the destination line corresponds to an example of the “second storage position”.
  • FIG. 21 is a diagram illustrating a relationship between a storage position of element data of a transmission source and a storage position of element data of a destination during packing according to the first embodiment.
  • FIG. 21 shows the transmission source and the destination determined in each step by the product-sum calculation unit 100 by the above-described processing.
  • the correspondence 410 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 0.
  • the correspondence relationship 420 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 1.
  • the correspondence 430 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 2.
  • the correspondence 440 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 3.
  • the designation information 451 is information on the transmission source designated by the instruction from the arithmetic instruction control unit 101.
  • the designation information 452 is information on the destination designated by the instruction from the arithmetic instruction control unit 101.
  • the product-sum calculation unit 100 adds the read line information 411 to the lower 2 bits of the designation information 451 to obtain the line number of the read line, as shown in the correspondence 410.
  • the read line information 411 corresponds to the lower 2 bits of the source bank number 412 that represents the bank number of the source bank in 3 bits using a binary number.
  • the source bank number 412 is the bank number of the source bank.
  • the product-sum calculation unit 100 sets the byte number 413 having a value of “00” as the byte number of the read byte.
  • the product-sum calculation unit 100 sets the storage destination bank number 414 generated by rotating each bit of the transmission source bank number 412 by 2 bits to the right as the transmission destination bank number. Further, the product-sum calculation unit 100 sets the destination byte number 415, which is the lower 2 bits of the source bank number 412, as the byte number of the destination byte.
  • the product-sum calculation unit 100 adds the read line information 421 to the lower 2 bits of the designation information 451 to obtain the line number of the read line.
  • the read line information 421 is a value obtained by inverting the lower bit of the lower 2 bits of the transmission source bank number 422. Further, the product-sum calculation unit 100 sets the byte number 423 having a value of "00" as the byte number of the read byte.
  • the product-sum calculation unit 100 inverts the least significant bit of the source bank number 422 and then rotates each bit by 2 bits to the right to generate a storage destination bank number.
  • the product-sum calculation unit 100 sets the destination byte number 425, which is the lower 2 bits of the source bank number 422, as the byte number of the destination byte.
  • the product-sum calculation unit 100 adds the read line information 431 to the lower 2 bits of the designation information 451 to obtain the line number of the read line.
  • the read line information 431 is a value obtained by inverting the upper bit of the lower two bits of the transmission source bank number 432. Further, the product-sum calculation unit 100 sets the byte number 433 having a value of “00” as the byte number of the read source byte.
  • the product-sum calculation unit 100 inverts the second least significant bit of the transmission source bank number 432, and then rotates each bit by 2 bits to store it into a storage.
  • the destination bank number 434 is the bank number of the storage destination bank.
  • the product-sum calculation unit 100 sets the destination byte number 435, which is the lower 2 bits of the source bank number 432, as the byte number of the destination byte.
  • the product-sum calculation unit 100 adds the read line information 441 to the lower 2 bits of the designation information 451 to obtain the line number of the read line.
  • the read line information 441 is a value obtained by inverting both lower two bits of the transmission source bank number 432. Further, the product-sum calculation unit 100 sets the byte number 443 having a value of “00” as the byte number of the read source byte.
  • the product-sum calculation unit 100 inverts the lower 2 bits of the source bank number 442 and then rotates each bit by 2 bits to the right to generate a storage destination bank number 444. Is the bank number of the storage destination bank. Further, the product-sum calculation unit 100 sets the destination byte number 445 corresponding to the lower 2 bits of the source bank number 442 as the byte number of the destination byte.
  • FIG. 21 is expressed in the form of lines, banks, and bytes as shown in FIG.
  • FIG. 22 is a diagram of a list of source and destination information at the time of packing by the product-sum calculation unit according to the first embodiment.
  • the number on the left side of the drawing represents the number sequentially assigned to the area in which 32 element data before packing are stored. Then, the left side of the arrow represents information on the position of the transmission source. Further, the right side of the arrow represents information on the position of the destination. That is, “line ## p-bank # q-byte (Br)” indicates an area represented by a line number ## p, a bank number #q, and a byte number (Br). The line number ## (dst) is the line number of the destination designated by the instruction. Further, eight sets from the upper end toward the paper surface correspond to the transmission source and the destination in each of the step numbers 0 to 3, respectively.
  • the source bank number 461 does not overlap in each step. That is, the product-sum calculation unit 100 can simultaneously read out eight element data in each step. Then, as shown in FIG. 22, the destination bank number 462 also does not overlap in each step. That is, the product-sum operation unit 100 can store eight element data at the same time in each step. That is, the product-sum calculation unit 100 can efficiently use the eight banks to perform packing processing.
  • the product-sum calculation unit 100 can efficiently perform the packing process by using the positions of the transmission source and the destination determined by the procedure shown in FIG.
  • the source and destination positions shown in FIG. 21 are the source and destination determined according to the read line selection table 201 of FIG. 6, the destination bank selection table 202 of FIG. 8, and the byte selection table 204 of FIG. Match the position of. That is, it is understood that the product-sum calculation unit 100 described above can efficiently perform the packing process by the process of the product-sum calculation unit 100 described above.
  • FIG. 23 is a diagram for explaining a generalized transmission source and destination determination method at the time of packing.
  • Information 471 on the upper side of the drawing in FIG. 23 is information indicating the position of the area of the transmission source.
  • the information 472 is information indicating the position of the destination area.
  • K in FIG. 23 is a power when the number of banks is represented by a power of 2.
  • K 3.
  • N is a logarithmic value whose base is 2 of the magnification of the line size of each bank with respect to the element data size of the transmission source. That is, N is a logarithmic value whose base is 2 of the magnification of the element data before compression with respect to the element data after compression.
  • the bank number of the transmission source bank is represented by a K-bit binary number, and the combination obtained by maintaining or inverting the value of each bit of the area 473 that is the least significant N bits is required.
  • the bank number 474 of the storage-destination bank is obtained by rotating the K-bit value changed to the combination obtained by obtaining the N-bit portion from the lowest order by N bits.
  • the N bits from the beginning of the bank number 474 are a combination obtained by maintaining or inverting the value of each bit of the area 473.
  • the value of the area 475 which is N bits from the most significant of the bank number 474 of the storage destination bank becomes the line number 476 of the read line.
  • the value of the N-bit area 473 of the least significant of the bank number of the transmission source corresponds to the value of the N-bit area 477 of the most significant bit of the destination byte, and further the M-bit area 478 of the most significant bit of the read byte.
  • the N + M bit value 479 to which the value is added becomes the element number in the bank of the destination line to which the element is moved.
  • the product-sum operation unit 100 can efficiently perform the packing process at any compression ratio and the number of banks. It can be carried out.
  • FIG. 24 is a diagram showing a relationship between a storage position of element data of a transmission source and a storage position of element data of a destination during unpacking.
  • FIG. 24 shows the transmission source and the destination determined in each step by the product-sum calculation unit 100 by the above-described processing.
  • the correspondence 510 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 0.
  • the correspondence relationship 520 represents a relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 1.
  • the correspondence 530 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 2.
  • the correspondence relationship 540 represents a relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 3.
  • the designation information 551 is information on the transmission source designated by the instruction from the arithmetic instruction control unit 101.
  • the designation information 552 is information on the destination designated by the instruction from the arithmetic instruction control unit 101.
  • the source bank number 511 in the correspondence 510 is the bank number of the source bank. Further, the destination line information 513 added to the lower 2 bits of the designation information 552 becomes the line number of the destination line.
  • the destination line information 513 corresponds to the upper 2 bits of the source bank number 511. Further, the byte number 515 of “00” becomes the byte number of the destination byte.
  • the storage destination bank number 514 generated by rotating each bit of the transmission source bank number 511 by 2 bits becomes the bank number of the storage destination bank. Further, the lower 2 bits of the storage destination bank number 514 correspond to the read byte number 512.
  • the source bank number 521 in the correspondence 520 is the bank number of the source bank. Further, the destination line information 523 added to the lower 2 bits of the designation information 552 becomes the line number of the destination line.
  • the destination line information 523 corresponds to the upper 2 bits of the source bank number 521. Further, the byte number 525 of "00" becomes the byte number of the destination byte.
  • the storage destination bank number 524 generated by inverting the second least significant bit of the transmission source bank number 521 and rotating each bit left 2 bits is stored. It becomes the bank number of the destination bank. Further, the lower 2 bits of the storage destination bank number 524 correspond to the read byte number 522.
  • the source bank number 531 in the correspondence 530 becomes the bank number of the source bank.
  • the destination line information 533 added to the lower 2 bits of the designation information 552 becomes the line number of the destination line.
  • the destination line information 533 corresponds to the upper 2 bits of the source bank number 531. Further, the byte number 535 that is "00" becomes the byte number of the destination byte.
  • the storage destination bank number 534 generated by inverting the most significant bit of the transmission source bank number 531 and rotating each bit to the left by 2 bits is the storage destination bank number 534. It becomes the bank number. Further, the lower 2 bits of the storage destination bank number 534 correspond to the read byte number 532.
  • the transmission source bank number 541 in the correspondence 540 becomes the bank number of the transmission source bank. Further, the destination line information 543 added to the lower 2 bits of the designation information 552 becomes the line number of the destination line. The destination line information 543 corresponds to the upper 2 bits of the source bank number 541. Further, the byte number 545 that is "00" becomes the byte number of the destination byte.
  • the storage destination bank number 544 generated by inverting both the 2 bits from the most significant bit of the transmission source bank number 541 and rotating each bit by 2 bits to the left is stored. It becomes the bank number of the destination bank. Further, the lower 2 bits of the storage destination bank number 544 correspond to the read byte number 542.
  • the product-sum calculation unit 100 can efficiently perform the packing process by using the positions of the transmission source and the destination determined by the procedure shown in FIG.
  • the source and destination positions shown in FIG. 24 are the source and destination positions determined according to the destination bank selection table 203 in FIG. 10, the byte selection table 205 in FIG. 14 and the destination line selection table 206 in FIG. Matches That is, the above-described processing of the product-sum calculation unit 100 enables the product-sum calculation unit 100 to efficiently perform the unpacking process.
  • FIG. 25 is a diagram for explaining a generalized method of determining a transmission source and a destination at the time of unpacking.
  • the information 561 on the upper side of the page in FIG. 25 is information indicating the position of the area of the transmission source.
  • the information 562 is information indicating the position of the destination area.
  • K, N, and M in FIG. 25 are determined by the same method as K, N, and M in FIG. 23, respectively.
  • the bank number of the source bank is represented by a K-bit binary number, and the value of each bit of the area 563, which is N bits from the most significant bit, is maintained or inverted to obtain a combination. The acquisition of this combination is repeated until all combinations are completed.
  • the bank number 564 of the destination bank is obtained by rotating the K-bit value, which has been changed to the combination obtained by obtaining the N-bit portion from the most significant bit, to N bits right.
  • the N least significant bits of the bank number 564 are a combination obtained by maintaining or inverting the value of each bit of the area 563.
  • the value of the area 563 which is N bits from the most significant bank number of the transmission source bank becomes the line number 565 of the destination line.
  • the value of the least significant N-bit area 566 of the bank number 564 of the destination bank corresponds to the value of the most significant N-bit area 567 of the destination byte, and thereafter, the value of the most significant M-bit area 568 of the destination byte.
  • a value 569 of N + M bits added with the value of becomes the element number in the bank of the read line to which the element is moved.
  • the product-sum calculation unit 100 can efficiently perform the unpacking process at any compression ratio and the number of banks. It can be performed.
  • FIG. 26 is a flowchart of packing processing by the processing unit according to the first embodiment.
  • the product-sum calculation unit 100 acquires a packing instruction in a repeating unit from the calculation instruction control unit 101 (step S101). At this time, the product-sum calculation unit 100 receives the initial value of the step number, that is, 0, from the calculation instruction control unit 101.
  • the read line changing circuit 121 acquires the line number of the transmission destination from the bank number and step number of the vector register 111 to which it corresponds. Further, the read line changing circuit 121 acquires information on the line of the storage destination designated by the instruction from the packing instruction. Then, the read line changing circuit 121 adds the acquired line number of the transmission destination to the lowest of the information of the line of the storage destination designated by the instruction (step S102). Then, the read line changing circuit 121 outputs the information of the line added with the line number of the transmission destination to the vector register 111.
  • the vector register 111 reads the read data from the element register 113 corresponding to the line number added to the bottom of the input line information (step S103). The vector register 111 outputs the read read data to the router 125.
  • the router 125 identifies the bank number of the transmission source according to the bank number of each storage destination (step S104).
  • the router 125 transmits the acquired read data to the byte shuffle circuit 122 connected to the product-sum calculator 112 corresponding to the vector register 111 having the bank number of the storage destination whose source is the bank number of the vector register 111 of the read source. Yes (step S105).
  • the byte shuffle circuit 122 determines a read byte corresponding to each destination byte according to the bank number of the element register 113 of the storage destination (step S106). Then, the byte shuffle circuit 122 outputs the read data to the product-sum calculator 112 together with the information of the read byte corresponding to each destination byte.
  • the sum-of-products calculator 112 executes and outputs a calculation that passes through the received read data (step S107).
  • the destination byte write enable / disable selection circuit 123 acquires the read data from the product-sum calculator 112. Next, the destination byte write enable / disable selection circuit 123 determines the destination byte from the storage destination bank number and the step number of the destination bytes, and validates the writing of the destination byte (step S108).
  • the destination byte write availability selection circuit 123 outputs the read data to the vector register 111.
  • the vector register 111 writes the element data stored in the corresponding read byte into the byte in which the writing of the line designated by the instruction is enabled (step S109).
  • the arithmetic instruction control unit 101 determines whether or not the four steps, which are the processing of the repeating unit, are completed (step S110).
  • step S110 If the four steps have not been completed (step S110: No), the arithmetic instruction control unit 101 outputs the step number of the next step to the product-sum calculator 112.
  • the product-sum calculation unit 112 acquires the step number of the next step from the calculation instruction control unit 101 (step S111). Then, the product-sum calculator 112 returns to step S102.
  • step S110 Yes
  • step S112 determines whether or not the packing processing for all the repeating units is completed. If the packing processing in the repeating unit remains (step S112: No), the product-sum calculator 112 returns to step S101.
  • step S112 Yes
  • the packing process is ended.
  • FIG. 27 is a flowchart of the unpacking process performed by the processing unit according to the first embodiment.
  • the sum-of-products calculation unit 100 acquires the unpacking instruction for each repeating unit from the calculation instruction control unit 101 (step S201). At this time, the product-sum calculation unit 100 receives the initial value of the step number, that is, 0, from the calculation instruction control unit 101.
  • the read line changing circuit 121 acquires the information of the transmission source line specified by the instruction from the unpacking instruction. Then, the read line changing circuit 121 outputs the information of the transmission destination line designated by the instruction to the vector register 111.
  • the vector register 111 reads the read data from the element register 113 having the line number according to the input line information (step S202).
  • the vector register 111 outputs the read read data to the router 125.
  • the router 125 identifies the bank number of the transmission source according to the bank number of each storage destination (step S203).
  • the router 125 transmits the acquired read data to the byte shuffle circuit 122 connected to the product-sum calculator 112 corresponding to the vector register 111 having the bank number of the storage destination whose source is the bank number of the vector register 111 of the read source. (Step S204).
  • the byte shuffle circuit 122 determines a read byte corresponding to each destination byte according to the bank number of the element register 113 of the storage destination (step S205). Then, the byte shuffle circuit 122 outputs the read data to the product-sum calculator 112 together with the information of the read byte corresponding to each destination byte.
  • the product-sum calculation unit 112 executes and outputs a calculation that passes through the received read data (step S206).
  • the destination byte write enable / disable selection circuit 123 acquires the read data from the product-sum calculator 112. Next, the destination byte write enable / disable selection circuit 123 enables writing of the least significant byte among the destination bytes (step S207).
  • the destination line selection circuit 124 determines a destination line according to the storage destination bank (step S208).
  • the destination byte write availability selection circuit 123 outputs the read data to the vector register 111.
  • the vector register 111 writes the element data stored in the corresponding read byte into the byte in which the writing of the line determined by the destination line selection circuit 124 is enabled (step S209).
  • the arithmetic instruction control unit 101 determines whether or not the four steps, which are the processing of the repeating unit, are completed (step S210).
  • step S210 If the four steps have not been completed (step S210: No), the arithmetic instruction control unit 101 outputs the step number of the next step to the product-sum arithmetic unit 112.
  • the product-sum calculation unit 112 acquires the step number of the next step from the calculation instruction control unit 101 (step S211). After that, the product-sum calculator 112 returns to step S202.
  • step S210 determines whether or not the unpacking processing for all the repeating units is completed (step S212).
  • step S212 determines whether or not the unpacking processing for all the repeating units is completed.
  • step S212 Yes
  • the unpacking process is ended.
  • FIG. 28 is a diagram showing an example of an instruction for causing the processing unit to execute the packing processing and the unpacking processing according to the present embodiment.
  • the instruction shown in FIG. 28 specifies what kind of packing process and unpacking process is to be performed, which step in the process is to be performed, the line number of the read source line, and the line number of the destination line.
  • Each processing circuit in the product-sum calculation unit 100 acquires the information designated by the instruction shown in FIG. 28 and executes the processing.
  • the processing unit determines the bank number of the storage destination bank from the bank number of the transmission source bank and the step number of the step included in the processing of the repeating unit in the packing processing, Also, the destination byte is determined. Then, the packing is completed by moving the element data stored in each bank to the determined destination byte of the element register of the predetermined line number included in the vector register having the determined bank number.
  • the processing unit determines the bank number of the storage destination bank and the line number of the destination line from the bank number of the transmission source bank and the step number of the step included in the processing of the repeating unit. To do. Then, the unpacking is completed by moving the element data stored in each bank to the determined destination byte of the element register having the line number of the determined destination line included in the vector register having the determined bank number.
  • the processing unit according to the present embodiment can execute efficient packing and unpacking processing by using the existing product-sum calculation circuit.
  • the second embodiment will be described. Also in this embodiment, the information processing apparatus 50 shown in FIG. 1 and the product-sum calculation unit 100 shown in FIG. 2 are used. In the following description, description of the operation of each unit similar to that of the first embodiment may be omitted.
  • FIG. 29 is a diagram illustrating an outline of the packing process according to the second embodiment. In this embodiment, as a repeating unit, two steps are executed as shown in FIG.
  • the read line change circuit 121 determines the read line according to the read line selection table 601 shown in FIG. 30 based on the input step number information and the bank number of the vector register 111 to which the read line change circuit 121 is connected. Get the line number.
  • FIG. 30 is a diagram of an example of a read line selection table for packing processing according to the second embodiment.
  • the read line selection table 601 represents information on a read line as a read source according to each source bank for each packing process that is repeated twice in this embodiment.
  • the read line change circuit 121 uses the line number of the vector register 111 to which it is connected and the step number 0 to obtain the information of the read line that is the read source.
  • the information of this read line matches the information of the read line when the step number of bank number # 0 in the read line selection table 601 is 0. Then, the read line changing circuit 121 inputs the obtained line number to the vector register 111 as a read address.
  • FIG. 31 is a diagram illustrating an outline of the circuit configuration of the read line changing circuit according to the second embodiment.
  • the bank number 612 is 3-bit information in which the bank number of the vector register 111 connected to the read line changing circuit 121 is represented by a binary number.
  • the step number 611 is 1-bit information that represents two step numbers in binary.
  • the read line changing circuit 121 acquires the bank number 612 of the vector register 111 corresponding to itself represented by “a, b, c”. Next, the read line changing circuit 121 receives the input of the step number 611 represented by “v” from the arithmetic instruction control unit 101. For example, when the step number is 1, the read line changing circuit 121 receives "1" as an input.
  • the read line changing circuit 121 uses the exclusive OR circuit 613 to obtain the exclusive OR of the least significant bit of the bank number 612 and the step number 611. As a result, the read line changing circuit 121 acquires the read line number 614.
  • the capital alphabet in the read line number 614 indicates a value obtained by inverting the bit value.
  • the read line change circuit 121 adds the read line number 614 to the least significant bit of the line information 615 of the line to be read specified by the instruction, and generates the read line information 616. After that, the read line changing circuit 121 outputs the generated read line information 616 to the vector register 111.
  • the read line changing circuit 121 can output the line number corresponding to the bank number and the step number in the read line selection table 601 shown in FIG. In this case, the read line changing circuit 121 can cause the vector register 111 to output the read data output from the element register 113 corresponding to the line number represented by the least significant bit included in the read line information 616.
  • the read line changing circuit 121 outputs the information of the transmission source including the input read address to the vector register 111 as it is. As a result, the read line changing circuit 121 can output the read data output from the element register 113 having the line number represented by the read address to the vector register 111.
  • the router 125 receives input of read data from each vector register 111.
  • the router 125 also receives the input of the step number from the arithmetic instruction control unit 101.
  • the router 125 acquires the source bank number according to the destination bank selection table 602 shown in FIG. 32 based on the bank number and step number of the storage destination vector register 111.
  • FIG. 32 is a diagram of an example of a destination bank selection table for packing processing according to the second embodiment.
  • the destination bank selection table 602 represents information on the source bank that is the source corresponding to each storage bank for each packing process that is repeated twice in this embodiment. For example, if the storage destination bank is bank number # 0, the router 125 selects the bank with bank numbers # 0 and # 1 as the source bank in each of the step numbers 0 and 1.
  • FIG. 33 is a diagram illustrating an outline of a circuit configuration that determines a storage destination bank at the time of packing included in the router according to the second embodiment.
  • the bank number 621 is 3-bit information that represents the bank number of the storage destination bank in binary.
  • the step number 622 is 1-bit information that represents two step numbers in binary.
  • the router 125 selects the bank number represented by “a, b, c” as the storage destination.
  • the router 125 rotates the bit of the bank number of the selected storage destination bank left by 1 bit. That is, the router 125 moves the value of the least significant bit and the second least significant bit of the bank number 621 to the upper bit of each one bit, and moves the most significant bit value to the least significant bit.
  • the router 125 acquires the post-tour number 623. For example, when the bank number 621 of the storage destination vector register 111 is “0,1,1”, the router 125 acquires “1,1,0” as the post-tour number 623.
  • the router 125 receives the input of the step number 622 represented by “v” from the arithmetic instruction control unit 101.
  • the router 125 uses the exclusive OR circuit 624 to obtain the exclusive OR of the least significant bit of the post-cycle number 623 and the step number.
  • the router 125 arranges the most significant bit and the second least significant bit of the post-tour number 623 and the output from the exclusive OR circuit 624 to obtain the bank number 625 of the transmission source bank.
  • the capital letters in the bank number 625 are the inverted values of the original values.
  • the router 125 inputs from the vector register 111 having the determined bank number of the transmission source bank to the byte shuffle circuit 122 connected to the product-sum calculator 112 corresponding to the vector register 111 of the selected storage destination bank number. Output the value.
  • FIG. 34 is a diagram illustrating an outline of a circuit configuration that determines a storage destination bank at the time of unpacking included in the router according to the second embodiment.
  • the bank number 626 is 3-bit information in which the bank number of the storage destination bank is represented by a binary number.
  • the step number 627 is 1-bit information that represents two step numbers in binary.
  • the router 125 selects the bank number represented by “a, b, c” as the storage destination. Next, the router 125 rotates the bits of the selected storage destination bank number right by 1 bit. That is, the router 125 moves the value of the most significant bit and the value of the second least significant bit of the bank number 626 to the next lower bit and sets the value of the least significant bit to the most significant bit. As a result, the router 125 acquires the post-patrol number 628. For example, when the bank number 626 of the storage destination vector register 111 is “1,0,1”, the router 125 acquires “1,1,0” as the post-tour number 628.
  • the router 125 receives the input of the step number 627 represented by “v” from the arithmetic instruction control unit 101.
  • the router 125 uses the exclusive OR circuit 629 to obtain the exclusive OR of the most significant bit of the post-cycle number 628 and the step number 627.
  • the router 125 obtains the bank number 630 of the transmission source bank by arranging the output from the exclusive OR circuit 629 and the values of the most significant bit and the second least significant bit of the post-cycle number 628.
  • the capital letters in the bank number 630 are the values obtained by inverting the original values.
  • the router 125 causes the byte shuffle circuit 122 connected to the product-sum calculator 112 corresponding to the vector register 111 of the selected storage destination bank number to read the data input from the vector register 111 of the determined transmission source bank number. Output the data.
  • the byte shuffle circuit 122, the product-sum calculation unit 112, and the destination byte write enable / disable selection circuit 123 use the byte selection table shown in FIG. A destination byte number and a read source byte number according to 603 are acquired.
  • FIG. 35 is a diagram of an example of a byte selection table for packing processing according to the second embodiment.
  • the byte selection table 603 represents information on a destination byte as a write destination and a read byte as a read source according to each storage destination bank for each packing process that is repeated twice in this embodiment.
  • element data whose destination byte is byte B0 or B2 is stored at the position of byte B0 in the read line.
  • the element data whose destination byte is byte B1 or B3 is stored at the position of byte B1 in the read line.
  • the byte number of the destination byte and the byte number of the read byte can be determined by reversing the packing processing.
  • the details of the byte shuffle circuit 122 and the destination byte write enable / disable selection circuit 123 will be described below.
  • FIG. 36 is a diagram for explaining a destination byte determination process at the time of packing by the byte shuffle circuit according to the second embodiment.
  • Byte shuffle circuit 122 sets the read byte to byte number 00 when the destination byte is byte number B0 or B2. Further, the byte shuffle circuit 122 sets the read byte to the byte number 01 when the destination byte is the byte number B1 or B3.
  • FIG. 37 is a diagram for explaining a destination byte determination process at the time of unpacking by the byte shuffle circuit according to the second embodiment.
  • the bank number 632 is 3-bit information that represents the bank number of the storage destination bank in binary.
  • the byte shuffle circuit 122 has the bank number of the vector register 111 corresponding to itself in advance.
  • the bank number of the vector register 111 corresponding to this self is the bank number of the storage destination bank.
  • the element data is written in the least significant byte B0 and the one most significant byte B1 in the line. Therefore, the byte shuffle circuit 122 sets the read bytes when the bytes B0 and B1 are the destination bytes to the byte numbers c0 and c1, as indicated by the correspondence 633.
  • the byte shuffle circuit 122 acquires the least significant bit of the bank number 632 of the vector register 111 of the storage destination and, as indicated by a correspondence 633, the read bytes corresponding to the bytes of the byte numbers B0 and B1 which are the destination bytes. Get the byte number of.
  • the byte shuffle circuit 122 outputs the read data and the information of the destination byte corresponding to each read byte in the read data to the product-sum calculator 112.
  • FIG. 38 is a diagram showing an outline of a circuit configuration for selecting a destination byte at the time of packing included in the destination byte write enable / disable selection circuit according to the second embodiment.
  • the bank number 642 is 3-bit information that represents the bank number of the storage destination bank in binary.
  • the step number 641 is 1-bit information that represents two step numbers in binary.
  • the destination byte write enable / disable selection circuit 123 acquires the bank number 642 represented by “a, b, c” as the storage destination. Next, the destination byte write enable / disable selection circuit 123 receives the input of the step number 641 represented by “v” from the arithmetic instruction control unit 101.
  • the destination byte write enable / disable selection circuit 123 uses the exclusive OR circuit 643 to obtain the exclusive OR of the most significant bit of the bank number 642 and the step number 641. Then, the destination byte write enable / disable selection circuit 123 inputs the output from the exclusive OR circuit 643 to the determination circuits 644 and 645.
  • FIG. 39 is a diagram for explaining the destination byte writability selection processing at the time of unpacking by the destination byte writability selection circuit according to the second embodiment.
  • the destination byte write enable / disable selection circuit 123 invalidates the writing to the bytes B2 and B3 as shown in the table 646 of FIG. 39 regardless of the bank number of the storage destination vector register 111. Further, the destination byte write enable / disable selection circuit 123 validates the write to the bytes B0 and B1 as shown in the table 646. This is because in the present embodiment, at the time of unpacking, element data is stored in bytes B0 and B1 of a 32-bit area in any line of any bank.
  • FIG. 40 is a diagram of an example of a destination line selection table for unpacking processing according to the second embodiment.
  • the destination line selection table 605 represents the information of the destination line that is the storage destination of the element data according to each destination bank for each unpacking process that is repeated twice in this embodiment. For example, when the destination bank is the bank number # 0, the destination line selection circuit 124 selects the lines with the line numbers ## 0 and ## 1 as the destination lines when the step numbers are 0 and 1, respectively. .
  • FIG. 41 is a diagram illustrating the outline of the circuit configuration of the destination line selection circuit according to the second embodiment that determines the destination line during unpacking.
  • the bank number 652 is 3-bit information that represents the bank number of the storage destination bank in binary.
  • the step number 651 is 1-bit information in which two step numbers are represented by a binary number.
  • the destination line selection circuit 124 acquires the bank number 652 of the vector register 111, which is represented by “a, b, c”, to which it connects. Next, the destination line selection circuit 124 receives the input of the step number 651 represented by “v” from the arithmetic instruction control unit 101.
  • the destination line selection circuit 124 uses the exclusive OR circuit 653 to obtain the exclusive OR of the least significant bit of the bank number 652 and the step number 651. As a result, the destination line selection circuit 124 acquires the destination line number 654.
  • the capital letter in the destination line number 654 indicates a value obtained by inverting the bit value.
  • the destination line selection circuit 124 adds the destination line number 654 to the least significant bit of the line information 655 of the line designated as the destination by the instruction, and generates the destination line information 656. After that, the destination line selection circuit 124 outputs the generated destination line information 656 to the vector register 111. As a result, the destination line selection circuit 124 can output information corresponding to the bank number and step number in the destination line selection table 605 shown in FIG. In this case, the destination line selection circuit 124 can cause the vector register 111 to write the element data to the element register 113 of the line number represented by the least significant bit included in the destination line information 656.
  • FIG. 42 is a diagram illustrating a relationship between a storage position of element data of a transmission source and a storage position of element data of a destination during packing according to the second embodiment.
  • FIG. 42 shows the transmission source and the destination determined in each step by the product-sum calculation unit 100 by the above-described processing.
  • the correspondence 660 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 0.
  • the correspondence 670 represents the relationship between the information indicating the storage position at the transmission source and the information indicating the storage position at the destination when the step number is 1.
  • the designation information 681 is information on the transmission source designated by the instruction from the arithmetic instruction control unit 101.
  • the designation information 682 is information on the destination designated by the instruction from the arithmetic instruction control unit 101.
  • the product-sum operation unit 100 adds the read line information 661 to the least significant bit of the designation information 681 as the line number of the read line, as indicated by the correspondence 660.
  • the read line information 661 corresponds to the least significant bit of the transmission source bank number 662, which represents the bank number of the transmission source bank in 3 bits using a binary number.
  • the source bank number 662 is the bank number of the source bank.
  • the product-sum calculation unit 100 sets the byte number 663 that takes a value of “0” as the byte number of the read byte.
  • the product-sum operation unit 100 sets the storage destination bank number 664 generated by rotating each bit of the transmission source bank number 662 right by 1 bit as the transmission destination bank number. Further, the product-sum calculation unit 100 sets the destination byte number 665, which is the least significant bit of the source bank number 662, as the byte number of the destination byte.
  • the product-sum calculation unit 100 adds the read line information 671 to the least significant bit of the designation information 681 to obtain the line number of the read line.
  • the read line information 671 is a value obtained by inverting the least significant bit of the source bank number 672. Further, the product-sum calculation unit 100 sets the byte number 673 having a value of “0” as the byte number of the read byte.
  • the product-sum calculation unit 100 Inverts the least significant bit of the source bank number 672 and then rotates each bit 1 bit to the right to generate a storage destination bank number. Let 674 be the bank number of the storage destination bank. Further, the product-sum calculation unit 100 sets the destination byte number 675, which is the least significant bit of the source bank number 672, as the byte number of the destination byte.
  • FIG. 43 is a diagram of a list of source and destination information at the time of packing by the product-sum calculation unit according to the second embodiment.
  • the numbers on the left side of the drawing represent serial numbers assigned to the area in which 16 element data before packing are stored. Then, the left side of the arrow represents information on the position of the transmission source. Further, the right side of the arrow represents information on the position of the destination. A group of eight from the upper end toward the paper corresponds to the transmission source and the destination at each step number 0 and 1, respectively.
  • the source bank number 691 does not overlap in each step. That is, the product-sum calculation unit 100 can simultaneously read out eight element data in each step. Then, as shown in FIG. 43, the destination bank number 692 also does not overlap in each step. That is, the product-sum operation unit 100 can store eight element data at the same time in each step. That is, the product-sum calculation unit 100 can efficiently use the eight banks to perform packing processing.
  • the product-sum calculation unit 100 can efficiently perform the packing process by using the positions of the transmission source and the destination determined by the procedure shown in FIG.
  • the positions of the source and the destination shown in FIG. 42 are the source and the destination determined according to the read line selection table 601 of FIG. 30, the destination bank selection table 602 of FIG. 32, and the byte selection table 603 of FIG. Match the position of. That is, it is understood that the product-sum calculation unit 100 described above can efficiently perform the packing process by the process of the product-sum calculation unit 100 described above. The same applies to the unpacking process, and it is understood that the product-sum calculation unit 100 can efficiently perform the unpacking process.
  • the processing unit converts existing 32-bit data into 16-bit data and packs them two by two, and the reverse unpacking processing.
  • the circuit can be used to efficiently perform the processing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Executing Machine-Instructions (AREA)
  • Complex Calculations (AREA)

Abstract

パッキング及びアンパッキングの処理を効率化する演算処理装置及び演算処理装置の制御方法を提供する。PCIカードは、データ転送を所定数繰り返し行いサイズの異なる2つの記憶領域間で要素データを移動する。ルータ(125)は、送信元の一方の記憶領域における前記要素データが格納された第1格納領域の情報及び前記繰り返しの回数を基に、送信先の他方の記憶領域における前記要素データの第2格納領域を決定する。格納部(122,123)は、前記第2格納領域の情報及び前記繰り返しの回数を基に、前記第1格納領域に格納された要素データを前記第2格納領域の所定位置へ格納する。

Description

演算処理装置及び演算処理装置の制御方法
 本発明は、演算処理装置及び演算処理装置の制御方法に関する。
 昨今重要性を増す深層学習(ディープラーニング:deep Learning)などで行われる計算においては、演算レイヤーにより巨大な演算データ配列の表現形式の変換が実行される場合が多い。表現形式の変換には、例えば、浮動小数点形式と固定小数点形式との間の変換などがある。さらに、巨大な演算データ配列の表現形式の変換においては、形式のみならず、計算に用いる要素毎のデータサイズも変わることが往々にしてある。そこで、効率的な演算動作のためには、変換後のデータは、変換後のサイズの要素の配列として配置し直されることが望ましい。
 例えば、畳み込みニューラルネットワーク(convolutional neural network)の処理において、畳み込み演算(convolution)を行うレイヤーは、演算量が多く、単位時間あたりにできるだけ大量の積和演算をこなしたい。一方で、畳み込み演算を行うレイヤーでは、各演算の精度はそれほど求められない。そのため、畳み込み演算を行うレイヤーが実行する演算においては、演算に用いられる各要素は8ビットや16ビットなどの低精度の固定小数点であってもよいが、演算自体は高並列な演算であることが望ましい。全結合レイヤーも同様の傾向がある。
 一方で、同じ畳み込みニューラルネットワーク内の計算でも、softmax演算のレイヤーでは、計算量は畳み込み演算レイヤーや全結合レイヤーと比べると相対的にかなり少ないが、扱う数値のダイナミックレンジは大きい。そのため、softmax演算のレイヤーでは、浮動小数点での計算処理が望まれる。浮動小数点数は、固定小数点形式では存在しない指数部をデータ内で表現するため、固定小数点数より要素あたりのサイズが大きくなる傾向がある。
 このように、扱う数値の形式がことなるレイヤー間では、巨大なデータ配列の全要素について、形式とサイズを共に変換することが求められる。
 ここで、例として、ある演算レイヤーで、単精度の浮動小数点数で求められた演算結果の配列を、その次の演算レイヤーでは、8ビットの固定小数点数の配列に変換して処理する場合について説明する。ここでは、単精度の浮動小数点数をFP32と呼び、8ビットの固定小数点数をINT8と呼ぶ。
 演算処理装置は、まず、FP32で表現された数を、妥当な小数点位置のINT8に変換する。次に、演算処理装置は、4つずつのINT8のデータを、連続する32ビット領域に詰め合わせる処理が行われる。
 この詰め合わせを行うことで、演算処理装置は、以降の演算レイヤーで、32ビットの処理単位で、4つのデータをまとめて演算器に送ることや転送することができるようになる。すなわち、高い並列度で効率よく演算処理やデータ転送処理を実行できる。このような複数要素を所定の領域に詰め合わせてゆく操作は、パッキング(packing)と呼ばれる場合がある。パッキングは、大量のデータ移動を伴うため、効率的に処理することが望まれる。
 ここで、データを格納するレジスタと呼ばれる記憶領域は、ハードウェアの構成上、同時に制限なくランダムアクセスできるものではないことが一般的である。典型的には、記憶領域は、一般的にバンクと呼ばれる個別にアクセスされるいくつかの領域に分割される。そして、同一バンクでは同時に1個又は数個の読み書きが行われるという制限が存在する。
 ここでは、要素単位での読み出し又は書き込みのいずれかの処理がそれぞれに同時に実行可な8個のバンクにレジスタがインターリーブされた場合を考える。言い換えれば、同時に読み出し又は同時に書き込みアクセスできる8個のバンクに、配列の要素が順番に繰り返し配列された状態である。1つのバンクは、32ビットのサイズを有する。その場合、パッキング処理を4回分まとめて32要素を移動する処理を1つの単位で扱うとすると、演算処理は、8バンク全体に対する繰り返し単位となる。
 ここで、先頭のバンクから最後のバンクまでの全バンクの一巡をラインと呼ぶことにする。すなわち、ここでは1つのラインは32×8ビットとなる。変換前には、32ビットのデータだったものが8ビットのデータに変換されるので、データサイズは4分の1となる。そして、データサイズが4分の1となったデータを4つ詰め合せる場合、データは32ビットの領域に格納される。すなわち、変換前の4つのラインから変換先の1つのラインへの移動が、この場合の演算処理の繰り返し単位となる。
 このような8バンク全体で見た繰り返し単位が実現できれば、それを繰返すことで、変換元の長い配列に含まれる要素を変換先に詰め合わせつつ移動することができる。
 逆に、INT8の配列をFP32の配列に変換する場合は、要素サイズが大きくなるため、要素の形式の変換前に広い領域への移動が行われる。この場合の処理を以下に示す。
 演算処理装置は、INT8の要素を含む配列を、1要素あたり8ビットの配列から1要素あたり32ビットの配列に展開する。次に、演算処理装置は、4バイトの配列に1要素ずつとなったINT8のデータをそれぞれFP32の表現に変換する。
 ここで、所定の領域に詰まった複数の要素を、要素毎にそれぞれより広い領域に散らせる操作は、アンパッキング(unpacking)と呼ばれる場合がある。アンパッキング処理も、パッキング処理と同様に、大量のデータ移動を伴うため、やはり効率的な処理が望まれる。
 ここでも、要素単位での読み出し又は書き込みのいずれかの処理が同時に実行可な8個のバンクにレジスタがインターリーブされた場合を考える。この場合も、上述したパッキング処理の場合と同じく、32要素の移動が繰り返し単位となる。ただし、このアンパッキング処理では、要素のデータサイズが大きくなる変換であるので、変換元の1つのラインから変換先の4つのラインへの移動が、この場合の演算処理の繰り返し単位となる。
 ここで、データの移動や詰め合わせを行う命令は、例えば、他用途で使用されるパターンが想定された既存命令を組み合わせることで作成することが考えられる。パターンが想定された既存命令には、例えば、shuffle命令などがある。
 また、演算を並列して行う技術として、レジスタファイルを4つのバンクに分けて、1つのオペランドで4つのレジスタに同時にアクセスさせる従来技術がある。また、パッキング及びアンパッキング処理の技術として、メモリからパッキングされたデータを読み出して、アンパッキング処理を行い、アンパッキングした各データに対するフォーマット変換を並列で実施する従来技術がある。さらに、サイズの小さいレジスタに格納されたデータを読み出して、読み出したデータをサイズの大きいレジスタに複数個格納してSIMD演算に用いる従来技術がある。
特開2002-149400号公報 特表2017-508201号公報 特開2005-174300号公報
 しかしながら、パターンが想定された既存命令の組み合わせでは、効率的な処理が困難である。例えば、shuffle命令は、要素間の選択は自由にできるものの、並び替え元や再配置先のラインの指定のしかたが固定的であり、パッキング又はアンパッキング処理うちいずれかの用途にしか活用できないおそれがある。また、パターンをうまく定義すれば、SIMD構成要素とするデータを単位とする移動は実現可能と考えられる。しかし、移動の前後で要素サイズが変わる場合、SIMD構成単位よりサイズの小さい演算要素の移動などを行うこととなり、パッキング及びアンパッキングの処理に利用することは困難である。
 また、1つのオペランドで4つに分けたレジスタに同時にアクセスさせる従来技術では、サイズ変更を伴うパッキング及びアンパッキングの処理を高速化することは困難である。また、メモリから読み出したデータをアンパッキングし、アンパッキングした各データに対するフォーマット変換を並列で実施する従来技術でも、移動の前後の要素サイズの変更は考慮されておらず、処理を高速化することは困難である。さらに、小さいレジスタに格納されたデータを大きいレジスタに複数個格納してSIMD演算に用いる従来技術であっても、要素のデータサイズが変化する場合は考慮されておらず、パッキング及びアンパッキングの処理を効率化することは困難である。
 開示の技術は、上記に鑑みてなされたものであって、パッキング及びアンパッキングの処理を効率化する演算処理装置及び演算処理装置の制御方法を提供することを目的とする。
 本願の開示する演算処理装置及び演算処理装置の制御方法は、一つの態様において、データ転送を所定数繰り返し行いサイズの異なる2つの記憶領域間で要素データを移動する演算処理装置である。そして、転送部は、送信元の一方の記憶領域における前記要素データが格納された第1格納領域の情報及び前記繰り返しの回数を基に、送信先の他方の記憶領域における前記要素データの第2格納領域を決定する。格納部は、前記第2格納領域の情報及び前記繰り返しの回数を基に、前記第1格納領域に格納された要素データを前記第2格納領域の所定位置へ格納する。
 本願の開示する演算処理装置及び演算処理装置の制御方法の一つの態様によれば、パッキング及びアンパッキングの処理を効率化できるという効果を奏する。
図1は、情報処理装置の全体構成図である。 図2は、積和演算部の詳細な回路図である。 図3は、実施例1に係るパッキング処理の概要を表す図である。 図4は、パッキングの処理において使用される領域を説明するための図である。 図5は、実施例1に係るアンパッキング処理の概要を表す図である。 図6は、実施例1に係るパッキング処理用の読出ライン選択テーブルの一例の図である。 図7は、実施例1に係る読出ライン変更回路の回路構成の概要を表す図である。 図8は、実施例1に係るパッキング処理用の宛先バンク選択テーブルの一例の図である。 図9は、実施例1に係るルータが有するパッキング時の格納先バンクを決定する回路構成の概要を表す図である。 図10は、アンパッキング処理用の宛先バンク選択テーブルの一例の図である。 図11は、実施例1に係るルータが有するアンパッキング時の格納先バンクを決定する回路構成の概要を表す図である。 図12は、格納先バンクに対応する読出元バンクを決定するための定義パターンの一例を表す図である。 図13は、実施例1に係るパッキング処理用のバイト選択テーブルの一例の図である。 図14は、アンパッキング処理用のバイト選択テーブルの一例の図である。 図15は、実施例2に係るバイトシャッフル回路によるパッキング時の宛先バイトの決定処理を説明するための図である。 図16は、実施例1に係るバイトシャッフル回路によるアンパッキング時の宛先バイトの決定処理を説明するための図である。 図17は、実施例1に係る宛先バイト書込可否選択回路が有するパッキング時の宛先バイトを選択する回路構成の概要を表す図である。 図18は、実施例1に係る宛先バイト書込可否選択回路によるアンパッキング時の宛先バイトの選択処理を説明するための図である。 図19は、実施例1に係るアンパッキング処理用の宛先ライン選択テーブルの一例の図である。 図20は、実施例1に係る宛先ライン選択回路が有するアンパッキング時の宛先ラインを決定する回路構成の概要を表す図である。 図21は、実施例1に係るパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係を表す図である。 図22は、実施例1に係る積和演算部によるパッキング時の送信元と宛先の情報の一覧の図である。 図23は、パッキング時の一般化した送信元及び宛先の決定方法を説明するための図である。 図24は、アンパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係を表す図である。 図25は、一般化したアンパッキング時の送信元及び宛先の決定方法を説明するための図である。 図26は、実施例1に係る処理ユニットによるパッキング処理のフローチャートである。 図27は、実施例1に係る処理ユニットによるアンパッキング処理のフローチャートである。 図28は、処理ユニットに本実施例に係るパッキング処理及びアンパッキング処理を実行させる命令の一例を示す図である。 図29は、実施例2に係るパッキング処理の概要を表す図である。 図30は、実施例2に係るパッキング処理用の読出ライン選択テーブルの一例の図である。 図31は、実施例2に係る読出ライン変更回路の回路構成の概要を表す図である。 図32は、実施例2に係るパッキング処理用の宛先バンク選択テーブルの一例の図である。 図33は、実施例2に係るルータが有するパッキング時の格納先バンクを決定する回路構成の概要を表す図である。 図34は、実施例2に係るルータが有するアンパッキング時の格納先バンクを決定する回路構成の概要を表す図である。 図35は、実施例2に係るパッキング処理用のバイト選択テーブルの一例の図である。 図36は、実施例2に係るバイトシャッフル回路によるパッキング時の宛先バイトの決定処理を説明するための図である。 図37は、実施例2に係るバイトシャッフル回路によるアンパッキング時の宛先バイトの決定処理を説明するための図である。 図38は、実施例2に係る宛先バイト書込可否選択回路が有するパッキング時の宛先バイトを選択する回路構成の概要を表す図である。 図39は、実施例2に係る宛先バイト書込可否選択回路によるアンパッキング時の宛先バイトの選択処理を説明するための図である。 図40は、実施例2に係るアンパッキング処理用の宛先ライン選択テーブルの一例の図である。 図41は、実施例2に係る宛先ライン選択回路が有するアンパッキング時の宛先ラインを決定する回路構成の概要を表す図である。 図42は、実施例2に係るパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係を表す図である。 図43は、実施例2に係る積和演算部によるパッキング時の送信元と宛先の情報の一覧の図である。
 以下に、本願の開示する演算処理装置及び演算処理装置の制御方法の実施例を図面に基づいて詳細に説明する。なお、以下の実施例により本願の開示する演算処理装置及び演算処理装置の制御方法が限定されるものではない。
 図1は、情報処理装置の全体構成図である。情報処理装置50は、PCI(Peripheral Component Interconnect)カード1及びホストコンピュータ2を有する。PCIカード1とホストコンピュータ2とはPCIバスで接続され、互いにデータの送受信を行う。
 ホストコンピュータ2は、例えば、深層学習を実行する際の全体的な管理を行う。深層学習を実行する場合、ホストコンピュータ2は、PCIカード1に対して畳み込み演算などの深層学習における所定の演算の実行を指示する。深層学習を実行する際に、ホストコンピュータ2は、要素データのデータサイズの変更を伴うパッキング及びアンパッキングの処理の実行をPCIカード1に対して指示する。例えば、全結合演算を行うレイヤーとsoftmax演算のレイヤーとの間でのデータの授受を行う場合に、ホストコンピュータ2は、要素データのデータサイズの変更を伴うパッキング及びアンパッキングの処理の実行をPCIカード1に指示する。
 PCIカード1は、ホストコンピュータ2からの指示を受けて演算を実行し、演算結果をホストコンピュータ2に出力する。例えば、PCIカード1は、深層学習における演算処理を実行する。PCIカード1は、図1に示すように、複数の処理ユニット10、全体命令制御部11、メモリコントローラ12、メモリ13及びPCI制御部14を有する。このPCIカード1が、「演算処理装置」の一例にあたる。
 PCI制御部14は、演算の実行を指示する演算命令や演算で使用する演算データの入力をホストコンピュータ2から受ける。そして、PCI制御部14は、取得した演算命令や演算データをメモリコントローラ12へ出力する。
 また、PCI制御部14は、指示された演算に対する演算結果の入力をメモリコントローラ12から受ける。そして、PCI制御部14は、演算結果をホストコンピュータ2へ出力する。
 メモリコントローラ12は、演算命令や演算で使用する演算データの入力をPCI制御部14から受ける。そして、メモリコントローラ12は、取得した演算命令及び演算データをメモリ13へ格納する。
 また、メモリコントローラ12は、演算を実行する際に用いる演算データのベクタレジスタ111への格納の指示を全体命令制御部11から受ける。そして、メモリコントローラ12は、指定された演算データを指定された積和演算部100のベクタレジスタ111へ格納する。ここで、メモリコントローラ12は、直列に並んだ処理ユニット10のうちの後段の処理ユニット10に対してデータを送信する場合、積和演算部100を迂回させてマルチプレクサ103へ演算データを出力する。
 また、メモリコントローラ12は、演算結果の格納指示を全体命令制御部11から受けると、指定された積和演算部100のベクタレジスタ111から演算結果を取得しメモリ13へ格納する。さらに、メモリコントローラ12は、ホストコンピュータ2からPCI制御部14を介して指示を受けると、メモリ13に格納された演算結果を読み出し、PCI制御部14へ出力する。
 全体命令制御部11は、ホストコンピュータ2から実行が指示された演算の全体の統括管理を行う。全体命令制御部11は、ホストコンピュータ2からの指示をPCI制御部14経由で受け、メモリ13に格納された全体命令列を次々と読んでは実行する。全体命令には、メモリ13から演算命令バッファ102に演算命令列を転送する命令、メモリ13から演算データをベクタレジスタ111に格納する命令、演算命令バッファ102に格納された演算命令列を演算命令制御部101に実行開始させる命令、ベクタレジスタ111に格納された演算結果をメモリ13に格納する命令、命令列の実行を終了する命令などがある。全体命令制御部11は、演算命令列を処理ユニット10に実行させる。
 演算を処理ユニット10に実行させる場合、全体命令制御部11は、演算を実行する際に用いる演算データの送信をメモリコントローラ12に指示する。また、処理ユニット10における演算が完了すると、全体命令制御部11は、演算結果の格納をメモリコントローラ12に指示する。さらに、実行が指示された演算の全ての処理が完了すると、全体命令制御部11は、演算完了をメモリコントローラ12へ通知する。
 全体命令制御部11は、深層学習を実行する場合、各レイヤー間のデータの授受なども制御する。その場合、全体命令制御部11は、要素データのデータサイズの変更を伴うパッキング及びアンパッキングの処理の実行を演算命令制御部101に対して指示する。その際、全体命令制御部11は、パッキング及びアンパッキングを行う対象となる配列に格納された要素データの送信をメモリコントローラ12に指示する。例えば、全結合演算を行うレイヤーとsoftmax演算のレイヤーとの間でのデータの授受を行う場合に、全体命令制御部11は、要素データのデータサイズの変更を伴うパッキング及びアンパッキングの処理の実行を演算命令制御部101に指示する。
 次に、処理ユニット10について説明する。処理ユニット10は、図1に示すように1つのPCIカード1に複数搭載される。各処理ユニット10は、並列及び直列に複数接続される。処理ユニット10の数は、ある態様においては128個である。処理ユニット10は、積和演算部100、演算命令制御部101、演算命令バッファ102及びマルチプレクサ103を有する。ただし、図1の処理ユニット10は、簡略化して記載しており、詳細については後で説明する。
 演算命令制御部101は、演算命令の実行処理を管理制御する。演算命令制御部101は、個々の演算の実行の指示を全体命令制御部11から受ける。処理ユニット10で実行できる命令を、全体命令と対比させて演算命令と呼んでいるが、命令には、積和演算部に演算を行わせる狭義の演算命令のほか、汎用レジスタ(図示しない)の操作命令、分岐命令、繰り返し命令、命令列の実行を停止する命令などが含まれる。
 演算命令制御部101は、演算命令バッファ102に格納された演算命令を取得する。次に、演算命令制御部101は、取得した演算命令で指定された演算データの出力をベクタレジスタ111に指示する。また、演算命令制御部101は、取得した演算命令にしたがい、演算実行の指示を積和演算器112へ出力する。その後、演算命令制御部101は、積和演算器112内で演算結果を用いた演算をループさせる。また、演算命令制御部101は、例えば、要素データのデータサイズの変更を伴うパッキング及びアンパッキングの処理の実行命令を発行する。
 演算命令バッファ102は、演算命令列を格納する記憶領域である。演算命令バッファ102は、メモリコントローラ12から入力された演算命令列を指示されたアドレスから入力順に格納する。その後、演算命令制御部101からの演算命令の取得要求を受けて、演算命令バッファ102は、演算命令制御部101に要求されたアドレスの演算命令を出力する。
 積和演算部100は、ベクタレジスタ111及び積和演算器112を有する。ただし、積和演算部100が有するベクタレジスタ111は、処理ユニット10に搭載されたベクタレジスタ全体の一部にあたる。
 ベクタレジスタ111は、演算を実行する際に用いる演算データの入力をメモリコントローラ12から受けて、入力された演算データを格納する。その後、ベクタレジスタ111は、演算命令制御部101からの指示を受けて、演算で使用する演算データを積和演算器112に出力する。また、ベクタレジスタ111は、積和演算器112の演算結果を取得して格納する。積和演算器112による演算のループ処理が完了後、メモリ13への出力の指示をメモリコントローラ12から受けると、ベクタレジスタ111は、出力を指示された領域に格納された積和演算器112の演算結果を、マルチプレクサ103へ出力する。
 特に、要素データのデータサイズの変更を伴うパッキング及びアンパッキングの処理の場合、ベクタレジスタ111は、パッキング又はアンパッキングを行う要素データ、並びに、パッキング又はアンパッキングの処理後の要素データを格納する。
 積和演算器112は、演算命令制御部101からの演算実行の指示を受ける。そして、積和演算器112は、ベクタレジスタ111から入力された演算データを用いて積和演算を実行する。その後、積和演算器112は、演算結果をベクタレジスタ111へ出力する。命令により累積を指示された場合は、積和演算器112は、累積演算結果を演算器内のレジスタ(アキュムレータ)に保持し、後続の累積演算命令で使用する。
 積和累積演算の場合、積和演算器112は、全ての演算が完了するまでベクタレジスタ111から入力された値に対する積和演算を繰返す。その後、積和累積演算のループ処理が終了すると、積和演算器112は、演算結果をベクタレジスタ111へ出力し、格納させる。
 次に、図2を参照して、要素データのデータサイズの変更を伴うパッキング及びアンパッキングの処理を行う積和演算部100の機能の詳細に説明する。図2は、積和演算部の詳細な回路図である。図2では、演算命令制御部101から、ベクタレジスタ111A、積和演算器112A、読出ライン変更回路121A、バイトシャッフル回路122A、宛先バイト書込可否選択回路123A、宛先ライン選択回路124A及びルータ125へ延びる信号経路を記載した。ただし、実際には、演算命令制御部101からの信号経路は、他のベクタレジスタ111B~111C、積和演算器112B~112C、読出ライン変更回路121B~121C、バイトシャッフル回路122B~122Cへも延びる。また、演算命令制御部101からの信号経路は、宛先バイト書込可否選択回路123B~123C及び宛先ライン選択回路124B~124Cへも延びる。
 積和演算部100は、図2に示すように、図1に示した積和演算器112を複数有する。ここでは、それぞれの積和演算器112を、積和演算器112A~112Cと表す。また、積和演算部100は、バンクと呼ばれる単位に分割されたベクタレジスタ111を有する。ここでは、バンク単位に分割された各ベクタレジスタ111を、ベクタレジスタ111A~111Cと表す。ベクタレジスタ111A~111Cは、それぞれ積和演算器112A~112Cに1対1で対応する。さらに、積和演算部100は、各ベクタレジスタ111A~111Cに対応させて、読出ライン変更回路121A~121C及び宛先ライン選択回路124A~124Cが配置される。また、各積和演算器112A~112Cに対応させて、バイトシャッフル回路122A~122C及び宛先バイト書込可否選択回路123A~123Cが配置される。以下の説明では、それぞれを区別しない場合、要素レジスタ113、積和演算器112、読出ライン変更回路121、バイトシャッフル回路122、宛先バイト書込可否選択回路123及び宛先ライン選択回路124と称する。
 さらに、ベクタレジスタ111A~111Cからバイトシャッフル回路122A~122Cを介して積和演算器112A~112Cへ繋がる経路上に、ルータ125が配置される。ルータ125は、ベクタレジスタ111A~111Cから出力されたデータを、バイトシャッフル回路122A~122Cのいずれかへ選択的に出力する。ここで、本実施例では、ベクタレジスタ111とバイトシャッフル回路122とを結ぶ経路上にルータ125を配置したが、ベクタレジスタ111と積和演算器112とを結ぶ他の経路も、ルータ125を経由してもよい。
 ベクタレジスタ111は、例えばRAM(Random Access Memory)である。ベクタレジスタ111は、本実施例では、全部で8つ配置される。ここでは、ベクタレジスタ111Aがバンク番号#0にあたり、ベクタレジスタ111Bがバンク番号#1にあたり、ベクタレジスタ111Cがバンク番号#7にあたる場合で説明する。
 さらに、ベクタレジスタ111は、複数の要素レジスタ113を有する。ベクタレジスタ111に含まれる各要素レジスタ113は、それぞれ番号が割り当てられたラインと呼ばれる単位と対応する。ここでは、各ラインを表す数値を、ライン番号という。すなわち、各要素レジスタ113には、それぞれライン番号が割り当てられる。
 本実施例では、ベクタレジスタ111は、演算命令制御部101から延びる経路に繋がるポートを4つ有する。演算命令制御部101から延びる経路に繋がる4つのポートのうち、3つはリードアドレスが入力されるポートである。そして、リードアドレスが入力される3つのポートのうち1つが、読出ライン変更回路121を介して演算命令制御部101に繋がる。また、演算命令制御部101から延びる経路に繋がる4つのポートのうちの残りの1つのポートは、ライトアドレスが入力されるポートである。
 また、ベクタレジスタ111は、各サイクルで演算に用いる複数のオペランドを積和演算器112に供給し、また、各サイクルで演算結果をいずれかの要素レジスタ113に書き戻すためのリードポート及びライトポートを有する。また、本実施例では、ベクタレジスタは、3つのリードポート及び1つのライトポートを有する。3つのリードポートは、それぞれ、演算命令制御部101から延びる経路に繋がる3つのライトアドレスが入力されるポートのいずれかに対応する。本実施例では、読出ライン変更回路121に接続するポートと、ルータを経由してバイトシャッフル回路122に接続されるポートとが対応する。
 ベクタレジスタ111は、演算命令制御部101に繋がるポートに入力されたリードアドレスに対応する要素レジスタ113に格納された値を、リードアドレスが入力されたポートに対応するリードポートから出力する。具体的には、ベクタレジスタ111Aは、読出ライン変更回路121から入力されたリードアドレスに対応する要素レジスタ113に格納された値を、ルータ125へ出力する。
 ここで、本実施例に係る要素レジスタ113は、ライン毎のサイズが32ビットである。そして、本実施例では、図3に示すように、要素レジスタ113のライン毎に格納された32ビットのデータを8ビットに変換後、要素レジスタ113の何れかの1つのラインの中に4つパッキングする処理を例に説明する。図3は、実施例1に係るパッキング処理の概要を表す図である。
 この場合、1つのバンクのラインを埋めるために、4つの送信元の領域のデータが用いられる。そこで、パッキング処理により宛先となるラインを全て埋めるには、送信元の領域として4×8=32個の送信元の領域のデータを用いることになる。また、バンク番号#0~#7に対応するベクタレジスタ111における要素レジスタ113は、それぞれ独立してアクセスされるので、1度に8つの書き込み処理又は読込処理が可能である。すなわち、送信元のバンクがそれぞれ異なり、宛先のバンクがそれぞれ異なれば、8つの送信元の領域のデータを一度に宛先の領域へ移すことができる。そこで、この8つの送信元の領域のデータを一度に宛先の領域へ移す処理を1ステップの処理とした場合、1つの宛先のラインをすべて埋めるには、4ステップの処理が行われる。そして、宛先のラインが同一であることから、32個の送信元の領域の要素データの移動が、パッキング処理の1回の繰り返し単位となる。
 図4は、パッキングの処理において使用される領域を説明するための図である。図4では、紙面に向かって縦方向に分割された各列が各バンク番号#0~#7のバンクを表す。そして、紙面に向かって横方向がラインを表す。すなわち、図4における領域21~23が、それぞれ繰り返し単位毎の送信元の領域となる。そして、各繰り返し単位における宛先の領域が領域24~26となる。すなわち、処理ユニット10は、領域21に格納された32個の要素データを、領域24に格納する。また、処理ユニット10は、領域22に格納された32個の要素データを、領域25に格納する。処理ユニット10は、領域23に格納された32個の要素データを、領域26に格納する。この領域21~23及び領域24~26のそれぞれが、「2つの記憶領域」の一例にあたる。そして、パッキング処理の場合、領域21~23が、「一方の記憶領域」の一例にあたり、領域24~26が、「他方の記憶領域」の一例にあたる。逆に、アンパッキング処理の場合、領域24~26が、「一方の記憶領域」の一例にあたり、領域21~23が、「他方の記憶領域」の一例にあたる。
 また、本実施例では、図5に示すように、1つのラインの8つの要素レジスタ113に格納された8ビットのデータを4つのラインの要素レジスタ113に振り分けて、32ビットに拡張するアンパッキング処理を例に説明する。図5は、実施例1に係るアンパッキング処理の概要を表す図である。アンパッキング処理は、パッキング処理を逆転させた処理にあたる。すなわち、アンパッキング処理においても、4ステップの処理が行われる。そして、宛先のラインが同一であることから、1つのラインに格納された32個の送信元の領域の要素データの移動が、アンパッキング処理の1回の繰り返し単位となる。
 読出ライン変更回路121は、ここで説明するパッキング及びアンパッキングの処理以外の処理を行う場合、演算命令制御部101から入力されたデータをそのままベクタレジスタ111へ出力する。
 一方、パッキング及びアンパッキングの処理の場合、読出ライン変更回路121は、宛先決定の指示とともに、ベクタレジスタ111における送信元となる領域の情報及びベクタレジスタ111における宛先となる領域の情報の入力を受ける。
 パッキング処理の場合、読出ライン変更回路121は、例えば、図5における送信元となる領域の情報として領域21を示す情報の入力を演算命令制御部101から受ける。さらに、読出ライン変更回路121は、ステップ番号を演算命令制御部101から受ける。ここで、本実施例では、1つの繰り返し単位の処理において4つのステップが行われるので、読出ライン変更回路121は、ステップ番号として0~3のいずれかの情報の入力を受ける。ここで、ステップ番号が0とは、最初のステップであることを表す。
 パッキング処理の場合、読出ライン変更回路121は、入力されたステップ番号の情報と自己が接続されたベクタレジスタ111のバンク番号を基に、図6に示す読出ライン選択テーブル201に応じた読出ラインのライン番号を取得する。
 図6は、実施例1に係るパッキング処理用の読出ライン選択テーブルの一例の図である。読出ライン選択テーブル201は、本実施例において4回繰り返して行われるパッキング処理毎の各送信元バンクに応じた読み出し元とする読出ラインの情報を表す。
 例えば、0回目の繰り返しの場合、読出ライン変更回路121は、自己が接続するベクタレジスタ111のライン番号及びステップ番号である0を用いて、読み出し元となる読出ラインの情報を求める。この読み出しラインの情報が読出ライン選択テーブル201におけるバンク番号#0のステップ番号が0の場合の読出ラインの情報に一致する。そして、読出ライン変更回路121は、求めたライン番号を読み出しアドレスとしてベクタレジスタ111に入力する。
 図7を参照して、より具体的に読み出し元の情報の生成を説明する。図7は、実施例1に係る読出ライン変更回路の回路構成の概要を表す図である。バンク番号302は、読出ライン変更回路121が接続するベクタレジスタ111のバンク番号を2進数で表した3ビットの情報である。また、ステップ番号301は、4つのステップ番号を2進数で表した2ビットの情報である。
 読出ライン変更回路121は、「a,b,c」で表される自己に対応するベクタレジスタ111のバンク番号302を取得する。例えば、読出ライン変更回路121Aは、バンク番号302として「0,0,0」を取得する。
 次に、読出ライン変更回路121は、「u,v」で表されるステップ番号301の入力を演算命令制御部101から受ける。例えば、ステップ番号301が2の場合、読出ライン変更回路121は、「1,0」の入力を受ける。
 次に、読出ライン変更回路121は、排他的論理和回路303を用いて、バンク番号302の最下位から2番目のビットと、ステップ番号301の上位ビットとの排他的論理和を求める。また、読出ライン変更回路121は、排他的論理和回路304を用いて、バンク番号302の最下位のビットと、ステップ番号301の下位ビットとの排他的論理和を求める。これにより、読出ライン変更回路121Aは、読出ライン番号305を取得する。ここで、読出ライン番号305における大文字のアルファベットはビットの値を反転させた値を指す。例えば、ステップ番号が2の場合、読出ライン変更回路121Aは、排他的論理和回路303から1を取得し、排他的論理和回路304から0を取得する。すなわち、読出ライン変更回路121Aは、読出ライン番号305として「1,0」を取得する。「1,0」が表すラインは、ライン番号##2のラインにあたる。
 その後、読出ライン変更回路121は、命令で指定された読み出し元とするラインのライン情報306の下位2ビットに読出ライン番号305を付加して、読出ライン情報307を生成する。その後、読出ライン変更回路121は、生成した読出ライン情報307をベクタレジスタ111へ出力する。これにより、読出ライン変更回路121は、図6で示した読出ライン選択テーブル201におけるバンク番号及びステップ番号に対応するライン番号の出力を行うことができる。この場合、読出ライン変更回路121は、読出ライン情報307に含まれる下位2ビットで表されるライン番号にあたる要素レジスタ113から出力される読出データをベクタレジスタ111に出力させることができる。ここで、読出データは、要素レジスタ113に格納された全ての値、すなわち、4つの要素データを含む。
 また、アンパッキングの処理の場合、読出ライン変更回路121は、入力されたリードアドレスを含む送信元の情報をそのまま、ベクタレジスタ111へ出力する。これにより、読出ライン変更回路121は、リードアドレスで表されるライン番号の要素レジスタ113から出力される読出データをベクタレジスタ111に出力させることができる。この読出ライン変更回路121が、「第1決定部」の一例にあたる。そして、送信元バンクが、「第1格納領域」の一例にあたり、読出ラインが、「第1格納位置」の一例にあたる。
 図2に戻って説明を続ける。ルータ125は、読出データの入力を各ベクタレジスタ111から受ける。また、ルータ125は、ステップ番号の入力を演算命令制御部101から受ける。
 パッキング処理の場合、ルータ125は、格納先のベクタレジスタ111のバンク番号及びステップ番号を基に、図8に示す宛先バンク選択テーブル202に応じた送信元のバンク番号を取得する。
 図8は、実施例1に係るパッキング処理用の宛先バンク選択テーブルの一例の図である。宛先バンク選択テーブル202は、本実施例において4回繰り返して行われるパッキング処理毎の各格納先のバンクに応じた送信元となる送信元バンクの情報を表す。例えば、格納先バンクがバンク番号#0であれば、ステップ番号が0~3である場合のそれぞれで、ルータ125は、バンク番号#0、#1、#2、#3のバンクを送信元バンクとして選択する。
 図9を参照して、より具体的に格納先バンクの決定を説明する。図9は、実施例1に係るルータが有するパッキング時の格納先バンクを決定する回路構成の概要を表す図である。バンク番号311は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号312は、4つのステップ番号を2進数で表した2ビットの情報である。
 ルータ125は、格納先とする「a,b,c」で表されるバンク番号を選択する。次に、ルータ125は、選択した格納先バンクのバンク番号のビットを2ビット左ローテートする。2ビットの左ローテートとは、各ビットを上位ビット側に向けて2ビット移動する処理であり、且つ、最上位のビットを超えた移動の場合は最下位のビットに移動して巡回させる処理である。すなわち、ルータ125は、バンク番号311の最下位のビットの値を最上位のビットに移動し、最上位のビットの値を下から2番目のビットに移動し、下から2番目のビットの値を最下位のビットに移動する。これにより、ルータ125は、巡回後番号313を取得する。例えば、格納先のベクタレジスタ111のバンク番号311が「0,1,1」である場合、ルータ125は、巡回後番号313として「1,0,1」を取得する。
 次に、ルータ125は、2進数である「u,v」で表されるステップ番号312の入力を演算命令制御部101から受ける。例えば、ステップ番号が2の場合、ルータ125は、「1,0」の入力を受ける。
 次に、ルータ125は、排他的論理和回路314を用いて巡回後番号313の下から2番目のビットと、ステップ番号の上位のビットの排他的論理和を求める。また、ルータ125は、排他的論理和回路315を用いて巡回後番号313の最下位のビットと、ステップ番号の下位のビットの排他的論理和を求める。そして、ルータ125は、巡回後番号313の最上位ビット、排他的論理和回路314からの出力及び排他的論理和回路315からの出力を並べて送信元バンクのバンク番号316を取得する。ここで、バンク番号316における大文字のアルファベットは元の値を反転させた値である。
 例えば、格納先のベクタレジスタ111のバンク番号311が「0,1,1」であり、ステップ番号が2の場合について説明する。この場合、ルータ125は、排他的論理和回路314及び排他的論理和回路315から1を取得し、送信元バンクのバンク番号316として、「1,1,1」を取得する。バンク番号316が「1,1,1」であるとは、バンク番号#7が送信元バンクであることを表す。これにより、ルータ125は、図8で示した宛先バンク選択テーブル202における格納先のバンク番号及びステップ番号に対応する送信元となるバンク番号を取得することができる。
 ルータ125は、選択した格納先のバンク番号のベクタレジスタ111に対応する積和演算器112に接続するバイトシャッフル回路122に対して、決定した送信元のバンク番号のベクタレジスタ111から入力された値を出力する。
 また、アンパッキング処理の場合、ルータ125は、格納先のベクタレジスタ111のバンク番号及びステップ番号を基に、図10に示す宛先バンク選択テーブル203に応じた宛先バンクのバンク番号を取得する。
 図10は、アンパッキング処理用の宛先バンク選択テーブルの一例の図である。宛先バンク選択テーブル203は、本実施例において4回繰り返して行われるパッキング処理毎の各格納先のバンクに応じた送信元となる送信元バンクの情報を表す。例えば、格納先バンクがバンク番号#0である場合、ルータ125は、ステップ番号が0~3である場合のそれぞれで、バンク番号#0、#2、#4、#6を送信元バンクのバンク番号として選択する。
 図11を参照して、より具体的に格納先バンクの決定を説明する。図11は、実施例1に係るルータが有するアンパッキング時の格納先バンクを決定する回路構成の概要を表す図である。バンク番号321は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号322は、4つのステップ番号を2進数で表した2ビットの情報である。
 ルータ125は、格納先とする「a,b,c」で表されるバンク番号を選択する。次に、ルータ125は、選択した格納先のバンク番号のビットを2ビット右ローテートする。2ビットの右ローテートとは、各ビットを下位ビット側に向けて2ビット移動する処理であり、且つ、最下位のビットを超えた移動の場合は最上位のビットに移動して巡回させる処理である。すなわち、ルータ125は、バンク番号321の最上位のビットの値を最下位のビットに移動し、最下位のビットの値を下から2番目のビットに移動し、下から2番目のビットの値を最上位のビットに移動する。これにより、ルータ125は、巡回後番号323を取得する。例えば、格納先のベクタレジスタ111のバンク番号321が「1,0,1」である場合、ルータ125は、巡回後番号323として「0,1,1」を取得する。
 次に、ルータ125は、2進数である「u,v」で表されるステップ番号322の入力を演算命令制御部101から受ける。例えば、ステップ番号が2の場合、ルータ125は、「1,0」の入力を受ける。
 次に、ルータ125は、排他的論理和回路324を用いて巡回後番号323の最上位のビットと、ステップ番号の上位のビットの排他的論理和を求める。また、ルータ125は、排他的論理和回路325を用いて巡回後番号323の最下位から2番目のビットと、ステップ番号の下位のビットの排他的論理和を求める。そして、ルータ125は、排他的論理和回路324からの出力、排他的論理和回路325からの出力及び巡回後番号323の最下位ビットを並べて送信元バンクのバンク番号326を取得する。ここで、バンク番号326における大文字のアルファベットは元の値を反転させた値である。
 例えば、格納先のベクタレジスタ111のバンク番号311が「1,0,1」であり、ステップ番号が2の場合について説明する。この場合、ルータ125は、排他的論理和回路324及び排他的論理和回路325から1を取得し、送信元バンクのバンク番号326として、「1,1,1」を取得する。バンク番号326が「1,1,1」であるとは、バンク番号#7が送信元バンクであることを表す。これにより、ルータ125は、図10で示した宛先バンク選択テーブル203における格納先のバンク番号及びステップ番号に対応する送信元となるバンク番号を取得することができる。
 ルータ125は、選択した格納先のバンク番号のベクタレジスタ111に対応する積和演算器112に接続するバイトシャッフル回路122に対して、決定した送信元のバンク番号のベクタレジスタ111から入力された読出データを出力する。
 ここで、ルータ125による送信元バンクから格納先バンクへの経路選択方法の一例について説明する。ルータ125は、例えば、図12に示す定義パターン251を記憶する。図12は、格納先バンクに対応する読出元バンクを決定するための定義パターンの一例を表す図である。定義パターン251は、それぞれのパターン毎に各格納元バンクに対応する読出元バンクが登録される。定義パターン251における各読出元バンクの左側の数字は読出元ライン番号のオフセットである。すなわち、+1の場合は、次のラインに移ることを表す。
 各パターンの機能としては、通常、ローテート及びブロードキャストが存在する。通常は、読出元バンクと格納先バンクが同じとなる場合である。ローテートは、読出元バンクのバンクバンク番号が、各格納先バンクに同じ数を加えたものになる場合である。ブロードキャストは、1つの読出元バンクからのデータが全ての格納先バンクに格納される場合である。
 ルータ125は、定義パターン251を用いることで、決定した読み出し元バンクと格納先バンクの組み合わせに応じたデータ転送を実現することができる。ただし、定義パターン252は一例であり、ルータ125は、他のパターンを用いても良いし、また、定義パターンを用いずに転送を行うことも可能である。このルータ125が、「転送部」の一例にあたる。また、格納先バンクが、「第2格納領域」の一例にあたる。
 図2に戻って説明を続ける。本実施例では、読み出し元及び書き込み先となる要素レジスタ113におけるライン毎の32ビットの領域は、4つの8ビットとして個別に扱うことができる。この4つの8ビットの領域をそれぞれバイトB0~B3とする。B0~B3は、バイト番号を表すが、ここでは各バイト番号を有するバイトを、バイトB0~B3と表す。以下では、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123について説明する。
 バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、それぞれの処理を組み合わせることで書き込み先の要素レジスタ113における書き込む対象とするバイトを決定する。詳細には、読み出し元における要素が格納されたバイトと書き込み先における要素が格納されるバイトとは位置が異なるため、バイトシャッフル回路122は、読出データの各読出バイトに格納された要素データに対応する宛先バイトの位置を決定する。また、積和演算器112は、ここでは単にデータを通過させる回路である。また、宛先バイト書込可否選択回路123は、実際に要素データを書き込む宛先バイトを選択する回路である。
 バイトシャッフル回路122は、ベクタレジスタ111から出力された読出データの入力をルータ125から受ける。また、バイトシャッフル回路122及び宛先バイト書込可否選択回路123は、ステップ番号の入力を演算命令制御部101から受ける。
 パッキングの処理の場合、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、格納先のベクタレジスタ111のバンク番号及びステップ番号を基に、図13に示すバイト選択テーブル204に応じた宛先バイト番号及び読出元バイト番号を取得する。
 図13は、実施例1に係るパッキング処理用のバイト選択テーブルの一例の図である。バイト選択テーブル204は、本実施例において4回繰り返して行われるパッキングの処理毎の各格納先バンクに応じた書き込み先となる宛先バイト及び読み出し元となる読出バイトの情報を表す。本実施例に係るパッキングの処理では、読出ラインにおいて要素データは全てバイトB0の位置に格納されるので、読出バイトとして指定されるのはバイトB0である。例えば、格納先バンクがバンク番号#0でありステップ番号が2の場合、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、バイトB2を宛先バイトとし、バイトB0を読出バイトとする。
 アンパッキング処理の場合、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、格納先のベクタレジスタ111のバンク番号及びステップ番号を基に、図14に示すバイト選択テーブル205に応じた宛先バイトのバイト番号及び読出バイトのバイト番号を取得する。
 図14は、アンパッキング処理用のバイト選択テーブルの一例の図である。バイト選択テーブル205は、本実施例において4回繰り返して行われるパッキングの処理毎の各格納先バンクに応じた書き込み先となる読出バイト及び読み出し元となる読出バンクの情報を表す。本実施例に係るアンパッキングの処理では、書き込み先の宛先ラインにおいて要素データは全てバイトB0の位置に格納されるので、宛先バイトとして指定されるのはバイト番号B0である。例えば、格納先バンクがバンク番号#0でありステップ番号が2の場合、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、バイト番号B0を宛先バイトとし、バイト番号B0を読出バイトとする。
 以下に、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123の詳細について説明する。
 図15を参照して、パッキング時のバイトシャッフル回路122による要素データが格納されるバイトの位置を決定について説明する。図15は、実施例2に係るバイトシャッフル回路によるパッキング時の宛先バイトの決定処理を説明するための図である。
 バイトシャッフル回路122は、格納先のベクタレジスタ111のバンク番号に関わらず、宛先バイトがバイト番号B0~B3のいずれであっても、図15のテーブル331で示すように読出元バイトを「00」に決定する。ここで、「00」は、バイト番号B0のバイトを示す。これは、本実施例では、32ビットのデータが8ビットに圧縮された要素データが、どのバンクのどのラインであってもバイトB0に格納されることを理由とする。
 次に、図16を参照して、アンパッキング時のバイトシャッフル回路122による要素データが格納される宛先バイトの位置を決定について説明する。図16は、実施例1に係るバイトシャッフル回路によるアンパッキング時の宛先バイトの決定処理を説明するための図である。バンク番号332は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。
 バイトシャッフル回路122は、自己に対応するベクタレジスタ111のバンク番号を予め有する。この自己に対応するベクタレジスタ111のバンク番号が、格納先バンクのバンク番号である。また、本実施例のアンパッキングの処理では、要素データは、ラインにおける最下位のバイトB0に書き込まれる。そこで、バイトシャッフル回路122は、バイトB0を宛先バイトとする。
 そして、バイトシャッフル回路122は、格納先のベクタレジスタ111のバンク番号332の下位2ビットを取得して、テーブル333に示すように、宛先バイトであるバイト番号B0のバイトに対応する読出バイトのバイト番号とする。
 バイトシャッフル回路122は、読出データとともに読出データにおける各読出バイトに対応する宛先バイトの情報を積和演算器112へ出力する。
 ここで、図2に戻って、積和演算器112について説明する。積和演算器112は、読出データ及び読出データにおける各読出バイトに対応する宛先バイトの情報の入力をバイトシャッフル回路122から受ける。そして、積和演算器112は、入力された情報を素通させる演算を行い、演算結果を宛先バイト書込可否選択回路123へ出力する。すなわち、積和演算器112は、入力された読出データの情報をそのまま宛先バイト書込可否選択回路123へ出力するのと同じ処理を行う。
 次に、宛先バイト書込可否選択回路123について説明する。図17は、実施例1に係る宛先バイト書込可否選択回路が有するパッキング時の宛先バイトを選択する回路構成の概要を表す図である。バンク番号342は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号341は、4つのステップ番号を2進数で表した2ビットの情報である。
 宛先バイト書込可否選択回路123は、格納先とする「a,b,c」で表されるバンク番号を取得する。次に、宛先バイト書込可否選択回路123は、「u,v」で表されるステップ番号341の入力を演算命令制御部101から受ける。例えば、ステップ番号が2の場合、宛先バイト書込可否選択回路123は、「1,0」の入力を受ける。
 次に、宛先バイト書込可否選択回路123は、排他的論理和回路343を用いてバンク番号342の最上位のビットと、ステップ番号の上位のビットの排他的論理和を求める。また、宛先バイト書込可否選択回路123は、排他的論理和回路344を用いてバンク番号342の最下位から2番目のビットと、ステップ番号の下位のビットの排他的論理和を求める。そして、宛先バイト書込可否選択回路123は、排他的論理和回路343からの出力及び排他的論理和回路344からの出力を並べて2進数とした値を判定回路345~348へ入力する。
 判定回路345~348は、四角の枠の中に記載された「==n」に応じて、入力された値がnを表す2進数の場合には1を出力し、それ以外の場合には0を出力する回路である。判定回路345~348は、AND回路とインバータを組み合わせることで実現可能である。そして、判定回路345~348のいずれかから1が出力された場合、それに繋がる四角の枠に記載するように、バイトB0~B3のいずれかへの書き込みを有効にする。そして、有効にされたバンクにデータが書き込まれ、他のバンクにはデータが書き込まれない。
 次に、図18を参照して、アンパッキング時の宛先バイト書込可否選択回路123の処理について説明する。図18は、実施例1に係る宛先バイト書込可否選択回路によるアンパッキング時の宛先バイトの書込可否選択処理を説明するための図である。
 宛先バイト書込可否選択回路123は、格納先のベクタレジスタ111のバンク番号に関わらず、図15のテーブル349で示すようにバイトB1~B3への書き込みを無効とする。また、宛先バイト書込可否選択回路123は、テーブル349で示すようにバイトB0への書き込みを有効とする。これは、本実施例では、アンパッキング時には、いずれのバンクのどのラインであっても32ビットの領域の最下位のビットに要素データが格納されることを理由とする。
 以上により、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、パッキング時に図13で示したバイト選択テーブル204における宛先バイトのバンク番号及びステップ番号に対応する情報の出力を行うことができる。また、バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、アンパッキング時に図14で示したバイト選択テーブル205における宛先バイトのバンク番号及びステップ番号に対応する情報の出力を行うことができる。このバイトシャッフル回路122及び宛先バイト書込可否選択回路123が、「格納部」の一例にあたる。そして、宛先バイトが「所定位置」の一例にあたる。
 図2に戻って説明を続ける。宛先ライン選択回路124は、宛先となる領域の情報の入力を演算命令制御部101から受ける。例えば、宛先ライン選択回路124は、宛先となる領域の情報として図5に示す領域24を示す情報の入力を演算命令制御部101から受ける。また、宛先ライン選択回路124は、ステップ番号の入力を演算命令制御部101から受ける。また、宛先ライン選択回路124は、自己が接続するベクタレジスタ111のバンク番号を格納先のベクタレジスタ111のバンク番号として保持する。
 ここで、本実施例では、パッキング時には特定のラインに要素データを詰め合わせる。そこで、パッキングの処理の場合、宛先ライン選択回路124は、演算命令制御部101から入力された命令で指定された宛先となる領域が示すラインを宛先ラインとする。
 これに対して、アンパッキングの処理の場合、宛先ライン選択回路124は、格納先バンクのバンク番号及びステップ番号を基に、図19に示す宛先バンク選択テーブル202に応じたライン番号を取得する。
 図19は、実施例1に係るアンパッキング処理用の宛先ライン選択テーブルの一例の図である。宛先ライン選択テーブル206は、本実施例において4回繰り返して行われるアンパッキングの処理毎の各宛先バンクに応じた要素データの格納先となる宛先ラインの情報を表す。例えば、宛先バンクがバンク番号#0である場合、宛先ライン選択回路124は、ステップ番号が0~3である場合のそれぞれで、ライン番号##0、##1、##2、##3のラインを宛先ラインとして選択する。
 次に、より具体的に宛先ライン選択回路124による宛先ラインの決定処理について説明する。図20は、実施例1に係る宛先ライン選択回路が有するアンパッキング時の宛先ラインを決定する回路構成の概要を表す図である。バンク番号352は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号351は、4つのステップ番号を2進数で表した2ビットの情報である。
 宛先ライン選択回路124は、「a,b,c」で表される自己が接続するベクタレジスタ111のバンク番号352を取得する。例えば、宛先ライン選択回路124Aは、バンク番号352として「0,0,0」を取得する。
 次に、宛先ライン選択回路124は、「u,v」で表されるステップ番号351の入力を演算命令制御部101から受ける。例えば、ステップ番号351が2の場合、宛先ライン選択回路124は、「1,0」の入力を受ける。
 次に、宛先ライン選択回路124は、排他的論理和回路353を用いて、バンク番号352の下位から2番目のビットと、ステップ番号351の上位ビットとの排他的論理和を求める。また、宛先ライン選択回路124は、排他的論理和回路354を用いて、バンク番号352の最下位のビットと、ステップ番号351の下位ビットとの排他的論理和を求める。これにより、宛先ライン選択回路124は、宛先ライン番号355を取得する。ここで、宛先ライン番号355における大文字のアルファベットはビットの値を反転させた値を指す。例えば、ステップ番号が2の場合、宛先ライン選択回路124Aは、排他的論理和回路353から1を取得し、排他的論理和回路354から0を取得する。すなわち、宛先ライン選択回路124は、宛先ライン番号355として「1,0」を取得する。「1,0」が表すラインは、ライン番号##2のラインである。
 その後、宛先ライン選択回路124は、命令で指定された宛先とするラインのライン情報356の下位2ビットに宛先ライン番号355を付加して、宛先ライン情報357を生成する。その後、宛先ライン選択回路124は、生成した宛先ライン情報357をベクタレジスタ111へ出力する。これにより、宛先ライン選択回路124は、図19で示した宛先ライン選択テーブル206におけるバンク番号及びステップ番号に対応する情報の出力を行うことができる。この場合、宛先ライン選択回路124は、宛先ライン情報357に含まれる下位2ビットで表されるライン番号の要素レジスタ113への要素データの書き込みをベクタレジスタ111に行わせることができる。この宛先ライン選択回路124が、「第2選択部」の一例にあたる。そして、宛先ラインが「第2格納位置」の一例にあたる。
 次に、図21を参照して、4つのステップにおける本実施例に係る積和演算部100によるパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係について説明する。図21は、実施例1に係るパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係を表す図である。図21は、上述した処理により積和演算部100により各ステップにおいて決定される送信元及び宛先を表す。
 図21において、対応関係410は、ステップ番号が0の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。また、対応関係420は、ステップ番号が1の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。また、対応関係430は、ステップ番号が2の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。また、対応関係440は、ステップ番号が3の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。そして、指定情報451は、演算命令制御部101からの命令で指定された送信元の情報である。また、指定情報452は、演算命令制御部101からの命令で指定された宛先の情報である。
 ステップ番号が0の場合、対応関係410に示すように、積和演算部100は、指定情報451の下位2ビットに、読出ライン情報411を付加して、読出ラインのライン番号とする。読出ライン情報411は、2進数を用いた3ビットで送信元バンクのバンク番号を表した送信元バンク番号412の下位2ビットにあたる。送信元バンク番号412は、送信元バンクのバンク番号となる。さらに、積和演算部100は、「00」の値を取るバイト番号413を読出バイトのバイト番号とする。
 そして、ステップ番号が0の場合、積和演算部100は、送信元バンク番号412の各ビットを2ビット右ローテートさせることで生成される格納先バンク番号414を送信先のバンク番号とする。さらに、積和演算部100は、送信元バンク番号412の下位2ビットにあたる宛先バイト番号415を宛先バイトのバイト番号とする。
 ステップ番号が1の場合、対応関係420に示すように、積和演算部100は、指定情報451の下位2ビットに読出ライン情報421を付加して、読出ラインのライン番号とする。読出ライン情報421は、送信元バンク番号422の下位2ビットのうちの下位のビットを反転させた値である。さらに、積和演算部100は、「00」の値を取るバイト番号423を読出バイトのバイト番号とする。
 そして、ステップ番号が1の場合、積和演算部100は、送信元バンク番号422の最下位のビットを反転させたうえで、各ビットを2ビット右ローテートさせることで生成される格納先バンク番号424を格納先バンクのバンク番号とする。さらに、積和演算部100は、送信元バンク番号422の下位2ビットにあたる宛先バイト番号425を宛先バイトのバイト番号とする。
 ステップ番号が2の場合、対応関係430に示すように、積和演算部100は、指定情報451の下位2ビットに読出ライン情報431を付加して、読出ラインのライン番号とする。読出ライン情報431は、送信元バンク番号432の下位2ビットのうちの上位のビットを反転させた値である。さらに、積和演算部100は、「00」の値を取るバイト番号433を読出元バイトのバイト番号とする。
 そして、ステップ番号が2の場合、積和演算部100は、送信元バンク番号432の最下位から2番目のビットを反転させたうえで、各ビットを2ビット右ローテートさせることで生成される格納先バンク番号434を格納先バンクのバンク番号とする。さらに、積和演算部100は、送信元バンク番号432の下位2ビットにあたる宛先バイト番号435を宛先バイトのバイト番号とする。
 ステップ番号が3の場合、対応関係440に示すように、積和演算部100は、指定情報451の下位2ビットに読出ライン情報441を付加して、読出ラインのライン番号とする。読出ライン情報441は、送信元バンク番号432の下位2ビットの両方のビットを反転させた値である。さらに、積和演算部100は、「00」の値を取るバイト番号443を読出元バイトのバイト番号とする。
 そして、ステップ番号が3の場合、積和演算部100は、送信元バンク番号442の下位2ビットを反転させたうえで、各ビットを2ビット右ローテートさせることで生成される格納先バンク番号444を格納先バンクのバンク番号とする。さらに、積和演算部100は、送信元バンク番号442の下位2ビットにあたる宛先バイト番号445を宛先バイトのバイト番号とする。
 図21で示した送信元と宛先の情報をライン、バンク及びバイトの形で表すと図22の様に表される。図22は、実施例1に係る積和演算部によるパッキング時の送信元と宛先の情報の一覧の図である。
 図22において、紙面に向かって左端の数字は、パッキング前の32個の要素データが格納された領域に連番で振った番号を表す。そして、矢印の左側が、送信元の位置の情報を表す。また、矢印の右側が、宛先の位置の情報を表す。すなわち、「line##p-bank#q-byte(Br)」は、ライン番号##p、バンク番号#q、バイト番号(Br)で表される領域を指す。また、ライン番号##(dst)は、命令で指定された宛先のライン番号である。さらに、紙面に向かって上端から8個ずつの組が、それぞれステップ番号が0~3の各ステップにおける送信元と宛先にあたる。
 図22に示すように、送信元のバンク番号461は、各ステップにおいて重複しない。すなわち、積和演算部100は、各ステップで同時に8つの要素データを読み出すことができる。そして、図22に示すように宛先のバンク番号462も、各ステップにおいて重複しない。すなわち、積和演算部100は、各ステップで同時に8つの要素データを格納することができる。すなわち、積和演算部100は、8つのバンクを効率的に使用してパッキングの処理を行うことができる。
 このように、積和演算部100は、図21に示した手順で決められた送信元及び宛先の位置を用いることで効率的にパッキングの処理を行うことができる。そして、図21に示した送信元及び宛先の位置は、図6の読出ライン選択テーブル201、図8の宛先バンク選択テーブル202、及び、図13のバイト選択テーブル204にしたがって決定した送信元及び宛先の位置に一致する。すなわち、上述した積和演算部100の処理により、積和演算部100は、効率的にパッキングの処理を行うことができることが分かる。
 ここで、図23を参照して、パッキング時の送信元及び宛先の決定を一般化について説明する。図23は、パッキング時の一般化した送信元及び宛先の決定方法を説明するための図である。
 図23における紙面に向かって上側の情報471は、送信元の領域の位置を表す情報である。また、情報472は、宛先の領域の位置を表す情報である。
 まず、図23におけるKは、バンクの数を2の冪乗で表した場合の冪数である。例えば、本実施例のように8つのバンクがある場合は、K=3である。また、Nは、送信元の要素データのサイズに対する各バンクのラインのサイズの倍率の2を底とした対数の値である。すなわち、Nは、圧縮後の要素データに対する圧縮前の要素データの倍率の2を底とした対数の値である。例えば、本実施例のように32ビットの要素データを8ビットに圧縮した場合、圧縮後の要素データに対する圧縮前の要素データの倍率は4倍であるので、N=2となる。さらに、Mは、送信元の各バンクの1つのラインの中に、含まれる要素データの数の2を底とした対数の値である。本実施例では、送信元の各バンクの1つのラインの中には1つの要素データが含まれるので、M=0である。
 そして、送信元バンクのバンク番号をKビットの2進数で表し、最下位からNビットである領域473の各ビットの値をそのまま維持する又は反転させるかして求められる組み合わせが求められる。そして、最下位からNビットの部分を求めた組み合わせに変更したKビットの値をNビット右ローテートさせることで、格納先バンクのバンク番号474が求められる。ここで、バンク番号474の先頭からNビットは、領域473の各ビットの値をそのまま維持する又は反転させるかして求められた組み合わせである。そして、格納先バンクのバンク番号474の最上位からNビットである領域475の値が、読出ラインのライン番号476になる。さらに、送信元バンクのバンク番号の最下位からNビットの領域473の値が宛先バイトの最上位からNビットの領域477の値にあたり、さらにその後に読出バイトの最上位からMビットの領域478の値を付加したN+Mビットの値479が、要素の移動先の宛先ラインのバンク内での要素番号となる。
 図23で示す方法で決定した送信元及び宛先を各ステップにおいて選択するように回路を組むことで、任意の圧縮率及びバンクの数において、積和演算部100は、効率的にパッキングの処理を行うことができる。
 次に、図24を参照して、4つのステップにおける本実施例に係る積和演算部100によるアンパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係について説明する。図24は、アンパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係を表す図である。図24は、上述した処理により積和演算部100により各ステップにおいて決定される送信元及び宛先を表す。
 図24において、対応関係510は、ステップ番号が0の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。また、対応関係520は、ステップ番号が1の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。また、対応関係530は、ステップ番号が2の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。また、対応関係540は、ステップ番号が3の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。そして、指定情報551は、演算命令制御部101からの命令で指定された送信元の情報である。また、指定情報552は、演算命令制御部101からの命令で指定された宛先の情報である。
 ステップ番号が0の場合、対応関係510における送信元バンク番号511が、送信元バンクのバンク番号となる。また、指定情報552の下位2ビットに付加される宛先ライン情報513が、宛先ラインのライン番号となる。宛先ライン情報513は、送信元バンク番号511の上位2ビットにあたる。さらに、「00」であるバイト番号515が、宛先バイトのバイト番号となる。
 そして、ステップ番号が0の場合、送信元バンク番号511の各ビットを2ビット左ローテートさせることで生成される格納先バンク番号514が、格納先バンクのバンク番号となる。さらに、格納先バンク番号514の下位2ビットが、読出バイト番号512にあたる。
 ステップ場合が1の場合、対応関係520における送信元バンク番号521が、送信元バンクのバンク番号となる。また、指定情報552の下位2ビットに付加される宛先ライン情報523が、宛先ラインのライン番号となる。宛先ライン情報523は、送信元バンク番号521の上位2ビットにあたる。さらに、「00」であるバイト番号525が、宛先バイトのバイト番号となる。
 そして、ステップ番号が1の場合、送信元バンク番号521の最下位から2番目のビットを反転させたうえで、各ビットを2ビット左ローテートさせることで生成される格納先バンク番号524が、格納先バンクのバンク番号となる。さらに、格納先バンク番号524の下位2ビットが、読出バイト番号522にあたる。
 ステップ場合が2の場合、対応関係530における送信元バンク番号531が、送信元バンクのバンク番号となる。また、指定情報552の下位2ビットに付加される宛先ライン情報533が、宛先ラインのライン番号となる。宛先ライン情報533は、送信元バンク番号531の上位2ビットにあたる。さらに、「00」であるバイト番号535が、宛先バイトのバイト番号となる。
 そして、ステップ番号が2の場合、送信元バンク番号531の最上位のビットを反転させたうえで、各ビットを2ビット左ローテートさせることで生成される格納先バンク番号534が、格納先バンクのバンク番号となる。さらに、格納先バンク番号534の下位2ビットが、読出バイト番号532にあたる。
 ステップ場合が3の場合、対応関係540における送信元バンク番号541が、送信元バンクのバンク番号となる。また、指定情報552の下位2ビットに付加される宛先ライン情報543が、宛先ラインのライン番号となる。宛先ライン情報543は、送信元バンク番号541の上位2ビットにあたる。さらに、「00」であるバイト番号545が、宛先バイトのバイト番号となる。
 そして、ステップ番号が3の場合、送信元バンク番号541の最上位から2ビットを両方とも反転させたうえで、各ビットを2ビット左ローテートさせることで生成される格納先バンク番号544が、格納先バンクのバンク番号となる。さらに、格納先バンク番号544の下位2ビットが、読出バイト番号542にあたる。
 積和演算部100は、図24に示した手順で決められた送信元及び宛先の位置を用いることで効率的にパッキングの処理を行うことができる。そして、図24に示した送信元及び宛先の位置は、図10の宛先バンク選択テーブル203、図14のバイト選択テーブル205及び図19の宛先ライン選択テーブル206にしたがって決定した送信元及び宛先の位置に一致する。すなわち、上述した積和演算部100の処理により、積和演算部100は、効率的にアンパッキングの処理を行うことができる。
 ここで、図25を参照して、アンパッキング時の送信元及び宛先の決定を一般化について説明する。図25は、一般化したアンパッキング時の送信元及び宛先の決定方法を説明するための図である。
 図25における紙面に向かって上側の情報561は、送信元の領域の位置を表す情報である。また、情報562は、宛先の領域の位置を表す情報である。
 まず、図25におけるK、N及びMはそれぞれ、図23におけるK、N及びMと同様の方法で決定される。
 そして、送信元バンクのバンク番号をKビットの2進数で表し、最上位からNビットである領域563の各ビットの値をそのまま維持する又は反転させるかして組み合わせが求められる。この組み合わせの取得は、全ての組み合わせが完了するまで繰り返し行われる。そして、最上位からNビットの部分を求めた組み合わせに変更したKビットの値をNビット右ローテートさせることで、送信先バンクのバンク番号564が求められる。ここで、バンク番号564の最下位からNビットは、領域563の各ビットの値をそのまま維持する又は反転させるかして求められた組み合わせである。そして、送信元バンクのバンク番号の最上位からNビットである領域563の値が、宛先ラインのライン番号565になる。さらに、送信先バンクのバンク番号564の最下位からNビットの領域566の値が宛先バイトの最上位からNビットの領域567の値にあたり、さらにその後に宛先バイトの最上位からMビットの領域568の値を付加したN+Mビットの値569が、要素の移動先の読出ラインのバンク内での要素番号となる。
 図25で示す方法で決定した送信元及び宛先を各ステップにおいて選択するように回路を組むことで、任意の圧縮率及びバンクの数において、積和演算部100は、効率的にアンパッキングの処理を行うことができる。
 次に、図26を参照して、本実施例に係る処理ユニット10によるパッキング処理の流れを説明する。図26は、実施例1に係る処理ユニットによるパッキング処理のフローチャートである。
 積和演算部100は、繰り返し単位のパッキング命令を演算命令制御部101から取得する(ステップS101)。このとき、積和演算部100は、ステップ番号の初期値、すなわち0の入力を演算命令制御部101から受ける。
 読出ライン変更回路121は、自己が対応するベクタレジスタ111のバンク番号及びステップ番号から送信先のライン番号を取得する。また、読出ライン変更回路121は、パッキング命令から命令で指定された格納先のラインの情報を取得する。そして、読出ライン変更回路121は、命令で指定された格納先のラインの情報の最下位に取得した送信先のライン番号を付加する(ステップS102)。そして、読出ライン変更回路121は、送信先のライン番号を付加したラインの情報をベクタレジスタ111へ出力する。
 ベクタレジスタ111は、入力されたラインの情報の最下位に付加されたライン番号に応じた要素レジスタ113から読出データを読み出す(ステップS103)。ベクタレジスタ111は、読み出した読出データをルータ125へ出力する。
 ルータ125は、各格納先のバンク番号に応じた送信元のバンク番号を特定する(ステップS104)。
 ルータ125は、取得した読出データを、読出元のベクタレジスタ111のバンク番号を送信元とする格納先のバンク番号を有するベクタレジスタ111に対応する積和演算器112に繋がるバイトシャッフル回路122へ送信する(ステップS105)。
 バイトシャッフル回路122は、格納先の要素レジスタ113のバンク番号に応じた各宛先バイトに対応する読出バイトを決定する(ステップS106)。そして、バイトシャッフル回路122は、各宛先バイトに対応する読出バイトの情報とともに、読出データを積和演算器112へ出力する。
 積和演算器112は、受信した読出データに素通しする演算を実行して出力する(ステップS107)。
 宛先バイト書込可否選択回路123は、読出データを積和演算器112から取得する。次に、宛先バイト書込可否選択回路123は、宛先バイトのうち格納先のバンク番号及びステップ番号から宛先バイトを決定し、その宛先バイトの書き込みを有効にする(ステップS108)。
 次に、宛先バイト書込可否選択回路123は、読出データをベクタレジスタ111へ出力する。ベクタレジスタ111は、命令で指定されたラインの書き込みが有効にされたバイトに、対応する読出バイトに格納された要素データを書き込む(ステップS109)。
 演算命令制御部101は、繰り返し単位の処理である4回のステップが完了したか否かを判定する(ステップS110)。
 4回のステップが完了していない場合(ステップS110:否定)、演算命令制御部101は、次のステップのステップ番号を積和演算器112へ出力する。積和演算器112は、次のステップのステップ番号を演算命令制御部101から取得する(ステップS111)。その後、積和演算器112は、ステップS102へ戻る。
 これに対して、4回のステップが完了した場合(ステップS110:肯定)、演算命令制御部101は、全ての繰り返し単位のパッキング処理が完了したか否かを判定する(ステップS112)。繰り返し単位のパッキング処理が残っている場合(ステップS112:否定)、積和演算器112は、ステップS101へ戻る。
 これに対して、全ての繰り返し単位のアンパッキング処理が完了した場合(ステップS112:肯定)、パッキング処理を終了する。
 次に、図27を参照して、本実施例に係る処理ユニット10によるアンパッキング処理の流れを説明する。図27は、実施例1に係る処理ユニットによるアンパッキング処理のフローチャートである。
 積和演算部100は、繰り返し単位のアンパッキング命令を演算命令制御部101から取得する(ステップS201)。このとき、積和演算部100は、ステップ番号の初期値、すなわち0の入力を演算命令制御部101から受ける。
 読出ライン変更回路121は、アンパッキング命令から命令で指定された送信元のラインの情報を取得する。そして、読出ライン変更回路121は、命令で指定された送信先のラインの情報をベクタレジスタ111へ出力する。
 ベクタレジスタ111は、入力されたラインの情報に応じたライン番号を有する要素レジスタ113から読出データを読み出す(ステップS202)。ベクタレジスタ111は、読み出した読出データをルータ125へ出力する。
 ルータ125は、各格納先のバンク番号に応じた送信元のバンク番号を特定する(ステップS203)。
 ルータ125は、取得した読出データを、読出元のベクタレジスタ111のバンク番号を送信元とする格納先のバンク番号を有するベクタレジスタ111に対応する積和演算器112に繋がるバイトシャッフル回路122へ送信する(ステップS204)。
 バイトシャッフル回路122は、格納先の要素レジスタ113のバンク番号に応じた各宛先バイトに対応する読出バイトを決定する(ステップS205)。そして、バイトシャッフル回路122は、各宛先バイトに対応する読出バイトの情報とともに、読出データを積和演算器112へ出力する。
 積和演算器112は、受信した読出データに素通しする演算を実行して出力する(ステップS206)。
 宛先バイト書込可否選択回路123は、読出データを積和演算器112から取得する。次に、宛先バイト書込可否選択回路123は、宛先バイトのうち最下位のバイトの書き込みを有効にする(ステップS207)。
 宛先ライン選択回路124は、格納先のバンクに応じた宛先ラインを決定する(ステップS208)。
 次に、宛先バイト書込可否選択回路123は、読出データをベクタレジスタ111へ出力する。ベクタレジスタ111は、宛先ライン選択回路124により決定されたラインの書き込みが有効にされたバイトに、対応する読出バイトに格納された要素データを書き込む(ステップS209)。
 演算命令制御部101は、繰り返し単位の処理である4回のステップが完了したか否かを判定する(ステップS210)。
 4回のステップが完了していない場合(ステップS210:否定)、演算命令制御部101は、次のステップのステップ番号を積和演算器112へ出力する。積和演算器112は、次のステップのステップ番号を演算命令制御部101から取得する(ステップS211)。その後、積和演算器112は、ステップS202へ戻る。
 これに対して、4回のステップが完了した場合(ステップS210:肯定)、演算命令制御部101は、全ての繰り返し単位のアンパッキング処理が完了したか否かを判定する(ステップS212)。繰り返し単位のアンパッキング処理が残っている場合(ステップS212:否定)、積和演算器112は、ステップS201へ戻る。
 これに対して、全ての繰り返し単位のパッキング処理が完了した場合(ステップS212:肯定)、アンパッキング処理を終了する。
 図28は、処理ユニットに本実施例に係るパッキング処理及びアンパッキング処理を実行させる命令の一例を示す図である。図28に示す命令は、どのようなパッキング処理及びアンパッキング処理を行うかと、その内のどのステップの処理を行うかと、読出元ラインのライン番号と、宛先ラインのライン番号とを指定する。積和演算部100における各処理回路は、図28に示される命令によって指定された情報を取得して処理を実行する。
 以上に説明したように、本実施例に係る処理ユニットは、パッキング処理であれば送信元バンクのバンク番号及び繰り返し単位の処理に含まれるステップのステップ番号から格納先バンクのバンク番号を決定し、且つ、宛先バイトを決定する。そして、決定したバンク番号を有するベクタレジスタに含まれる所定のライン番号の要素レジスタの決定した宛先バイトに各バンクに格納された要素データを移動することでパッキングを完了する。
 また、本実施例に係る処理ユニットは、アンパッキング処理であれば送信元バンクのバンク番号及び繰り返し単位の処理に含まれるステップのステップ番号から格納先バンクのバンク番号及び宛先ラインのライン番号を決定する。そして、決定したバンク番号を有するベクタレジスタに含まれる決定した宛先ラインのライン番号を有する要素レジスタの決定した宛先バイトに各バンクに格納された要素データを移動することでアンパッキングを完了する。
 このように、本実施例に係る処理ユニットは、既存の積和演算の回路を用いて効率的なパッキング及びアンパッキングの処理を実行することができる。
 次に、実施例2について説明する。本実施例においても図1に示す情報処理装置50及び図2に示す積和演算部100が用いられる。以下の説明では、実施例1と同様の各部の動作は説明を省略する場合がある。
 本実施例に係る処理ユニット10は、図29に示すようにパッキング時には32ビットのデータを16ビットに圧縮し、32ビットの宛先ラインに2つずつ16ビットのデータを詰め合わせる。図29は、実施例2に係るパッキング処理の概要を表す図である。本実施例では、図29に示すように繰り返し単位として、2回のステップが実行される。
 パッキング処理の場合、読出ライン変更回路121は、入力されたステップ番号の情報と自己が接続されたベクタレジスタ111のバンク番号を基に、図30に示す読出ライン選択テーブル601に応じた読出ラインのライン番号を取得する。
 図30は、実施例2に係るパッキング処理用の読出ライン選択テーブルの一例の図である。読出ライン選択テーブル601は、本実施例において2回繰り返して行われるパッキング処理毎の各送信元バンクに応じた読み出し元とする読出ラインの情報を表す。
 例えば、0回目の繰り返しの場合、読出ライン変更回路121は、自己が接続するベクタレジスタ111のライン番号及びステップ番号である0を用いて、読み出し元となる読出ラインの情報を求める。この読み出しラインの情報が読出ライン選択テーブル601におけるバンク番号#0のステップ番号が0の場合の読出ラインの情報に一致する。そして、読出ライン変更回路121は、求めたライン番号を読み出しアドレスとしてベクタレジスタ111に入力する。
 図31を参照して、より具体的に読み出し元の情報の生成を説明する。図31は、実施例2に係る読出ライン変更回路の回路構成の概要を表す図である。バンク番号612は、読出ライン変更回路121が接続するベクタレジスタ111のバンク番号を2進数で表した3ビットの情報である。また、ステップ番号611は、2つのステップ番号を2進数で表した1ビットの情報である。
 読出ライン変更回路121は、「a,b,c」で表される自己に対応するベクタレジスタ111のバンク番号612を取得する。次に、読出ライン変更回路121は、「v」で表されるステップ番号611の入力を演算命令制御部101から受ける。例えば、ステップ番号が1の場合、読出ライン変更回路121は、「1」の入力を受ける。
 次に、読出ライン変更回路121は、排他的論理和回路613を用いて、バンク番号612の最下位のビットと、ステップ番号611との排他的論理和を求める。これにより、読出ライン変更回路121は、読出ライン番号614を取得する。ここで、読出ライン番号614における大文字のアルファベットはビットの値を反転させた値を指す。
 その後、読出ライン変更回路121は、命令で指定された読み出し元とするラインのライン情報615の最下位のビットに読出ライン番号614を付加して、読出ライン情報616を生成する。その後、読出ライン変更回路121は、生成した読出ライン情報616をベクタレジスタ111へ出力する。これにより、読出ライン変更回路121は、図30で示した読出ライン選択テーブル601におけるバンク番号及びステップ番号に対応するライン番号の出力を行うことができる。この場合、読出ライン変更回路121は、読出ライン情報616に含まれる最下位ビットで表されるライン番号にあたる要素レジスタ113から出力される読出データをベクタレジスタ111に出力させることができる。
 また、アンパッキングの処理の場合、読出ライン変更回路121は、入力されたリードアドレスを含む送信元の情報をそのまま、ベクタレジスタ111へ出力する。これにより、読出ライン変更回路121は、リードアドレスで表されるライン番号の要素レジスタ113から出力される読出データをベクタレジスタ111に出力させることができる。
 ルータ125は、読出データの入力を各ベクタレジスタ111から受ける。また、ルータ125は、ステップ番号の入力を演算命令制御部101から受ける。
 パッキング処理の場合、ルータ125は、格納先のベクタレジスタ111のバンク番号及びステップ番号を基に、図32に示す宛先バンク選択テーブル602に応じた送信元のバンク番号を取得する。
 図32は、実施例2に係るパッキング処理用の宛先バンク選択テーブルの一例の図である。宛先バンク選択テーブル602は、本実施例において2回繰り返して行われるパッキング処理毎の各格納先のバンクに応じた送信元となる送信元バンクの情報を表す。例えば、格納先バンクがバンク番号#0であれば、ステップ番号が0、1である場合のそれぞれで、ルータ125は、バンク番号#0、#1のバンクを送信元バンクとして選択する。
 図33を参照して、より具体的に格納先バンクの決定を説明する。図33は、実施例2に係るルータが有するパッキング時の格納先バンクを決定する回路構成の概要を表す図である。バンク番号621は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号622は、2つのステップ番号を2進数で表した1ビットの情報である。
 ルータ125は、格納先とする「a,b,c」で表されるバンク番号を選択する。次に、ルータ125は、選択した格納先バンクのバンク番号のビットを1ビット左ローテートする。すなわち、ルータ125は、バンク番号621の最下位及び最下位から2番目のビットの値を1ビットずつの上位のビットに移動し、最上位のビットの値を最下位のビットに移動する。これにより、ルータ125は、巡回後番号623を取得する。例えば、格納先のベクタレジスタ111のバンク番号621が「0,1,1」である場合、ルータ125は、巡回後番号623として「1,1,0」を取得する。
 次に、ルータ125は、「v」で表されるステップ番号622の入力を演算命令制御部101から受ける。次に、ルータ125は、排他的論理和回路624を用いて巡回後番号623の最下位のビットとステップ番号との排他的論理和を求める。そして、ルータ125は、巡回後番号623の最上位ビット及び最下位から2番目のビット、並びに、排他的論理和回路624からの出力を並べて送信元バンクのバンク番号625を取得する。ここで、バンク番号625における大文字のアルファベットは元の値を反転させた値である。
 ルータ125は、選択した格納先のバンク番号のベクタレジスタ111に対応する積和演算器112に接続するバイトシャッフル回路122に対して、決定した送信元バンクのバンク番号を有するベクタレジスタ111から入力された値を出力する。
 また、アンパッキング処理の場合、図34に示す回路により格納先バンクを決定する。図34は、実施例2に係るルータが有するアンパッキング時の格納先バンクを決定する回路構成の概要を表す図である。バンク番号626は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号627は、2つのステップ番号を2進数で表した1ビットの情報である。
 ルータ125は、格納先とする「a,b,c」で表されるバンク番号を選択する。次に、ルータ125は、選択した格納先のバンク番号のビットを1ビット右ローテートする。すなわち、ルータ125は、バンク番号626の最上位のビット及び最下位から2番目のビットの値をそれぞれ1つ下位のビットに移動し、最下位のビットの値を最上位のビットにする。これにより、ルータ125は、巡回後番号628を取得する。例えば、格納先のベクタレジスタ111のバンク番号626が「1,0,1」である場合、ルータ125は、巡回後番号628として「1,1,0」を取得する。
 次に、ルータ125は、「v」で表されるステップ番号627の入力を演算命令制御部101から受ける。次に、ルータ125は、排他的論理和回路629を用いて巡回後番号628の最上位のビットと、ステップ番号627との排他的論理和を求める。そして、ルータ125は、排他的論理和回路629からの出力、並びに、巡回後番号628の最上位ビット及び最下位から2番目のビットの値を並べて送信元バンクのバンク番号630を取得する。ここで、バンク番号630における大文字のアルファベットは元の値を反転させた値である。
 ルータ125は、選択した格納先のバンク番号のベクタレジスタ111に対応する積和演算器112に接続するバイトシャッフル回路122に対して、決定した送信元のバンク番号のベクタレジスタ111から入力された読出データを出力する。
 バイトシャッフル回路122、積和演算器112及び宛先バイト書込可否選択回路123は、パッキングの処理の場合、格納先のベクタレジスタ111のバンク番号及びステップ番号を基に、図35に示すバイト選択テーブル603に応じた宛先バイト番号及び読出元バイト番号を取得する。
 図35は、実施例2に係るパッキング処理用のバイト選択テーブルの一例の図である。バイト選択テーブル603は、本実施例において2回繰り返して行われるパッキングの処理毎の各格納先バンクに応じた書き込み先となる宛先バイト及び読み出し元となる読出バイトの情報を表す。本実施例に係るパッキングの処理では、宛先バイトがバイトB0又はB2の要素データは、読出ラインにおけるバイトB0の位置に格納される。また、宛先バイトがバイトB1又はB3の要素データは、読出ラインにおけるバイトB1の位置に格納される。
 アンパッキング処理の場合、パッキング処理を逆向きにすることで、宛先バイトのバイト番号及び読出バイトのバイト番号が決定できる。以下に、バイトシャッフル回路122及び宛先バイト書込可否選択回路123の詳細について説明する。
 図36を参照して、パッキング時のバイトシャッフル回路122による要素データが格納されるバイトの位置を決定について説明する。図36は、実施例2に係るバイトシャッフル回路によるパッキング時の宛先バイトの決定処理を説明するための図である。
 バイトシャッフル回路122は、宛先バイトがバイト番号B0又はB2の場合、読出バイトをバイト番号00とする。また、バイトシャッフル回路122は、宛先バイトがバイト番号B1又はB3の場合、読出バイトをバイト番号01とする。
 次に、図37を参照して、アンパッキング時のバイトシャッフル回路122による要素データが格納される宛先バイトの位置を決定について説明する。図37は、実施例2に係るバイトシャッフル回路によるアンパッキング時の宛先バイトの決定処理を説明するための図である。バンク番号632は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。
 バイトシャッフル回路122は、自己に対応するベクタレジスタ111のバンク番号を予め有する。この自己に対応するベクタレジスタ111のバンク番号が、格納先バンクのバンク番号である。また、本実施例のアンパッキングの処理では、要素データは、ラインにおける最下位のバイトB0及び1つ上位のバイトB1に書き込まれる。そこで、バイトシャッフル回路122は、対応633に示すように、バイトB0及びB1が宛先バイトの場合の読出バイトをバイト番号c0及びc1とする。
 そして、バイトシャッフル回路122は、格納先のベクタレジスタ111のバンク番号632の最下位ビットを取得して、対応633に示すように、宛先バイトであるバイト番号B0及びB1のバイトに対応する読出バイトのバイト番号を取得する。
 バイトシャッフル回路122は、読出データとともに読出データにおける各読出バイトに対応する宛先バイトの情報を積和演算器112へ出力する。
 図38は、実施例2に係る宛先バイト書込可否選択回路が有するパッキング時の宛先バイトを選択する回路構成の概要を表す図である。バンク番号642は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号641は、2つのステップ番号を2進数で表した1ビットの情報である。
 宛先バイト書込可否選択回路123は、格納先とする「a,b,c」で表されるバンク番号642を取得する。次に、宛先バイト書込可否選択回路123は、「v」で表されるステップ番号641の入力を演算命令制御部101から受ける。
 次に、宛先バイト書込可否選択回路123は、排他的論理和回路643を用いてバンク番号642の最上位のビットとステップ番号641との排他的論理和を求める。そして、宛先バイト書込可否選択回路123は、排他的論理和回路643からの出力を判定回路644及び645へ入力する。
 判定回路644及び645は、四角の枠の中に記載された「==n」に応じて、入力された値がnを表す2進数の場合には1を出力し、それ以外の場合には0を出力する回路である。そして、判定回路645から1が出力された場合、バイト番号B0及びB1への書き込みを有効にする。判定回路644から1が出力された場合、バイト番号B2及びB3への書き込みを有効にする。そして、有効にされたバンクにデータが書き込まれ、他のバンクにはデータが書き込まれない。
 次に、図39を参照して、アンパッキング時の宛先バイト書込可否選択回路123の処理について説明する。図39は、実施例2に係る宛先バイト書込可否選択回路によるアンパッキング時の宛先バイトの書込可否選択処理を説明するための図である。
 宛先バイト書込可否選択回路123は、格納先のベクタレジスタ111のバンク番号に関わらず、図39のテーブル646で示すようにバイトB2及びB3への書き込みを無効とする。また、宛先バイト書込可否選択回路123は、テーブル646で示すようにバイトB0及びB1への書き込みを有効とする。これは、本実施例では、アンパッキング時には、いずれのバンクのどのラインであっても32ビットの領域のバイトB0及びB1に要素データが格納されることを理由とする。
 図40は、実施例2に係るアンパッキング処理用の宛先ライン選択テーブルの一例の図である。宛先ライン選択テーブル605は、本実施例において2回繰り返して行われるアンパッキングの処理毎の各宛先バンクに応じた要素データの格納先となる宛先ラインの情報を表す。例えば、宛先バンクがバンク番号#0である場合、宛先ライン選択回路124は、ステップ番号が0及び1である場合のそれぞれで、ライン番号##0、##1のラインを宛先ラインとして選択する。
 次に、より具体的に宛先ライン選択回路124による宛先ラインの決定処理について説明する。図41は、実施例2に係る宛先ライン選択回路が有するアンパッキング時の宛先ラインを決定する回路構成の概要を表す図である。バンク番号652は、格納先バンクのバンク番号を2進数で表した3ビットの情報である。また、ステップ番号651は、2つのステップ番号を2進数で表した1ビットの情報である。
 宛先ライン選択回路124は、「a,b,c」で表される自己が接続するベクタレジスタ111のバンク番号652を取得する。次に、宛先ライン選択回路124は、「v」で表されるステップ番号651の入力を演算命令制御部101から受ける。
 次に、宛先ライン選択回路124は、排他的論理和回路653を用いて、バンク番号652の最下位のビットとステップ番号651との排他的論理和を求める。これにより、宛先ライン選択回路124は、宛先ライン番号654を取得する。ここで、宛先ライン番号654における大文字のアルファベットはビットの値を反転させた値を指す。
 その後、宛先ライン選択回路124は、命令で指定された宛先とするラインのライン情報655の最下位ビットに宛先ライン番号654を付加して、宛先ライン情報656を生成する。その後、宛先ライン選択回路124は、生成した宛先ライン情報656をベクタレジスタ111へ出力する。これにより、宛先ライン選択回路124は、図40で示した宛先ライン選択テーブル605におけるバンク番号及びステップ番号に対応する情報の出力を行うことができる。この場合、宛先ライン選択回路124は、宛先ライン情報656に含まれる最下位ビットで表されるライン番号の要素レジスタ113への要素データの書き込みをベクタレジスタ111に行わせることができる。
 次に、図42を参照して、2つのステップにおける本実施例に係る積和演算部100によるパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係について説明する。図42は、実施例2に係るパッキング時の送信元の要素データの格納位置と宛先の要素データの格納位置との関係を表す図である。図42は、上述した処理により積和演算部100により各ステップにおいて決定される送信元及び宛先を表す。
 図42において、対応関係660は、ステップ番号が0の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。また、対応関係670は、ステップ番号が1の場合の送信元における格納位置を表す情報及び宛先における格納位置を表す情報との関係を表す。そして、指定情報681は、演算命令制御部101からの命令で指定された送信元の情報である。また、指定情報682は、演算命令制御部101からの命令で指定された宛先の情報である。
 ステップ番号が0の場合、対応関係660に示すように、積和演算部100は、指定情報681の最下位ビットに、読出ライン情報661を付加して、読出ラインのライン番号とする。読出ライン情報661は、2進数を用いた3ビットで送信元バンクのバンク番号を表した送信元バンク番号662の最下位ビットにあたる。送信元バンク番号662は、送信元バンクのバンク番号となる。さらに、積和演算部100は、「0」の値を取るバイト番号663を読出バイトのバイト番号とする。
 そして、ステップ番号が0の場合、積和演算部100は、送信元バンク番号662の各ビットを1ビット右ローテートさせることで生成される格納先バンク番号664を送信先のバンク番号とする。さらに、積和演算部100は、送信元バンク番号662の最下位ビットにあたる宛先バイト番号665を宛先バイトのバイト番号とする。
 ステップ番号が1の場合、対応関係670に示すように、積和演算部100は、指定情報681の最下位ビットに読出ライン情報671を付加して、読出ラインのライン番号とする。読出ライン情報671は、送信元バンク番号672の最下位ビットを反転させた値である。さらに、積和演算部100は、「0」の値を取るバイト番号673を読出バイトのバイト番号とする。
 そして、ステップ番号が1の場合、積和演算部100は、送信元バンク番号672の最下位のビットを反転させたうえで、各ビットを1ビット右ローテートさせることで生成される格納先バンク番号674を格納先バンクのバンク番号とする。さらに、積和演算部100は、送信元バンク番号672の最下位ビットにあたる宛先バイト番号675を宛先バイトのバイト番号とする。
 図42で示した送信元と宛先の情報をライン、バンク及びバイトの形で表すと図43の様に表される。図43は、実施例2に係る積和演算部によるパッキング時の送信元と宛先の情報の一覧の図である。
 図43において、紙面に向かって左端の数字は、パッキング前の16個の要素データが格納された領域に連番で振った番号を表す。そして、矢印の左側が、送信元の位置の情報を表す。また、矢印の右側が、宛先の位置の情報を表す。紙面に向かって上端から8個ずつの組が、それぞれステップ番号が0及び1の各ステップにおける送信元と宛先にあたる。
 図43に示すように、送信元のバンク番号691は、各ステップにおいて重複しない。すなわち、積和演算部100は、各ステップで同時に8つの要素データを読み出すことができる。そして、図43に示すように宛先のバンク番号692も、各ステップにおいて重複しない。すなわち、積和演算部100は、各ステップで同時に8つの要素データを格納することができる。すなわち、積和演算部100は、8つのバンクを効率的に使用してパッキングの処理を行うことができる。
 このように、積和演算部100は、図42に示した手順で決められた送信元及び宛先の位置を用いることで効率的にパッキングの処理を行うことができる。そして、図42に示した送信元及び宛先の位置は、図30の読出ライン選択テーブル601、図32の宛先バンク選択テーブル602、及び、図35のバイト選択テーブル603にしたがって決定した送信元及び宛先の位置に一致する。すなわち、上述した積和演算部100の処理により、積和演算部100は、効率的にパッキングの処理を行うことができることが分かる。また、アンパッキング処理についても同様であり、積和演算部100は、効率的にアンパッキングの処理を行うことができることが分かる。
 以上に説明したように、本実施例に係る処理ユニットは、32ビットのデータを16ビットのデータに変換して2つずつ詰め合せるパッキング処理やその逆のアンパッキング処理について、既存の積和演算の回路を用いて効率的に処理を行うことができる。
 1 PCIカード
 2 ホストコンピュータ
 10 処理ユニット
 11 全体命令制御部
 12 メモリコントローラ
 13 メモリ
 14 PCI制御部
 50 情報処理装置
 100 積和演算部
 101 演算命令制御部
 102 演算命令バッファ
 103 マルチプレクサ
 111,111A~111C ベクタレジスタ
 112,112A~112C 積和演算器
 121,121A~121C 読出ライン変更回路
 122,122A~122C バイトシャッフル回路
 123,123A~123C 宛先バイト書込可否選択回路
 124,124A~124C 宛先ライン選択回路
 125 ルータ

Claims (6)

  1.  データ転送を所定数繰り返し行いサイズの異なる2つの記憶領域間で要素データを移動する演算処理装置であって、
     送信元の一方の記憶領域における前記要素データが格納された第1格納領域の情報及び前記繰り返しの回数を基に、送信先の他方の記憶領域における前記要素データの第2格納領域を決定する転送部と、
     前記第2格納領域の情報及び前記繰り返しの回数を基に、前記第1格納領域に格納された要素データを前記第2格納領域の所定位置へ格納する格納部と
     を備えたことを特徴とする演算処理装置。
  2.  送信元の一方の記憶領域における前記要素データが格納された第1格納領域の情報及び前記繰り返しの回数を基に、前記第1格納領域における前記要素データの第1格納位置を決定する第1決定部をさらに備え、
     前記格納部は、前記第2格納領域の情報及び前記繰り返しの回数を基に、前記第1格納領域の前記第1格納位置に格納された要素データを前記第2格納領域の前記所定位置へ格納する
     を備えたことを特徴とする請求項1に記載の演算処理装置。
  3.  前記2つの記憶領域は行方向にバンク単位で分割され列方向に複数の格納領域を含むライン単位で分割されるレジスタの一部であって、
     前記第1決定部は、前記一方の記憶領域における送信元のバンクの情報から送信元のラインを決定し、
     前記転送部は、前記他方の記憶領域における送信先のバンクの情報から前記送信元のバンクを決定し、決定した前記送信元のバンクの前記第1決定部により決定された前記送信元のラインから取得した前記要素データを含む読出データを前記送信先のバンクに送信し、
     前記格納部は、前記送信先のバンクの情報から送信元の格納領域及び送信先の格納領域を決定し、前記転送部から送信された前記読出データにおける前記送信先の格納領域から前記要素データを取得して、前記送信先のバンクの所定ラインにおける決定した前記送信先の格納領域に格納する
     ことを特徴とする請求項2に記載の演算処理装置。
  4.  前記第2格納領域の情報及び前記繰り返しの回数を基に、前記第2格納領域における前記要素データを格納する第2格納位置を決定する第2決定部をさらに備え、
     前記格納部は、前記第2格納領域の情報及び前記繰り返しの回数を基に、前記第1格納領域に格納された要素データを前記第2格納領域の前記第2格納位置における前記所定位置へ格納する
     ことを特徴とする請求項1に記載の演算処理装置。
  5.  前記2つの記憶領域は行方向にバンク単位で分割され列方向に複数の格納領域を含むライン単位で分割されるレジスタの一部であって、
     転送部は、前記他方の記憶領域における送信先のバンクの情報から送信元のバンクを決定し、決定した前記送信元のバンクの所定ラインから取得した読出データを前記送信先のバンクに送信し、
     前記第2決定部は、前記送信先のバンクから送信先のラインを決定し、
     前記格納部は、前記送信先のバンクの情報から送信元の格納領域及び送信先の格納領域を決定し、前記転送部から送信された前記読出データにおける前記送信先の格納領域から前記要素データを取得して、前記送信先のバンクの前記第2決定部により決定された前記送信先のラインにおける決定した前記送信先の格納領域に格納する、
     ことを特徴とする請求項4に記載の演算処理装置。
  6.  データ転送を所定数繰り返し行いサイズの異なる2つの記憶領域間で要素データを移動する演算処理装置の制御方法であって、
     送信元の一方の記憶領域における前記要素データが格納された第1格納領域の情報及び前記繰り返しの回数を基に、送信先の他方の記憶領域における前記要素データの第2格納領域を決定し、
     前記第2格納領域の情報及び前記繰り返しの回数を基に、前記第1格納領域に格納された要素データを前記第2格納領域の所定位置へ格納する
     ことを特徴とする演算処理装置の制御方法。
PCT/JP2018/039387 2018-10-23 2018-10-23 演算処理装置及び演算処理装置の制御方法 WO2020084694A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2018/039387 WO2020084694A1 (ja) 2018-10-23 2018-10-23 演算処理装置及び演算処理装置の制御方法
JP2020551750A JP7140201B2 (ja) 2018-10-23 2018-10-23 演算処理装置及び演算処理装置の制御方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/039387 WO2020084694A1 (ja) 2018-10-23 2018-10-23 演算処理装置及び演算処理装置の制御方法

Publications (1)

Publication Number Publication Date
WO2020084694A1 true WO2020084694A1 (ja) 2020-04-30

Family

ID=70331820

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/039387 WO2020084694A1 (ja) 2018-10-23 2018-10-23 演算処理装置及び演算処理装置の制御方法

Country Status (2)

Country Link
JP (1) JP7140201B2 (ja)
WO (1) WO2020084694A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05181963A (ja) * 1991-12-27 1993-07-23 Toshiba Corp 画像処理装置
JP2002149400A (ja) * 2000-11-08 2002-05-24 Hitachi Ltd 複数レジスタ指定が可能なsimd演算方式
JP2015219544A (ja) * 2014-05-14 2015-12-07 ソニー株式会社 データ処理装置、データ処理方法、プログラム、および記憶装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3212720B2 (ja) * 1992-11-10 2001-09-25 富士通株式会社 情報処理装置
JP5338937B2 (ja) * 2012-03-26 2013-11-13 富士通セミコンダクター株式会社 メモリ装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05181963A (ja) * 1991-12-27 1993-07-23 Toshiba Corp 画像処理装置
JP2002149400A (ja) * 2000-11-08 2002-05-24 Hitachi Ltd 複数レジスタ指定が可能なsimd演算方式
JP2015219544A (ja) * 2014-05-14 2015-12-07 ソニー株式会社 データ処理装置、データ処理方法、プログラム、および記憶装置

Also Published As

Publication number Publication date
JP7140201B2 (ja) 2022-09-21

Similar Documents

Publication Publication Date Title
EP3631622B1 (en) Tensor register files
EP3631623B1 (en) Tensor processor instruction set architecture
KR101202445B1 (ko) 프로세서
JP5500652B2 (ja) 並列比較選択演算装置、プロセッサ及び並列比較選択演算方法
WO2001035224A1 (en) Bit-serial memory access with wide processing elements for simd arrays
KR20220047797A (ko) 암호화 연산을 위한 코프로세서
US10884736B1 (en) Method and apparatus for a low energy programmable vector processing unit for neural networks backend processing
JP2007536628A (ja) Simdアレープロセッサ用のビットシリアル処理要素
US10810281B2 (en) Outer product multipler system and method
TWI780116B (zh) 用於資料處理設備、方法、電腦可讀式儲存媒體及虛擬機器的向量逐元素操作
JP2018022339A (ja) 演算処理装置及び演算処理装置の制御方法
US11907681B2 (en) Semiconductor device and method of controlling the semiconductor device
JP2024028901A (ja) ハードウェアにおけるスパース行列乗算
WO2020084694A1 (ja) 演算処理装置及び演算処理装置の制御方法
KR20200028965A (ko) 데이터 처리장치에서의 벡터 인터리빙
WO2007099950A1 (ja) 高速pe間データ再配置機能を有するプロセッサアレイシステム
JPWO2020084694A1 (ja) 演算処理装置及び演算処理装置の制御方法
KR20230078131A (ko) 반복 배열 ntt를 이용한 동형 암호 연산 장치 및 방법
JP2013517576A5 (ja)
JP2022074442A (ja) 演算装置および演算方法
JP3613466B2 (ja) データ演算処理装置及びデータ演算処理プログラム
JP7078129B2 (ja) 演算処理装置及び演算処理装置の制御方法
WO2024024755A1 (ja) 演算処理装置
CN111260069B (zh) 数据处理装置、方法、芯片及电子设备
US20220004363A1 (en) Semiconductor device, data generation methods used for the same, and method of controlling the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18937833

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020551750

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18937833

Country of ref document: EP

Kind code of ref document: A1