The present invention relates to a register designating system and an in-register data alignment processing in an SIMD (Single Instruction Multiple Data) processor, and relates to means for executing in-register data alignment without deteriorating a parallel processing function of SIMD at high speed.
Further, the present invention relates to means for operating standard multiply accumulate operation as a DSP (Digital Signal Processing) instruction while maintaining parallelism of SIMD without deteriorating accuracy.
Japanese Patent Laid-Open No. 124484 has disclosed a method of executing vector operation such that a plurality of consecutive registers can be designated by a single register designating field, when a vector operation processing, which is necessary in three-dimensional graphics or the like, is executed.
Further, as an in-resister data alignment instruction, various data alignment instructions, which can designate up to four operands, are described in “AltiVec Programming Interface Manual” of an instruction set Altivec for multimedia developed by Motorola Corporation.
Further, with regard to multiply accumulate operations, a multiply accumulate instruction, without deteriorating accuracy, is realized in the form of halving reduced parallelism of SIMD from 4 parallel to 2 parallel by an SH5 architecture developed jointly by Hitachi, Ltd. and ST Microelectronics.
According to the vector operation processing disclosed in Japanese Patent Laid-Open No. 124484, a constitution capable of designating only a multiple of 4 registers and therefore, which is devoid of freedom. Further, according to the data alignment instruction of Altivec, not only an operating apparatus is large-sized and expensive, but also only three source registers can be designated, and operation particular to SIMD such as data pack or unpack cannot be executed efficiently. Therefore, the parallelism of SIMD cannot fully be achieved.
It is a principal object of the invention to provide means with regard to data alignment for maximizing an effect of SIMD instruction.
Further, it is another object of the invention to provide a means for realizing a standard multiply accumulate operation instruction as a DSP instruction without deteriorating parallelism of SIMD and while maintaining accuracy thereof.
A simple explanation will be given of an outline of representative aspects of the invention disclosed in the application as follows.
According to an aspect of the invention, a processor includes an operation instruction comprising an instruction code and at least one register designating field, wherein the at least one register designating field designates a plurality of registers having consecutive numbers.
Further, according to another aspect of the invention, a processor comprises a decoder designating a plurality of read registers in one field in an arbitrary number of register designating fields; and a register file for outputting data in a plurality of registers having consecutive numbers in accordance with an output from the decoder.
Further, according to another aspect of the invention, a processor comprises a decoder for designating a plurality of write registers in one field in an arbitrary number of register designating fields; and a register file capable of writing values in a plurality of registers having consecutive numbers in accordance with an output from the decoder.
The register file includes a plurality of banks, and by reading or writing data from the plurality of banks, the number of ports of reading or writing the data of the respective banks is restricted to be equal to or smaller than the number of the register designating fields, to thereby restrain an increase in a circuit scale caused by reading or writing the data by a number of times larger than the number of the fields.
The number of the plurality of registers having the consecutive number is limited to the n-th power of 2 (n is a natural number), to thereby enable to reduce register selecting circuits.
Further, a data pack operation, which is capable of dealing with a number of the data read from the read registers larger than a number of the data written to the write registers in order to read data from the registers larger in a number than the number of the read register designating fields, is realized without producing invalid portions in the write registers.
Further, a data unpack operation, which is capable of dealing with a number of the data written to the write registers larger than a number of the data read from the read registers such that the data can be written to the registers larger in a number than the number of the write register designating fields, is realized in parallel without executing data writing a plurality of times.
Further, an operation of outputting the data having a data width wider than a width of input data such that the data can be written to the registers larger in a number than the number of the write register designating fields, is realized without producing an invalid portion in the input data and without mounting a special register having a wider data width.
Further, in order to supply the data respectively to pipes necessitating the data equal to or larger than the number of the register designative fields such as pipes for executing data alignment, a plurality of data buses are provided between registers and operation pipes in addition to a general purpose bus.
Further, a plurality of data buses are provided for writing data to registers between registers and operation pipes are provided for outputting a plurality of results such as a data unpack instruction, a permutation instruction, a matrix operational instruction, a multiply accumulate operation instruction and so on.
A detailed explanation will be given for the embodiments of the invention in reference to the drawings as follows. Further, in all of the drawings for explaining the embodiments, portions having the same functions are attached with the same notations, and repeated explanation thereof will be omitted.
The SIMD processor shown in
According to
A register number of any of R0 through R63 is designated to a portion m, which is one of register designating fields of an instruction code 201, and the code is decoded by a decoder 202 to provide direct access to respective registers.
The decoder 202 is constituted by a logic circuit satisfying a truth table shown in
Also the selector 204 is similarly supplied with data from respective banks. Lower 2 bits of the operand code m, that is the same as that of the selector 205, are used as a control signal for outputting remaining data excluding the data to be outputted to the general purpose bus.
The outputs from the selectors 204 and 205 are exclusive to each other for a respective bank, and the selectors 204 and 205 are constituted by a logic circuit satisfying the truth table shown in
With regard to the respective bank,
In
As shown by
The selector 208 has 3 inputs and 4 outputs and is constituted by a logic circuit satisfying a truth table shown in
Notations a and b in
A control signal inputted to the selector 208 uses lower 2 bits of a code indicated by a destination register designating field (operand code d). Further, data outputted to the general purpose bus 207 is inputted to a selector 209, and is selected and outputted to a bank with a register to be stored.
The selector 209 uses the lower 2 bits of the code (operand code d) indicated by the destination register designating field similarly to the selector 208, and is constituted by a logic circuit satisfying a truth table shown in
Notations a and b in
Outputs from the selector 208 and the selector 209 are exclusive to each other for respective bank. When an output of one of the selectors is data, an output from the other one of the selectors becomes 0. Therefore, the outputs from the selectors 208 and 209 are written to registers in the banks by calculating logical sums for respective banks.
The above-described explanation described the SIMD processor capable of designating a plurality of registers.
Next, an explanation will be given of SIMD operation instructions defined by utilizing the characteristic of the SIMD processor.
Generally, according to the SIMD processor, when data in registers are aligned in orders capable of immediately operating the data, maximum parallelism is achieved; however, in many cases, it is necessary to permute the data and thereafter execute a principal operation. Therefore, a reduction in a number of permutation cycles to as less as possible promotes the function of the SIMD processor.
A data pack instruction as shown by
As is known from an explanation of operation in
A circuit constitution for realizing the instruction is as shown by
Four pieces of in-register data designated by a register designating field 1 (operand code m) are transmitted to the general purpose bus 206 and buses 307. Further, a shift amount indicated by a register designating field 2 (operand code n) is taken from a general purpose bus 301. The data and the shift amount are respectively inputted to a barrel shifter 302 for shifting with arbitrary bits. A division of a fixed-point is carried out by the barrel shifter 302.
It is possible that only lower 16 bits of the shifted results are respectively taken out, outputted to the general purpose bus 207, and packed to a single register as 64 bits width data.
Next, a data unpack instruction as shown by
A detailed explanation will be given of a circuit constitution for realizing the instruction in reference to
In-register SIMD data designated by the register designative field 1 (operand code m) is transmitted via the general purpose bus 206.
Further, a permutation instruction as shown by
Generally, “permutation instruction” is effective in transposition or rotation of a matrix, butterfly operation of FFT (fast Fourier transform) or the like. A specific operation is shown in
According to a conventional permutation instruction, when permutation operation is carried out with regard to, for example, two pieces of SIMD data of 16 bit×4 pieces, two pieces of 64 bit width registers for storing result are needed. However, only one piece of a destination register can be designated such that separate instructions are prepared for an upper bit portion and a lower bit portion of the permutation result.
According to the permutation instruction by designating a plurality of registers in one piece of register designating field, with regard to four pieces of source data as shown in
Further, in the case of complex number data, real numbers and imaginary numbers are frequently present alternately in loaded data. It is frequently necessary to constitute data rows of only real number data and only imaginary number data in operation.
In that case, according to the SIMD processor of the invention, 8 pieces of SIMD data can simultaneously be read at maximum and therefore, in the case of 16 bit data, a result of 16 data can be calculated at one time by executing permutation operation among 32 pieces of data.
In order to execute a processing of dealing with complex number data as described above, instructions as shown by
Specifically, a processing as shown by
An explanation is given to details of operation by a circuit constitution diagram of
Finally, multiply accumulate operation instruction as shown by
In
In general multiplication, a result obtained for bit widths of a multiplier and a multiplicand is provided with a doubled bit width and therefore, according to SIMD type 64 bit data holding four pieces of data of 16 bit width, a register having 128 bit width is needed to store operation results. As a real solution, there is frequently adopted a method of storing data effective only in lower 32 bits of 64 bits width register and storing the result to 64 bits by sacrificing a parallelism of SIMD. However, when the accumulation is calculated, it is to further increase the bit width of the result. Even by the above-described method, operation accuracy is deteriorated.
In DSP (Digital Signal Processor), in the case of multiply accumulate operation of 16 bits×16 bits, accuracy of operation is devised to be maintained by preparing 40 bit registers for storing.
However, when utilizing the characteristic of the invention, multiply accumulate operation can be executed without deteriorating the parallelism of SIMD.
SIMD data including four pieces of 16 bit data is transmitted via the general purpose bus 206 and the buses 307. The SIMD data is divided into for each 16 bit data, respectively inputted to multipliers 700 through 703, and outputted to adders 704 through 707. Data of accumulation is transmitted via the general purpose bus 301 and buses 501 and is inputted to the adders 704 through 707. Results of the accumulation calculation are outputted to the general purpose bus 207 and the buses 210 for storing. By using such means, the multiply accumulate operation of SIMD data is realized without deteriorating accuracy, and the parallelism is maintained.
Although a specific explanation has been given of the invention based on the embodiments, the invention is not limited thereto but can be modified within a range not deviated from the gist.
For example, although the selector 204 in
In the case of the data pack instruction, in
Further, in the case of the data unpack instruction, a number of division is determined by a type of SIMD data in registers and therefore, the number is not limited to four as in
A simple explanation will be given of effects achieved by representative aspects of the invention as follows.
According to the SIMD processor of the invention, high speed formation of in-register data alignment operation, which may otherwise obstruct an effect of SIMD operation, is realized, and a multiply accumulate operation as in DSP can be realized.
Specific effects are enumerated as follows.
(1) By introducing the data pack instruction defined by the invention, scatteredly stored data is summarized and data can be processed efficiently by the SIMD instruction.
Annotation “pack. W” in
(2) By introducing the data unpack instruction defined by the invention, prompt initialization of registers and division of data are carried out, and even at a portion in which the SIMD processing is not effective, operation efficiency is not deteriorated.
(3) By introducing a permutation instruction defined by the invention, permutation of in-register SIMD data is executed at high speed, and data is supplied to SIMD processing such as a multiple accumulate operation, without delay.
Number | Date | Country | Kind |
---|---|---|---|
2000-340239 | Nov 2000 | JP | national |
Number | Name | Date | Kind |
---|---|---|---|
5390307 | Yoshida | Feb 1995 | A |
6038582 | Arakawa et al. | Mar 2000 | A |
6463525 | Prabhu | Oct 2002 | B1 |
Number | Date | Country |
---|---|---|
03-260727 | Mar 1990 | JP |
07-200542 | Dec 1993 | JP |
07-152535 | Aug 1994 | JP |
10-124484 | Oct 1996 | JP |
WO 9617291 | Dec 1995 | WO |
Number | Date | Country | |
---|---|---|---|
20020026570 A1 | Feb 2002 | US |