Digital signal processors (DSPs) may be used for a variety of multimedia applications such as digital video, imaging, and audio. DSPs can manipulate the digital signals to create and open such multimedia files.
DSPs may operate as SIMD (Single Instruction/Multiple Data), or data parallel, processors. In SIMD operations, a single instruction is sent to a number of processing elements, which perform the same operation on different data. A central controller may be used to broadcast the instruction stream to the different processing elements. SIMD instructions provide for several types of standard operations including addition, subtraction, multiplication, multiply-accumulate (MAC), and a number of special instructions for L1-Norm-accumulate (SAA), clipping, and bilinear interpolation.
Many video and image processing devices operate on 8 bit words arranged in a two dimensional (2D) data array. Four 8 bit operands may be packed into a 32 bit grouped word to be sent to the execution units for parallel processing. These 8 bit operands from the 2D array must be properly aligned in the 32 bit grouped word for proper operation.
When working with 8 bit data on a 32 bit word aligned machine, four different alignment possibilities may exist: aligned; shifted 8 bits; shifted 16 bits; and shifted 24 bits. If the DSP detects a misaligned word, it may generate an exception. In response to the exception, an alignment operation may be performed at the memory interface or in data registers to shift the 8 bit operands to produced an aligned 32 bit word. However, this alignment operation may introduces additional processing overhead into the operation of the machine.
Alignment overhead for 8 bit SIMD operations may result in inefficient utilization of resources within a general purpose DSP. Often this inefficiency will manifest itself as unnecessary cycle consumption due to alignment operations applied to prepare the data for processing.
A register file architecture in a general purpose digital signal processor (DSP) supports alignment independent SIMD (Single Instruction/Multiple Data) operations. The register file architecture includes a register pair and an alignment multiplexer. Two 32 bit grouped words may be loaded into the register pair. Each grouped word includes four 8 bit operands. The alignment state of the 32 bit words may be determined by the two least significant bits (LSBs) of the pointer addresses of the grouped words. These LSBs are used to control the alignment MUX to select n operands from the two 32 bit grouped words and output an aligned 32 bit grouped word to execution units for parallel processing.
Like reference symbols in the various drawings indicate like elements.
The register file is primed for an alignment operation by loading two 32 bit grouped words, k and k+1 from the data array into each of one of the data registers in the register pair, R0 and R1, respectively. Each 8 bit operand occupies one of four memory locations in the register, RxLL, RxLH, RxHL, and RxHH.
The two least significant bits (LSB) 202 of the pointer addresses are masked off by the control unit and used to determine the state of alignment for the 32 bit grouped word. These LSBs 202 are used as control signals to control the alignment MUX 110 to select the four 8 bit operands from the eight memory locations in the register pair that correspond to an aligned 32 bit word 204. The aligned 32 bit word 202 may be output as an operand (OPA or OPB) for parallel processing of its component 8 bit operands by the execution units.
As shown in
As shown in
As shown in
As shown in
In the next cycle (cycle 3), R1 is loaded with 32 bit word k+3, LMNO, 316. The alignment MUX 110 is controlled to select bytes I, J, K, and L in state 318 and output 32 bit word IJKL 320 in state 322. In cycle 3, the alignment MUX 110 forward multiplexes registers R0 and R1. Thus, the 32 bit loads are “ping-ponged” between the two registers R0 and R1 in the pair each even/odd cycle while processing the packed 8 bit array.
As illustrated in the operation shown in
Loading a data register with a misaligned 32 bit word in a general purpose DSP may cause the generation of an exception. Eight bit SIMD operations may require as many as sixteen 8 bit operands to be available to the execution units. This corresponds to two register pairs, i.e., four registers. With two 32 bit busses available for loading the register pairs, the four registers must loaded prior to initiating the SIMD operation. According to an embodiment, a special instruction, e.g., DISALGENEX, may be used while priming the function to disable the generation of exceptions due to misaligned access while priming the 8 bit SIMD function loops. The DISALGENEX instruction may be issued in combination with one or two load operations which may or may not cross 32 bit boundaries. Some instruction examples include:
An instruction which support this type of alignment may have the form:
An alignment independent 8 bit SIMD ADD operation may be performed according to an embodiment. Quad 8 bit SIMD instructions are used to perform two byte additions with four 16 bit signed data outputs. Thirty-two bit load OPA includes four 8 bit operands am+3, am+2, am+1, and am. Thirty-two bit load OPB includes four 8 bit operands bm+3, bm+2, bm+1, and bm. The two 32 bit grouped words used to determine OPA may be loaded on register pair R0/R1, and the 32 bit grouped words used to determine OPB may be loaded on register pair R2/R3. The corresponding 8 bit operands of OPA and OPB are added. The results of the addition operation are four 16 bit values, am+3+bm+3, am+2+bm+2, am+1+bm+1, and am+bm, that may be grouped into 32 bit words and stored in two destination registers selected from R4, R5, R6, and R7.
The instructions for performing the alignment independent 8 bit SIMD ADD operation may have the form:
Example instructions include:
These instructions assume that the loads are always on the 32 bit boundary and that the two pointers are stored in I0 and I1. These values are valid for 8 bit boundaries, however loads actually occur on 32 bit boundaries. The two LSBs from the pointers i0 and i1, are decoded to select one of the four possible alignment cases from register pairs R0/R1 and R2/R3, respectively. The register containing word k+1 is considered to be in registers R0 and R2 in the default, and the word k+2 is considered to be in registers R1 and R3.
The “R” option specifies that the reflection of the read out should be performed, as described above in connection with
The above-described alignment independent SIMD ADD operation may be used to support a number of image based calculations. Other alignment independent SIMD operations may be performed according to various embodiments, including, for example, subtraction, multiplication, multiply-accumulate (MAC) and a number of special instructions for L1-Norm-accumulate (SAA), clipping, and bilinear interpolation.
Depending on the desired SIMD operation, different methods of alignment may be used for 32 bit grouped words. The 8 bit case has been described above, with four different alignment cases. Sixteen bit data may also grouped into 32 bit loads. Such loads will have two alignment cases, aligned and misaligned, in which the 16 bit operands are shifted by 16 bits. The two LSBs of the pointer address for the load may be used to determine the alignment case, for example, “00” for the aligned case, and “01” for the misaligned case. Another case may be generalized for SIMD operations which operate on mixed data types, for example, 32 bit grouped words containing mixed 8 bit and 16 bit operands.
A register file architecture according to an embodiment may provide higher throughput for a variety of video and imaging algorithms by eliminated the need to pre-process data for the various alignment operations. This may reduce code size by eliminating similar routines in the code intended to handle the different alignment situations and also improve cycle count by eliminating the need for detecting the alignment state and subsequent branching to the appropriate sequence of instructions. Thus, the register file architecture may provide for alignment of data on 8 bit boundaries within the execution units without burdening the memory interface, which may be reserved for 32 bit load/store operations.
The embodiments described above which support alignment independent SIMD operations are particularly well suited to operations intended to support video and image based processing. These include, for example, 8 bit quad interpolation for half X, half Y, and half XY, fractional motion search operations, and motion compensation.
A general purpose DSP including a register file architecture according to the various embodiments may be well suited for use in video processing imaging equipment which utilize MPEG-1/MPEG-2/MPEG-4/H.263 future standards for video compression.
Such a general purpose DSP is contemplated for use in video camcorders, digital cameras, teleconferencing, PC video cards, and HDTV. As shown in
A number of embodiments of the invention have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. Accordingly, other embodiments are within the scope of the following claims.
Number | Name | Date | Kind |
---|---|---|---|
4972260 | Fujikawa et al. | Nov 1990 | A |
5128759 | Matsunaga | Jul 1992 | A |
5179671 | Kelly et al. | Jan 1993 | A |
5307321 | Sasai et al. | Apr 1994 | A |
5309527 | Ohki | May 1994 | A |
5544251 | Coelho | Aug 1996 | A |
5566250 | Coelho | Oct 1996 | A |
5724275 | Chung | Mar 1998 | A |
5771368 | Cmelik et al. | Jun 1998 | A |
5922066 | Cho et al. | Jul 1999 | A |
5933650 | van Hook et al. | Aug 1999 | A |
5951677 | Wolf et al. | Sep 1999 | A |
5996057 | Scales et al. | Nov 1999 | A |
Number | Date | Country |
---|---|---|
0 268 140 | May 1988 | EP |
0 524 792 | Jan 1993 | EP |
0 552 005 | Jul 1993 | EP |
602886 | Jun 1994 | EP |
04-021128 | Jan 1992 | JP |
06-131248 | May 1994 | JP |
07-013762 | Jan 1995 | JP |
11-312085 | Nov 1999 | JP |