Apparatus, method, and machine-readable medium

Chained tile operations optimize matrix processing in computing systems by dividing matrices into tiles, enhancing efficiency and reducing power consumption in CPUs and GPUs through improved data parallelism and shared memory techniques.

JP7582591B2Active Publication Date: 2024-11-13INTEL CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2022203407
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-03-30
Filing Date
2022-12-20
Publication Date
2024-11-13
Estimated Expiration
2039-02-07

AI Technical Summary

Technical Problem

Existing computing systems face challenges in efficiently handling large matrix operations due to the difficulty and instruction intensity required for matrix manipulation, particularly in processors like CPUs and GPUs, where operations on large matrices are often inefficient and power-consuming.

Method used

The implementation of chained tile operations using matrix accelerators and tile configurations, which allow for optimized matrix operations by dividing matrices into tiles, enabling efficient use of resources and reducing computational overhead through techniques such as tile multiplication, addition, and accumulation, and shared memory utilization.

Benefits of technology

This approach enhances the efficiency and energy performance of matrix operations by improving data parallelism and reducing computational latency, allowing for faster and more power-efficient processing of large matrices in computing systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007582591000008
    Figure 0007582591000008
  • Figure 0007582591000009
    Figure 0007582591000009
  • Figure 0007582591000010
    Figure 0007582591000010
Patent Text Reader

Abstract

A system and method for performing chained tile operations is provided. [Solution] The processor includes a fetch circuit that fetches one or more instructions until multiple instructions are fetched; a decode circuit that decodes the fetched instructions; and an execution circuit that, in response to the decoded instructions, identifies first and second decoded instructions belonging to an instruction chain, dynamically selects and configures a SIMD path having first and second processing engines (PEs) that execute the first and second decoded instructions, and discards a specified destination of the first decoded instruction and instead sends a result of the decoded first instruction from the first PE to be used by the second PE to execute the second decoded instruction.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The field of the invention relates generally to computer processor architecture, and more particularly to systems and methods for performing chained tile operations. [Background technology]

[0002] Matrices are becoming increasingly important in many computing tasks, such as machine learning and other large-scale data processing. [Brief description of the drawings]

[0003] The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like reference symbols refer to similar elements and in which:

[0004] [Figure 1A] FIG. 1 illustrates one embodiment of configured tiles.

[0005] [Figure 1B] FIG. 1 illustrates one embodiment of configured tiles.

[0006] [Diagram 2] FIG. 2 illustrates some examples of matrix storage.

[0007] [Diagram 3] FIG. 1 illustrates an embodiment of a system that utilizes a tiled arithmetic accelerator.

[0008] [Figure 4] FIG. 2 illustrates one embodiment of how memory is shared using a matrix operation accelerator. [Diagram 5] FIG. 2 illustrates another embodiment of how memory is shared using a matrix operation accelerator.

[0009] [Figure 6]FIG. 1 illustrates one embodiment of a matrix multiply-accumulate operation using tiles ("TMMA").

[0010] [Figure 7] FIG. 1 illustrates one embodiment of a subset of executions of iterations of a chained fused multiply accumulate instruction.

[0011] [Figure 8] FIG. 1 illustrates one embodiment of a subset of executions of iterations of a chained fused multiply accumulate instruction.

[0012] [Figure 9] FIG. 1 illustrates one embodiment of a subset of executions of iterations of a chained fused multiply accumulate instruction.

[0013] [Figure 10] FIG. 1 illustrates one embodiment of a subset of executions of iterations of a chained fused multiply accumulate instruction.

[0014] [Figure 11] FIG. 2 illustrates a power-of-two sized SIMD implementation in which an accumulator uses a larger input size than the input to the multiplier, according to one embodiment.

[0015] [Figure 12] FIG. 1 illustrates an embodiment of a system that utilizes a matrix operation circuit.

[0016] [Figure 13] FIG. 2 illustrates one embodiment of a processor core pipeline that supports matrix operations using tiles.

[0017] [Figure 14] FIG. 2 illustrates one embodiment of a processor core pipeline that supports matrix operations using tiles.

[0018] [Figure 15] FIG. 2 illustrates an example of a matrix represented in row-major and column-major formats.

[0019] [Figure 16] FIG. 1 shows an example of the use of matrices (tiles).

[0020] [Figure 17] FIG. 1 illustrates one embodiment of how matrices (tiles) are used.

[0021] [Figure 18] FIG. 1 illustrates support for configuring the use of tiles, according to one embodiment.

[0022] [Figure 19] FIG. 1 illustrates one embodiment of a description of matrices (tiles) to be supported.

[0023] [Figure 20A] FIG. 2 illustrates an example of a register. [Figure 20B] FIG. 2 illustrates an example of a register. [Figure 20C] FIG. 2 illustrates an example of a register. [Figure 20D] FIG. 2 illustrates an example of a register.

[0024] [Figure 21A] FIG. 11 is a block flow diagram illustrating an example execution of an optimizable tile instruction chain.

[0025] [Figure 21B] FIG. 11 is a block flow diagram illustrating optimized execution of tile instruction chains according to some embodiments.

[0026] [Figure 22] FIG. 2 is a block flow diagram illustrating the execution flow of a processor in response to chained tile instructions according to one embodiment.

[0027] [Figure 23] FIG. 2 illustrates a more detailed illustration of the execution of chained tile instructions, according to one embodiment.

[0028] [Figure 24A] FIG. 2 is an exemplary pseudocode diagram illustrating an embodiment of a processor that executes chained tile instructions, according to one embodiment.

[0029] [Figure 24B] FIG. 2 is a pseudocode diagram illustrating an unoptimized tile instruction chain in accordance with some embodiments.

[0030] [Figure 24C] FIG. 2 is a pseudocode diagram illustrating execution flow by a processor execution circuitry executing optimized tiled instruction chains in accordance with some embodiments.

[0031] 25A-25D are block diagrams illustrating instruction formats according to embodiments of the present invention.

[0032] [Figure 25A] FIG. 2 is a block diagram illustrating a chain-friendly instruction format, according to an embodiment of the present invention.

[0033] [Figure 25B] 4 is a block diagram illustrating a start chain instruction format in accordance with an embodiment of the present invention.

[0034] [Figure 25C] FIG. 2 is a block diagram illustrating a generic vector friendly instruction format and its class A instruction templates, according to an embodiment of the present invention.

[0035] [Figure 25D] FIG. 2 is a block diagram illustrating a generic vector friendly instruction format and its class B instruction templates, according to an embodiment of the present invention.

[0036] [Figure 26A] FIG. 2 is a block diagram illustrating an exemplary special vector friendly instruction format, in accordance with an embodiment of the present invention.

[0037] [Figure 26B] FIG. 2 is a block diagram illustrating the fields of a special vector friendly instruction format that make up the full opcode field, according to one embodiment of the invention.

[0038] [Figure 26C] FIG. 2 is a block diagram illustrating the fields of a special vector friendly instruction format that constitute a register index field in accordance with one embodiment of the invention.

[0039] [Figure 26D] FIG. 2 is a block diagram illustrating fields of a special vector friendly instruction format that constitute an augmented operation field in accordance with one embodiment of the present invention.

[0040] [Figure 27] FIG. 2 is a block diagram of a register architecture according to one embodiment of the present invention.

[0041] [Figure 28A] 2A-2C are block diagrams illustrating both an exemplary in-order pipeline and an exemplary register renaming, out-of-order issue / execution pipeline, in accordance with an embodiment of the present invention.

[0042] [Figure 28B] 2 is a block diagram illustrating both an exemplary embodiment of an in-order architecture core and an exemplary register renaming, out-of-order issue / execution architecture core to be included in a processor, in accordance with an embodiment of the present invention.

[0043] 29A and 29B are block diagrams of a more specific exemplary in-order core architecture, in which the core is one of several logic blocks (including other cores of the same and / or different types) in a chip.

[0044] [Figure 29A] 1 is a block diagram of a single processor core with its connection to an on-die interconnect network and its local subset of a level 2 (L2) cache, according to an embodiment of the invention.

[0045] [Figure 29B] FIG. 29B is an expanded view of a portion of the processor core of FIG. 29A in accordance with an embodiment of the present invention.

[0046] [Diagram 30] FIG. 1 is a block diagram of a processor that may have two or more cores, that may have an integrated memory controller, and that may have integrated graphics, in accordance with embodiments of the present invention.

[0047] 31-34 are block diagrams of exemplary computer architectures.

[0048] [Diagram 31] FIG. 1 is a block diagram of a system according to one embodiment of the present invention.

[0049] [Diagram 32] 1 is a block diagram of a first more specific exemplary system according to one embodiment of the present invention;

[0050] [Diagram 33] FIG. 2 is a block diagram of a second, more specific, exemplary system according to one embodiment of the present invention.

[0051] [Diagram 34] 1 is a block diagram of a system on a chip (SoC) in accordance with one embodiment of the present invention.

[0052] [Diagram 35] 1 is a block diagram contrasting the use of a software instruction converter to convert binary instructions in a source instruction set to binary instructions in a target instruction set according to an embodiment of the invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

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

[0054] References herein to "one embodiment," "one embodiment," "one exemplary embodiment," and the like indicate that the described embodiment may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases do not necessarily refer to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in connection with one embodiment, it is believed to be within the knowledge of one of ordinary skill in the art to affect such feature, structure, or characteristic in connection with other embodiments, whether or not explicitly described.

[0055] In many mainstream processors, working with matrices is a difficult and / or instruction-intensive task. For example, the rows of a matrix may be put into multiple packed data (e.g., SIMD or vector) registers and then processed individually. For example, the addition of two 8×2 matrices may require loading and may be collected into four packed data registers depending on the data size. The first addition is then performed on the packed data registers corresponding to the first row of each matrix, and the second addition is performed on the packed data registers corresponding to the second row of each matrix. The resulting packed data registers are then distributed to memory. While this scenario may be acceptable for small matrices, it is often not acceptable for large matrices.

[0056] [I. High-level Description] Described herein are mechanisms for supporting matrix operations in computer hardware, such as central processing units (CPUs), graphics processing units (GPUs), and accelerators. Matrix operations utilize two-dimensional (2-D) data structures that represent one or more packed regions of memory, such as registers. Throughout this description, these 2-D data structures are referred to as tiles. Note that a matrix may be smaller than a tile (using less than an entire tile) or may utilize multiple tiles (the matrix is ​​larger than the size of any tile). Throughout the description, tile language is used to indicate operations performed using tiles that affect a matrix, and whether or not that matrix is ​​larger than any tile is generally irrelevant.

[0057] Each tile may be operated on by various operations as detailed herein, including but not limited to tile multiplication, tile addition, tile subtraction, tile diagonal, tile zero, tile transpose, tile dot product, tile broadcast, tile row broadcast, tile column broadcast, tile multiplication, tile multiply accumulate, tile move, etc. Additionally, support for operators such as the use of scale and / or bias may be used with these operations and may be used in future non-numeric applications, e.g., support for OpenCL "local memory", data compression / decompression, etc.

[0058] Portions of storage (memory (non-volatile and volatile), registers, cache, etc.) are arranged in tiles of various horizontal and vertical dimensions. For example, a tile may have a horizontal dimension of 4 (e.g., a matrix with 4 rows) and a vertical dimension of 8 (e.g., a matrix with 8 columns). Typically, the horizontal dimension is related to the element size (e.g., 2, 4, 8, 16, 32, 64, 128 bits, etc.). Multiple data types (single precision floating point, double precision floating point, integer, etc.) may be supported.

[0059] A. Exemplary Uses of Composed Tiles In some embodiments, tile parameters can be configured. For example, a given tile may be configured to provide tile options. Exemplary tile options include, but are not limited to, the number of rows in the tile, the number of columns in the tile, whether the tile is enabled, and whether the tile is composed of a pair of equally sized tiles.

[0060] FIG. 1A illustrates one embodiment of configured tiles. As illustrated, a 4 kB application memory 102 stores four 1 kB tiles: tile 0 (104), tile 1 (106), tile 2 (108), and tile 3 (110). In this example, the four tiles are not configured in pairs, and each has elements arranged in rows and columns. Tile t0 (104) and tile t1 (106) have K rows and N columns of 4-byte elements (e.g., single-precision data), where K equals 8 and N=32. Tile t2 (108) and tile t3 (110) have K rows and N / 2 columns of 8-byte elements (e.g., double-precision data). Because double-precision operands are twice as wide as single-precision, this configuration is consistent with a palette providing at least four names for a total storage capacity of at least 4 kB used to provide tile options. In operation, these tiles can be loaded from and stored to memory using load and store operations. Depending on the instruction encoding used, the amount of available application memory, as well as the size, number and configuration of available tiles, vary.

[0061] 1B illustrates one embodiment of configured tiles. As illustrated, 4 kB application memory 122 stores two pairs of 1 kB tiles, the first pair being tiles t4L (124) and t4R (126) and the second pair being tiles t5L (128) and t5R (130). As illustrated, these pairs of tiles are split into left and right tiles. In other embodiments, the pairs of tiles are split into even and odd tiles. In this example, the four tiles each have elements arranged in rows and columns. Tiles t4L (124) and t4R (126) have K rows and N columns of 4-byte elements (e.g., single precision data), where K is equal to 8 and N is equal to 32. Tiles t5L 128 and t5R 130 have K rows and N / 2 columns of 8-byte elements (e.g., double precision data). Because double precision operands are twice as wide as single precision, this configuration is consistent with a palette providing at least two names for a total storage capacity of at least 4kB used to provide tile options. The four tiles in FIG. 1A use four names to name tiles of 1kB each, while the two paired tiles in FIG. 1B can use two names to specify the paired tiles. In some embodiments, the tile instructions accept the names of the paired tiles as operands. In operation, these tiles can be loaded from and stored to memory using load and store operations. Depending on the instruction encoding used, the amount of available application memory, as well as the size, number, and configuration of the available tiles, will vary.

[0062] In some embodiments, tile parameters are definable. For example, a "palette" is used to provide tile options. Exemplary options include, but are not limited to, the number of tile names, the number of bytes in a row of storage, the number of rows and columns in a tile, etc. For example, the maximum "height" (number of rows) of a tile may be defined as follows:

[0063] Maximum number of tile rows = design memory capacity / (number of palette names * bytes per row).

[0064] This allows applications to be written in a way that uses fixed names but takes advantage of different storage sizes between implementations.

[0065] Configuring tiles is done using the tile configuration ("TILECONFIG") instruction, which defines a particular tile usage with a selected palette. This declaration includes the number of tile names to be used, the desired number of rows and columns per name (tile), and in some embodiments, the desired data type for each tile. In some embodiments, a consistency check is performed during execution of the TILECONFIG instruction to determine that it fits the constraints of the palette entries.

[0066] [B. Example Tile Storage Types] Figure 2 shows some examples of matrix storage. In (A), tiles are stored in memory. As shown, each "row" consists of four packed data elements. To get the next "row", a stride value is used. Note that rows may be stored contiguously in memory. Strided memory access allows access from one row to the next when the tile storage does not map the row width of the underlying memory array.

[0067] Tile loads from and stores to memory are typically strided accesses to packed rows of data from application memory. The exemplary TILELOAD and TILESTORE instructions, or other instruction references to application memory as TILE operands in load operation instructions, are restartable in some embodiments to handle (up to) 2*row page faults, unmasked floating-point exceptions, and / or per-instruction interrupts.

[0068] In (B), matrices are stored in tiles consisting of multiple registers, such as packed data registers (Single Instruction Multiple Data (SIMD) registers or vector registers). In this example, the tiles overlap three physical registers. Typically, contiguous registers are used, but this is not required.

[0069] In (C), the matrices are stored in tiles in non-register storage accessible to a fused multiple accumulate (FMA) circuit used in the tile instructions. This storage may be internal to the FMA or adjacent to it. Additionally, in some embodiments described below, the storage may be for data elements rather than entire rows or tiles.

[0070] Support parameters for the TMMA architecture are reported via CPUID. In some embodiments, the list of information includes maximum height and maximum SIMD dimensions. To configure the TMMA architecture, the dimensions per tile, element size per tile, and palette identifier must be specified. This configuration is done by executing the TILECONFIG instruction.

[0071] Successful execution of the TILECONFIG instruction enables subsequent TILE operations. The TILERELEASEALL instruction clears the tile configuration and disables TILE operations (until the next TILECONFIG instruction is executed). In some embodiments, XSAVE, XSTORE, etc. are used in context switching that uses tiles. In some embodiments, two XCR0 bits are used in XSAVE, one bit for TILECONFIF metadata and the other bit corresponds to the actual tile payload data.

[0072] In addition to configuring tile usage, TILECONFIG also sets a state variable that indicates that the program is in a region of code with configured tiles. An implementation can enumerate restrictions on other instructions that can be used with the tile region, such as not using an existing register set.

[0073] Finishing a tile region is typically done with the TILERELEASEALL command, which takes no parameters and quickly invalidates all tiles (indicating that no data needs to be saved or restored anymore) and clears any internal state associated with being in the tile region.

[0074] In some embodiments, the tile operation zeros all rows and all columns beyond the dimensions specified by the tile configuration. For example, the tile operation zeros data beyond the number of columns configured (considering the size of the elements) as each row is written. For example, in a tile configured with 64 byte rows and 10 rows and 12 columns, an operation writing an FP32 element will write 12*4 bytes of output / result data to each of the first 10 rows and zero the remaining 4*4 bytes of each row. The tile operation completely zeros any rows after the first 10 configured rows. Using a 1K tile with 64 byte rows results in 16 rows, so the last 6 rows should also be zeroed in this example.

[0075] In some embodiments, context restore (e.g., XRSTOR) enforces that data beyond the rows configured for a tile is kept as zero when loading data. If there is no valid configuration, all rows are zeroed. XRSTOR of tile data may load unwanted data into columns beyond the configured columns. Since there is no element width associated with the tile configuration, it should not be possible for XRSTOR to clear beyond the configured number of columns.

[0076] A context save (e.g., XSAVE) exposes the entire TILE storage area when it writes it to memory. If XRSTOR loads unwanted data to the right edge of a tile, that data is saved by XSAVE. XSAVE writes zeros to any rows beyond the specified number per tile.

[0077] In some embodiments, tile instructions are restartable. Operations that access memory allow restart after a page fault. Computation instructions that process floating point operations also allow unmasked floating point exceptions, with the masking of the exceptions being controlled by control and / or status registers.

[0078] To support restart of instructions after these events, these instructions store information in a start register, which is described in more detail below.

[0079] [II. Matrix (Tile) Calculation System] A. Exemplary Hardware Support FIG. 3 illustrates one embodiment of a system utilizing a matrix (tile) operations accelerator. In this diagram, a host processor / processing system 301 communicates commands 311 (e.g., arithmetic or matrix operation operations, or matrix operation operations such as load and store operations) to a matrix operations accelerator 307. However, this is shown in this manner for illustrative purposes only. As will be described in more detail later, this matrix operations accelerator 307 may be part of a processing core. Typically, commands 311, which are tile operation operator instructions, refer to tiles as register-register ("reg-reg") or register-memory ("reg-mem") formats. Other commands, such as TILESTORE, TILELOAD, TILECONFIG, do not perform data operations on tiles. The commands may be decoded instructions (e.g., micro-ops) or macro-instructions for the matrix operations accelerator 307 to process.

[0080] In this example, the coherent memory interface 303 is coupled to the host processor / processing system 301 and the matrix operation accelerator 307 so that they can share memory. Figures 4 and 5 show different embodiments of how memory is shared using the matrix operation accelerator. As shown in Figure 4, the host processor 401 and the matrix operation accelerator circuit 405 share the same memory 403. Figure 5 shows an embodiment in which the host processor 501 and the matrix operation accelerator 505 do not share memory, but can access each other's memory. For example, the processor 501 can access the tiled memory 507 and can also use its own host memory 503 as usual. Similarly, the matrix operation accelerator 505 can access the host memory 503, but more generally uses the tiled memory 507. Note that these memories can be different types of memories.

[0081] In some embodiments, the matrix operations accelerator 307 includes multiple FMAs 309 coupled to data buffers 305 (in some implementations, one or more of these data buffers 305 are stored in a grid of FMAs as shown). The data buffers 305 buffer tiles loaded from memory (e.g., using a tile load instruction or a tile store instruction) and / or tiles to be stored in memory. The data buffers may be, for example, multiple registers. Typically, these FMAs are arranged as a grid 309 of chained FMAs that can read and write tiles. In this example, the matrix operations accelerator 307 performs a matrix multiplication operation using tiles T0, T1, and T2. The FMA grid 309 stores at least one of these tiles. In some embodiments, all tiles involved in the operation are stored in the FMA grid 309. In other embodiments, only a subset is stored in the FMA grid 309. As shown, T1 is accommodated and T0 and T2 are not. Note that A, B, and C refer to the matrices of these tiles, which may or may not occupy the entire space of the tile.

[0082] FIG. 6 illustrates one embodiment of a matrix multiply-accumulate operation using tiles ("TMMA").

[0083] The number of rows in the matrix (tile A 601) corresponds to the number of serial (chained) FMAs, including the computational latency. An implementation freely recycles on a lower height grid, but the computation remains the same.

[0084] The source / destination vectors come from a tile with N rows (tile C 605) and the FMA's grid 611 performs N vector-matrix operations resulting in a complete instruction to perform the matrix multiplication of the tile. Tile B 603 is the other vector source, feeding the "broadcast" terms to the FMA at each stage.

[0085] In operation, in some embodiments, the elements of matrix B (stored in tile B 603) are spread across a rectangular grid of FMAs. Matrix B (stored in tile A 601) has its row elements transposed to match the column dimensions of the rectangular grid of the FMAs. At each FMA in the grid, the elements of A and B are multiplied and added to the incoming augend (starting from the top of the figure), and the output sum is passed to the next row (or final output) of the FMA.

[0086] The latency of a single step is proportional to K (the row height of matrix B), and the dependent TMMA typically has enough source-destination rows (within a single tile or across tiles) to hide that latency. An implementation may also divide the SIMD (packed data element) dimension M (the row height of matrix A) over time steps, but this simply changes the constant by which K is multiplied. When a program specifies K smaller than the maximum enumerated by TMACC, an implementation is free to implement this with "masking" or "early out".

[0087] The overall TMMA latency is proportional to N*K. The repeat rate is proportional to N. The number of MACs per TMMA instruction is N*K*M.

[0088] 7 illustrates one embodiment of a subset of the execution of iterations of a chained fused multiply-accumulate instruction. Specifically, the diagram illustrates the execution circuitry for iterations of one packed data element location of the destination. In this embodiment, the chained fused multiply-accumulate is operating on a signed source and the accumulator is twice the input data size.

[0089] The first signed source (Source 1 (701)) and the second signed source (Source 2 (703)) each have four packed data elements. Each of these packed data elements stores signed data, such as floating point data. The third signed source (Source 3 (709)) has two packed data elements, each of which stores signed data. The size of the first and second signed sources 701 and 703 is half the size of the third signed source (initial value or previous result) 709. For example, the first and second signed sources 701 and 703 may have 32-bit packed data elements (e.g., single precision floating point) and the third signed source 709 may have 64-bit packed data elements (e.g., double precision floating point).

[0090] In this figure, only the two most significant packed data element positions of the first and second signed sources 701 and 703, and the most significant packed data element position of the third signed source 709, are shown. Of course, other packed data element positions would also be processed.

[0091] As shown, packed data elements are processed in pairs. For example, data in the most significant packed data element positions of the first and second signed sources 701 and 703 are multiplied using multiplier circuit 705, and data from the second most significant packed data element positions 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 packed data element positions. In other embodiments, additional multiplier circuits are used so that packed data elements are processed in parallel. In some contexts, the parallel execution is performed using lanes that are the size of the third signed source 709. The results of each multiplication are added using adder circuit 711.

[0092] The result of the addition of the results of the multiplications is added (using a different adder 713 or the same adder 711) to the data from the most significant packed data element position of signed source 3 (709).

[0093] Finally, the result of the second addition is stored in the signed destination 715 at a packed data element location that corresponds to the packed data element location used from the third signed source 709, or passed to the next iteration, if any. In some embodiments, a write mask is applied to this storage such that if the corresponding write mask (bit) is set, a save occurs, and if not, no save occurs.

[0094] 8 illustrates one embodiment of a subset of the execution of iterations of a chained fused multiply-accumulate instruction. Specifically, the diagram illustrates the execution circuitry for iterations of one packed data element location in the destination. In this embodiment, the chained fused multiply-accumulate is operating on a signed source and the accumulator is twice the input data size.

[0095] A first signed source (Source 1 (801)) and a second signed source (Source 2 (803)) each have four packed data elements. Each of these packed data elements stores signed data, such as integer data. A third signed source (Source 3 (809)) has two packed data elements, each of which stores signed data. The size of the first and second signed sources 801 and 803 is half the size of the third signed source 809. For example, the first and second signed sources 801 and 803 may have 32-bit packed data elements (e.g., single precision floating point) and the third signed source 809 may have 64-bit packed data elements (e.g., double precision floating point).

[0096] In this figure, only the two most significant packed data element positions of the first and second signed sources 801 and 803, and the most significant packed data element position of the third signed source 809, are shown. Of course, other packed data element positions would also be processed.

[0097] As illustrated, packed data elements are processed in pairs. For example, data in the most significant packed data element positions of the first and second signed sources 801 and 803 are multiplied using multiplier circuit 805, and data from the second most significant packed data element positions of the first and second signed sources 801 and 803 are multiplied using multiplier circuit 807. In some embodiments, these multiplier circuits 805 and 807 are reused for other packed data element positions. In other embodiments, additional multiplier circuits are used so that packed data elements are processed in parallel. In some contexts, the parallel execution is performed using lanes that are the size of the third signed source (initial value or previous iteration result) 809. The result of each multiplication is added to the third signed source 809 using add / saturate circuit 813.

[0098] The add / saturate (accumulator) circuit 813 preserves the signs of the operands when the addition results in a value that is too large. Specifically, saturation evaluation is performed on the infinite precision result between the multiway addition and the write to the destination or the next iteration. When the accumulator 813 is floating point and the input terms are integers, the sum of products and the floating point accumulator input values ​​are converted to infinite precision values ​​(fixed point numbers of a few hundred bits) and an addition of the multiplication result and the third input is performed, with one rounding to the actual accumulator type.

[0099] Unsigned saturation means that the output value is restricted to the maximum unsigned number (all ones) for the element width. Signed saturation means that the value is restricted to be between the most negative and most positive number for the element width (e.g. for bytes the range is -128 (=-2^7) to 127 (=2^7-1)).

[0100] The result of the addition and saturation check is stored in signed result 815 in a packed data element location that corresponds to the packed data element location used from the third signed source 809, or passed to the next iteration, if any. In some embodiments, a write mask is applied to this storage such that if the corresponding write mask (bit) is set, a save occurs, and if not, no save occurs.

[0101] 9 illustrates one embodiment of a subset of the execution of iterations of a chained fused multiply-accumulate instruction. Specifically, the diagram illustrates the execution circuitry for iterations of one packed data element location of the destination. In this embodiment, the chained fused multiply-accumulate is processing signed and unsigned sources, and the accumulator is four times the input data size.

[0102] A first signed source (source 1 (901)) and a second unsigned source (source 2 (903)) each have four packed data elements. Each of these packed data elements has data, such as floating point data or integer data. A third signed source (initial value or result 915) has packed data elements that store signed data. The first and second signed sources 901 and 903 are one-quarter the size of the third signed source 915. For example, the first and second sources 901 and 903 may have 16-bit packed data elements (e.g., words) and the third signed source 915 may have 64-bit packed data elements (e.g., double precision floating point or 64-bit integers).

[0103] In this figure, the four most significant packed data element positions of the first and second sources 901 and 903 are shown, as well as the most significant packed data element position of the third signed source 915. Of course, other packed data element positions, if any, would also be processed.

[0104] As shown, the packed data elements are processed in quadruplets. For example, data in the most significant packed data element positions of the first and second sources 901 and 903 are multiplied using multiplier circuitry 905, data from the second most significant packed data element positions of the first and second sources 901 and 903 are multiplied using multiplier circuitry 907, data from the third most significant packed data element positions of the first and second sources 901 and 903 are multiplied using multiplier circuitry 909, and data from the least significant packed data element positions of the first and second sources 901 and 903 are multiplied using multiplier circuitry 911. In some embodiments, the signed packed data elements of the first source 901 are sign extended and the unsigned packed data elements of the second source 903 are zero extended prior to the multiplication.

[0105] In some embodiments, these multiplier circuits 905-911 are reused for other packed data element positions. In other embodiments, additional multiplier circuits are used so that packed data elements are processed in parallel. In some contexts, the parallel execution is performed using lanes that are the size of the third signed source 915. The results of each multiplication are added using adder circuit 911.

[0106] The result of the addition of the results of the multiplications is added (using a different adder 913 or the same adder 911) to the data from the most significant packed data element position of signed source 3 (915).

[0107] Finally, the result 919 of the second addition is stored in the signed destination at a packed data element location that corresponds to the packed data element location used from the third signed source 915 or passed to the next iteration. In some embodiments, a write mask is applied to this storage such that if the corresponding write mask bit is set, a save occurs, and if not, no save occurs.

[0108] 10 illustrates one embodiment of a subset of the execution of iterations of a chained fused multiply-accumulate instruction. Specifically, the diagram illustrates the execution circuitry for iterations of one packed data element location of the destination. In this embodiment, the chained fused multiply-accumulate is processing signed and unsigned sources, and the accumulator is four times the input data size.

[0109] A first signed source (signed source 1 (1001)) and a second unsigned source (unsigned source 2 (1003)) each have four packed data elements. Each of these packed data elements stores data such as floating point data or integer data. A third signed source (initial value or previous result 1015) has packed data elements that store signed data. The size of signed source 1 (1001) and unsigned source 2 (1003) is one-quarter of the size of the third signed source connected to the initial value or previous result 1015. For example, signed source 1 (1001) and unsigned source 2 (1003) may have 16-bit packed data elements (e.g., words) and the initial value or previous result 1015 may have 64-bit packed data elements (e.g., double precision floating point or 64-bit integer).

[0110] In this diagram, the four most significant packed data element positions of signed source 1 (1001) and unsigned source 2 (1003) are shown, as well as the most significant packed data element position of the initial value or previous result 1015. Of course, other packed data element positions, if any, would also be processed.

[0111] As shown, the packed data elements are processed in quadruplets. For example, data in the most significant packed data element positions of signed source 1 (1001) and unsigned source 2 (1003) are multiplied using multiplier circuit 1005, data from the second most significant packed data element positions of signed source 1 (1001) and unsigned source 2 (1003) are multiplied using multiplier circuit 1007, data from the third most significant packed data element positions of signed source 1 (1001) and unsigned source 2 (1003) are multiplied using multiplier circuit 1009, and data from the least significant packed data element positions of signed source 1 (1001) and unsigned source 2 (1003) are multiplied using multiplier circuit 1011. In some embodiments, the signed packed data elements of signed source 1 (1001) are sign extended and the unsigned packed data elements of unsigned source 2 (1003) are zero extended prior to multiplication.

[0112] In some embodiments, these multiplier circuits 1005-1011 are reused for other packed data element positions. In other embodiments, additional multiplier circuits are used so that packed data elements are processed in parallel. In some contexts, the parallel execution is done using lanes that are the size of the initial value or previous result 1015. The result of the addition of the results of the multiplication is added to the data from the most significant packed data element position of the signed source 3 connected to the initial value or previous result 1015 using an add / saturate circuit 1013.

[0113] The add / saturate circuit 1013 preserves the signs of the operands when the addition results in values ​​that are too large or too small for signed saturation. As used herein, the add / saturate circuit 1013 may be referred to as an accumulator. Specifically, saturation evaluation is performed on the infinite precision result between the multiway addition and the write to the destination. When the add / saturate circuit 1013 uses floating point and the input terms are integers, the sum of products and the floating point accumulator input values ​​are converted to infinite precision values ​​(fixed point numbers of several hundred bits) and an addition of the multiplication result and a third input is performed, with one rounding to the actual accumulator type.

[0114] The result of the addition and saturation check 1019 is used from a third signed source and is stored in a signed destination at a packed data element location corresponding to the packed data element location connected to the initial value or previous result 1015, or passed to the next iteration. In some embodiments, a write mask is applied to this storage such that if the corresponding write mask (bit) is set then a save occurs, and if not set then no save occurs.

[0115] FIG. 11 illustrates a power-of-two sized SIMD implementation where the accumulator uses a larger input size than the input to the multiplier, according to one embodiment. Note that the source value (to the multiplier) and the accumulator value can be signed or unsigned values. For an accumulator with double input size (in other words, the accumulator input value is twice the size of the source's packed data element size), table 1101 illustrates various configurations. For a byte-sized source, the accumulator uses word or half-precision floating-point (HPFP) values ​​with a size of 16 bits. For a word-sized source, the accumulator uses 32-bit integer or single-precision floating-point (SPFP) values ​​with a size of 32 bits. For a SPFP or 32-bit integer sized source, the accumulator uses 64-bit integer or double-precision floating-point (DPFP) values ​​with a size of 64 bits.

[0116] For an accumulator with 4x input size (in other words, the accumulator input value is 4x the size of the source's packed data element size), table 1103 shows various configurations. For byte-sized sources, the accumulator uses 32-bit integer or single-precision floating-point (SPFP) values ​​with a size of 32 bits. For word-sized sources, in some embodiments, the accumulator uses 64-bit integer or double-precision floating-point (DPFP) values ​​with a size of 64 bits.

[0117] For an accumulator with 8x input size (in other words, the accumulator input values ​​are 8x the size of the source packed data element size), table 1105 shows one configuration: For a byte-sized source, the accumulator uses 64-bit integers.

[0118] As alluded to above, the matrix operation circuitry may be included in the core or may be an external accelerator. Figure 12 illustrates one embodiment of a system utilizing the matrix operation circuitry. In this figure, multiple entities are coupled with a ring interconnect 1245.

[0119] Multiple cores 1201, 1203, 1205, and 1207 provide non-tile-based instruction support. In some embodiments, matrix operation circuitry 1251 is provided within core 1203, while in other embodiments, matrix operation circuitry 1211 and 1213 are accessible over ring interconnect 1245.

[0120] Further, in place of the core and / or matrix calculation circuitry, one or more memory controllers 1223-1225 are provided to communicate with the memories 1233 and 1231.

[0121] FIG. 13 illustrates one embodiment of a processor core pipeline supporting matrix operations using tiles. A branch prediction and decode circuit 1303 performs branch prediction, instruction decoding, and / or both of instructions from instructions stored in an instruction storage 1301. For example, instructions detailed herein may be stored in the instruction storage. In some implementations, a separate circuit is used for branch prediction, and in some embodiments, at least some instructions are decoded into one or more micro-operations, microcode entry points, microinstructions, other instructions, or other control signals using microcode 1305. The branch prediction and decode circuit 1303 may be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to, lookup tables, hardware implementations, programmable logic arrays (PLAs), microcode read-only memories (ROMs), and the like.

[0122] The branch prediction and decode circuit 1303, in some embodiments, is coupled to a rename / allocator circuit 1307, which is coupled to a scheduler circuit 1309. In some embodiments, these circuits provide register renaming, register allocation, and / or scheduling functionality by performing one or more of: 1) renaming logical operand values ​​to physical operand values ​​(e.g., in some embodiments, a register alias table), 2) assigning status bits and flags to decoded instructions, and 3) scheduling decoded instructions for execution on execution circuits from an instruction pool (e.g., using a reservation station in some embodiments).

[0123] The scheduler circuitry 1309 represents any number of various schedulers including reservation stations, central instruction windows, etc. The scheduler circuitry 1309 of the scheduler unit is coupled to or includes a physical register file 1315. Each of the physical register files 1315 represents one or more physical register files, the different files storing one or more different data types, such as scalar integer, scalar floating point, packed integer, packed floating point, vector integer, vector floating point, status (e.g., an instruction pointer that is the address of the next instruction to be executed), tiles, etc. In one embodiment, the physical register file 1315 comprises a vector register circuit, a write mask register circuit, and a scalar register circuit. These register circuits can provide architectural vector registers, vector mask registers, and general purpose registers. The physical register file 1315 is overlapped with the retirement circuitry 1317 to illustrate the various ways in which register renaming and out-of-order execution can be implemented (e.g., using a reorder buffer and a retirement register file, using a future file, a history buffer and a retirement register file, using a register map and a pool of registers, etc.). The retirement circuitry 1317 and the physical register file 1315 are coupled to the execution circuitry 1311.

[0124] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming may also be used in in-order architectures. The illustrated processor embodiment may also include separate instruction and data cache units and a shared L2 cache unit, although 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 cache. In some embodiments, the system may include a combination of an internal cache and an external cache that is external to the core and / or processor. Alternatively, all of the caches may be external to the core and / or processor.

[0125] The execution circuitry 1311 includes a set of one or more execution circuits 1321, 1323, and 1327, as well as a set of one or more memory access circuits 1325. The execution circuits 1321, 1323, and 1327 perform various operations (e.g., shift, add, subtract, multiply) on various types of data (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point). Some embodiments may include several execution units dedicated to specific functions or sets of functions, while other embodiments may include only one execution unit or multiple execution units that all perform all functions. The scalar circuitry 1321 performs scalar operations, the vector / SIMD circuitry 1323 performs vector / SIMD operations, and the matrix operation circuitry 1327 performs matrix (tile) operations as detailed herein.

[0126] By way of example, an exemplary register renaming, out-of-order issue / execution core architecture may implement a pipeline as follows: 1) an instruction fetch circuit performs a fetch and length decode phase; 2) a branch and decode circuit 1303 performs a decode phase; 3) a rename / allocator circuit 1307 performs an allocate phase and a rename phase; 4) a scheduler circuit 1309 performs a schedule phase; 5) a physical register file and memory unit (coupled to or included in the scheduler circuit 1309 and the rename / allocate circuit 1307) perform a register read / memory read phase, and an execution circuit 1311 performs an execute phase; 6) a memory unit and a physical register file unit perform a writeback / memory write phase; 7) various units may be involved in an exception handling phase; and 8) a retirement unit and a physical register file unit perform a commit phase.

[0127] The core may support one or more instruction sets (e.g., the x86 instruction set (with some extensions added in newer versions), the MIPS instruction set from MIPS Technologies of Sunnyvale, Calif., the ARM instruction set (with optional additional extensions such as NEON) from ARM Holdings of Sunnyvale, Calif.), including the instructions described herein. In one embodiment, the core 1390 includes logic to support packed data instruction set extensions (e.g., AVX1, AVX2), which allows operations used by many multimedia applications to be performed using packed data.

[0128] Cores may support multithreading (the execution of two or more parallel sets of operations or threads) in a variety of ways, including time sliced ​​multithreading, simultaneous multithreading (wherein a single physical core provides a logical core for each of the threads that the physical core is multithreading simultaneously), or a combination thereof (e.g., time sliced ​​fetch and decode and then simultaneous multithreading, such as in Intel® Hyper-Threading Technology).

[0129] FIG. 14 illustrates one embodiment of a processor core pipeline supporting matrix operations using tiles. A branch prediction and decode circuit 1403 performs branch prediction, instruction decoding, and / or both of instructions from instructions stored in an instruction storage 1401. For example, instructions detailed herein may be stored in the instruction storage. In some implementations, a separate circuit is used for branch prediction, and in some embodiments, at least some instructions are decoded into one or more micro-operations, microcode entry points, microinstructions, other instructions, or other control signals using microcode 1405. The branch prediction and decode circuit 1403 may be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to, lookup tables, hardware implementations, programmable logic arrays (PLAs), microcode read-only memories (ROMs), and the like.

[0130] The branch prediction and decode circuit 1403, in some embodiments, is coupled to a rename / allocator circuit 1407, which is coupled to a scheduler circuit 1409. In some embodiments, these circuits provide register renaming, register allocation, and / or scheduling functionality by performing one or more of: 1) renaming logical operand values ​​to physical operand values ​​(e.g., in some embodiments, a register alias table), 2) assigning status bits and flags to decoded instructions, and 3) scheduling decoded instructions for execution on execution circuits from an instruction pool (e.g., using a reservation station in some embodiments).

[0131] The scheduler circuitry 1409 represents any number of various schedulers including reservation stations, central instruction windows, etc. The scheduler circuitry 1409 of the scheduler unit is coupled to or includes a physical register file 1415. Each of the physical register files 1415 represents one or more physical register files, the different files storing one or more different data types, such as scalar integer, scalar floating point, packed integer, packed floating point, vector integer, vector floating point, status (e.g., an instruction pointer that is the address of the next instruction to be executed), tiles, etc. In one embodiment, the physical register file 1415 comprises a vector register circuit, a write mask register circuit, and a scalar register circuit. These register circuits can provide architectural vector registers, vector mask registers, and general purpose registers. The physical register file 1415 is overlapped with the retirement circuitry 1417 to illustrate the various ways in which register renaming and out-of-order execution can be implemented (e.g., using a reorder buffer and a retirement register file, using a future file, a history buffer, and a retirement register file, using a register map and a pool of registers, etc.). The retirement circuitry 1417 and the physical register file 1415 are coupled to the execution circuitry 1411.

[0132] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming may also be used in in-order architectures. The illustrated processor embodiment may also include separate instruction and data cache units and a shared L2 cache unit, although 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 cache. In some embodiments, the system may include a combination of an internal cache and an external cache that is external to the core and / or processor. Alternatively, all of the caches may be external to the core and / or processor.

[0133] The execution circuitry 1411 includes a set of one or more execution circuits 1427 and a set of one or more memory access circuits 1425. The execution circuits 1427 perform the matrix (tile) operations detailed herein.

[0134] By way of example, an exemplary register renaming, out-of-order issue / execution core architecture may implement a pipeline as follows: 1) an instruction fetch circuit performs a fetch and length decode phase; 2) a branch and decode circuit 1403 performs a decode phase; 3) a rename / allocator circuit 1407 performs an allocation phase and a renaming phase; 4) a scheduler circuit 1409 performs a schedule phase; 5) a physical register file and memory unit (coupled to or included in the scheduler circuit 1409 and the rename / allocator circuit 1407) perform a register read / memory read phase, and an execution circuit 1411 performs an execution phase; 6) a memory unit and a physical register file unit perform a writeback / memory write phase; 7) various units may be involved in an exception handling phase; and 8) a retirement unit and a physical register file unit perform a commit phase.

[0135] The core may support one or more instruction sets (e.g., the x86 instruction set (with some extensions added in newer versions), the MIPS instruction set from MIPS Technologies of Sunnyvale, Calif., the ARM instruction set (with optional additional extensions such as NEON) from ARM Holdings of Sunnyvale, Calif.), including the instructions described herein. In one embodiment, the core 1490 includes logic to support packed data instruction set extensions (e.g., AVX1, AVX2), which allows operations used by many multimedia applications to be performed using packed data.

[0136] Cores may support multithreading (the execution of two or more parallel sets of operations or threads) in a variety of ways, including time sliced ​​multithreading, simultaneous multithreading (wherein a single physical core provides a logical core for each of the threads that the physical core is multithreading simultaneously), or a combination thereof (e.g., time sliced ​​fetch and decode and then simultaneous multithreading, such as in Intel® Hyper-Threading Technology).

[0137] [B. Layout] Throughout this description, data is represented using a row-major data layout. Column-major users should interpret the terms according to their own orientation. Figure 15 shows an example of a matrix represented in row-major and column-major formats. As shown, matrix A is a 2x3 matrix. When this matrix is ​​stored in row-major format, the data elements in the rows are contiguous. When this matrix is ​​stored in column-major format, the data elements in the columns are contiguous. A T *B T =(BA) T It is a well-known property of matrices that T = ∑ ...

[0138] In some embodiments, row-major semantics is exploited in hardware, with column-major data swapping the operand order with the result being the transpose of the matrix, but for a subsequent column-major read from memory it is the correct untransposed matrix.

[0139] For example, if you have two column-major matrices to be multiplied,

number

[0140] The input matrix should be stored in linear memory (column-major order) as follows:

number

[0141] If we read those matrices as row-major with dimensions 2x3 and 3x2, they should look like this:

number

[0142] Exchange degree and matrix multiplication.

number

number

number

[0143] III. EXEMPLARY USES FIG. 16 shows an example of the use of matrices (tiles). In this example, matrix C 1601 contains two tiles, tile A 1603 contains one tile, and tile B 1605 contains two tiles. This figure shows an example of an inner loop of an algorithm that computes matrix multiplication. In this example, two result tiles tmm0 and tmm1 from matrix C 1601 are used to accumulate intermediate results. One tile (tmm2) from matrix A 1603 is reused twice, as it is multiplied with two tiles from matrix B 1605. Pointers load a new A tile and two new B tiles from the direction indicated by the arrows. The outer loop, not shown, adjusts the pointers for the C tile.

[0144] The exemplary code shown includes the use of tile configuration instructions, which are executed to configure tile usage, load tiles, perform a loop to process tiles, store tiles in memory, and free tile usage.

[0145] Figure 17 illustrates one embodiment of matrix (tile) usage. At 1701, tile usage is configured. For example, a TILECONFIG instruction is executed to configure tile usage, including setting the number of rows and columns per tile. Typically, at 1703, at least one matrix (tile) is loaded from memory. At 1705, at least one matrix (tile) operation is performed using the matrix (tile). At 1707, at least one matrix (tile) is stored in memory and at 1709, a context switch can occur.

[0146] IV. EXEMPLARY CONFIGURATIONS [A. Tile Configuration Hardware Support]

[0147] As mentioned above, tile usage typically needs to be configured before use. For example, it may not be necessary to fully use all rows and columns. In some embodiments, not only does not configuring these rows and columns save power, but the configuration may be used to determine if the operation will generate an error. For example, a matrix multiplication of the form (N×M)*(L*N) typically does not work if M and L are not the same.

[0148] Before using matrices using tiles, in some embodiments, tile support should be configured. For example, the number of rows and columns per tile, tiles to be used, etc. are configured. The TILECONFIG instruction is an improvement to the computer itself, as it provides support for configuring the computer to use a matrix accelerator (either as part of a processor core or as an external device). Specifically, execution of the TILECONFIG instruction retrieves the configuration from memory and applies it to the matrix (tile) settings within the matrix accelerator.

[0149] [i. Tile usage configuration] Figure 18 shows support for configuring the use of tiles, according to one embodiment. Memory 1801 contains tile descriptions 1803 of matrices (tiles) to be supported.

[0150] The execution circuitry 1811 of the processor / core 1805 stores aspects of the tile description 1803 in a tile configuration 1817. The tile configuration 1817 details which tiles for the palette are configured (the number of rows and columns in each tile), as well as marking that matrix support is in use. The execution circuitry 1811 is configured to use the tiles specified by the tile configuration 1817. The execution circuitry 1811 may also include machine state registers, model specific registers (MSRs), or configuration registers to indicate tile usage. Further values ​​such as in-use and start values ​​are also set. The tile configuration 1817 utilizes one or more registers 1819 to store tile usage and configuration information.

[0151] Figure 19 shows one embodiment of a description of the matrices (tiles) to be supported. This is the description to be stored upon execution of the STTILECFG instruction. In this example, each field is one byte. Byte[0] stores the palette ID 1901. The palette ID is used to index a palette table 1813 which stores, for each palette ID, the number of bytes in the tile and the number of bytes per row of the tile associated with this ID as defined by the configuration.

[0152] Byte 1 stores the value to be stored in the "startRow" register 1903, and byte 2 stores the value to be stored in the "startP" register 1905. The instruction stores information in these registers to support restart of the instruction after these events. The instruction stores information in these registers to support restart of the instruction after a break event, such as the events described above. The startRow value indicates the row to be used for restart. The startP value indicates the location within the row for the store operation when a pair is used, in some embodiments the lower half of the row (in the lower tile of the pair) or the upper half of the row (in the upper tile of the pair). Typically the row (column) location is not required.

[0153] With the exception of TILECONFIG and STTILECFG, successful execution of any matrix (tile) instruction sets both startRow and startP to zero.

[0154] It is the software's responsibility to zero the startRow and startP values ​​whenever an interrupted matrix (tile) instruction is not resumed. For example, an unmasked floating-point exception handler may decide to terminate the operation in the software and change the program counter value to another instruction, usually the next instruction. In this case, the software exception handler must zero the startRow and startP values ​​in the exception presented to it by the operating system before resuming the program. The operating system then reloads those values ​​using the restore instruction.

[0155] Byte 3 stores an indication 1907 of the tile pair (1b per tile).

[0156] Bytes 16-17 store the number of rows 1913 and the number of columns 1915 for tile 0, bytes 18-19 store the number of rows and columns for tile 1, etc. In other words, each two-byte group specifies the number of rows and columns for a tile. If two-byte groups are not used to specify tile parameters, they should have the value zero. Specifying tile parameters for more tiles than the implementation or palette limits results in a failure. Unconfigured tiles are set to an initial state of 0 rows and 0 columns.

[0157] Finally, the in-memory construct typically ends with a trailing representation, such as some number of consecutive bytes of all zeros.

[0158] [ii. Exemplary Tiles and Tile Configuration Storage] Figures 20A-20D show examples of registers 1819. Figure 20A shows multiple registers 1819. As shown, each tile (TMM0 2001...TMMN 2003) has a separate register, with each register storing the row and column size for that particular tile. StartP 2011 and StartRow 2013 are stored in separate registers. One or more status registers 2015 are set to indicate that a tile is configured for use (e.g., TILES_CONFIGURED=1).

[0159] Figure 20B shows a number of registers 1819. As shown, each tile has separate registers for its rows and columns. For example, TMM0 Row Configuration 2021, TMM0 Column Configuration 2023, StartP 2011, and StartRow 2013 are stored in separate registers. One or more status registers 2015 are set to indicate that the tile is configured for use (e.g., TILES_CONFIGURED=1).

[0160] Figure 20C shows a single register 1819. As shown, this register stores the tile configuration (rows and columns per tile) 2031, StartP 2011, and StartRow 2013 stored in a single register as a packed data register. One or more status registers 2015 are set to indicate that the tiles are configured for use (e.g., TILES_CONFIGURED=1).

[0161] Figure 20D shows multiple registers 1819. As shown, a single register stores the tile configuration (rows and columns per tile) 2031. StartP 2011 and StartRow 2013 are stored in separate registers. One or more status registers 2015 are set to indicate that the tiles are configured for use (e.g., TILES_CONFIGURED=1).

[0162] Where they are shown separately, other combinations are possible, such as combining the start registers into a single register.

[0163] [Chained tile operation] A single instruction, multiple data (SIMD) processor core implemented according to the disclosed embodiments achieves significant data parallelism through SIMD execution. However, limitations may exist on SIMD computation throughput as the throughput is limited by the number of SIMD functional units or the width of the SIMD functional units. SIMD functional units may be referred to herein as processing engines (PEs). The disclosed embodiments leverage the TILES architecture described herein for use in SIMD execution, allowing for an increased number of SIMD functional units and an increased width of each functional unit.

[0164] The disclosed embodiments provide energy efficiency and execution speed improvements to many vectorizable instructions that use the TILES architecture to enable data reuse between chained tile operations that access tiles in an array. As used herein, a chain is a sequence of two or more instructions (macro-ops and / or micro-ops) that have common source and destination tile specifiers. As used herein, a source tile specifier is included in an instruction that specifies a location from which to retrieve a source tile to be processed. A destination tile specifier is included in an instruction that specifies a destination tile to write the result of the instruction. The specified source tile and destination tile may be stored in any one or more of a memory, a cache hierarchy, a scratch pad, and a register file.

[0165] To illustrate a non-limiting example of a chain of tiled operations, a first instruction may generate a result to be written to a specified destination tile, but that result may also be used as a specified source tile for a second instruction. According to some embodiments, the destination tile specifier of the first instruction is discarded and the result of the first instruction is sent instead to a processing engine that executes the second instruction. In some other embodiments, the destination tile specifier of the first instruction is ignored and the result of the first instruction is sent instead to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is inconsistent and the result of the first instruction is sent instead to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is disregarded and the result of the first instruction is sent instead to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is not used and the result of the first instruction is sent instead to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is rejected and the results of the first instruction are instead sent to a processing engine that executes a subsequent instruction in the chain.

[0166] In some embodiments, the results of a first instruction are sent to multiple subsequent instructions, hi some embodiments, a second instruction receives the results of multiple preceding instructions in the chain.

[0167] Instruction chains are not limited in their length and many instructions may be chained together. Instruction chains are further described and illustrated with respect to at least Figures 21A-23 (which show process flow diagrams illustrating optimized instruction chain execution), Figure 24A (which shows optimized pseudocode for performing efficient chained tile operations), and Figure 25B (which shows an instruction format for a begin chain instruction that specifies the linkages between instructions in the chain).

[0168] To improve processor efficiency by enabling data reuse among multiple operations when executing an instruction chain, the disclosed embodiments improve efficiency by discarding the destination tile specifier of a first instruction and instead choosing to send the result of the first instruction directly to a second instruction without first writing the result back to memory. Such discarding may be performed for multiple instructions in the chain, but is not limited to such.

[0169] Ignoring the destination tile specifier of the first instruction improves performance because the second instruction does not have to wait for at least the results of the first instruction to be written back to storage. In some embodiments, an instruction in the instruction chain includes a chain control field that provides a hint to the execution circuitry as to whether and how to perform the discard. In some embodiments, the execution circuitry includes a binary translator that monitors dependencies between multiple instructions and determines whether and when to discard one or more destination tile specifiers and instead send a result of one of the one or more instructions to one or more PEs that execute a next instruction in the instruction chain.

[0170] In some embodiments, the execution circuitry performs periodic consistency checks to identify any problems caused by the discard. In some embodiments, the execution circuitry keeps a record of instructions whose destination tile specifiers have been discarded, so that the SIMD processor can roll back and re-execute those recorded instructions without being discarded this time.

[0171] The disclosed embodiments do not attempt to improve SIMD efficiency by restricting the selection of execution cores to one type. Rather, some embodiments utilize a mix of asymmetric processing engines (PEs), some with more limited capabilities and utilizing less power than others. In some embodiments, the selection of a processing engine from among the asymmetric processing engines as well as the SIMD execution path is done dynamically at run-time.

[0172] Some disclosed embodiments utilize the paradigm of an array of asymmetric processing engines (PEs). In some embodiments, each PE in the asymmetric array is an arithmetic logic unit (ALU) capable of performing only a limited number of operations. For example, the array of asymmetric PEs may include, but is not limited to, some PEs dedicated to shifting, some PEs dedicated to addition and subtraction, some PEs dedicated to format conversion, some PEs dedicated to division, some PEs dedicated to multiplication, some PEs dedicated to unary operations, some PEs dedicated to logical operations, etc. In some embodiments, at least some PEs are capable of performing more than one type of operation. In operation, the execution circuitry dynamically selects and configures a set of PEs to execute a set of instructions in a SIMD instruction chain. Different PEs can be selected to perform different operations, matching the required performance to the provided performance, resulting in a power-efficient implementation. One advantage of this asymmetric array is that it allows for a tight match between the processing power required and the power consumed, i.e., only as much processing power is used as is required. In some embodiments, power is saved by performing a one-time setup and configuration of a set of PEs to execute different portions of a tiled computation chain, allowing that configuration to be reused for the remaining matrix elements. As described herein, a "tile" may be referred to as a matrix, and is a special case of a matrix.

[0173] In some embodiments, the asymmetric array of PEs includes a dynamically configurable interconnect to route data between multiple PEs in a SIMD processing path. In operation, the execution circuitry can select a set of PEs to execute a SIMD instruction chain and dynamically set up a network to transfer data between them. One advantage of this dynamically configurable interconnect is that it allows connections between a wide set of PEs without necessarily incurring the cost and die area of ​​connecting every PE to every other PE.

[0174] One advantage of this asymmetric arrangement of PEs and dynamically configurable interconnect is that intermediate results do not need to be written back to the register file or output to the bypass network, but rather the results of one PE can be sent to the next PE in the SIMD processing chain. This hardware can therefore result in higher performance and more energy efficient SIMD processors.

[0175] [Example Execution] 21A is a block flow diagram illustrating an exemplary execution of an optimizable tile instruction chain. As shown, the unoptimized instruction chain 2100 specifies an arithmetic sequence of operations that sets a result tile as a function of three source tiles, i.e., result=((A+B)*3)-C). Such an instruction chain may be executed N times, each time producing a result that is stored in each element of a tile having M rows and K columns of elements. However, for simplicity and to illustrate the optimization, only one instance of the instructions is shown, i.e., one iteration of a loop that produces one tile.

[0176] To optimize an instruction chain according to embodiments disclosed herein, one or more of the destination tile specifiers of a plurality of instructions are discarded and the results of that instruction are sent instead to subsequent instructions in the chain. In some embodiments, the execution circuitry keeps a record of the instructions that have discarded their destination tile specifiers, and if a problem resulting from the discard is detected, rolls back to recover by re-executing one or more of the recorded plurality of instructions.

[0177] In some embodiments, the execution circuitry keeps a record of instructions that have discarded their destination tile specifiers, so that the execution circuitry can roll back and re-execute the instructions again without discarding. In some embodiments, the execution circuitry further saves the machine state before the discard and then performs a machine state consistency check to detect any inconsistencies caused by the discard. In some embodiments, the execution circuitry further discards the destination tile specifier of the instruction, thereby setting a dirty bit in the configuration of that tile to detect an inconsistency if the dirty tile is read by a subsequent instruction. The execution circuitry in some embodiments generates a fault if such an inconsistency is detected, and in some embodiments the execution circuitry rolls back and re-executes one or more instructions.

[0178] In operation, as shown, the instruction chain 2100 is fetched from storage as a series of instructions (e.g., micro-ops) or macro-instructions, each having a destination tile specifier and a source tile specifier. Typically, the instructions in the instruction chain specify intermediate tiles stored in the scratch pad 2102 as sources and destinations. In some embodiments, the instructions in the instruction chain specify source and / or destination tiles in a register file, in a cache, or some other memory structure. In some embodiments, the scratch pad is a memory that includes one or more registers or latches, as well as cache memory and other static memory, that is located relatively close to the execution circuitry and that stores intermediate data results. At some point, the tiles in the scratch pad are committed to memory.

[0179] Assuming that matrices (tiles) A, B, and C have already been loaded into the scratchpad 2102, matrices (tiles) A, B, and C are retrieved from the scratchpad 2102 in tile A 2104, tile B 2106, and tile C 2108, respectively.

[0180] In add 2110, tiles A and B are added together and the result in tile E 2112 is written back to tile E in scratch pad 2102 (or in a register file, cache, or some other memory structure). Tile E 2112 is shown with a dashed border to highlight that it is a potential optimization point. In some embodiments, as disclosed herein and shown and described with respect to FIG. 21B, the execution circuitry discards the destination tile specifier of the instruction performed in add 2110, tile E, and instead sends the result of the operation at 2112 to be performed in the next operation in the instruction chain, multiply 2114.

[0181] In multiplication 2114, the result of addition 2110, i.e., tile E, is sent to the processing engine to be multiplied with a value (e.g., 3) 2120 broadcast from scratch pad 2102, depending on whether the specified destination tile of addition 2110 was discarded, and the result in tile F 2116 is written back to tile F in scratch pad 2102. Tile F 2116 is shown with a dashed border to highlight that it is a potential optimization point. In some embodiments, as disclosed herein and shown and described with respect to FIG. 21B, the execution circuitry discards tile F, which is the destination tile specifier of multiplication 2114, and instead sends the result of multiplication 2114 to the next instruction in the instruction chain, subtraction 2118.

[0182] In operation subtract 2118, the result of multiplication 2114, tile F, is forwarded to the processing engine as a source from which tile C 2108 is to be subtracted, depending on whether the specified destination tile of multiplication 2114 was discarded. Because operation subtract 2118 represents the last instruction in the chain, no optimization is available and the result of operation subtract 2118, tile D 2122, is stored back in scratch pad 2102 (or in a register file, cache, or some other memory structure) at 2124.

[0183] Figure 21B is a block flow diagram illustrating an exemplary execution of an optimized tile instruction chain. As shown, an optimized instruction chain 2150, like the instruction chain 2100 of Figure 21A, specifies an arithmetic sequence of operations that sets a result tile as a function of three source tiles, i.e., result = ((A + B) * 3) - C). Such an instruction chain may be executed N times, each time generating a result that is stored in each element of a tile having M rows and K columns of elements. However, for simplicity and to illustrate the optimization, only one instance of the instructions is shown, i.e., one iteration of a loop that generates one tile.

[0184] To optimize an instruction chain according to some embodiments, the destination tile specifiers of one or more instructions are discarded and the results of those instructions are sent instead to subsequent instructions in the chain.

[0185] In operation, as shown, an instruction chain 2150 is fetched from storage as a series of instructions (e.g., micro-ops) or macro-instructions, each of which specifies an arithmetic opcode and has a destination tile specifier and at least one source tile specifier. Typically, instructions in the instruction chain specify intermediate tiles stored in the scratch pad 2152 as source and destination tiles. At some point, the tiles in the scratch pad are committed to memory.

[0186] Assuming that matrices (tiles) A, B, and C have already been loaded into the scratchpad 2152, then matrices (tiles) A, B, and C are retrieved from the scratchpad 2152 at 2154, 2156, and 2158, respectively.

[0187] At 2160, tiles A and B are added in response to an instruction that specifies tiles A and B as the source tiles and tile E as the destination tile. In operation, the SIMD processor performs additions on multiple vector elements simultaneously and in parallel. The execution circuitry optimizes the flow by discarding the destination tile specifier at 2160 and instead sending the result of the addition to the next instruction in the chain, multiplication 2164. In operation, the processor performs multiplications 2164 on multiple vector elements simultaneously and in parallel.

[0188] [Deciding whether and when to discard] According to the embodiments disclosed herein, there are multiple ways in which the execution circuitry can be triggered to optimize the flow by re-sending the results of the arithmetic addition 2160 to the arithmetic multiplication 2164.

[0189] First, in some embodiments, the execution circuitry includes a binary translator that buffers a sequence of instructions and dynamically analyzes them at run-time to detect data dependencies between the instructions. The binary translator can predict, for example, that a result of an executed operation will be used only once by the next instruction in the chain and never again. Based on such a prediction, the execution circuitry can choose to discard a specified destination tile in the scratch pad and instead send the result to the next processing engine that will execute the next instruction in the chain.

[0190] Moreover, in some disclosed embodiments, the add 2160 instruction is formatted according to a chain-friendly instruction format, such as CHAIN_TILE_OP, which specifies an arithmetic operation, a destination tile, up to three source tiles, possibly an immediate value, and a chain control field, as further shown and described below with respect to Figure 25A. The format of the CHAIN_TILE_OP instruction, as well as other instruction formats of the disclosed embodiments, are further shown and described with respect to Figures 25C-D and 26A-D.

[0191] Further methods of determining whether a chain exists and optimizing it are disclosed without limitation. In some embodiments, the chain control field of the CHAIN_TILE_OP includes a header that identifies a first instruction and one or more subsequent instructions as being part of a chain or instructions to be optimized according to the disclosed embodiments. In some embodiments, the chain control field indicates that the chain position hint is one of, for example, a chain start hint, a chain middle hint, and a chain end hint that mark each instruction in the chain. In some embodiments, each instruction chain control field in the chain specifies an index that indicates the relative position of the instruction in the chain.

[0192] Additionally, in some disclosed embodiments, the begin chain instruction makes the execution circuitry aware that an instruction chain continues and provides some details of the chain, as further described and illustrated with respect to FIG. 25B.

[0193] According to a disclosed embodiment, in response to determining that there is an instruction chain to optimize, the execution circuitry dynamically selects and configures the SIMD paths of the processing engine to execute the instruction chain, discarding all designated destination tiles except the last instruction in the chain, and sending the results of all instructions except the last instruction to the next PE that executes the next instruction in the chain. Thus, as shown, the execution circuitry determines the presence of a chain and resends the results of the addition 2160 from the designated destination tile, tile E, to the PE that executes the multiplication 2164. Similarly, the execution circuitry continues processing the chain by resending the results of the multiplication 2164 from the designated destination tile F to the PE that executes the subtraction 2168, the next instruction in the chain. In operation, the SIMD processor simultaneously and in parallel performs the addition 2160, the multiplication 2164, and the subtraction 2168 on multiple tile elements. If there are no further instructions in the chain after the subtraction 2168, then the execution circuitry sends the result of the subtraction 2168 to the specified destination tile D 2172 for storage back in the scratchpad 2152 at 2174.

[0194] [Selection of Processing Engine (PE) and SIMD Path Configuration] To implement the chained tile operations, the disclosed embodiments select processing engines to perform the chained mathematical operations. In some embodiments, the SIMD processor includes an asymmetric array of processing engines (PEs). Such an array has a variety of different types of processing engines, some with higher processing power than others but consuming more power or die area.

[0195] In some embodiments, the SIMD processor has processing engines suited to the mathematical operations being performed. For example, some processing engines may be dedicated to unary operations such as increment, decrement, square root, negation, or trigonometric operations such as sine, cosine, and tangent, to name a few non-limiting examples. Some PEs may be dedicated to binary operations such as mathematical operations (e.g., addition, subtraction, division, multiplication, modular, etc.) and logical operations (e.g., AND, OR, NAND, NOR, XOR, XNOR, CMP, etc.), to name a few non-limiting examples. In some embodiments, the SIMD processor has a pool of symmetric processing engines for use in performing chained tile operations.

[0196] In operation, according to some embodiments, the execution circuitry selects and configures PEs to perform chained tile operations. For example, in the embodiment of FIG. 21B, the execution circuitry selects PEs to process multiple tile elements in parallel. The execution circuitry in some embodiments attempts to select and configure a minimum number of PEs, matching processing power to the tile processing requirements. In some embodiments, different PEs or a set of PEs are selected to operate in parallel on multiple elements of a tile. In some embodiments, when selecting PEs to perform operations of an instruction chain, the execution circuitry selects PEs that are located close to each other on the die of the processor to minimize routing latency when performing a SIMD chain of operations. In some embodiments, when selecting PEs to perform operations of an instruction chain, the execution circuitry selects PEs that are evenly spread across various regions of the die to balance and spread power utilization evenly across the die region.

[0197] Some disclosed embodiments utilize the paradigm of an array of asymmetric processing engines (PEs). In some embodiments, each PE in the asymmetric array is an arithmetic logic unit (ALU) capable of performing only a limited number of operations. For example, the array of asymmetric PEs may include, but is not limited to, some PEs dedicated to shifting, some PEs dedicated to addition and subtraction, some PEs dedicated to format conversion, some PEs dedicated to division, some PEs dedicated to multiplication, some PEs dedicated to unary operations, some PEs dedicated to logical operations, etc. In some embodiments, at least some PEs are capable of performing more than one type of operation. In operation, the execution circuitry dynamically selects and configures a set of PEs to execute a set of instructions in a SIMD instruction chain. Different PEs are selected to perform different operations, and the performance provided can be matched to the performance required, resulting in a power-efficient implementation. One advantage of this asymmetric array is that it allows for a tight match between the processing power required and the power consumed, i.e., only as much processing power is used as is required. In some embodiments, power is saved by performing a one-time setup and configuration of a set of PEs to execute different portions of a tiled computation chain, allowing that configuration to be reused for the remaining matrix elements. As described herein, a "tile" may be referred to as a matrix, and is a special case of a matrix.

[0198] [Example Processor Execution Flow] 22 is a block flow diagram illustrating a processor execution flow in response to chained tile instructions, according to one embodiment. At 2201, the processor uses a fetch circuit to fetch instructions having a source tile specifier and a destination tile specifier, each of which specifies a respective source tile and destination tile. At 2203, the processor buffers the fetched instructions in memory. Operation 2203 is optional, as indicated by its dashed border, unless the fetched instructions are buffered elsewhere or not buffered at all. At 2205, the processor uses a decode circuit to decode the fetched instructions. At 2207, the processor schedules execution of the decoded instructions. Operation 2207 is optional, as indicated by its dashed border, unless it may occur at different times or not at all. At 2209, the processor uses an execution circuit to execute the decoded instructions as follows:

[0199] At 2211, the processor's execution circuitry identifies the decoded first and second instructions that belong to the instruction chain. The section entitled "Determining Whether and When to Discard" describes various ways in which the processor may identify the decoded first and second instructions that belong to the instruction chain. One embodiment requires the processor to fetch a start chain instruction before fetching the instructions at 2201, e.g., as further described and illustrated with respect to FIG. 25B. The start chain instruction informs the execution circuitry that an instruction chain is to follow and provides some details about the chain.

[0200] At 2213, execution circuitry of the processor dynamically selects and configures a SIMD path having first and second processing engines (PEs) that execute the decoded first and second instructions. At 2215, execution circuitry of the processor dynamically configures a network path from the first PE to the second PE. Operation 2215 is optional, as indicated by its dashed border, insofar as the network path may already be configured.

[0201] At 2217, according to an illustrated embodiment, the execution circuitry of the processor discards the destination tile specifier of the decoded first instruction and instead sends the result of the decoded first instruction from the first PE to the second PE to be used by the second PE to execute the decoded second instruction. In some other embodiments, the destination tile specifier of the first instruction is ignored and the result of the first instruction is instead sent to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is inconsistent and the result of the first instruction is instead sent to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is disregarded and the result of the first instruction is instead sent to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is not used and the result of the first instruction is instead sent to a processing engine that executes a subsequent instruction in the chain. In some other embodiments, the destination tile specifier of the first instruction is rejected and the results of the first instruction are instead sent to a processing engine that executes a subsequent instruction in the chain.

[0202] In some embodiments, the execution circuitry keeps a record of instructions that have discarded their destination tile specifiers (not shown in FIG. 22) and rolls back and re-executes one or more of the recorded instructions as necessary.

[0203] At 2219, the processor commits the results of the executed instructions. Operation 2219 is optional, as indicated by its dashed border, unless a writeback of the results occurs at a different time or not at all.

[0204] 23 is a block flow diagram illustrating execution of chained tile instructions by a single instruction multiple data (SIMD) processor, according to one embodiment. Flow 2300 is typically performed by execution circuitry, such as the execution circuitry detailed herein with respect to at least FIGS. 13, 14, 28A-B, and 29A-B.

[0205] At 2302, a processor fetches, decodes, and buffers one or more instructions until a set of instructions is fetched, where each instruction specifies a source and destination matrix (tile).

[0206] At 2304, the processor tests for several error conditions, any of which, if present, cause a fault to occur at 2306. As shown, the error conditions tested at 2304 include: 1) whether the tile has not yet been constructed, 2) whether the destination and two source tiles are valid, 3) whether any of the two sources are paired, and 4) any of the various row and column counts are out of range.

[0207] When none of the fault conditions tested in 2304 are true, the processor determines, at 2308, whether the decoded first and second instructions are part of an instruction chain. If not, the processor returns to 2302 to fetch at least one more instruction until a set of instructions is fetched. If, however, yes, the processor dynamically selects and configures, at 2310, a SIMD execution path including first and second processing engines (PEs) that execute the decoded first and second instructions. At 2312, the processor discards the destination tile specifier of the decoded first instruction and instead sends the result of the decoded first instruction from the first PE to the second PE to be used by the second PE when executing the decoded second instruction. At 2314, the processor determines whether the chain is complete. If not, the processor returns to 2302 to fetch at least one more instruction until a set of instructions is fetched. If, however, yes, the flow 2300 ends.

[0208] [iv. Example Pseudocode] 24A is an example native code showing a SIMD code loop to be optimized by a processor according to some embodiments. As shown, the SIMD loop in native mode 2402 is a function to be executed for every element of an M×N tile, i.e., result=((B+C)<<2)+k.

[0209] Figure 24B is pseudocode illustrating an unoptimized tile instruction chain. Such an instruction chain may be executed MxN times, e.g., once for each element of a tile having M rows and N columns of elements. However, for simplicity and to illustrate the optimization, only one instance of the instruction is shown, i.e., one iteration of the SIMD code executed for each loop element. Instructions in the SIMD code loop 2404 whose comments include an asterisk represent candidates for optimization according to the embodiments disclosed herein and illustrated and described with respect to Figure 24C.

[0210] Figure 24C is pseudocode illustrating execution flow by a processor execution circuitry executing an optimized tile instruction chain, according to some embodiments. As shown, pseudocode 2406 is the same as the unoptimized pseudocode of Figure 24B, but with the instructions marked with asterisks removed. Thus, instead of storing the sum of B and C in tile A, the execution circuitry discards the specified destination tile (A) and instead sends the result of the sum directly to the processing engine that executes the instruction.

[0211] The pseudocode in Figures 24B and 24C is self-documenting because it includes comments and variable names.

[0212] [ii. Exemplary Instruction Formats] 25A is a block diagram illustrating an example format for a chain friendly instruction, according to some embodiments. As shown, a CHAIN_TILE_OP instruction 2500 is a chain friendly instruction that includes an opcode 2501, a chain control 2502, a destination 2503, and a source 1 (2504). Several optional parameters are also shown, including a source 2 (2505), a source 3 (2506), an immediate value 2507, a write mask 2508, and a size 2509.

[0213] Opcode 2501 specifies an arithmetic tile operation to be performed on all elements of the tile. The specified operation may be a unary operation, a binary operation (in this case source 2 (2505) should also be specified), or a ternary operation (in this case source 2 (2505) and source 3 (2506) should be specified). Examples of unary operations to be specified include increment, decrement, square root, negation, or trigonometric operations such as sine, cosine, and tangent, to name a few non-limiting examples. Examples of binary operations to be specified include, but are not limited to, some examples including mathematical operations (e.g., addition, subtraction, division, multiplication, modulus, etc.), logical operations (e.g., AND, OR, NAND, NOR, XOR, XNOR, CMP, etc.), exchange, threshold, and lower limit, to name a few non-limiting examples.

[0214] In some embodiments, the chain control 2502 is a header that identifies a first instruction and one or more subsequent instructions as part of a chain or instructions to be optimized according to the disclosed embodiments, at least as shown and described with respect to FIG. 21B. In some embodiments, the chain control field indicates that the chain position hint is one of, for example, a chain start hint, a chain middle hint, and a chain end hint that mark each instruction in the chain. In some embodiments, each instruction chain control field in the chain specifies an index that indicates the relative position of the instruction in the chain.

[0215] Destination 2503, source 1 (2504), source 2 (2505), and source 3 (2506) are tile specifiers that specify a destination tile and a source tile. Destination 2503, in some embodiments, is a destination tile specifier that identifies a destination for a chained tile instruction. In some embodiments, destination 2503 is a destination tile specifier that specifies two or more destinations for the results of the instruction.

[0216] Immediate value 2507 allows for the specification of an immediate value within an instruction. Immediate value 2507 is optional, as indicated by its dashed border, in the sense that it is not present in an implementation of the generic vector friendly format that does not support immediate values, and is not present in instructions that do not use immediate values.

[0217] Write mask 2508 is an optional field (indicated by its dashed border) whose contents control, for each data element position, whether that data element position in the destination tile reflects the result of the operation. Some instructions support a merging write mask, while other instructions support both a merging and zeroing write mask. When merging, the vector mask allows any set of elements in the destination tile to be protected from updates during the execution of any operation, and in another embodiment, preserves the old value of each element in the destination tile whose corresponding mask bit has a zero. In contrast, zeroing the vector mask allows any set of elements in the destination to be zeroed during the execution of any operation. If no write mask is specified, all destination elements are treated as unmasked.

[0218] Size 2509 is an optional field (indicated by its dashed border) that indicates the size of the tile data element being processed. Although size 2509 is shown as a separate instruction operand, an asterisk is included to indicate that in some embodiments it should be included in the opcode, prefix, or suffix, the size of each tile element - "B", "W", "D", and "Q", which correspond to 1 byte, 2 bytes, 4 bytes, or 8 bytes, respectively. In some embodiments, size 2509 is included in the opcode, as a prefix or suffix, "H", "S", "D", "Q", and "E", which correspond to the precision level of each tile element - half precision (2 bytes), single precision (4 bytes), double precision (8 bytes), and quadruple precision (16 bytes), respectively.

[0219] 25B is a block diagram illustrating a begin chain instruction, according to some embodiments. As shown, the begin chain instruction 2510 includes an opcode 2511, a chain length 2512, a chain target 2513 including targets 1 through 8 2513A through 2513H, respectively, an optional secondary chain target 2514, and an optional chain operation 2515. In operation, according to some embodiments, a processor fetches the begin chain instruction before fetching a set of instructions for an instruction chain. The begin chain instruction informs the processor that an instruction chain will follow and provides some information about the instruction chain to inform the processor's selection, configuration, and routing of the SIMD pathways of the processing engine to execute the instruction chain.

[0220] The opcode 2511 may include a prefix or suffix to cause a processor executing the instruction to recognize the instruction as a start chain instruction and to further specify the behavior of the instruction. For example, the opcode 2511 may include a prefix specifying that the instruction includes fields specifying a chain target 2513, a secondary chain target 2514, and a chain operation 2515. In operation, the processor selects and configures SIMD pathways of a processing engine to execute an instruction chain in response to the start chain instruction 2510, according to some embodiments.

[0221] Chain length 2512 in some embodiments is an immediate value or a constant that specifies the number of instructions in the instruction chain. In some embodiments, chain length 2512 specifies a general purpose register whose contents specify the number of instructions in the instruction chain.

[0222] The chain target 2513 specifies a target for at least the first instruction in the instruction chain. As illustrated, the chain target 2513 specifies targets 2513A-2513H for each of the first seven instructions in an instruction chain having a length of eight (the results of the eight instructions in the chain are written to a specified destination rather than being passed on to the next instruction). In some embodiments, the chain target 2513 field is an immediate value logically partitioned into bits to specify the target of each instruction in the chain. In some embodiments, the chain target 2513 specifies a general purpose register that contains the target information. In some embodiments, the chain target 2513 specifies a vector register that contains the target information. In some embodiments, the chain target 2513 specifies a model specific register ("MSR") where the target information is stored. In other embodiments, the chain target 2513 specifies a memory location where the target information is stored.

[0223] In some embodiments, the 4-byte chain target 2513 field may be partitioned into 4-bit nibbles to specify a target for each of up to eight instructions in the instruction chain. In some embodiments, each chain target 2513A-2513H specifies the absolute position of the target instruction in the chain. As shown, target 1 2513A (for instruction 0) specifies instruction 1, target 2 2513B specifies instruction 4, target 3 2513C and target 4 2513D specify instruction 4, target 5 2513E specifies instruction 6, target 6 2513F specifies instruction 6, and target 7 2513G specifies instruction 7.

[0224] In some embodiments, targets 1-7, 2513A-G each specify a relative offset of the target instruction to which to send the result. Each of targets 2513A-G may be a two-bit or three-bit value that specifies the distance between the instruction and its target. For example, as shown, targets 1 2513A through 7 2513G may specify 1, 3, 2, 1, 2, 1, 1, respectively.

[0225] In some embodiments, secondary chain targets 2514 are formatted similarly to chain targets 2513, but specify a second target for each instruction in the instruction chain. Like chain targets 2513, secondary chain targets 2514 may be an immediate value, a general-purpose register, a vector register, a model-specific register, or a memory location. Secondary chain targets 2514 are optional, as indicated by their dashed border.

[0226] In some embodiments, the begin chain instruction 2510 includes a chain operation 2515 that specifies the operations to be performed by each of the instruction chain. In operation, the processor uses the chain operation 2515 field to inform its selection, configuration, and routing of processing engines along a SIMD execution path.

[0227] 25C-D are block diagrams illustrating a generic vector friendly instruction format and its instruction templates, according to some embodiments. One embodiment of a format for a CHAIN_TILE_OP instruction is CHAIN_TILE_OP(OP, tdest, tsrc1, tsrc2), where OP specifies the arithmetic operation to be performed, and tsrc1 and tsrc2 specify the sources to be added. In some embodiments, the tdest field is an R / M value (such as 2546 in FIGS. 25C-D), and the tsrc1 field is a register index field in FIGS. 25C-D. In some embodiments, the OP opcode includes an indicator, such as a [U,S][U,S] prefix or suffix, indicating whether each of the first and second identified sources is signed or unsigned.

[0228] In some embodiments, the encoding of the instruction includes a scaled 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 from which an address of a particular destination location in memory is calculated. For example, the base address may be the address of a first location in 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, from the base address, the address of a respective destination location in the block of potential destination locations. 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 a respective destination address. For example, if a scaling factor value of 4 is encoded in the SIB type memory operand, each index value obtained from an element of the index register may be multiplied by 4 and then added to the base address to calculate the destination address.

[0229] In one embodiment, a SIB type memory operand of the format vm32{x,y,z} can identify a vector array of memory operands specified using SIB type memory addressing. In this example, the array of memory addresses is specified using vector index registers that contain a common base register, a constant scaling factor, and individual elements that are each a 32-bit index value. The vector index registers may be 128-bit (e.g., XMM) registers (vm32x), 256-bit (e.g., YMM) registers (vm32y), or 512-bit (e.g., ZMM) registers (vm32z). In another embodiment, a SIB type memory operand of the format vm64{x,y,z} can identify a vector array of memory operands specified using SIB type memory addressing. In this example, the array of memory addresses is specified using vector index registers that contain a common base register, a constant scaling factor, and individual elements that are each a 64-bit index value. The vector index registers may be 128-bit (eg, XMM) registers (vm64x), 256-bit (eg, YMM) registers (vm64y), or 512-bit (eg, ZMM) registers (vm64z).

[0230] V. Detailed Exemplary Systems, Processors, and Emulations Examples of hardware, software, etc. for executing the instructions described above are detailed herein. For example, the description below details aspects of instruction execution including various pipeline stages such as fetch, decode, schedule, execute, retire, etc.

[0231] [Instruction Set] An instruction set may include one or more instruction formats. A given instruction format may define, among other things, various fields (e.g., number of bits, bit positions) that specify the operation to be performed (e.g., opcode) and the operands on which the operation is to be performed, and / or other data fields (e.g., masks). Some instruction formats are further classified by the definition of instruction templates (or sub-formats). For example, the instruction templates of a given instruction format may be defined to have different subsets of the fields of the instruction format (where the included fields are usually in the same order, but at least some have different bit positions because fewer fields are included) and / or where given fields are interpreted differently. Thus, each instruction of the ISA is expressed using a given instruction format (and a given one of the instruction templates of that instruction format, if defined), and includes fields for specifying the operation and the operands. For example, an exemplary ADD instruction has an instruction format that includes a particular opcode, and an opcode field that specifies the opcode and an operand field that selects the operands (source1 / destination and source2), such that an occurrence of this ADD instruction in an instruction stream includes particular content in the operand field that selects the particular operand. A set of SIMD extensions called Advanced Vector Extensions (AVX) (AVX1 and AVX2) that use the Vector Extensions (VEX) coding scheme has been released and / or published (see, e.g., Intel® 64 and IA-32 Architecture Developer's Manual, September 2014; Intel® Advanced Vector Extensions Programming Reference, October 2014).

[0232] [Example instruction format] Embodiments of the instructions described herein may be embodied in different formats. Further, exemplary systems, architectures, and pipelines are detailed below. Embodiments of the instructions may be executed on such systems, architectures, and pipelines, but are not limited to those detailed.

[0233] [Generic Vector Friendly Instruction Format] The vector friendly instruction format is an instruction format that is suitable for vector instructions (e.g., there are some fields that are specific to vector operations). Although embodiments are described in which both vector and scalar operations are supported by the vector friendly instruction format, alternative embodiments use only vector operations in the vector friendly instruction format.

[0234] 25C-25D are block diagrams illustrating a generic vector friendly instruction format and its instruction templates according to an embodiment of the present invention. FIG. 25C is a block diagram illustrating a generic vector friendly instruction format and its class A instruction templates according to an embodiment of the present invention, and FIG. 25D is a block diagram illustrating a generic vector friendly instruction format and its class B instruction templates according to an embodiment of the present invention. Specifically, a generic vector friendly instruction format 2516 is defined for class A and class B instruction templates, both of which do not include the no memory access 2519 instruction template and the memory access 2520 instruction template. The term generic in the context of the vector friendly instruction format refers to an instruction format that is not tied to any particular instruction set.

[0235] Vector-friendly instruction formats support the following: vector operand lengths (or sizes) of 64 bytes with data element widths (or sizes) of 32 bits (4 bytes) or 64 bits (8 bytes) (so a 64-byte vector consists of either 16 doubleword-sized elements, or alternatively, 8 quadword-sized elements); vector operand lengths (or sizes) of 64 bytes with data element widths (or sizes) of 16 bits (2 bytes) or 8 bits (1 byte); data elements of 32 bits (4 bytes), 64 bits (8 bytes), 16 bits (2 bytes), or 8 bits (1 byte) Although embodiments of the invention are described supporting vector operand lengths (or sizes) of 32 bytes having a width (or size), and vector operand lengths (or sizes) of 16 bytes having data element widths (or sizes) of 32 bits (4 bytes), 64 bits (8 bytes), 16 bits (2 bytes), or 8 bits (1 byte), alternative embodiments may support more, fewer, and / or different vector operand sizes (e.g., 256 byte vector operands) having more, fewer, or different data element widths (e.g., a data element width of 128 bits (16 byte)).

[0236] The class A instruction templates of Figure 25C include: 1) within the no memory access 2519 instruction template, a no memory access, full round control type operation 2517 instruction template and a no memory access, data transform type operation 2518 instruction template are shown; 2) within the memory access 2520 instruction template, a memory access, temporal 2525 instruction template and a memory access, non-temporal 2530 instruction template are shown. The class B instruction templates of Figure 25D include: 1) within the no memory access 2519 instruction template, a no memory access, write mask control, partial round control type operation 2522 instruction template and a no memory access, write mask control, vsize type operation 2523 instruction template are shown; 2) within the memory access 2520 instruction template, a memory access, write mask control 2527 instruction template is shown.

[0237] The generic vector friendly instruction format 2516 includes the following fields, listed below in the order shown in Figures 25C-25D.

[0238] Format field 2540 - a particular 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 vector friendly instruction format in an instruction stream. As such, this field is optional in the sense that it is not required for an instruction set that has only a generic vector friendly instruction format.

[0239] Basic Operation field 2542 - its contents identify different basic operations.

[0240] Register index field 2544 - its contents specify, either directly or via address generation, the location of the source and destination operands, whether they are in registers or in memory. These contain a sufficient number of bits to select N registers from a P×Q (e.g., 32×512, 16×128, 32×1024, 64×1024) register file. In one embodiment, N may be up to three source registers and one destination register, although alternative embodiments may support more or fewer source and destination registers (e.g., up to two sources may be supported where one of these sources also serves as a destination, up to three sources may be supported where one of these sources also serves as a destination, up to two sources and one destination may be supported).

[0241] Qualifier field 2546 - its content distinguishes occurrences of instructions in the generic vector instruction format that specify a memory access from instructions that do not, i.e., distinguishes between no-memory access 2519 and memory access 2520 instruction templates. Memory access operations read and / or write to the memory hierarchy (possibly using values ​​in registers to specify source and / or destination addresses), while no-memory access operations do not (e.g., the source and destination are registers). In one embodiment, this field also selects among three different ways of performing memory address calculations, although alternative embodiments may support more, fewer, or different ways of performing memory address calculations.

[0242] Extended operation field 2550 - its contents identify which of a variety of different operations should be performed in addition to the basic operations. This field is context specific. In one embodiment of the invention, this field is split into a class field 2568, an alpha field 2552, and a beta field 2554. The extended operation field 2550 allows a common group of operations to be performed in a single instruction rather than two, three, or four instructions.

[0243] Scale field 2560 - its contents are the scale factor for memory address generation (for example, 2 スケール * Allows scaling of the contents of the index field (for address generation using index+base).

[0244] Displacement field 2562A - its contents are used as part of memory address generation (e.g., 2 スケール * Used for address generation using index + base + displacement.

[0245] Displacement factor field 2562B (note that the juxtaposition of displacement field 2562A directly above displacement factor field 2562B indicates that one or the other is used) - its contents are used as part of address generation, it specifies the displacement factor to be scaled by the size of the memory access (N) - N may be (e.g., 2 スケール*The number of bytes in a memory access (for address generation using index+base+scaled displacement). Redundant low-order bits are ignored, so the content of the displacement factor field is multiplied by the total size of the memory operands (N) to generate the final displacement to be used in calculating the effective address. The value of N is determined by the processor hardware at run-time based on the full opcode field 2574 and the data manipulation field 2554C (described later in this specification). The displacement field 2562A and the displacement factor field 2562B are optional in the sense that they are not used for the no memory access 2519 instruction templates and / or different embodiments may implement only one of the two or neither of the two.

[0246] Data element width field 2564 - its contents identify which of multiple data element widths should be used (in some embodiments for all instructions, in other embodiments for only 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 using some aspect of the opcode.

[0247] Write mask field 2570 - its contents control whether, based on the data element position, that data element position in the destination vector operand reflects the result of the basic and extended operations. Class A instruction templates support a merging write mask, and class B instruction templates support both a merging write mask and a zeroing write mask. When merged, the vector mask allows any set of elements in the destination tile to be protected from updates during the execution of any operation (specified by the basic and extended operations), and in one embodiment preserves the old value of each element in the destination whose corresponding mask bit has a zero. In contrast, zeroing the vector mask allows any set of elements in the destination to be zeroed during the execution of any operation (specified by the basic and extended operations), and in one embodiment sets an element in the destination to zero when its corresponding mask bit has a value of zero. A subset of this functionality is the ability to control the vector length of the operation being performed (i.e., the range of elements being modified, from the first element to the last element), although the elements being modified need not be contiguous. The write mask field 2570 thus allows for partial vector operations including loads, stores, arithmetic, logical, etc. Although embodiments of the invention are described in which the contents of the write mask field 2570 select one of several write mask registers that contain the write mask to be used (and thus the contents of the write mask field 2570 indirectly identify the masking to be performed), alternative embodiments allow the contents of the write mask field 2570 to instead or in addition directly specify the masking to be performed.

[0248] Immediate field 2572 - its contents allow for the specification of an immediate value. This field is optional in the sense that it is not present in an implementation of the generic vector friendly format that does not support immediate values, and is not present in instructions that do not use immediate values.

[0249] Class field 2568 - its contents distinguish between different classes of instructions. With reference to Figures 25C-25D, the contents of this field select between class A and class B instructions. In Figures 25C-25D, rounded rectangles are used to indicate that a particular value is present in the field (e.g., class A 2568A and class B 2568B for class field 2568, respectively, in Figures 25C-25D).

[0250] [Class A instruction template] For class A no memory access 2519 instruction templates, the alpha field 2552 is interpreted as an RS field 2552A whose contents identify which of the different extended operation types is to be performed (e.g., round 2552A.1 and data transform 2552A.2 are specified for the no memory access, full round type operation 2517 and no memory access, data transform type operation 2518 instruction templates, respectively), and the beta field 2554 identifies which of the specified types of operations is to be performed. The scale field 2560, displacement field 2562A, and displacement scale field 2562B are not present in the no memory access 2519 instruction templates.

[0251] [Non-memory access instruction template - Fully rounded control type operation] In the no memory access full round control type operation 2517 instruction template, the beta field 2554 is interpreted as a rounding control field 2554A whose contents provide static rounding. In the described embodiment of the invention, the rounding control field 2554A includes a full floating-point exception suppression (SAE) field 2556 and a rounding operation control field 2558, although alternative embodiments may encode both of these concepts in the same field or may only have one or the other of these concepts / fields (e.g., may only have the rounding operation control field 2558).

[0252] SAE field 2556 - its contents distinguish whether exception event reporting should be disabled or not; when the contents of SAE field 2556 indicate that suppression is enabled, the given instruction will not report any floating-point exception flags of any kind and will not generate any floating-point exception handlers.

[0253] Rounding operation control field 2558 - its contents identify which rounding operation of a group of rounding operations (e.g., round up, round down, round towards zero, and round to nearest) to perform. Thus, the rounding operation control field 2558 allows the rounding mode to be changed based on the instruction. In one embodiment of the invention where the processor includes a control register for specifying the rounding mode, the content of the rounding operation control field 2558 overrides that register value.

[0254] [Non-memory access instruction template - data conversion type operation] In the no memory access data transform type operation 2518 instruction template, the beta field 2554 is interpreted as a data transform field 2554B, the contents of which identify which of multiple data transforms (e.g., no data transform, swizzle, broadcast) should be performed.

[0255] For memory access 2520 instruction templates of class A, the alpha field 2552 is interpreted as an eviction hint field 2552B, the content of which identifies which of a number of eviction hints should be used (in FIG. 25C, temporal 2552B.1 and non-temporal 2552B.2 are specified for the memory access, temporal 2525 instruction template and the memory access, non-temporal 2530 instruction template, respectively), and the beta field 2554 is interpreted as a data manipulation field 2554C, the content of which identifies which of a number of data manipulation operations (also known as primitives) should be performed (e.g., no operation, broadcast, up-conversion of source, and down-conversion of destination). The memory access 2520 instruction templates include a scale field 2560, and possibly a displacement field 2562A or a displacement scale field 2562B.

[0256] Vector memory instructions perform vector loads from memory and vector stores to memory, with conversion support. Like regular vector instructions, vector memory instructions transfer data to and from memory on a data element by data element basis, with the actual elements transferred being determined by the contents of the vector mask selected as the write mask.

[0257] [Memory access instruction template - temporary] Transient data is data that is likely to be reused quickly enough to benefit from caching. However, this is a hint, and different processors may implement it in different ways, including ignoring the hint entirely.

[0258] [Memory access instruction template - non-temporal] Non-temporal data is data that is unlikely to be reused fast enough to benefit from caching in the first level cache and should be prioritized for eviction. However, this is a hint, and different processors may implement it in different ways, including ignoring the hint entirely.

[0259] [Class B instruction template] For class B instruction templates, the alpha field 2552 is interpreted as a light mask control (Z) field 2552C, whose content distinguishes whether the light masking controlled by the light mask field 2570 should be merging or zeroing.

[0260] For class B no memory access 2519 instruction templates, a portion of the beta field 2554 is interpreted as an RL field 2557A, whose contents identify which of the different extended operation types is to be performed (e.g., round 2557A.1 and vector length (VSIZE) 2557A.2 are specified for the no memory access, write mask control, partial round control type operation 2522 instruction template and the no memory access, write mask control, VSIZE type operation 2523 instruction template, respectively), and the remainder of the beta field 2554 identifies which of the specified types of operations is to be performed. The scale field 2560, displacement field 2562A, and displacement scale field 2562B are not present in the no memory access 2519 instruction templates.

[0261] In the no memory access, write mask control, partial round control type operation 2522 instruction template, the remainder of the beta field 2554 is interpreted as a round operation control field 2559A and exception event reporting is disabled (the given instruction does not report any kind of floating-point exception flags or generate any floating-point exception handlers).

[0262] Rounding operation control field 2559A - like the rounding operation control field 2558, its contents identify which rounding operation of a group of rounding operations (e.g., round up, round down, round towards zero, and round to nearest) to perform. Thus, the rounding operation control field 2559A allows the rounding mode to be changed based on the instruction. In one embodiment of the invention where the processor includes a control register for specifying the rounding mode, the content of the rounding operation control field 2559A overrides that register value.

[0263] In the no memory access, write mask control, VSIZE type operation 2523 instruction template, the remainder of the beta field 2554 is interpreted as a vector length field 2559B, whose contents identify which of a number of data vector lengths (e.g., 128, 256, or 512 bytes) should be executed.

[0264] For class B memory access 2520 instruction templates, a portion of the beta field 2554 is interpreted as a broadcast field 2557B, whose contents distinguish whether a broadcast-type data manipulation operation is to be performed or not, and the remainder of the beta field 2554 is interpreted as a vector length field 2559B. The memory access 2520 instruction templates include a scale field 2560 and, possibly, a displacement field 2562A or a displacement scale field 2562B.

[0265] With respect to the generic vector friendly instruction format 2516, a full opcode field 2574 is shown that includes a format field 2540, a basic operation field 2542, and a data element width field 2564. One embodiment is shown in which the full opcode field 2574 includes all of these fields, although the full opcode field 2574 includes less than all of these fields in embodiments that do not support all of them. The full opcode field 2574 provides an operation code (opcode).

[0266] The extended operation field 2550, data element width field 2564, and write mask field 2570 allow these features to be specified on a per-instruction basis in a generic vector friendly instruction format.

[0267] The combination of the write mask field and the data element width field create a typed instruction in that they allow masks to be applied based on different data element widths.

[0268] The different instruction templates found in class A and class B are useful 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 classes. For example, a high performance general purpose out-of-order core intended for general purpose computing may support only class B, a core intended primarily for graphics and / or scientific (throughput) computing may support only class A, and a core intended for both may support both (of course, cores having some mix of templates and instructions from both classes, but not necessarily all templates and instructions from both classes, are within the scope of the invention). Also, a single processor may contain multiple cores, all of which support the same class, or different cores therein support different classes. For example, in a processor with separate graphics and general purpose cores, one of the multiple graphics cores intended primarily for graphics and / or scientific computing may support only class A, and 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 that does not have a separate graphics core may include another general-purpose in-order or out-of-order core that supports both class A and class B. Of course, features from one class may also be implemented in other classes in different embodiments of the invention. Programs written in high-level languages ​​can be put into a variety of different executable formats (e.g., just-in-time compiled or statically compiled), including 1) a format that has only instructions of classes supported by the target processor for execution, or 2) a format that has alternative routines written using different combinations of instructions of all classes, with control flow code that selects which routine to execute based on the instructions supported by the processor currently executing the code.

[0269] [Example Special Vector Friendly Instruction Format] FIG. 26A is a block diagram illustrating an exemplary special vector friendly instruction format according to an embodiment of the present invention. FIG. 26A illustrates a special vector friendly instruction format 2600 that is special in the sense that it specifies the location, size, interpretation, and order of fields, as well as the values ​​of some of those fields. The special vector friendly instruction format 2600 may be used to extend the x86 instruction set, and thus some fields are similar or the same as those used in the existing x86 instruction set and its extensions (e.g., AVX). The format remains consistent with the prefix encoding field, actual opcode byte field, MOD R / M field, SIB field, displacement field, and immediate field of the existing x86 instruction set with the extensions. The fields of FIG. 25C-D to which the fields of FIG. 26A are mapped are illustrated.

[0270] Although embodiments of the invention are described with reference to the specific vector friendly instruction format 2600 in the context of the generic vector friendly instruction format 2516 for illustrative purposes, it should be understood that the invention is not limited to the specific vector friendly instruction format 2600 except as claimed. For example, the generic vector friendly instruction format 2516 contemplates a variety of possible sizes for various fields, while the specific vector friendly instruction format 2600 is illustrated as having fields of specific sizes. As a specific example, although the data element width field 2564 is illustrated as a one-bit field in the specific vector friendly instruction format 2600, the invention is not so limited (i.e., the generic vector friendly instruction format 2516 contemplates other sizes for the data element width field 2564).

[0271] The special vector friendly instruction format 2600 includes the following fields, listed below in the order shown in FIG. 26A:

[0272] EVEX Prefix (bytes 0 to 3) 2602 - Encoded in 4-byte format.

[0273] Format Field 2540 (EVEX Byte 0, bits [7:0]) - The first byte (EVEX Byte 0) is the format field 2540, which contains 0x62 (a unique value used to identify a vector friendly instruction format in one embodiment of the invention).

[0274] The second through fourth bytes (EVEX bytes 1 through 3) contain several bit fields that provide specific functionality.

[0275] REX field 2605 (EVEX byte 1, bits [7-5]) - consists of the EVEX.R bit field (EVEX byte 1, bit [7] - R), the EVEX.X bit field (EVEX byte 1, bit [6] - X), and the EVEX.B bit field (EVEX byte 1, bit [5] - B). The EVEX.R, EVEX.X, and EVEX.B bit fields serve the same function as the corresponding VEX bit fields and are encoded using one's complement format, 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 (rrr, xxx, and bbb) as known in the art, so that Rrrr, Xxxx, and Bbbb may be formed by appending EVEX.R, EVEX.X, and EVEX.B.

[0276] REX' 2610A - This is the first part of the REX' field 2610, and is the EVEX.R' bit field (EVEX byte 1, bit [4]-R') that is used to encode either the top 16 or the bottom 16 of the extended 32 register set. In one embodiment of the invention, this bit, along with other bits shown below, are stored in a bit-reversed format to distinguish (in the well-known x86 32-bit mode) from the BOUND instruction, whose actual opcode byte is 62, but the MOD R / M field (described below) does not accept a value of 11 in the MOD field, and an alternative embodiment of the invention does not store this and the other bits shown below in an inverted format. A value of 1 is used to encode the bottom 16 registers. In other words, R'Rrrr is formed by combining EVEX.R', EVEX.R, and the other RRR from the other fields.

[0277] Opcode map field 2615 (EVEX byte 1, bits [3:0]-mmmm)--its contents encode the implied preceding opcode byte (0F, 0F38, or 0F3).

[0278] Data Element Width field 2564 (EVEX byte 2, bit [7] - W) - represented by the symbol EVEX.W. EVEX.W is used to define the granularity (size) of the data type (32-bit data elements or 64-bit data elements).

[0279] EVEX.vvvv 2620 (EVEX byte 2, bits [6:3] - vvvv) - The role of EVEX.vvvv may include: 1) EVEX.vvvv encodes the first source register operand specified in inverted (one's complement) form and is valid for instructions with two or more source operands. 2) EVEX.vvvv encodes the destination register operand specified in one's complement form for some vector shifts. 3) EVEX.vvvv does not encode any operand, the field is reserved and should contain 1111b. Thus, EVEX.vvvv field 2620 encodes the lower 4 bits of the first source register specifier stored in inverted (one's complement) form. Depending on the instruction, further different EVEX bit fields are used to extend the specifier size to 32 registers.

[0280] EVEX.U2568 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.

[0281] Prefix encoding field 2625 (EVEX byte 2, bits [1:0]-pp) - provides additional bits to the basic operation field. In addition to providing support for legacy SSE instructions in EVEX prefix format, this also has the advantage of compressing the SIMD prefix (rather than requiring one byte to represent the SIMD prefix, the EVEX prefix only requires two bits). In one embodiment, to support legacy SSE instructions that use 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 expanded at runtime to the legacy SIMD prefix before being provided to the decoder's PLA (so that the PLA can execute both the 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 extend them in a similar manner for consistency but allow different meanings to be specified by these legacy SIMD prefixes. Alternate embodiments can redesign the PLA to support 2-bit SIMD prefix encodings and thus not require the extension.

[0282] Alpha Field 2552 (EVEX byte 3, bit [7] - EH, also known as EVEX.EH, EVEX.rs, EVEX.RL, EVEX.writemaskcontrol, and EVEX.N, and denoted by α) - As stated above, this field is context specific.

[0283] Beta field 2554 (EVEX byte 3, bits [6:4] - SSS, EVEX.s 2-0 , EVEX.r 2-0 , EVEX.rr1, EVEX.LL0, EVEX.LLB, and denoted by βββ) - as stated above, this field is context specific.

[0284] REX' 2610B - This is the remainder of the REX' field 2610 and is the EVEX.V' bit field (EVEX byte 3, bit [3] - V') which may be used to encode either the top 16 or the bottom 16 of the extended 32 register set. This bit is stored in bit-reversed format. A value of 1 is used to encode the bottom 16 registers. In other words, V'VVVV is formed by concatenating EVEX.V' and EVEX.vvvv.

[0285] Write mask field 2570 (EVEX byte 3, bits [2:0]-kkk) - its contents specify the index of a register in the write mask register as described above. In one embodiment of the invention, the unique value EVEX.kkk=000 has special behavior that means no write mask is used for the particular instruction (this may be implemented in a variety of ways, including using a write mask that is hardwired to everything or in hardware that bypasses the masking hardware).

[0286] The real opcode field 2630 (byte 4) is also known as the opcode byte. Part of the opcode is specified in this field.

[0287] MOD R / M field 2640 (byte 5) includes MOD field 2642, Reg field 2644, and R / M field 2646. As previously mentioned, the contents of MOD field 2642 distinguish between memory access and non-memory access operations. The role of Reg field 2644 can be summarized in two situations: either encoding a destination register operand or a source register operand, or it is treated as an opcode extension and is not used to encode any instruction operand. The role of R / M field 2646 may include the following: encoding an instruction operand that references a memory address, or encoding either a destination register operand or a source register operand.

[0288] Scale, Index, Base (SIB) Byte (Byte 6) - As previously described, the contents of the scale field 2560 are used in memory address generation. SIB.xxx 2654 and SIB.bbb 2656 - The contents of these fields were previously referenced in terms of the register indices Xxxx and Bbbb.

[0289] Displacement Field 2562A (Bytes 7-10) - When the MOD field 2642 contains 10, bytes 7 through 10 are the displacement field 2562A, which functions the same as the legacy 32-bit displacement (disp32), and works at byte granularity.

[0290] Displacement Factor Field 2562B (Byte 7) - When the MOD field 2642 contains 01, byte 7 is the displacement factor field 2562B. The location of this field is the same as that of the 8-bit displacement (disp8) in the legacy x86 instruction set, which works at byte granularity. Since disp8 is sign-extended, it can only address between -128 and 127 byte offsets, and for 64-byte cache lines, disp8 uses 8 bits that can only be set to four really useful values ​​-128, -64, 0, and 64, and since a larger range is often needed, disp32 is used, but disp32 requires 4 bytes. In contrast to disp8 and disp32, the displacement factor field 2562B is a reinterpretation of disp8, and when using the displacement factor field 2562B, the actual displacement is determined by the contents of the displacement factor field multiplied by the size of the memory operand access (N). This type of displacement is called disp8*N. This results in a shorter average instruction length (a single byte used for displacement, but with a much larger range). Such a compressed displacement is based on the assumption that the effective displacement is a multiple of the granularity of the memory access, and therefore the redundant low-order bits of the address offset do not need to be encoded. In other words, the displacement factor field 2562B replaces the 8-bit displacement of the legacy x86 instruction set. The displacement factor field 2562B is therefore encoded in the same way as the 8-bit displacement of the x86 instruction set, with the only exception that disp8 is overloaded to disp8*N (so there is no change in the ModRM / SIB encoding rules). In other words, there is no change in the encoding rules or encoding length, but 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 get the address offset in bytes). The immediate field 2572 works as described above.

[0291] [Full Opcode Field] 26B is a block diagram illustrating the fields of the special vector friendly instruction format 2600 that make up the full opcode field 2574, according to one embodiment of the invention. Specifically, the full opcode field 2574 includes a format field 2540, a base operation field 2542, and a data element width (W) field 2564. The base operation field 2542 includes a prefix encoding field 2625, an opcode map field 2615, and a real opcode field 2630.

[0292] [Register index field] 26C is a block diagram illustrating the fields of the special vector friendly instruction format 2600 that make up the register index field 2544, in accordance with one embodiment of the invention. Specifically, the register index field 2544 includes a REX field 2605, a REX′ field 2610, a MODR / M.reg field 2644, a MODR / Mr / m field 2646, a VVVV field 2620, a xxx field 2654, and a bbb field 2656.

[0293] [Extended computed field] 26D is a block diagram illustrating the fields of the special vector friendly instruction format 2600 that make up the extended operation field 2550, according to one embodiment of the invention. When the class (U) field 2568 contains a 0, it means EVEX.U0 (Class A 2568A), and when it contains a 1, it means EVEX.U1 (Class B 2568B). When U=0 and the MOD field 2642 contains 11 (signifying a non-memory access operation), the alpha field 2552 (EVEX byte 3, bit [7] - EH) is interpreted as the rs field 2552A. When the rs field 2552A contains a 1 (round 2552A.1), the beta field 2554 (EVEX byte 3, bits [6:4] - SSS) is interpreted as the rounding control field 2554A. The rounding control field 2554A includes a 1-bit SAE field 2556 and a 2-bit rounding operation control field 2558. When the rs field 2552A contains a 0 (data transformation 2552A.2), the beta field 2554 (EVEX byte 3, bits [6:4] - SSS) is interpreted as a 3-bit data transformation field 2554B. When U=0 and the MOD field 2642 contains 00, 01, or 10 (signifying a memory access operation), the alpha field 2552 (EVEX byte 3, bits [7] - EH) is interpreted as an eviction hint (EH) field 2552B and the beta field 2554 (EVEX byte 3, bits [6:4] - SSS) is interpreted as a 3-bit data manipulation field 2554C.

[0294] When U=1, the alpha field 2552 (EVEX byte 3, bit [7]—EH) is interpreted as a write mask control (Z) field 2552C. When U=1 and the MOD field 2642 contains 11 (signifying a non-memory access operation), a portion of the beta field 2554 (EVEX byte 3, bit [4]—S0) is interpreted as the RL field 2557A, and when it contains 1 (round 2557A.1), the remainder of the beta field 2554 (EVEX byte 3, bits [6-5]—S 2-1) is interpreted as the rounding operation control field 2559A, and when the RL field 2557A contains zero (VSIZE2557.A2), the remainder of the beta field 2554 (EVEX byte 3, bits [6-5]-S 2-1 ) is the vector length field 2559B (EVEX byte 3, bits [6-5]-L 1-0 When U=1 and the MOD field 2642 contains 00, 01, or 10 (denoting a memory access operation), the beta field 2554 (EVEX byte 3, bits [6:4] - SSS) is interpreted as the vector length field 2559B (EVEX byte 3, bits [6-5] - L 1-0 ) and broadcast field 2557B (EVEX byte 3, bit [4]-B).

[0295] [Example Register Architecture] Figure 27 is a block diagram of a register architecture 2700 according to one embodiment of the invention. In the illustrated embodiment, there are 32 vector registers 2710 that are 512 bits wide, and these registers are referenced as zmm0 through zmm31. The lower 256 bits of the lower 16 zmm registers overlap with registers ymm0 through 15. The lower 128 bits of the lower 16 zmm registers (the lower 128 bits of the ymm registers) overlap with registers xmm0 through 15. The special vector friendly instruction format 2600 operates on these overlapping register files, as shown in the table below. [Table 1]

[0296] In other words, the vector length field 2559B selects between a maximum length and one or more other shorter lengths, each such shorter length being half the length of the preceding length, and instruction templates without the vector length field 2559B handle the maximum vector length. Furthermore, in one embodiment, the class B instruction templates of the special vector friendly instruction format 2600 handle packed or scalar single / double precision floating point data and packed or scalar integer data. Scalar operations are operations performed on the lowest data element positions in zmm / ymm / xmm registers, with the higher data element positions remaining the same as they were before the instruction or being zeroed out, depending on the embodiment.

[0297] Write Mask Registers 2715 - In the illustrated embodiment, there are eight write mask registers (k0 through k7), each 64 bits in size. In an alternative embodiment, the write mask registers 2715 are 16 bits in size. As previously mentioned, in one embodiment of the invention, vector mask register k0 cannot be used as a write mask, and when an encoding that would normally indicate k0 is used for a write mask, a hardwired write mask of 0xFFFF is selected, effectively disabling write masking for that instruction.

[0298] General purpose registers 2725 - in the illustrated embodiment, there are sixteen 64-bit general purpose registers that are used with the existing x86 addressing modes to address memory operands. These registers are referenced by the names RAX, RBX, RCX, RDX, RBP, RSI, RDI, RSP, and R8 through R15.

[0299] Scalar floating-point stack register file (x87 stack) 2745, which aliases MMX packed integer flat register file 2750; in the illustrated embodiment, the x87 stack is an 8-element stack used to perform scalar floating-point operations on 32 / 64 / 80-bit floating-point data using the x87 instruction set extensions, and the MMX registers are used to perform operations on 64-bit packed integer data, as well as to hold operands for some operations performed between MMX and XMM registers.

[0300] Alternate embodiments of the invention may use wider or narrower registers. Additionally, alternative embodiments of the invention may use more, fewer, or different register files and registers.

[0301] [Exemplary Core Architectures, Processors, and Computer Architectures] Processor cores may be implemented in different ways, for different purposes, and in different processors. For example, implementations of such cores may include: 1) general-purpose in-order cores for general-purpose computing; 2) high-performance general-purpose out-of-order cores for general-purpose computing; 3) specialized cores primarily for graphics and / or scientific (throughput) computing. Various processor implementations may include: 1) CPUs including one or more general-purpose in-order cores for general-purpose computing and / or one or more general-purpose out-of-order cores for general-purpose computing; and 2) coprocessors including one or more specialized cores primarily for graphics and / or scientific (throughput). Such various processors result in various computer system architectures, which may include: 1) coprocessors on a separate chip from the CPU; 2) coprocessors on a separate die in the same package as the CPU; 3) coprocessors on the same die as the CPU (in which case such coprocessors may be referred to as specialized logic, such as integrated graphics and / or scientific (throughput) logic, or specialized cores); and 4) systems-on-chips that may include the described CPU, the coprocessors mentioned above, and additional functionality on the same die (sometimes referred to as application cores or application processors). An exemplary core architecture is described next, followed by a description of an exemplary processor and computer architecture.

[0302] [Example Core Architecture] [Block diagram of in-order and out-of-order cores] FIG. 28A is a block diagram illustrating both an exemplary in-order pipeline and an exemplary register renaming, out-of-order issue / execution pipeline, according to an embodiment of the present invention. FIG. 28B is a block diagram illustrating both an exemplary embodiment of an in-order architecture core to be included in a processor, and an exemplary register renaming, out-of-order issue / execution architecture core, according to an embodiment of the present invention. The solid lined boxes in FIG. 28A-B show the in-order pipeline and the in-order core, while the optional addition of dashed lined boxes shows the register renaming, out-of-order issue / execution pipeline and the core. The out-of-order aspects will be described assuming that the in-order aspects are a subset of the out-of-order aspects.

[0303] In FIG. 28A , the processor pipeline 2800 includes a fetch stage 2802, a length decode stage 2804, a decode stage 2806, an allocation stage 2808, a renaming stage 2810, a scheduling stage 2812 (also known as dispatch or issue), a register read / memory read stage 2814, an execution stage 2816, a writeback / memory write stage 2818, an exception handling stage 2822, and a commit stage 2824.

[0304] 28B shows a processor core 2890 including a front end unit 2830 coupled to an execution engine unit 2850, both coupled to a memory unit 2870. Core 2890 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. As yet another option, core 2890 may be a special-purpose core, such as, for example, a network or communication core, a compression engine, a co-processor core, a general purpose computing graphics processing unit (GPGPU) core, a graphics core, etc.

[0305] The front-end unit 2830 includes a branch prediction unit 2832 coupled to an instruction cache unit 2834 coupled to an instruction translation lookaside buffer (TLB) 2836 coupled to an instruction fetch unit 2838 coupled to send fetched instructions 2839 to a decode unit 2840. The decode unit 2840 (or decoder) may decode instructions and generate as output one or more decoded instructions 2841, or micro-operations, microcode entry points, microinstructions, other instructions, or other control signals that are decoded from or otherwise reflect or are derived from the original instructions. The decode unit 2840 may be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to, lookup tables, hardware implementations, programmable logic arrays (PLAs), microcode read only memories (ROMs), and the like. In one embodiment, core 2890 includes a microcode ROM or other medium that stores microcode for some macro-instructions (e.g., within decode unit 2840 or otherwise within front-end unit 2830). Decode unit 2840 is coupled to a rename / allocator unit 2852 within execution engine unit 2850.

[0306] The execution engine units 2850 include a rename / allocator unit 2852 coupled to a retirement unit 2854 and a set of one or more scheduler units 2856. The scheduler units 2856 represent any number of various schedulers, including reservation stations, central instruction windows, and the like. The scheduler units 2856 are coupled to physical register file units 2858. Each of the physical register file units 2858 represents one or more physical register files, the different files storing one or more different data types, such as scalar integer, scalar floating point, packed integer, packed floating point, vector integer, vector floating point, status (e.g., an instruction pointer, which is the address of the next instruction to be executed). In one embodiment, the physical register file units 2858 comprise a vector register unit, a write mask register unit, and a scalar register unit. These register units may provide architectural vector registers, vector mask registers, and general purpose registers. The physical register files unit 2858 overlaps with the retirement unit 2854 to illustrate various ways in which register renaming and out-of-order execution may be implemented (e.g., using a reorder buffer and a retirement register file, using a future file, a history buffer, and a retirement register file, using a register map and a pool of registers, etc.). The retirement unit 2854 and the physical register files unit 2858 are coupled to the execution clusters 2860. The execution clusters 2860 include a set of one or more execution units 2862 and a set of one or more memory access units 2864. The execution units 2862 can perform various operations (e.g., shift, add, subtract, multiply) on various types of data (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point).Some embodiments may include several execution units dedicated to a particular function or set of functions, while other embodiments may include just one execution unit or multiple execution units that all perform all functions. The scheduler unit 2856, physical register file unit 2858, and execution clusters 2860 are shown as possibly multiple, as some embodiments create separate pipelines for several types of data / operations (scalar integer pipeline, scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipeline, and / or memory access pipeline, each with its own scheduler unit, physical register file unit, and / or execution cluster - in the case of a separate memory access pipeline, some embodiments are implemented where only the execution cluster of this pipeline has a memory access unit 2864). It should also be understood that if separate pipelines are used, one or more of these pipelines may be out-of-order issue / execution and the rest in-order.

[0307] The set of memory access units 2864 is coupled to a memory unit 2870 that includes a data TLB unit 2872 coupled to a data cache unit 2874 coupled to a level 2 (L2) cache unit 2876. In an exemplary embodiment, the memory access units 2864 may include a load unit, a store address unit, and a store data unit, each of which is coupled to the data TLB unit 2872 in the memory unit 2870. The instruction cache unit 2834 is further coupled to a level 2 (L2) cache unit 2876 in the memory unit 2870. The L2 cache unit 2876 is coupled to one or more other levels of cache and ultimately to a main memory.

[0308] By way of example, an exemplary register renaming, out-of-order issue / execution core architecture may implement the pipeline 2800 as follows: 1) instruction fetch 2838 performs the fetch stage 2802 and the length decode stage 2804; 2) decode unit 2840 performs the decode stage 2806; 3) rename / allocator unit 2852 performs the allocation stage 2808 and the renaming stage 2810; 4) scheduler unit 2856 performs the schedule stage 2812; 5) physical register file unit 2858 and memory unit 2870 perform the register read / memory read stage 2814, and execution cluster 2860 performs the execute stage 2816; 6) memory unit 2870 and physical register file unit 2858 perform the writeback / memory write stage 2818; 7) various units may be involved in the exception handling stage 2822. 8) The retirement unit 2854 and the physical register file unit 2858 perform the commit stage 2824.

[0309] Core 2890 may support one or more instruction sets (e.g., the x86 instruction set (with some extensions added in newer versions), the MIPS instruction set from MIPS Technologies of Sunnyvale, Calif., the ARM instruction set (with optional additional extensions such as NEON) from ARM Holdings of Sunnyvale, Calif.), including the instructions described herein. In one embodiment, core 2890 includes logic to support packed data instruction set extensions (e.g., AVX1, AVX2), which allows operations used by many multimedia applications to be performed using packed data.

[0310] Cores may support multithreading (the execution of two or more parallel sets of operations or threads) in a variety of ways, including time sliced ​​multithreading, simultaneous multithreading (wherein a single physical core provides a logical core for each of the threads that the physical core is multithreading simultaneously), or a combination thereof (e.g., time sliced ​​fetch and decode and then simultaneous multithreading, such as in Intel® Hyper-Threading Technology).

[0311] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming may also be used in in-order architectures. The illustrated embodiment of the processor also includes separate instruction and data cache units 2834 / 2874 and a shared L2 cache unit 2876, although 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 cache. In some embodiments, the system may include a combination of an internal cache and an external cache that is external to the core and / or processor. Alternatively, all of the caches may be external to the core and / or processor.

[0312] [Specific Exemplary In-Order Core Architecture] 29A-29B show block diagrams of a more specific exemplary in-order core architecture, where the core is one of several logic blocks (including other cores of the same and / or different types) in a chip. The logic block communicates with some fixed function logic, memory I / O interfaces, and other necessary I / O logic over a high bandwidth interconnect network (e.g., a ring network) depending on the application.

[0313] FIG. 29A is a block diagram of a single processor core with its connection to an on-die interconnect network 2902 and its local subset of a level 2 (L2) cache 2904, in accordance with an embodiment of the invention. In one embodiment, the instruction decoder 2900 supports the x86 instruction set with the packed data instruction set extension. The L1 cache 2906 allows low latency accesses to cache memory into the scalar and vector units. In one embodiment (to simplify the design), the scalar unit 2908 and the vector unit 2910 use separate register sets (scalar registers 2912 and vector registers 2914, respectively), with data transferred between them being written to memory and then read back from the level 1 (L1) cache 2906, although 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 transferred between the two register files without writes and readbacks).

[0314] The local subsets of the L2 cache 2904 are part of a global L2 cache that is divided into separate local subsets, one per processor core. Each processor core has a direct access path to its own local subset of the L2 cache 2904. Data read by a processor core is stored in its L2 cache subset 2904 and can be accessed quickly, in parallel with other processor cores accessing their own local L2 cache subsets. Data written by a processor core is stored in its own L2 cache subset 2904 and is flushed from other subsets when necessary. The 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 per direction.

[0315] Figure 29B is an expanded view of a portion of the processor core of Figure 29A, according to an embodiment of the invention. Figure 29B includes an L1 data cache 2906A, which is part of the L1 cache 2906, as well as further details regarding the vector unit 2910 and vector registers 2914. Specifically, the vector unit 2910 is a 16-wide vector processing unit (VPU) that executes one or more of integer, single precision floating point, and double precision floating point instructions (see 16-wide ALU 2928). The VPU supports swizzling of register inputs by swizzle unit 2920, numeric conversion by numeric conversion units 2922A-B, and replication on memory inputs by replication unit 2924. A write mask register 2926 allows prediction of resulting vector writes.

[0316] Figure 30 is a block diagram of a processor 3000 that may have two or more cores, may have an integrated memory controller, and may have integrated graphics, in accordance with an embodiment of the present invention. The solid lined box in Figure 30 illustrates a processor 3000 having a single core 3002A, a system agent 3010, and a set of one or more bus controller units 3016, while the optional addition of dashed lined boxes illustrates an alternative processor 3000 having multiple cores 3002A-N, a set of one or more integrated memory controller units 3014 in the system agent unit 3010, and dedicated logic 3008.

[0317] Various implementations of the processor 3000 may thus include: 1) a CPU with special purpose logic 3008 that is integrated graphics and / or scientific (throughput) logic (which may include one or more cores), and one or more general purpose cores 3002A-N (e.g., general purpose in-order cores, general purpose out-of-order cores, a combination of the two); 2) a coprocessor with many special purpose cores 3002A-N primarily for graphics and / or scientific (throughput); and 3) a coprocessor with many general purpose in-order cores 3002A-N. Thus, the processor 3000 may be a general purpose processor, coprocessor, or special purpose processor, such as, for example, a network or communication processor, a compression engine, a graphics processor, a GPGPU (general purpose graphics processing unit), a high throughput multiple integrated core (MIC) coprocessor (including 30 or more cores), an embedded processor, etc. The processor may be implemented on one or more chips. The processor 3000 may be a part of and / or be implemented on one or more substrates using any of a number of process technologies, such as, for example, BiCMOS, CMOS, or NMOS.

[0318] The memory hierarchy includes one or more levels of cache within the cores, a set of one or more shared cache units 3006, and an external memory (not shown) coupled to a set of integrated memory controller units 3014. The set of shared cache units 3006 may include one or more intermediate level caches, such as a level 2 (L2), level 3 (L3), level 4 (L4), or other level cache, a last level cache (LLC), and / or combinations thereof. In one embodiment, a ring-based interconnect unit 3012 interconnects with integrated graphics logic 3008 (integrated graphics logic 3008 is an example of dedicated logic and is also referred to herein as dedicated logic), the set of shared cache units 3006, and the system agent unit 3010 / integrated memory controller unit 3014, although alternative embodiments may use any number of well-known techniques for interconnecting such units. In one embodiment, coherency is maintained between one or more cache units 3006 and the cores 3002A-N.

[0319] In some embodiments, one or more of the cores 3002A-N are capable of being multi-threaded. The system agent 3010 includes components that coordinate and operate the cores 3002A-N. The system agent unit 3010 may include, for example, a power control unit (PCU) and a display unit. The PCU may be or may include the logic and components necessary to coordinate the power state of the cores 3002A-N and the integrated graphics logic 3008. The display unit is for driving one or more externally connected displays.

[0320] The cores 3002A-N may be homogenous or heterogeneous with respect to architectural instruction sets, i.e., two or more of the cores 3002A-N may be capable of executing the same instruction set, while other cores may be capable of executing only a subset of that instruction set or a different instruction set.

[0321] [Example Computer Architecture] 31-34 are block diagrams of exemplary computer architectures. 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. In general, a wide variety of systems or electronic devices capable of incorporating the processors and / or other execution logic disclosed herein are generally suitable.

[0322] Referring now to Figure 31, a block diagram of a system 3100 is shown, according to one embodiment of the invention. The system 3100 may include one or more processors 3110, 3115 coupled to a controller hub 3120. In one embodiment, the controller hub 3120 includes a graphics memory controller hub (GMCH) 3190 and an input / output hub (IOH) 3150 (which may be on separate chips), where the GMCH 3190 includes a memory and graphics controller coupled to a memory 3140 and a coprocessor 3145, and the IOH 3150 couples input / output (I / O) devices 3160 to the GMCH 3190. Alternatively, one or both of the memory and graphics controller are integrated within the processor (as described herein), and the memory 3140 and coprocessor 3145 are directly coupled to the processor 3110 and controller hub 3120 in a single chip with the IOH 3150.

[0323] The optional features of the additional processor 3115 are denoted in Figure 31 by dashed lines. Each processor 3110, 3115 may include one or more of the processing cores described herein and may be some version of the processor 3000.

[0324] The memory 3140 may be, for example, dynamic random access memory (DRAM), phase change memory (PCM), or a combination of the two. For at least one embodiment, the controller hub 3120 communicates with the processors 3110, 3115 via a multi-drop bus such as a front side bus (FSB), a point-to-point interface such as a Quick Path Interconnect (QPI), or a similar connection 3195.

[0325] In one embodiment, the coprocessor 3145 is a special purpose 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. In one embodiment, the controller hub 3120 may include an integrated graphics accelerator.

[0326] There may be various differences between the physical resources 3110, 3115 with respect to a set of metrics of merit including architectural characteristics, microarchitectural characteristics, thermal characteristics, power consumption characteristics, and the like.

[0327] In one embodiment, the processor 3110 executes instructions that control general types of data processing operations. Coprocessor instructions may be embedded within the instructions. The processor 3110 recognizes these coprocessor instructions as the type of instructions to be executed by the attached coprocessor 3145. In response, the processor 3110 issues these coprocessor instructions (or control signals representing the coprocessor instructions) to the coprocessor 3145 on a coprocessor bus or other interconnect. The coprocessor 3145 accepts and executes the received coprocessor instructions.

[0328] Referring now to Figure 32, a block diagram of a first more specific exemplary system 3200 is shown, according to one embodiment of the present invention. As shown in Figure 32, the multiprocessor system 3200 is a point-to-point interconnect system and includes a first processor 3270 and a second processor 3280 coupled via a point-to-point interconnect 3250. Each of the processors 3270 and 3280 may be some version of the processor 3000. In one embodiment of the present invention, the processors 3270 and 3280 are processors 3110 and 3115, respectively, and the coprocessor 3238 is coprocessor 3145. In another embodiment, the processors 3270 and 3280 are processors 3110 and coprocessor 3145, respectively.

[0329] Processors 3270 and 3280 are shown including integrated memory controller (IMC) units 3272 and 3282, respectively. Processor 3270 also includes point-to-point (PP) interfaces 3276 and 3278 as part of its bus controller unit, and similarly, second processor 3280 includes PP interfaces 3286 and 3288. Processors 3270, 3280 can exchange information over point-to-point (PP) interface 3250 using PP interface circuits 3278, 3288. As shown in FIG. 32, IMCs 3272 and 3282 couple the processors to respective memories, i.e., memory 3232 and memory 3234, which may be part of a main memory locally connected to the respective processors.

[0330] Processors 3270, 3280 may each exchange information with chipset 3290 via individual PP interfaces 3252, 3254 using point-to-point interface circuits 3276, 3294, 3286, 3298. Chipset 3290 may optionally exchange information with coprocessor 3238 via high performance interface 3292. In one embodiment, coprocessor 3238 is a special purpose processor, such as, for example, a high throughput MIC processor, a network or communications processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, or the like.

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

[0332] Chipset 3290 may be coupled to a first bus 3216 via an interface 3296. In one embodiment, first bus 3216 may be a bus such as a Peripheral Component Interconnect (PCI) bus, or a PCI Express bus or another third generation I / O interconnect bus, although the scope of the invention is not so limited.

[0333] As shown in FIG. 32, various I / O devices 3214 may be coupled to the first bus 3216, along with a bus bridge 3218 coupling the first bus 3216 to the second bus 3220. In one embodiment, one or more additional processors 3215, such as a co-processor, a high throughput MIC processor, a GPGPU, an accelerator (e.g., a graphics accelerator or a digital signal processing (DSP) unit), a field programmable gate array, or any other processor, are coupled to the first bus 3216. In one embodiment, the second bus 3220 may be a low pin count (LPC) bus. In one embodiment, various devices may be coupled to the second bus 3220, including, for example, a keyboard and / or mouse 3222, a communication device 3227, and a storage unit 3228, such as a disk drive or other mass storage device, which may contain instructions / code and data 3230. Additionally, an audio I / O 3224 may be coupled to the second bus 3220. It should be noted that other architectures are possible. For example, instead of the point-to-point architecture of FIG. 32, the system may implement a multi-drop bus or other such architecture.

[0334] Referring now to Figure 33, there is shown a block diagram of a second, more specific, exemplary system 3300, in accordance with one embodiment of the present invention. Like elements in Figures 32 and 33 have like reference numbers, and some aspects of Figure 32 have been omitted from Figure 33 to avoid obscuring other aspects of Figure 33.

[0335] Figure 33 shows that processors 3270, 3280 may include integrated memory and I / O control logic ("CL") 3272 and 3282, respectively. Thus, CL 3272, 3282 includes an integrated memory controller unit and includes I / O control logic. Figure 33 shows that not only are memory 3232, 3234 coupled to CL 3272, 3282, but also I / O devices 3314 are coupled to control logic 3272, 3282. Legacy I / O devices 3315 are coupled to chipset 3290.

[0336] Referring now to FIG. 34, a block diagram of a SoC 3400 is shown according to one embodiment of the present invention. Similar elements in FIG. 30 have similar reference numbers. Also, the dashed boxes are optional features on more advanced SoCs. In FIG. 34, an interconnect unit 3402 is coupled to a set of one or more cores 3002A-N including cache units 3004A-N, and an application processor 3410 including a shared cache unit 3006, a system agent unit 3010, a bus controller unit 3016, an integrated memory controller unit 3014, a set of one or more coprocessors 3420 that may include integrated graphics logic, image processors, audio processors, and video processors, a static random access memory (SRAM) unit 3430, a direct memory access (DMA) unit 3432, and a display unit 3440 for coupling to one or more external displays. In one embodiment, the coprocessors 3420 include special purpose processors such as, for example, network or communication processors, compression engines, GPGPUs, high throughput MIC processors, embedded processors, etc.

[0337] The embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of such implementation means.Embodiments of the invention may be implemented as a computer program or program code executed on a programmable system comprising at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0338] Program code, such as code 3230 shown in Figure 32, may be applied to the input instructions to perform the functions described herein and to generate output information. The output information may be applied to one or more output devices, in known fashion. For purposes of this application, a processing system includes any system having a processor, such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0339] The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. The program code may also be implemented in assembly or machine language, if necessary. Indeed, the mechanisms described herein are not limited in scope to any particular programming language. In any case, the language may be a compiled or interpreted language.

[0340] One or more aspects of at least one embodiment may be implemented by representative instructions stored on a machine-readable medium that represent various logic within a processor, which, when read by a machine, causes the machine to assemble logic to perform the techniques described herein. Such representations, known as "IP cores," may be stored on tangible machine-readable media and supplied to various customers or manufacturing facilities for loading into manufacturing machines that actually produce the logic or processors.

[0341] Such machine-readable storage media may include, but are not limited to, non-transitory tangible configurations of articles manufactured or formed by a machine or device, including storage media such as hard disks, floppy disks, optical disks, compact disk-read only memory (CD-ROM), compact disk-rewriteable (CD-RW), and any other type of disk, including 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.

[0342] Accordingly, embodiments of the present invention also include non-transitory tangible machine-readable media that include instructions, such as in a Hardware Description Language (HDL), or that include design data that define the functionality of the structures, circuits, devices, processors, and / or systems described herein. Such embodiments may also be referred to as program products.

[0343] [Emulation (including binary conversion, code morphing, etc.)] In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may interpret, transform, emulate, or otherwise translate (e.g., using static binary translation, dynamic binary translation including dynamic compilation), instructions into one or more other instructions to be processed by the core. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on-processor, off-processor, or partially on-processor and partially off-processor.

[0344] FIG. 35 is a block diagram contrasting the use of a software instruction converter to convert binary instructions in a source instruction set to binary instructions in a target instruction set, according to an embodiment of the present invention. In the illustrated embodiment, the instruction converter is a software instruction converter, but alternatively, the instruction converter may be implemented in software, firmware, hardware, or various combinations thereof. FIG. 35 illustrates that a program in a high-level language 3502 may be compiled using an x86 compiler 3504 to generate x86 binary code 3506 that may be natively executed by a processor 3516 with at least one x86 instruction set core. A processor 3516 with at least one x86 instruction set core represents any processor that can perform substantially the same functions as an Intel processor with at least one x86 instruction set core by compatibly executing or possibly processing (1) a substantial portion of the instruction set of the Intel x86 instruction set core, or (2) object code versions of applications or other software intended to run on an Intel processor with at least one x86 instruction set core, to achieve substantially the same results as an Intel processor with at least one x86 instruction set core. x86 compiler 3504 represents a compiler operable to generate x86 binary code 3506 (e.g., object code) that can be executed, with or without additional linkage processing, on a processor 3516 having at least one x86 instruction set core. Similarly, Figure 35 illustrates that a program in a high-level language 3502 can be compiled using an alternative instruction set compiler 3508 to generate alternative instruction set binary code 3510 that can be natively executed by a processor 3514 that does not have at least one x86 instruction set core (e.g., a processor having a core that executes the MIPS instruction set from MIPS Technologies of Sunnyvale, Calif. and / or the ARM instruction set from ARM Holding of Sunnyvale, Calif.).The instruction converter 3512 is used to convert the x86 binary code 3506 into code that can be natively executed by a processor 3514 that does not have an x86 instruction set core. This converted code is unlikely to be the same as the alternative instruction set binary code 3510, because an instruction converter that would make this possible would be difficult to make, but the converted code performs common operations and is composed of instructions from the alternative instruction set. Thus, the instruction converter 3512 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 the x86 binary code 3506, via emulation, simulation, or any other process.

[0345] [More examples] Example 1 provides an exemplary single instruction multiple data (SIMD) processor comprising: a fetch circuit that fetches one or more instructions until a set of instructions is fetched, each instruction specifying a source and a destination tile operand; a decode circuit that decodes the fetched set of instructions; and an execution circuit that, in response to the decoded set of instructions, identifies first and second decoded instructions belonging to an instruction chain, dynamically selects and configures a SIMD path having first and second processing engines (PEs) that execute the first and second decoded instructions, and discards the specified destination of the first decoded instruction and instead sends a result of the decoded first instruction from the first PE to be used by the second PE to execute the second decoded instruction.

[0346] Example 2 includes the exemplary processor embodiment of Example 1, wherein the set of instructions comprises at least one instruction, each of the instruction chains further comprises a chain control field that causes the execution circuitry to determine that the instruction is part of a chain, each of the chain control fields indicating a chain position hint comprising one of a chain start hint, a chain middle hint, and a chain end hint to mark the last instruction in the chain, and the chain control field causes the execution circuitry to determine the existence of a chain, dynamically select and configure a SIMD path to execute the instruction chain, discard specified destinations of all instructions in the chain except the last, and send results of all instructions except the last to a PE that executes the next instruction in the chain.

[0347] Example 3 includes the example processor embodiment of Example 1, wherein the decoded first and second instructions specify different opcodes to specify different first and second arithmetic operations, and the selected first and second processing engines have limited functionality to specialize in the first and second arithmetic operations, respectively.

[0348] Example 4 includes the example processor embodiment of Example 2, wherein the first instruction of the instruction chain further comprises a chain control field, the chain control field comprising a chain header that identifies the first instruction and one or more subsequent instructions as being part of a chain or instruction.

[0349] Example 5 includes an implementation of the exemplary processor of Example 1, where the specified source and destination matrices (tiles) each have M rows and N columns of elements, with only one row containing a valid element.

[0350] Example 6 includes the exemplary processor embodiment of example 1, wherein the execution circuitry further maintains a record of instructions that have abandoned a specified destination, and, if necessary, rolls back and re-executes a set of the recorded instructions.

[0351] Example 7 includes the exemplary processor embodiment of Example 1, where the execution circuitry further preserves the machine state before the discard and then performs a machine state consistency check to detect any inconsistencies caused by the discard.

[0352] Example 8 includes the example processor embodiment of Example 1, wherein the set of instructions comprises at least two instructions, and the execution circuitry further comprises a binary translator that buffers the set of instructions and detects data dependencies between the two or more instructions to determine that the two or more instructions are part of a chain.

[0353] Example 9 includes the exemplary processor embodiment of Example 1, where the execution circuitry further avoids alerting the operating system to the discard.

[0354] Example 10 includes the exemplary processor embodiment of Example 1, wherein the tile specified as the destination of the first instruction further comprises a tile configuration, and the execution circuitry further sets a dirty bit in the tile configuration before discarding and generates a fault if the dirty tile is read by a subsequent instruction.

[0355] Example 11 provides an exemplary method performed by a single instruction multiple data (SIMD) processor comprising: fetching, using a fetch circuitry, one or more instructions comprising a set of instructions, each specifying a matrix (tile) of sources and destinations; decoding, using a decode circuitry, the fetched set of instructions; and executing, using an execution circuitry, the decoded set of instructions to identify first and second decoded instructions belonging to an instruction chain; dynamically selecting and configuring a SIMD path having first and second processing engines (PEs) that execute the decoded first and second instructions; and discarding the specified destination of the decoded first instruction and instead sending a result of the decoded first instruction from the first PE to be used by the second PE to execute the decoded second instruction.

[0356] Example 12 includes the example method substance of Example 11, wherein the set of instructions comprises at least one instruction, each of the instruction chains further comprises a chain control field that causes the execution circuitry to determine that the instruction is part of the chain, each of the chain control fields indicating a chain position hint comprising one of a chain start hint, a chain middle hint, and a chain end hint to mark the last instruction in the chain, and the chain control field causes the execution circuitry to determine the existence of a chain, dynamically select and configure a SIMD path to execute the instruction chain, discard specified destinations of all instructions in the chain except the last, and send results of all instructions except the last to a PE that executes the next instruction in the chain.

[0357] Example 13 includes an embodiment of the example method of Example 11, wherein the decoded first and second instructions specify different opcodes to specify different first and second arithmetic operations, and the selected first and second processing engines have limited functionality to specialize in handling the first arithmetic operation and the second arithmetic operation, respectively.

[0358] Example 14 includes an embodiment of the example method of Example 11, wherein the first instruction of the instruction chain further comprises a chain control field, the chain control field comprising a chain header that identifies the first instruction and one or more subsequent instructions as being part of the chain or instructions.

[0359] Example 15 includes an implementation of the exemplary method of Example 11, where the specified source and destination matrices (tiles) each have M rows and N columns of elements, with only one row containing a valid element.

[0360] Example 16 includes the exemplary method of example 11, wherein the execution circuitry further maintains a record of instructions that have abandoned a specified destination, and rolls back and re-executes one or more of the recorded instructions as necessary.

[0361] Example 17 includes the exemplary method embodiment of Example 11, where the execution circuitry further preserves the machine state before the discard and then performs a machine state consistency check to detect any inconsistencies caused by the discard.

[0362] Example 18 includes the example method embodiment of Example 11, wherein the set of instructions comprises at least two instructions, and the execution circuitry further comprises a binary translator that buffers the set of instructions and detects data dependencies between the two or more instructions to determine that the two or more instructions are part of a chain.

[0363] Example 19 includes the exemplary method embodiment of Example 11, where the execution circuitry further avoids warning the operating system against discarding.

[0364] Example 20 includes the exemplary method of Example 11, wherein the tile specified as the destination of the first instruction further comprises a tile configuration, and the execution circuitry further sets a dirty bit in the tile configuration before discarding to generate a fault if the dirty tile is read by a subsequent instruction.

[0365] Example 21 provides an exemplary apparatus comprising: means for fetching one or more instructions until a set of instructions is fetched, each instruction specifying a source and a destination tile operand; means for decoding the fetched set of instructions; and means for, in response to the decoded set of instructions, identifying first and second decoded instructions belonging to an instruction chain; dynamically selecting and configuring a SIMD path having first and second processing engines (PEs) that execute the first and second decoded instructions; and discarding the specified destination of the decoded first instruction and instead sending a result of the decoded first instruction from the first PE to be used by the second PE to execute the decoded second instruction.

[0366] Example 22 includes the exemplary apparatus embodiment of Example 21, wherein the set of instructions comprises at least one instruction, each of the instruction chains further comprises a chain control field that causes the means for executing to determine that the instruction is part of the chain, each of the chain control fields indicating a chain position hint comprising one of a chain start hint, a chain middle hint, and a chain end hint to mark a last instruction in the chain, and the chain control field causes the means for executing to determine the existence of a chain, dynamically select and configure a SIMD path to execute the instruction chain, discard specified destinations of all instructions in the chain except the last, and send results of all instructions except the last to a PE that executes the next instruction in the chain.

[0367] Example 23 includes the exemplary apparatus embodiment of Example 21, wherein the decoded first and second instructions specify different opcodes to specify different first and second arithmetic operations, and the selected first and second processing engines have limited functionality to specialize in handling the first arithmetic operation and the second arithmetic operation, respectively.

[0368] Example 24 includes the example apparatus embodiment of Example 22, wherein the first instruction of the instruction chain further comprises a chain control field, the chain control field comprising a chain header that identifies the first instruction and one or more subsequent instructions as being part of the chain or instructions.

[0369] Example 25 includes an embodiment of the exemplary apparatus of Example 21, where the specified source and destination matrices (tiles) each have M rows and N columns of elements, with only one row containing a valid element.

[0370] Example 26 includes the exemplary apparatus embodiment of example 21, wherein the means for executing further comprises: maintaining a record of instructions that discarded a specified destination; and, if necessary, rolling back and re-executing a set of the recorded instructions.

[0371] Example 27 includes the exemplary apparatus of example 21, wherein the means for executing further comprises preserving a machine state prior to the discarding and thereafter performing a machine state consistency check to detect any inconsistencies caused by the discarding.

[0372] Example 28 includes the exemplary apparatus embodiment of Example 21, wherein the set of instructions comprises at least two instructions, and the means for executing further comprises a binary translator that buffers the set of instructions and detects data dependencies between the two or more instructions to determine that the two or more instructions are part of a chain.

[0373] Example 29 includes the exemplary apparatus of example 21, wherein the means for executing further avoids warning the operating system against discarding.

[0374] Example 30 includes the exemplary apparatus of Example 21, wherein the tile specified as the destination of the first instruction further comprises a tile configuration, and the means for executing further sets a dirty bit in the tile configuration before discarding and generates a fault if the dirty tile is read by a subsequent instruction.

[0375] Example 31 provides an exemplary non-transitory machine-readable medium containing instructions that, when accessed by a single instruction multiple data (SIMD) processor, cause the processor to respond by: fetching, using a fetch circuitry, one or more instructions comprising a set of instructions, each specifying a matrix (tile) of sources and destinations; decoding, using a decode circuitry, the fetched set of instructions; and executing, using an execution circuitry, the decoded set of instructions to identify first and second decoded instructions that belong to an instruction chain; dynamically selecting and configuring a SIMD path having first and second processing engines (PEs) that execute the decoded first and second instructions; and discarding the specified destination of the decoded first instruction and instead sending a result of the decoded first instruction from the first PE to be used by the second PE to execute the decoded second instruction.

[0376] Example 32 includes the exemplary non-transitory machine-readable medium entity of Example 31, wherein the set of instructions comprises at least one instruction, each of the instruction chains further comprises a chain control field that causes the execution circuitry to determine that the instruction is part of a chain, each of the chain control fields indicating a chain position hint comprising one of a chain start hint, a chain middle hint, and a chain end hint to mark the last instruction in the chain, and the chain control field causes the execution circuitry to determine the existence of a chain, dynamically select and configure a SIMD path to execute the instruction chain, discard specified destinations of all instructions in the chain except the last, and send results of all instructions except the last to a PE that executes the next instruction in the chain.

[0377] Example 33 includes the exemplary non-transitory machine-readable medium entity of Example 31, wherein the decoded first and second instructions specify different opcodes to specify different first and second arithmetic operations, and the selected first and second processing engines have limited functionality that specializes in handling the first arithmetic operation and the second arithmetic operation, respectively.

[0378] Example 34 includes the example non-transitory machine-readable medium entity of Example 31, wherein the first instruction of the instruction chain further comprises a chain control field, the chain control field comprising a chain header that identifies the first instruction and one or more subsequent instructions as being part of a chain or instruction.

[0379] Example 35 includes the exemplary non-transitory machine-readable medium embodiment of Example 31, where the specified source and destination matrices (tiles) each have M rows and N columns of elements, with only one row containing a valid element.

[0380] Example 36 includes the exemplary non-transitory machine-readable medium embodiment of Example 31, wherein the processor further maintains a record of the instructions that discarded the specified destination and responds by rolling back and re-executing one or more of the recorded instructions as necessary.

[0381] Example 37 includes the exemplary non-transitory machine-readable medium embodiment of Example 31, wherein the processor further responds by preserving the machine state before the discarding and thereafter performing a machine state consistency check to detect any inconsistencies caused by the discarding.

[0382] Example 38 includes the exemplary non-transitory machine-readable medium embodiment of Example 31, wherein the set of instructions comprises at least two instructions, and the processor is further responsive by using a binary translator to buffer the set of instructions and detect data dependencies between the two or more instructions to determine that the two or more instructions are part of a chain.

[0383] Example 39 includes the exemplary non-transitory machine-readable medium embodiment of example 31, wherein the processor further responds by avoiding alerting the operating system to the discard.

[0384] Example 40 includes the exemplary non-transitory machine-readable medium entity of Example 31, wherein the tile specified as the destination of the first instruction further comprises a tile configuration, and wherein the processor is further responsive by setting a dirty bit in the tile configuration before discarding and generating a fault if the dirty tile is read by a subsequent instruction. (Item 1) a fetch circuit for fetching a plurality of instructions, each having a source tile specifier and a destination tile specifier specifying a respective source tile and destination tile; a decode circuit for decoding the fetched instructions; in response to the decoded instructions, identifying a decoded first and second instructions belonging to the instruction chain; dynamically selecting and configuring a SIMD path having first and second processing engines (PEs) that execute the decoded first and second instructions; discarding the destination tile specifier of the first decoded instruction and instead sending a result of the first decoded instruction from the first PE to the second PE for use by the second PE to execute the second decoded instruction; An execution circuit that performs A processor comprising: (Item 2) the plurality of instructions comprises at least two instructions, each instruction of the chain of instructions further comprising a chain control field that causes the execution circuitry to determine that the instruction is part of a chain; the chain control field indicates a chain position hint comprising one of a chain start hint, a chain middle hint, and a chain end hint to mark the last instruction in the chain, and the chain control field causes the execution circuitry to determine the existence of the chain, to dynamically select and configure the SIMD path to execute the instruction chain, to discard the destination tile specifiers of all instructions in the chain except the last, and instead send results of all instructions except the last to a next PE that executes a next instruction in the chain; Item 1. The processor of item 1. (Item 3) 2. The processor of claim 1, wherein the decoded first and second instructions specify different opcodes to specify different first and second arithmetic operations, and wherein selected first and second processing engines have limited functionality that specializes in handling the first and second arithmetic operations, respectively. (Item 4) 2. The processor of claim 1, wherein a first instruction in the instruction chain further has a chain control field, the chain control field including a chain header that identifies the first instruction and one or more subsequent instructions as part of the instruction chain. (Item 5) 2. The processor of claim 1, wherein the specified source and destination tiles each have M rows and N columns of elements, with only one row containing valid elements. (Item 6) 2. The processor of claim 1, wherein the execution circuitry further maintains a record of instructions that caused each instruction's destination tile specifier to be discarded, and rolls back and re-executes one or more of the recorded instructions as necessary. (Item 7) 2. The processor of claim 1, wherein the execution circuitry further saves a machine state before discarding the destination tile specifier of the decoded first instruction, and then performs a machine state consistency check to detect any inconsistencies caused by discarding the destination tile specifier of the decoded first instruction. (Item 8) 2. The processor of claim 1, wherein the plurality of instructions comprises at least two instructions, and the execution circuitry further comprises a binary translator that buffers the plurality of instructions and detects data dependencies between two or more instructions to determine that the two or more instructions are part of the chain. (Item 9) 2. The processor of claim 1, wherein the fetch circuitry further fetches a start chain instruction before fetching the instructions, the start chain instruction specifying instructions in the instruction chain and further specifying a target for at least the first decoded instruction, the target being one of the instructions in the instruction chain to which the result of the first decoded instruction is sent. (Item 10) 2. The processor of claim 1, wherein the execution circuitry further sets a dirty bit in a tile configuration of the specified destination tile of the first instruction when discarding the destination tile specifier of the decoded first instruction, and generates a fault if the dirty tile is read by a subsequent instruction. (Item 11) 1. A processor-implemented method, comprising: fetching, using fetch circuitry, a plurality of instructions each having a source tile specifier and a destination tile specifier that specify a respective source tile and destination tile; decoding the fetched instructions using decode circuitry; Using the execution circuit, identifying a decoded first and second instructions belonging to the instruction chain; dynamically selecting and configuring a SIMD path having first and second processing engines (PEs) that execute the decoded first and second instructions; discarding the destination tile specifier of the first decoded instruction and instead sending a result of the first decoded instruction from the first PE to the second PE for use by the second PE to execute the second decoded instruction; executing the decoded instructions to perform A method comprising: (Item 12) the plurality of instructions comprises at least two instructions, each instruction of the chain of instructions further comprising a chain control field that causes the execution circuitry to determine that the instruction is part of a chain; the chain control field indicates a chain position hint comprising one of a chain start hint, a chain middle hint, and a chain end hint to mark the last instruction in the chain, the chain control field causing the execution circuitry to determine the existence of the instruction chain, dynamically select and configure the SIMD path to execute the instruction chain, discard destination tile specifiers of all instructions in the chain except the last, and instead send results of all instructions except the last to a next PE that executes a next instruction in the chain; Item 12. The method according to item 11. (Item 13) Item 12. The method of item 11, wherein the decoded first and second instructions specify different opcodes to specify different first and second arithmetic operations, and the selected first and second processing engines have limited functionality that specializes in the first and second arithmetic operations, respectively. (Item 14) 12. The method of claim 11, wherein a first instruction in the instruction chain further has a chain control field, the chain control field including a chain header that identifies the first instruction and one or more subsequent instructions as being part of the chain or instructions. (Item 15) Item 12. The method of item 11, wherein the specified source tile and destination tile each have M rows and N columns of elements, with only one row containing a valid element. (Item 16) 12. The method of claim 11, wherein the execution circuitry further maintains a record of each instruction that has had its destination tile specifier discarded, and rolls back and re-executes the recorded instructions as necessary. (Item 17) 12. The method of claim 11, wherein the execution circuitry further saves a machine state before discarding the destination tile specifier of the decoded first instruction, and then performs a machine state consistency check to detect any inconsistencies caused by discarding the destination tile specifier of the decoded first instruction. (Item 18) 12. The method of claim 11, wherein the plurality of instructions comprises at least two instructions, and the execution circuitry further comprises a binary translator that buffers the plurality of instructions and detects data dependencies between two or more instructions to determine which two or more instructions are part of the chain. (Item 19) 12. The method of claim 11, further comprising the step of fetching a start chain instruction before fetching the instructions, the start chain instruction specifying instructions in the instruction chain and further specifying a target for at least the first decoded instruction, the target being one of the instructions in the instruction chain to which the result of the first decoded instruction is sent. (Item 20) 12. The method of claim 11, further comprising setting a dirty bit by the execution circuitry in a tile configuration of the specified destination tile of the first instruction when discarding the destination tile specifier of the decoded first instruction, causing a fault if the specified destination tile with the dirty bit set is read by a subsequent instruction. (Item 21) 1. A system for executing an instruction chain, the system comprising: Memory, Processor and Equipped with The processor is a fetch circuit for fetching a plurality of instructions, each having a source tile specifier and a destination tile specifier specifying a respective source tile and destination tile; a decode circuit for decoding the fetched instructions; in response to the decoded instructions, identifying a decoded first and second instructions belonging to the instruction chain; dynamically selecting and configuring a SIMD path having first and second processing engines (PEs) that execute the decoded first and second instructions; an execution circuit for discarding the destination tile specifier of the first decoded instruction and instead sending a result of the first decoded instruction from the first PE to the second PE for use by the second PE to execute the second decoded instruction; A system comprising: (Item 22) the plurality of instructions comprises at least two instructions, each instruction of the chain of instructions further comprising a chain control field that causes the execution circuitry to determine that the instruction is part of a chain; the chain control field indicates a chain position hint including one of a chain start hint, a chain middle hint, and a chain end hint to mark the last instruction in the chain, and the chain control field causes the execution circuit to determine the existence of the chain, dynamically select and configure the SIMD path to execute the instruction chain, discard the destination tile specifiers of all instructions in the chain except the last, and send results of all instructions except the last to a next PE that executes a next instruction in the chain; 22. The system according to item 21. (Item 23) 22. The system of claim 21, wherein the decoded first and second instructions specify different opcodes to specify different first and second arithmetic operations, and wherein the selected first and second processing engines have limited functionality that specializes in handling the first arithmetic operation and the second arithmetic operation, respectively. (Item 24) 22. The system of claim 21, wherein a first instruction in the instruction chain further has a chain control field, the chain control field including a chain header that identifies the first instruction and one or more subsequent instructions as being part of the chain or instructions. (Item 25) 22. The system of claim 21, wherein the fetch circuitry further fetches a chain start instruction before fetching the plurality of instructions, the chain start instruction specifying a plurality of instructions in the instruction chain and further specifying a target for at least the first decoded instruction, the target being one of the plurality of instructions in the instruction chain to which the result of the first decoded instruction is sent.

Claims

1. a processor that performs a plurality of operations associated with an instruction indicating a first operation and a second operation, the performing the plurality of operations including performing the first operation on a first source matrix and a second source matrix to generate a third matrix, and performing the second operation on the third matrix and a fourth source matrix to generate a fifth matrix, wherein at least one of the first operation and the second operation is a logical operation; The processor, selecting a first circuit from the three or more circuits to perform the first operation, and selecting a second circuit from the three or more circuits to perform the second operation; dynamically configuring a path from the first circuit used to perform the first operation to the second circuit used to perform the second operation; Sending the third matrix from the first circuit to the second circuit without writing it back to memory. Device.

2. The first operation is not an arithmetic operation.

2. The apparatus of claim 1.

3. Neither the first operation nor the second operation is an arithmetic operation.

2. The apparatus of claim 1.

4. Neither the first operation nor the second operation is a multiplication operation.

2. The apparatus of claim 1.

5. The logical operation is a logical AND operation.

2. The apparatus of claim 1.

6. The logical operation is a logical OR operation.

2. The apparatus of claim 1.

7. Both the first operation and the second operation are logical operations.

2. The apparatus of claim 1.

8. The processor selects the first operation from three or more operations and selects the second operation from three or more operations.

2. The apparatus of claim 1.

9. The data elements of the first source matrix are half-precision data elements.

2. The apparatus of claim 1.

10. The processor has a plurality of graphics cores.

2. The apparatus of claim 1.

11. The processor has multiple heterogeneous cores.

2. The apparatus of claim 1.

12. The processor has multiple heterogeneous graphics cores.

2. The apparatus of claim 1.

13. The processor is part of a graphics processing unit (GPU).

2. The apparatus of claim 1.

14. and an instruction converter for converting the instructions into one or more instructions of a different instruction set executable by the processor.

2. The apparatus of claim 1.

15. 11. A method of executing a plurality of operations associated with an instruction indicating a first operation and a second operation, the executing the plurality of operations comprising: performing the first operation on a first source matrix and a second source matrix to generate a third matrix; performing the second operation on the third matrix and a fourth source matrix to generate a fifth matrix; The method comprises: selecting a first circuit from the three or more circuits to perform the first operation; selecting a second circuit from the three or more circuits to perform the second operation; dynamically configuring a path from the first circuit used to perform the first operation to the second circuit used to perform the second operation; sending the third matrix from the first circuit to the second circuit without writing the third matrix back to a memory; At least one of the first operation and the second operation is a logical operation. method.

16. The logical operation is a logical AND operation or a logical OR operation. The method of claim 15.

17. Both the first operation and the second operation are logical operations. The method of claim 15.

18. The data elements of the first source matrix are half-precision data elements. The method of claim 15.

19. converting the instructions into one or more instructions of a different instruction set executable by a processor. The method of claim 15.

20. A machine-readable medium storing a plurality of instructions which, when executed by at least one processor, cause the processor to perform the method of any one of claims 15 to 19.

21. Apparatus comprising means for carrying out the method according to any one of claims 15 to 19.

Citation Information

Patent Citations

  • Memory network processor with programmable optimization

    JP2016526220A

  • Chaining between exposed vector pipelines

    US20140281386A1