Systems, apparatuses, and methods for fused multiply-add

By using fused instructions and accumulator design in multiplication-accumulation operations, the overflow and saturation problems in multiplication-accumulation operations are solved, achieving efficient and accurate data calculation.

CN115480730BActive Publication Date: 2026-11-24INTEL CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211329959.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2016-10-20
Publication Date
2026-11-24
Estimated Expiration
2036-10-20

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively manage the number of bits in input items when processing multiplication and accumulation operations on large datasets, leading to overflow or saturation during computation. Furthermore, existing methods fail to effectively handle sign extension and rounding issues.

Method used

By employing a fused multiply-accumulate instruction, the accuracy and correctness of computation are ensured by keeping the input data size small and using a larger accumulator, combined with sign extension and saturation evaluation.

Benefits of technology

It avoids overflow and saturation in large dataset computations, ensures computational accuracy, supports sign extension and rounding for different data types, and improves computational efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115480730B_ABST
    Figure CN115480730B_ABST
Patent Text Reader

Abstract

This application discloses systems, apparatus, and methods for fused multiply-add. In some embodiments, the compressed data elements of first and second compressed data source operands have a first size different from the second size of the compressed data elements of a third compressed data operand. An execution circuit executes a decoded single instruction to perform the following for each compressed data element location of the destination operand: multiplication of M N-sized compressed data elements from the first and second compressed data sources corresponding to the compressed data element location of the third compressed data source; adding the result of these multiplications to the full-size compressed data element of the compressed data element location of the third compressed data source; and storing the addition result in the compressed data element location destination corresponding to the compressed data element location of the third compressed data source, where M equals the full-size compressed data element divided by N.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application entitled "System, apparatus and method for fused multiply-add" with PCT international application number PCT / US2016 / 057991, international application date October 20, 2016, and Chinese national phase application number 201680089435.5. Technical Field

[0002] The field of this invention generally relates to computer processor architecture, and more specifically to instructions that, when executed, produce specific results. Background Technology

[0003] A common operation in linear algebra is the multiplicative accumulation operation (e.g., c = c + a * b). Multiplicative accumulation is typically a suboperation in an operation stream, such as the dot product between two vectors; it can also be a single product of columns and rows in matrix multiplication. For example,

[0004] C=0

[0005] For(I)

[0006] C+=A[l]*B[l]. Attached Figure Description

[0007] The invention is illustrated by way of example and not limitation in the accompanying drawings, in which the same reference numerals indicate similar elements and wherein:

[0008] Figure 1 The illustration shows an exemplary execution of a fused multiply-accumulate instruction using operands of different sizes according to an embodiment;

[0009] Figure 2 The illustration shows a SIMD implementation of a power-of-two size according to an embodiment, wherein the accumulator uses an input size larger than the input to the multiplier;

[0010] Figure 3 An embodiment of hardware for processing instructions such as fused multiply-accumulate instructions is illustrated;

[0011] Figure 4 An embodiment of a method executed by a processor to process fused multiply-accumulate instructions is illustrated;

[0012] Figure 5 The illustration shows an example of a subset of the execution of the merged multiplication accumulation;

[0013] Figure 6 An example of pseudocode for implementing this instruction in hardware is illustrated;

[0014] Figure 7The illustration shows an example of a subset of the execution of the merged multiplication accumulation;

[0015] Figure 8 An example of pseudocode for implementing this instruction in hardware is illustrated;

[0016] Figure 9 The illustration shows an example of a subset of the execution of the merged multiplication accumulation;

[0017] Figure 10 An example of pseudocode for implementing this instruction in hardware is illustrated;

[0018] Figure 11 The illustration shows an example of a subset of the execution of the merged multiplication accumulation;

[0019] Figure 12 An example of pseudocode for implementing this instruction in hardware is illustrated;

[0020] Figure 13A It is a block diagram illustrating a general vector-friendly instruction format and its Class A instruction template according to an embodiment of the present invention;

[0021] Figure 13B It is a block diagram illustrating a general vector-friendly instruction format and its Class B instruction template according to an embodiment of the present invention;

[0022] Figure 14A This is a block diagram illustrating an exemplary vector-friendly instruction format according to an embodiment of the present invention;

[0023] Figure 14B It is a block diagram illustrating a specific vector-friendly instruction format field constituting a full opcode field according to an embodiment of the present invention;

[0024] Figure 14C It is a block diagram illustrating a field in a specific vector-friendly instruction format that constitutes a register index field according to an embodiment of the present invention;

[0025] Figure 14D It is a block diagram illustrating a specific vector-friendly instruction format of fields constituting an amplification operation field according to an embodiment of the present invention;

[0026] Figure 15 This is a block diagram of a register architecture according to an embodiment of the present invention;

[0027] Figure 16A It is a block diagram illustrating both an exemplary ordered pipeline and an exemplary register renaming and unordered publish / execute pipeline according to embodiments of the present invention.

[0028] Figure 16B It is a block diagram illustrating an ordered architecture core according to an embodiment of the present invention, and exemplary embodiments of both an exemplary register renaming and an unordered release / execution architecture core to be included in a processor;

[0029] Figure 17A This is a block diagram of a single processor core according to an embodiment of the present invention, the single processor core together with its connection to the on-die interconnect network 1702 and together with a partial subset of its level 2 (L2) cache 1704;

[0030] Figure 17B This is according to an embodiment of the present invention. Figure 17A An expanded view of a portion of the processor core;

[0031] Figure 18 This is a block diagram of a processor 1800 according to an embodiment of the present invention. The processor 1800 may have more than one core, may have an integrated memory controller, and may have integrated graphics.

[0032] Figure 19 A block diagram of a system according to an embodiment of the present invention is shown;

[0033] Figure 20 This is a block diagram of a first more specific exemplary system according to an embodiment of the present invention;

[0034] Figure 21 This is a block diagram of a second, more specific, exemplary system according to an embodiment of the present invention;

[0035] Figure 22 This is a block diagram of a SoC according to an embodiment of the present invention; and

[0036] Figure 23 It is a block diagram that, according to an embodiment of the invention, contrasts the use of a software instruction converter to convert binary instructions in a source instruction set into binary instructions in a target instruction set. Detailed Implementation

[0037] Numerous specific details are set forth in the following description. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures, and techniques have not been shown in detail so as not to obscure the understanding of this description.

[0038] References to "an embodiment," "an embodiment," "an exemplary embodiment," etc., in this specification indicate that the described embodiment may include specific features, structures, or characteristics, but each embodiment may not necessarily include the specific features, structures, or characteristics stated herein. Furthermore, such phrases do not necessarily refer to the same embodiment. Moreover, when a specific feature, structure, or characteristic is described in connection with an embodiment, it is claimed that, whether explicitly described or not, the influence of such feature, structure, or characteristic on other embodiments is within the knowledge of those skilled in the art.

[0039] When processing large datasets, memory and computational density can be increased by making the data types as small as possible. If the input comes from sensor data, then 8-bit or 16-bit integer data can be expected as input. Neural network computations, which can also be encoded to match this dense format, typically have "small" numbers as input. However, accumulators sum products, meaning that accumulators should allow twice the number of bits in the input (due to the nature of multiplication) and potentially much more, to avoid overflow or saturation at any point in the computation.

[0040] The embodiments detailed in this article attempt to keep the input data size small and aggregate it into a larger accumulator in a chain of fused multiply-accumulate (FMA) operations. Figure 1 The illustration depicts an exemplary execution of a fused multiply-accumulate instruction using operands of different sizes according to an embodiment. A first source 101 (e.g., a SIMD or vector register) and a second source 103 store “half-size” packed data elements (e.g., single-input, multiple-data (SIMD) or vector registers) with respect to a third source 105, which stores the full-size packed data elements for accumulation. Any set of values ​​for the packed data element size in this manner is supported.

[0041] As shown, the values ​​stored in the same location of the compact data elements in the first and second sources 101 and 103 are multiplied together. For example, A0*B0, A1*B1, etc. The result of multiplying two such "half-size" compact data elements is added to the corresponding "full-size" compact data element from the third source 105. For example, A0*B0+A1*B1+C0, etc.

[0042] The results are stored in destination 107 (e.g., a SIMD register), which has a compact data element size of at least "full size". In some embodiments, the third source 105 and destination 107 are the same.

[0043] Figure 2The illustration shows a SIMD implementation of a power-of-two size according to an embodiment, where the accumulator uses an input size larger than the input to the multiplier. Note that the source (for the multiplier) and the accumulator value can be signed or unsigned. Table 201 illustrates different configurations for an accumulator with an input size of 2X (in other words, the accumulator input value is twice the size of the compacted data element of the source). For a byte-sized source, the accumulator uses a word or half-precision floating-point (HPFP) value, which is 16 bits in size. For a word-sized source, the accumulator uses a 32-bit integer or single-precision floating-point (SPFP) value, which is 32 bits in size. For an SPFP or 32-bit integer-sized source, the accumulator uses a 64-bit integer or double-precision floating-point (DPFP) value, which is 64 bits in size. Figure 1 As an example, when the compressed data element size of source 1 101 and source 2 103 is 8 bits, the accumulator will use a 16-bit data element from source 3 103. When the compressed data element size of source 1 101 and source 2 103 is 16 bits, the accumulator will use a 32-bit data element from source 3 103. When the compressed data element size of source 1 101 and source 2 103 is 32 bits, the accumulator will use a 64-bit data element from source 3 103.

[0044] For accumulators with an input size of 4X (in other words, the accumulator input value is four times the size of the compressed data element of the source), Table 203 illustrates the different configurations. For byte-sized sources, the accumulator uses 32-bit integer or single-precision floating-point (SPFP) values, which are 32 bits in size. For word-sized sources, the accumulator uses 64-bit integer or double-precision floating-point (DPFP) values, which are 64 bits in size. Figure 1 As an example, when the size of the compressed data elements from source 1 101 and source 2 103 is 8 bits, the accumulator will use a 32-bit data element from source 3 103. When the size of the compressed data elements from source 1 101 and source 2 103 is 16 bits, the accumulator will use a 64-bit data element from source 3 103.

[0045] For an accumulator with an input size of 8X (in other words, the accumulator input value is eight times the size of the compressed data element of the source), Table 205 illustrates a configuration. For a byte-sized source, the accumulator uses 64-bit integer or double-precision floating-point (DPFP) values, which are 64 bits in size. Figure 1 As an example, when the size of the compressed data elements from source 1 101 and source 2 103 is 8 bits, the accumulator will use a 64-bit data element from source 3 103.

[0046] This document details embodiments of instructions and circuitry for fused multiply-accumulate operations. In some embodiments, the fused multiply-accumulate instructions have mixed precision and / or use level reduction, as detailed herein.

[0047] This document details an embodiment of the following instruction: When executed, the instruction causes M multiplications of N-sized compact data elements from the first and second sources corresponding to the compact data element locations of the third source for each compact data element location at the destination, and adds the results of these multiplications to the full-size (relative to N-sized compact data elements) compact data element of the compact data element location of the third source, and stores the results of the additions in the compact data element location destination corresponding to the compact data element location of the third source, where M equals the full-size compact data element divided by N. For example, when M equals 2 (e.g., the full-size compact data element is 16 bits and N is 8 bits), successive compact data elements from the first source are multiplied by the corresponding successive compact data elements from the second source.

[0048] Therefore, the embodiments detailed herein are as follows: when executed, the instructions cause multiplication of half-size compacted data element pairs from the first and second sources, and add the results of these multiplications to a full-size (relative to half-size compacted data element) compacted data element from the third source and store the results in a destination. In other words, in some embodiments, for each data element location i from the third source, there is a multiplication of data from data element location [2i] of the first source with data from data element location [2i] of the second source to generate a first result, a multiplication of data from data element location [2i+1] of the first source with data from data element location [2i+1] of the second source to generate a second result, and the first and second results are added to data from data element location i of the third source. In some embodiments, saturation is performed at the end of the addition. In some embodiments, the data from the first and / or second sources is sign-expanded before multiplication.

[0049] Furthermore, the embodiments detailed herein are as follows: when executed, the instructions cause multiplication of quartets of compact data elements of one-quarter size from the first and second sources, and add the results of these multiplications to a full-size (relative to the one-quarter size compact data element) compact data element from the third source and store the results in the destination. In other words, in some embodiments, for each data element location i of the third source, there is a multiplication of data from data element location [4i] of the first source with data from data element location [4i] of the second source to generate a first result, a multiplication of data from data element location [4i+1] of the first source with data from data element location [4i+1] of the second source to generate a second result, a multiplication of data from data element location [4i+2] of the first source with data from data element location [4i+2] of the second source to generate a second result, a multiplication of data from data element location [4i+3] of the first source with data from data element location [4i+3] of the second source to generate a second result, and the first, second, third, and fourth results are added to the data from data element location i of the third source. In some embodiments, saturation is performed at the end of the addition. In some embodiments, the data from the first and / or second sources are sign-extended before multiplication.

[0050] In some embodiments of the integer version of the instructions, saturation circuitry is used to maintain the sign of the operands when addition results in a value that is too large. Specifically, saturation evaluation occurs on the infinite-precision result between the multiplexed addition and the write to the destination. There are instances where the largest positive or smallest negative number cannot be trusted, as it may reflect computation exceeding the container space. However, this can at least be checked. When the accumulator is floating-point and the input items are integers, the question then becomes how and when to perform the conversion from integer products so that there is no double-rounding from partial items to the final floating-point accumulation. In some embodiments, the product sum and the floating-point accumulator are converted to infinite-precision values ​​(hundreds of digits fixed-point numbers), addition is performed, and then a single rounding to the actual accumulator type is performed.

[0051] In some embodiments, when the inputs are floating-point operands, rounding and handling special values ​​(infinity and not a number (NAN)), as well as the ordering of errors in computation, need to be addressed in the definition. In some embodiments, the order of operations is specified, simulated, and the implementation is ensured to deliver errors in that order. For such implementations, it may be impossible to avoid multiple roundings during computation. Single-precision multiplication can completely fill the double-precision result, regardless of the input value. However, horizontal addition of two such operations may not be suitable for double-precision without rounding, and the sum may not be suitable for the accumulator without additional rounding. In some embodiments, rounding is performed during horizontal summation and once during accumulation.

[0052] Figure 3 An embodiment of hardware for processing instructions such as fused multiply-accumulate instructions is illustrated. As illustrated, storage device 303 stores fused multiply-accumulate instructions 301, which, when executed, cause M multiplications of N-sized compact data elements from first and second sources corresponding to compact data element locations of a third source for each compact data element location of the destination, add the results of these multiplications to the full-size (relative to N-sized compact data elements) compact data element of the third source compact data element location, and store the results of the additions in the compact data element location destination corresponding to the third source compact data element location, where M equals the full-size compact data element divided by N.

[0053] Instruction 301 is received by decoding circuitry 305. For example, decoding circuitry 305 receives the instruction from fetch logic / circuit. The instruction includes fields for first, second, and third sources and destinations. In some embodiments, the source and destination are registers. Additionally, in some embodiments, the third source and destination are the same. The opcode and / or prefix of instruction 301 includes indications of the source and destination data element sizes {B / W / D / Q} for bytes, words, double words, and quad words, and the number of iterations.

[0054] A more detailed embodiment of at least one instruction format will be described later. Decoding circuitry 305 decodes the instruction into one or more operations. In some embodiments, this decoding includes generating multiple micro-operations to be executed by execution circuitry (such as execution circuitry 311). Decoding circuitry 305 also decodes instruction prefixes.

[0055] In some embodiments, register renaming, register allocation, and / or scheduling circuitry 307 provides functionality for one or more of the following: 1) renaming logical operand values ​​to physical operand values ​​(e.g., register aliasing tables in some embodiments), 2) assigning status bits and flags to decoded instructions, and 3) scheduling decoded instructions for execution on execution circuitry outside the instruction pool (e.g., using reserved stations in some embodiments). Registers (register files) and / or memory 308 store data, such as operands of instructions to be operated on by execution circuitry 309. Exemplary register types include compact data registers, general-purpose registers, and floating-point registers.

[0056] The execution circuit 309 executes the decoded instructions.

[0057] In some embodiments, the write-back / write-back circuit 311 architecturally commits the destination register to a register or memory, and a write-back instruction.

[0058] An embodiment of the format used for fused multiply-accumulate instructions is FMA[SOURCESIZE{B / W / D / Q}][DESTSIZE{B / W / D / Q}]DSTREG, SRC1, SRC2, SRC3. In some embodiments, FMA[SOURCESIZE{B / W / D / Q}][DESTSIZE{B / W / D / Q}] is the opcode and / or prefix of the instruction. B / W / D / Q indicates the size of the source / destination data element as bytes, words, double words, and quadwords. DSTREG is a field for the compact data destination register operand. SRC1, SRC2, and SRC3 are fields for the source, such as a compact data register and / or memory.

[0059] An embodiment of the format for the fused multiply-accumulate instruction is FMA[SOURCESIZE{B / W / D / Q}][DESTSIZE{B / W / D / Q}]DSTREG / SRC3, SRC1, SRC2. In some embodiments, FMA[SOURCESIZE{B / W / D / Q}][DESTSIZE{B / W / D / Q}] is the opcode and / or prefix of the instruction. B / W / D / Q indicates the size of the source / destination data element as bytes, words, double words, and quadwords. DSTREG / SRC3 is a field for the compact data destination register operand and the third source operand. SRC1, SRC2, and SRC3 are fields for the source, such as a compact data register and / or memory.

[0060] In some embodiments, the fused multiply-accumulate instruction includes fields for the write mask register operand (k) (e.g., FMA[SOURCESIZE{B / W / D / Q}][DESTSIZE{B / W / D / Q}]{k}DSTREG / SRC3,SRC1,SRC2 or FMA[SOURCESIZE{B / W / D / Q}][DESTSIZE{B / W / D / Q}]{k}DSTREG,SRC1,SRC2,SRC3). The write mask is used to conditionally control element-wise operations and updates to the result. Depending on the implementation, the write mask uses either merged or zero-masking. Instructions encoding a predictor (write mask, write mask, or k register) operand use that operand to conditionally control element-wise computation operations and updates to the destination operand. The predictor operand is known as the operand mask (write mask) register. The operand mask is a set of architecture registers of size MAX_KL (64 bits). Note that from this set of architecture registers, only k1 through k7 can be addressed as predictive operands. k0 can be used as a regular source or destination, but cannot be encoded as a predictive operand. Also note that predictive operands can be used to enable memory fault tolerance for certain instructions with memory operands (sources or destinations). As predictive operands, the opmask register contains a bit to control the operation / update of each data element in the vector register. Typically, the opmask register can support instructions with the following element sizes: single-precision, floating-point (floating-point 32), integer double-word (integer 32), double-precision floating-point (floating-point 64), and integer quad-word (integer 64). The opmask register length MAX_XL is sufficient to handle up to 64 elements, each with one bit, i.e., 64 bits. For a given vector length, each instruction only accesses the minimum number of valid mask bits required based on its data type. The opmask register affects instructions at an element-wise granularity. Therefore, any numeric or non-numeric operations on each data element, as well as element-wise updates of intermediate results to the destination operand, are predicted at the corresponding bits in the operation mask register. In most embodiments, the operation mask used to predict operands follows these properties: 1) If the corresponding operation mask bit is not set, the operation of the instruction is not performed on the element (meaning that no exception or violation can be caused by the operation on the masked-off element, and therefore, no exception flag is updated as a result of the masked operation); 2) If the corresponding write mask bit is not set, the result of the operation is not used to update the destination element. Instead, the destination element value must be preserved (merge-masked) or it must be zeroed (zero-masked); 3) For some instructions with memory operands, memory faults are suppressed for elements with a 0-mask bit.Note that this feature provides a general construct for implementing control flow prediction because the mask effectively provides merging behavior for the vector register destination. As an alternative, masking can be used for zeroing instead of merging, allowing the masked elements to be updated with 0 instead of preserving the old values. Zeroing behavior is provided to remove implicit dependencies on old values ​​when they are no longer needed.

[0061] In one embodiment, the instruction encoding includes a scale-index-base (SIB) type memory addressing operand that indirectly identifies multiple indexed destination locations in memory. In one embodiment, the SIB type memory operand may include an encoding that identifies a base address register. The contents of the base address register may represent a base address in memory, against which the address of a specific destination location in memory is calculated. For example, the base address may be the address of a first location within a block of potential destination locations for an extended vector instruction. In one embodiment, the SIB type memory operand may include an encoding that identifies an index register. Each element of the index register may specify an index or offset value that can be used to calculate the address of the corresponding destination location within a block of potential destination locations based on the base address. In one embodiment, the SIB type memory operand may include an encoding that specifies a scaling factor to be applied to each index value when calculating the corresponding destination address. For example, if a scaling factor value of four is encoded in the SIB type memory operand, each index value obtained from the elements of the index register may be multiplied by four and then added to the base address to calculate the destination address.

[0062] In one embodiment, a memory operand of type SIB in the form vm32{x,y,z} can identify a vector array of memory operands specified using memory addressing of the SIB type. In this example, the array of memory addresses is specified using a common base register, a constant scaling factor, and a vector index register containing individual elements, each of which is a 32-bit index value. The vector index register can be an XMM register (vm32x), a YMM register (vm32y), or a ZMM register (vm32z). In another embodiment, a memory operand of type SIB in the form vm64{x,y,z} can identify a vector array of memory operands specified using memory addressing of the SIB type. In this example, the array of memory addresses is specified using a common base register, a constant scaling factor, and a vector index register containing individual elements, each of which is a 64-bit index value. The vector index register can be an XMM register (vm64x), a YMM register (vm64y), or a ZMM register (vm64z).

[0063] Figure 4 An embodiment of a method for a processor to execute fused multiply-accumulate instructions is illustrated.

[0064] At position 401, the instruction is fetched. For example, a fused multiply-accumulate instruction is fetched. The fused multiply-accumulate instruction includes an opcode and fields for the compressed data source operands and compressed data destination operands as detailed above. In some embodiments, the fused multiply-accumulate instruction includes a write mask operand. In some embodiments, the instruction is fetched from the instruction cache.

[0065] The fetched instruction is decoded at 403. For example, the fetched fused multiply-accumulate instruction is decoded by a decoding circuit such as the one detailed in this article.

[0066] Retrieve the data value associated with the source operand of the decoded instruction at position 405.

[0067] At 407, the decoded instructions are executed by an execution circuit (hardware) such as the one detailed herein. For a fused multiply-accumulate instruction, the execution will cause for each compact data element location of the destination: M N-sized compact data elements from the first and second sources corresponding to the compact data element location of the third source, the results of these multiplications are added to the full-size (relative to N-sized compact data elements) compact data element of the compact data element location of the third source, and the results of the additions are stored in the compact data element location destination corresponding to the compact data element location of the third source, where M is equal to the full-size compact data element divided by N.

[0068] In some embodiments, a submit or retire instruction is given at 409.

[0069] Figure 5 The illustration depicts an embodiment of a subset of the execution of fused multiply-accumulate. Specifically, it illustrates the iterative execution circuitry for locating a compact data element at the destination. In this embodiment, the fused multiply-accumulate operates on a signed source, where the accumulator is 2 x the input data size. Figure 6 An example of pseudocode for implementing the instruction in hardware is illustrated.

[0070] The first signed source (source 1 501) and the second signed source (source 2 503) each have four compact data elements. Each of these compact data elements stores signed data, such as floating-point data. The third signed source 509 (source 3) has two compact data elements, each of which stores signed data. The sizes of the first and second signed sources 501 and 503 are half the size of the third signed source 509. For example, the first and second signed sources 501 and 503 can have 32-bit compact data elements (e.g., single-precision floating-point), and the third signed source 509 can have 64-bit compact data elements (e.g., double-precision floating-point).

[0071] This diagram only shows the locations of the two most effective compressed data elements of the first and second signed sources 501 and 503, and the most effective compressed data element of the third signed source 509. Other compressed data element locations will, of course, be processed.

[0072] As illustrated, compressed data elements are processed in pairs. For example, data located from the most valid compressed data elements of the first and second signed sources 501 and 503 are multiplied using multiplier circuit 505, and data located from the second most valid compressed data elements of the first and second signed sources 501 and 503 are multiplied using multiplier circuit 507. In some embodiments, these multiplier circuits 505 and 507 are reused for other compressed data element locations. In other embodiments, additional multiplier circuitry is used to enable parallel processing of compressed data elements. In some contexts, parallel execution is performed using a channel of size 509, which is a signed third source. The result of each multiplication is added using adder circuit 511.

[0073] The result of the multiplication is added to the data located by the highest valid compact data element from the signed source 3 509 (by using a different adder 513 or the same adder 511).

[0074] Finally, the result of the second addition is stored in the signed destination 515 of the compact data element location corresponding to the compact data element location used from the signed third source 509. In some embodiments, a write mask is applied to this storage such that storage occurs if the corresponding write mask (bit) is set, and storage does not occur if it is not set.

[0075] Figure 7 The illustration depicts an embodiment of a subset of the execution of fused multiply-accumulate. Specifically, it illustrates the iterative execution circuitry for locating a compact data element at the destination. In this embodiment, the fused multiply-accumulate operates on a signed source, where the accumulator is 2 x the input data size. Figure 8 An example of pseudocode for implementing the instruction in hardware is illustrated.

[0076] The first signed source (source 1 701) and the second signed source (source 2 703) each have four compact data elements. Each of these compact data elements stores signed data, such as integer data. The third signed source 709 (source 3) has two compact data elements, each of which stores signed data. The sizes of the first and second signed sources 701 and 703 are half the size of the third signed source 709. For example, the first and second signed sources 701 and 703 can have 32-bit compact data elements (e.g., single-precision floating-point), and the third signed source 709 can have 64-bit compact data elements (e.g., double-precision floating-point).

[0077] This illustration only shows the locations of the two most effective compacted data elements of the first and second signed sources 701 and 703, and the most effective compacted data element of the third signed source 709. Other compacted data element locations will, of course, be processed.

[0078] As illustrated, compressed data elements are processed in pairs. For example, data located from the most valid compressed data elements of the first and second signed sources 701 and 703 are multiplied using multiplier circuit 705, and data located from the second most valid compressed data elements of the first and second signed sources 701 and 703 are multiplied using multiplier circuit 707. In some embodiments, these multiplier circuits 705 and 707 are reused for other compressed data element locations. In other embodiments, additional multiplier circuitry is used to enable parallel processing of compressed data elements. In some contexts, parallel execution is performed using a channel of size 709 for the signed third source. The result of each multiplication is added to the signed third source 709 using an adder / saturation circuit 711.

[0079] When addition results in a value that is too large, the adder / saturation (accumulator) circuit 711 maintains the sign of the operand. Specifically, saturation evaluation occurs on the infinite-precision result between the multiplexed addition and the write to the signed destination 715. When the accumulator 711 is floating-point and the input is an integer, the product sum and the floating-point accumulator input value are converted to an infinite-precision value (a fixed-point number of several hundred digits), the multiplication result is added to the third input, and a single rounding to the actual accumulator type is performed.

[0080] The results of addition and saturation checks are stored in a signed destination 715 corresponding to the compact data element location used from the signed third source 709. In some embodiments, a write mask is applied to this storage such that storage occurs if the corresponding write mask (bit) is set, and does not occur if it is not set.

[0081] Figure 9 The illustration shows an embodiment of a subset of the execution of fused multiply-accumulate. Specifically, it illustrates the iterative execution circuitry for locating a compact data element at the destination. In this embodiment, the fused multiply-accumulate operates on both signed and unsigned sources, where the accumulator is 4 x the input data size. Figure 10 An example of pseudocode for implementing the instruction in hardware is illustrated.

[0082] The first signed source (source 1 901) and the second unsigned source (source 2 903) each have four compact data elements. Each of these compact data elements contains, for example, floating-point or integer data. The third signed source (source 3 915) has compact data elements in which signed data is stored. The size of the first and second sources 901 and 903 is one-quarter that of the third signed source 915. For example, the first and second sources 901 and 903 may have 16-bit compact data elements (e.g., words), and the third signed source 915 may have 64-bit compact data elements (e.g., double-precision floating-point or 64-bit integers).

[0083] This diagram shows the locations of the four most effective compressed data elements for the first and second sources 901 and 903, and the location of the most effective compressed data element for the third signed source 915. Other compressed data element locations will, of course, be processed, if any exist.

[0084] As illustrated, the compressed data elements are processed in quadruplicate. For example, the data located by the most significant compressed data elements from the first and second sources 901 and 903 are multiplied using multiplier circuit 907, the data located by the second most significant compressed data elements from the first and second sources 901 and 903 are multiplied using multiplier circuit 907, the data located by the third most significant compressed data elements from the first and second sources 901 and 903 are multiplied using multiplier circuit 909, and the data located by the least significant compressed data elements from the first and second sources 901 and 903 are multiplied using multiplier circuit 911. In some embodiments, prior to multiplication, the signed compressed data elements of the first source 901 are sign-expanded, and the unsigned compressed data elements of the second source 903 are zero-expanded.

[0085] In some embodiments, these multiplier circuits 905-911 are reused for locating other compressed data elements. In other embodiments, additional multiplier circuitry is used to enable parallel processing of compressed data elements. In some contexts, parallel execution is performed using channels of size 915, which are signed third sources. The results of each multiplication are added using adder circuitry 911.

[0086] The result of the multiplication is added to the data located by the highest effective compact data element from the signed source 3 915 (by using a different adder 913 or the same adder 911).

[0087] Finally, the result of the second addition is stored in the signed destination 919 of the compact data element location corresponding to the compact data element location used from the signed third source 909. In some embodiments, a write mask is applied to this storage such that storage occurs if the corresponding write mask (bit) is set, and storage does not occur if it is not set.

[0088] Figure 11 The illustration shows an embodiment of a subset of the execution of fused multiply-accumulate. Specifically, it illustrates the iterative execution circuitry for locating a compact data element at the destination. In this embodiment, the fused multiply-accumulate operates on both signed and unsigned sources, where the accumulator is 4 x the input data size. Figure 12 An example of pseudocode for implementing the instruction in hardware is illustrated.

[0089] The first signed source (source 1 1101) and the second unsigned source (source 2 1103) each have four compacted data elements. Each of these compacted data elements contains, for example, floating-point or integer data. The third signed source (source 3 1115) has compacted data elements in which signed data is stored. The sizes of the first and second sources 1101 and 1103 are one-quarter the size of the third signed source 1115. For example, the first and second sources 1101 and 1103 can have 16-bit compacted data elements (e.g., words), and the third signed source 1115 can have 64-bit compacted data elements (e.g., double-precision floating-point or 64-bit integers).

[0090] This diagram shows the locations of the four most effective compacted data elements for the first and second sources 1101 and 1103, and the most effective compacted data element for the third signed source 1115. Other compacted data element locations will, of course, be processed, if any exist.

[0091] As illustrated, the compressed data elements are processed in quadruplicate. For example, the data located by the most valid compressed data elements from the first and second sources 1101 and 1103 are multiplied using multiplier circuit 1107, the data located by the second most valid compressed data elements from the first and second sources 1101 and 1103 are multiplied using multiplier circuit 1107, the data located by the third most valid compressed data elements from the first and second sources 1101 and 1103 are multiplied using multiplier circuit 1109, and the data located by the least valid compressed data elements from the first and second sources 1101 and 1103 are multiplied using multiplier circuit 1111. In some embodiments, prior to multiplication, the signed compressed data elements of the first source 1101 are sign-extended, and the unsigned compressed data elements of the second source 1103 are zero-extended.

[0092] In some embodiments, these multiplier circuits 1105-1111 are reused for other compact data element positioning. In other embodiments, additional multiplier circuitry is used to enable parallel processing of compact data elements. In some contexts, parallel execution is performed using a channel of size 1115 for a signed third source. The result of the addition of the multiplication results is added to the data positioned by the most valid compact data element from the signed source 31115, which is added to the signed third source 1115 using the addition / saturation circuit 1113.

[0093] When addition results in a value that is too large, the adder / saturation (accumulator) circuit 1113 maintains the sign of the operand. Specifically, saturation evaluation occurs on the infinite-precision result between the multiplexed addition and the write to destination 1115. When accumulator 1113 is floating-point and the input is an integer, the product sum and the floating-point accumulator input value are converted to an infinite-precision value (a fixed-point number with hundreds of digits), the multiplication result is added to the third input, and a single rounding to the actual accumulator type is performed.

[0094] The results of addition and saturation checks are stored in a signed destination 1119 in a compact data element location corresponding to the compact data element location used from the signed third source 715. In some embodiments, a write mask is applied to this storage such that storage occurs if a corresponding write mask (bit) is set, and storage does not occur if it is not set.

[0095] The following figures detail exemplary architectures and systems used to implement the embodiments described above. In some embodiments, one or more of the hardware components and / or instructions described above are emulated or implemented as software modules as described below.

[0096] An exemplary embodiment includes a processor comprising a decoder for decoding a single instruction having an opcode, a destination field representing a destination operand, and fields for first, second, and third compressed data source operands, wherein compressed data elements of the first and second compressed data source operands have a first size different from a second size of a compressed data element of the third compressed data operand; a register file having a plurality of compressed data registers, including registers for source and destination operands; and execution circuitry for executing the decoded single instruction for positioning each compressed data element of the destination operand as follows: multiplying M N-sized compressed data elements from the first and second compressed data sources corresponding to the compressed data element positioning of the third compressed data source, adding the results of these multiplications to a full-size compressed data element of the compressed data element positioning of the third compressed data source, and storing the addition result in a compressed data element positioning destination corresponding to the compressed data element positioning of the third compressed data source, wherein M is equal to the full-size compressed data element divided by N.

[0097] In some embodiments, one or more of the following apply: the instruction defines the size of the compacted data element; the execution circuit zero-expands the compacted data element of the second source and sign-expands the compacted data element of the first source before multiplication; when the first size is half the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; when the first size is half the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration; when the first size is one-quarter of the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; and / or when the first size is one-quarter of the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration.

[0098] An exemplary embodiment includes a method for decoding a single instruction having an opcode, a destination field representing a destination operand, and fields for first, second, and third compressed data source operands, wherein the compressed data elements of the first and second compressed data source operands have a first size different from the second size of the compressed data element of the third compressed data operand; a register file having a plurality of compressed data registers, including registers for source and destination operands; and executing the decoded single instruction to perform, for each compressed data element of the destination operand, the following operations: multiplication of M N-sized compressed data elements from the first and second compressed data sources corresponding to the compressed data element location of the third compressed data source; adding the result of these multiplications to the full-size compressed data element of the compressed data element location of the third compressed data source; and storing the addition result in a compressed data element location destination corresponding to the compressed data element location of the third compressed data source, wherein M is equal to the full-size compressed data element divided by N.

[0099] In some embodiments, one or more of the following apply: the instruction defines the size of the compacted data element; the execution circuit zero-expands the compacted data element of the second source and sign-expands the compacted data element of the first source before multiplication; when the first size is half the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; when the first size is half the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration; when the first size is one-quarter of the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; and / or when the first size is one-quarter of the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration.

[0100] An exemplary embodiment includes a non-transitory machine-readable medium storing instructions that, when executed, trigger a method for decoding a single instruction having an opcode, a destination field representing a destination operand, and fields for first, second, and third compressed data source operands, wherein compressed data elements of the first and second compressed data source operands have a first size different from a second size of a compressed data element of the third compressed data operand; a register file having a plurality of compressed data registers, including registers for source and destination operands; and executing the decoded single instruction to perform, for each compressed data element of the destination operand, the following: multiplication of M N-sized compressed data elements from the first and second compressed data sources corresponding to the compressed data element location of the third compressed data source; adding the result of these multiplications to the full-size compressed data element of the compressed data element location of the third compressed data source; and storing the addition result in a compressed data element location destination corresponding to the compressed data element location of the third compressed data source, wherein M is equal to the full-size compressed data element divided by N.

[0101] In some embodiments, one or more of the following apply: the instruction defines the size of the compacted data element; the execution circuit zero-expands the compacted data element of the second source and sign-expands the compacted data element of the first source before multiplication; when the first size is half the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; when the first size is half the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration; when the first size is one-quarter of the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; and / or when the first size is one-quarter of the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration.

[0102] An exemplary embodiment includes a system comprising a memory and a processor, the processor including a decoder for decoding a single instruction having an opcode, a destination field representing a destination operand, and fields for first, second, and third compressed data source operands, wherein compressed data elements of the first and second compressed data source operands have a first size different from a second size of compressed data elements of the third compressed data operand; a register file having a plurality of compressed data registers, including registers for source and destination operands; and execution circuitry for executing the decoded single instruction to perform, for each compressed data element of the destination operand, the following: multiplication of M N-sized compressed data elements from the first and second compressed data sources corresponding to the compressed data element location of the third compressed data source; adding the result of these multiplications to the full-size compressed data element of the compressed data element location of the third compressed data source; and storing the addition result in a compressed data element location destination corresponding to the compressed data element location of the third compressed data source, wherein M is equal to the full-size compressed data element divided by N.

[0103] In some embodiments, one or more of the following apply: the instruction defines the size of the compacted data element; the execution circuit zero-expands the compacted data element of the second source and sign-expands the compacted data element of the first source before multiplication; when the first size is half the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; when the first size is half the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration; when the first size is one-quarter of the second size, a first addition is performed on each of the multiplications, and a second addition is performed on the result of the first addition and the result from the previous iteration; and / or when the first size is one-quarter of the second size, a single addition and a saturation check are performed on each of the multiplications and the result from the previous iteration.

[0104] The embodiments of the instructions(s) detailed above are embodied in the “general vector-friendly instruction format” detailed below, and may be embodied as such. In other embodiments, such a format is not used, and another instruction format is used; however, the following description of write mask registers, various data transformations (swizzling, broadcasting, etc.), addressing, etc., generally applies to the description of the embodiments of the above instructions(s). Furthermore, exemplary systems, architectures, and pipelines are detailed below. The embodiments of the above instructions(s) can be executed in such systems, architectures, and pipelines, but are not limited to those detailed above.

[0105] Instruction set

[0106] An instruction set may include one or more instruction formats. A given instruction format may define various fields (e.g., the number of bits, the position of bits) to specify, among other things, the operation to be performed (e.g., the opcode) and the operand(s) on which the operation will be performed, and / or (e.g., multiple) other data fields (e.g., a mask). Although there are definitions of instruction templates (or subformats), some instruction formats are further decomposed. For example, an instruction template of a given instruction format may be defined to have different subsets of the instruction format fields (the fields are typically in the same order, but at least some have different bit positions because fewer fields are included) and / or defined to allow the given fields to be interpreted differently. Thus, each instruction of an ISA is expressed using a given instruction format (and, if defined, a given template from the instruction templates of 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, the instruction format including an opcode field for specifying the opcode and an operand field for selecting operands (source 1 / destination and source 2); and the appearance of the ADD (addition) instruction in the instruction stream will have specific content in the operand field that selects specific operands. Sets of SIMD extensions known as Advanced Vector Extensions (AVX) (AVX1 and AVX2) and using the Vector Extensions (VEX) encoding scheme have been published and / or disclosed (e.g., see...). 64 and IA-32 Architecture Software Developer's Manual, September 2014; and see also Advanced Vector Extension Programming Reference, October 2014.

[0107] Exemplary instruction format

[0108] Examples of the instructions described herein may be embodied in different formats. Furthermore, exemplary systems, architectures, and pipelines are detailed below. Examples of the instructions may be executed in such systems, architectures, and pipelines, but are not limited to those detailed herein.

[0109] General Vector-Friendly Instruction Format

[0110] A vector-friendly instruction format is an instruction format suitable for use with vector instructions (e.g., the presence of certain fields specific to vector operations). While an embodiment in which both vector and scalar operations are supported through a vector-friendly instruction format has been described, alternative embodiments simply use vector operations and a vector-friendly instruction format.

[0111] Figures 13A-13B This is a block diagram illustrating a general vector-friendly instruction format and its instruction template according to an embodiment of the present invention. Figure 13AIt is a block diagram illustrating a general vector-friendly instruction format and its Class A instruction template according to an embodiment of the present invention; and Figure 13B This 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, a general vector-friendly instruction format 1300 defines Class A and Class B instruction templates, which include a non-memory access instruction template 1305 and a memory access instruction template 1320. In the context of a vector-friendly instruction format, the term "general" means that the instruction format is not constrained to any particular instruction set.

[0112] While embodiments of the invention will be described, the vector-friendly instruction format supports the following: 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 comprises 16 double-word elements or alternatively 8 quad-word elements); 64-byte vector operand length (or size) with a 16-bit (2-byte) or 8-bit (1-byte) data element width (or size); 32-byte vector operand length (or size) with a 32-bit (4-byte) data element width. 64-bit (8-byte), 16-bit (2-byte), or 8-bit (1-byte) data element widths (or sizes); and 16-byte vector operand lengths (or sizes) with 32-bit (4-byte), 64-bit (8-byte), 16-bit (2-byte), or 8-bit (1-byte) data element widths (or sizes); however, alternative embodiments may support more, fewer, and / or different vector operand sizes (e.g., 256-byte vector operands) with more, fewer, or different data element widths (e.g., 128-bit (16-byte) data element widths).

[0113] Figure 13A The Class A instruction templates include: 1) within the non-memory access instruction template 1305, which shows a non-memory access, full round control type operation instruction template 1310, and a non-memory access, data transformation type operation instruction template 1315; and 2) within the memory access instruction template 1320, which shows a memory access, temporary instruction template 1325, and a memory access, non-temporary instruction template 1330. Figure 13B The B-type instruction templates include: 1) within the non-memory access instruction template 1305, which shows the non-memory access, write mask control, and partial round control type operation instruction template 1312, and the non-memory access, write mask control, and vsize type operation instruction template 1317; and 2) within the memory access instruction template 1320, which shows the memory access and write mask control instruction template 1327.

[0114] General Vector Friendly Command Format 1300 includes the following: Figures 13A-13B The following fields are listed in the order shown in the diagram.

[0115] Format field 1340 – A specific value in this field (the instruction format identifier value) uniquely identifies the vector-friendly instruction format, and thus the occurrence of an instruction in the instruction stream in the vector-friendly instruction format. Therefore, this field is optional in the sense that it is not needed for instruction sets that only have a general vector-friendly instruction format.

[0116] Basic operation field 1342 – its content distinguishes different basic operations.

[0117] Register index field 1344—its contents specify the location of the source and destination operands, either directly or through address generation, whether they are in registers or in memory. These include a sufficient number of bits to select N registers from a PxQ (e.g., 32×512, 16×128, 32×1024, 64×1024) register file. Although in one embodiment N can be up to three source and one destination registers, alternative embodiments can support more or fewer source and destination registers (e.g., up to two sources, one of which also acts as a destination; up to three sources, one of which also acts as a destination; up to two sources and one destination).

[0118] Modifier field 1346—its content distinguishes between instructions that specify memory access in the general vector instruction format and those that do not; that is, it differentiates between the non-memory access instruction template 1305 and the memory access instruction template 1320. Memory access operations read from and / or write to memory hierarchies (in some cases specifying source and / or destination addresses using values ​​in registers), while non-memory access operations do not (e.g., the source and destination are registers). Although in one embodiment this field also selects between three different methods for performing memory address calculations, alternative embodiments may support more, fewer, or different methods for performing memory address calculations.

[0119] The augmented operation field 1350 distinguishes which of the various operations will be performed in addition to the basic operation. This field is context-specific. In one embodiment of the invention, this field is divided into a class field 1368, an alpha field 1352, and a beta field 1354. The augmented operation field 1350 allows common group operations to be performed in a single instruction, rather than two, three, or four instructions.

[0120] Scaling field 1360 — its content allows scaling the contents of the index field for use in memory address generation (e.g., for using "2"). 缩放 *index+base(2) scale (The address is generated using "*index+base").

[0121] Displacement field 1362A – its contents are used as part of memory address generation (e.g., for using "2"). 缩放 *Index + Basis + Shift(2) scale Address generation for "*index+base+displacement").

[0122] The displacement factor field 1362B (note that placing displacement field 1362A directly juxtaposed on displacement factor field 1362B indicates that one or the other is being used) – its contents are used as part of the address generation; it specifies the displacement factor by which the size (N) of the memory access will be scaled – where N is the number of bytes in the memory access (e.g., for using "2"). 缩放 *Index + Base + Scaled Displacement (2) scale The address is generated using the formula "*index + base + scaled displacement". Redundant low-order bits are ignored, and therefore, the contents of the displacement factor field are multiplied by the total size of the memory operands (N) to generate the final displacement that will be used in the calculation of the effective address. The value of N is determined by the processor hardware at runtime based on the full opcode field 1374 (described later herein) and the data manipulation field 1354C. The displacement field 1362A and the displacement factor field 1362B are optional in the sense that they are not used in the non-memory access 1305 instruction template and / or different embodiments may implement only one of the two or neither of the two.

[0123] The data element width field 1364—its content distinguishes which of the multiple data element widths will be used (in some embodiments for all instructions; in other embodiments only for some instructions). This field is optional in the sense that it is not needed if only one data element width is supported and / or if the data element width is supported by using some aspect of the opcode.

[0124] The write mask field 1370—its content controls, on a data element-by-data element-location basis, whether the location of that data element in the destination vector operand reflects the results of the basic and augmentation operations. Type A instruction templates support merge-write masking, while Type B instruction templates support both merge-and zero-write masking. When merging, the vector mask allows protection of any set of elements in the destination from updates during the execution of any operation (specified by the basic and augmentation operations); in another embodiment, it preserves the old value of each element in the destination where the corresponding mask bit has a value of 0. In contrast, when zeroing, the vector mask allows zeroing of any set of elements in the destination during the execution of any operation (specified by the basic and augmentation operations); in one embodiment, when the corresponding mask bit has a value of 0, the elements in the destination are set to 0. A subset of this functionality is the ability to control the vector length of the performed operation (i.e., the span of the modified elements from first to last); however, it is not necessary for the modified elements to be sequential. Therefore, the write mask field 1370 allows for some vector operations, including load, store, arithmetic, logical, etc. Although embodiments of the invention have been described in which the content of the write mask field 1370 is selected from a plurality of write mask registers to contain a write mask to be used (and thus the content of the write mask field 1370 indirectly identifies the masking to be performed), alternative embodiments may instead or additionally allow the content of the mask write field 1370 to directly specify the masking to be performed.

[0125] Immediate field 1372 – Its content allows for immediate specifications. This field is optional in the sense that it does not exist in implementations of generic vector-friendly formats that do not support immediateness, and it does not exist in directives that do not use immediateness.

[0126] Class field 1368 – its content distinguishes instructions from different classes. (See reference) Figure 13A -B indicates that the content of this field selects between type A and type B instructions. Figure 13A In -B, rounded corner rectangles are used to indicate the presence of specific values ​​in a field (e.g., respectively in...). Figure 13A -B refers to class A 1368A and class B 1368B for class field 1368.

[0127] Type A Instruction Template

[0128] In the case of the Class A non-memory access instruction template 1305, the alpha field 1352 is interpreted as the RS field 1352A, the content of which distinguishes which of the different amplification operation types will be performed (for example, specifying rounding 1352A.1 and data transformation 1352A.2 for non-memory access, rounding type operation 1310 and non-memory access, data transformation type operation 1315 instruction templates, respectively), while the beta field 1354 distinguishes which of the specified type of operation will be performed. In the non-memory access instruction template 1305, the scaling field 1360, the displacement field 1362A, and the displacement-scaling field 1362B are not present.

[0129] Non-memory access instruction template – Full rounding control type operation

[0130] In the non-memory access full rounding control type operation 1310 instruction template, beta field 1354 is interpreted as rounding control field 1354A, the contents of which provide static rounding. Although in the embodiments described in this invention, rounding control field 1354A includes suppress all floating-point exceptions (SAE) field 1356 and rounding operation control field 1358, alternative embodiments may support, encode, or have only one or the other of these concepts / fields (e.g., may only have rounding operation control field 1358).

[0131] SAE field 1356 – Its content distinguishes whether exception event reporting should be disabled; when the content of SAE field 1356 indicates that suppression is enabled, the given instruction does not report any kind of floating-point exception flag and does not trigger any floating-point exception handler.

[0132] The rounding operation control field 1358—its contents distinguish which of the rounding operations in the group to be performed (e.g., round up, round down, round to zero, and round to the nearest). Therefore, the rounding operation control field 1358 allows the rounding mode to be changed on an instruction-by-instruction basis. In one embodiment of the invention, where the processor includes a control register for specifying the rounding mode, the contents of the rounding operation control field 1350 overwrite the value of that register.

[0133] Non-Memory Access Instruction Templates – Data Transformation Type Operations

[0134] In the instruction template 1315 for non-memory access data transformation type operation, beta field 1354 is interpreted as data transformation field 1354B, the contents of which distinguish which of the multiple data transformations will be performed (e.g., no data transformation, mixing, broadcasting).

[0135] In the case of Class A memory access instruction template 1320, the alpha field 1352 is interpreted as the eviction hint field 1352B, and its content distinguishes which eviction hint will be used (in...). Figure 13A In this context, temporary instruction template 1325 and non-temporary instruction template 1330 are specified as temporary 1352B.1 and non-temporary 1352B.2, respectively, while beta field 1354 is interpreted as data manipulation field 1354C, the contents of which distinguish which of several data manipulation operations (also known as primitives) will be performed (e.g., no manipulation; broadcast; source upcast; and destination downcast). Memory access instruction template 1320 includes scaling field 1360, and optionally displacement field 1362A or displacement-scaling field 1362B.

[0136] Vector memory instructions perform vector loads from and vector stores to memory, provided translation support is available. Like regular vector instructions, vector memory instructions pass data to / from memory element by element, where the actual element passed is indicated by the contents of a vector mask selected as the write mask.

[0137] Memory access instruction template - Temporary

[0138] Temporary data is data that is likely to be reused quickly enough to benefit from the cache. However, this is a hint, and different processors may implement it in different ways, including ignoring the hint entirely.

[0139] Memory access instruction template - non-temporal

[0140] Non-transitory data is data that is unlikely to be reused quickly enough to benefit from the L1 cache and should be given priority for eviction. However, this is a hint, and different processors may implement it in different ways, including ignoring the hint entirely.

[0141] Type B Instruction Template

[0142] In the case of the B-type instruction template, the alpha field 1352 is interpreted as the write mask control (Z) field 1352C, the content of which distinguishes whether the write masking controlled by the write mask field 1370 should be merged or zeroed.

[0143] In the case of the Class B non-memory access instruction template 1305, a portion of the beta field 1354 is interpreted as the RL field 1357A, the content of which distinguishes which of the different augmentation operation types will be performed (e.g., for the non-memory access, write mask control, partial rounding control type operation instruction template 1312 and the non-memory access, write mask control, V-size (VSIZE) type operation instruction template 1317, rounding 1357A.1 and vector length (V-size) 1357A.2 are specified respectively), while the remaining portion of the beta field 1354 distinguishes which of the specified type of operation will be performed. In the non-memory access instruction template 1305, the scaling field 1360, the displacement field 1362A, and the displacement-scaling field 1362B are absent.

[0144] In the instruction template 1310 for non-memory access, write mask control, and partial rounding control type operations, the remainder of the beta field 1354 is interpreted as the rounding operation field 1359A and exception reporting is disabled (the given instruction does not report any kind of floating-point exception flag and does not trigger any floating-point exception handler).

[0145] Rounding operation control field 1359A—like rounding operation control field 1358, its content distinguishes which of the rounding operation groups to be performed (e.g., round up, round down, round to zero, and round to nearest). Therefore, rounding operation control field 1359A allows the rounding mode to be changed on an instruction-by-instruction basis. In one embodiment of the invention, where the processor includes a control register for specifying the rounding mode, the content of rounding operation control field 1350 overrides the value of that register.

[0146] In the instruction template 1317 for non-memory access, write mask control, and V-size (VSIZE) type operations, the remainder of the beta field 1354 is interpreted as the vector length field 1359B, the contents of which distinguish which of the multiple data vector lengths will be executed (e.g., 128, 256, or 512 bytes).

[0147] In the case of the Class B memory access 1320 instruction template, a portion of the beta field 1354 is interpreted as a broadcast field 1357B, the content of which distinguishes whether a broadcast-type data manipulation operation will be performed, while the remainder of the beta field 1354 is interpreted as a vector length field 1359B. The memory access 1320 instruction template includes a scaling field 1360, and optionally a displacement field 1362A or a displacement-scaling field 1362B.

[0148] Regarding the general vector-friendly instruction format 1300, a full opcode field 1374 is shown, which includes a format field 1340, a basic operation field 1342, and a data element width field 1364. While one embodiment is shown where the full opcode field 1374 includes all of these fields, in embodiments that do not support all of them, the full opcode field 1374 includes fewer than all of these fields. The full opcode field 1374 provides the opcode.

[0149] The augmentation operation field 1350, the data element width field 1364, and the write mask field 1370 allow these features to be specified on an instruction-by-instruction basis in a generic vector-friendly instruction format.

[0150] Write a combination of a mask field and a data element width field to create type instructions, as they allow masks to be applied based on different data element widths.

[0151] The various instruction templates existing within classes A and B are advantageous in different situations. In some embodiments of the invention, different processors or different cores within a processor may support only class A, only class B, or both. For example, a high-performance general-purpose out-of-order core intended for general-purpose computing may support only class B, a core primarily intended for graphics and / or scientific (throughput) computing may support only class A, and a core intended for both may support both (of course, some hybrid core having templates and instructions from both classes, but not all templates and instructions from both classes, is within the scope of the invention). Moreover, a single processor may include multiple cores, all of which support the same class or different cores that support different classes. For example, in a processor with separate graphics and general-purpose cores, one of the graphics cores primarily intended for graphics and / or scientific computing may support only class A, while one or more of the general-purpose cores may be a high-performance general-purpose core with out-of-order execution and register renaming intended for general-purpose computing that supports only class B. Another processor without separate graphics cores may include one or more general-purpose ordered or out-of-order cores supporting both class A and class B. Of course, in different embodiments of the invention, features from one class can also be implemented in another class. Programs written in a high-level language will be placed in various executable forms (e.g., just-in-time or statically compiled), including: 1) a form having only instructions from the classes(s) supported by the target processor for execution; or 2) a form having replaceable routines written using different combinations of instructions from all classes and control flow code that selects the routine to be executed based on instructions supported by the processor of the currently executing code.

[0152] Exemplary Vector-Friendly Instruction Format

[0153] Figure 14A This is a block diagram illustrating an exemplary vector-friendly instruction format according to an embodiment of the present invention. Figure 14A A specific vector-friendly instruction format 1400 is illustrated, which is specific in the sense that it specifies the position, size, interpretation, and order of fields, as well as the values ​​for some of those fields. This specific vector-friendly instruction format 1400 can be used to extend the x86 instruction set, and therefore some of the fields are similar to or the same as those used in existing x86 instruction sets and their extensions (such as AVX). This format maintains consistency with the prefix-encoded fields, actual opcode byte fields, MOD R / M fields, SIB fields, shift fields, and instantaneous fields of existing x86 instruction sets with extensions. The illustration shows... Figure 14A The fields are mapped to the fields from Figure 13.

[0154] It should be understood that although embodiments of the invention have been described in the context of the general vector-friendly instruction format 1300 with reference to the specific vector-friendly instruction format 1400 for illustrative purposes, the invention is not limited to the specific vector-friendly instruction format 1400, except where claimed. For example, the general vector-friendly instruction format 1300 envisions various possible sizes for various fields, while the specific vector-friendly instruction format 1400 is shown as a field with a specific size. As a specific example, although the data element width field 1364 is illustrated as a one-bit field in the specific vector-friendly instruction format 1400, the invention is not limited in this way (that is, the general vector-friendly instruction format 1300 envisions other sizes for the data element width field 1364).

[0155] General Vector Friendly Command Format 1300 includes the following: Figure 14A The following fields are listed in the order shown in the diagram.

[0156] The EVEX prefix (bytes 0-3) 1402 is encoded in four-byte form.

[0157] Format field 1340 (EVEX byte 0, bits [7:0]) — The first byte (EVEX byte 0) is format field 1340 and it contains 0x62 (a unique value used in one embodiment of the invention to distinguish vector-friendly instruction formats).

[0158] The second to fourth bytes (EVEX bytes 1-3) include multiple bit fields that provide specific capabilities.

[0159] REX field 1405 (EVEX byte 1, bit [7-5]) – includes the EVEX.R bit field (EVEX byte 1, bit [7]-R), the EVEX.X bit field (EVEX byte 1, bit [6]-X), and the 1357BEX byte 1, bit [5]-B). The EVEX.R, EVEX.X, and EVEX.B bit fields provide the same functionality as their corresponding VEX bit fields and are encoded using multiple complements of one, i.e., ZMM0 is encoded as 1111B and ZMM15 is encoded as 0000B. The other fields of the instruction encode the lower three bits of the register index as is known in the art (rrr, xxx, and bbb), so that Rrrr, Xxxx, and Bbb can be formed by adding EVEX.R, EVEX.X, and EVEX.B.

[0160] REX' field 1310—This is the first part of REX' field 1310 and is the EVEX.R' bit field (EVEX byte 1, bit [4]-R'), which is used to encode the higher 16 or lower 16 of the extended 32 register set. In one embodiment of the invention, this bit, along with other bits as indicated below, is stored in bit-inverted format to distinguish it (in the well-known x86 32-bit mode) from the BOUND instruction, which has an opcode byte of 62, but does not accept the value 11 in the MOD field in the MOD R / M field (described below); alternative embodiments of the invention do not store this bit and other bits indicated below in inverted format. The value 1 is used to encode the lower 16 registers. In other words, R'Rrrr is formed by combining EVEX.R', EVEX.R, and other RRRs from other fields.

[0161] Opcode mapping field 1415 (EVEX byte 1, bit [3:0]-mmmm) — its content encodes the implied leading opcode byte (0F, 0F 38 or 0F 3).

[0162] The data element width field is 1364 (EVEX byte 2, bit [7]-W) – which is represented by the notation EVEX.W. EVEX.W is used to define the granularity (size) of the data type (32-bit data element or 64-bit data element).

[0163] EVEX.vvvv 1420 (EVEX byte 2, bits [6:3] - vvvv) — The function of EVEX.vvvv can include the following: 1) EVEX.vvvv encodes the first source register operand specified in reverse (multiple two's complement) form and is valid for instructions with two or more source operands; 2) EVEX.vvvv encodes the destination register operand, which is specified in multiple two's complement form for some vector shift; or 3) EVEX.vvvv does not encode any operand, and the field is reserved and should contain 1111b. Therefore, the EVEX.vvvv field 1420 encodes the four lower-order bits of the first source register specifier stored in reverse (multiple two's complement) form. Depending on the instruction, additional different EVEX bit fields are used to extend the specifier size to 32 registers.

[0164] EVEX.U 1368 Class Field (EVEX byte 2, bit [2]-U) — If EVEX.U = 0, it indicates Class A or EVEX.U0; if EVEX.U = 1, it indicates Class B or EVEX.U1.

[0165] Prefix encoding field 1425 (EVEX byte 2, bits [1:0]-pp) – provides additional bits for the basic operation field. Besides supporting legacy SSE instructions in EVEX prefix format, this has the benefit of making the SIMD prefix more compact (the EVEX prefix only requires 2 bits instead of one byte to represent the SIMD prefix). In one embodiment, to support legacy SSE instructions using SIMD prefixes (66H, F2H, F3H) in both legacy and EVEX prefix formats, these legacy SIMD prefixes are encoded into the SIMD prefix encoding field; and at runtime, they are expanded to the legacy SIMD prefix and then provided to the decoder's PLA (so the PLA can execute both legacy and EVEX formats of these legacy instructions without modification). While newer instructions can directly use the contents of the EVEX prefix encoding field as an opcode extension, some embodiments expand in a similar manner for consistency, but allow different meanings to be specified through these legacy SIMD prefixes. Alternative implementations can be redesigned to support 2-bit SIMD prefix coding, and therefore no extension is required.

[0166] The alpha field 1352 (EVEX byte 3, bit [7]-EH; also known as EVEX.EH, EVEX.rs, EVEX.RL, EVEX.writemask control, and EVEX.N; also described using α) - as previously stated, this field is context-specific.

[0167] Beta field 1354 (EVEX byte 3, bit [6:4] - SSS, also known as EVEX.s 2-0 EVEX.r 2-0 EVEX.rr1, EVEX.LL0, EVEX.LLB; also described as βββ) - as previously described, this field is context-specific.

[0168] REX' field 1310 — This is the remainder of the REX' field and is the EVEX.V' bit field (EVEX byte 3, bit [3]-V'), which can be used to encode either the higher 16 or lower 16 of the extended 32 register set. This bit is stored in bit-inverted format. The value 1 is used to encode the lower 16 registers. In other words, V'VVVV is formed by combining EVEX.V' and EVEX.vvvv.

[0169] Write mask field 1370 (EVEX byte 3, bits [2:0]-kkk) – its content specifies the index of the register in the write mask register, as previously described. In one embodiment of the invention, the specific value EVEX.kkk = 000 has a special behavior, meaning that no write mask is used for a specific instruction (this can be implemented in various ways, including using a write mask hardwired to all one or hardware that bypasses the masking hardware).

[0170] The actual opcode field 1430 (byte 4) is also known as the opcode byte. The opcode portion is specified in this field.

[0171] The MOD R / M field 1440 (byte 5) includes the MOD field 1442, the Reg field 1444, and the R / M field 1446. As previously described, the content of the MOD field 1442 distinguishes between memory access and non-memory access operations. The function of the Reg field 1444 can be summarized in two cases: encoding the destination register operand or the source register operand, or being treated as an opcode extension and not used to encode any instruction operand. The function of the R / M field 1446 can include encoding instruction operands referencing memory addresses, or encoding the destination register operand or the source register operand.

[0172] Scaling, Indexing, Base (SIB) Byte (Byte 6) – As previously described, the contents of scaling field 1350 are used for memory address generation. SIB.xxx 1454 and SIB.bbb 1456 – The contents of these fields have already been mentioned previously regarding register indices Xxxx and Bbbb.

[0173] Displacement field 1362A (bytes 7-10) — When MOD field 1442 contains 10, bytes 7-10 are displacement field 1362A, and it works the same as the legacy 32-bit displacement (disp32), and operates at the byte granularity.

[0174] Displacement factor field 1362B (byte 7) – When MOD field 1442 contains 01, byte 7 is displacement factor field 1362B. This field is located in the same position as the 8-bit displacement (disp8) of the legacy x86 instruction set, which operates at the byte granularity. Because disp8 is sign-extended, it can only be addressed between byte offsets of -128 and 127 bytes; for 64-byte cache lines, disp8 uses 8 bits, which can be set to only four truly useful values: -128, -64, 0, and 64; because a larger range is typically required, disp32 is used; however, disp32 requires 4 bytes. In contrast to disp8 and disp32, displacement factor field 1362B is a reinterpretation of disp8; when using displacement factor field 1362B, the actual displacement is determined by multiplying the content of the displacement factor field by the size (N) of the memory operand access. This type of displacement is called disp8*N. This reduces the average instruction length (for a single byte of displacement, but with a much larger range). This compressed displacement is based on the assumption that the effective displacement is a multiple of the granularity of the memory access, and therefore, redundant low-order bits of the address offset do not need to be encoded. In other words, the displacement factor field 1362B replaces the legacy x86 instruction set's 8-bit displacement. Thus, the displacement factor field 1362B is encoded in the same way as the x86 instruction set's 8-bit displacement (therefore, there is no change in the ModRM / SIB encoding rules), with the only exception: disp8 is overloaded to disp8*N. In other words, there is no change in the encoding rules or encoding length, only in the interpretation of the displacement value by the hardware (which needs to scale the displacement by the size of the memory operand to obtain the byte-by-byte address offset). The instant field 1372 operates as previously described.

[0175] Full opcode field

[0176] Figure 14B This is a block diagram illustrating the fields constituting a specific vector-friendly instruction format 1400 for a full opcode field 1374 according to an embodiment of the present invention. Specifically, the full opcode field 1374 includes a format field 1340, a basic operation field 1342, and a data element width (W) field 1364. The basic operation field 1342 includes a prefix encoding field 1425, an opcode mapping field 1415, and a real opcode field 1430.

[0177] Register index field

[0178] Figure 14C This is a block diagram illustrating the fields of a specific vector-friendly instruction format 1400 constituting register index field 1344 according to an embodiment of the present invention. Specifically, register index field 1344 includes REX field 1405, REX' field 1410, MODR / M.reg field 1444, MODR / Mr / m field 1446, VVVV field 1420, xxx field 1454, and bbb field 1456.

[0179] Amplification operation field

[0180] Figure 14D This is a block diagram illustrating the fields of a specific vector-friendly instruction format 1400 constituting the augmentation operation field 1350 according to an embodiment of the present invention. When the class (U) field 1368 contains 0, it represents EVEX.U0 (class A 1368A); when it contains 1, it represents EVEX.U1 (class B 1368B). When U = 0 and the MOD field 1442 contains 11 (indicating a non-memory access operation), the alpha field 1352 (EVEX byte 3, bit [7]-EH) is interpreted as the rs field 1352A. When the rs field 1352A contains a 1 (rounding 1352A.1), the beta field 1354 (EVEX byte 3, bit [6:4]-SSS) is interpreted as the rounding control field 1354A. The rounding control field 1354A includes a one-bit SAE field 1356 and a two-bit rounding operation field 1358. When the rs field 1352A contains a 0 (data transformation 1352A.2), the beta field 1354 (EVEX byte 3, bits [6:4]-SSS) is interpreted as a three-bit data transformation field 1354B. When U = 0 and the MOD field 1442 contains 00, 01, or 10 (indicating a memory access operation), the alpha field 1352 (EVEX byte 3, bits [7]-EH) is interpreted as an eviction hint (EH) field 1352B, and the beta field 1354 (EVEX byte 3, bits [6:4]-SSS) is interpreted as a three-bit data manipulation field 1354C.

[0181] When U = 1, the alpha field 1352 (EVEX byte 3, bit [7]-EH) is interpreted as the write mask control (Z) field 1352C. When U = 1 and the MOD field 1442 contains 11 (indicating a non-memory access operation), a portion of the beta field 1354 (EVEX byte 3, bit [4]-S0) is interpreted as the RL field 1357A; when it contains a 1 (rounding up to 1357A.1), the remainder of the beta field 1354 (EVEX byte 3, bit [6-5]-S0) is interpreted as the RL field 1357A.2-1 The remainder of the beta field 1354 (EVEX byte 3, bit [6-5]-S) is interpreted as the rounding operation field 1359A, while when the RL field 1357A contains a 0 (V size (VSIZE) 1357.A2), the ... and when the RL field 1357A contains a 0 (V size (VSIZE) 1357.A2), the remainder of the beta field 1354 (EVEX byte 2-1 ) is interpreted as the vector length field 1359B (EVEX byte 3, bit [6-5]-L) 1-0 When U=1 and MOD field 1442 contains 00, 01, or 10 (indicating a memory access operation), beta field 1354 (EVEX byte 3, bits [6:4]-SSS) is interpreted as vector length field 1359B (EVEX byte 3, bits [6-5]-L). 1-0 ) and broadcast field 1357B (EVEX byte 3, bit [4]-B).

[0182] Exemplary Register Architecture

[0183] Figure 15 This is a block diagram of a register architecture 1500 according to an embodiment of the present invention. In the illustrated embodiment, there are 32 vector registers 1510, each 512 bits wide; these registers are referenced from zmm0 to zmm31. The lower-order 256 bits of the lower 16 zmm registers are overlaid on registers ymm0-16. The lower-order 128 bits of the lower 16 zmm registers (the lower-order 128 bits of the ymm registers) are overlaid on registers xmm0-15. Vector-friendly instruction set.

[0184] Equation 1400 operates on these overlay register files as illustrated in the following table.

[0185]

[0186] In other words, the vector length field 1359B is selected between a maximum length and one or more other shorter lengths, each of which is half the length of the previous length; and no instruction template with vector length field 1359B operates on the maximum vector length. Furthermore, in one embodiment, the Class B instruction template of the specific vector-friendly instruction format 1400 operates on compressed or scalar single-precision / double-precision floating-point data and compressed or scalar integer data. Scalar operations are performed on the lowest-order data element location in the zmm / ymm / xmm registers; either causing the higher-order data element locations to be the same as they were before the instruction, or zeroing them out, depending on the embodiment.

[0187] Write mask register 1515—In the illustrated embodiment, there are eight write mask registers (k0 through k7), each 64 bits in size. In an alternative embodiment, write mask register 1515 is 16 bits in size. As previously described, in one embodiment of the invention, vector mask register k0 cannot be used as a write mask; when the encoding that would normally indicate k0 would be used for the write mask, it selects a hard-wired write mask of 0xFFFF, which effectively disables write masking for that instruction.

[0188] General Purpose Register 1525 — In the illustrated embodiment, there are sixteen 64-bit general purpose registers that are used in conjunction with the existing x86 addressing modes to address memory operands. These registers are referenced and labeled by the names RAX, RBX, RCX, RDX, RBP, RSI, RDI, RSP, and R8 up to R15.

[0189] The scalar floating-point stack register file (x87 stack) 1545 is overlaid with the MMX compact integer flat register file 1550. In the illustrated embodiment, the x87 stack is an octal stack used to perform scalar floating-point operations on 32 / 64 / 80-bit floating-point data using x87 instruction set extensions; while the MMX registers are used to perform operations on 64-bit compact integer data and hold operands for some operations performed between the MMX and XMM registers.

[0190] Alternative embodiments of the present invention may use wider or narrower registers. Furthermore, alternative embodiments of the present invention may use more, fewer, or different register files and registers.

[0191] Exemplary core architectures, processors, and computer architectures

[0192] Processor cores can be implemented in different ways, for different purposes, and in different processors. For example, such core implementations can include: 1) general-purpose ordered cores intended for general-purpose computing; 2) high-performance general-purpose unordered cores intended for general-purpose computing; and 3) dedicated cores primarily intended for graphics and / or scientific (throughput) computing. Different processor implementations can include: 1) CPUs, which include one or more general-purpose ordered cores and / or one or more general-purpose unordered cores intended for general-purpose computing; and 2) coprocessors, which include one or more dedicated cores primarily intended for graphics and / or scientific (throughput) computing. Such different processors result in different computer system architectures, which may include: 1) a coprocessor on a discrete chip from the CPU; 2) a coprocessor on a discrete die in the same package as the CPU; 3) a coprocessor on the same die as the CPU (in which case, such a coprocessor is sometimes referred to as dedicated logic, such as integrated graphics and / or scientific (throughput) logic, or referred to as a dedicated core); and 4) a system-on-a-chip that may include the CPU (sometimes referred to as application cores or application processors), the aforementioned coprocessors, and additional functionality on the same die. An exemplary core architecture is described below, followed by a description of exemplary processors and computer architectures.

[0193] Exemplary core architecture

[0194] Ordered and Unordered Kernel Block Diagrams

[0195] Figure 16A This is a block diagram illustrating both an exemplary ordered pipeline and an exemplary register renaming and unordered publish / execute pipeline according to embodiments of the present invention. Figure 16B This is a block diagram illustrating an ordered architecture core according to an embodiment of the present invention, and exemplary embodiments of both an exemplary register renaming and an unordered release / execution architecture core to be included in a processor. Figure 16A The solid boxes in -B illustrate ordered pipelines and ordered cores, while the optional dashed boxes illustrate register renaming, out-of-order release / execution pipelines, and cores. Since the ordered aspect is a subset of the out-of-order aspect, the out-of-order aspect will be described.

[0196] exist Figure 16A In the processor pipeline 1600, there are fetch stage 1602, length decoding stage 1604, decoding stage 1606, allocation stage 1608, renaming stage 1610, scheduling (also known as dispatch or issue) stage 1612, register read / memory read stage 1614, execution stage 1616, write-back / memory write stage 1618, exception handling stage 1622, and commit stage 1624.

[0197] Figure 16B A processor core 1690 is shown, comprising a front-end unit 1630 coupled to an execution engine unit 1650, and both the front-end unit 1630 and the execution engine unit 1650 coupled to a memory unit 1670. Core 1690 may 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. Alternatively, core 1690 may be a dedicated 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, etc.

[0198] Front-end unit 1630 includes branch prediction unit 1632 coupled to instruction cache unit 1634, instruction cache unit 1634 coupled to instruction translation lookup buffer (TLB) 1636, instruction translation lookup buffer (TLB) 1636 coupled to instruction fetch unit 1638, and instruction fetch unit 1638 coupled to decoding unit 1640. Decoding unit 1640 (or decoder) can decode instructions and generate, as output, one or more micro-operations, microcode entry points, microinstructions, other instructions, or other control signals, which are decoded from, or otherwise reflected in, or derived from the original instructions. Decoding unit 1640 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 memory (ROM), etc. In one embodiment, core 1690 includes microcode ROM or other media storing microcode for certain macro instructions (e.g., in decoding unit 1640 or otherwise within front-end unit 1630). The decoding unit 1640 is coupled to the rename / allocator unit 1652 in the execution engine unit 1650.

[0199] The execution engine unit 1650 includes a rename / allocator unit 1652, which is coupled to a retirement unit 1654 and a group of one or more scheduler units 1656. The scheduler units 1656 represent any number of different schedulers, including reservation stations, central instruction windows, etc. The scheduler units 1656 are coupled to physical register file units 1658. Each of the physical register file units 1658 represents one or more physical register files, the different files storing one or more different data types, such as scalar integers, scalar floating-point numbers, compressed integers, compressed floating-point numbers, vector integers, vector floating-point numbers, status (e.g., an instruction pointer as the address of the next instruction to be executed), etc. In one embodiment, the physical register file units 1658 include vector register units, write mask register units, and scalar register units. These register units may provide architectural vector registers, vector mask registers, and general-purpose registers. Physical register file(s)(s) 1658 are overlapped by retirement unit(s) 1654 to illustrate various ways that can be used to implement register renaming and out-of-order execution (e.g., by using (multiple) reorder buffers and (multiple) retirement register files; by using (multiple) future files, (multiple) history buffers, and (multiple) retirement register files; by using register mapping and register pools; etc.). Retirement unit(s) 1654 and physical register file(s)(s) 1658 are coupled to execution cluster(s) 1660. Execution cluster(s) 1660 includes a group of one or more execution units 1662 and a group of one or more memory access units 1664. Execution unit(s) 1662 can perform various operations (e.g., shift, addition, subtraction, multiplication) and can be performed on various types of data (e.g., scalar floating-point, compressed integer, compressed floating-point, vector integer, vector floating-point). While some embodiments may include multiple execution units dedicated to a particular function or function set, other embodiments may include only one execution unit or multiple execution units that perform all functions. Multiple scheduler units 1656, multiple physical register file units 1658, and multiple execution clusters 1660 are shown as possibly multiple, because some embodiments create separate pipelines for certain types of data / operations (e.g., scalar integer pipelines, scalar floating-point / compact integer / compact floating-point / vector integer / vector floating-point pipelines, and / or memory access pipelines, each having its own scheduler unit, multiple physical register file units, and / or execution clusters—and in the case of separate memory access pipelines, some embodiments are implemented where only the execution cluster of that pipeline has multiple memory access units 1664).It should also be understood that in cases where separate pipelines are used, one or more of these pipelines may be out-of-order releases / executions and the rest may be ordered.

[0200] The memory access unit 1664 is coupled to a memory unit 1670, which includes a data TLB unit 1672. The data TLB unit 1672 is coupled to a data cache unit 1674, which is coupled to a Level 2 (L2) cache unit 1676. In one exemplary embodiment, the memory access unit 1664 may include a load unit, a memory address unit, and a memory data unit, each of which is coupled to the data TLB unit 1672 in the memory unit 1670. An instruction cache unit 1634 is further coupled to the Level 2 (L2) cache unit 1676 in the memory unit 1670. The L2 cache unit 1676 is coupled to one or more other cache levels and finally to main memory.

[0201] As an example, the exemplary register renaming, out-of-order release / execution core architecture can implement pipeline 1600 as follows: 1) Instruction fetch 1638 executes fetch and length decoding stages 1602 and 1604; 2) Decoding unit 1640 executes decoding stage 1606; 3) Rename / allocator unit 1652 executes allocation stage 1608 and rename stage 1610; 4) (multiple) scheduler units 1656 execute scheduling stage 1612; 5) Physical register (multiple) file (multiple) units 1658 and memory unit 1670 execute register read / memory read stage 1614; execution cluster 1660 fulfills execution stage 1616; 6) Memory unit 1670 and physical register (multiple) file (multiple) units 1658 execute write-back / memory write stage 1618; 7) Various units may be involved in exception handling stage 1622; and 8) Retirement unit 1654 and physical register (multiple) file (multiple) units 1658 execute commit stage 1624.

[0202] Core 1690 may support one or more instruction sets (e.g., the x86 instruction set (with some extensions added in newer versions); the MIPS instruction set of MIPS Technologies, Sunnyvale, California; the ARM instruction set of ARM Holdings, Sunnyvale, California (with optional additional extensions, such as NEON)), including the instructions(s) described herein. In one embodiment, Core 1690 includes logic for supporting compressed data instruction set extensions (e.g., AVX1, AVX2), thereby allowing operations used by many multimedia applications to be performed using compressed data.

[0203] It should be understood that a core can support multithreading (two or more parallel sets of operations or threads), and can do so in various ways, including time-slice multithreading, simultaneous multithreading (where a single physical core provides a logical core for each of the threads being simultaneously multithreaded by the physical core), or combinations thereof (e.g., time-slice extraction and decoding followed by subsequent simultaneous multithreading, such as in...). (like in hyper-threading technology).

[0204] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming can be used in ordered architectures. While the illustrated embodiment of the processor also includes separate instruction and data cache units 1634 / 1674 and a shared L2 cache unit 1676, alternative embodiments may have a single internal cache for both instructions and data, such as, for example, a Level 1 (L1) internal cache, or multiple levels of internal caches. In some embodiments, the system may include a combination of internal caches and external caches located outside the core and / or processor. Alternatively, all caches may be located outside the core and / or processor.

[0205] Specific exemplary ordered kernel architecture

[0206] Figure 17A -B illustrates a block diagram of a more specific exemplary ordered core architecture, where the core is one of several logic blocks (including other cores of the same and / or different types) within a chip. Depending on the application, the logic block communicates with a fixed functional logic, memory I / O interface, and other necessary I / O logic via a high-bandwidth interconnect network (e.g., a ring network).

[0207] Figure 17A This is a block diagram of a single processor core according to an embodiment of the invention, the single processor core together with its connection to an on-die interconnect network 1702 and a partial subset of its Level 2 (L2) cache 1704; in one embodiment, the instruction decoder 1700 supports the x86 instruction set with a compact data instruction set extension. The L1 cache 1706 allows low-latency access to cache memory into scalar and vector units. Although in one embodiment (for design simplification), scalar unit 1708 and vector unit 1710 use separate register sets (correspondingly, scalar register 1712 and vector register 1714), and data passed between them is written to memory and then read back from the Level 1 (L1) cache 1706, alternative embodiments of the invention may use different approaches (e.g., using a single register set or including a communication path that allows data to be passed between two register files without being written and read back).

[0208] Local subsets of L2 cache 1704 are part of the global L2 cache, which is divided into separate local subsets, one for each processor core. Each processor core has a direct access path to its own local subset of L2 cache 1704. Data read by a processor core is stored in its L2 cache subset 1704 and can be accessed quickly, in parallel with other processor cores accessing their own local subsets of L2 cache. Data written by a processor core is stored in its own L2 cache subset 1704 and flushed from other subsets, if necessary. A ring network ensures consistency for shared data. 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. Each ring data path is 1012 bits wide in each direction.

[0209] Figure 17B This is according to an embodiment of the present invention. Figure 17A An expanded view of the processor core portion. Figure 17B This includes the L1 data cache 1706A portion of L1 cache 1704, and further details regarding vector unit 1710 and vector register 1714. Specifically, vector unit 1710 is a 16-wide vector processing unit (VPU) (see 16-wide ALU 1728), which executes one or more of integer, single-precision float, and double-precision float instructions. The VPU supports mixing register inputs using mixing unit 1720, performing numerical conversions using value conversion units 1722A-B, and copying to memory inputs using copy unit 1724. Write mask register 1726 allows the writing of vectors generated from prediction results.

[0210] Figure 18 This is a block diagram of a processor 1800 according to an embodiment of the present invention. The processor 1800 may have more than one core, may have an integrated memory controller, and may have integrated graphics. Figure 18 The solid-line box in the figure illustrates processor 1800, which has a single core 1802A, system agent 1810, and a group of one or more bus controller units 1816. Alternatively, dashed-line boxes are added to illustrate alternative processor 1800, which has multiple cores 1802A-N, a group of one or more integrated memory controller units 1814 in the system agent unit 1810, and dedicated logic 1808.

[0211] Therefore, different implementations of processor 1800 may include: 1) a CPU, wherein dedicated logic 1808 is integrated graphics and / or scientific (throughput) logic (which may include one or more cores), and cores 1802A-N are one or more general-purpose cores (e.g., general-purpose ordered cores, general-purpose unordered cores, or a combination of both); 2) a coprocessor, wherein cores 1802A-N are a large number of dedicated cores primarily intended for graphics and / or scientific (throughput); and 3) a coprocessor, wherein cores 1802A-N are a large number of general-purpose ordered cores. Thus, processor 1800 may be a general-purpose processor, coprocessor, or dedicated 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 multi-core (MIC), a coprocessor (including 30 or more cores), an embedded processor, etc. The processor may be implemented on one or more chips. Processor 1800 may be part of one or more substrates and / or may be implemented on one or more substrates using a variety of process technologies, such as, for example, BiCMOS, CMOS, or NMOS.

[0212] The memory hierarchy includes one or more levels of cache within the core, a set or one or more shared cache units 1806, and external memory (not shown) coupled to the set of integrated memory controller units 1814. The set of shared cache units 1806 may include one or more intermediate caches, such as Level 2 (L2), Level 3 (L3), Level 4 (L4), or other levels of cache, Last Level Cache (LLC), and / or combinations thereof. While in one embodiment, ring-based interconnect units 1812 interconnect integrated graphics logic 1808 (which is an example of dedicated logic and is also referred to herein as dedicated logic), the set of shared cache units 1806, and system proxy units 1810 / (multiple) of integrated memory controller units 1814, alternative embodiments may use any number of well-known techniques for interconnecting such units. In one embodiment, consistency is maintained between one or more cache units 1806 and core 1802-AN.

[0213] In some embodiments, one or more of the cores 1802A-N are multithreaded. System agent 1810 includes those components that coordinate and operate the cores 1802A-N. System agent unit 1810 may include, for example, a power control unit (PCU) and a display unit. The PCU may be or include the logic and components required for regulating the power state of the cores 1802A-N and the integrated graphics logic 1808. The display unit is used to drive one or more externally connected displays.

[0214] The 1802A-N cores can be homogeneous or heterogeneous in terms of their instruction sets; that is, two or more of the 1802A-N cores can execute the same instruction set, while others can execute only that instruction set or a subset of a different instruction set.

[0215] Exemplary computer architecture

[0216] Figure 19-22 This is a block diagram of an exemplary computer architecture. Other system designs and configurations known in the art for laptops, desktops, 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, mobile phones, portable media players, handheld devices, and various other electronic devices are also suitable. Generally, a wide variety of systems or electronic devices capable of incorporating processors and / or other execution logic as disclosed herein are suitable.

[0217] Now for reference Figure 19 The diagram illustrates a block diagram of a system 1900 according to an embodiment of the present invention. System 1900 may include one or more processors 1910, 1915 coupled to a controller hub 1920. In one embodiment, the controller hub 1920 includes a graphics memory controller hub (GMCH) 1990 and an input / output hub (IOH) 1950 (which may be on a separate chip); the GMCH 1990 includes memory and a graphics controller, to which memory 1940 and a coprocessor 1945 are coupled; the IOH 1950 couples an input / output (I / O) device 1960 to the GMCH 1990. Alternatively, one or both of the memory and the graphics controller may be integrated within the processor (as described herein), with memory 1940 and coprocessor 1945 directly coupled to processor 1910 and controller hub 1920 on a single chip having IOH 1950.

[0218] exist Figure 19 The optional nature of the additional processor 1915 is indicated by a broken line. Each processor 1910, 1915 may include one or more of the processing cores described herein, and may be a version of processor 1800.

[0219] The memory 1940 may be, for example, dynamic random access memory (DRAM), phase-change memory (PCM), or a combination of both. In at least one embodiment, the controller hub 1920 communicates with (a plurality of) processors 1910, 1915 via a multi-drop bus, such as a front-side bus (FSB), a point-to-point interface, a connection such as a QuickPath Interconnect (QPI), or a similar connection 1995.

[0220] In one embodiment, the coprocessor 1945 is a dedicated processor, such as, for example, a high-throughput MIC processor, a network or communication processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, and so on. In one embodiment, the controller hub 1920 may include an integrated graphics accelerator.

[0221] There can be various differences in the range of measures of merit, including architecture, microarchitecture, thermal properties, power consumption characteristics, etc., between physical resources 1910 and 1915.

[0222] In one embodiment, processor 1910 executes instructions that control general-type data processing operations. Embedded within these instructions may be coprocessor instructions. Processor 1910 identifies these coprocessor instructions as having a type that should be executed by an attached coprocessor 1945. Therefore, processor 1910 issues these coprocessor instructions (or control signals representing coprocessor instructions) to coprocessor 1945 on a coprocessor bus or other interconnect. Coprocessors 1945 (multiple) receive and execute the received coprocessor instructions.

[0223] Now for reference Figure 20 The diagram shown is a block diagram of a first, more specific, exemplary system 2000 according to an embodiment of the present invention. Figure 20 As shown, the multiprocessor system 2000 is a point-to-point interconnect system and includes a first processor 2070 and a second processor 2080 coupled via point-to-point interconnect 2050. Each of processors 2070 and 2080 may be a version of processor 1800. In one embodiment of the invention, processors 2070 and 2080 are processors 1910 and 1915, respectively, and coprocessor 2038 is coprocessor 1945. In another embodiment, processors 2070 and 2080 are processor 1910 and coprocessor 1945, respectively.

[0224] Processors 2070 and 2080 are shown, each including an integrated memory controller (IMC) unit 2072 and 2082, respectively. Processor 2070, as part of its bus controller unit, also includes point-to-point (PP) interfaces 2076 and 2078; similarly, a second processor 2080 includes PP interfaces 2086 and 2088. Processors 2070 and 2080 can exchange information via point-to-point (PP) interface 2050 using PP interface circuits 2078 and 2088. Figure 20 As shown, IMC 2072 and 2082 couple the processor to the corresponding memory, namely memory 2032 and memory 2034, which may be a portion of the main memory locally attached to the corresponding processor.

[0225] Processors 2070 and 2080 can each exchange information with chipset 2090 via point-to-point interface circuits 2076, 2094, 2086, and 2098, or via separate PP interfaces 2052 and 2054. Chipset 2090 can optionally exchange information with coprocessor 2038 via high-performance interface 2092. In one embodiment, coprocessor 2038 is a dedicated processor, such as, for example, a high-throughput MIC processor, a network or communication processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, etc.

[0226] A shared cache (not shown) may be included in either processor or external to both processors and connected to the processors via a PP interconnect, such that if the processors are in a low-power mode, the local cache information of either or both processors may be stored in the shared cache.

[0227] Chipset 2090 can be coupled to first bus 2016 via interface 2096. In one embodiment, first bus 2016 may be a peripheral component interconnect (PCI) bus, or a bus such as PCI Fast Bus or another third-generation I / O interconnect bus, although the scope of the invention is not limited in this way.

[0228] like Figure 20As shown, various I / O devices 2014, along with a bus bridge 2018, can be coupled to a first bus 2016, which in turn couples the first bus 2016 to a second bus 2020. In one embodiment, one or more additional processors 2015, such as coprocessors, high-throughput MIC processors, GPGPUs, accelerators (such as graphics accelerators or digital signal processing (DSP) units), field-programmable gate arrays, or any other processors, are coupled to the first bus 2016. In one embodiment, the second bus 2020 may be a low pin count (LPC) bus. In one embodiment, various devices can be coupled to the second bus 2020, including, for example, a keyboard and / or mouse 2022, communication devices 2027, and storage units 2028, such as disk drives or other mass storage devices, which may include instruction / code and data 2030. Furthermore, audio I / O 2024 can be coupled to the second bus 2020. Note that other architectures are possible. For example, instead of... Figure 20 The point-to-point architecture allows the system to implement multi-point branch bus or other similar architectures.

[0229] Now for reference Figure 21 The diagram shown is a block diagram of a second more specific exemplary system 2100 according to an embodiment of the present invention. Figure 20 and 21 The same elements in the same text have the same reference number, and Figure 20 Some aspects have already been from Figure 21 Omitted in order to avoid making Figure 21 Other aspects are unclear.

[0230] Figure 21 The illustration shows that processors 2070 and 2080 may include integrated memory and I / O control logic (“CL”) 2072 and 2082, respectively. Therefore, CL 2072 and 2082 include an integrated memory controller unit and I / O control logic. Figure 21 The diagram illustrates that not only are memories 2032 and 2034 coupled to CLs 2072 and 2082, but I / O device 2114 is also coupled to control logic 2072 and 2082. Legacy I / O device 2115 is coupled to chipset 2090.

[0231] Now for reference Figure 22 The diagram shown is a block diagram of a SoC 2200 according to an embodiment of the present invention. Figure 18 Similar elements within the same text have the same reference numerals. Furthermore, the dashed box is an optional feature on more advanced SoCs. Figure 22In this configuration, multiple interconnect units 2202 are coupled to: an application processor 2210, which includes a set of one or more cores 1802A-N, said cores including cache units 1804A-N, and multiple shared cache units 1806; a system proxy unit 1810; multiple bus controller units 1816; multiple integrated memory controller units 1814; a set of one or more coprocessors 2220, which may include integrated graphics logic, a graphics processor, an audio processor, and a video processor; a static random access memory (SRAM) unit 2230; a direct memory access (DMA) unit 2232; and a display unit 2240 for coupling to one or more external displays. In one embodiment, the multiple coprocessors 2220 include dedicated processors, such as, for example, network or communication processors, compression engines, GPGPUs, high-throughput MIC processors, embedded processors, etc.

[0232] Embodiments of the mechanisms disclosed herein can be implemented in hardware, software, firmware, or a combination of such implementations. Embodiments of the invention can be implemented as computer programs or program code executable on a programmable system, said programmable system including at least one processor, a storage system (including volatile and non-volatile memories and / or storage elements), at least one input device, and at least one output device.

[0233] Program code, such as Figure 20 The code 2030 illustrated herein can be applied to input instructions 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 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.

[0234] The program code can be implemented using high-level procedural or object-oriented programming languages ​​to communicate with the processing system. If desired, the program code can also be implemented using assembly or machine language. In fact, the mechanisms described herein are not limited to any particular programming language. In any case, the language can be a compiled or interpreted language.

[0235] One or more aspects of at least one embodiment can be implemented by representative instructions stored on a machine-readable medium, the representative instructions representing various logics within a processor that, when read by a machine, cause the machine to be configured to perform the techniques described herein. Such representations, known as “IP cores,” can be stored on tangible machine-readable media and supplied to various consumer or manufacturing facilities for loading into manufacturing machines that actually constitute logic or processors.

[0236] Such machine-readable storage media can include, without limitation, non-transitory, tangible arrangements of articles made or formed by a machine or device, including storage media such as hard disks, any other type of disk, including floppy disks, optical disks, optical disc read-only memory (CD-ROM), optical disc rewritable (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), 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.

[0237] Therefore, embodiments of the invention also include non-transitory, tangible machine-readable media containing instructions or design data, such as a hardware description language (HDL), defining the structures, circuits, devices, processors, and / or system features described herein. Such embodiments may also be referred to as program products.

[0238] Simulation (including binary conversion, code transformation, etc.)

[0239] In some cases, an instruction translator can be used to translate instructions from a source instruction set to a target instruction set. For example, an instruction translator can translate instructions (e.g., through static binary translation, dynamic binary translation, including dynamic compilation), transform, emulate, or otherwise convert them into one or more other instructions for processing by the kernel. Instruction translators can be implemented in software, hardware, firmware, or a combination thereof. Instruction translators can be on the processor, remote from the processor, or partially on and partially remote from the processor.

[0240] Figure 23 This is a block diagram illustrating, according to embodiments of the invention, the use of a software instruction converter to convert binary instructions in a source instruction set into binary instructions in a target instruction set. In the illustrated embodiment, the instruction converter is a software instruction converter, although alternatively, the instruction converter can be implemented using software, firmware, hardware, or various combinations thereof. Figure 23It is shown that a program in high-level language 2302 can be compiled using x86 compiler 2304 to generate x86 binary code 2306, which can be natively executed by a processor having at least one x86 instruction set core 2316. A processor having at least one x86 instruction set core 2316 means any processor that can perform substantially the same function as an Intel processor having at least one x86 instruction set core by: compatibly executing or otherwise processing (1) a substantial portion of the instruction set of the Intel x86 instruction set core, or (2) a version of object code for an application or other software intended to run on an Intel processor having at least one x86 instruction set core, in order to achieve substantially the same result as an Intel processor having at least one x86 instruction set core. x86 compiler 2304 represents a compiler operable to generate x86 binary code 2306 (e.g., object code), which can be executed on a processor having at least one x86 instruction set core 2316 with or without additional linking processing. Similarly, Figure 23 A program in high-level language 2302 is shown to be compiled using a replaceable instruction set compiler 2308 to generate replaceable instruction set binary code 2310, which can be natively executed by a processor without at least one x86 instruction set core 2314 (e.g., a processor with cores that execute the MIPS instruction set of MIPS Technologies, Sunnyvale, California and / or the ARM instruction set of ARM Holdings, Sunnyvale, California). An instruction converter 2312 is used to translate the x86 binary code 2306 into code that can be natively executed by a processor without an x86 instruction set core 2314. This translated code is unlikely to be identical to the replaceable instruction set binary code 2310, as an instruction converter capable of doing so would be difficult to manufacture; however, the translated code will implement general operations and consist of instructions from the replaceable instruction set. Therefore, the instruction converter 2312 represents software, firmware, hardware, or a combination thereof that allows a processor or other electronic device without an x86 instruction set processor or core to execute x86 binary code 2306 through emulation, simulation, or any other process.

Claims

1. A device for calculation, comprising: A decoder is used to decode a single instruction having an opcode field and four operand fields, the four operand fields including: The first operand field is used to indicate the first source compressed data register, which is used to store the first source compressed data element; The second operand field is used to indicate the second source compressed data register, which is used to store the second source compressed data element; The third operand field is used to indicate the source / destination compressed data register, which stores a third source compressed data element and a result compressed data element; and The fourth operand field is used to indicate the write mask register, which stores multiple bit values ​​for conditionally controlling the element-by-element operation indicated by the single instruction. Wherein, the first source compressed data element and the second source compressed data element are data elements with a first size, and the first size is different from the second size of the third source compressed data element and the result compressed data element; The register file includes the first source compressed data register, the second source compressed data register, and the source / destination compressed data register; and The execution circuitry executes the decoded individual instructions to perform the following operations for each resulting data element: If the value of the corresponding bit in the write mask register is set to the first value, then the existing value of the resulting compressed data element is retained or the resulting compressed data element is set to zero; and If the value of the corresponding bit in the write mask register is set to the second value, then: Multiply the first number of the first source compressed data elements with the corresponding compressed data elements in the second source compressed data elements to produce the first number of products; The product of the first quantity is added to the corresponding compressed data element from the third source compressed data element to produce the resulting compressed data element having the second size at the corresponding position in the source / destination compressed data register.

2. The apparatus of claim 1, wherein, The first quantity is equal to the second size divided by the first size.

3. The apparatus of claim 1, wherein, The first value includes the value 0, and the second value includes the value 1.

4. The apparatus according to any one of claims 1 to 3, wherein, The resulting compressed data elements include compressed 32-bit floating-point values.

5. The apparatus according to any one of claims 1 to 3, wherein, The first size and the second size are based on the opcode value.

6. The apparatus according to any one of claims 1 to 3, wherein, The first size is half or a quarter of the second size.

7. The apparatus according to any one of claims 1 to 3, wherein, The register file further includes the write mask register.

8. A method for calculation, comprising: Decoding a single instruction, the single instruction having an opcode field and four operand fields, the four operand fields including: The first operand field is used to indicate the first source compressed data register, which is used to store the first source compressed data element; The second operand field is used to indicate the second source compressed data register, which is used to store the second source compressed data element; The third operand field is used to indicate the source / destination compressed data register, which stores a third source compressed data element and a result compressed data element; and The fourth operand field is used to indicate the write mask register, which stores multiple bit values ​​for conditionally controlling the element-by-element operation indicated by the single instruction. Wherein, the first source compressed data element and the second source compressed data element are data elements with a first size, and the first size is different from the second size of the third source compressed data element and the result compressed data element; Execute the decoded single instruction to compress the data element for each result and perform the following operations: If the value of the corresponding bit in the write mask register is set to the first value, then the existing value of the resulting compressed data element is retained or the resulting compressed data element is set to zero; and If the value of the corresponding bit in the write mask register is set to the second value, then: Multiply the first number of the first source compressed data elements with the corresponding compressed data elements in the second source compressed data elements to produce the first number of products; The product of the first quantity is added to the corresponding compressed data element from the third source compressed data element to produce the resulting compressed data element having the second size at the corresponding position in the source / destination compressed data register.

9. The method of claim 8, wherein, The first quantity is equal to the second size divided by the first size.

10. The method of claim 8, wherein, The first value includes the value 0, and the second value includes the value 1.

11. The method as claimed in any one of claims 8 to 10, wherein, The resulting compressed data elements include compressed 32-bit floating-point values.

12. The method as claimed in any one of claims 8 to 10, wherein, The first size and the second size are based on the opcode value.

13. The method as claimed in any one of claims 8 to 10, wherein, The first size is half or a quarter of the second size.

14. A computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 8 to 13.

15. An apparatus for computing, comprising means for performing the method as described in any one of claims 8 to 13.

Citation Information

Patent Citations

  • Bit shuffle processors, methods, systems, and instructions

    WO2016048631A1