Apparatus and method for vector horizontal addition of signed / unsigned words and double words
By introducing universal vector-friendly instruction format and VEX encoding, the problem of low efficiency in performing multiplication-accumulation operations in the existing microarchitecture is solved, and more efficient signed/unsigned font and double word vector lateral addition is achieved, which is suitable for complex digital signal processing tasks.
Patent Information
- Application Number
- CN201811389347.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-12-21
- Filing Date
- 2018-11-21
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2038-11-21
AI Technical Summary
The existing single-instruction multi-data microarchitecture is less efficient when performing multiplication-accumulation operations, making it difficult to efficiently handle signed/unsigned words and double-word vector horizontal addition operations.
Using a universal vector-friendly instruction format and VEX encoding, instructions with more than two operands are supported, SIMD registers are allowed to be longer than 28 bits, and multiplication-accumulation operations are implemented through the circuits and logic within the execution engine unit described in Figure 4B.
Improves the efficiency of the processor in performing signed/unsigned font and double word vector lateral addition operations, and supports more complex digital signal processing tasks such as FFT and FIR filtering, suitable for sensors, audio and computer vision fields.
Smart Images

Figure CN109947392B_ABST
Abstract
Description
BACKGROUND OF THE INVENTION TECHNICAL FIELD
[0002] Embodiments of the present invention generally relate to the field of computer processors. More specifically, embodiments relate to apparatuses and methods for performing vector horizontal addition of signed / unsigned words and double words.
[0003] Description of Related Technologies
[0004] An instruction set or instruction set architecture (ISA) is the programming-related portion of a computer architecture, including native data types, instructions, register architecture, addressing modes, memory architecture, interrupt and exception handling, and external input and output (I / O). It should be noted that the term "instruction" generally refers to a macro-instruction herein - i.e., an instruction provided to the processor for execution - rather than a micro-instruction or micro-operation - i.e., the micro-instruction or micro-operation that is the result of the decoder of the processor decoding the macro-instruction. A micro-instruction or micro-operation may be configured to instruct an execution unit on the processor to perform an operation to implement the logic associated with the macro-instruction.
[0005] The ISA is different from the microarchitecture, which is a collection of processor design techniques for implementing an instruction set. Processors with different microarchitectures may share a common instruction set. For example, the Pentium 4 processor, Core TM (Core TM ) processors, and multiple processors from Advanced Micro Devices, Inc. of Sunnyvale, California implement nearly identical versions of the x86 instruction set (with some extensions that have been added with updated versions), but have different internal designs. For example, the same register architecture of an ISA may be implemented in different ways using well-known techniques in different microarchitectures, including dedicated physical registers, one or more dynamically allocated physical registers using a register renaming mechanism (e.g., using a register alias table (RAT), a reorder buffer (ROB), and a retirement register file). Unless otherwise specified, the phrases "register architecture", "register file", and "register" are used herein to refer to the register architecture, register file, and registers that are visible to the software / programmer and the way instructions specify registers. In cases where a distinction is needed, the adjectives "logical", "architectural", or "software visible" will be used to indicate registers / register files in the register architecture, while different adjectives will be used to specify registers in a given microarchitecture (e.g., physical registers, reorder buffers, retirement registers, register pools).
[0006] Multiplication-accumulation is a common digital signal processing operation that calculates the product of two numbers and adds the product to an accumulated value. Existing single instruction multiple data (SIMD) microarchitectures implement the multiplication-accumulation operation by executing a sequence of instructions. For example, a multiplication instruction can be utilized, followed by a 4-way addition, and then an accumulation using the destination quadword data to perform the multiplication-accumulation to generate two 64-bit saturated results. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] A better understanding of the present invention can be obtained from the following detailed description in conjunction with the following drawings, in which:
[0008] Figure 1A and Figure 1B is a block diagram illustrating a general vector-friendly instruction format and its instruction templates according to an embodiment of the present invention;
[0009] Figures 2A - 2C is a block diagram illustrating an exemplary VEX instruction format according to an embodiment of the present invention;
[0010] Figure 3 is a block diagram of a register architecture according to an embodiment of the present invention; and
[0011] Figure 4A is a block diagram illustrating both an exemplary in-order fetch, decode, retire pipeline and an exemplary out-of-order issue / execution pipeline with register renaming according to an embodiment of the present invention;
[0012] Figure 4B is a block diagram illustrating an exemplary embodiment of an in-order fetch, decode, retire core to be included in a processor and an exemplary out-of-order issue / execution architecture core with register renaming according to an embodiment of the present invention;
[0013] Figure 5A is a block diagram of a single processor core and its connection to an on-die interconnect network;
[0014] Figure 5B illustrates according to an embodiment of the present invention Figure 5A an expanded view of a portion of the processor core in
[0015] Figure 6 is a block diagram of a single-core processor and a multi-core processor with an integrated memory controller and a graphics device according to an embodiment of the present invention;
[0016] Figure 7 illustrates a block diagram of a system according to an embodiment of the present invention;
[0017] Figure 8 illustrates a block diagram of a second system according to an embodiment of the present invention;
[0018] Figure 9 The figure shows a block diagram of a third system according to an embodiment of the present invention;
[0019] Figure 10 The figure shows a block diagram of a system-on-chip (SoC) according to an embodiment of the present invention;
[0020] Figure 11 The figure shows a block diagram of converting binary instructions in a source instruction set into binary instructions in a target instruction set by using a software instruction converter according to an embodiment of the present invention;
[0021] Figure 12 The figure shows a processor architecture on which embodiments of the present invention can be implemented;
[0022] Figure 13 The figure shows a plurality of packed data elements including real and complex values according to one embodiment;
[0023] Figures 14A - 14B The figure shows an exemplary architecture for executing instructions for performing a horizontal addition operation;
[0024] Figure 15 The figure shows a method according to an embodiment of the present invention; and
[0025] Figure 16 The figure shows a method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the invention described hereinafter. It will be apparent, however, to one skilled in the art that embodiments of the invention may be practiced without some of these specific details. In other instances, well-known structures and devices are shown in block diagram form to avoid obscuring the basic principles of the embodiments of the invention.
[0027] Exemplary Processor Architectures, Instruction Formats, and Data Types
[0028] The instruction set includes one or more instruction formats. A given instruction format defines various fields (number of bits, position of bits) to specify the operation to be performed (opcode) and the operand(s) on which the operation is to be performed, etc. Some instruction formats are further decomposed by the definition of instruction templates (or sub-formats). For example, an instruction template of a given instruction format can be defined as different subsets of the fields of that instruction format (the included fields are typically in the same order, but at least some fields have different bit positions as fewer fields are included), and / or defined as having a given field interpreted in a different way. Thus, each instruction of the ISA is expressed using a given instruction format (and if defined, according to a given one of the instruction templates in that instruction format), and includes fields for specifying the operation and operands. For example, an exemplary ADD (addition) instruction has a specific opcode and instruction format, and this specific instruction format includes an opcode field for specifying the opcode and operand fields for selecting the operands (source 1 / destination and source 2); and the appearance of the ADD instruction in the instruction stream will result in specific contents in the operand fields for selecting specific operands.
[0029] Embodiments of the (multiple) instructions described herein can be embodied in different formats. Additionally, exemplary systems, architectures, and pipelines are detailed below. Embodiments of the (multiple) instructions can be executed on such systems, architectures, and pipelines, but are not limited to those detailed.
[0030] General vector-friendly instruction format
[0031] A vector-friendly instruction format is an instruction format suitable for vector instructions (e.g., there are specific fields dedicated to vector operations). Although embodiments are described in which both vector and scalar operations are supported by the vector-friendly instruction format, alternative embodiments use only vector operations via the vector-friendly instruction format.
[0032] Figures 1A - 1B is a block diagram illustrating a general vector-friendly instruction format and its instruction templates according to an embodiment of the present invention. Figure 1A is a block diagram illustrating a general vector-friendly instruction format and its Class A instruction templates according to an embodiment of the present invention; while Figure 1B is a block diagram illustrating a general vector-friendly instruction format and its Class B instruction templates according to an embodiment of the present invention. Specifically, Class A and Class B instruction templates are defined for the general vector-friendly instruction format 100, both of which include instruction templates for no memory access 105 and instruction templates for memory access 120. The term "general" in the context of the vector-friendly instruction format refers to an instruction format that is not tied to any specific instruction set.
[0033] Although embodiments of the present invention will be described where a vector-friendly instruction format supports the following: a 64-byte vector operand length (or size) with a 32-bit (4-byte) or 64-bit (8-byte) data element width (or size) (and thus, a 64-byte vector consists of 16 double-word-sized elements, or alternatively, 8 quad-word-sized elements); a 64-byte vector operand length (or size) with a 16-bit (2-byte) or 8-bit (1-byte) data element width (or size); a 32-byte vector operand length (or size) with a 32-bit (4-byte), 64-bit (8-byte), 16-bit (2-byte), or 8-bit (1-byte) data element width (or size); and a 16-byte vector operand length (or size) with a 32-bit (4-byte), 64-bit (8-byte), 16-bit (2-byte), or 8-bit (1-byte) data element width (or size); alternative embodiments may support larger, smaller, and / or different vector operand sizes (e.g., a 256-byte vector operand) with larger, smaller, or different data element widths (e.g., a 128-bit (16-byte) data element width).
[0034] Figure 1A The class A instruction templates in include: 1) within the instruction templates without memory access 105, an instruction template showing a fully rounded control type operation 110 without memory access and an instruction template of a data transformation type operation 115 without memory access; and 2) within the instruction templates with memory access 120, an instruction template showing the timeliness 125 of memory access and an instruction template of the non-timeliness 130 of memory access. Figure 1B The class B instruction templates in Figure 1B include: 1) within the instruction templates without memory access 105, an instruction template showing a partially rounded control type operation 112 with write mask control without memory access and an instruction template of a vsize type operation 117 with write mask control without memory access; and 2) within the instruction templates with memory access 120, an instruction template showing the write mask control 127 of memory access.
[0035] The general vector-friendly instruction format 100 includes the following fields in the order listed as shown in Figures 1A - 1B as follows.
[0036] Format field 140 - The specific value (instruction format identifier value) in this field uniquely identifies the vector-friendly instruction format and thus identifies that the instruction appears in the instruction stream in the vector-friendly instruction format. Thus, this field is optional in the sense that it is not required for an instruction set that only has the general vector-friendly instruction format.
[0037] Base operation field 142 - The content of which differentiates different base operations.
[0038] Register index field 144 - whose content directly or through address generation specifies the location of source or destination operands in registers or in memory. These fields include a sufficient number of bits to select N registers from a PxQ (e.g., 32x512, 16x128, 32x1024, 64x1024) register file. Although in one embodiment N can be up to three source registers and one destination register, alternative embodiments can support more or fewer source and destination registers (e.g., can support up to two sources, where one of these sources also serves as a destination; can support up to three sources, where one of these sources also serves as a destination; can support up to two sources and one destination).
[0039] Modifier field 146 - whose content distinguishes instructions in general vector instruction format that specify memory access from those that do not; i.e., distinguishes between instruction templates with no memory access 105 and instruction templates with memory access 120. Memory access operations read and / or write to the memory hierarchy (in some cases, using values in registers to specify source and destination addresses), while non - memory access operations do not (e.g., source and / or destination are registers). Although in one embodiment, this field also selects between three different ways to perform memory address calculation, alternative embodiments can support more, fewer, or different ways to perform memory address calculation.
[0040] Extended operation field 150 - whose content distinguishes which one of various different operations, in addition to the base operation, is to be performed. This field is context - specific. In one embodiment of the present invention, this field is divided into a class field 168, an alpha field 152, and a beta field 154. The extended operation field 150 allows multiple sets of common operations to be performed in a single instruction rather than in 2, 3, or 4 instructions.
[0041] Scale field 160 - whose content allows the content of the index field used for memory address generation (e.g., for address generation using
[0042] (2 比例 * index + base address) to be scaled.
[0043] Displacement field 162A - whose content is used as part of memory address generation (e.g., for address generation using (2 比例 * index + base address + displacement)).
[0044] Displacement factor field 162B (note that the displacement field 162A directly juxtaposed on the displacement factor field 162B indicates the use of one or the other) - the content of which is used as part of address generation; it specifies the displacement factor that will scale the size (N) of the memory access - where N is the number of bytes in the memory access (e.g., for address generation using (2 比例 * index + base address + scaled displacement). The redundant low-order bits are ignored, and thus the content of the displacement factor field is multiplied by the total size (N) of the memory operand to generate the final displacement that will be used in calculating the effective address. The value of N is determined by the processor hardware at runtime based on the full opcode field 174 (described later in this document) and the data manipulation field 154C. The displacement field 162A and the displacement factor field 162B are optional in the sense that they are not used in instruction templates without memory access 105 and / or different embodiments may implement only one of the two or neither of the two.
[0045] Data element width field 164 - the content of which differentiates which of the multiple data element widths will be used (used for all instructions in some embodiments; only for some instructions in other embodiments). This field is optional in the sense that it is not required if only one data element width is supported and / or some aspect of the opcode is used to support the data element width.
[0046] Write mask field 170 - whose content controls, on a per data element position basis, whether the data element positions in the destination vector operand reflect the results of the base and extended operations. Class A instruction templates support merge-write masking, while Class B instruction templates support both merge-write masking and zero-write masking. When merged, the vector mask allows any set of elements in the destination to be protected from update during the execution of any operation (specified by the base and extended operations); in another embodiment, the old value of each element of the destination where the corresponding mask bit has 0 is retained. Conversely, when zeroed, the vector mask allows any set of elements in the destination to be zeroed during the execution of any operation (specified by the base and extended operations); in one embodiment, the elements of the destination are set to 0 when the corresponding mask bit has a 0 value. A subset of this functionality is the ability to control the vector length of the operation being performed (i.e., the span from the first to the last element being modified), however, the elements being modified do not necessarily have to be contiguous. Thus, write mask field 170 allows partial vector operations, which include loads, stores, arithmetic, logic, etc. Although embodiments of the invention have been described in which the content of write mask field 170 selects one write mask register out of a plurality of write mask registers that contains the write mask to be used (and thus, the content of write mask field 170 indirectly identifies the masking to be performed), alternative embodiments alternatively or additionally allow the content of mask write field 170 to directly specify the masking to be performed.
[0047] Immediate field 172 - whose content allows the specification of an immediate value. This field is optional in the sense that it does not exist in a general vector-friendly format that does not support immediates and does not exist in instructions that do not use immediates.
[0048] Class field 168 - whose content differentiates between different classes of instructions. Refer to Figures 1A - 1B , the content of this field selects between Class A and Class B instructions. In Figures 1A - 1B , rounded rectangles are used to indicate that a particular value exists in the field (e.g., Class A 168A and Class B 168B for class field 168 in Figures 1A - 1B respectively).
[0049] Class A instruction templates
[0050] In the case of the instruction template for a Class A non-memory access 105, the α field 152 is interpreted as an RS field 152A whose content differentiates which of different augmentation operation types is to be performed (e.g., for instruction templates for rounding-type operations 110 without memory access and data transformation-type operations 115 without memory access, rounding 152A.1 and data transformation 152A.2 are specified respectively), and the β field 154 differentiates which of the operations of the specified type is to be performed. In the instruction template for a non-memory access 105, the scale field 160, the displacement field 162A, and the displacement scale field 162B do not exist.
[0051] Instruction template for non-memory access - fully rounding control-type operation
[0052] In the instruction template for a non-memory access fully rounding control-type operation 110, the β field 154 is interpreted as a rounding control field 154A whose (multiple) content provides static rounding. Although in the described embodiments of the present invention the rounding control field 154A includes a suppress all floating-point exceptions (SAE) field 156 and a rounding operation control field 158, alternative embodiments may support both concepts, may encode both concepts into the same field, or have only one or the other of these concepts / fields (e.g., may have only the rounding operation control field 158).
[0053] SAE field 156 - whose content differentiates whether to disable exception event reporting; when the content of the SAE field 156 indicates enabling suppression, a given instruction does not report any kind of floating-point exception flag and does not invoke any floating-point exception handler.
[0054] Rounding operation control field 158 - whose content differentiates which of a set of rounding operations is to be performed (e.g., round up, round down, round towards zero, and round to nearest). Thus, the rounding operation control field 158 allows the rounding mode to be changed instruction by instruction. In one embodiment of the present invention in which the processor includes a control register for specifying the rounding mode, the content of the rounding operation control field 150 overrides the register value.
[0055] Instruction template for non-memory access - data transformation-type operation
[0056] In the instruction template for a non-memory access data transformation-type operation 115, the β field 154 is interpreted as a data transformation field 154B whose content differentiates which of multiple data transformations is to be performed (e.g., no data transformation, mix, broadcast).
[0057] In the case of the instruction template for a Class A memory access 120, the α field 152 is interpreted as an eviction hint field 152B whose content differentiates which eviction hint is to be used (inFigure 1A In it, for the instruction template of memory access timeliness 125 and the instruction template of memory access non - timeliness 130, the timeliness 152B.1 and non - timeliness 152B.2 are respectively specified, and the β field 154 is interpreted as a data manipulation field 154C, the content of which differentiates which one of multiple data manipulation operations (also called primitives) is to be executed (e.g., no manipulation, broadcast, up - conversion of the source, and down - conversion of the destination). The instruction template of memory access 120 includes a scale field 160 and optionally includes a displacement field 162A or a displacement - scale field 162B.
[0058] Vector memory instructions use conversion support to perform vector loads from memory and vector stores to memory. Like ordinary vector instructions, vector memory instructions transfer data to / from memory in a data - element - by - data - element manner, where the actually transferred elements are specified by the content of the vector mask selected as the write mask.
[0059] Instruction template for memory access - Timeliness
[0060] Timely data is data that may be reused quickly enough to benefit from cache operations. However, this is a hint, and different processors can implement it in different ways, including completely ignoring the hint.
[0061] Instruction template for memory access - Non - timeliness
[0062] Non - timely data is data that is unlikely to be reused quickly enough to benefit from cache operations in the first - level cache and should be given eviction priority. However, this is a hint, and different processors can implement it in different ways, including completely ignoring the hint.
[0063] Class B instruction template
[0064] In the case of the Class B instruction template, the α field 152 is interpreted as a write - mask control (Z) field 152C, the content of which differentiates whether the write masking controlled by the write - mask field 170 should be merging or zeroing.
[0065] In the case of the instruction template for a Class B non-memory access 105, a portion of the β field 154 is interpreted as an RL field 157A, the content of which differentiates which of different extended operation types is to be performed (e.g., for the instruction template for a write mask control partial rounding control type operation 112 without memory access and the instruction template for a write mask control VSIZE type operation 117 without memory access, rounding 157A.1 and vector length (VSIZE) 157A.2 are specified respectively), while the remainder of the β field 154 differentiates which of the operations of the specified type is to be performed. In the instruction template for a non-memory access 105, the scale field 160, displacement field 162A, and displacement scale field 162B do not exist.
[0066] In the instruction template for a write mask control partial rounding control type operation 110 without memory access, the remainder of the β field 154 is interpreted as a rounding operation field 159A, and exception event reporting is disabled (the given instruction does not report any kind of floating-point exception flag and does not invoke any floating-point exception handler).
[0067] The rounding operation control field 159A - like the rounding operation control field 158, the content of which differentiates which of a set of rounding operations is to be performed (e.g., round up, round down, round towards zero, and round to nearest). Thus, the rounding operation control field 159A allows the rounding mode to be changed instruction by instruction. In one embodiment of the present invention in which the processor includes a control register for specifying the rounding mode, the content of the rounding operation control field 150 overrides the register value.
[0068] In the instruction template for a write mask control VSIZE type operation 117 without memory access, the remainder of the β field 154 is interpreted as a vector length field 159B, the content of which differentiates which of multiple data vector lengths is to be performed (e.g., 128 bytes, 256 bytes, or 512 bytes).
[0069] In the case of the instruction template for a Class B memory access 120, a portion of the β field 154 is interpreted as a broadcast field 157B, the content of which differentiates whether a broadcast type data manipulation operation is to be performed, while the remainder of the β field 154 is interpreted as a vector length field 159B. The instruction template for a memory access 120 includes a scale field 160 and optionally includes a displacement field 162A or a displacement scale field 162B.
[0070] For a general vector friendly instruction format 100, the full opcode field 174 is shown to include a format field 140, a base operation field 142, and a data element width field 164. Although one embodiment is shown in which the full opcode field 174 includes all of these fields, in embodiments that do not support all of these fields, the full opcode field 174 includes less than all of these fields. The full opcode field 174 provides an operation code (opcode).
[0071] The extended operation field 150, the data element width field 164, and the write mask field 170 allow these features to be specified on a per-instruction basis in a general vector friendly instruction format.
[0072] The combination of the write mask field and the data element width field creates various types of instructions because these instructions allow the mask to be applied based on different data element widths.
[0073] The various instruction templates that occur within classes A and B are beneficial in different scenarios. In some embodiments of the present invention, different processors or different cores within a processor may support only class A, only class B, or may support both classes. For example, a high-performance general out-of-order core intended for general computing may support only class B, a core intended primarily for graphics and / or scientific (throughput) computing may support only class A, and a core intended for both general computing and graphics and / or scientific (throughput) computing may support both class A and class B (of course, having some mix of templates and instructions from both classes, but not all templates and instructions from both classes is within the scope of the present invention). Similarly, a single processor may include multiple cores, all of which support the same class, or in which different cores support different classes. For example, in a processor having separate graphics and general cores, one core in the graphics core intended primarily for graphics and / or scientific computing may support only class A, while one or more in the general core may be high-performance general out-of-order cores with register renaming that support only class B for general computing. Another processor without a separate graphics core may include one or more general in-order or out-of-order cores that support both class A and class B. Of course, in different embodiments of the present invention, features from one class may also be implemented in other classes. This will enable programs written in a high-level language to be (e.g., just-in-time compiled or statically compiled) into various different executable forms, including: 1) a form having only instructions of the (multiple) classes supported by the target processor for execution; or 2) a form having alternative routines and control flow code, where the alternative routines are written using different combinations of instructions from all classes, and the control flow code selects these routines for execution based on the instructions supported by the processor currently executing the code.
[0074] VEX instruction format
[0075] VEX encoding allows instructions to have more than two operands and allows SIMD vector registers to be longer than 28 bits. The use of the VEX prefix provides a three-operand (or more operand) syntax. For example, previous two-operand instructions performed operations that overwrote source operands such as A = A + B. The use of the VEX prefix enables operands to perform non-destructive operations such as A = B + C.
[0076] Figure 2A The figure shows an exemplary AVX instruction format, including the VEX prefix 202, the real opcode field 230, the Mod R / M byte 240, the SIB byte 250, the displacement field 262, and the IMM8 272. Figure 2B The figure shows which fields from Figure 2A constitute the complete opcode field 274 and the base operation field 241. Figure 2C The figure shows which fields from Figure 2A constitute the register index field 244.
[0077] The VEX prefix (bytes 0-2) 202 is encoded in a three-byte form. The first byte is the format field 290 (VEX byte 0, bits [7:0]), which contains an explicit C4 byte value (the unique value for differentiating C4 instruction formats). The second and third bytes (VEX bytes 1-2) include several bit fields that provide dedicated capabilities. Specifically, the REX field 205 (VEX byte 1, bits [7-5]) consists of the VEX.R bit field (VEX byte 1, bit [7] – R), the VEX.X bit field (VEX byte 1, bit [6] – X), and the VEX.B bit field (VEX byte 1, bit [5] – B). Other fields of these instructions encode the lower three bits (rrr, xxx, and bbb) of the register index as known in the art, such that Rrrr, Xxxx, and Bbbb can be formed by incrementing VEX.R, VEX.X, and VEX.B. The opcode mapping field 215 (VEX byte 1, bits [4:0] – mmmmm) includes content for encoding the implicit leading opcode byte. The W field 264 (VEX byte 2, bit [7] – W) — denoted by the notation VEX.W and provides different functions depending on the instruction. The role of VEX.vvvv 220 (VEX byte 2, bits [6:3] - vvvv) can include the following: 1) VEX.vvvv encodes the first source register operand specified in inverted (1's complement) form and is valid for instructions with two or more source operands; 2) VEX.vvvv encodes the destination register operand specified in 1's complement form for certain vector displacements; or 3) VEX.vvvv does not encode any operand, this field is reserved and should contain 1111b. If the VEX.L 268 size field (VEX byte 2, bit [2] - L) = 0, it indicates a 28-bit vector; if VEX.L = 1, it indicates a 256-bit vector. The prefix encoding field 225 (VEX byte 2, bits [1:0] - pp) provides additional bits for the base operation field 241.
[0078] The real opcode field 230 (byte 3) is also referred to as the opcode byte. A part of the opcode is specified in this field.
[0079] The MOD R / M field 240 (byte 4) includes the MOD field 242 (bits [7-6]), the Reg field 244 (bits [5-3]), and the R / M field 246 (bits [2-0]). The functions of the Reg field 244 can include the following: encoding a destination register operand or a source register operand (rrr of Rrrr); or being regarded as an opcode extension and not being used to encode any instruction operand. The functions of the R / M field 246 can include the following: encoding an instruction operand that references a memory address; or encoding a destination register operand or a source register operand.
[0080] Scale, Index, Base (SIB) - The content of the scale field 250 (byte 5) includes SS252 (bits [7-6]), which is used for memory address generation. The content of SIB.xxx 254 (bits [5-3]) and SIB.bbb 256 (bits [2-0]) has been previously mentioned for register indices Xxxx and Bbbb.
[0081] The displacement field 262 and the immediate field (IMM8) 272 contain data.
[0082] Exemplary Register Architecture
[0083] Figure 3 is a block diagram of a register architecture 300 according to an embodiment of the present invention. In the illustrated embodiment, there are 32 vector registers 310 that are 512 bits wide; these registers are referred to as zmm0 to zmm31. The lower 256 bits of the lower 6 zmm registers overlay on the registers ymm0-15. The lower 128 bits of the lower 6 zmm registers (the lower 128 bits of the ymm registers) overlay on the registers xmm0-15.
[0084] General-Purpose Registers 325 - In the illustrated embodiment, there are sixteen 64-bit general-purpose registers that are used with existing x86 addressing modes to address memory operands. These registers are referred to by the names RAX, RBX, RCX, RDX, RBP, RSI, RDI, RSP, and R8 to R15.
[0085] The scalar floating-point stack register file (x87 stack) 345, on which the MMX packed integer flat register file 350 overlaps - In the illustrated embodiment, the x87 stack is an eight-element stack for performing scalar floating-point operations on 32 / 64 / 80-bit floating-point data using the x87 instruction set extension; while using the MMX registers to perform operations on 64-bit packed integer data and saving operands for some operations performed between the MMX and XMM registers.
[0086] Alternative embodiments of the present invention may use wider or narrower registers. Additionally, alternative embodiments of the present invention may use more, fewer, or different register files and registers.
[0087] Exemplary Core Architectures, Processors, and Computer Architectures
[0088] Processor cores can be implemented in different ways, for different purposes, and in different processors. For example, implementations of such cores can include: 1) general-purpose in-order cores intended for general computing; 2) high-performance general-purpose out-of-order cores intended for general computing; 3) specialized cores intended primarily for graphics and / or scientific (throughput) computing. Implementations of different processors can include: 1) a CPU that includes one or more general-purpose in-order cores intended for general computing and / or one or more general-purpose out-of-order cores intended for general computing; and 2) a coprocessor that includes one or more specialized cores intended primarily for graphics and / or scientific (throughput). Such different processors result in different computer system architectures, which can include: 1) a coprocessor on a chip separate from the CPU; 2) a coprocessor in the same package as the CPU but on a separate die; 3) a coprocessor on the same die as the CPU (in which case, such a coprocessor is sometimes referred to as specialized logic or as a specialized core, such specialized logic being, for example, integrated graphics and / or scientific (throughput) logic); and 4) a system-on-a-chip that can include the described CPU (sometimes referred to as (one or more) application cores or (one or more) application processors), the above-described coprocessor, and additional functionality on the same die. Exemplary core architectures are then described, followed by exemplary processors and computer architectures. Circuits (units) including example cores, processors, etc. are described in detail herein.
[0089] Exemplary Core Architecture
[0090] Figure 4A is a block diagram illustrating an exemplary in-order pipeline and an exemplary register-renamed out-of-order issue / execution pipeline in accordance with embodiments of the present invention. Figure 4B is a block diagram showing an exemplary embodiment of an in-order architecture core to be included in a processor and an exemplary register-renamed out-of-order issue / execution architecture core in accordance with embodiments of the present invention. Figures 4A - 4B The solid boxes in illustrate the in-order pipeline and in-order core, while the optional addition of the dashed boxes illustrates the register-renamed, out-of-order issue / execution pipeline and core. Considering that the in-order aspects are a subset of the out-of-order aspects, the out-of-order aspects will be described.
[0091] In Figure 4AIn it, the processor pipeline 400 includes an instruction fetch stage 402, a length decoding stage 404, a decoding stage 406, an allocation stage 408, a renaming stage 410, a scheduling (also referred to as dispatch or issue) stage 412, a register read / memory read stage 414, an execution stage 416, a write-back / memory write stage 418, an exception handling stage 422, and a commit stage 424.
[0092] Figure 4B A processor core 490 is shown, which includes a front-end unit 430 that is coupled to an execution engine unit 450, and both the front-end unit 430 and the execution engine unit 450 are coupled to a memory unit 470. The core 490 can be a reduced instruction set computing (RISC) core, a complex instruction set computing (CISC) core, a very long instruction word (VLIW) core, or a hybrid or alternative core type. As another option, the core 490 can be a specialized core, such as, for example, a network or communication core, a compression engine, a coprocessor core, a general-purpose computing graphics processing unit (GPGPU) core, a graphics core, and so on.
[0093] The front-end unit 430 includes a branch prediction unit 432 that is coupled to an instruction cache unit 434, the instruction cache unit 434 is coupled to an instruction translation lookaside buffer (TLB) 436, the instruction translation lookaside buffer 436 is coupled to an instruction fetch unit 438, and the instruction fetch unit 438 is coupled to a decoding unit 440. The decoding unit 440 (or decoder) can decode the instruction and generate, as output, one or more micro-operations, microcode entry points, microinstructions, other instructions, or other control signals that are decoded from the original instruction, or otherwise reflect the original instruction, or are derived from the original instruction. The decoding unit 440 can be implemented using various different mechanisms. Examples of suitable mechanisms include, but are not limited to, lookup tables, hardware implementations, programmable logic arrays (PLAs), microcode read-only memories (ROMs), etc. In one embodiment, the core 490 includes a microcode ROM or other medium (e.g., in the decoding unit 440, or otherwise within the front-end unit 430) that stores microcode for certain macroinstructions. The decoding unit 440 is coupled to a rename / allocator unit 452 in the execution engine unit 450.
[0094] The execution engine unit 450 includes a rename / allocator unit 452 that is coupled to a retirement unit 454 and a set 456 of one or more scheduler units. The (multiple) scheduler units 456 represent any number of different schedulers, including reservation stations, a central instruction window, and the like. The (multiple) scheduler units 456 are coupled to the (multiple) physical register file units 458. Each of the (multiple) physical register file units 458 represents one or more physical register files, where different physical register files store one or more different data types, such as scalar integers, scalar floating points, packed integers, packed floating points, vector integers, vector floating points, status (e.g., an instruction pointer that is an address of a next instruction to be executed), and so on. In one embodiment, the (multiple) physical register file units 458 include a vector register unit and a scalar register unit. These register units may provide architectural vector registers, vector mask registers, and general-purpose registers. The (multiple) physical register file units 458 are overlapped by the retirement unit 454 to illustrate various ways in which register renaming and out-of-order execution can be implemented (e.g., using the (multiple) reorder buffers and the (multiple) retirement register files; using the (multiple) future files, the (multiple) history buffers, the (multiple) retirement register files; using register maps and register pools, and so on). The retirement unit 454 and the (multiple) physical register file units 458 are coupled to the (multiple) execution clusters 460. The (multiple) execution clusters 460 include a set 462 of one or more execution units and a set 464 of one or more memory access units. The execution units 462 can perform various operations (e.g., shift, add, subtract, multiply) and can operate on various data types (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point). Although some embodiments may include multiple execution units dedicated to a particular function or set of functions, other embodiments may include only one execution unit or multiple execution units that all perform all functions. The (multiple) scheduler units 456, the (multiple) physical register file units 458, and the (multiple) execution clusters 460 are shown as potentially having multiple because certain embodiments create separate pipelines for certain types of data / operations (e.g., a scalar integer pipeline, a scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipeline, and / or a memory access pipeline that each has its own scheduler unit, (multiple) physical register file units, and / or execution cluster - and in the case of a separate memory access pipeline, certain embodiments are implemented where only the execution cluster of that pipeline has the (multiple) memory access units 464). It should also be understood that in the case of using separate pipelines, one or more of these pipelines can be out-of-order issue / execution, and the remaining pipelines can be in-order.
[0095] A set 464 of memory access units is coupled to a memory unit 470 that includes a data TLB unit 472, which is coupled to a data cache unit 474, which is coupled to a second-level (L2) cache unit 476. In one exemplary embodiment, the memory access units 464 may include a load unit, a store address unit, and a store data unit, each of which is coupled to the data TLB unit 472 in the memory unit 470. An instruction cache unit 434 is also coupled to the second-level (L2) cache unit 476 in the memory unit 470. The L2 cache unit 476 is coupled to one or more other levels of cache and ultimately to main memory.
[0096] As an example, an exemplary register-renaming out-of-order issue / execution core architecture may implement a pipeline 400 as follows: 1) Instruction fetch 438 performs a fetch stage 402 and a length decoding stage 404; 2) A decode unit 440 performs a decode stage 406; 3) A rename / allocator unit 452 performs an allocation stage 408 and a rename stage 410; 4) One or more scheduler units 456 perform a schedule stage 412; 5) One or more physical register file units 458 and the memory unit 470 perform a register read / memory read stage 414; An execution cluster 460 performs an execution stage 416; 6) The memory unit 470 and one or more physical register file units 458 perform a write-back / memory write stage 418; 7) Each unit may be involved in an exception handling stage 422; and 8) A retirement unit 454 and one or more physical register file units 458 perform a commit stage 424.
[0097] The core 490 may support one or more instruction sets (e.g., the x86 instruction set (with some extensions added with more recent versions); the MIPS instruction set of MIPS Technologies, Inc., in Sunnyvale, California; the ARM instruction set of ARM Holdings, Inc., in Sunnyvale, California (with optional additional extensions such as NEON)), including the instructions described herein. In one embodiment, the core 490 includes logic for supporting SIMD (Single Instruction, Multiple Data) instruction set extensions (e.g., AVX1, AVX2), thereby allowing operations used by many multimedia applications to be performed using SIMD data.
[0098] It should be understood that the core may support multithreading (execution of two or more sets of parallel operations or threads), and this multithreading may be accomplished in various ways, including time division multithreading, simultaneous multithreading (where a single physical core provides a logical core for each of the threads for which the physical core is simultaneously multithreading), or a combination thereof (e.g., time division fetching and decoding and thereafter such as Simultaneous multithreading in hyperthreading technology).
[0099] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming can be used in an in-order architecture. Although the illustrated embodiments of the processor also include separate instruction and data cache units 434 / 474 and a shared L2 cache unit 476, alternative embodiments may have a single internal cache for both instructions and data, such as, for example, a first-level (L1) internal cache or multiple levels of internal caches. In some embodiments, the system may include a combination of an internal cache and an external cache outside the core and / or processor. Alternatively, all caches may be outside the core and / or processor.
[0100] Specific exemplary in-order core architecture
[0101] Figures 5A - 5B A block diagram illustrating a more specific exemplary in-order core architecture, which would be one of several logic blocks (including other cores of the same type and / or different types) in a chip. Depending on the application, the logic block communicates with some fixed-function logic, memory I / O interfaces, and other necessary I / O logic via a high-bandwidth interconnect network (e.g., a ring network).
[0102] Figure 5A A block diagram of a single processor core according to an embodiment of the present invention, its connection to the on-die interconnect network 502, and a local subset 504 of its second-level (L2) cache. In one embodiment, the instruction decoder 500 supports the x86 instruction set with a compact data instruction set extension. The L1 cache 506 allows low-latency access to the cache memory for data entering the scalar and vector units. Although in one embodiment (for simplicity of design), the scalar unit 508 and the vector unit 510 use separate register sets (scalar registers 512 and vector registers 514 respectively), and the data transferred between these registers is written to memory and then read back from the first-level (L1) cache 506, alternative embodiments of the present invention may use different methods (e.g., using a single register set or including a communication path that allows data to be transferred between the two register banks without being written and read back).
[0103] The local subset 504 of the L2 cache is part of a global L2 cache that is partitioned into separate local subsets, one for each processor core. Each processor core has a direct access path to its own local subset 504 of the L2 cache. Data read by a processor core is stored in its L2 cache subset 504 and can be quickly accessed in parallel with other processor cores accessing their own local L2 cache subsets. Data written by a processor core is stored in its own L2 cache subset 504 and flushed from other subsets as necessary. A ring network ensures data sharing consistency. The ring network is bidirectional to allow agents such as processor cores, L2 caches, and other logic blocks to communicate with each other within the chip. In some embodiments, each ring data path is 1024 bits wide in each direction.
[0104] Figure 5B is part of a processor core according to an embodiment of the present invention Figure 5A expanded view. Figure 5B The L1 data cache 506A portion includes the L1 cache 504, as well as more details regarding the vector unit 510 and vector registers 514. Specifically, the vector unit 510 is a 16-wide vector processing unit (VPU) (see 16-wide ALU 528) that executes one or more of integer, single-precision floating-point, and double-precision floating-point instructions. The VPU supports mixing of register inputs through the mixing unit 520, numerical conversion through the numerical conversion units 522A-B, and replication of memory inputs through the replication unit 524.
[0105] A processor with an integrated memory controller and graphics device
[0106] Figure 6 is a block diagram of a processor 600 that can have more than one core, can have an integrated memory controller, and can have an integrated graphics device according to an embodiment of the present invention. Figure 6 The solid box diagram in shows a processor 600 having a single core 602A, a system agent 610, and a set 616 of one or more bus controller units, while the optional addition of the dashed box diagram shows an alternative processor 600 having multiple cores 602A-N, a set 614 of one or more integrated memory controller units in the system agent unit 610, and dedicated logic 608.
[0107] Thus, different implementations of the processor 600 can include: 1) a CPU, where the dedicated logic 608 is integrated graphics and / or scientific (throughput) logic (which can include one or more cores), and the cores 602A-N are one or more general-purpose cores (e.g., general-purpose in-order cores, general-purpose out-of-order cores, a combination of both); 2) a coprocessor, where the cores 602A-N are a large number of dedicated cores designed primarily for graphics and / or scientific (throughput); and 3) a coprocessor, where the cores 602A-N are a large number of general-purpose in-order cores. Thus, the processor 600 can be a general-purpose processor, a coprocessor, or a special-purpose processor, such as, for example, a network or communication processor, a compression engine, a graphics processor, a GPGPU (general-purpose graphics processing unit), a high-throughput integrated many-core (MIC) coprocessor (including 30 or more cores), an embedded processor, and so on. The processor can be implemented on one or more chips. The processor 600 can be part of one or more substrates, and / or can be implemented on one or more substrates using any of a variety of process technologies, such as, for example, BiCMOS, CMOS, or NMOS.
[0108] The memory hierarchy includes one or more cache levels within the cores 604A-N, a set 606 of one or more shared cache units, and external memory (not shown) coupled to a set 614 of integrated memory controller units. The set 606 of shared cache units can include one or more intermediate-level caches, such as a second-level (L2), third-level (L3), fourth-level (L4) or other-level cache, a last-level cache (LLC), and / or a combination of the foregoing. Although in one embodiment, a ring-based interconnect unit 612 interconnects the integrated graphics logic 608, the set 606 of shared cache units, and the system agent unit 610 / (multiple) integrated memory controller units 614, alternative embodiments can use any number of well-known techniques to interconnect such units. In one embodiment, coherence is maintained between one or more cache units 606 and the cores 602A-N.
[0109] In some embodiments, one or more of the cores 602A-N are capable of multi-threading. The system agent 610 includes those components that coordinate and operate the cores 602A-N. The system agent unit 610 can include, for example, a power control unit (PCU) and a display unit. The PCU can be the logic and components required to regulate the power states of the cores 602A-N and the integrated graphics logic 608, or can include such logic and components. The display unit is used to drive one or more externally connected displays.
[0110] The cores 602A-N can be homogeneous or heterogeneous in terms of the architecture instruction set; that is, two or more of the cores 602A-N may be capable of executing the same instruction set, while other cores may be capable of executing only a subset of that instruction set or a different instruction set.
[0111] Exemplary computer architecture
[0112] Figures 7 - 10 is a block diagram of an exemplary computer architecture. Other system designs and configurations known in the art for laptop devices, desktop computers, handheld PCs, personal digital assistants, engineering workstations, servers, network devices, network hubs, switches, embedded processors, digital signal processors (DSPs), graphics devices, video game devices, set-top boxes, microcontrollers, cellular telephones, portable media players, handheld devices, and various other electronic devices are also suitable. In general, a wide variety of systems or electronic devices capable of incorporating a processor and / or other execution logic as disclosed herein are generally suitable.
[0113] Now referring to Figure 7 , shown is a block diagram of a system 700 according to an embodiment of the present invention. The system 700 may include one or more processors 710, 715, which are coupled to a controller hub 720. In one embodiment, the controller hub 720 includes a Graphics Memory Controller Hub (GMCH) 790 and an Input / Output Hub (IOH) 750 (which may be on separate chips); the GMCH 790 includes a memory and a graphics controller, to which a memory 740 and a coprocessor 745 are coupled; the IOH 750 couples input / output (I / O) devices 760 to the GMCH 790. Alternatively, one or both of the memory and the graphics controller are integrated within the processor (as described herein), the memory 740 and the coprocessor 745 are directly coupled to the processor 710, and the controller hub 720 and the IOH 750 are in a single chip.
[0114] The optionality of the additional processor 715 is indicated by a dashed line in Figure 7 . Each processor 710, 715 may include one or more of the processing cores described herein and may be a certain version of the processor 600.
[0115] The memory 740 may be, for example, dynamic random access memory (DRAM), phase change memory (PCM), or a combination of the two. For at least one embodiment, the controller hub 720 communicates with the (multiple) processors 710, 715 via a multi-branch bus such as a front-side bus (FSB), a point-to-point interface, or a similar connection 795.
[0116] In one embodiment, the coprocessor 745 is a specialized processor such as, for example, a high throughput MIC processor, a network or communications processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, and the like. In one embodiment, the controller hub 720 may include an integrated graphics accelerator.
[0117] There can be various differences in a series of quality metrics including architecture, microarchitecture, thermal, power consumption characteristics, etc. between the physical resources 710, 715.
[0118] In one embodiment, the processor 710 executes instructions that control general types of data processing operations. Coprocessor instructions may be embedded within these instructions. The processor 710 identifies these coprocessor instructions as being of a type that should be executed by the attached coprocessor 745. Accordingly, the processor 710 issues these coprocessor instructions (or control signals representing coprocessor instructions) to the coprocessor 745 on a coprocessor bus or other interconnect. The (multiple) coprocessor 745 receives and executes the received coprocessor instructions.
[0119] Now refer to Figure 8 , shown is a block diagram of a first more specific exemplary system 800 in accordance with an embodiment of the present invention. As Figure 8 shown, the multiprocessor system 800 is a point-to-point interconnect system and includes a first processor 870 and a second processor 880 coupled via a point-to-point interconnect 850. Each of the processors 870 and 880 may be a certain version of the processor 600. In one embodiment of the present invention, the processors 870 and 880 are the processors 710 and 715 respectively, and the coprocessor 838 is the coprocessor 745. In another embodiment, the processors 870 and 880 are the processor 710 and the coprocessor 745 respectively.
[0120] The processors 870 and 880 are shown as including integrated memory controller (IMC) units 872 and 882 respectively. The processor 870 also includes point-to-point (P-P) interfaces 876 and 878 as part of its bus controller unit; similarly, the second processor 880 includes P-P interfaces 886 and 888. The processors 870, 880 may exchange information via the P-P interface 850 using the point-to-point (P-P) interface circuits 878, 888. As Figure 8 shown, the IMCs 872 and 882 couple the processors to the respective memories, namely memory 832 and memory 834, which may be portions of the main memories locally attached to the respective processors.
[0121] Processors 870, 880 may each exchange information with chipset 890 via respective P-P interfaces 852, 854 using point-to-point interface circuits 876, 894, 886, 898. Chipset 890 may optionally exchange information with coprocessor 838 via high performance interface 892. In one embodiment, coprocessor 838 is a specialized processor such as, for example, a high throughput MIC processor, a network or communications processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, and the like.
[0122] A shared cache (not shown) may be included in either processor, or external to both processors but connected to these processors via a P-P interconnect such that if the processors are placed in a low power mode, the local cache information of either or both processors may be stored in the shared cache.
[0123] Chipset 890 may be coupled to first bus 816 via interface 896. In one embodiment, first bus 816 may be a Peripheral Component Interconnect (PCI) bus or a bus such as a PCI Express bus or another I / O interconnect bus, but the scope of the present invention is not limited thereto.
[0124] As Figure 8 shown, various I / O devices 814 may be coupled to first bus 816 along with bus bridge 818 which couples first bus 816 to second bus 820. In one embodiment, one or more additional processors 815 such as a coprocessor, a high throughput MIC processor, a GPGPU, an accelerator (such as, for example, a graphics accelerator or a Digital Signal Processing (DSP) unit), a Field Programmable Gate Array or any other processor are coupled to first bus 816. In one embodiment, second bus 820 may be a Low Pin Count (LPC) bus. In one embodiment, various devices may be coupled to second bus 820 including, for example, keyboard and / or mouse 822, communication device 827, and storage unit 828 which may include, for example, a disk drive or other mass storage device including instructions / code and data 830. Additionally, audio I / O 824 may be coupled to second bus 820. Note that other architectures are possible. For example, instead of Figure 8 the point-to-point architecture, the system may implement a multi-branch bus or other such architecture.
[0125] Now referring Figure 9 to, shown is a block diagram of a second more specific exemplary system 900 in accordance with an embodiment of the present invention. Figure 8 and 9 Similar elements in Figure 9 are designated with similar reference numerals and Figure 8certain aspects to avoid confusion Figure 9 other aspects of
[0126] Figure 9 Illustrated processors 870, 880 may each include integrated memory and I / O control logic ("CL") 971 and 982. Thus, CL 972, 982 includes an integrated memory controller unit and includes I / O control logic. Figure 9 Illustrated is that not only memories 832, 834 are coupled to CL 972, 982, but also I / O device 914 is coupled to control logics 972, 982. Conventional I / O device 915 is coupled to chipset 890.
[0127] Now referring to Figure 10 , shown is a block diagram of an SoC 1000 in accordance with an embodiment of the present invention. Figure 6 Similar elements in Figure 10 are denoted with similar reference numerals. Additionally, the dashed boxes are optional features on a more advanced SoC. In
[0128] Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of such implementations. Embodiments of the present invention may be implemented as a computer program or program code executing on a programmable system that includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0129] The program code (such as, Figure 8The code 830) illustrated in the figure is applied to the input instruction to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor, such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0130] The program code can be implemented in a high-level procedural programming language or an object-oriented programming language to communicate with the processing system. If desired, the program code can also be implemented in assembly language or machine language. In fact, the mechanisms described herein are not limited to the scope of any particular programming language. In any case, the language can be a compiled language or an interpreted language.
[0131] One or more aspects of at least one embodiment can be implemented by representative instructions stored on a machine-readable medium, which represent various logics in a processor, and which, when read by the machine, cause the machine to fabricate the logics for performing the techniques described herein. Such representations, referred to as "IP cores", can be stored on a tangible machine-readable medium and supplied to various customers or production facilities to be loaded into the manufacturing machines that actually fabricate the logics or processors.
[0132] Such machine-readable storage media can include, but are not limited to, non-transitory, tangible arrangements of articles manufactured or formed by a machine or device, which include storage media such as hard disks; any other type of disk, including floppy disks, optical disks, compact disk read-only memory (CD-ROM), rewritable compact disk (CD-RW), and magneto-optical disks; semiconductor devices such as read-only memory (ROM), random access memory (RAM) such as dynamic random access memory (DRAM) and static random access memory (SRAM), erasable programmable read-only memory (EPROM), flash memory, electrically erasable programmable read-only memory (EEPROM); phase change memory (PCM); magnetic or optical cards; or any other type of medium suitable for storing electronic instructions.
[0133] Accordingly, embodiments of the present invention also include non-transitory, tangible machine-readable media that contain instructions or contain design data, such as a hardware description language (HDL), which define the structures, circuits, devices, processors, and / or system features described herein. These embodiments are also referred to as program products.
[0134] Emulation (including binary translation, code morphing, etc.)
[0135] In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may transform (e.g., using static binary translation, dynamic binary translation including dynamic compilation), morph, emulate, or otherwise convert an instruction or instructions to be processed by the core into one or more other instructions. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on the processor, off the processor, or partly on the processor and partly off the processor.
[0136] Figure 11 is a block diagram contrasting the use of a software instruction converter to convert binary instructions in a source instruction set to binary instructions in a target instruction set. In the illustrated embodiment, the instruction converter is a software instruction converter, but alternatively, the instruction converter may be implemented in software, firmware, hardware, or various combinations thereof. Figure 11 shows that a first compiler 1104 may be used to compile a program in the form of a high-level language 1102 to generate first binary code (e.g., x86) 1106 that can be natively executed by a processor 1116 having at least one first instruction set core. In some embodiments, a processor 1116 having at least one first instruction set core represents any processor that performs substantially the same functions as an Intel processor having at least one x86 instruction set core by compatibly executing or otherwise executing: 1) an essential portion of the instruction set of the Intel x86 instruction set core, or 2) a target code version of an application or other software targeted to run on an Intel processor having at least one x86 instruction set core to achieve substantially the same results as an Intel processor having at least one x86 instruction set core. The first compiler 1104 represents a compiler operable to generate binary code 1106 (e.g., target code) in a first instruction set that can be executed on a processor 1116 having at least one first instruction set core with or without additional linking processing. Similarly, Figure 11It is shown that an alternative instruction set compiler 1108 can be used to compile a program in the form of a high-level language 1102 to generate alternative instruction set binary code 1110 that can be natively executed by a processor 1114 that does not have at least one first instruction set core (e.g., a processor having a core that executes the MIPS instruction set of MIPS Technologies, Inc. of Sunnyvale, California, and / or the ARM instruction set of ARM Holdings plc of Sunnyvale, California). An instruction converter 1112 is used to convert the first binary code 1106 into code that can be natively executed by the processor 1114 that does not have the first instruction set core. This converted code is not likely to be the same as the alternative instruction set binary code 1110 because it is difficult to manufacture an instruction converter that can do so; however, the converted code will perform general operations and is composed of instructions from an alternative instruction set. Thus, the instruction converter 1112 represents software, firmware, hardware, or a combination thereof that allows a processor or other electronic device that does not have a first instruction set processor or core to execute the first binary code 1106 through emulation, simulation, or any other process.
[0137] Apparatus and method for digital signal processing instructions
[0138] Digital signal processing (DSP) instructions are described below. In one embodiment, the circuitry and logic for performing DSP operations are integrated within the execution engine unit 450 shown in Figure 4B and are integrated within the various cores described above (see, for example, Figure 6 and Figure 10 cores 602A-N) and / or within the vector unit 510 shown in Figure 5A For example, the various source and destination registers can be the SIMD registers in the (multiple) physical register file units 458 in Figure 4B and / or the vector registers 310 in Figure 3 The multiplication circuitry, adder circuitry, accumulator circuitry, and other circuitry described below can be integrated within the execution components of the architectures described above, by way of example and not limitation, the execution components including the (multiple) execution units 462 in Figure 4B However, it should be noted that the basic principles of the present invention are not limited to these particular architectures.
[0139] One embodiment of the present invention includes circuitry and / or logic for processing Digital Signal Processing (DSP) instructions. Specifically, one embodiment includes a multiply-accumulate (MAC) architecture having eight 16×16-bit multipliers and two 64-bit accumulators. The Instruction Set Architecture (ISA) described below can process various multiplication and MAC operations on 128-bit packed (8-bit, 16-bit, or 32-bit data elements) integer, fixed-point, and complex data types. Additionally, certain instructions have direct support for highly efficient Fast Fourier Transform (FFT) and Finite Impulse Response (FIR) filtering and post-processing of accumulated data through shift, round, and saturation operations.
[0140] One embodiment of the new DSP instructions uses opcode encoding based on the VEX.128 prefix, and several of the SSE / SSE2 / AVX instructions that handle post-processing of data are used with the DSP ISA. VEX-encoded 128-bit DSP instructions with memory operands can have relaxed memory alignment requirements.
[0141] In one embodiment, the instructions also support various integer and fixed-point data types, including:
[0142] 1) Q31 data type with more than 16 bits, for signals requiring Analog-to-Digital Conversion (ADC) and Digital-to-Analog Conversion (DAC);
[0143] 2) Q15 data type commonly used in DSP algorithms;
[0144] 3) 16-bit complex data type; and
[0145] 4) 32-bit complex data type.
[0146] The Instruction Set Architecture described herein targets a wide range of standard DSP (e.g., FFT, filtering, pattern matching, correlation, polynomial estimation, etc.) and statistical operations (e.g., mean, moving average, variance, etc.).
[0147] Target applications of embodiments of the present invention include sensors, audio, classification tasks for computer vision, and speech recognition. The DSP ISA described herein includes a wide range of instructions applicable to Deep Neural Networks (DNN), Automatic Speech Recognition (ASR), sensor fusion using Kalman filtering, and other major DSP applications, etc. Given a weight sequence {w1, w2, … w k} and an input sequence {x1, x2, x3, … x n}, many image processing and machine learning tasks require computing y i = w1x i + w2xi+1 +…+w k x i+k-1 The defined result sequence {y1, y2, y3, … y n+1-k}.
[0148] Figure 12 The figure shows an exemplary processor 1255 including embodiments of the present invention that can be implemented thereon. The exemplary processor 1255 includes multiple cores 0-N for simultaneously executing multiple instruction threads. The illustrated embodiments include DSP instruction decoding circuitry / logic 1231 within decoder 1230 and DSP instruction execution circuitry / logic 1241 within execution unit 1240. These pipeline components can perform the operations described herein in response to the decoding and execution of DSP instructions. Although only the details of a single core (core 0) are shown in Figure 12 , it will be understood that each of the other cores of processor 1255 can include similar components.
[0149] Before describing the specific details of embodiments of the present invention, a description of the components of the exemplary processor 1255 is provided directly below. Each of the multiple cores 0-N can include a memory management unit 1290 for performing memory operations (such as load / store operations), a set of general-purpose registers (GPRs) 1205, a set of vector registers 1206, and a set of mask registers 1207. In one embodiment, multiple vector data elements are packed into each vector register 1206, and each vector register 1206 can have a width of 512 bits for storing two 256-bit values, four 128-bit values, eight 64-bit values, sixteen 32-bit values, etc. However, the basic principles of the present invention are not limited to any specific size / type of vector data. In one embodiment, the mask registers 1207 include eight 64-bit operand mask registers for performing bit masking operations on the values stored in the vector registers 1206 (e.g., implemented as mask registers k0-k7 described herein). However, the basic principles of the present invention are not limited to any specific mask register size / type.
[0150] Each core 0-N may include a dedicated first-level (L1) cache 1212 and a second-level (L2) cache 1211 for caching instructions and data according to the specified cache management policy. The L1 cache 1212 includes a separate instruction cache 1220 for storing instructions and a separate data cache 1221 for storing data. The instructions and data stored in each processor cache are managed in units of cache lines, and the cache lines may be of a fixed size (e.g., 64 bytes, 128 bytes, 512 bytes in length). Each core of this exemplary embodiment has an instruction fetch unit 1210 for fetching instructions from the main memory 1200 and / or the shared third-level (L3) cache 1216. The instruction fetch unit 1210 includes various well-known components, including: a next instruction pointer 1203 for storing the address of the next instruction to be fetched from the memory 1200 (or one of the caches); a translation lookaside buffer (ITLB) 1204 for storing the mapping of the most recently used virtual-to-physical instruction addresses to improve the address translation speed; a branch prediction unit 1202 for speculatively predicting instruction branch addresses; and a branch target buffer (BTB) 1201 for storing branch addresses and target addresses.
[0151] As mentioned, the decode unit 1230 includes DSP instruction decoding circuitry / logic 1231 for decoding the DSP instructions described herein into micro-operations or "uops" and DSP instruction execution circuitry / logic 1241 for executing the DSP instructions. The writeback / retire unit 1250 retires the executed instructions and writes back the results.
[0152] Example for Performing Vector Horizontal Addition of Packed Signed / Unsigned Words and Double Words
[0153] One embodiment of the present invention includes an instruction that performs a horizontal addition of two signed or unsigned words from source registers, saturates the resulting sum, and stores the final word result in a packed data element position in a destination register. The data element position in one implementation corresponds to the data element position of one of the multiple words in the source register.
[0154] One embodiment performs a horizontal addition of double words in a similar manner. Specifically, this embodiment includes an instruction that performs a horizontal addition of two signed or unsigned double words from source registers, saturates the resulting sum, and stores the final double word result in a packed data element position in a destination register. The data element position in one implementation corresponds to the data element position of one of the multiple double words in the source register.
[0155] A particular implementation includes the instruction VPHADDLSWUQ xmm1, xmm2 / m128, which performs a vector unsigned horizontal addition of unsigned words at [15:0] and [79:64] of the source register xmm2 / m128 (a packed data register or a memory location), and writes the unsigned result to the word location [15:0] of the destination register, xmm1[15:0].
[0156] An embodiment also includes the instruction VPHADDLSWQ xmm1, xmm2 / m128, which performs a vector signed horizontal addition of signed words at [15:0] and [79:64] of the source register xmm2 / m128 (a packed data register or a memory location), and writes the signed result to the word location [15:0] of the destination register, xmm1[15:0].
[0157] An implementation includes the instruction VPHADDLSDUQ xmm1, xmm2 / m128, which performs a vector unsigned horizontal addition of doublewords at [31:0] and [95:64] of the source register xmm2 / m128 (a packed data register or a memory location), and writes the unsigned result to the doubleword location [31:0] of the destination register, xmm1[31:0].
[0158] In addition, an embodiment includes the instruction VPHADDLSDQ xmm1, xmm2 / m128, which performs a vector signed horizontal addition of doublewords at [31:0] and [95:64] of the source register xmm2 / m128 (a packed data register or a memory location), and writes the signed result to the doubleword location [31:0] of the destination register, xmm1[31:0].
[0159] The figure shows exemplary data elements and bit distributions for exemplary source registers and / or destination registers (SRCx / DESTx). As shown, the data elements can be packed into the source register and / or destination register as words (16 bits), doublewords (32 bits), and / or quadwords (64 bits). In the implementations described herein, for example, the source register and the destination register store words (illustrated as data elements A - H of 16 bits) or doublewords (illustrated as elements B - A, D - C, F - E, and H - G). Other embodiments can store larger or smaller values, such as quadwords (illustrated as the lower quadword D - A and the upper quadword H - E) or bytes, respectively. However, the underlying principles of the present invention are not limited to any specific data size.
[0160] The figure shows an exemplary architecture for executing an instruction to perform a horizontal addition operation on signed / unsigned words or doublewords. One embodiment uses double-packed word data elements or packed doubleword data elements stored in register SRC1 1401 or SRC2 1402. illustrates the word implementation, while illustrates the doubleword implementation. For purposes of explanation, the word values in are identified as 16-bit elements A-H, and the doubleword values in are identified as 32-bit elements HG, FE, DC, and BA. In the implementations described herein, the word values and doubleword values can be signed or unsigned packed data values.
[0161] In one embodiment, a vector horizontal addition instruction can be executed via input multiplexer 1403, adder network 1410-1411, saturation circuits 1440-1441, and output multiplexer 1450. The input multiplexer 1403 selects the signed word data elements and doubleword data elements to be added, the adder network 1410-1411 performs the addition operation, the saturation circuits 1440-1441 saturate the result if necessary, and the output multiplexer 1450 routes the word / doubleword result to destination register 1460.
[0162] The architecture shown in can be used to execute a variety of different DSP-based instructions, such as multiply-accumulate, reciprocal, reciprocal square root, shift and extract, and multiply, as well as addition / multiplication of complex numbers, to name just a few. The various components shown in can be used to execute some instructions but not others. For example, in one embodiment, when executing the vector horizontal addition instruction described herein, multiplier 1405 and accumulators 1420-1421 are not used. In this case, the data can simply bypass these circuits without modification.
[0163] One embodiment of the VPHADDLSWUQ xmm1,xmm2 / m128 instruction is represented by the following code sequence:
[0164] TEMP[16:0] ← (SRC1[15:0] + SRC1[79:64]); (*unsigned addition*)
[0165] DEST[15:0] ← SaturateToUnSignedWord(TEMP[16:0]);
[0166] DEST[127:16] ← 0;
[0167] One embodiment of the VPHADDLSWQ xmm1, xmm2 / m128 instruction is represented by the following code sequence:
[0168] TEMP[16:0] ← ({SRC1
[15] , SRC1[15:0]} + {SRC1
[79] , SRC1[79:64]});
[0169] (*Signed addition*)
[0170] DEST[15:0] ← SaturateToSignedWord(TEMP[16:0]);
[0171] DEST[127:16] ← 0;
[0172] One embodiment of the VPHADDLSDUQ xmm1, xmm2 / m128 instruction is represented by the following code sequence:
[0173] TEMP[32:0] ← (SRC1[31:0] + SRC1[95:64]); (*Unsigned addition*)
[0174] DEST[31:0] ← SaturateToUnSignedDword(TEMP[32:0]);
[0175] DEST[127:32] ← 0;
[0176] One embodiment of the VPHADDLSDQ xmm1, xmm2 / m128 instruction is represented by the following code sequence:
[0177] TEMP[32:0] ← ({SRC1
[31] , SRC1[31:0]} + {SRC1
[95] , SRC1[95:64]}); (*Signed addition*)
[0178] DEST[31:0] ← SaturateToSignedDword(TEMP[32:0]);
[0179] DEST[127:32] ← 0;
[0180] In the above code, the VPHADDLSWUQ instruction performs an unsigned addition of the words at [79:64] and [15:0] within a single source register (SRC1). The result is stored in a 17-bit temporary register or memory location (TEMP[16:0]), where an additional bit is used to account for overflow. Subsequently, if necessary (i.e., if bit 17 of the temporary location is set, which indicates overflow), the temporary result is saturated to an unsigned word, and the final result is stored in bits [15:0] of the destination register. The remaining bits in the 128-bit destination register are set to 0.
[0181] The VPHADDLSWQ instruction operates in substantially the same manner, but the sign bits (i.e., bits 15 and 79) are preserved and used to generate the final signed value. Similarly, VPHADDLSDUQ performs the same basic function, but uses the double-word values stored at [31:0] and [95:64]. A 33-bit temporary result provides space for overflow (into bit 32). The VPHADDLSDQ instruction performs the same operation, but preserves the sign bits (bits 31 and 95) for generating the final signed value.
[0182] In illustrates a method according to an embodiment of the present invention. The method can be implemented within the context of the processors and system architectures described above, but is not limited to any particular system architecture.
[0183] At 1501, a horizontal addition instruction is fetched, which has fields for an opcode, a source operand indicating a packed word, and a destination operand indicating a packed word. At 1502, the horizontal addition instruction is decoded to generate a first decoded instruction (e.g., decoded into multiple micro-operations). At 1503, the packed word values are fetched and stored in a first data element location and a second data element location in the source register. Subsequently, the decoded instruction is scheduled.
[0184] At 1504, the decoded instruction is executed to perform a horizontal addition of a first packed word and a second packed word from a first source register, thereby generating a temporary sum. As mentioned, the temporary sum can be a 17-bit value to account for overflow. If necessary, the temporary sum is saturated to 16 bits to generate the final result. At 1505, the final result is stored as a packed word in the destination register. As described above, the first packed word, the second packed word, and the final result can be signed words or unsigned words.
[0185] In illustrates a method according to an embodiment of the present invention. The method can be implemented within the context of the processors and system architectures described above, but is not limited to any particular system architecture.
[0186] At 1601, a horizontal addition instruction is fetched, which has fields for an opcode, a source operand indicating a packed doubleword (32 bits), and a destination operand indicating a packed doubleword. At 1602, the horizontal addition instruction is decoded to generate a first decoded instruction (e.g., decoded into multiple micro-operations). At 1603, a packed doubleword value is fetched and stored in the first and second data element positions in a source register. Subsequently, the decoded instruction is scheduled.
[0187] At 1604, the decoded instruction is executed to perform a horizontal addition of a first packed doubleword and a second packed doubleword from a first source register, thereby generating a temporary sum. As mentioned, the temporary sum can be a value of 33 bits to account for overflow. If necessary, the temporary sum is saturated to 32 bits to generate a final result. At 1605, the final result is stored as a packed doubleword in a destination register. As described above, the first packed doubleword, the second packed doubleword, and the final result can be signed or unsigned doublewords.
[0188] In the foregoing specification, embodiments of the invention have been described with reference to specific exemplary embodiments of the invention. However, it will be apparent that various modifications and changes can be made to these embodiments without departing from the broader spirit and scope of the invention as set forth in the appended claims. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.
[0189] Embodiments of the invention may include the steps described above. These steps may be embodied in machine-executable instructions that can be used to cause a general-purpose or special-purpose processor to execute these steps. Alternatively, these steps may be performed by a special-purpose hardware component that includes hardwired logic for performing these steps, or by any combination of programmed computer components and custom hardware components.
[0190] As described herein, an instruction can refer to a specific configuration of hardware, such as an application specific integrated circuit (ASIC) configured to perform certain operations or having a predetermined function, or software instructions stored in a memory embodied in a non-transitory computer-readable medium. Thus, the techniques shown in the figures can be implemented using code and data stored on and executed on one or more electronic devices (e.g., terminal stations, network elements, etc.). Such electronic devices use computer machine-readable media such as non-transitory computer machine-readable storage media (e.g., magnetic disks; optical disks; random access memory; read-only memory; flash devices; phase change memory) and transitory computer machine-readable communication media (e.g., electrical, optical, acoustic, or other forms of propagated signals - such as carrier waves, infrared signals, digital signals, etc.) to store and transfer code and data (internally and / or over a network to other electronic devices). Additionally, such electronic devices typically include a set of one or more processors coupled to one or more other components, such as one or more storage devices (non-transitory machine-readable storage media), user input / output devices (e.g., keyboards, touchscreens, and / or displays), and network connections. The coupling of the set of processors to the other components is typically through one or more buses and bridges (also referred to as bus controllers). The storage devices and the signals carrying network traffic represent one or more machine-readable storage media and machine-readable communication media, respectively. Thus, the storage devices of a given electronic device typically store code and / or data for execution on the set of one or more processors of that electronic device. Of course, one or more portions of embodiments of the present invention can be implemented using different combinations of software, firmware, and / or hardware. Throughout this detailed description, numerous specific details are set forth for purposes of explanation in order to provide a thorough understanding of the present invention. However, it will be apparent to one of ordinary skill in the art that the present invention can be practiced without some of these specific details. In some instances, well-known structures and functions are not described in detail so as not to obscure the subject matter of the present invention. Therefore, the scope and spirit of the present invention should be determined according to the appended claims.
Claims
1. A processor, comprising: a decoder for decoding a packed horizontal addition instruction to generate a decoded packed horizontal addition instruction, the packed horizontal addition instruction including an opcode and an operand identifying a plurality of packed words, wherein the opcode is used to identify the plurality of packed words as signed packed words or unsigned packed words; a source register for storing a first plurality of packed words; an execution circuit for executing the decoded instruction, the execution circuit including: an operand selection circuit for identifying a first packed word and a second packed word from the source register according to the operand and the opcode of the packed horizontal addition instruction, wherein the first packed word and the second packed word are selected from non-adjacent fixed positions in the source register; an adder circuit for adding the first packed word and the second packed word to generate a temporary sum; a temporary storage having at least 17 bits for storing the temporary sum; a saturation circuit for saturating the temporary sum if necessary to generate a final result; a destination register for storing the final result as a packed result word in a specified data element position, wherein the specified data element position corresponds to a data element position of one of the first packed word and the second packed word, and any remaining bits in the destination register are set to zero.
2. The processor according to claim 1, wherein, The saturation circuit is used to determine whether saturation of the word is necessary based on the value of the most significant bit of the 17 bits.
3. The processor according to claim 1 or 2, wherein The saturation circuit is used to: saturate the temporary sum if bit 17 is set to 1.
4. The processor according to claim 1 or 2, wherein, The packed words and the packed result word include signed words.
5. The processor according to claim 4, wherein, The adder circuit is used to: retain and process the sign bits of the first packed word and the second packed word when performing the addition operation.
6. The processor according to claim 1 or 5, wherein The first packed word and the second packed word are selected from positions [15:0] and [79:64] of the source register.
7. A processor, comprising: a decoder for decoding a packed horizontal addition instruction to generate a decoded packed horizontal addition instruction, the packed horizontal addition instruction including an opcode and an operand identifying a plurality of packed doublewords, wherein the opcode is used to identify the plurality of packed doublewords as signed packed doublewords or unsigned packed doublewords; a source register for storing a first plurality of packed doublewords; an execution circuit for executing the decoded instruction, the execution circuit including: an operand selection circuit for identifying a first packed doubleword and a second packed doubleword from the source register according to the operand and the opcode of the packed horizontal addition instruction, wherein the first packed doubleword and the second packed doubleword are selected from non-adjacent fixed positions in the source register; an adder circuit for adding the first packed doubleword and the second packed doubleword to generate a temporary sum; a temporary storage having at least 33 bits for storing the temporary sum; a saturation circuit for saturating the temporary sum if necessary to generate a final result; A destination register for storing the final result as a packed result doubleword at a specified data element position, where the specified data element position corresponds to a data element position of one of the first packed doubleword and the second packed doubleword, and any remaining bits in the destination register are set to zero.
8. The processor according to claim 7, wherein, The saturation circuit is used to determine whether saturation of the doubleword is necessary based on the value of the 33-bit most significant bit.
9. The processor according to claim 7 or 8, wherein, The saturation circuit is configured to: if bit 33 is set to 1, saturate the temporary sum.
10. The processor according to claim 7 or 8, wherein, The packed doubleword and the packed result doubleword include signed doublewords.
11. The processor according to claim 10, wherein, The adder circuit is configured to: when performing the addition operation, preserve and process the sign bits of the first packed doubleword and the second packed doubleword.
12. The processor according to claim 7 or 11, wherein, The first packed doubleword and the second packed doubleword are selected from positions [31:0] and [95:64] of the source register.
13. A method for processing an instruction, comprising: Decoding a packed horizontal addition instruction to generate a decoded packed horizontal addition instruction, the packed horizontal addition instruction including an opcode and operands identifying a plurality of packed words, wherein the opcode is used to identify the plurality of packed words as signed packed words or unsigned packed words; Storing a first plurality of packed words in a source register; Executing the decoded instruction to perform the following operations: Identifying a first packed word and a second packed word from the source register according to the operands and the opcode of the packed horizontal addition instruction, wherein the first packed word and the second packed word are selected from non-adjacent fixed positions in the source register; Adding the first packed word and the second packed word to generate a temporary sum; Storing the temporary sum in a temporary storage having at least 17 bits; Saturating the temporary sum if necessary to generate a final result; Storing the final result as a packed result word at a specified data element position of a destination register, where the specified data element position corresponds to a data element position of one of the first packed word and the second packed word, and any remaining bits in the destination register are set to zero.
14. The method according to claim 13, further comprising: Determining whether saturation of the word is necessary based on the value of the 17-bit most significant bit.
15. The method according to claim 13 or 14, wherein, If bit 17 is set to 1, the temporary sum will be saturated.
16. The method according to claim 13 or 14, wherein The packed word and the packed result word include signed words.
17. The method according to claim 16, wherein, When performing the addition operation, the sign bits of the first packed word and the second packed word will be preserved and processed.
18. The method according to claim 13 or 17, wherein The first packed word and the second packed word are selected from positions [15:0] and [79:64] of the source register.
19. A machine-readable medium having program code stored thereon, the program code causing the machine to perform the following operations when executed by the machine: Decode a packed horizontal add instruction to generate a decoded packed horizontal add instruction, the packed horizontal add instruction including an opcode and an operand identifying a plurality of packed words, wherein, The opcode is used to identify the plurality of packed words as signed packed words or unsigned packed words; Storing a first plurality of packed words in a source register; Executing the decoded instruction to perform the following operations: Identify a first packed word and a second packed word from the source register according to the operand and the opcode of the packed horizontal addition instruction, wherein the first packed word and the second packed word are selected from non-adjacent fixed positions in the source register; Add the first packed word and the second packed word to generate a temporary sum; Store the temporary sum in a temporary storage having at least 17 bits; Saturate the temporary sum if necessary to generate a final result; Store the final result as a packed result word in a specified data element position of a destination register, wherein the specified data element position corresponds to a data element position of one of the first packed word and the second packed word, and any remaining bits in the destination register are set to zero.
20. The machine-readable medium according to claim 19, further comprising: Determine whether saturation of the word is necessary based on the value of the most significant bit of the 17 bits.
21. The machine-readable medium according to claim 19 or 20, wherein If bit 17 is set to 1, the temporary sum will be saturated.
22. The machine-readable medium according to claim 19 or 20, wherein, The packed word and the packed result word include signed words.
23. The machine-readable medium according to claim 22, wherein, When performing the addition operation, the sign bits of the first packed word and the second packed word will be retained and processed.
24. The machine-readable medium according to claim 19 or 23, wherein, The first packed word and the second packed word are selected from positions [15:0] and [79:64] of the source register.
25. An apparatus for processing instructions, comprising: means for decoding a packed horizontal addition instruction to generate a decoded packed horizontal addition instruction, the packed horizontal addition instruction including an opcode and an operand identifying a plurality of packed words, wherein the opcode is used to identify the plurality of packed words as signed packed words or unsigned packed words; means for storing a first plurality of packed words in a source register; means for executing the decoded instruction; means for identifying a first packed word and a second packed word from the source register according to the operand and the opcode of the packed horizontal addition instruction, wherein the first packed word and the second packed word are selected from non-adjacent fixed positions in the source register; means for adding the first packed word and the second packed word to generate a temporary sum; means for storing the temporary sum in a temporary storage having at least 17 bits; means for saturating the temporary sum if necessary to generate a final result; means for storing the final result as a packed result word in a specified data element position of a destination register, wherein the specified data element position corresponds to a data element position of one of the first packed word and the second packed word, and any remaining bits in the destination register are set to zero.
Citation Information
Patent Citations
Arithmetic unit for addition or subtraction with preliminary saturation detection
CN1826580A
Multi-element instruction with different read and write masks
US20130339678A1