Control circuit, information processing method and program

The control circuit and method address inefficiencies in vector processors by generating and selecting multiple vector lengths for data elements, reducing the number of instructions required for packed operations and enhancing resource efficiency.

JP7533064B2Active Publication Date: 2024-08-14NEC CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2020158610
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-09-23
Publication Date
2024-08-14
Estimated Expiration
2040-09-23

AI Technical Summary

Technical Problem

Vector processors face inefficiencies due to the need for complex software processing when dividing data elements of varying lengths, leading to an increase in the number of instructions required, especially when fractions occur during division operations.

Method used

A control circuit and method that generate multiple vector lengths corresponding to different precisions for data elements, allowing for efficient selection and use of these lengths in vector calculations, reducing the need for additional instructions.

Benefits of technology

This approach suppresses the increase in the number of instructions needed for packed operations by enabling simultaneous setting of vector lengths for multiple precisions, optimizing resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007533064000002
    Figure 0007533064000002
  • Figure 0007533064000003
    Figure 0007533064000003
  • Figure 0007533064000004
    Figure 0007533064000004
Patent Text Reader

Abstract

To enable an increase in the number of instructions to be suppressed in performing a packed operation.SOLUTION: A control circuit includes: a vector length generation part for generating each vector length corresponding to a plurality of kinds of accuracy to a data element stored in a vector register; and a selector for vector operation for selecting a vector length to be used for a vector operation among the plurality of vector lengths generated by the vector length generation part.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a control circuit, an information processing method, and a program. [Background technology]

[0002] For example, the vector processor described in Patent Document 1 is capable of executing packed operations that combine multiple data elements and execute them with a single operation instruction as a method for efficiently using resources in single-precision and half-precision operations. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2013-140472 A Summary of the Invention [Problem to be solved by the invention]

[0004] Vector processors generally have only one type of register in which the vector length is stored, so in packed operations, packed-format data elements stored in the vector processor's vector registers must be treated as a single unit after division, just as they were before division. This is not a problem if the vector length after division is divisible by the division number, but if it is not divisible by the division number, that is, if a fraction is generated, processing must be performed that takes the fraction into account. As a result, software is required to perform complex processing to handle this fraction, and the number of instructions required for the desired processing increases.

[0005] SUMMARY OF THE PRESENT DISCLOSURE An object of the present invention is to provide a control circuit, an information processing method, and a program that solve the above-mentioned problems. [Means for solving the problem]

[0006] According to a first aspect of this embodiment, the control circuit includes a vector length generation unit that generates vector lengths corresponding to multiple types of precision for data elements stored in a vector register, and a vector operation selector that selects a vector length to be used for vector operation from the multiple vector lengths generated by the vector length generation unit.

[0007] According to a second aspect of this embodiment, in an information processing method of a processor, vector lengths corresponding to multiple types of precision are generated for data elements stored in a vector register provided in the processor, and a vector length to be used for vector calculation is selected from the multiple generated vector lengths.

[0008] According to a third aspect of this embodiment, the program causes a computer to generate vector lengths corresponding to multiple types of precision for data elements stored in a vector register, and to execute a process of selecting a vector length to be used in a vector operation from among the multiple generated vector lengths. Effect of the Invention

[0009] According to the present invention, it is possible to suppress an increase in the number of instructions when performing packed arithmetic. [Brief description of the drawings]

[0010] [Figure 1] FIG. 2 is a schematic configuration diagram of a control circuit according to the present embodiment. [Diagram 2] 11 is a flowchart of an operation when an LVL instruction that sets a vector length according to the present embodiment is executed. [Diagram 3] 11 is a flowchart of an operation when executing an SVL instruction to read a vector length according to the present embodiment. [Figure 4] 4 is a flowchart showing the operation of the control circuit A when performing vector calculation according to the present embodiment. [Diagram 5] FIG. 11 is a diagram illustrating a first process. [Figure 6]FIG. 11 is a diagram illustrating a second process. [Figure 7] FIG. 2 is a diagram showing the minimum configuration of a control circuit according to the embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] Hereinafter, a control circuit according to an embodiment will be described with reference to the drawings.

[0012] The control circuit A of this embodiment has a mechanism that can simultaneously set each vector length according to the precision of multiple data elements with one instruction in order to simplify software control of the vector length register in packed vector operations, and is a circuit that does not need to set or switch the vector length individually according to packed / non-packed instructions. The control circuit A is, for example, a vector processor. Here, the vector length is the number of data elements processed by one instruction in a vector operation instruction described later.

[0013] Here, precision means how precisely a data element can be expressed. For example, when one data element is expressed in 64 bits in non-packed format, in a 2-split packed format with a division number of 2 (described below), one data element is expressed in 32 bits, so the precision of the 2-split packed format is half that of the non-packed format. In this way, precision depends on the number of divisions. Note that the above precision is synonymous with the "precision" of double precision or single precision in floating-point numbers.

[0014] The configuration of the control circuit A according to this embodiment will be described below with reference to Fig. 1. Fig. 1 is a diagram showing an example of the configuration of the control circuit A according to this embodiment.

[0015] 1, the control circuit A includes an instruction decoder 1, a general-purpose register 2, a reservation station 3, an LVL·SVL instruction control circuit 4, a vector length register group 5, an SVL instruction selector 6, a vector operation signal sending unit 7, a vector operation selector 8, and a vector calculator 9. The vector length register group 5 includes a VL register 50-1, a VLP2 register 50-2, and a VLP4 register 50-3. The vector calculator 9 includes a vector length register 91, a vector register 92, and a calculator 93.

[0016] The instruction decoder 1 is a known instruction decoder and will not be described in detail here, but it decodes various instructions.

[0017] The general-purpose register 2 is a known general-purpose register and will not be described in detail here, but stores information such as the results of calculations by the control circuit A, for example.

[0018] The reservation station 3 is a known reservation station and therefore a detailed description thereof will be omitted, but for example, instructions decoded by the instruction decoder 1 and the like are stored therein.

[0019] The LVL·SVL instruction control circuit 4 includes a vector length generation unit 41 and an SVL instruction selector signal transmission unit 42 .

[0020] The LVL / SVL instruction control circuit 4 receives an instruction decoded by the instruction decoder 1 from the reservation station 3. For example, when the received instruction is a decoded LVL instruction, the LVL / SVL instruction control circuit 4 receives information including the decoded instruction and operands in the vector length generation unit 41. Here, the LVL instruction is an instruction that sets the vector length in the vector length register group 5 with a value specified in the general-purpose register 2.

[0021] The vector length generation unit 41 generates vector lengths corresponding to multiple types of precision for data elements stored in the vector register 92, using information including the decoded instruction and operands received from the reservation station 3. Note that, as an example for the sake of simplicity of explanation, the vector length generation unit 41 generates three types of vector lengths as vector lengths for each precision: a vector length corresponding to non-packed, a vector length corresponding to two-part packed, and a vector length corresponding to part packed. However, the vector length generation unit 41 only needs to generate multiple vector lengths, and the number of vector lengths is not particularly limited.

[0022] The vector length generation unit 41 sends the vector length corresponding to non-packed of the multiple vector lengths it generates to the VL register 50-1 for storage, sends the vector length corresponding to two-split packed to the VLP2 register 50-2 for storage, and sends the vector length corresponding to four-split packed to the VLP4 register 50-3 for storage.

[0023] In this way, the vector length register group 5 is provided with a plurality of registers 50 (VL register 50-1, VLP2 register 50-2, and VLP4 register 50-3) corresponding to each vector length generated by the vector length generation unit 41. A different vector length is written to each of the plurality of registers 50.

[0024] Furthermore, in the LVL / SVL instruction control circuit 4, when the received instruction is a decoded SVL instruction, information including the decoded instruction and operands is received by the SVL instruction selector signal sending unit 42. Then, the SVL instruction selector signal sending unit 42 sends a signal (hereinafter referred to as the "first control signal") for selecting the register 50 to be read from to the SVL instruction selector 6. Here, the SVL instruction is an instruction for reading the vector length from the vector length register group 5 and writing it back to the general-purpose register 2.

[0025] The SVL instruction selector 6 selects the register 50 to be read from among the VL register 50-1, the VLP2 register 50-2, and the VLP4 register 50-3 based on the first control signal. The vector length of the register 50 selected by the SVL instruction selector 6 is written back to the general-purpose register 2.

[0026] When the vector operation signal sending unit 7 receives the decoded vector operation instruction from the reservation station 3, it sends a second control signal to the vector operation selector 8. This second control signal is a signal for selecting one vector length from the multiple registers 50. The vector operation instruction is an instruction for actually executing a vector operation by referring to the vector length register 91.

[0027] The vector operation selector 8 selects a vector length to be used in the vector operation based on the second control signal from among the vector lengths stored in the vector length register group 5. The vector length selected by the vector operation selector 8 is written to a vector length register 91 in the vector calculator 9, and is used in the vector operation performed by the calculator 93 together with a vector register 92.

[0028] The vector register 92 stores a plurality of data elements (also called vector elements).

[0029] The flow of operations of the control circuit A when executing the LVL instruction for setting the vector length of this embodiment will be described below with reference to Fig. 2. Fig. 2 is a flowchart of operations when executing the LVL instruction for setting the vector length.

[0030] First, when the vector length generation unit 41 receives one instruction (LVL instruction) for setting a vector length, it generates vector lengths of each precision based on a vector length setting value, which is a preset setting value of the vector length. Specifically, the vector length generation unit 41 receives the decoded LVL instruction, the vector length setting value, and information on which precision of the data element the vector length setting value corresponds to from the reservation station 3 (step S101). The vector length generation unit 41 generates a vector length based on the information received from the reservation station 3, but the method of generating the vector length changes depending on the received information on the precision of the element.

[0031] As an example, if the vector length setting value received in step S101 is for non-packed (number of divisions is zero), and the vector length for non-packed is VL, the vector length for 2-division packed (number of divisions is 2) is VLP2, and the vector length for 4-division packed (number of divisions is 4) is VLP4, the vector length generation unit 41 generates the vector length for each precision based on the following formulas (1), (2), and (3) (step S103). For example, if the vector length setting value received in step S101 is "128", the vector length generation unit 41 sets VLP2 to "256" and VLP4 to "512".

[0032] VL = Vector length setting (1) VLP2 = Vector length setting × 2 (2) VLP4 = Vector length setting value × 4 (3)

[0033] If the vector length setting value received in step S101 is for two-part packed, the vector length generating unit 41 generates the vector length for each precision based on the following formulas (4), (5), and (6) (step S104). For example, if the vector length setting value is "255", VL is "128" and VLP4 is "510".

[0034] VL = (vector length setting value + 1) ÷ 2 (4) VLP2 = Vector length setting (5) VLP4 = Vector length setting × 2 (6)

[0035] If the vector length setting value received in step S101 is for 4-part packed, the vector length generating unit 41 generates the vector length for each precision based on the following formulas (7), (8), and (9) (step S105). For example, if the vector length setting value is "503", VL is "126" and VLP2 is "252".

[0036] VL = (vector length setting value + 3) ÷ 4 (7) VLP2 = (vector length setting value + 1)÷2 (8) VLP4 = Vector length setting (9)

[0037] Finally, the vector length generation unit 41 writes each generated vector length to a corresponding register 50 (either the VL register 50-1, the VLP2 register 50-2, or the VLP4 register 50-3) (step S106).

[0038] Next, the flow of operations of the control circuit A when executing the SVL instruction for reading the vector length in this embodiment will be described with reference to Fig. 3. Fig. 3 is a flowchart of operations when executing the SVL instruction for reading the vector length.

[0039] First, the SVL instruction selector signal sending unit 42 receives the decoded SVL instruction and information (information on accuracy) indicating which precision of the data element the vector length to be read corresponds to (step S201). The SVL instruction selector signal sending unit 42 sends a first control signal to the SVL instruction selector 6 to select the register 50 to be read based on the received information on accuracy (step S202). The SVL instruction selector 6 selects one of the multiple registers 50 as the register 50 specified by the first control signal from the SVL instruction selector signal sending unit 42, and reads and outputs the vector length written in the selected register 50 (step S203). The SVL instruction selector 6 writes back the last output vector length (read result) to the general-purpose register 2 (step S204).

[0040] Next, the flow of operations of the control circuit A when performing vector operations will be described with reference to Fig. 4. Fig. 4 is a flowchart of the operations of the control circuit A when performing vector operations.

[0041] First, the vector operation signal sending unit 7 receives the decoded vector operation instruction (instruction information) and the operand from the reservation station 3 (step S301). The vector operation signal sending unit 7 sends a second control signal to the vector operation selector 8 based on information on the precision of the data elements (information indicating a certain precision) among the instruction information received in step S301, and sends information other than the information on the precision of the data elements to the vector calculator 9 (S302). The vector operation selector 8 selects a vector length with the precision indicated by the second control signal from the vector lengths stored in the multiple registers 50, and stores the selected vector length in the vector length register 91 in the vector calculator 9 (step S303). The vector calculator 9 executes the vector operation in the calculator 93 using the vector length stored in the vector length register 91 (step S304).

[0042] Next, the effects of this embodiment will be described.

[0043] Unlike scalar operations, in which one piece of data is processed by one instruction, vector operations are optimized for vector operations, which process many pieces of data with one instruction. When using the packed format for vector registers consisting of multiple data elements, special processing may be required for setting the vector length.

[0044] For example, when a vector register with a 64-bit width per data element and a maximum vector length of 256 in the non-packed state is divided into two to perform a packed operation, the 64-bit data of each data element is divided into two halves, the first and second halves, but if there is only one type of register with the vector length, the two data of each data element must be treated as a single unit.In this case, if the net vector length in the 2-part packed state is an odd number, one of the following two processes (first process and second process) will be performed.

[0045] As the first process, as shown in FIG. 5, a vector operation of 255 elements of 64 bits per data element is performed up to the 255th data element, and the 256th data element is processed separately as a scalar operation of 32-bit data.

[0046] As the second process, as shown in FIG. 6, the unused bits 32 to 63 of the 256th data element are filled with "0" and then a vector operation of 256 elements is performed.

[0047] The above two processes have the drawback of increasing the complexity of the software processing and the number of instructions required for the desired processing.

[0048] To address this issue, it is possible to provide a register for the vector length corresponding to packed operations, so that even if data elements are divided, they can be treated as individual elements rather than as a single piece of data. However, if there is a mixture of instructions that are both compatible with packed and incompatible with packed, it would be necessary to issue an instruction to set the vector length according to the type of precision that is supported, and this would not solve the problem of an increase in the number of instructions required for processing.

[0049] On the one hand, since the control circuit A of this embodiment can set the vector lengths of multiple precisions at once with a single LVL instruction, there is no need to issue multiple LVL instructions even in a situation where Packed-compatible and non-compatible instructions are mixed, and the number of instructions can be reduced.

[0050] Also, in this embodiment, since instructions (such as the first control signal, the second control signal, the LVL instruction, the SVL instruction, and the vector operation instruction) are controlled by hardware, even if there is a range that is partially unused in the lower data elements in the vector register 92 as software, no special processing is actually performed on such data elements.

[0051] In the above-described embodiment, the number of divisions of the data elements for Packed operation has been set to 2 or 4. However, when the bit width of each data element is divisible by 2 N (N is a positive integer), any number of divisions may be adopted within that range. When a certain LVL instruction is instructed with a vector length setting value for the number of divisions = 2 N (where N is an integer of 0 or more, and when N = 0, it represents non-Packed), for the vector length VLPX of any precision, if the number of divisions is 2 M (M is an integer of 0 or more and M ≠ N), the vector length generation unit 41 may generate the vector length according to the following equations (10) and (11).

[0052] That is, assume that the setting value of the vector length is for the case where the number of divisions = 2 N . In this case, when the vector length generation unit 41 sets the vector length of any precision to VLPX, when obtaining VLPX with the vector length for the case where the number of divisions is 2 M as VLPX, when N > M, VLPX is obtained by equation (10), and when N < M, VLPX is obtained by equation (11) to generate the vector length of each precision.

[0053] VLPX = [vector length setting value + {(N - M) × 2 - 1}] ÷ {(N - M) × 2}…(10) VLPX = vector length setting value × (MN) × 2 … (11)

[0054] An embodiment of the minimum configuration of the control circuit A of the embodiment will be described with reference to FIG. 7. The control circuit A according to the present embodiment has a vector length generation unit 41 and a vector operation selector 8. The vector length generation unit 41 generates vector lengths corresponding to multiple types of precision for data elements stored in a vector register 92. The vector operation selector 8 selects a vector length to be used in a vector operation from the multiple vector lengths generated by the vector length generation unit 21. This makes it possible to suppress an increase in the number of instructions when performing a packed operation.

[0055] The control circuit A may be realized in whole or in part by a computer. In this case, the computer may include a processor such as a CPU or a GPU, and a computer-readable recording medium. The control circuit A may be realized by recording a program for realizing the functions of the control circuit A in whole or in part by a computer in the computer-readable recording medium, and reading and executing the program recorded in the recording medium into the processor. Here, the "computer-readable recording medium" refers to a portable medium such as a flexible disk, an optical magnetic disk, a ROM, a CD-ROM, and a storage device such as a hard disk built into a computer system. Furthermore, the "computer-readable recording medium" may also include a medium that dynamically holds a program for a short period of time, such as a communication line when a program is transmitted via a network such as the Internet or a communication line such as a telephone line, and a medium that holds a program for a certain period of time, such as a volatile memory inside a computer system that is a server or a client in that case. The program may be a program for realizing a part of the functions described above, or may be a program that can realize the functions described above in combination with a program already recorded in the computer system, or may be a program that is realized using a programmable logic device such as an FPGA.

[0056] The above program may also be transmitted from a computer system in which the program is stored in a storage device or the like to another computer system via a transmission medium, or by transmission waves in the transmission medium. Here, the "transmission medium" that transmits the program refers to a medium that has the function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line. The above program may also be for realizing part of the above-mentioned functions. Furthermore, it may be a so-called difference file (difference program) that can realize the above-mentioned functions in combination with a program already recorded in the computer system.

[0057] Throughout the specification, when a part is described as "comprising" or "having" a certain element, this does not mean that it excludes other elements, but that it may further include other elements, unless specifically stated to the contrary.

[0058] The term "unit" in the specification means a unit that processes at least one function or operation, which may be embodied as hardware or software, or a combination of hardware and software. [Explanation of symbols]

[0059] A…Control circuit 4...LVL / SVL command control circuit 6...SVL command selector 7...Vector calculation signal transmission section 8...Vector operation selector 9...Vector calculator 41...Vector length generator 50...Registers (VL register, VLP2 register, VLP4 register) 91...Vector length register 92...Vector register 92

Claims

1. a vector length generation unit that generates vector lengths corresponding to a plurality of types of precision for data elements stored in a vector register; a vector operation selector that selects a vector length to be used in a vector operation from among the plurality of vector lengths generated by the vector length generation unit; A control circuit comprising:

2. The method further includes a plurality of registers provided corresponding to each of the vector lengths, the vector length generation unit writes each of the generated vector lengths to a corresponding one of the registers; 2. The control circuit of claim 1.

3. a vector operation signal sending unit that sends a signal to the vector operation selector to select one vector length from the plurality of registers; the vector operation selector selects a vector length to be used in the vector operation from among the plurality of registers based on the signal; 3. The control circuit of claim 2.

4. When the vector length generation unit receives a command for setting a vector length, the vector length generation unit generates vector lengths of the respective precisions based on a vector length setting value that is a preset setting value of the vector length. A control circuit according to any one of claims 1 to 3.

5. The vector length setting value is set so that the number of divisions of the data element is 2. N (N is a positive integer), When a vector length of the arbitrary precision is VLPX, the vector length generation unit determines that the number of divisions is 2 M 5. The control circuit according to claim 4, wherein the vector length for each precision is calculated as the VLPX when M is an integer equal to or greater than 0 and M≠N, and when N>M, the VLPX is calculated using equation (a), and when N<M, the VLPX is calculated using equation (b), thereby generating the vector length for each precision. VLPX = [vector length setting value + {(N - M) x 2 - 1}] ÷ {(N - M) x 2} ... (a) VLPX = vector length setting value × (M-N) × 2 ... (b)

6. A method for processing information by a processor, comprising: generating vector lengths corresponding to a plurality of types of precision for data elements stored in a vector register provided in the processor, and selecting a vector length to be used in a vector operation from among the plurality of generated vector lengths; Information processing methods.

7. On the computer, generating vector lengths corresponding to a plurality of types of precision for data elements stored in a vector register, and selecting a vector length to be used in a vector operation from among the plurality of vector lengths thus generated; program.

Citation Information

Patent Citations

  • Control system of vector processor

    JP1984071577A

  • Vector processor

    JP1991127171A

  • Vector processor

    JP2013140472A