WO1997033222A1 - Apparatus for performing packed shift operations - Google Patents

Apparatus for performing packed shift operations Download PDF

Info

Publication number
WO1997033222A1
WO1997033222A1 PCT/US1997/003522 US9703522W WO9733222A1 WO 1997033222 A1 WO1997033222 A1 WO 1997033222A1 US 9703522 W US9703522 W US 9703522W WO 9733222 A1 WO9733222 A1 WO 9733222A1
Authority
WO
WIPO (PCT)
Prior art keywords
bits
bus
bit
shift
data
Prior art date
Application number
PCT/US1997/003522
Other languages
French (fr)
Inventor
Derrick Chu Lin
Punit Minocha
Alexander D. Peleg
Yaakov Yaari
Millind Mittal
Larry M. Mennemeier
Benny Eitan
Original Assignee
Intel Corporation
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 Intel Corporation filed Critical Intel Corporation
Priority to AU19885/97A priority Critical patent/AU1988597A/en
Publication of WO1997033222A1 publication Critical patent/WO1997033222A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/76Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
    • G06F7/762Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data having at least two separately controlled rearrangement levels, e.g. multistage interconnection networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/01Methods or arrangements for data conversion without changing the order or content of the data handled for shifting, e.g. justifying, scaling, normalising
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/76Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
    • 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/30025Format conversion instructions, e.g. Floating-Point to Integer, decimal conversion
    • 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
    • G06F9/3013Organisation of register space, e.g. banked or distributed register file according to data content, e.g. floating-point registers, address registers
    • 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/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/3016Decoding the operand specifier, e.g. specifier format
    • G06F9/30167Decoding the operand specifier, e.g. specifier format of immediate specifier, e.g. constants
    • 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/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3885Concurrent instruction execution, e.g. pipeline, look ahead using a plurality of independent parallel functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/499Denomination or exception handling, e.g. rounding or overflow
    • G06F7/49994Sign extension

Definitions

  • the present invention describes an apparatus for performing arithmetic operations using a single control signal to manipulate multiple data elements.
  • the present invention allows execution of shift operations on packed data types.
  • CISC Complex Instruction Set Computer
  • a processor having a thirty-two bit data bus and registers, and executing one of these algorithms can waste up to seventy-five percent of its data processing, carrying and storage capacity because only the first eight bits of data are important.
  • a processor that increases performance by more efficiently using the difference between the number of bits required to represent the data to be manipulated and the actual data carrying and storage capacity of the processor.
  • An apparatus for performing a packed shift operation on a packed data having a multiple values having a first bus which has bits that represent a shifted packed intermediate result and a second bus which has bits each representing a replacement bit for one of the multiple values.
  • the apparatus including a correction circuit having a third bus having multiple bits.
  • the apparatus further including multiple muxes, each of the multiple muxes having a first input, a second input, a select input and an ou ⁇ ut. Each of the first inputs are coupled to one of the bits of the first bus.
  • Each of the second inputs are coupled to one of the bits of the second bus.
  • Each of said select inputs are coupled to a corresponding one of the third bus.
  • Figure 1 illustrates an embodiment of the computer system using the apparatus of the present invention.
  • FIG. 2 illustrates an embodiment of the processor of the present invention.
  • Figure 3 is a flow diagram illustrating the general steps used by the processor to manipulate data in the register file.
  • Figure 4a illustrates memory data types.
  • Figure 4b, Figure 4c and Figure 4d illustrate in-register integer data representations.
  • Figure 5a illustrates packed data-types.
  • Figure 5b, Figure 5c and Figure 5d illustrate in-register packed data representations.
  • Figure 6a illustrates a control signal format used in the computer system to indicate the use of packed data.
  • Figure 6b illustrates a second control signal format that can be used in the computer system to indicate the use of packed data.
  • Figure 7 illustrates one embodiment of a method followed by a processor when performing a shift operation on packed data.
  • Figure 8 illustrates one embodiment of a Packed Shift circuit.
  • Figure 9 illustrates another embodiment of a Packed Shift circuit.
  • Figure 10 illustrates an embodiment of a portion of the logic to identify which bits of the barrel shifted result should be corrected (Fixshift).
  • Figure 11 illustrates an embodiment of a barrel shifter.
  • Figure 12 illustrates an embodiment of a mux for a barrel shifter.
  • Figure 13 illustrates another embodiment of a method of performing a packed shift operation.
  • Bit X through Bit Y defines a subfield of binary number. For example, bit six through bit zero of the byte 0011 10102 (shown in base two) represent the subfield 1 1 10102- The '2' following a binary number indicates base 2. Therefore, 10002 equals 8 ⁇ o> while Fi equals 15 ⁇ o.
  • R x is a register.
  • a register is any device capable of storing and providing data. Further functionality of a register is described below. A register is not necessarily part of the processor's package.
  • DEST is a data address
  • SRC1 is a data address
  • SRC2 is a data address.
  • Result is the data to be stored in the register addressed by
  • Sourcel is the data stored in the register addressed by SRC1.
  • Source2 is the data stored in the register addressed by SRC2.
  • Computer system 100 comprises a bus 101, or other communications hardware and software, for communicating information, and a processor 109 coupled with bus 101 for processing information.
  • Computer system 100 further comprises a random access memory (RAM) or other dynamic storage device (referred to as main memory 104), coupled to bus 101 for storing information and instructions to be executed by processor 109.
  • Main memory 104 also may be used for storing temporary variables or other intermediate information during execution of instructions by processor 109.
  • Computer system 100 also comprises a read only memory (ROM) 106, and/or other static storage device, coupled to bus 101 for storing static infoimation and instructions for processor 109.
  • Data storage device 107 is coupled to bus 101 for storing information and instructions.
  • Memory includes any data storage medium, such as main memory 104, cache memory, registers, ROM, and other static storage devices.
  • a data storage device 107 such as a magnetic disk or optical disk, and its corresponding disk drive, can be coupled to computer system 100.
  • Computer system 100 can also be coupled via bus 101 to a display device 121 for displaying information to a computer user.
  • Display device 121 can include a frame buffer, specialized graphics rendering devices, a cathode ray tube (CRT), and/or a flat panel display.
  • An alphanumeric input device 122 is typically coupled to bus 101 for communicating information and command selections to processor 109.
  • cursor control 123 such as a mouse, a trackball, a pen, a touch screen, or cursor direction keys for communicating direction information and command selections to processor 109, and for controlling cursor movement on display device 121.
  • This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), which allows the device to specify positions in a plane.
  • this invention should not be limited to input devices with only two degrees of freedom.
  • a hard copy device 124 which may be used for printing instructions, data, or other information on a medium such as paper, film, or similar types of media.
  • computer system 100 can be coupled to a device for sound recording, and/or playback 125, such as an audio digitizer coupled to a microphone for recording information. Further, the device may include a speaker which is coupled to a digital to analog (D/A) converter for playing back the digitized sounds.
  • computer system 100 can be a terminal in a computer network (e.g., a LAN). Computer system 100 would then be a computer subsystem of a computer system including a number of networked devices.
  • Computer system 100 optionally includes video digitizing device 126. Video digitizing device 126 can be used to capture video images that can be transmitted to others on the computer network.
  • Computer system 100 is useful for supporting computer supported cooperation (CSC - the integration of teleconferencing with mixed media data manipulation), 2D/3D graphics, image processing, video compression/decompression, recognition algorithms and audio manipulation.
  • CSC computer supported cooperation
  • 2D/3D graphics image processing
  • video compression/decompression recognition algorithms
  • audio manipulation
  • FIG. 2 illustrates a detailed diagram of processor 109.
  • Processor 109 can be implemented on one or more substrates using any of a number of process technologies, such as, BiCMOS, CMOS, and NMOS.
  • Processor 109 comprises a decoder 202 for decoding control signals and data used by processor 109. Data can then be stored in register file 204 via internal bus 205.
  • the registers of an embodiment should not be limited in meaning to a particular type of circuit. Rather, a register of an embodiment need only be capable of storing and providing data, and performing the functions described herein.
  • integer registers 201 may be stored in integer registers 201, registers 209, status registers 208, or instruction pointer register 21 1.
  • Other registers can be included in the register file 204, for example, floating point registers.
  • integer registers 201 store thirty-two bit integer data.
  • registers 209 contains eight registers, Ro 212a through R7 212h. Each register in registers 209 is sixty-four bits in length.
  • Ri 212a, R2 212b and R3 212c are examples of individual registers in registers 209. Thirty-two bits of a register in registers 209 can be moved into an integer register in integer registers 201. Similarly, an value in an integer register can be moved into thirty- two bits of a register in registers 209.
  • Status registers 208 indicate the status of processor 109.
  • Instruction pointer register 211 stores the address of the next instruction to be executed. Integer registers 201, registers 209, status registers 208, and instruction pointer register 211 all connect to internal bus 205. Any additional registers would also connect to the internal bus 205.
  • registers 209 and integer registers 201 can be combined where each register can store either integer data or packed data.
  • registers 209 can be used as floating point registers.
  • packed data can be stored in registers 209 or floating point data.
  • the combined registers are sixty-four bits in length and integers are represented as sixty-four bits. In this embodiment, in storing packed data and integer data, the registers do not need to differentiate between the two data types.
  • Functional unit 203 performs the operations carried out by processor 109. Such operations may include shifts, addition, subtraction and multiplication, etc.
  • Functional unit 203 connects to internal bus 205.
  • Cache 206 is an optional element of processor 109 and can be used to cache data and/or control signals from, for example, main memory 104.
  • Cache 206 is connected to decoder 202, and is connected to receive control signal 207.
  • Figure 3 illustrates the general operation of processor 109. That is, Figure 3 illustrates the steps followed by processor 109 while performing an operation on packed data, performing an operation on unpacked data, or performing some other operation. For example, such operations include a load operation to load a register in register file 204 with data from cache 206, main memory 104, read only memory (ROM) 106, or data storage device 107.
  • processor 109 supports most of the instructions supported by the Intel 80486TM, available from Intel Corporation of Santa Clara, California. In another embodiment of the present invention, processor 109 supports all the operations supported by the Intel 80486TM, available from Intel Co ⁇ oration of Santa Clara, California.
  • processor 109 supports all the operations supported by the PentiumTM processor, the Intel 80486TM processor, the 80386TM processor, the Intel 80286TM processor, and the Intel 8086TM processor, all available from Intel Co ⁇ oration of Santa Clara, California.
  • processor 109 supports all the operations supported in the IATM - Intel Architecture, as defined by Intel Co ⁇ oration of Santa Clara, California (see Microprocessors. Intel Data Books volume 1 and volume 2, 1992 and 1993, available from Intel of Santa Clara, California).
  • processor 109 can support the present instruction set for the PentiumTM processor, but can also be modified to inco ⁇ orate future instructions, as well as those described herein.
  • the decoder 202 receives a control signal 207 from either the cache 206 or bus 101. Decoder 202 decodes the control signal to determine the operations to be performed.
  • Decoder 202 accesses the register file 204, or a location in another memory, at step 302. Registers in the register file 204, or memory locations in another memory, are accessed depending on the register address specified in the control signal 207.
  • control signal 207 can include SRCl, SRC2 and DEST register addresses.
  • SRCl is the address of the first source register.
  • SRC2 is the address of the second source register. In some cases, the SRC2 address is optional as not all operations require two source addresses. If the SRC2 address is not required for an operation, then only the SRCl address is used.
  • DEST is the address of the destination register where the result data is stored. In one embodiment, SRCl or SRC2 is also used as DEST.
  • SRCl, SRC2 and DEST are described more fully in relation to Figure 6a and Figure 6b.
  • the data stored in the corresponding registers is referred to as Source 1 , Source2, and Result respectively. Each of these data is sixty-four bits in length.
  • any one, or all, of SRCl, SRC2 and DEST can define a memory location in the addressable memory space of processor 109.
  • SRCl may identify a memory location in main memory 104 while SRC2 identifies a first register in integer registers 201 , and
  • DEST identifies a second register in registers 209.
  • references are made to the accesses to the register file 204, however, these accesses could be made to another memory instead.
  • the operation code only includes two addresses, SRCl and SRC2.
  • the result of the operation is stored in the SRCl or SRC2 register. That is SRCl (or SRC2) is used as the DEST.
  • SRCl or SRC2
  • This type of addressing is compatible with previous CISC instructions having only two addresses. This reduces the complexity in the decoder 202.
  • the data contained in the SRCl register is not to be destroyed, then that data is copied into another register before the execution of the operation. The copying would require an additional instruction.
  • the three address addressing scheme will be described (i.e. SRCl, SRC2, and DEST).
  • the control signal in one embodiment, may only include SRCl and SRC2, and that SRCl (or SRC2) identifies the destination register.
  • control signal requires an operation
  • functional unit 203 will be enabled to perform this operation on accessed data from register file 204.
  • the result is stored back into register file 204 or another memory according to requirements of control signal 207.
  • Figure 4a illustrates some of the data formats as may be used in the computer system of Figure 1. These data formats are fixed point. Processor 109 can manipulate these data formats. Multimedia algorithms often use these data formats. A byte 401 contains eight bits of information. A word 402 contains sixteen bits of information, or two bytes. A doubleword 403 contains thirty-two bits of information, or four bytes. Thus, processor 109 executes control signals that may operate on any one of these memory data formats.
  • bit six through bit zero of the byte 001110102 represent the subfield 1 1 10102.
  • Figure 4b through Figure 4d illustrate in-register representations used in one embodiment of the present invention.
  • unsigned byte in-register representation 410 can represent data stored in a register in integer registers 201.
  • a register, in integer registers 201 is sixty-four bits in length.
  • a register, in integer registers 201 is thirty-two bits in length.
  • sixty-four bit integer registers is used.
  • thirty-two bit integer registers can be used. In other embodiments, other sizes of registers may be used.
  • Unsigned byte in-register representation 410 illustrates processor 109 storing a byte 401 in integer registers 201, the first eight bits, bit seven through bit zero, in that register are dedicated to the data byte 401. These bits are shown as (b). To properly represent this byte, the remaining 56 bits must be zero.
  • integer registers 201 store the data in the first seven bits, bit six through bit zero, to be data. The seventh bit represents the sign bit, shown as an ⁇ s ⁇ . The remaining bit sixty-three through bit eight are the continuation of the sign for the byte.
  • Unsigned word in-register representation 412 is stored in one register of integer registers 201. Bit fifteen through bit zero contain an unsigned word 402. These bits are shown as ⁇ w ⁇ . To properly represent this word, the remaining bit sixty-three through bit sixteen must be zero.
  • a signed word 402 is stored in bit fourteen through bit zero as shown in the signed word in-register representation 413. The remaining bit sixty-three through bit fifteen is the sign field.
  • a doubleword 403 can be stored as an unsigned doubleword in-register representation 414 or a signed doubleword in-register representation 415.
  • Bit thirty-one through bit zero of an unsigned doubleword in-register representation 414 are the data. These bits are shown as ⁇ d ⁇ . To properly represent this unsigned doubleword, the remaining bit sixty-three through bit thirty-two must be zero.
  • Integer registers 201 stores a signed doubleword in-register representation 415 in its bit thirty through bit zero; the remaining bit sixty-three through bit thirty-one are the sign field.
  • Figure 5a illustrates the data formats for packed data.
  • Three packed data formats are illustrated; packed byte 501, packed word 502, and packed doubleword 503.
  • Packed byte in one embodiment of the present invention, is sixty-four bits long containing eight data elements. Each data element is one byte long.
  • a data element is an individual piece of data that is stored in a single register (or memory location) with other data elements of the same length.
  • the number of data elements stored in a register is sixty-four bits divided by the length in bits of a data element.
  • Packed word 502 is sixty-four bits long and contains four word 402 data elements. Each word 402 data element contains sixteen bits of information.
  • Packed doubleword 503 is sixty-four bits long and contains two doubleword 403 data elements. Each doubleword 403 data element contains thirty- two bits of information.
  • Figure 5b through Figure 5d illustrate the in-register packed data storage representation.
  • Unsigned packed byte in-register representation 510 illustrates the storage of packed byte 501 in one of the registers Ro 212a through R n 212af.
  • Information for each byte data element is stored in bit seven through bit zero for byte zero, bit fifteen through bit eight for byte one, bit twenty-three through bit sixteen for byte two, bit thirty-one through bit twenty-four for byte three, bit thirty-nine through bit thirty-two for byte four, bit forty-seven through bit forty for byte five, bit fifty-five through bit forty-eight for byte six and bit sixty-three through bit fifty-six for byte seven.
  • all available bits are used in the register.
  • Unsigned packed word in-register representation 512 illustrates how word three through word zero are stored in one register of registers 209. Bit fifteen through bit zero contain the data element information for word zero, bit thirty-one through bit sixteen contain the information for data element word one, bit forty- seven through bit thirty-two contain the information for data element word two and bit sixty-three through bit forty-eight contain the information for data element word three. Signed packed word in-register representation 513 is similar to the unsigned packed word in-register representation 512. Note that only the sixteenth bit of each word data element contains the necessary sign indicator.
  • Unsigned packed doubleword in-register representation 514 shows how registers 209 store two doubleword data elements. Doubleword zero is stored in bit thirty-one through bit zero of the register. Doubleword one is stored in bit sixty-three through bit thirty-two of the register. Signed packed doubleword in- register representation 515 is similar to unsigned packed doubleword in-register representation 514. Note that the necessary sign bit is the thirty-second bit of the doubleword data element.
  • registers 209 may be used for both packed data and integer data.
  • the individual programming processor 109 may be required to track whether an addressed register, Ri 212a for example, is storing packed data or simple integer/fixed point data.
  • processor 109 could track the type of data stored in individual registers of registers 209. This alternative embodiment could then generate errors if, for example, a packed addition operation were attempted on simple/fixed point integer data.
  • control signals are represented as thirty-two bits.
  • Decoder 202 may receive control signal 207 from bus 101. In another embodiment, decoder 202 can also receive such control signals from cache 206.
  • Figure 6a illustrates a general format for a control signal operating on packed data.
  • Operation field OP 601 bit thirty-one through bit twenty-six, provides information about the operation to be performed by processor 109; for example, packed addition, packed subtraction, etc..
  • SRCl 602 bit twenty-five through twenty, provides the source register address of a register in registers 209. This source register contains the first packed data, Source 1 , to be used in the execution of the control signal.
  • SRC2 603, bit nineteen through bit fourteen contains the address of a register in registers 209.
  • This second source register contains the packed data, Source2, to be used during execution of the operation.
  • DEST 605, bit five through bit zero, contains the address of a register in registers 209. This destination register will store the result packed data, Result, of the packed data operation.
  • Control bits SZ 610 indicates the length of the data elements in the first and second packed data source registers. If SZ 610 equals 012, then the packed data is formatted as packed byte 501. If SZ 610 equals 102, then the packed data is formatted as packed word 502. SZ 610 equaling 002 or 112 is reserved, however, in another embodiment, one of these values could be used to indicate packed doubleword 503.
  • Control bit T 611 indicates whether the operation is to be carried out with saturate mode. If T 611 equals one, then a saturating operation is performed. If T 611 equals zero, then a nonsaturating operation is performed. Saturating operations will be described later.
  • Control bit S 612 indicates the use of a signed operation. If S 612 equals one, then a signed operation is performed. If S 612 equals zero, then an unsigned operation is performed.
  • Figure 6b illustrates a second general format for a control signal operating on packed data. This format corresponds with the general integer opcode format described in the "PentiumTM Processor Family User's Manual," available from Intel Co ⁇ oration, Literature Sales, P.O. Box 7641, Mt. prospect, IL, 60056- 7641. Note that OP 601, SZ 610, T 611, and S 612 are all combined into one large field. For some control signals, bits three through five are SRCl 602.
  • bits three through five also correspond to DEST 605.
  • bits zero through two also correspond to DEST 605.
  • bits three through five represent an extension to the opcode field.
  • this extension allows a programmer to include an immediate value with the control signal, such as a shift count value.
  • the immediate value follows the control signal. This is described in more detail in the "PentiumTM Processor Family User's Manual," in appendix F, pages F- 1 through F-3. Bits zero through two represent SRC2 603.
  • This general format allows register to register, memory to register, register by memory, register by register, register by immediate, register to memory addressing. Also, in one embodiment, this general format can support integer register to register, and register to integer register addressing. DESCRIPTION OF S ATI IR ATE/UNS ATUR A TE
  • T 61 1 indicates whether operations optionally saturate. Where the result of an operation, with saturate enabled, overflows or underflows the range of the data, the result is clamped. Clamping means setting the result to a maximum or minimum value should a result exceed the range's maximum or minimum value. In the case of underflow, saturation clamps the result to the lowest value in the range and in the case of overflow, to the highest vilue.
  • Table 1 Data Format Minimum Value Maximum Value
  • the performance of CSC applications is improved by not only supporting a standard CISC instruction set (unpacked data operations), but by supporting a shift operation on packed data.
  • the packed shift can be used to increase the speed of fixed-point implements of Fast Fourier Transforms, Cosine Transforms, and other digital image and audio signal processing algorithms.
  • the SRCl register contains the data (Source 1) to be shifted
  • the SRC2 register contains the data (Source2) representing the shift count
  • DEST register will contain the result of the shift (Result). That is, Source 1 will have each data element independently shifted by the shift count.
  • Source2 is inte ⁇ reted as an unsigned 64 bit scalar.
  • Source2 is packed data and contains shift counts for each corresponding data element in Source 1.
  • both arithmetic shifts and logical shifts are supported. An arithmetic shift, shifts the bits of each data element down by a specified number, and fills the high order bit of each data element with the initial value of the sign bit.
  • a logical shift can operate by shifting bits up or down. In a shift right logical, the high order bits of each data element are filled with zeroes.
  • a shift left logical causes the least significant bits of each data element to be filled with zeroes.
  • a shift right arithmetic, the shift right logical, and the shift left logical operations are supported for packed bytes and packed words. In another embodiment of the present invention, these operations are supported for packed doublewords also.
  • Figure 7 illustrates one embodiment of a method of performing a shift operation on packed data. This embodiment can be implemented in the processor 109 of Figure 2.
  • decoder 202 decodes control signal 207 received by processor 109.
  • decoder 202 decodes: the operation code for the appropriate shift operation; SRCl 602, SRC2 603 and DEST 605 addresses in integer registers 209; saturate/unsaturate (not necessarily needed for shift operations), signed/unsigned (again not necessarily needed), and length of the data elements in the packed data.
  • decoder 202 accesses integer registers 209 in register file 204 given the SRCl 602 and SRC2 603 addresses.
  • Integer registers 209 provides functional unit 203 with the packed data stored in the SRCl 602 register (Source 1), and the scalar shift count stored in SRC2 603 register (Source2). That is, integer registers 209 communicate the packed data to functional unit 203 via internal bus 205.
  • decoder 202 enables functional unit 203 to perform the appropriate packed shift operation. Decoder 202 further communicates, via internal bus 205, the size of data elements, the type of shift operation, and the direction of the shift (for logical shifts).
  • the size of the data element determines which step is to be executed next. If the size of the data elements is eight bits (byte data), then functional unit 203 performs step 712. However, if the size of the data elements in the packed data is sixteen bits (word data), then functional unit 203 performs step 714. In one embodiment, only eight bit and sixteen bit data element size packed shifts are supported. However, in another embodiment, a thirty-two bit data element size packed shift is also supported. In other embodiments, other size data elements may be supported.
  • step 712 is executed.
  • step 712 the following is performed.
  • Source 1 bits seven through zero are shifted by the shift count (Source2 bits sixty-three through zero) generating Result bits seven through zero.
  • Source 1 bits fifteen through eight are shifted by the shift count generating Result bits fifteen through eight.
  • Source 1 bits twenty-three through sixteen are shifted by the shift count generating Result bits twenty-three through sixteen.
  • Source 1 bits thirty-one through twenty-four are shifted by the shift count generating Result bits thirty-one through twenty-four.
  • Sourcel bits thirty-nine through thirty-two are shifted by the shift count generating Result bits thirty-nine through thirty-two.
  • Sourcel bits forty-seven through forty are shifted by the shift count generating Result forty-seven through forty.
  • Sourcel bits fifty-five through forty-eight are shifted by the shift count generating Result bits fifty-five through forty-eight.
  • Sourcel bits sixty-three through fifty-six are shifted by the shift count generating Result bits sixty-three through fifty-six.
  • step 714 is executed.
  • step 714 the following is performed.
  • Sourcel bits fifteen through zero are shifted by the shift count generating Result bits fifteen through zero.
  • Sourcel bits thirty-one through sixteen are shifted by the shift count generating Result bits thirty-one through sixteen.
  • Sourcel bits forty-seven through thirty-two a e shifted by the shift count generating Result bits forty-seven through thirty-two.
  • Sourcel bits sixty-three through forty-eight are shifted by the shift count generating Result bits sixty-three through forty-eight.
  • the shifts of step 712 are performed simultaneously. However, in another embodiment, these shifts are performed serially. In another embodiment, some of these shifts are performed simultaneously and some are performed serially. This discussion applies to the shifts of step 714 as well.
  • the Result is stored in the DEST register.
  • Table 2 illustrates the in-register representation of packed shift right arithmetic operation.
  • the first row of bits is the packed data representation of Sourcel.
  • the second row of bits is the data representation of Source2.
  • the third row of bits is the packed data representation of the Result.
  • the number below each data element bit is the data element number. For example, Sourcel data element three is 100000002-
  • Table 2 illustrates the in-register representation of packed shift right logical operation on packed byte data.
  • Table 4 illustrates the in-register representation of packed shift left logical operation on packed byte data.
  • a Sourcel signal is on a Sourcel bus.
  • Busses with multiple bits may be designated with particular bit ranges.
  • Sourcel [31 : 16] indicates that the bus corresponds to bits 31 through 16 of the Sourcel bus.
  • the whole bus may be referred to as the Sourcel bus or Sourcel [63:0] (for a 64 bit bus).
  • the complement of a signal may be referred to by appending an "#" after the signal name.
  • the complement of the Sourcel signal on the Sourcel bus is the Sourcel# signal on the Sourcel# bus.
  • the shift operation can occur on multiple data elements in the same number of clock cycles as a single shift operation on unpacked data.
  • parallelism is used. That is, registers are simultaneously instructed to perform the shift operation on the data elements. This is discussed in more detail below.
  • Figure 8 illustrates one embodiment of a portion of a circuit that can perform a shift operation on packed data in the same number of clock cycles as a shift operation on unpacked data.
  • Figure 8 illustrates the use of a modified byte slice shift circuit, byte slice stagei 899.
  • the most significant data element byte slice need only have a shift unit.
  • Shift unitj 811 and shift unitj+i 871 each allow eight bits from Sourcel to be shifted by the shift count.
  • each shift unit operates like a known eight bit shift circuit.
  • Each shift unit has a Sourcel input, a Source2 input, a control input, a next stage signal, a last stage signal, and a result output. Therefore, shift uniti 811 has Sourceli 831 input, Source2[63:0] 833 input, control! 801 input, next stagei 813 signal, last stagei 812 input, and a result stored in result registerj 851.
  • shift uniti+i 871 has Sourceli+i 832 input, Source2[63:0] 833 input, controli+i 802 input, next stagej+l 873 signal, last stagei+i 872 input, and a result stored in result registeri+i 852.
  • the Sourcel input is typically an eight bit portion of Sourcel.
  • the eight bits represents the smallest type of data element, one packed byte data element.
  • Source2 input represents the shift count.
  • each shift unit receives the same shift count from Source2[63:0] 833.
  • Operation control 800 transmits control signals to enable each shift unit to perform the required shift.
  • the control signals are determined from the type of shift (arithmetic/logical) and the direction of the shift.
  • the next stage signal is received from the bit control for that shift unit.
  • the shift unit will shift the most significant bit out/in on the next stage signal, depending on the direction of the shift (left/right).
  • each shift unit will shift the least significant bit out/in on the last stage signal, depending on the direction of the shift (right left).
  • the last stage signal being received from the bit control unit of the previous stage.
  • the result ou ⁇ ut represents the result of the shift operation on the portion of Sourcel the shift unit is operating upon.
  • Bit controli 820 is enabled from operation control 800 via packed data enablei 806. Bit controli 820 controls next stagei 813 and last stagej+i 872. Assume, for example, shift unitj 811 is responsible for the eight least significant bits of Sourcel, and shift uniti+i 871 is responsible for the next eight bits of Sourcel. If a shift on packed bytes is performed, bit controli 820 will not allow the least significant bit from shift uniti+i 871 to be communicated with the most significant bit of shift uniti 811. However, a shift on packed words is performed, then bit controli 820 will allow the least significant bit from shift unitj+i 871 to be communicated with the most significant bit of shift unitj 811
  • Shift 7 Shift 6
  • Shift 5 Shift 4
  • Shift J Shift 2
  • Each shift unit is optionally connected to a result register.
  • the result register temporarily stores the result of the shift operation until the complete result, Result[63:0] 860 can be transmitted to the DEST register.
  • eight shift units and seven bit control units are used for a complete sixty-four bit packed shift circuit. Such a circuit can also be used to perform a shift on a sixty-four bit unpacked data, thereby using the same circuit to perform the unpacked shift operation and the packed shift operation.
  • FIG. 9 illustrates another embodiment of a packed shift circuit.
  • the packed shift circuit is capable of performing arithmetic shift operations on multiple data types.
  • the packed shift circuit may be capable of performing a packed shift on data elements which each contain one 64- bit value, two 32-bit data values, or four 16-bit values.
  • This embodiment may also be implemented to be capable of alternatively or additionally performing logical shift operations, right shifts, and/or left shifts.
  • a barrel shifter 905 is used to shift Sourcel by the count specified in the low order bits of Source2. However, if Sourcel is a packed data type, the barrel shifter shifts the low order bits of each of the values in the packed data type into the high order bits of the next lowest order value to produce a shifted packed intermediate result.
  • a correction circuit is used to replace each of these bits with the most significant bit of the corresponding value if it is a signed shift operation, and a zero if it is a logical shift operation. In one embodiment, if at least one of the high order bits that are not required to specify the shift count is one, all the bits of the shifted packed intermediate result are replaced with the sign bit (for right arithmetic shifts) or zero (for logical shifts).
  • the shift data is driven on a Sourcel bus 901.
  • the shift count is driven on a Source2 bus 902 in two portions, an actual shift count bus, Source2[5:0] 903, and an overflow shift count bus, Source2[63:6J 904.
  • the six bits required to specify a shift count ranging from 0 to 63 are specified on the actual shift count bus 903.
  • the rest of the 64-bit data field is specified on the overflow shift count bus 904.
  • the shift data bus 901, the actual shift count bus 903, and a left shift bus 900 are coupled to the inputs of a barrel shifter.
  • the barrel shifter contains a set of muxes that use complex gates (described below) to drive a set of 16-1 decoders which form one stage of the barrel shifter.
  • the barrel shifter 905 drives the shift output bus 919.
  • Muxes 906-909 drive the replacements bits that are used to correct the appropriate bits of the shift output bus 914.
  • Each of the muxes 906-909 corresponding to the most- significant to the least significant word of the shift output bus 914, respectively.
  • a right-shift arithmetic word (rsadword) bus 928 is coupled to the most-significant select bit of each of the muxes 906-909 to indicate whether the shift operation is an arithmetic right shift that operated on packed doubleword data.
  • a right-shift arithmetic word (rsaword) bus 929 is coupled to the least- significant select bit of each of the muxes 906-909 to indicate whether the shift operation is an arithmetic right shift that operated on packed word data.
  • the rsadword signal and the rsaword signal may be generated based on the decoding of the control signal 207, for example.
  • a zero is driven through a set of zero busses 924-927 which are coupled to the zero input of each of the muxes 906-909, respectively.
  • a zero is used to correct the selected bits on the shift ou ⁇ ut bus 919 when the operation is neither a right shift arithmetic word or right shift arithmetic doubleword operation.
  • the operation may be a left shift or a logical shift, for example.
  • the operation is a rsaword operation
  • the most significant bit of each word is used to correct the selected bit of each corresponding word of the shifted packed word data on the shift output bus 919.
  • a Sourcel [63] bus 920, a Sourcel [47] bus 921, a Sourcel [31] bus 922, and a Sourcel [15] bus 923 are coupled to the corresponding 1 inputs of each of the muxes 906-909, respectively.
  • the sign bit of each of the words of the packed word data are driven onto the corresponding bus.
  • the most significant bit (which is the sign bit) of each word is used to correct the selected bits of each corresponding word of the shifted packed word data on the shift ou ⁇ ut bus 919.
  • the Sourcel [63] bus 920 and the Sourcel [31] bus 922 are coupled to the corresponding two inputs of the most significant pair of muxes 906- 907 and the least-significant pair of muxes 908-909, respectively. These sign bit of each of the corresponding doublewords are driven onto the corresponding bus.
  • Each of the muxes 906-909 drives a corresponding replacement bit bus 996-999.
  • the decoded signal is a field of zeroes with ones in the bit positions corresponding to numbers less than or equal to the value on the Source2[5:0] bus 903.
  • the bits that are one correspond to the bits positions of the shift ou ⁇ ut bus that should be corrected if the operation were a right shift of a 64- bit scalar data.
  • the value on the decoded bus 938 is received and manipulated by a fixshift circuit 932 to produce the values on the fixdata busses 934-937 according to the operation and data type specified on the control bus 933 such that the appropriate bits of each value of the packed data are corrected. For example, if a right shift of packed word data were indicated on the control bus 933 and a shift count of 6 was indicated on the Source2[5:0] bus 903, the fixshift circuit 932 would replicate the most-significant 6 ones produced on the 64-bit decoded bus 938 on the most-significant 6 bits of each of the 16-bit fixdata busses 934-937.
  • the fixshift circuit 932 would replicate the most-significant 6 ones produced on the 64-bit decoded bus 938 on the least-significant 6 bits of each of the 16-bit fixdata busses 934-937.
  • the Source2[63:6] bus 904 is input to NOR logic 931 which produces an output on the NOR bus 939 that is one only if all the bits of the Source2[63:6] bus 904 are zero.
  • the Fixshift circuit 932 indicates that all bits should be replaced. More details of the Fixshift circuit 932 is provided below.
  • Each of the bits of the most significant word of the shift ou ⁇ ut bus 919 are coupled to the zero input of a corresponding one of the set of muxes 910.
  • the replacement bit bus 996 which corresponds to the replacement bit for the most significant word is coupled to the one input of each of the set of muxes 910.
  • Each bit of the fixdata bus 934 is coupled to the corresponding one of the set of muxes 910 to indicate whether the corresponding bit of the So[63:48] data or the corresponding bit on the replacement bit bus 996 is driven onto a corresponding bit of the fixed shift output FSo)[63:48] bus.
  • the inputs and ou ⁇ uts of muxes 911-913 are similarly coupled, as illustrated in FIG. 9.
  • FIG. 9 illustrates one circuit for implementation of a shifter circuit, any number of well-known shifter circuits providing the equivalent function.
  • FIG. 10 illustrates one embodiment of the fixshift circuit 932.
  • the control bus 933 comprises a left-shift word (lsw) bus 1000, a right-shift word doubleword (rswd) bus 1001, a left-shift doubleword quadword (lsdq) bus 1002, a left-shift word doubleword quadword (lswdq) bus 1003, a right-shift word (rsw) bus 1004, a right-shift doubleword (rsd) bus 1005, a right-shift quadword (rsq) bus 1006, a left-shift doubleword (lsd) bus 1007, a right-shift word doubleword quadword (rswdq) bus 1008, a left-shift word doubleword (lswd) bus 1009, a right-shift doubleword quadword (rsdq) bus 1010, and a left-shift quadword (lsq) bus 1011.
  • These signals may be generated based on the decoding of the control signal 207, for example.
  • the names of the individual control signals indicate when they are asserted (active). These signals are a one when they are active (active high).
  • the lsw bus 1000 is only active when the operation is a left-shift of a packed word data.
  • the rswd bus 1001 is only active when the operation is a right-shift operation of a packed word data or a packed doubleword data.
  • Each of the busses of the control bus 933 are coupled to a corresponding one of inverters 1020-1031 which drive one of the corresponding busses comprising an bus 1040, an rswd# bus 1041 , an lsdq# bus 1042, an lswdq# bus 1043, an rsw# bus 1044, an rsd# bus 1045, an rsq# bus 1046, an lsd# bus 1047, an rswdq# bus 1048, an lswd# bus 1049, an rsdq# bus 1050, and an lsq# bus 1051.
  • These signals are zero when they are active (active low).
  • Each of a set of muxes 1060 drives a bit of the fixdata bus 937 to indicate which bits of the least significant word of the shift output bus 919 (referring to FIG. 9) should be replaced.
  • the lswdq# bus 1043 is coupled to the select 0 input of each of the set of muxes 1060 to select each data 0 input whenever the operation is a left-shift of either a word, doubleword, or quadword.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1060. For example, the three least significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a lswdq with a shift count of 3.
  • the rsw# bus 1044 is coupled to the select 1 input of each of the set of muxes 1060 to select each data 1 input whenever the operation is a right-shift of a word.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1060 in reverse order (The most significant bit of the decoded bus 938 drives the one of the set of muxes 1060 that drives the least significant bit of the fixdata bus 937, the second most significant bit of the decoded bus 938 drives the one of the set of muxes 1060 that drives the second least significant bit of the fixdata bus 937, etc.).
  • the three most significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a rsw with a shift count of 3.
  • the rsd# bus 1045 is coupled to the select 2 input of each of the set of muxes 1060 to select each data 2 input whenever the operation is a right-shift of a doubleword.
  • a bit of the second least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1060 in reverse order.
  • the three most significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a rsd with a shift count of 19.
  • the right shift shifts through the most significant word of the least significant doubleword before it begins to effect the least significant word.
  • the rsq# bus 1046 is coupled to the select 3 input of each of the set of muxes 1060 to select each data 3 input whenever the operation is a right- shift of a quadword.
  • a bit of the most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1060 in reverse order. For example, the three most significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a rsq with a shift count of 51.
  • the right shift shifts through the most significant 48 bits of the quadword before it begins to effect the least significant word.
  • the lswdq bus 1003, the rsw bus 1004, the rsd bus 1005, and the rsq bus 1006 are coupled to a NOR gate 1013 which drives a zero bus 1017.
  • the zero bus 1017 is coupled to the control 0 (cO) input of each of the set of muxes 1060 to force a zero on the outputs when none of the select inputs are active.
  • the NOR bus 939 is coupled to the control 1 (cl) input of each of the muxes to force a one on the outputs when at least one of the most-significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift output bus 719 to be replaced.
  • Each of a set of muxes 1061 drives a bit of the fixdata bus 936 to indicate which bits of the second least significant word of the shift output bus 919 (referring to FIG. 9) should be replaced.
  • the lsw# bus 1040 is coupled to the select 0 input of each of the set of muxes 1061 to select each data 0 input whenever the operation is a left-shift of a word.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1061.
  • the three least significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a lsw with a shift count of 3.
  • the rswd# bus 1041 is coupled to the select 1 input of each of the set of muxes 1061 to select each data 1 input whenever the operation is a right-shift of a word or a doubleword.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1061 in reverse order.
  • the three most significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a rswd with a shift count of 3.
  • the lsdq# bus 1042 is coupled to the select 2 input of each of the set of muxes 1061 to select each data 2 input whenever the operation is a left-shift of a doubleword or a quadword.
  • a bit of the second least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1061.
  • the three least significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a lsdq with a shift count of 19.
  • the left shift shifts through the least significant word before it begins to effect the second least significant word.
  • the rsq# bus 1046 is coupled to the select 3 input of each of the set of muxes 1061 to select each data 3 input whenever the operation is a right-shift of a quadword.
  • a bit of the second most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1061 in reverse order. For example, the three most significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a rsq with a shift count of 35.
  • the right shift shifts through the most significant doubleword of the quadword before it begins to effect the second least significant word.
  • the lsw bus 1000, the rswd bus 1001, the lsdq bus 1002, and the rsq bus 1006 are coupled to a NOR gate 1012 which drives a zero bus 1016.
  • the zero bus 1016 is coupled to the control 0 (cO) input of each of the set of muxes 1061 to force a zero on the ou ⁇ uts when none of the select inputs are active.
  • the NOR bus 939 is coupled to the control 1 (c 1 ) input of each of the muxes to force a one on the ou ⁇ uts when at least one of the most-significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift output bus 719 to be replaced.
  • Each of a set of muxes 1062 drives a bit of the fixdata bus 935 to indicate which bits of the second most significant word of the shift output bus 919 (referring to FIG. 9) should be replaced.
  • the lswd# bus 1049 is coupled to the select 0 input of each of the set of muxes 1062 to select each data 0 input whenever the operation is a left-shift of either a word or doubleword.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1062. For example, the three least significant bits of the fixdata bus 935 would indicate that the corresponding bits should be replaced for a lswd with a shift count of 3.
  • the rsw# bus 1044 is coupled to the select 1 input of each of the set of muxes 1062 to select each data 1 input whenever the operation is a right-shift of a word.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1060 in reverse order. For example, the three most significant bits of the fixdata bus 935 would indicate that the corresponding bits should be replaced for a rswd with a shift count of 3.
  • the rsdq# bus 1050 is coupled to the select 2 input of each of the set of muxes 1062 to select each data 2 input whenever the operation is a right-shift of a doubleword or quadword.
  • a bit of the second least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1062 in reverse order.
  • the three most significant bits of the fixdata bus 935 would indicate that the corresponding bits should be replaced for a rsdq with a shift count of 19.
  • the right shift shifts through the most significant word before it begins to effect the second least significant word.
  • the lsq# bus 1051 is coupled to the select 3 input of each of the set of muxes 1062 to select each data 3 input whenever the operation is a left-shift of a quadword.
  • a bit of the second most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1062 in reverse order.
  • the three most significant bits of the fixdata bus 935 would indicate that ⁇ e corresponding bits should be replaced for a lsq with a shift count of 35. The left shift shifts through the least significant doubleword before it begins to effect the second most significant word.
  • the lsw bus 1000, the rsw bus 1004, the rsdq bus 1010, and the lsq bus 1011 are coupled to a NOR gate 1014 which drives a zero bus 1018.
  • the zero bus 1018 is coupled to the control 0 (cO) input of each of the set of muxes 1062 to force a zero on the outputs when none of the select inputs are active.
  • the NOR bus 939 is coupled to the control 1 (c 1 ) input of each of the muxes to force a one on the outputs when at least one of the most- significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift output bus 719 to be replaced.
  • Each of a set of muxes 1063 drives a bit of the fixdata bus 934 to indicate which bits of the most significant word of the shift output bus 919 (referring to FIG. 9) should be replaced.
  • the lsw# bus 1000 is coupled to the select 0 input of each of the set of muxes 1063 to select each data 0 input whenever the operation is a left-shift of a word.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1063.
  • the three least significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a lsw with a shift count of 3.
  • the lsd# bus 1047 is coupled to the select 1 input of each of the set of muxes 1063 to select each data 1 input whenever the operation is a left-shift of a doubleword.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1063.
  • the three least significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a lsd with a shift count of 19. The left shift shifts through the second least significant word before it begins to effect the most significant word.
  • the rswdq# bus 1048 is coupled to the select 2 input of each of the set of muxes 1063 to select each data 2 input whenever the operation is a right-shift of a word, doubleword, or quadword.
  • a bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1063 in reverse order. For example, the three most significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a rswdq with a shift count of 3.
  • the lsq# bus 1045 is coupled to the select 3 input of each of the set of muxes 1063 to select each data 3 input whenever the operation is a left-shift of a quadword.
  • a bit of the most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1060.
  • the three most significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a lsq with a shift count of 51.
  • the left shift shifts through the least significant 48 bits of the quadword before it begins to effect the most significant word.
  • the lsw bus 1000, the lsd bus 1007, the rswdq bus 1008, and the lsq bus 1011 are coupled to a NOR gate 1015 which drives a zero bus 1019.
  • the zero bus 1019 is coupled to the control 0 (cO) input of each of the set of muxes 1063 to force a zero on the ou ⁇ uts when none of the select inputs are active.
  • the NOR bus 939 is coupled to the control 1 (cl) input of each of the muxes to force a one on the ou ⁇ uts when at least one of the most- significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift ou ⁇ ut bus 719 to be replaced.
  • FIG. 10 illustrates one circuit for implementation of the fixshift circuit 932 of FIG. 9, any number of alternative fixshift circuits could be used.
  • FIG. 11 illustrates one embodiment of the barrel shifter 905 (referring to FIG. 9).
  • the barrel shifter 905 is implemented to perform right shifts. In order to perform left shifts, a right shift of the two's complement of the right shift count is performed according to well-known methods.
  • the Source2[5:0] bus 903 comprises an Source2[0] bus 1100, an Source2[l] bus 1101, an Source2[2] bus 1102, an Source2[3] bus 1103, an Source2[4] bus 1 104, and an Source2[5] bus 1105.
  • the Source2[l] bus 1101 and the shift left bus 900 are coupled to logic 1110 which generates a signal on select bus 1120 that is the value of Source2[l] when the operation is aright shift and the complement of Source2[l] when the operation is a left shift.
  • the select bus 1 120 is coupled to the select input of a set of 2-1 Muxes 1140.
  • the Sourcel[63:0] bus 901 is coupled to circuit 1161 which replicates the 64-bit data to produce a 128-bit data (where one copy of the 64-bit data is in the most significant quadword and the other is in the least significant quadword) on the data[ 127:0] bus 1130.
  • the circuit 1161 is simply wires that branch each single bit input to two output bits at the appropriate bit positions.
  • Each bit of the data[127:2] portion of the data[127:0] bus 1130 is coupled to each corresponding 1 input of the set of 2- 1 Muxes 1140.
  • Each bit of the data[125:0] portion of he data[127:0] bus 1130 is coupled to each corresponding 0 input of the set of 2- 1 Muxes 1 140.
  • the set of 2-1 Muxes 1 140 are coupled to corresponding bits of the intermediate result bus 1 141.
  • the next stage of the barrel shifter 905 shifts the data on the intermediate result bus 1 141 by 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, or 60 positions depending on the value of the bits on the Source2[2] bus 1 102, the Source2[3] bus 1103, the Source2[4] bus 1 104 and the Source2[5] bus 1 105.
  • the Source2[2] bus 1102 is coupled to logic 1 11 1 (described in more detail below) which drives the two bits of the bitpair bus 1121.
  • the first bit is Source2[2] when the operation is a right shift and the complement of Source2[2] when the operation is a left shift.
  • the second bit is the complement of the first bit.
  • the Source2[3] bus 1103, the Source2[4] bus 1104, and the Source2[5] bus 1 105 are coupled to logic circuits 1112-1114, respectively, which drive bitpair busses 1 122-1124, respectively, in a similar manner.
  • the bitpair busses 1 121-1 124 are coupled to the inputs of decoder 1116 that generates a decoded value of the bi ⁇ air busses 1121-1124 on the select bus 1162 according to well-known methods.
  • Each bit of the intermediate result [65:0] portion of the intermediate result bus 1150 is coupled to the 0 inputs of the corresponding one of the set of 16- 1 Muxes 1150.
  • Each bit of the intermediate result [69:4] portion of the intermediate result bus 1150 is coupled to the 1 inputs of the corresponding one of the set of 16-1 Muxes 1150.
  • Each bit of the intermediate result [ 125:60] portion of the intermediate result bus 1150 is coupled to the 15 inputs of the corresponding one of the set of 16-1 Muxes 1150.
  • the 2 inputs through the 14 inputs are coupled in a manner according to the pattern illustrated in FIG. 11 and described above.
  • the set of muxes 1150 drive the intermediate result bus 1151 according to the input selected.
  • the last stage of the barrel shifter 905 shifts the data on the intermediate result bus 1151 by 0, 1, or 2 positions according to the value on the Source2[0] uus 1100 and the shift left bus 900.
  • the Source2[0] bus 1 100 and the shift left bus 900 are coupled to the inputs of a logic circuit 11 15 which drives the select bus 1125.
  • the logic circuit 1115 adds the values of the bits on the Source2[0] bus 1100 and the shift left bus 900 and drives the decoded sum on the select bus 1 125 according to well-known methods.
  • the select bus 1125 is coupled to a set of 3-1 Muxes 1160.
  • Each bit of the intermediate result [63: 0] portion of the intermediate result bus 1151 is coupled to the 0 inputs of the corresponding one of the set of 3- 1 Muxes 1160.
  • Each bit of the intermediate result [64: 1] portion of the intermediate result bus 1151 is coupled to the 1 inputs of the corresponding one of the set of 3-1 Muxes 1160.
  • Each bit of the intermediate result [65: 2] portion of the intermediate result bus 1 151 is coupled to the 2 inputs of the corresponding one of the set of 3-1 Muxes 1160.
  • Each of the set of 3- 1 Muxes 1160 drives the corresponding bit of the result on the shifted output bus 919.
  • FIG. 10 illustrates one circuit for implementation of the fixshift circuit 932 of FIG. 8, any number of alternative fixshift circuits could be used.
  • FIG. 12 illustrates one embodiment of the encoding logic represented in FIG. 11 as each of the logic circuits 11 1 1-1114.
  • the bit to be encoded is driven onto the S bus 1220 (which corresponds to each of the first bit of a bitpair bus as described above) and the complement of the bit to be encoded is driven onto the S# bus (which corresponds to the second bit of a bitpair bus as described above) when the shift left bus 1203 indicates that the operation is a right shift.
  • the complement of the bit to be encoded is driven onto the S bus 1220 and the bit to be encoded is driven onto the S# bus when the shift left bus 1203 indicates that the operation is a left shift.
  • the bit to be encoded is driven on a shiftcount bit bus 1202 which is coupled to the input of an inverter 1210.
  • Inverter 1210 drives the complement of the bit to be encoded on the shiftcount# bus 1204 which is coupled to the input of an inverter 1212.
  • Inverter 1212 drives the bit to be encoded on a delayed shiftcount bit bus 1206.
  • the shift left bus 1203 is coupled to the input of inverter 1211 which drives the complement of the shift left signal on the shift left# bus 1205.
  • the shift left# bus 1205 is coupled to an inverter 1213 which drives the delayed shift left bus 1207.
  • the shiftcount* bus 1204 is coupled to the first input of complex gate 1214 and the fourth input of complex gate 1215.
  • the delayed shiftcount bus 1206 is coupled to the fourth input of complex gate 1214 and the second input of complex gate 1215.
  • the shift left# bus 1205 is coupled to the third input of complex gate 1214 and the third input of complex gate 1215.
  • the delayed shift left bus 1207 is coupled to the first input of complex gate 1214 and the first input of complex gate 1215.
  • Table 7 is the truth table for both complex gate 1214 and complex gate 1215. The output is false whenever either the first two inputs are true or the second two inputs are true. Otherwise, the ou ⁇ ut is false.
  • the implementation of this logic as a complex gate improves performance. This is particularly important since the logic decodes 4 bits for the second stage of this 64-bit barrel shifter as compared to 3 bits for the second stage in a 32-bit barrel shifter.
  • FIG. 13 illustrates one embodiment of a method of performing a Packed
  • a first packed data is accessed from a register or another memory, such as RAM, a cache memory, a flash memory, or other data storage device.
  • the first packed data represents multiple values to be shifted.
  • a shift count is accessed from a register or another memory. The shift count represents the number of positions each value of the first packed data is to be shifted.
  • Step 1303 the first packed data is shifted by the number of positions indicated by the shift count to produce an shifted packed intermediate result. In one embodiment, portions of some values of the shifted packed intermediate result may be shifted into other values of the shifted packed intermediate result.
  • Step 1305 the correction circuit determines whether the shift count is greater than the number of bits to be shifted in the first packed data. If so, Step 1306 is performed. If not Step 1307 is performed.
  • Step 1306 all the bits of the shifted packed intermediate data is replaced by the corresponding replacement bit. This produces a result that is consistent with a first packed data having values that are extended beyond the most significant and least significant bits represented. If such a value is shifted by greater than the number of bits represented, the sign bit (for right arithmetic shifts) or the zero bits (for logical shifts) should replace the whole value.
  • Step 1307 at least one bit of the shifted packed intermediate data is replaced by the corresponding replacement bit.
  • the replacement bits correspond to those bits in those portions of the values of the shifted packed intermediate result that are shifted into other values of the shifted packed intermediate result.

Abstract

An apparatus for performing a shift operation on a packed data element (901) having multiple values. The apparatus having multiple muxes (910-913), each of the multiple muxes having a first input, a second input, a select input and an output. Each of the multiple bits that represents a shifted packed intermediate result on a first bus (919) is coupled to the corresponding first input. Each of the multiple bits representing a replacement bit for one of the multiple values is coupled to a corresponding second input (996-999). Each of the multiple bits driven by a correction circuit (932) is coupled to a corresponding select input. Each output (915-918) corresponds to a bit of a shifted packed result.

Description

APPARATUS FOR PERFORMING PACKED SHIFT
OPERATIONS
RELATED APPLICATIONS This is a continuation-in-part of application no. 08/349,730 filed December
1, 1994 by Alexander Peleg, Yaakov Yaari, Millind Mittal, Larry M. Mennemeier, and Benny Eitan, and which is assigned to the assignee of the present invention.
BACKGROUND OF THE INVENTION
1. Field of the Invention
In particular, the present invention describes an apparatus for performing arithmetic operations using a single control signal to manipulate multiple data elements. The present invention allows execution of shift operations on packed data types.
2. Description of Related Art
Today, most personal computer systems operate with one instruction to produce one result. Performance increases are achieved by increasing execution speed of instructions and the processor instruction complexity; known as Complex Instruction Set Computer (CISC). Such processors as the Intel 80286™ microprocessor, available from Intel Corp. of Santa Clara, California, belong to the CISC category of processor.
Previous computer system architecture has been optimized to take advantage of the CISC concept. Such systems typically have data buses thirty-two bits wide. However, applications targeted at computer supported cooperation (CSC - the integration of teleconferencing with mixed media data manipulation), 2D/3D graphics, image processing, video compression/decompression, recognition algorithms and audio manipulation increase the need for improved performance. But, increasing the execution speed and complexity of instructions is only one solution. One common aspect of these applications is that they often manipulate large amounts of data where only a few bits are important. That is, data whose relevant bits are represented in much fewer bits than the size of the data bus. For example, processors execute many operations on eight bit and sixteen bit data (e.g., pixel color components in a video image) but have much wider data busses and registers. Thus, a processor having a thirty-two bit data bus and registers, and executing one of these algorithms, can waste up to seventy-five percent of its data processing, carrying and storage capacity because only the first eight bits of data are important. As such, what is desired is a processor that increases performance by more efficiently using the difference between the number of bits required to represent the data to be manipulated and the actual data carrying and storage capacity of the processor.
SUMMARY OF THE INVENTION
An apparatus for performing a packed shift operation on a packed data having a multiple values. The apparatus having a first bus which has bits that represent a shifted packed intermediate result and a second bus which has bits each representing a replacement bit for one of the multiple values. The apparatus including a correction circuit having a third bus having multiple bits. The apparatus further including multiple muxes, each of the multiple muxes having a first input, a second input, a select input and an ouφut. Each of the first inputs are coupled to one of the bits of the first bus. Each of the second inputs are coupled to one of the bits of the second bus. Each of said select inputs are coupled to a corresponding one of the third bus. Each output corresponding to a bit of a shifted packed result.
^RIEF DESCRIPTION OF THE DRAWINGS
Figure 1 illustrates an embodiment of the computer system using the apparatus of the present invention.
Figure 2 illustrates an embodiment of the processor of the present invention.
Figure 3 is a flow diagram illustrating the general steps used by the processor to manipulate data in the register file. Figure 4a illustrates memory data types.
Figure 4b, Figure 4c and Figure 4d illustrate in-register integer data representations.
Figure 5a illustrates packed data-types. Figure 5b, Figure 5c and Figure 5d illustrate in-register packed data representations.
Figure 6a illustrates a control signal format used in the computer system to indicate the use of packed data.
Figure 6b illustrates a second control signal format that can be used in the computer system to indicate the use of packed data.
Figure 7 illustrates one embodiment of a method followed by a processor when performing a shift operation on packed data.
Figure 8 illustrates one embodiment of a Packed Shift circuit.
Figure 9 illustrates another embodiment of a Packed Shift circuit. Figure 10 illustrates an embodiment of a portion of the logic to identify which bits of the barrel shifted result should be corrected (Fixshift).
Figure 11 illustrates an embodiment of a barrel shifter.
Figure 12 illustrates an embodiment of a mux for a barrel shifter.
Figure 13 illustrates another embodiment of a method of performing a packed shift operation.
DETAILED DESCRIPTION
A processor having shift operations that operate on multiple data elements is described. In the following description, numerous specific details are set forth such as circuits, etc., in order to provide a thorough understanding of the present invention. In other instances, well-known structures and techniques have not been shown in detail in order not to unnecessarily obscure the present invention.
DEFINITIONS
To provide a foundation for understanding the description of the embodiments of the present invention, the following definitions are provided. Bit X through Bit Y: defines a subfield of binary number. For example, bit six through bit zero of the byte 0011 10102 (shown in base two) represent the subfield 1 1 10102- The '2' following a binary number indicates base 2. Therefore, 10002 equals 8ιo> while Fi equals 15ιo.
Rx: is a register. A register is any device capable of storing and providing data. Further functionality of a register is described below. A register is not necessarily part of the processor's package.
DEST is a data address, SRC1 is a data address, SRC2 is a data address.
Result: is the data to be stored in the register addressed by
DEST. Sourcel: is the data stored in the register addressed by SRC1. Source2: is the data stored in the register addressed by SRC2.
COMPUTER SYSTEM
Referring to Figure 1, a computer system upon which an embodiment of the present invention can be implemented is shown as computer system 100. Computer system 100 comprises a bus 101, or other communications hardware and software, for communicating information, and a processor 109 coupled with bus 101 for processing information. Computer system 100 further comprises a random access memory (RAM) or other dynamic storage device (referred to as main memory 104), coupled to bus 101 for storing information and instructions to be executed by processor 109. Main memory 104 also may be used for storing temporary variables or other intermediate information during execution of instructions by processor 109. Computer system 100 also comprises a read only memory (ROM) 106, and/or other static storage device, coupled to bus 101 for storing static infoimation and instructions for processor 109. Data storage device 107 is coupled to bus 101 for storing information and instructions. Memory includes any data storage medium, such as main memory 104, cache memory, registers, ROM, and other static storage devices.
Furthermore, a data storage device 107, such as a magnetic disk or optical disk, and its corresponding disk drive, can be coupled to computer system 100. Computer system 100 can also be coupled via bus 101 to a display device 121 for displaying information to a computer user. Display device 121 can include a frame buffer, specialized graphics rendering devices, a cathode ray tube (CRT), and/or a flat panel display. An alphanumeric input device 122, including alphanumeric and other keys, is typically coupled to bus 101 for communicating information and command selections to processor 109. Another type of user input device is cursor control 123, such as a mouse, a trackball, a pen, a touch screen, or cursor direction keys for communicating direction information and command selections to processor 109, and for controlling cursor movement on display device 121. This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), which allows the device to specify positions in a plane. However, this invention should not be limited to input devices with only two degrees of freedom.
Another device which may be coupled to bus 101 is a hard copy device 124 which may be used for printing instructions, data, or other information on a medium such as paper, film, or similar types of media. Additionally, computer system 100 can be coupled to a device for sound recording, and/or playback 125, such as an audio digitizer coupled to a microphone for recording information. Further, the device may include a speaker which is coupled to a digital to analog (D/A) converter for playing back the digitized sounds. Also, computer system 100 can be a terminal in a computer network (e.g., a LAN). Computer system 100 would then be a computer subsystem of a computer system including a number of networked devices. Computer system 100 optionally includes video digitizing device 126. Video digitizing device 126 can be used to capture video images that can be transmitted to others on the computer network.
Computer system 100 is useful for supporting computer supported cooperation (CSC - the integration of teleconferencing with mixed media data manipulation), 2D/3D graphics, image processing, video compression/decompression, recognition algorithms and audio manipulation. PR CESSOR
Figure 2 illustrates a detailed diagram of processor 109. Processor 109 can be implemented on one or more substrates using any of a number of process technologies, such as, BiCMOS, CMOS, and NMOS. Processor 109 comprises a decoder 202 for decoding control signals and data used by processor 109. Data can then be stored in register file 204 via internal bus 205. As a matter of clarity, the registers of an embodiment should not be limited in meaning to a particular type of circuit. Rather, a register of an embodiment need only be capable of storing and providing data, and performing the functions described herein.
Depending on the type of data, the data may be stored in integer registers 201, registers 209, status registers 208, or instruction pointer register 21 1. Other registers can be included in the register file 204, for example, floating point registers. In one embodiment, integer registers 201 store thirty-two bit integer data. In one embodiment, registers 209 contains eight registers, Ro 212a through R7 212h. Each register in registers 209 is sixty-four bits in length. Ri 212a, R2 212b and R3 212c are examples of individual registers in registers 209. Thirty-two bits of a register in registers 209 can be moved into an integer register in integer registers 201. Similarly, an value in an integer register can be moved into thirty- two bits of a register in registers 209.
Status registers 208 indicate the status of processor 109. Instruction pointer register 211 stores the address of the next instruction to be executed. Integer registers 201, registers 209, status registers 208, and instruction pointer register 211 all connect to internal bus 205. Any additional registers would also connect to the internal bus 205.
In another embodiment, some of these registers can be used for two different types of data. For example, registers 209 and integer registers 201 can be combined where each register can store either integer data or packed data. In ' other embodiment, registers 209 can be used as floating point registers. In this embodiment, packed data can be stored in registers 209 or floating point data. In one embodiment, the combined registers are sixty-four bits in length and integers are represented as sixty-four bits. In this embodiment, in storing packed data and integer data, the registers do not need to differentiate between the two data types. Functional unit 203 performs the operations carried out by processor 109. Such operations may include shifts, addition, subtraction and multiplication, etc. Functional unit 203 connects to internal bus 205. Cache 206 is an optional element of processor 109 and can be used to cache data and/or control signals from, for example, main memory 104. Cache 206 is connected to decoder 202, and is connected to receive control signal 207.
Figure 3 illustrates the general operation of processor 109. That is, Figure 3 illustrates the steps followed by processor 109 while performing an operation on packed data, performing an operation on unpacked data, or performing some other operation. For example, such operations include a load operation to load a register in register file 204 with data from cache 206, main memory 104, read only memory (ROM) 106, or data storage device 107. In one embodiment of the present invention, processor 109 supports most of the instructions supported by the Intel 80486™, available from Intel Corporation of Santa Clara, California. In another embodiment of the present invention, processor 109 supports all the operations supported by the Intel 80486™, available from Intel Coφoration of Santa Clara, California. In another embodiment of the present invention, processor 109 supports all the operations supported by the Pentium™ processor, the Intel 80486™ processor, the 80386™ processor, the Intel 80286™ processor, and the Intel 8086™ processor, all available from Intel Coφoration of Santa Clara, California. In another embodiment of the present invention, processor 109 supports all the operations supported in the IA™ - Intel Architecture, as defined by Intel Coφoration of Santa Clara, California (see Microprocessors. Intel Data Books volume 1 and volume 2, 1992 and 1993, available from Intel of Santa Clara, California). Generally, processor 109 can support the present instruction set for the Pentium™ processor, but can also be modified to incoφorate future instructions, as well as those described herein. What is important is that general processor 109 can support previously used operations in addition to the operations described herein. At step 301, the decoder 202 receives a control signal 207 from either the cache 206 or bus 101. Decoder 202 decodes the control signal to determine the operations to be performed.
Decoder 202 accesses the register file 204, or a location in another memory, at step 302. Registers in the register file 204, or memory locations in another memory, are accessed depending on the register address specified in the control signal 207. For example, for an operation on packed data, control signal 207 can include SRCl, SRC2 and DEST register addresses. SRCl is the address of the first source register. SRC2 is the address of the second source register. In some cases, the SRC2 address is optional as not all operations require two source addresses. If the SRC2 address is not required for an operation, then only the SRCl address is used. DEST is the address of the destination register where the result data is stored. In one embodiment, SRCl or SRC2 is also used as DEST. SRCl, SRC2 and DEST are described more fully in relation to Figure 6a and Figure 6b. The data stored in the corresponding registers is referred to as Source 1 , Source2, and Result respectively. Each of these data is sixty-four bits in length.
In another embodiment of the present invention, any one, or all, of SRCl, SRC2 and DEST, can define a memory location in the addressable memory space of processor 109. For example, SRCl may identify a memory location in main memory 104 while SRC2 identifies a first register in integer registers 201 , and
DEST identifies a second register in registers 209. For simplicity of the description herein, references are made to the accesses to the register file 204, however, these accesses could be made to another memory instead.
In another embodiment of the present invention, the operation code only includes two addresses, SRCl and SRC2. In this embodiment, the result of the operation is stored in the SRCl or SRC2 register. That is SRCl (or SRC2) is used as the DEST. This type of addressing is compatible with previous CISC instructions having only two addresses. This reduces the complexity in the decoder 202. Note, in this embodiment, if the data contained in the SRCl register is not to be destroyed, then that data is copied into another register before the execution of the operation. The copying would require an additional instruction. To simplify the description herein, the three address addressing scheme will be described (i.e. SRCl, SRC2, and DEST). However, it should be remembered that the control signal, in one embodiment, may only include SRCl and SRC2, and that SRCl (or SRC2) identifies the destination register.
Where the control signal requires an operation, at step 303, functional unit 203 will be enabled to perform this operation on accessed data from register file 204. Once the operation has been performed in functional unit 203, at step 304, the result is stored back into register file 204 or another memory according to requirements of control signal 207.
D ATA STORAP.E AND FORM A TS
Figure 4a illustrates some of the data formats as may be used in the computer system of Figure 1. These data formats are fixed point. Processor 109 can manipulate these data formats. Multimedia algorithms often use these data formats. A byte 401 contains eight bits of information. A word 402 contains sixteen bits of information, or two bytes. A doubleword 403 contains thirty-two bits of information, or four bytes. Thus, processor 109 executes control signals that may operate on any one of these memory data formats.
In the following description, references to bit, byte, word, and doubleword subfields are made. For example, bit six through bit zero of the byte 001110102 (shown in base 2) represent the subfield 1 1 10102.
Figure 4b through Figure 4d illustrate in-register representations used in one embodiment of the present invention. For example, unsigned byte in-register representation 410 can represent data stored in a register in integer registers 201. In one embodiment, a register, in integer registers 201, is sixty-four bits in length. In another embodiment, a register, in integer registers 201, is thirty-two bits in length. For the simplicity of the description, the following describes sixty-four bit integer registers, however, thirty-two bit integer registers can be used. In other embodiments, other sizes of registers may be used.
Unsigned byte in-register representation 410 illustrates processor 109 storing a byte 401 in integer registers 201, the first eight bits, bit seven through bit zero, in that register are dedicated to the data byte 401. These bits are shown as (b). To properly represent this byte, the remaining 56 bits must be zero. For an signed byte in-register representation 411, integer registers 201 store the data in the first seven bits, bit six through bit zero, to be data. The seventh bit represents the sign bit, shown as an {s}. The remaining bit sixty-three through bit eight are the continuation of the sign for the byte. Unsigned word in-register representation 412 is stored in one register of integer registers 201. Bit fifteen through bit zero contain an unsigned word 402. These bits are shown as {w}. To properly represent this word, the remaining bit sixty-three through bit sixteen must be zero. A signed word 402 is stored in bit fourteen through bit zero as shown in the signed word in-register representation 413. The remaining bit sixty-three through bit fifteen is the sign field.
A doubleword 403 can be stored as an unsigned doubleword in-register representation 414 or a signed doubleword in-register representation 415. Bit thirty-one through bit zero of an unsigned doubleword in-register representation 414 are the data. These bits are shown as {d}. To properly represent this unsigned doubleword, the remaining bit sixty-three through bit thirty-two must be zero. Integer registers 201 stores a signed doubleword in-register representation 415 in its bit thirty through bit zero; the remaining bit sixty-three through bit thirty-one are the sign field.
As indicated by the above Figure 4b through Figure 4d, storage of some data types in a sixty-four bit wide register is an inefficient method of storage. For example, for storage of an unsigned byte in-register representation 410 bit sixty- three through bit eight must be zero, while only bit seven through bit zero may contain non-zero bits. Thus, a processor storing a byte in a sixty-four bit register uses only 12.5% of the register's capacity. Similarly, only the first few bits of operations performed by functional unit 203 will be important.
Figure 5a illustrates the data formats for packed data. Three packed data formats are illustrated; packed byte 501, packed word 502, and packed doubleword 503. Packed byte, in one embodiment of the present invention, is sixty-four bits long containing eight data elements. Each data element is one byte long. Generally, a data element is an individual piece of data that is stored in a single register (or memory location) with other data elements of the same length. In one embodiment of the present invention, the number of data elements stored in a register is sixty-four bits divided by the length in bits of a data element.
Packed word 502 is sixty-four bits long and contains four word 402 data elements. Each word 402 data element contains sixteen bits of information.
Packed doubleword 503 is sixty-four bits long and contains two doubleword 403 data elements. Each doubleword 403 data element contains thirty- two bits of information.
Figure 5b through Figure 5d illustrate the in-register packed data storage representation. Unsigned packed byte in-register representation 510 illustrates the storage of packed byte 501 in one of the registers Ro 212a through Rn 212af. Information for each byte data element is stored in bit seven through bit zero for byte zero, bit fifteen through bit eight for byte one, bit twenty-three through bit sixteen for byte two, bit thirty-one through bit twenty-four for byte three, bit thirty-nine through bit thirty-two for byte four, bit forty-seven through bit forty for byte five, bit fifty-five through bit forty-eight for byte six and bit sixty-three through bit fifty-six for byte seven. Thus, all available bits are used in the register. This storage arrangement increases the storage efficiency of the processor. As well, with eight data elements accessed, one operation can now be performed on eight data elements simultaneously. Signed packed byte in-register representation 511 is similarly stored in a register in registers 209. Note that only the eighth bit of every byte data element is the necessary sign bit; other bits may or may not be used to indicate sign.
Unsigned packed word in-register representation 512 illustrates how word three through word zero are stored in one register of registers 209. Bit fifteen through bit zero contain the data element information for word zero, bit thirty-one through bit sixteen contain the information for data element word one, bit forty- seven through bit thirty-two contain the information for data element word two and bit sixty-three through bit forty-eight contain the information for data element word three. Signed packed word in-register representation 513 is similar to the unsigned packed word in-register representation 512. Note that only the sixteenth bit of each word data element contains the necessary sign indicator.
Unsigned packed doubleword in-register representation 514 shows how registers 209 store two doubleword data elements. Doubleword zero is stored in bit thirty-one through bit zero of the register. Doubleword one is stored in bit sixty-three through bit thirty-two of the register. Signed packed doubleword in- register representation 515 is similar to unsigned packed doubleword in-register representation 514. Note that the necessary sign bit is the thirty-second bit of the doubleword data element.
As mentioned previously, registers 209 may be used for both packed data and integer data. In this embodiment of the present invention, the individual programming processor 109 may be required to track whether an addressed register, Ri 212a for example, is storing packed data or simple integer/fixed point data. In an alternative embodiment, processor 109 could track the type of data stored in individual registers of registers 209. This alternative embodiment could then generate errors if, for example, a packed addition operation were attempted on simple/fixed point integer data.
CONTROL SIGNAL FOR M ATS
The following describes one embodiment of control signal formats used by processor 109 to manipulate packed data. In one embodiment of the present invention, control signals are represented as thirty-two bits. Decoder 202 may receive control signal 207 from bus 101. In another embodiment, decoder 202 can also receive such control signals from cache 206.
Figure 6a illustrates a general format for a control signal operating on packed data. Operation field OP 601, bit thirty-one through bit twenty-six, provides information about the operation to be performed by processor 109; for example, packed addition, packed subtraction, etc.. SRCl 602, bit twenty-five through twenty, provides the source register address of a register in registers 209. This source register contains the first packed data, Source 1 , to be used in the execution of the control signal. Similarly, SRC2 603, bit nineteen through bit fourteen, contains the address of a register in registers 209. This second source register contains the packed data, Source2, to be used during execution of the operation. DEST 605, bit five through bit zero, contains the address of a register in registers 209. This destination register will store the result packed data, Result, of the packed data operation.
Control bits SZ 610, bit twelve and bit thirteen, indicates the length of the data elements in the first and second packed data source registers. If SZ 610 equals 012, then the packed data is formatted as packed byte 501. If SZ 610 equals 102, then the packed data is formatted as packed word 502. SZ 610 equaling 002 or 112 is reserved, however, in another embodiment, one of these values could be used to indicate packed doubleword 503.
Control bit T 611, bit eleven, indicates whether the operation is to be carried out with saturate mode. If T 611 equals one, then a saturating operation is performed. If T 611 equals zero, then a nonsaturating operation is performed. Saturating operations will be described later.
Control bit S 612, bit ten, indicates the use of a signed operation. If S 612 equals one, then a signed operation is performed. If S 612 equals zero, then an unsigned operation is performed. Figure 6b illustrates a second general format for a control signal operating on packed data. This format corresponds with the general integer opcode format described in the "Pentium™ Processor Family User's Manual," available from Intel Coφoration, Literature Sales, P.O. Box 7641, Mt. prospect, IL, 60056- 7641. Note that OP 601, SZ 610, T 611, and S 612 are all combined into one large field. For some control signals, bits three through five are SRCl 602. In one embodiment, where there is a SRCl 602 address, then bits three through five also correspond to DEST 605. In an alternate embodiment, where there is a SRC2 603 address, then bits zero through two also correspond to DEST 605. For other control signals, like a packed shift immediate operation, bits three through five represent an extension to the opcode field. In one embodiment, this extension allows a programmer to include an immediate value with the control signal, such as a shift count value. In one embodiment, the immediate value follows the control signal. This is described in more detail in the "Pentium™ Processor Family User's Manual," in appendix F, pages F- 1 through F-3. Bits zero through two represent SRC2 603. This general format allows register to register, memory to register, register by memory, register by register, register by immediate, register to memory addressing. Also, in one embodiment, this general format can support integer register to register, and register to integer register addressing. DESCRIPTION OF S ATI IR ATE/UNS ATUR A TE
As mentioned previously, T 61 1 indicates whether operations optionally saturate. Where the result of an operation, with saturate enabled, overflows or underflows the range of the data, the result is clamped. Clamping means setting the result to a maximum or minimum value should a result exceed the range's maximum or minimum value. In the case of underflow, saturation clamps the result to the lowest value in the range and in the case of overflow, to the highest vilue. The allowable range for each data format is shown in Table 1. Data Format Minimum Value Maximum Value
Unsigned Byte 0 255
Signed Byte -128 127
Unsigned Word 0 65535
Signed Word -32768 32767
Unsigned Doubleword 0 26 -1
Signed Doubleword -263 2 3-1
Table 1
As mentioned above, T 611 indicates whether saturating operations are being performed. Therefore, using the unsigned byte data format, if an operation's result = 258 and saturation was enabled, then the result would be clamped to 255 before being stored into the operation's destination register. Similarly, if an operation's result = -32999 and processor 109 used signed word data format with saturation enabled, then the result would be clamped to -32768 before being stored into the operation's destination register.
SHIFT O PERATION
In one embodiment of the present invention, the performance of CSC applications is improved by not only supporting a standard CISC instruction set (unpacked data operations), but by supporting a shift operation on packed data. The packed shift can be used to increase the speed of fixed-point implements of Fast Fourier Transforms, Cosine Transforms, and other digital image and audio signal processing algorithms.
In one embodiment of the present invention, the SRCl register contains the data (Source 1) to be shifted, the SRC2 register contains the data (Source2) representing the shift count, and DEST register will contain the result of the shift (Result). That is, Source 1 will have each data element independently shifted by the shift count. In one embodiment, Source2 is inteφreted as an unsigned 64 bit scalar. In another embodiment, Source2 is packed data and contains shift counts for each corresponding data element in Source 1. In one embodiment of the present invention, both arithmetic shifts and logical shifts are supported. An arithmetic shift, shifts the bits of each data element down by a specified number, and fills the high order bit of each data element with the initial value of the sign bit. A shift count greater than seven for packed byte data, greater than fifteen for packed word data, or greater than thirty-one for packed doubleword, causes the each Result data element to be filled with the initial value of the sign bit. A logical shift can operate by shifting bits up or down. In a shift right logical, the high order bits of each data element are filled with zeroes. A shift left logical causes the least significant bits of each data element to be filled with zeroes.
In one embodiment of the present invention, a shift right arithmetic, the shift right logical, and the shift left logical operations are supported for packed bytes and packed words. In another embodiment of the present invention, these operations are supported for packed doublewords also. Figure 7 illustrates one embodiment of a method of performing a shift operation on packed data. This embodiment can be implemented in the processor 109 of Figure 2.
At step 701, decoder 202 decodes control signal 207 received by processor 109. Thus, decoder 202 decodes: the operation code for the appropriate shift operation; SRCl 602, SRC2 603 and DEST 605 addresses in integer registers 209; saturate/unsaturate (not necessarily needed for shift operations), signed/unsigned (again not necessarily needed), and length of the data elements in the packed data.
At step 702, via internal bus 205, decoder 202 accesses integer registers 209 in register file 204 given the SRCl 602 and SRC2 603 addresses. Integer registers 209 provides functional unit 203 with the packed data stored in the SRCl 602 register (Source 1), and the scalar shift count stored in SRC2 603 register (Source2). That is, integer registers 209 communicate the packed data to functional unit 203 via internal bus 205. At step 703, decoder 202 enables functional unit 203 to perform the appropriate packed shift operation. Decoder 202 further communicates, via internal bus 205, the size of data elements, the type of shift operation, and the direction of the shift (for logical shifts). At step 710, the size of the data element determines which step is to be executed next. If the size of the data elements is eight bits (byte data), then functional unit 203 performs step 712. However, if the size of the data elements in the packed data is sixteen bits (word data), then functional unit 203 performs step 714. In one embodiment, only eight bit and sixteen bit data element size packed shifts are supported. However, in another embodiment, a thirty-two bit data element size packed shift is also supported. In other embodiments, other size data elements may be supported.
Assuming the size of the data elements is eight bits, then step 712 is executed. In step 712, the following is performed. Source 1 bits seven through zero are shifted by the shift count (Source2 bits sixty-three through zero) generating Result bits seven through zero. Source 1 bits fifteen through eight are shifted by the shift count generating Result bits fifteen through eight. Source 1 bits twenty-three through sixteen are shifted by the shift count generating Result bits twenty-three through sixteen. Source 1 bits thirty-one through twenty-four are shifted by the shift count generating Result bits thirty-one through twenty-four. Sourcel bits thirty-nine through thirty-two are shifted by the shift count generating Result bits thirty-nine through thirty-two. Sourcel bits forty-seven through forty are shifted by the shift count generating Result forty-seven through forty. Sourcel bits fifty-five through forty-eight are shifted by the shift count generating Result bits fifty-five through forty-eight. Sourcel bits sixty-three through fifty-six are shifted by the shift count generating Result bits sixty-three through fifty-six.
Assuming the size of the data elements is sixteen bits, then step 714 is executed. In step 714, the following is performed. Sourcel bits fifteen through zero are shifted by the shift count generating Result bits fifteen through zero. Sourcel bits thirty-one through sixteen are shifted by the shift count generating Result bits thirty-one through sixteen. Sourcel bits forty-seven through thirty-two a e shifted by the shift count generating Result bits forty-seven through thirty-two. Sourcel bits sixty-three through forty-eight are shifted by the shift count generating Result bits sixty-three through forty-eight.
In one embodiment, the shifts of step 712 are performed simultaneously. However, in another embodiment, these shifts are performed serially. In another embodiment, some of these shifts are performed simultaneously and some are performed serially. This discussion applies to the shifts of step 714 as well. At step 720, the Result is stored in the DEST register.
Table 2 illustrates the in-register representation of packed shift right arithmetic operation. The first row of bits is the packed data representation of Sourcel. The second row of bits is the data representation of Source2. The third row of bits is the packed data representation of the Result. The number below each data element bit is the data element number. For example, Sourcel data element three is 100000002-
Figure imgf000019_0001
Table 2 Table 3 illustrates the in-register representation of packed shift right logical operation on packed byte data.
Figure imgf000020_0001
Table 3
Table 4 illustrates the in-register representation of packed shift left logical operation on packed byte data.
Figure imgf000020_0002
Table 4
Circuit Descriptions
The convention followed in the subsequent descriptions of circuits is that the bus names correspond to the signal names on that bus. For example, a Sourcel signal is on a Sourcel bus. Busses with multiple bits may be designated with particular bit ranges. For example, Sourcel [31 : 16] indicates that the bus corresponds to bits 31 through 16 of the Sourcel bus. The whole bus may be referred to as the Sourcel bus or Sourcel [63:0] (for a 64 bit bus). The complement of a signal may be referred to by appending an "#" after the signal name. For example, the complement of the Sourcel signal on the Sourcel bus is the Sourcel# signal on the Sourcel# bus.
PACKED SHIFT CIR CUIT
In one embodiment, the shift operation can occur on multiple data elements in the same number of clock cycles as a single shift operation on unpacked data. To achieve execution in the same number of clock cycles, parallelism is used. That is, registers are simultaneously instructed to perform the shift operation on the data elements. This is discussed in more detail below. Figure 8 illustrates one embodiment of a portion of a circuit that can perform a shift operation on packed data in the same number of clock cycles as a shift operation on unpacked data.
Figure 8 illustrates the use of a modified byte slice shift circuit, byte slice stagei 899. Each byte slice, except for the most significant data element byte slice, includes a shift unit and bit control. The most significant data element byte slice need only have a shift unit.
Shift unitj 811 and shift unitj+i 871 each allow eight bits from Sourcel to be shifted by the shift count. In one embodiment, each shift unit operates like a known eight bit shift circuit. Each shift unit has a Sourcel input, a Source2 input, a control input, a next stage signal, a last stage signal, and a result output. Therefore, shift uniti 811 has Sourceli 831 input, Source2[63:0] 833 input, control! 801 input, next stagei 813 signal, last stagei 812 input, and a result stored in result registerj 851. Therefore, shift uniti+i 871 has Sourceli+i 832 input, Source2[63:0] 833 input, controli+i 802 input, next stagej+l 873 signal, last stagei+i 872 input, and a result stored in result registeri+i 852.
The Sourcel input is typically an eight bit portion of Sourcel. The eight bits represents the smallest type of data element, one packed byte data element. Source2 input represents the shift count. In one embodiment, each shift unit receives the same shift count from Source2[63:0] 833. Operation control 800 transmits control signals to enable each shift unit to perform the required shift. The control signals are determined from the type of shift (arithmetic/logical) and the direction of the shift. The next stage signal is received from the bit control for that shift unit. The shift unit will shift the most significant bit out/in on the next stage signal, depending on the direction of the shift (left/right). Similarly, each shift unit will shift the least significant bit out/in on the last stage signal, depending on the direction of the shift (right left). The last stage signal being received from the bit control unit of the previous stage. The result ouφut represents the result of the shift operation on the portion of Sourcel the shift unit is operating upon.
Bit controli 820 is enabled from operation control 800 via packed data enablei 806. Bit controli 820 controls next stagei 813 and last stagej+i 872. Assume, for example, shift unitj 811 is responsible for the eight least significant bits of Sourcel, and shift uniti+i 871 is responsible for the next eight bits of Sourcel. If a shift on packed bytes is performed, bit controli 820 will not allow the least significant bit from shift uniti+i 871 to be communicated with the most significant bit of shift uniti 811. However, a shift on packed words is performed, then bit controli 820 will allow the least significant bit from shift unitj+i 871 to be communicated with the most significant bit of shift unitj 811
For example, in Table 5, a packed byte arithmetic shift right is performed. Assume that shift uniti+i 871 operates on data element one, and shift uniti 811 operates on data element zero. Shift uniti+i 871 shifts its least significant bit out. However operation control 800 will cause bit controli 820 to stop the propagation of that bit, received from last stagej+i 821, to next stagei 813. Instead, shift uniti 811 will fill the high order bits with the sign bit, Sourcel [7].
.. . OOOOl l 100010 10 00
Shift 7 Shift 6 Shift 5 Shift 4 Shift J Shift 2 Shift J Shift °
. .. . . . . . . . . . 0000000
1
= = = = = =: — =
. .. . .. OOOOl l 010001 1 1 00
7 6 5 4 3 2 / 0
Table 5
However, if a packed word arithmetic shift is performed, then the least significant bit of shift uniti+i 871 will be communicated to the most significant bit of shift uniti 811. Table 6 illustrates this result. This communication would be allowed for packed doubleword shifts as well.
... 000011 10 10001000
Shift S Shift 2 Shift J Shift
00000001
= =r = =
.. . 0000011 1 01000100
3 2 1 0
Table 6
Each shift unit is optionally connected to a result register. The result register temporarily stores the result of the shift operation until the complete result, Result[63:0] 860 can be transmitted to the DEST register. For a complete sixty-four bit packed shift circuit, eight shift units and seven bit control units are used. Such a circuit can also be used to perform a shift on a sixty-four bit unpacked data, thereby using the same circuit to perform the unpacked shift operation and the packed shift operation.
Another Packed Shift Circuit
FIG. 9 illustrates another embodiment of a packed shift circuit. In one embodiment, the packed shift circuit is capable of performing arithmetic shift operations on multiple data types. For example, the packed shift circuit may be capable of performing a packed shift on data elements which each contain one 64- bit value, two 32-bit data values, or four 16-bit values. This embodiment may also be implemented to be capable of alternatively or additionally performing logical shift operations, right shifts, and/or left shifts.
A barrel shifter 905 is used to shift Sourcel by the count specified in the low order bits of Source2. However, if Sourcel is a packed data type, the barrel shifter shifts the low order bits of each of the values in the packed data type into the high order bits of the next lowest order value to produce a shifted packed intermediate result. A correction circuit is used to replace each of these bits with the most significant bit of the corresponding value if it is a signed shift operation, and a zero if it is a logical shift operation. In one embodiment, if at least one of the high order bits that are not required to specify the shift count is one, all the bits of the shifted packed intermediate result are replaced with the sign bit (for right arithmetic shifts) or zero (for logical shifts). One embodiment of the barrel shifter 905 is described with reference to FIG. 10. The shift data is driven on a Sourcel bus 901. The shift count is driven on a Source2 bus 902 in two portions, an actual shift count bus, Source2[5:0] 903, and an overflow shift count bus, Source2[63:6J 904. The six bits required to specify a shift count ranging from 0 to 63 are specified on the actual shift count bus 903. The rest of the 64-bit data field is specified on the overflow shift count bus 904. The shift data bus 901, the actual shift count bus 903, and a left shift bus 900 are coupled to the inputs of a barrel shifter. In one embodiment, the barrel shifter contains a set of muxes that use complex gates (described below) to drive a set of 16-1 decoders which form one stage of the barrel shifter. The barrel shifter 905 drives the shift output bus 919. Muxes 906-909 drive the replacements bits that are used to correct the appropriate bits of the shift output bus 914. Each of the muxes 906-909 corresponding to the most- significant to the least significant word of the shift output bus 914, respectively. A right-shift arithmetic word (rsadword) bus 928 is coupled to the most-significant select bit of each of the muxes 906-909 to indicate whether the shift operation is an arithmetic right shift that operated on packed doubleword data. A right-shift arithmetic word (rsaword) bus 929 is coupled to the least- significant select bit of each of the muxes 906-909 to indicate whether the shift operation is an arithmetic right shift that operated on packed word data. The rsadword signal and the rsaword signal may be generated based on the decoding of the control signal 207, for example. A zero is driven through a set of zero busses 924-927 which are coupled to the zero input of each of the muxes 906-909, respectively. A zero is used to correct the selected bits on the shift ouφut bus 919 when the operation is neither a right shift arithmetic word or right shift arithmetic doubleword operation. The operation may be a left shift or a logical shift, for example. When the operation is a rsaword operation, the most significant bit of each word is used to correct the selected bit of each corresponding word of the shifted packed word data on the shift output bus 919. A Sourcel [63] bus 920, a Sourcel [47] bus 921, a Sourcel [31] bus 922, and a Sourcel [15] bus 923 are coupled to the corresponding 1 inputs of each of the muxes 906-909, respectively. The sign bit of each of the words of the packed word data are driven onto the corresponding bus. When the operation is a rsadword operation, the most significant bit (which is the sign bit) of each word is used to correct the selected bits of each corresponding word of the shifted packed word data on the shift ouφut bus 919. The Sourcel [63] bus 920 and the Sourcel [31] bus 922 are coupled to the corresponding two inputs of the most significant pair of muxes 906- 907 and the least-significant pair of muxes 908-909, respectively. These sign bit of each of the corresponding doublewords are driven onto the corresponding bus. Each of the muxes 906-909 drives a corresponding replacement bit bus 996-999. The Source2[5:0] bus 903 is also coupled to the input of a less-than-or- equal-to (<=) decoder logic 930 which drives a 64-bit decoded signal on the decoded bus 938. The decoded signal is a field of zeroes with ones in the bit positions corresponding to numbers less than or equal to the value on the Source2[5:0] bus 903. The bits that are one correspond to the bits positions of the shift ouφut bus that should be corrected if the operation were a right shift of a 64- bit scalar data. The value on the decoded bus 938 is received and manipulated by a fixshift circuit 932 to produce the values on the fixdata busses 934-937 according to the operation and data type specified on the control bus 933 such that the appropriate bits of each value of the packed data are corrected. For example, if a right shift of packed word data were indicated on the control bus 933 and a shift count of 6 was indicated on the Source2[5:0] bus 903, the fixshift circuit 932 would replicate the most-significant 6 ones produced on the 64-bit decoded bus 938 on the most-significant 6 bits of each of the 16-bit fixdata busses 934-937. Alternatively, if a left shift of packed word data were indicated on the control bus 933 and a shift count of 6 was indicated on the Source2[5:0] bus 903, the fixshift circuit 932 would replicate the most-significant 6 ones produced on the 64-bit decoded bus 938 on the least-significant 6 bits of each of the 16-bit fixdata busses 934-937. The Source2[63:6] bus 904 is input to NOR logic 931 which produces an output on the NOR bus 939 that is one only if all the bits of the Source2[63:6] bus 904 are zero. When the NOR bus 939 is low, the Fixshift circuit 932 indicates that all bits should be replaced. More details of the Fixshift circuit 932 is provided below.
Each of the bits of the most significant word of the shift ouφut bus 919 (So[63:48]) are coupled to the zero input of a corresponding one of the set of muxes 910. The replacement bit bus 996 which corresponds to the replacement bit for the most significant word is coupled to the one input of each of the set of muxes 910. Each bit of the fixdata bus 934 is coupled to the corresponding one of the set of muxes 910 to indicate whether the corresponding bit of the So[63:48] data or the corresponding bit on the replacement bit bus 996 is driven onto a corresponding bit of the fixed shift output FSo)[63:48] bus. The inputs and ouφuts of muxes 911-913 are similarly coupled, as illustrated in FIG. 9.
While FIG. 9 illustrates one circuit for implementation of a shifter circuit, any number of well-known shifter circuits providing the equivalent function.
Fixshift circuit
FIG. 10 illustrates one embodiment of the fixshift circuit 932. The control bus 933 comprises a left-shift word (lsw) bus 1000, a right-shift word doubleword (rswd) bus 1001, a left-shift doubleword quadword (lsdq) bus 1002, a left-shift word doubleword quadword (lswdq) bus 1003, a right-shift word (rsw) bus 1004, a right-shift doubleword (rsd) bus 1005, a right-shift quadword (rsq) bus 1006, a left-shift doubleword (lsd) bus 1007, a right-shift word doubleword quadword (rswdq) bus 1008, a left-shift word doubleword (lswd) bus 1009, a right-shift doubleword quadword (rsdq) bus 1010, and a left-shift quadword (lsq) bus 1011. These signals may be generated based on the decoding of the control signal 207, for example. The names of the individual control signals indicate when they are asserted (active). These signals are a one when they are active (active high). For example, the lsw bus 1000 is only active when the operation is a left-shift of a packed word data. The rswd bus 1001 is only active when the operation is a right-shift operation of a packed word data or a packed doubleword data. Each of the busses of the control bus 933 are coupled to a corresponding one of inverters 1020-1031 which drive one of the corresponding busses comprising an bus 1040, an rswd# bus 1041 , an lsdq# bus 1042, an lswdq# bus 1043, an rsw# bus 1044, an rsd# bus 1045, an rsq# bus 1046, an lsd# bus 1047, an rswdq# bus 1048, an lswd# bus 1049, an rsdq# bus 1050, and an lsq# bus 1051. These signals are zero when they are active (active low).
Each of a set of muxes 1060 drives a bit of the fixdata bus 937 to indicate which bits of the least significant word of the shift output bus 919 (referring to FIG. 9) should be replaced. The lswdq# bus 1043 is coupled to the select 0 input of each of the set of muxes 1060 to select each data 0 input whenever the operation is a left-shift of either a word, doubleword, or quadword. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1060. For example, the three least significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a lswdq with a shift count of 3. The rsw# bus 1044 is coupled to the select 1 input of each of the set of muxes 1060 to select each data 1 input whenever the operation is a right-shift of a word. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1060 in reverse order (The most significant bit of the decoded bus 938 drives the one of the set of muxes 1060 that drives the least significant bit of the fixdata bus 937, the second most significant bit of the decoded bus 938 drives the one of the set of muxes 1060 that drives the second least significant bit of the fixdata bus 937, etc.). For example, the three most significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a rsw with a shift count of 3. The rsd# bus 1045 is coupled to the select 2 input of each of the set of muxes 1060 to select each data 2 input whenever the operation is a right-shift of a doubleword. A bit of the second least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1060 in reverse order. For example, the three most significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a rsd with a shift count of 19. The right shift shifts through the most significant word of the least significant doubleword before it begins to effect the least significant word. The rsq# bus 1046 is coupled to the select 3 input of each of the set of muxes 1060 to select each data 3 input whenever the operation is a right- shift of a quadword. A bit of the most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1060 in reverse order. For example, the three most significant bits of the fixdata bus 937 would indicate that the corresponding bits should be replaced for a rsq with a shift count of 51. The right shift shifts through the most significant 48 bits of the quadword before it begins to effect the least significant word.
The lswdq bus 1003, the rsw bus 1004, the rsd bus 1005, and the rsq bus 1006 are coupled to a NOR gate 1013 which drives a zero bus 1017. The zero bus 1017 is coupled to the control 0 (cO) input of each of the set of muxes 1060 to force a zero on the outputs when none of the select inputs are active. In addition the NOR bus 939 is coupled to the control 1 (cl) input of each of the muxes to force a one on the outputs when at least one of the most-significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift output bus 719 to be replaced. This produces a result that is consistent with a Sourcel value that is extended beyond the most significant and least significant bits of the register. If such a value is shifted by greater than the register size, the sign bit (for right arithmetic shifts) or the zero bits (for logical shifts) should replace the whole field. Each of a set of muxes 1061 drives a bit of the fixdata bus 936 to indicate which bits of the second least significant word of the shift output bus 919 (referring to FIG. 9) should be replaced. The lsw# bus 1040 is coupled to the select 0 input of each of the set of muxes 1061 to select each data 0 input whenever the operation is a left-shift of a word. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1061. For example, the three least significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a lsw with a shift count of 3. The rswd# bus 1041 is coupled to the select 1 input of each of the set of muxes 1061 to select each data 1 input whenever the operation is a right-shift of a word or a doubleword. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1061 in reverse order. For example, the three most significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a rswd with a shift count of 3. The lsdq# bus 1042 is coupled to the select 2 input of each of the set of muxes 1061 to select each data 2 input whenever the operation is a left-shift of a doubleword or a quadword. A bit of the second least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1061. For example, the three least significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a lsdq with a shift count of 19. The left shift shifts through the least significant word before it begins to effect the second least significant word. The rsq# bus 1046 is coupled to the select 3 input of each of the set of muxes 1061 to select each data 3 input whenever the operation is a right-shift of a quadword. A bit of the second most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1061 in reverse order. For example, the three most significant bits of the fixdata bus 936 would indicate that the corresponding bits should be replaced for a rsq with a shift count of 35. The right shift shifts through the most significant doubleword of the quadword before it begins to effect the second least significant word.
The lsw bus 1000, the rswd bus 1001, the lsdq bus 1002, and the rsq bus 1006 are coupled to a NOR gate 1012 which drives a zero bus 1016. The zero bus 1016 is coupled to the control 0 (cO) input of each of the set of muxes 1061 to force a zero on the ouφuts when none of the select inputs are active. In addition the NOR bus 939 is coupled to the control 1 (c 1 ) input of each of the muxes to force a one on the ouφuts when at least one of the most-significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift output bus 719 to be replaced. Each of a set of muxes 1062 drives a bit of the fixdata bus 935 to indicate which bits of the second most significant word of the shift output bus 919 (referring to FIG. 9) should be replaced. The lswd# bus 1049 is coupled to the select 0 input of each of the set of muxes 1062 to select each data 0 input whenever the operation is a left-shift of either a word or doubleword. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1062. For example, the three least significant bits of the fixdata bus 935 would indicate that the corresponding bits should be replaced for a lswd with a shift count of 3. The rsw# bus 1044 is coupled to the select 1 input of each of the set of muxes 1062 to select each data 1 input whenever the operation is a right-shift of a word. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1060 in reverse order. For example, the three most significant bits of the fixdata bus 935 would indicate that the corresponding bits should be replaced for a rswd with a shift count of 3. The rsdq# bus 1050 is coupled to the select 2 input of each of the set of muxes 1062 to select each data 2 input whenever the operation is a right-shift of a doubleword or quadword. A bit of the second least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1062 in reverse order. For example, the three most significant bits of the fixdata bus 935 would indicate that the corresponding bits should be replaced for a rsdq with a shift count of 19. The right shift shifts through the most significant word before it begins to effect the second least significant word. The lsq# bus 1051 is coupled to the select 3 input of each of the set of muxes 1062 to select each data 3 input whenever the operation is a left-shift of a quadword. A bit of the second most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1062 in reverse order. For example, the three most significant bits of the fixdata bus 935 would indicate that ύe corresponding bits should be replaced for a lsq with a shift count of 35. The left shift shifts through the least significant doubleword before it begins to effect the second most significant word.
The lsw bus 1000, the rsw bus 1004, the rsdq bus 1010, and the lsq bus 1011 are coupled to a NOR gate 1014 which drives a zero bus 1018. The zero bus 1018 is coupled to the control 0 (cO) input of each of the set of muxes 1062 to force a zero on the outputs when none of the select inputs are active. In addition the NOR bus 939 is coupled to the control 1 (c 1 ) input of each of the muxes to force a one on the outputs when at least one of the most- significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift output bus 719 to be replaced. Each of a set of muxes 1063 drives a bit of the fixdata bus 934 to indicate which bits of the most significant word of the shift output bus 919 (referring to FIG. 9) should be replaced. The lsw# bus 1000 is coupled to the select 0 input of each of the set of muxes 1063 to select each data 0 input whenever the operation is a left-shift of a word. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 0 of each of the set of muxes 1063. For example, the three least significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a lsw with a shift count of 3. The lsd# bus 1047 is coupled to the select 1 input of each of the set of muxes 1063 to select each data 1 input whenever the operation is a left-shift of a doubleword. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 1 of each of the set of muxes 1063. For example, the three least significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a lsd with a shift count of 19. The left shift shifts through the second least significant word before it begins to effect the most significant word. The rswdq# bus 1048 is coupled to the select 2 input of each of the set of muxes 1063 to select each data 2 input whenever the operation is a right-shift of a word, doubleword, or quadword. A bit of the least significant word of the decoded bus 938 is coupled to a corresponding data input 2 of each of the set of muxes 1063 in reverse order. For example, the three most significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a rswdq with a shift count of 3. The lsq# bus 1045 is coupled to the select 3 input of each of the set of muxes 1063 to select each data 3 input whenever the operation is a left-shift of a quadword. A bit of the most significant word of the decoded bus 938 is coupled to a corresponding data input 3 of each of the set of muxes 1060. For example, the three most significant bits of the fixdata bus 934 would indicate that the corresponding bits should be replaced for a lsq with a shift count of 51. The left shift shifts through the least significant 48 bits of the quadword before it begins to effect the most significant word. The lsw bus 1000, the lsd bus 1007, the rswdq bus 1008, and the lsq bus 1011 are coupled to a NOR gate 1015 which drives a zero bus 1019. The zero bus 1019 is coupled to the control 0 (cO) input of each of the set of muxes 1063 to force a zero on the ouφuts when none of the select inputs are active. In addition the NOR bus 939 is coupled to the control 1 (cl) input of each of the muxes to force a one on the ouφuts when at least one of the most- significant bits of the shift count 904 is non-zero. This forces all the bits of the shifted packed intermediate result on the shift ouφut bus 719 to be replaced.
While FIG. 10 illustrates one circuit for implementation of the fixshift circuit 932 of FIG. 9, any number of alternative fixshift circuits could be used.
Barrel Shifter
FIG. 11 illustrates one embodiment of the barrel shifter 905 (referring to FIG. 9). The barrel shifter 905 is implemented to perform right shifts. In order to perform left shifts, a right shift of the two's complement of the right shift count is performed according to well-known methods. The Source2[5:0] bus 903 comprises an Source2[0] bus 1100, an Source2[l] bus 1101, an Source2[2] bus 1102, an Source2[3] bus 1103, an Source2[4] bus 1 104, and an Source2[5] bus 1105. The Source2[l] bus 1101 and the shift left bus 900 are coupled to logic 1110 which generates a signal on select bus 1120 that is the value of Source2[l] when the operation is aright shift and the complement of Source2[l] when the operation is a left shift. The select bus 1 120 is coupled to the select input of a set of 2-1 Muxes 1140. The Sourcel[63:0] bus 901 is coupled to circuit 1161 which replicates the 64-bit data to produce a 128-bit data (where one copy of the 64-bit data is in the most significant quadword and the other is in the least significant quadword) on the data[ 127:0] bus 1130. In one embodiment, the circuit 1161 is simply wires that branch each single bit input to two output bits at the appropriate bit positions. Each bit of the data[127:2] portion of the data[127:0] bus 1130 is coupled to each corresponding 1 input of the set of 2- 1 Muxes 1140. Each bit of the data[125:0] portion of he data[127:0] bus 1130 is coupled to each corresponding 0 input of the set of 2- 1 Muxes 1 140. The set of 2-1 Muxes 1 140 are coupled to corresponding bits of the intermediate result bus 1 141. When the select bus 1120 is driven high, data [127:2] is driven onto the intermediate result bus 1141 thereby shifting the data by two positions. When the select bus 1 120 is driven low, data [125:0] is driven onto the intermediate result bus 1141.
The next stage of the barrel shifter 905 shifts the data on the intermediate result bus 1 141 by 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, or 60 positions depending on the value of the bits on the Source2[2] bus 1 102, the Source2[3] bus 1103, the Source2[4] bus 1 104 and the Source2[5] bus 1 105. The Source2[2] bus 1102 is coupled to logic 1 11 1 (described in more detail below) which drives the two bits of the bitpair bus 1121. The first bit is Source2[2] when the operation is a right shift and the complement of Source2[2] when the operation is a left shift. The second bit is the complement of the first bit. The Source2[3] bus 1103, the Source2[4] bus 1104, and the Source2[5] bus 1 105 are coupled to logic circuits 1112-1114, respectively, which drive bitpair busses 1 122-1124, respectively, in a similar manner. The bitpair busses 1 121-1 124 are coupled to the inputs of decoder 1116 that generates a decoded value of the biφair busses 1121-1124 on the select bus 1162 according to well-known methods. Each bit of the intermediate result [65:0] portion of the intermediate result bus 1150 is coupled to the 0 inputs of the corresponding one of the set of 16- 1 Muxes 1150. Each bit of the intermediate result [69:4] portion of the intermediate result bus 1150 is coupled to the 1 inputs of the corresponding one of the set of 16-1 Muxes 1150. Each bit of the intermediate result [ 125:60] portion of the intermediate result bus 1150 is coupled to the 15 inputs of the corresponding one of the set of 16-1 Muxes 1150. The 2 inputs through the 14 inputs are coupled in a manner according to the pattern illustrated in FIG. 11 and described above. The set of muxes 1150 drive the intermediate result bus 1151 according to the input selected.
The last stage of the barrel shifter 905 shifts the data on the intermediate result bus 1151 by 0, 1, or 2 positions according to the value on the Source2[0] uus 1100 and the shift left bus 900. The Source2[0] bus 1 100 and the shift left bus 900 are coupled to the inputs of a logic circuit 11 15 which drives the select bus 1125. The logic circuit 1115 adds the values of the bits on the Source2[0] bus 1100 and the shift left bus 900 and drives the decoded sum on the select bus 1 125 according to well-known methods. The select bus 1125 is coupled to a set of 3-1 Muxes 1160. Each bit of the intermediate result [63: 0] portion of the intermediate result bus 1151 is coupled to the 0 inputs of the corresponding one of the set of 3- 1 Muxes 1160. Each bit of the intermediate result [64: 1] portion of the intermediate result bus 1151 is coupled to the 1 inputs of the corresponding one of the set of 3-1 Muxes 1160. Each bit of the intermediate result [65: 2] portion of the intermediate result bus 1 151 is coupled to the 2 inputs of the corresponding one of the set of 3-1 Muxes 1160. Each of the set of 3- 1 Muxes 1160 drives the corresponding bit of the result on the shifted output bus 919.
While FIG. 10 illustrates one circuit for implementation of the fixshift circuit 932 of FIG. 8, any number of alternative fixshift circuits could be used.
Encoding Logic
FIG. 12 illustrates one embodiment of the encoding logic represented in FIG. 11 as each of the logic circuits 11 1 1-1114. The bit to be encoded is driven onto the S bus 1220 (which corresponds to each of the first bit of a bitpair bus as described above) and the complement of the bit to be encoded is driven onto the S# bus (which corresponds to the second bit of a bitpair bus as described above) when the shift left bus 1203 indicates that the operation is a right shift. The complement of the bit to be encoded is driven onto the S bus 1220 and the bit to be encoded is driven onto the S# bus when the shift left bus 1203 indicates that the operation is a left shift. The bit to be encoded is driven on a shiftcount bit bus 1202 which is coupled to the input of an inverter 1210. Inverter 1210 drives the complement of the bit to be encoded on the shiftcount# bus 1204 which is coupled to the input of an inverter 1212. Inverter 1212 drives the bit to be encoded on a delayed shiftcount bit bus 1206. The shift left bus 1203 is coupled to the input of inverter 1211 which drives the complement of the shift left signal on the shift left# bus 1205. The shift left# bus 1205 is coupled to an inverter 1213 which drives the delayed shift left bus 1207.
The shiftcount* bus 1204 is coupled to the first input of complex gate 1214 and the fourth input of complex gate 1215. The delayed shiftcount bus 1206 is coupled to the fourth input of complex gate 1214 and the second input of complex gate 1215. The shift left# bus 1205 is coupled to the third input of complex gate 1214 and the third input of complex gate 1215. The delayed shift left bus 1207 is coupled to the first input of complex gate 1214 and the first input of complex gate 1215. Table 7 is the truth table for both complex gate 1214 and complex gate 1215. The output is false whenever either the first two inputs are true or the second two inputs are true. Otherwise, the ouφut is false. The implementation of this logic as a complex gate improves performance. This is particularly important since the logic decodes 4 bits for the second stage of this 64-bit barrel shifter as compared to 3 bits for the second stage in a 32-bit barrel shifter.
First Second Third Fourth OUT Injjut Input Input Input
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1 0
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1 0
0 0 0
0 0 1
0 1 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 0
Table 7: Complex Gate Truth Table
Method of Performing A Packed Shift Operation FIG. 13 illustrates one embodiment of a method of performing a Packed
Shift Operation.
In Step 1301 , a first packed data is accessed from a register or another memory, such as RAM, a cache memory, a flash memory, or other data storage device. The first packed data represents multiple values to be shifted. In Step 1302, a shift count is accessed from a register or another memory. The shift count represents the number of positions each value of the first packed data is to be shifted.
In Step 1303, the first packed data is shifted by the number of positions indicated by the shift count to produce an shifted packed intermediate result. In one embodiment, portions of some values of the shifted packed intermediate result may be shifted into other values of the shifted packed intermediate result.
In Step 1305, the correction circuit determines whether the shift count is greater than the number of bits to be shifted in the first packed data. If so, Step 1306 is performed. If not Step 1307 is performed.
In Step 1306, all the bits of the shifted packed intermediate data is replaced by the corresponding replacement bit. This produces a result that is consistent with a first packed data having values that are extended beyond the most significant and least significant bits represented. If such a value is shifted by greater than the number of bits represented, the sign bit (for right arithmetic shifts) or the zero bits (for logical shifts) should replace the whole value.
In Step 1307, at least one bit of the shifted packed intermediate data is replaced by the corresponding replacement bit. In one embodiment, the replacement bits correspond to those bits in those portions of the values of the shifted packed intermediate result that are shifted into other values of the shifted packed intermediate result.
Although a great deal of detail has been included in the description and figures, the invention is defined by the scope of the claims. Only limitations found in the claims are considered essential to the invention.

Claims

CLAΓMSWhat is claimed is:
1. A microprocessor which includes an apparatus for performing a packed shift operation on a first packed data having a first plurality of values, said apparatus comprising: a barrel shifter, said barrel shifter shifting said first packed data to produce a second packed data having a second plurality of values, each of said second plurality of values having a second plurality of bits, a portion of at least one of said second plurality of bits being shifted into another of said second plurality of bits; a first bus coupled to said barrel having a second plurality of bits, each of said second plurality of bits being a replacement bit for a corresponding one of said second plurality of values; a correction circuit having a third bus containing a third plurality of bits; and a first plurality of muxes, each of said first plurality of muxes having a first input coupled to said barrel shifter, a second input coupled to said second bus, a select input coupled to said third bus and an ouφut, each output corresponding to a bit of a shifted packed result.
2. The microprocessor of Claim 1 further comprising a second plurality of muxes, each of said second plurality of muxes having a plurality of inputs, at least one of said plurality of inputs corresponding to a zero bit, each of said second plurality of muxes coupled to a corresponding one of said second plurality of bits.
3. The microprocessor of Claim 1 further comprising a second plurality of muxes, each of said second plurality of muxes having a plurality of inputs, at least one of said plurality of inputs corresponding to a sign bit, each of said second plurality of muxes coupled to a corresponding one of said second plurality of bits.
4. The microprocessor of Claim 1 wherein said correction circuit comprises: a fourth plurality of bits, said fourth plurality of bits indicating a shift count, a first circuit coupled to at least a portion of said fourth plurality of bits having a fifth bus containing a fifth plurality of bits, said fifth plurality of bits having a field of bits having one logic value that comprises a number of bits corresponding to said shift count; and a second circuit coupled to said fifth bus, said second circuit comprising logic to transpose portions of said fifth plurality of bits to produce transposed portions of said fifth plurality of bits and logic to replicate portions of said fifth plurality of bits and transposed portions of said fifth plurality of bits, said second circuit being coupled to said third plurality of bits.
5. The microprocessor of Claim 1 wherein said correction circuit comprises: a fourth plurality of bits, said fourth plurality of bits indicating a shift count; and a first circuit coupled to a portion of said fourth plurality of bits for driving said third plurality of bits to all ones when at least one bit of said portion of said fourth plurality of bits is a one.
6. A circuit for performing a packed shift operation on a first packed data having a first plurality of values, said circuit comprising: a barrel shifter, said barrel shifter shifting said first packed data to produce a second packed data having a second plurality of values, each of said second plurality of values having a second plurality of bits, a portion of at least one of said second plurality of bits being shifted into another of said second plurality of bits; a second bus having a second plurality of bits, each of said second plurality of bits being a replacement bit for a corresponding one of said second plurality of values; a correction circuit having a third bus third plurality of bits; and a first plurality of muxes, each of said first plurality of muxes having a first input coupled to said barrel shifter, a second input coupled to said second bus, a select input coupled to said third bus and an ouφut, each output corresponding to a bit of a shifted packed result.
7. The circuit of Claim 6 further comprising a second plurality of muxes, each of said second plurality of muxes having a plurality of inputs, at least one of said plurality of inputs corresponding to a zero bit, each of said second plurality of muxes coupled to a corresponding one of said second plurality of bits.
8. The circuit of Claim 7 further comprising a second plurality of muxes, each of said second plurality of muxes having a plurality of inputs, at least one of said plurality of inputs corresponding to a sign bit, each of said second plurality of muxes coupled to a corresponding one of said second plurality of bits.
9. The circuit of Claim 6 wherein said correction circuit comprises: a fourth plurality of bits, said fourth plurality of bits indicating a shift count, a first circuit coupled to at least a portion of said first circuit having a fifth bus containing a fifth plurality of bits, said fifth plurality of bits having a field of bits having one logic value that comprises a number of bits corresponding to said shift count; a second circuit coupled to said fifth bus, said second circuit comprising logic to transpose portions of said fifth plurality of bits to produce transposed portions of said fifth plurality of bits and logic to replicate portions of said fifth plurality of bits and transposed portions of said fifth plurality of bits, said second circuit being coupled to said third plurality of bits.
10. The circuit of Claim 6 wherein said correction circuit comprises: a fourth plurality of bits, said fourth plurality of bits indicating a shift count; and a first circuit coupled to a portion of said fourth plurality of bits for driving said third plurality of bits to all ones when at least one bit of said portion of said fourth plurality of bits is a one.
PCT/US1997/003522 1996-03-04 1997-03-03 Apparatus for performing packed shift operations WO1997033222A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
AU19885/97A AU1988597A (en) 1996-03-04 1997-03-03 Apparatus for performing packed shift operations

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US08/610,495 US6275834B1 (en) 1994-12-01 1996-03-04 Apparatus for performing packed shift operations
US08/610,495 1996-03-04

Publications (1)

Publication Number Publication Date
WO1997033222A1 true WO1997033222A1 (en) 1997-09-12

Family

ID=24445245

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US1997/003522 WO1997033222A1 (en) 1996-03-04 1997-03-03 Apparatus for performing packed shift operations

Country Status (3)

Country Link
US (6) US6275834B1 (en)
AU (1) AU1988597A (en)
WO (1) WO1997033222A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000008552A1 (en) * 1998-08-06 2000-02-17 Koninklijke Philips Electronics N.V. Data processor and method of processing data

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6738793B2 (en) * 1994-12-01 2004-05-18 Intel Corporation Processor capable of executing packed shift operations
US6275834B1 (en) * 1994-12-01 2001-08-14 Intel Corporation Apparatus for performing packed shift operations
US5953241A (en) * 1995-08-16 1999-09-14 Microunity Engeering Systems, Inc. Multiplier array processing system with enhanced utilization at lower precision for group multiply and sum instruction
US6643765B1 (en) 1995-08-16 2003-11-04 Microunity Systems Engineering, Inc. Programmable processor with group floating point operations
US6295599B1 (en) * 1995-08-16 2001-09-25 Microunity Systems Engineering System and method for providing a wide operand architecture
US7301541B2 (en) * 1995-08-16 2007-11-27 Microunity Systems Engineering, Inc. Programmable processor and method with wide operations
US6260055B1 (en) * 1997-10-15 2001-07-10 Kabushiki Kaisha Toshiba Data split parallel shifter and parallel adder/subtractor
US7932911B2 (en) * 1998-08-24 2011-04-26 Microunity Systems Engineering, Inc. Processor for executing switch and translate instructions requiring wide operands
ATE557343T1 (en) 1998-08-24 2012-05-15 Microunity Systems Eng PROCESSOR AND METHOD FOR PERFORMING A WIDE OPERAND SWITCHING INSTRUCTION
US6629115B1 (en) * 1999-10-01 2003-09-30 Hitachi, Ltd. Method and apparatus for manipulating vectored data
US7251248B2 (en) * 2001-07-31 2007-07-31 Bridgeworks Ltd. Connection device
US20040054877A1 (en) 2001-10-29 2004-03-18 Macy William W. Method and apparatus for shuffling data
US7685212B2 (en) * 2001-10-29 2010-03-23 Intel Corporation Fast full search motion estimation with SIMD merge instruction
TWI307874B (en) * 2005-04-06 2009-03-21 Himax Tech Inc Shift register circuit
US20070233767A1 (en) * 2006-03-31 2007-10-04 Jeremy Anderson Rotator/shifter arrangement
US20080077772A1 (en) * 2006-09-22 2008-03-27 Ronen Zohar Method and apparatus for performing select operations
WO2012137428A1 (en) * 2011-04-08 2012-10-11 パナソニック株式会社 Data processing device and data processing method
US9329835B1 (en) * 2011-10-19 2016-05-03 Marvell International Ltd. Systems and methods for performing mathematical functions
CN104025024B (en) * 2011-12-22 2018-07-17 英特尔公司 Packaged data operation mask shift processor, method and system
EP2798464B8 (en) 2011-12-30 2019-12-11 Intel Corporation Packed rotate processors, methods, systems, and instructions
US9529591B2 (en) * 2011-12-30 2016-12-27 Intel Corporation SIMD variable shift and rotate using control manipulation
US9933996B2 (en) * 2012-12-20 2018-04-03 Wave Computing, Inc. Selectively combinable shifters
US10289382B2 (en) * 2012-12-20 2019-05-14 Wave Computing, Inc. Selectively combinable directional shifters
US20150186137A1 (en) * 2013-12-27 2015-07-02 Tal Uliel Systems, apparatuses, and methods for vector bit test
US9208839B2 (en) 2014-03-20 2015-12-08 Arm Limited Predicting saturation in a shift operation
US9785565B2 (en) 2014-06-30 2017-10-10 Microunity Systems Engineering, Inc. System and methods for expandably wide processor instructions
US9478312B1 (en) * 2014-12-23 2016-10-25 Amazon Technologies, Inc. Address circuit
US9904545B2 (en) 2015-07-06 2018-02-27 Samsung Electronics Co., Ltd. Bit-masked variable-precision barrel shifter
US11204764B2 (en) * 2016-03-31 2021-12-21 Intel Corporation Processors, methods, systems, and instructions to Partition a source packed data into lanes
US10318298B2 (en) * 2017-09-29 2019-06-11 Intel Corporation Apparatus and method for shifting quadwords and extracting packed words

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5416731A (en) * 1992-12-14 1995-05-16 Motorola, Inc. High-speed barrel shifter
US5477543A (en) * 1994-08-03 1995-12-19 Chromatic Research, Inc. Structure and method for shifting and reordering a plurality of data bytes
US5553010A (en) * 1991-03-06 1996-09-03 Fujitsu Limited Data shifting circuit capable of an original data width rotation and a double data width rotation

Family Cites Families (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3711692A (en) 1971-03-15 1973-01-16 Goodyear Aerospace Corp Determination of number of ones in a data field by addition
US3723715A (en) 1971-08-25 1973-03-27 Ibm Fast modulo threshold operator binary adder for multi-number additions
US3723705A (en) * 1972-01-17 1973-03-27 Ridge Tool Co Fusion heater
US3712715A (en) * 1972-03-22 1973-01-23 C Wagner Multiple range rear vision mirror
US4139899A (en) 1976-10-18 1979-02-13 Burroughs Corporation Shift network having a mask generator and a rotator
US4161784A (en) 1978-01-05 1979-07-17 Honeywell Information Systems, Inc. Microprogrammable floating point arithmetic unit capable of performing arithmetic operations on long and short operands
US4418383A (en) 1980-06-30 1983-11-29 International Business Machines Corporation Data flow component for processor and microprocessor systems
US4393468A (en) 1981-03-26 1983-07-12 Advanced Micro Devices, Inc. Bit slice microprogrammable processor for signal processing applications
US4498177A (en) 1982-08-30 1985-02-05 Sperry Corporation M Out of N code checker circuit
US4707800A (en) 1985-03-04 1987-11-17 Raytheon Company Adder/substractor for variable length numbers
JPS6297060A (en) 1985-10-23 1987-05-06 Mitsubishi Electric Corp Digital signal processor
US4989168A (en) 1987-11-30 1991-01-29 Fujitsu Limited Multiplying unit in a computer system, capable of population counting
US4903228A (en) 1988-11-09 1990-02-20 International Business Machines Corporation Single cycle merge/logic unit
KR920007505B1 (en) 1989-02-02 1992-09-04 정호선 Multiplier by using neural network
US5081698A (en) 1989-02-14 1992-01-14 Intel Corporation Method and apparatus for graphics display data manipulation
US4963867A (en) 1989-03-31 1990-10-16 Ampex Corporation Apparatus for packing parallel data words having a variable width into parallel data words having a fixed width
US5237701A (en) 1989-03-31 1993-08-17 Ampex Systems Corporation Data unpacker using a pack ratio control signal for unpacked parallel fixed m-bit width into parallel variable n-bit width word
US5168571A (en) 1990-01-24 1992-12-01 International Business Machines Corporation System for aligning bytes of variable multi-bytes length operand based on alu byte length and a number of unprocessed byte data
US5268995A (en) 1990-11-21 1993-12-07 Motorola, Inc. Method for executing graphics Z-compare and pixel merge instructions in a data processor
WO1992009968A1 (en) * 1990-11-27 1992-06-11 Cray Research, Inc. VECTOR WORD SHIFT BY Vo SHIFT COUNT IN VECTOR SUPERCOMPUTER PROCESSOR
US5680161A (en) 1991-04-03 1997-10-21 Radius Inc. Method and apparatus for high speed graphics data compression
US5187679A (en) 1991-06-05 1993-02-16 International Business Machines Corporation Generalized 7/3 counters
US5423010A (en) 1992-01-24 1995-06-06 C-Cube Microsystems Structure and method for packing and unpacking a stream of N-bit data to and from a stream of N-bit data words
US5426783A (en) 1992-11-02 1995-06-20 Amdahl Corporation System for processing eight bytes or less by the move, pack and unpack instruction of the ESA/390 instruction set
US5408670A (en) 1992-12-18 1995-04-18 Xerox Corporation Performing arithmetic in parallel on composite operands with packed multi-bit components
US5465374A (en) 1993-01-12 1995-11-07 International Business Machines Corporation Processor for processing data string by byte-by-byte
US5625374A (en) 1993-09-07 1997-04-29 Apple Computer, Inc. Method for parallel interpolation of images
US5390135A (en) 1993-11-29 1995-02-14 Hewlett-Packard Parallel shift and add circuit and method
US5487159A (en) 1993-12-23 1996-01-23 Unisys Corporation System for processing shift, mask, and merge operations in one instruction
US5781457A (en) 1994-03-08 1998-07-14 Exponential Technology, Inc. Merge/mask, rotate/shift, and boolean operations from two instruction sets executed in a vectored mux on a dual-ALU
US5848286A (en) * 1994-03-29 1998-12-08 Cray Research, Inc. Vector word shift by vo shift count in vector supercomputer processor
US5594437A (en) 1994-08-01 1997-01-14 Motorola, Inc. Circuit and method of unpacking a serial bitstream
US6275834B1 (en) * 1994-12-01 2001-08-14 Intel Corporation Apparatus for performing packed shift operations
ZA9510127B (en) * 1994-12-01 1996-06-06 Intel Corp Novel processor having shift operations
US5831877A (en) * 1995-05-26 1998-11-03 National Semiconductor Corporation Bit searching through 8, 16, or 32 bit operands using a 32 bit data path
US6098087A (en) * 1998-04-23 2000-08-01 Infineon Technologies North America Corp. Method and apparatus for performing shift operations on packed data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5553010A (en) * 1991-03-06 1996-09-03 Fujitsu Limited Data shifting circuit capable of an original data width rotation and a double data width rotation
US5416731A (en) * 1992-12-14 1995-05-16 Motorola, Inc. High-speed barrel shifter
US5477543A (en) * 1994-08-03 1995-12-19 Chromatic Research, Inc. Structure and method for shifting and reordering a plurality of data bytes

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000008552A1 (en) * 1998-08-06 2000-02-17 Koninklijke Philips Electronics N.V. Data processor and method of processing data
US6438676B1 (en) 1998-08-06 2002-08-20 Trimedia Technologies Distance controlled concatenation of selected portions of elements of packed data

Also Published As

Publication number Publication date
US7117232B2 (en) 2006-10-03
US20050219897A1 (en) 2005-10-06
US6901420B2 (en) 2005-05-31
US6275834B1 (en) 2001-08-14
US7451169B2 (en) 2008-11-11
US20060235914A1 (en) 2006-10-19
US20040024800A1 (en) 2004-02-05
US20070239810A1 (en) 2007-10-11
US20010016861A1 (en) 2001-08-23
AU1988597A (en) 1997-09-22
US7461109B2 (en) 2008-12-02
US6631389B2 (en) 2003-10-07

Similar Documents

Publication Publication Date Title
US7451169B2 (en) Method and apparatus for providing packed shift operations in a processor
US5818739A (en) Processor for performing shift operations on packed data
US5675526A (en) Processor performing packed data multiplication
US6738793B2 (en) Processor capable of executing packed shift operations
US9015453B2 (en) Packing odd bytes from two source registers of packed data
US5959874A (en) Method and apparatus for inserting control digits into packed data to perform packed arithmetic operations
US5819101A (en) Method for packing a plurality of packed data elements in response to a pack instruction
EP0795154A1 (en) Microprocessor with compare operation of composite operands

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AL AM AT AT AU AZ BA BB BG BR BY CA CH CN CU CZ CZ DE DE DK DK EE EE ES FI FI GB GE GH HU IL IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MD MG MK MN MW MX NO NZ PL PT RO RU SD SE SG SI SK SK TJ TM TR TT UA UG US UZ VN YU AM AZ BY KG KZ MD RU TJ TM

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH KE LS MW SD SZ UG AT BE CH DE DK ES FI FR GB GR IE

121 Ep: the epo has been informed by wipo that ep was designated in this application
DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
NENP Non-entry into the national phase

Ref country code: JP

Ref document number: 97531939

Format of ref document f/p: F

REG Reference to national code

Ref country code: DE

Ref legal event code: 8642

122 Ep: pct application non-entry in european phase
NENP Non-entry into the national phase

Ref country code: CA