Apparatus and methods for processor architecture

Through static and dynamic resource partitioning strategies and priority algorithms, the problem of resource allocation and deadlock of the processor in a multi-threaded environment is solved, and efficient resource utilization and stable performance are achieved.

CN109952566BActive Publication Date: 2024-08-23INTEL CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201680090755.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2016-12-12
Publication Date
2024-08-23
Estimated Expiration
2036-12-12

AI Technical Summary

Technical Problem

It is difficult for existing processors to efficiently share and allocate resources in a multi-threaded environment, resulting in performance bottlenecks and increased power consumption, and it is difficult to avoid deadlock situations.

Method used

Adopt static and dynamic resource partitioning strategies, combined with priority algorithms and arbitration circuits, to optimize resource allocation and thread switching to ensure efficient resource utilization and deadlock avoidance.

Benefits of technology

It improves the performance and power consumption management of the processor in a multi-threaded environment, ensuring efficient resource utilization and stable performance, and reducing the possibility of deadlock.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109952566B
    Figure CN109952566B
Patent Text Reader

Abstract

The present invention discloses an embodiment of a processor architecture. In an embodiment, the processor includes a decoder, an execution unit, a coherent cache, and an interconnect. The decoder is used to decode an instruction for zeroing a cache line. The execution unit is used to issue a write command for initiating a zero write of the size of a cache line. The coherent cache is used to receive the write command, to determine whether there is a hit in the cache line and whether the cache coherence protocol state of the hit cache line is a modified state or an exclusive state, to configure the cache line to indicate all zeros, and to issue the write command to the interconnect. The interconnect is used to issue a snoop to each of a plurality of other coherent caches for which a hit must be determined in response to receiving the write command.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The field of the invention relates generally to computers, and more particularly to processor architectures. Background Art

[0002] The processor includes many interconnected circuits and structures that work together to execute instructions and process information. These circuits and structures, and the features they provide, can be included in the processor in many different configurations and combinations. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0004] Figure 1A is a block diagram illustrating an exemplary in-order pipeline and an exemplary register renaming, out-of-order issue / execution pipeline according to an embodiment of the present invention;

[0005] Figure 1B is a block diagram illustrating 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 according to an embodiment of the present invention;

[0006] Figure 2A and Figure 2B A block diagram showing a more specific exemplary core architecture, which would be one of several logic blocks in a chip (including other cores of the same type and / or different types);

[0007] Figure 2A is a block diagram of a single processor core along with its connection to an on-die interconnect network 202, and its local subset 204 of a level 2 (L2) cache in accordance with an embodiment of the present invention;

[0008] Figure 2B According to an embodiment of the present invention Figure 2A An expanded view of a portion of a processor core in FIG.

[0009] Figure 3 is a block diagram of an illustrative out-of-order issue / execution processor core that may be included in a processor according to an embodiment of the present invention;

[0010] Figure 4 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative fetch unit in a processor core such as a processor core of and / or a processor;

[0011] Figure 5 According to an embodiment of the present invention, it may be included in Figure 3A block diagram of an illustrative decoding unit in a processor core such as a processor core of and / or a processor;

[0012] Figure 6 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative integer execution unit in a processor core such as a processor core of and / or a processor;

[0013] Figure 7 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative floating point (FP) execution unit in a processor core such as a processor core of and / or a processor;

[0014] Figure 8 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative load / store unit in a processor core such as a processor core of and / or a processor;

[0015] Fig. 9 is a processor according to an embodiment of the present invention that supports simultaneous multithreading (SMT). Figure 3 A block diagram of an illustrative out-of-order issue / execution processor core;

[0016] Fig.10 is a block diagram illustrating an SMT static partitioning feature that may be included in a processor according to some embodiments;

[0017] Fig.11 is a flow chart illustrating a method for SMT static partitioning features that may be performed by a processor according to some embodiments;

[0018] Fig.12 is a block diagram illustrating a resource allocator that may be included in a processor according to some embodiments;

[0019] Fig.13 is a block diagram illustrating algorithmic SMT features that may be included in processor 1300 according to an embodiment;

[0020] Fig.14 is a flow chart illustrating a method for algorithmic SMT features that may be executed by a processor according to an embodiment;

[0021] Fig.15 is a block diagram illustrating algorithmic SMT features that may be included in a processor according to an embodiment;

[0022] Fig.16 shows a block diagram of an implementation of a branch predictor priority algorithm according to an exemplary embodiment;

[0023] Fig.17is a block diagram illustrating arbitration circuitry for an SMT thread switching feature that may be included in a processor according to an embodiment;

[0024] Fig.18 is a block diagram illustrating deadlock avoidance hardware 1800 that may be included in a processor according to an embodiment;

[0025] Fig.19 is a diagram showing 256-bit loading into a 256-bit register file using a pair of 128-bit μops according to some embodiments;

[0026] Fig. 20 is a diagram illustrating a process of loading 256 bits into a 256-bit register file using a pair of 128-bit μops according to some embodiments;

[0027] Fig.21 is a diagram showing the use of a 128-bit μop to store 256 bits from a 256-bit register file according to some embodiments.

[0028] Fig. 22 is a diagram showing a process for storing 256 bits from a 256-bit register file using a pair of 128-bit μops according to some embodiments

[0029] Fig.23 is a block diagram illustrating features for enabling 256-bit arithmetic operations using 128-bit micro-operations according to some embodiments;

[0030] Fig.24 is a block diagram illustrating a cross-channel operation using a temporary storage area to store partial results according to some embodiments;

[0031] Fig.25 is a block diagram illustrating micro-op cache features that may be included in a processor according to an embodiment;

[0032] Fig.26 is a flow chart illustrating a method for a micro-operation cache feature that may be performed by a processor according to an embodiment;

[0033] Fig. 27 is a block diagram illustrating micro-op cache features that may be included in a processor according to an embodiment;

[0034] Fig.28 is a block diagram illustrating micro-op cache features that may be included in a processor according to an embodiment;

[0035] Fig.29 is a block diagram illustrating a register renaming and dependency tracking scheme involving a register alias table (RAT) according to an embodiment;

[0036] Fig.30 is a block diagram illustrating a RAT extended to include zero idioms, sign extension, and zero extension according to an embodiment;

[0037] Fig.31 is a block diagram illustrating reading extended RAT bits during register renaming and passing them down the pipeline using a read register micro-operation according to an embodiment;

[0038] Fig.32 is a block diagram illustrating a virtual register renaming feature that may be included in a processor according to an embodiment;

[0039] Fig.33 is a flow chart illustrating a method for a virtual register renaming feature that may be performed by a processor according to an embodiment;

[0040] Fig.34 is a block diagram illustrating an issue / execute pipeline that may be implemented in a processor core supporting a fused multiply-add (FMA) split / fuse feature according to an embodiment of the present invention;

[0041] Fig.35 is a flow chart illustrating a method for FMA split / merge that may be performed by a processor according to an embodiment of the present invention;

[0042] Fig.36 is a block diagram of a processor that may have more than one core, may have an integrated memory controller, and may have integrated graphics according to an embodiment of the present invention;

[0043] Fig.37 is a block diagram of an illustrative central processor unit (CPU) complex that may be included in a processor according to an embodiment of the present invention;

[0044] Fig.38 is a block diagram of an illustrative cache hierarchy that may be included in a processor according to an embodiment of the present invention;

[0045] Fig.39 is a block diagram illustrating a memory hierarchy in which a cache line zeroing instruction may be implemented in accordance with the present embodiment;

[0046] Fig.40 is a block diagram illustrating a cache implementing a cache line zeroing instruction in a processor according to an embodiment;

[0047] Fig.41 is a flow chart illustrating an embodiment of the present invention that first attempts to write to the cache of the publishing agent before using snooping;

[0048] Fig.42 is a flow chart illustrating an embodiment of the present invention for relying on coherent cache snooping;

[0049] Fig.43 is a flow chart showing an embodiment of the present invention using write-update snooping to implement a snooping process;

[0050] Fig.44 is a flow chart showing an embodiment of the present invention of using write-invalidate snooping to implement the snooping process.

[0051] Fig.45 is a flow chart showing an embodiment of the present invention for implementing a monitoring process using invalidation and write-back monitoring;

[0052] Fig.46 is a flow chart illustrating an embodiment of the present invention for implementing a snooping process using snooping that snoops write-out hits without sending data back to the first agent and without causing any cache line of data to be read from downstream memory;

[0053] Fig.47 is a diagram illustrating a page merging feature that may be included in a processor according to some embodiments;

[0054] Fig.48 is a flow chart illustrating a method for merging page table entries into a single valid page according to some embodiments;

[0055] Figures 49 to 52 is a block diagram of an exemplary computer architecture;

[0056] Fig.49 A block diagram of a system according to an embodiment of the present invention is shown;

[0057] Fig.50 is a block diagram of a first more specific exemplary system according to an embodiment of the present invention;

[0058] Fig.51 is a block diagram of a second more specific exemplary system according to an embodiment of the present invention;

[0059] Fig.52 is a block diagram of a system on a chip (SoC) according to an embodiment of the present invention;

[0060] FIG. 53A to FIG. 53B is a block diagram illustrating a general vector friendly instruction format and instruction templates thereof according to an embodiment of the present invention;

[0061] Fig.53A is a block diagram illustrating a general vector friendly instruction format and a class A instruction template thereof according to an embodiment of the present invention;

[0062] Fig.53Bis a block diagram illustrating a general vector friendly instruction format and a class B instruction template thereof according to an embodiment of the present invention;

[0063] Fig.54A is a block diagram illustrating an exemplary specific vector friendly instruction format according to an embodiment of the present invention;

[0064] Fig.54B is a block diagram illustrating the fields of a particular vector friendly instruction format that make up a complete opcode field according to one embodiment of the present invention;

[0065] Fig.54C is a block diagram illustrating fields of a particular vector friendly instruction format that constitute a register index field according to one embodiment of the present invention;

[0066] Fig.54D is a block diagram illustrating fields of a particular vector friendly instruction format that constitute an enhanced operation field according to one embodiment of the present invention;

[0067] Fig.55 is a block diagram of a register architecture according to one embodiment of the present invention; and

[0068] Fig.56 is a block diagram contrasting the use of a software instruction converter for converting binary instructions in a source instruction set to binary instructions in a target instruction set in accordance with an embodiment of the present invention.

[0069] Figures 57 to 66 It is a demonstration of an embodiment of the present invention in a system. DETAILED DESCRIPTION

[0070] In the following description, various specific details are set forth. However, it should be understood that embodiments of the present invention can be practiced without these specific details. In other cases, well-known circuits, structures, and techniques are not shown in detail to avoid obscuring the understanding of this specification.

[0071] References in the specification to "one embodiment", "an embodiment", "an example embodiment", etc. indicate that the described embodiment may include certain features, structures, or characteristics, but each embodiment may not necessarily include the certain features, structures, or characteristics. In addition, such phrases do not necessarily refer to the same embodiment. Further, when a certain feature, structure, or characteristic is described in conjunction with an embodiment, it is considered within the knowledge of those skilled in the art that such feature, structure, or characteristic may be implemented in conjunction with other embodiments, whether or not explicitly described.

[0072] A device for processing information, such as a computer, may include one or more processor cores. Each processor core may include various circuit systems, hardware, structures, and other features, wherein each processor core alone or in any number of combinations may be referred to as a feature. Features may be implemented and / or arranged in various ways, using various techniques, and involving the execution of various methods to attempt to achieve desired levels of performance, power consumption, and / or other characteristics in various combinations (e.g., improving performance, reducing power consumption and implementing power saving features, as well as improving fairness, minimum performance guarantees, throughput, instructions per clock (IPC), instructions per unit time, quality of service, time and / or memory efficiency, to name only some applicable criteria). Embodiments of the present invention may include one or more of the features described in this specification. Some examples of architectures and systems that may embody the present invention are provided in the accompanying drawings and the description of this specification.

[0073] Processor cores that may embody the present invention may be implemented in different ways, for different purposes, and in different processors. For example, implementations of such cores may include: 1) a general-purpose in-order core intended for general-purpose computing; 2) a high-performance general-purpose out-of-order core intended for general-purpose computing; 3) a special-purpose core intended primarily for graphics and / or scientific (throughput) computing. Implementations of different processors may include: 1) a central processing unit (CPU) including one or more general-purpose in-order cores intended for general-purpose computing and / or one or more general-purpose out-of-order cores intended for general-purpose computing; and 2) a coprocessor including one or more special-purpose cores intended primarily for graphics and / or scientific (throughput) computing. Such different processors result in different computer system architectures, which may include: 1) a coprocessor located on a separate chip from the CPU; 2) a coprocessor located on a separate die in the same package as the CPU; 3) a coprocessor on the same die as the CPU (in which case such coprocessors are sometimes referred to as dedicated logic, such as integrated graphics and / or scientific (throughput) logic or dedicated cores); and 4) a system on a chip (SoC), which may include the described CPU (sometimes referred to as application core(s) or application processor(s)), the above-mentioned coprocessors, and additional functionality on the same die.

[0074] Next, an exemplary core architecture is described, followed by an exemplary processor and computer architecture. Each processor may include one or more cores, wherein each core and / or a combination of cores may be architected and designed to execute one or more threads, processes, or other instruction sequences at different times. The core architecture and design techniques may provide and / or support concurrent execution of multiple threads according to any of a class of methods known as synchronous (or symmetric) multithreading (SMT) or any other method. Therefore, a processor core that may embody the present invention, including those described in the following examples, may include various novel features that are architected and designed to support SMT and / or various known features that may be modified in various novel ways to support SMT, as may be described below. For the sake of brevity, the meaning of the term SMT in this specification may include a combination of SMT and any other method for multithreading (e.g., time slicing).

[0075] As mentioned above and explained in more detail below, embodiments of the present disclosure may be desirable for a variety of reasons, including, for example, improving performance, reducing power consumption, and implementing power saving features, as well as improving fairness, minimum performance guarantees, throughput, instructions per clock (IPC), instructions per unit time, quality of service, time and / or memory efficiency, to name just a few applicable criteria. The desired criteria listed above and described herein are exemplary; as explained herein, the present disclosure may be desirable for any of the reasons listed above, either alone or in combination, and the present disclosure may be further desirable for additional reasons not specifically listed above.

[0076] Further, as mentioned above and explained in more detail below, embodiments of the present disclosure may be applied to any type of processor or processing element, including general purpose processors, server processors or processing elements for server environments, coprocessors (e.g., security coprocessors) high throughput MIC processors, GPGPU's, accelerators (such as, for example, graphics accelerators or digital signal processing (DSP) units, cryptographic accelerators, fixed function accelerators, machine learning accelerators, networking accelerators, or computer vision accelerators), field programmable gate arrays, or any other processor or processing device. The one or more processors may be implemented on one or more chips. The one or more processors 3600 may be part of one or more substrates and / or may be implemented on one or more substrates using any of a variety of processing technologies such as, for example, BiCMOS, CMOS, or NMOS. The processors and processing devices listed above and described herein are exemplary; as explained herein, the present disclosure is applicable to any processor or processing device.

[0077] Further, as mentioned above and explained in more detail below, embodiments of the present disclosure may be applied to processors or processing elements using a wide variety of instruction sets and instruction set architectures, including, for example, the x86 instruction set (optionally including extensions to which newer versions have been added); the MIPS instruction set of MIPS Technologies, Inc. of Sunnyvale, California; the ARM instruction set of ARM Holdings, Inc. of Sunnyvale, California (with optional additional extensions such as NEON); IBM's "Power" instruction set or any other instruction set, including RISC and CISC instruction sets. The instruction sets and instruction set architectures listed above and described herein are exemplary; as explained herein, the present disclosure is applicable to any instruction set or instruction set architecture.

[0078] Exemplary Core Architecture

[0079] In-order and out-of-order core block diagram

[0080] Figure 1A is a block diagram illustrating an exemplary in-order pipeline and an exemplary register renaming, out-of-order issue / execution pipeline according to an embodiment of the present invention. Figure 1B is a block diagram illustrating 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 according to an embodiment of the present invention. Figure 1A and Figure 1B The solid boxes in show the in-order pipeline and in-order core, while the optional addition of dashed boxes shows the register renaming, out-of-order issue / execution pipeline and core. The out-of-order aspects will be described assuming that they are a subset of the out-of-order aspects.

[0081] exist Figure 1A , the processor pipeline 100 includes a fetch stage 102, a length decode stage 104, a decode stage 106, an allocation stage 108, a rename stage 110, a schedule (also called a dispatch or issue) stage 112, a register read / memory read stage 114, an execute stage 116, a write back / memory write stage 118, an exception handling stage 122, and a commit stage 124.

[0082] Figure 1BA processor core 190 is shown, the processor core comprising a front end unit 130 coupled to an execution engine unit 150, and the execution engine unit and the front end unit are both coupled to a memory unit 170. The core 190 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, the core 190 may be a dedicated core, such as, for example, a network or communication core, a compression engine, a coprocessor core, a general purpose computing graphics processing unit (GPGPU) core, a graphics core, etc. For example, as explained above, the core 190 may be any member of a set, the set comprising: a general purpose processor, a server processor or processing element for a server environment, a coprocessor (e.g., a security coprocessor) a high throughput MIC processor, a GPGPU, an accelerator (such as, for example, a graphics accelerator or a digital signal processing (DSP) unit, a cryptographic accelerator, a fixed function accelerator, a machine learning accelerator, a networking accelerator, or a computer vision accelerator), a field programmable gate array, or any other processor or processing device.

[0083] The front end unit 130 includes a branch prediction unit 132 coupled to a micro-operation cache 133 and an instruction cache unit 134, the instruction cache unit is coupled to an instruction translation lookaside buffer (TLB) 136, the instruction translation lookaside buffer is coupled to an instruction fetch unit 138, the instruction fetch unit is coupled to a decode unit 140. The decode unit 140 (or decoder) can decode instructions and generate one or more micro-operations, microcode entry points, microinstructions, other instructions, or other control signals as outputs, which are decoded from the original instructions, or otherwise reflect the original instructions, or are derived from the original instructions. The micro-operations, microcode entry points, microinstructions, etc. can be stored at least in the micro-operation cache 133. The decode unit 140 can be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to: a lookup table, a hardware implementation, a programmable logic array (PLA), a microcode read-only memory (ROM), etc. In one embodiment, core 190 includes a microcode ROM or other medium that stores microcode for certain macroinstructions (e.g., stored in decode unit 140 or otherwise stored within front end unit 130). Micro-op cache 133 and decode unit 140 are coupled to rename / allocator unit 152 in execution engine unit 150. In various embodiments, a micro-op cache such as 133 may also or instead be referred to as an op cache, u-op cache, uop cache, or μop cache; and micro-operations may be referred to as micro-ops, u-ops, uops, and μops.

[0084] The execution engine unit 150 includes a rename / allocator unit 152 coupled to a retirement unit 154 and a set of one or more scheduler units 156. The (multiple) scheduler units 156 represent any number of different schedulers, including reservation stations, central instruction windows, etc. The (multiple) scheduler units 156 are coupled to (multiple) physical register file units 158. Each of the (multiple) physical register file units 158 represents one or more physical register files, different ones of which store one or more different data types, such as scalar integers, scalar floating points, packed integers, packed floating points, vector integers, vector floating points, status (e.g., an instruction pointer as the address of the next instruction to be executed), etc. In one embodiment, the (multiple) physical register file units 158 include vector register units, write mask register units, and scalar register units. These register units can provide architectural vector registers, vector mask registers, and general registers. The physical register file(s) unit(s) 158 overlap with the retirement unit 154 to illustrate various ways in which register renaming and out-of-order execution may be implemented (e.g., using reorder buffer(s) and retirement register file(s); using future stack(s), history buffer(s) and retirement register file(s); using register maps and register pools; etc.). The retirement unit 154 and the physical register file(s) unit(s) 158 are coupled to the execution cluster(s) 160. The execution cluster(s) 160 include a set of one or more execution units 162 and a set of one or more memory access units 164. The execution unit(s) 162 may perform various operations (e.g., shifts, additions, subtractions, multiplications), and on various types of data (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point). While some embodiments may include multiple execution units dedicated to specific functions or sets of functions, other embodiments may include only one execution unit or include multiple execution units that all perform all functions. Scheduler unit(s) 156, physical register file(s) units 158, and execution cluster(s) 160 are shown as possibly plural because some embodiments create separate pipelines for certain types of data / operations (e.g., scalar integer pipelines, scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipelines, and / or memory access pipelines, each with its own scheduler unit, physical register file(s), and / or execution cluster, and in the case of separate memory access pipelines, some embodiments are implemented where only the execution cluster of this pipeline has memory access unit(s) 164). It should also be understood that where separate pipelines are used, one or more of these pipelines may be out-of-order issue / execution pipelines, and the rest are in-order pipelines.

[0085] The set of memory access units 164 are coupled to a memory unit 170, which includes a data TLB unit 172 coupled to a data cache unit 174, which is coupled to a level 2 (L2) cache unit 176. In an exemplary embodiment, the memory access unit 164 may include a load unit, a store address unit, and a store data unit, each coupled to the data TLB unit 172 in the memory unit 170. The instruction cache unit 134 is further coupled to a level 2 (L2) cache unit 176 in the memory unit 170. The L2 cache unit 176 is coupled to one or more other levels of cache and ultimately to main memory.

[0086] By way of example, an exemplary register renaming, out-of-order issue / execution core architecture may implement pipeline 100 as follows: 1) instruction fetch 138 performs fetch and length decode stages 102 and 104; 2) decode unit 140 performs decode stage 106; 3) rename / allocator unit 152 performs allocate stage 108 and rename stage 110; 4) (multiple) scheduler units 156 perform schedule stage 112; 5) (multiple) physical register file units 158 and memory units 170 perform register read / memory read stage 114; execution cluster 160 performs execute stage 116; 6) memory unit 170 and (multiple) physical register file units 158 perform write back / memory write stage 118; 7) various units may be involved in exception handling stage 122; and 8) retirement unit 154 and (multiple) physical register file units 158 perform commit stage 124.

[0087] Core 190 may support one or more instruction sets (e.g., the x86 instruction set (with some extensions that have been added with newer versions); the MIPS instruction set of MIPS Technologies, Inc. of Sunnyvale, California; the ARM instruction set of ARM Holdings, Inc. of Sunnyvale, California (with optional additional extensions such as NEON), IBM's "Power" instruction set, or any other instruction set including RISC instruction sets and CISC instruction sets), including the instruction(s) described herein. In one embodiment, core 190 includes logic to support packed data instruction set extensions (e.g., AVX, AVX2, AVX-512), thereby allowing operations used by many multimedia applications to be performed using packed data.

[0088] It should be understood that a core may support multithreading (executing two or more sets of operations or threads in parallel) and may accomplish such multithreading in a variety of ways, including time-division multithreading, SMT (where a single physical core provides a logical core for each of the threads that the physical core is simultaneously multithreading), or a combination thereof (e.g., time-division fetch and decode and thereafter, such as SMT in Hyper-Threading Technology).

[0089] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming can be used in an in-order architecture. Although the illustrated embodiment of the processor also includes separate instruction and data cache units 134 / 174 and a shared L2 cache unit 176, alternative embodiments may have a single internal cache for both instructions and data, such as a level 1 (L1) internal cache, or multiple levels of internal caches. In some embodiments, the system may include a combination of internal caches and external caches external to the core and / or processor. Alternatively, all (multiple) caches may be external to the core and / or processor.

[0090] Specific exemplary core architecture

[0091] Figure 2A and Figure 2B A block diagram of a more specific exemplary core architecture is shown, which would be one of several logic blocks in a chip (including other cores of the same type and / or different types). Depending on the application, the logic blocks communicate through a high-bandwidth interconnect network (e.g., a ring network) with some fixed-function logic, memory I / O interfaces, and other necessary I / O logic.

[0092] Figure 2A 2 is a block diagram of a single processor core along with its connection to an on-die interconnect network 202, and its local subset 204 of a level 2 (L2) cache in accordance with an embodiment of the present invention. In one embodiment, the instruction decoder 200 supports the x86 instruction set with a packed data instruction set extension. The L1 cache 206 allows low latency access to cache memory into the scalar and vector units. While in one embodiment (to simplify the design), the scalar unit 208 and the vector unit 210 use separate register files (scalar registers 212 and vector registers 214, respectively), and data passed between them is written to memory and then read back from the level 1 (L1) cache 206, alternative embodiments of the present invention may use a different approach (e.g., using a single register file or including a communication path that allows data to be passed between the two register files without being written and read back).

[0093] The local subset 204 of the L2 cache is part of the global L2 cache, which is divided into multiple separate local subsets, one for each processor core. Each processor core has a direct access path to its own local subset 204 of the L2 cache. The data read by the processor core is stored in its L2 cache subset 204 and can be quickly accessed, accessing its local L2 cache subset in parallel with other processor cores. The data written by the processor core is stored in its own L2 cache subset 204, and if necessary, it is dumped and cleared from other subsets. The ring network ensures the consistency of 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. The width of each ring data path in each direction is 1012 bits.

[0094] Figure 2B According to an embodiment of the present invention Figure 2A An expanded view of a portion of a processor core in FIG. Figure 2B The L1 data cache 206A portion of the L1 cache 204 is included, as well as more details about the vector unit 210 and vector registers 214. Specifically, the vector unit 210 is a 16-bit wide vector processing unit (VPU) (see the 16-bit wide ALU 228) that executes one or more of integer, single precision floating point, and double precision floating point instructions. The VPU supports blending of register inputs with a blend unit 220, numerical conversion with numerical conversion units 222A and 222B, and copying of memory inputs with a copy unit 224. Write mask register 226 allows predictive result vector writes.

[0095] Specific Exemplary Out-of-Order Core Architecture

[0096] Figure 3 is a block diagram of an illustrative out-of-order issue / execution processor core that may be included in a processor according to an embodiment of the present invention. Figure 3 , the processor core 300 includes a front end unit 310, an integer unit 320, an FP unit 330, a load-store unit 340, and a level 2 (L2) cache unit 350. Figure 3 , and thus shows various units arranged and named according to one of many possible methods according to embodiments of the present invention. Any one or more embodiments may be presented in one or more ways. Figure 3 Each unit shown in the embodiment may include circuit systems and / or structures that may be included in other units in other representations of the embodiment. For example, the front end unit 310 may be additionally or alternatively shown and described as including the following: Figure 4 The take-out unit 400 and the like in Figure 5 ; any or all of the integer unit 320, the FP unit 330, and the load-store unit 340 may be additionally or alternatively shown and described individually or collectively as one or more execution units; etc. In addition, the various units within the core 300 may be coupled in various ways; therefore, for convenience, different figures may show units within different larger units; for example, a specific unit may be shown within a first larger unit in the first figure and within a second larger unit in the second figure.

[0097] exist Figure 3 In the embodiment, the front end unit 310 includes a branch prediction unit 311, a micro-operation cache (op cache) unit 312, an instruction cache (i cache) unit 313, a decode unit 314, and a micro-operation (micro-operation) queue unit 315. The branch prediction unit 311 includes a branch prediction circuit system such as a branch target buffer (BTB) to reduce the average branch delay, and is coupled to the op cache unit 312 and the i cache unit 313. The op cache unit 312 includes an op cache in which micro-operations associated with instructions are cached. The i cache 313 unit includes an i cache, which in an embodiment may be a 64K four-way i cache in which instructions are cached. The i cache 313 unit is coupled to the decode unit 314 to provide cached instructions to be decoded. The decode unit 314 includes a decode circuit system such as an instruction decoder for decoding instructions. In an embodiment, the front end unit 310 can fetch and the decode unit 314 can decode up to four instructions per clock cycle. Op cache unit 312 and decode unit 314 are each coupled to uop queue unit 315 to provide two paths for loading uops into uop queue unit 315. Uop queue unit 315 includes a uop queue that, in an embodiment, can dispatch six uops per cycle to one or more execution units.

[0098] Also in Figure 3, integer unit 320 includes integer rename unit 321; integer scheduler units 322A, 322B, 322C, 322D, 322E, and 322F (collectively, integer scheduler unit 322); integer physical register file 323; arithmetic logic unit (ALU) 324A, 324B, 324C, and 324D (collectively, ALU 324); and address generation units (AGU) 325A and 325B (collectively, AGU 325). Integer rename unit 321 is coupled to micro-op queue unit 315 to receive one or more micro-ops to be executed in whole or in part by one or more of ALU 324 and / or AGU 325. Integer rename unit 321 includes register renaming circuitry and is also coupled to integer scheduler unit 322, which in turn is coupled to integer physical register file 323 to provide integer register renaming. Integer scheduler unit 322 includes scheduling circuitry for scheduling micro-operations to be executed in whole or in part by one or more of ALU 324 and / or AGU 325. Integer physical register file 323 includes a file of physical integer registers, which in an embodiment may include 168 physical integer registers. Each of ALU 324 and AGU 325 is coupled to physical register file 323 to receive values ​​to be used as input in the execution of micro-operations and / or to provide values ​​as output of the execution of micro-operations.

[0099] Also in Figure 3 , FP unit 330 includes FP renaming unit 331, FP scheduler unit 332, FP register file 333, FP multiplier 334A and FP multiplier 334B (collectively referred to as FP multiplier 334), and FP adder 335A and 335B (collectively referred to as FP adder 335). FP renaming unit 331 is coupled to micro-operation queue unit 315 to receive one or more micro-operations to be executed in whole or in part by FP multiplier 334 and / or FP adder 335. FP renaming unit 331 includes register renaming circuitry and is also coupled to FP scheduler unit 332, which in turn is coupled to FP register file 333 to provide FP register renaming. FP scheduler unit 332 includes scheduling circuitry for scheduling micro-operations to be executed in whole or in part by one or more of FP multiplier 334 and / or FP adder 335. Each of the FP multiplier 334 and the FP adder 335 is coupled to the FP register file 333 to receive values ​​to be used as inputs in the execution of micro-operations and / or to provide values ​​as outputs of the execution of micro-operations.

[0100] Also in Figure 3, the load-store unit 340 includes a load-store queue unit 341 and a data cache (d-cache) unit 342. The load-store queue unit 341 may include any number of load and / or store queues, which in an embodiment provide two loads and one store per clock cycle and are coupled to the AGU 325 to receive memory addresses for load and / or store operations. The D-cache unit 342 includes a d-cache, which in an embodiment may be a 32K, eight-way level 1 (L1) d-cache for caching data, and which is coupled to the integer physical register file 323, the FP register file 333, and the load-store queue unit 341 to receive and provide data generated by micro-operations and to be used in the execution of micro-operations.

[0101] Also in Figure 3 In the embodiment, the L2 cache unit 350 includes an L2 cache, which can be a 512K, eight-way cache for caching instructions and data.

[0102] Figure 4 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative fetch unit in a processor core such as the core 300 and / or a processor. Figure 4 In the embodiment, the fetch unit 400 includes a next program counter (PC) unit 410, a translation lookaside buffer (TLB) unit 420, a hash sensor unit 430, a BTB return stack indirect target array (ITA) unit 440, a physical request queue unit 450, a micro tag unit 460 and an i cache unit 470.

[0103] Figure 5 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative decoding unit in a processor core such as the core 300 and / or a processor. Figure 5 In the example, the decoding unit 500 includes an instruction byte buffer unit 510, a selection unit 520, a decoding unit 530, an op cache unit 540, a micro-operation queue unit 550, a microcode read-only memory (ROM) unit 560, a stack engine memory heap (memfile) unit 570, and a dispatch unit 580.

[0104] Figure 6 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative integer execution unit in a processor core such as the core 300 and / or a processor. Figure 6, integer execution unit 600 includes mapping unit 610; retirement queue unit 620; arithmetic logic queue (ALQ) units 630A, 630B, 630C and 630D (collectively referred to as ALQ 630); address generation queue (AGQ) units 640A and 640B (collectively referred to as AGQ 640); physical register file unit 650, forwarding multiplexer (mux) unit 660; ALU 670A, 670B, 670C and 670D (collectively referred to as ALU 670); AGU 680A and AGU 680B (collectively referred to as AGU 680); and load-store unit 690.

[0105] Figure 7 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative FP execution unit in a processor core or processor such as the core 300 of FIG. Figure 7 In the embodiment, the FP execution unit 700 includes an unschedulable micro-operation queue unit 710, a schedulable micro-operation queue unit 720, a retirement queue unit 730, an FP conversion unit 740, an FP physical register file 750, a forwarding mux unit 760, FP multipliers 770A and 770B (collectively referred to as FP multipliers 770), and FP adders 780A and 780B (collectively referred to as FP adders 780).

[0106] Figure 8 According to an embodiment of the present invention, it may be included in Figure 3 A block diagram of an illustrative load / store unit in a processor core or processor such as the core 300 of FIG. Figure 8 In the embodiment, the load / store unit 800 includes a load queue unit 810, a load pipeline pick unit 811A and 811B (collectively referred to as a load pick unit 811), a TLB unit 812A and 812B (collectively referred to as a TLB unit 812), a data pipeline unit 813A and 813B (collectively referred to as a data pipeline unit 813), a storage queue unit 820, a pre-fetch unit 821, a storage pipeline pick unit 822), a storage pipeline unit 823, a storage commit unit 824, an L1 / L2 TLB and data cache tag array 830, an L1 data cache 840, a memory address buffer 850, and a write-merging buffer 860.

[0107] Fig. 9 is a processor according to an embodiment of the present invention that supports SMT. Figure 3 A block diagram of an illustrative out-of-order issue / execution processor core is shown in FIG. 300 . Fig. 9In the embodiment, the processor core 900 includes a front end unit 910, an integer unit 920, an FP unit 930, a load-store unit 940, an L2 cache unit 950, and a retirement unit 960. The front end unit 910 includes a branch prediction unit 911, an op cache unit 912, an i cache unit 913, a decode unit 914, a micro-operation queue unit 915, and an instruction TLB unit 916. The integer unit 920 includes an integer renaming unit 921, an integer scheduler unit 922, an integer physical register file 923, an ALU 924, and an AGU 925. The FP unit 930 includes an FP renaming unit 931, an FP scheduler unit 932, an FP register file 933, FP multipliers 934A and 934B (collectively referred to as FP multipliers 934), and FP adders 935A and 935B (collectively referred to as FP adders 935). The load-store unit 940 includes a load queue unit 941A and a store queue unit 941B (collectively referred to as a load-store queue unit 941), a data cache (d-cache) unit 942, and a TLB unit 943. The retirement unit 960 includes a retirement queue.

[0108] SMT Features

[0109] A processor core according to an embodiment of the present invention may include various features to support SMT. A number of such features are described individually using the following non-limiting examples, but embodiments may include any combination of these features.

[0110] Static partitioning of resources

[0111] According to some exemplary embodiments, the processor core can support the SMT static partitioning feature. Threads can be assigned to available resources that are statically shared in a simultaneous multithreaded pipeline. In some embodiments, techniques such as pattern-based algorithms can be used to assign threads to available resources to improve performance and efficiency. In some embodiments, this feature can improve computer systems by providing more efficient resource sharing for statically shared resources between threads. The feature can also use available resources that have not been used otherwise due to SMT static partitioning.

[0112] For example, resources in a pipeline may be statically shared between two threads, e.g., 50%-50%, to provide the same resources to both threads. In some embodiments, different percentages of available resources may be allocated to each thread, e.g., based on workload patterns. For example, if one thread is stopped longer than another thread, and there are empty entries available for the other thread, the available entries may be allocated to the stopped thread, rather than keeping them empty in the statically shared resources.

[0113] In some embodiments, more than one thread may have a similar pattern. In this case, in the case where there is a tie between threads, a priority scheme may be used to allocate resources. For example, tie-breaking may be performed by random selection, selecting a lower numbered thread, selecting a higher numbered thread, and / or selecting alternating threads.

[0114] Fig.10 1 is a block diagram illustrating an SMT static partitioning feature that may be included in a processor according to some embodiments. According to an exemplary embodiment, the SMT static partitioning feature may include a pattern detection block 1001. A first resource and a second resource may be statically allocated to threads T0 and T1. A lookup of a pattern base table may determine that thread T1 has a long stall time. The pattern detection block may then adjust the statically allocated resources based on the pattern input. For example, a second resource statically allocated to T1 may be allocated to T0.

[0115] In some embodiments, dynamic partitioning may be applied to other statically partitioned resources such as an instruction translation lookaside buffer (ITLB).

[0116] Fig.11 is a flow chart illustrating a method for SMT static partitioning features that may be performed by a processor according to some embodiments. In some embodiments, as illustrated in block CQB01, the method may include detecting a pattern for static shared resources in a pipeline, such as a thread stall. As illustrated in block CQB02, the method may further include adjusting sharing (e.g., 50-50 sharing). The method adjustment may be based, for example, on the length of the stall or some other similar event.

[0117]

[0118] An embodiment may include a processor configured to detect a pattern for at least one of the first static partitioned resources and the second static partitioned resources; and adjust allocation of at least one of the first static partitioned resources and the second static partitioned resources.

[0119] In some embodiments, one or more of the following applies. The first static partitioned resource and the second static partitioned resource of the pipeline may be resources of a simultaneous multithreaded pipeline. The first static partitioned resource and the second static partitioned resource may be allocated between the first thread and the second thread. The processor may be further configured to allocate the first resource and the second resource based on a pattern-based algorithm. The processor may be further configured to allocate at least one of the first resource and the second resource based on one or more workload patterns. The processor may be further configured to allocate at least one of the first resource and the second resource based on determining whether at least one of the first thread and the second thread is stopped for a longer period of time than the other thread. The processor may be further configured to allocate at least one of the first resource and the second resource based on determining whether there is an empty entry associated with at least one of the available first resource and the second resource, and allocate at least one of the first thread and the second thread to at least one of the available first resource and the second resource. The processor may be further configured to allocate at least one of the first resource and the second resource based on a priority scheme. The processor may be further configured to determine whether a stop has occurred based on a lookup pattern base table. The first static partitioned resource and the second static partitioned resource may be resources of an instruction translation lookaside buffer (ITLB).

[0120] Embodiments may include a method comprising detecting at least one of a pattern for a first static partitioned resource and a second static partitioned resource; and adjusting allocation of at least one of the first static partitioned resource and the second static partitioned resource.

[0121] In some embodiments, one or more of the following apply. The first static partitioned resource and the second static partitioned resource may be resources of a simultaneous multithreaded pipeline. The first static partitioned resource and the second static partitioned resource may be allocated between the first thread and the second thread. The method may further include allocating the first resource and the second resource based on a pattern-based algorithm. The method may further include allocating at least one of the first resource and the second resource based on one or more workload patterns. The method may further include allocating at least one of the first resource and the second resource based on determining whether at least one of the first thread and the second thread is stopped for a longer period of time than the other thread. The method may further include allocating at least one of the first resource and the second resource based on determining whether there is an empty entry associated with at least one of the available first resource and the second resource, and allocating at least one of the first thread and the second thread to at least one of the available first resource and the second resource. The method may further include allocating at least one of the first resource and the second resource based on a priority scheme. The method may further include determining whether a stop has occurred based on a lookup pattern base table. The first static partitioned resource and the second static partitioned resource may be resources of an instruction translation lookaside buffer (ITLB).

[0122] An embodiment may include a non-transitory machine-readable medium storing at least one instruction that, when executed by a processor, causes the processor to perform a method comprising detecting at least one of a mode for a first static partitioned resource and a second static partitioned resource; and adjusting an allocation of at least one of the first static partitioned resource and the second static partitioned resource.

[0123] In some embodiments, one or more of the following apply. The first static partitioned resource and the second static partitioned resource may be resources of a simultaneous multithreaded pipeline. The first static partitioned resource and the second static partitioned resource may be allocated between the first thread and the second thread. The method may further include allocating the first resource and the second resource based on a pattern-based algorithm. The method may further include allocating at least one of the first resource and the second resource based on one or more workload patterns. The method may further include allocating at least one of the first resource and the second resource based on determining whether at least one of the first thread and the second thread is stopped for a longer period of time than the other thread. The method may further include allocating at least one of the first resource and the second resource based on determining whether there is an empty entry associated with at least one of the available first resource and the second resource, and allocating at least one of the first thread and the second thread to at least one of the available first resource and the second resource. The method may further include allocating at least one of the first resource and the second resource based on a priority scheme. The method may further include determining whether a stop has occurred based on a lookup pattern base table. The first static partitioned resource and the second static partitioned resource may be resources of an instruction translation lookaside buffer (ITLB).

[0124] An embodiment may include a system comprising a system of memory and a processor, the processor configured to detect a pattern for at least one of a first static partitioned resource and a second static partitioned resource; and adjust an allocation of at least one of the first static partitioned resource and the second static partitioned resource.

[0125] In some embodiments, one or more of the following applies. The first static partitioned resource and the second static partitioned resource may be resources of a simultaneous multithreaded pipeline. The first static partitioned resource and the second static partitioned resource may be allocated between the first thread and the second thread. The processor may be further configured to allocate the first resource and the second resource based on a pattern-based algorithm. The processor may be further configured to allocate at least one of the first resource and the second resource based on one or more workload patterns. The processor may be further configured to allocate at least one of the first resource and the second resource based on determining whether at least one of the first thread and the second thread is stopped for a longer period of time than the other thread. The processor may be further configured to allocate at least one of the first resource and the second resource based on determining whether there is an empty entry associated with at least one of the available first resource and the second resource, and allocate at least one of the first thread and the second thread to at least one of the available first resource and the second resource. The processor may be further configured to allocate at least one of the first resource and the second resource based on a priority scheme. The processor may be further configured to determine whether a stop has occurred based on a lookup pattern base table. The first static partitioned resource and the second static partitioned resource may be resources of an instruction translation lookaside buffer (ITLB).

[0126] Competitive sharing of resources

[0127] According to an embodiment of the present invention, a processor core may support SMT with contention resource sharing. Circuits, structures, or other resources in the core may be shared by multiple threads based on a strategy of thread contention priority. Fig. 9 In an embodiment of the present invention, each of the following resources can be shared between or among threads based on a contention policy: branch prediction unit 911, op cache unit 912, i cache unit 913, decode unit 914, instruction TLB unit 916, integer rename unit 921, integer scheduler unit 922, integer physical register file 923, ALU 924, AGU 925, FP rename unit 931, FP scheduler unit 932, FP register file 933, FP multipliers 934A and 934B, FP adders 935A and 935B, load queue unit 941A, d cache unit 942, and TLB unit 943.

[0128] Some of these resources, such as the buffers in integer rename unit 921, integer scheduler unit 922, FP rename unit 931, FP scheduler unit 932, or load queue unit 941A, may have entries, subunits, or other portions that may be individually allocated to threads. For convenience, this type of resource may be referred to as a divisible resource, and this type of allocation may be referred to as a partial allocation. Others, such as each individual ALU in ALU 924, each individual AGU in AGU 925, FP multiplier 934A, FP multiplier 934B, FP adder 935A, or FP adder 935B, may only be fully allocated for a specific clock cycle, a set of consecutive clock cycles to complete an operation, or other time period or duration of an operation. For convenience, this type of resource may be referred to as an indivisible resource, and this type of allocation may be referred to as a full allocation.

[0129] Fig.12 1 is a block diagram illustrating a resource allocator 1200 that may be included in a processor according to an embodiment of the present invention. Resource allocator 1200 may include circuitry, structures, and / or hardware for allocating core circuits, structures, units, or resources, or any portion thereof, to a particular thread. In an embodiment, resource allocator 1200 may be implemented to allocate a single resource and / or multiple resources. In either case, a processor or processor core may include multiple instances of one or more embodiments of resource allocator 1200, each instance for allocating any one or more resources, each instance including Fig.12 Any one or more of the blocks shown in the example, and each instance implements any one or more resource allocation strategies or combinations of resource allocation strategies.

[0130] Resource allocator 1200 may include tracker circuit 1210, policy circuit 1220, decision circuit 1230, and allocator circuit 1240. Tracker circuit may include one or more of performance history circuit 1212, usage history circuit 1214, and thread state circuit 1216. Policy circuit 1220 may include one or more of power policy circuit 1222, fairness policy circuit 1224, performance guarantee policy circuit 1226, and throughput policy circuit 1228. Embodiments may include, combine, and / or implement each of these circuits in various ways depending on the type and amount of resources to be allocated and the desired policy.

[0131] The performance history circuit 1212 may include circuitry, structures, and / or hardware for monitoring, tracking, recording, and / or reporting thread performance in one or more ways. In an embodiment, the performance history circuit 1212 may include one or more hardware counters 1212A per thread to count one or more performance metrics for each thread, such as instructions retired per some measure of time or duration. For example, the measure of time or duration may be a window of clock cycles, where the size of the window (e.g., represented by the letter 'N') may be fixed (e.g., hard-wired), configurable (e.g., by hardware or firmware), and / or programmable (e.g., by software). In an embodiment, N may be 1024.

[0132] The performance history circuit 1212 may also include one or more hardware comparators 1212B for comparing the performance of a thread as measured by the counter 1212A with one or more other threads. For example, at the end of each window of N clock cycles, the hardware comparator 1212B may compare the number of instructions retired by the first thread during the window with the number of instructions retired by the second thread, and may reset the counter 1212A for the next window. As described below, during the next window, the comparison result from the previous window may be used by the policy circuit 1220 and / or the decision circuit 1230. In an embodiment, the comparison result may be an ordering of the threads (e.g., which thread retired more instructions), the comparison result may be a ratio (e.g., calculating or approximating the ratio of the number of instructions retired by the first thread to the number of instructions retired by the second thread), and / or any other measurement and calculation results.

[0133] Embodiments may include more than one counter per thread. For example, each thread may provide two separate counters: a first counter for tracking instructions identified as "energy-intensive" (e.g., whose execution typically consumes more power than other instructions) and a second counter for counting other (i.e., non-energy-intensive) instructions. For example, AVX-512 FMA instructions (as defined below) may be identified as energy-intensive and tracked using a separate counter (possibly along with other energy-intensive instructions).

[0134] The usage history circuit 1214 may include circuitry, structures, and / or hardware for monitoring, tracking, recording, and / or reporting resource usage by a thread. In an embodiment, the usage history circuit 1214 may include one or more hardware counters 1214A for counting resource usage by each thread, and one or more hardware comparators 1214B for comparing resource usage between threads. As described below, one or more results from the counters 1214A and / or comparators 1214B may be used by the policy circuit 1220 and / or the decision circuit 1230.

[0135] For example, for divisible resources such as buffers, a counter can count the number of entries occupied by a thread. The count to be used for further calculation and / or allocation decisions can be a current count, directly reported or used at any point in time, and / or can be an average count averaged within a window (e.g., a window of size N as described above). For indivisible resources, the count to be used for further calculation and / or allocation decisions can be a count of average time or weighted time (e.g., the number of times a thread uses a resource within a time window, wherein the count is reset at the end of each time window, or the count is right-shifted (divided by a power of two) at the end of each time window). The result based on any of these counts can be the count itself, the per-thread ranking of the count, and / or the ratio of the thread to the thread of the count.

[0136] Thread state circuit 1216 may include circuitry, structures, and / or hardware for monitoring, tracking, recording, and / or reporting thread states. For example, thread state circuit 1216 may report whether a thread is currently stalled, such as due to a long latency L2 / L3 or other cache miss.

[0137] The historical and current information reported by tracker circuit 1210 may be used for resource allocation calculations and decisions according to policies specified by policy circuit 1220. These policies may include any type of policy with any priority, in any combination, including considerations of power consumption, fairness, minimum performance guarantees, and throughput.

[0138] The power policy circuit 1222 may include circuit systems, structures, and / or hardware for implementing one or more power policies and / or prioritizing or selecting threads based on one or more policies. These policies may include any type of power policy with any priority and in any combination. For example, threads that use fewer energy-intensive instructions or threads that progress more slowly may be prioritized or selected.

[0139] The fairness policy circuit 1224 may include circuit systems, structures, and / or hardware for implementing one or more fairness policies and / or prioritizing or selecting threads based on one or more policies. For example, threads with lower recent performance, lower divisible resource occupancy, and / or lower indivisible resource recent usage may be prioritized or selected.

[0140] The performance guarantee policy circuit 1226 may include circuit systems, structures, and / or hardware for implementing one or more minimum performance guarantee policies and / or prioritizing or selecting threads based on one or more policies. For example, threads that have made progress below a certain minimum threshold may be prioritized or selected based on the performance guarantee policy.

[0141] Throughput policy circuitry 1228 may include circuitry, structures, and / or hardware for implementing one or more throughput policies and / or prioritizing or selecting threads based on one or more policies. For example, threads that make relatively more or faster progress than other threads may be prioritized or selected.

[0142] Any or all of the power policy circuit 1222, the fairness policy circuit 1224, the performance guarantee policy circuit 1226, the throughput policy circuit 1228, and / or any other policy circuits may include separate storage locations or registers in which information and / or criteria used to implement, modify (e.g., strengthen or weaken the importance of a policy or one or more criteria or metrics used by a policy), or otherwise dynamically influence a policy are stored. An embodiment may also or instead include a central or shared storage location or register for this information. Any one or more of the individual or group storage locations are represented as policy registers 1220A. In an embodiment, any such storage location or register may be configurable (e.g., by hardware or firmware) or programmable (e.g., by software).

[0143] The decision circuit 1230 may include circuit systems, structures, and / or hardware for receiving information, results, and / or signals from the tracker circuit 1210 and information, criteria, and / or signals from the policy circuit 1220 to use, weight, prioritize, filter, compare, combine, override, or otherwise process to generate information that may result in selecting a thread to which resources are allocated and / or one or more indications or signals regarding the decision. For example, in an embodiment including a throughput policy and a minimum performance guarantee, the throughput policy may give preference to selecting a first thread, but the decision circuit 1230 may override the preference and select a second thread to help meet the minimum performance guarantee of the second thread. In an embodiment, the resource allocator 1200 may include multiple instances of one or more embodiments of the decision circuit 1230, each instance for any resource or resource group, and each instance implementing any one or more resource allocation policies or combinations of resource allocation policies, and each instance implementing any one or more methods or combinations of methods described below, wherein each instance may be configured or programmed to select a thread according to any method or combination of methods (e.g., each may assign different weights to information received from each individual policy circuit in the policy circuit 1220).

[0144] In embodiments including indivisible resources, decision circuitry 1230 may determine which thread has priority for dynamic full allocation of indivisible resources. In embodiments including divisible resources, decision circuitry 1230 may determine which thread has priority for partial dynamic allocation of divisible resources and / or a portion of a divisible resource, and / or how many (e.g., how many buffer entries) of the divisible resource to allocate to the thread.

[0145] In an embodiment, the decision circuit 1230 may generate or provide one or more information, decision results, indicators and / or signals, for example by storing them in one or more storage locations accessible to the allocator circuit 1240 and / or sending them directly to the allocator circuit 1240, wherein the information, decision results, indicators and / or signals may identify a single thread having a higher priority than any number of other threads or may specify a priority ranking of two or more threads.

[0146] The allocator circuit 1240 may include circuit systems, structures and / or hardware for receiving information, decision results, indicators and / or signals from the decision circuit 1230 to act on, complete and / or implement resource allocation decisions, such as by responding to a decision from the decision circuit 1230 indicating that a first thread has a higher priority than a second thread, thereby sending one or more signals to indicate that a resource (e.g., resource 1250) is allocated in whole or in part to the thread. To this end, the allocator circuit 1240 may send one or more signals (e.g., "go" signal 1240C) to a dispatch or other circuit that allows a particular thread to use an indivisible resource or to use one or more portions of a divisible resource.

[0147] In an embodiment, the allocator circuit 1240 may also receive one or more requests (e.g., requests 1240A and 1240B) to use resources. The request may be a signal and / or any other type of indication from a thread, from a resource, and / or from any type of dispatch circuit associated with a thread or resource. In an embodiment, the allocator circuit 1240 may select or arbitrate between or among the thread requests, for example, using information, decision results, indicators, and / or signals from the decision circuit 1230 to determine the thread to which the resource is to be allocated.

[0148] In an embodiment, the allocator circuit 1240 may include circuitry, structures, and / or hardware for acting on the allocation decision from the decision circuit 1230 subject to or based on additional information or constraints. For example, the allocator circuit 1240 may include a set of fixed, configurable, or programmable storage locations or registers 1242, with one register per thread indicating how many portions of the divisible resource (e.g., how many entries of a buffer) are dedicated to each thread, a set of counters 1244, one per thread, for tracking how much of each portion is currently being used by each thread, and a set of comparators 1246, one per thread, for checking whether the thread is using its full allocation. The allocator circuit 1240 may use the results from the comparators 1246 to accept or reject the allocation decision from the decision circuit 1230. Alternatively or alternatively, an embodiment may include storage of an indicator for each portion of the divisible resource (e.g., a bit or field for each entry in a buffer) to indicate which thread (or threads) is allowed to use that portion of the resource, and the allocator circuit 1240 may use the stored indicator to accept or reject the allocation decision from the decision circuit 1230.

[0149]

[0150] Embodiments of the present invention may include a processor including a resource allocator and a resource including a tracker circuit, a policy circuit, a decision circuit, and an allocator circuit. The tracker circuit may be used to track at least one of a performance history of a resource, a usage history of a resource, and a thread state, and the policy circuit may be used to provide policy information for implementing a resource allocation policy. The decision circuit may be used to select a thread based on an output of the tracker circuit and the policy information. The allocator circuit may be used to allocate resources to threads using the output of the decision circuit.

[0151] Algorithmic competitive sharing of resources

[0152] According to some exemplary embodiments, the processor core may support algorithmic SMT features. In some embodiments, this feature solves the thread allocation problem for available resources that compete for sharing in the pipeline. In some embodiments, this problem is solved using a priority algorithm. In some embodiments, the branch predictor blocks in the pipeline can be competitively shared, and a priority algorithm can be used to perform efficient entry allocation. In some embodiments, the priority algorithm can be implemented in hardware and / or software. In some embodiments, thread allocation can be performed using two or more threads. In some embodiments, thread allocation can allocate the most efficient thread to the available resources in the pipeline to achieve the highest per-clock instruction (IPC) and / or pipeline throughput. In some embodiments, this feature can provide the best known algorithm for prioritizing thread allocation to available resources. With the increase in the number of threads and / or the increase in context switches between threads, the feature can provide further benefits by efficiently allocating resources.

[0153] Fig.13 1 is a block diagram showing algorithmic SMT features that may be included in a processor 1300 according to an embodiment. Priority algorithm hardware may, for example, include management based on dynamic behavior. Priority hardware may include at least one of an event detection block 1301, a performance counter marking block 1302, a deadlock prevention block 1303, and an instruction type / category block 1304. Event detection block 1301 may, for example, detect one or more events, such as cores, clearing frequencies (e.g., JE clearing and CR clearing), frequencies of BRs, interrupts, and cache misses. Performance counter marking block 1302 may, for example, count one or more of the following: instruction retirement, code miss, L2 / L3 miss. Deadlock prevention block 1303 may prevent a deadlock state. Instruction type / category block 1304 may, for example, allow floating point instructions to retire. In some embodiments, one or more of the above may be implemented in software and / or firmware. Additionally, in some embodiments, software may allow an operating system (OS) and / or a virtual machine manager (VMM) to set priorities.

[0154] In some embodiments, the priority algorithm may have learning capabilities such as machine learning, etc. The learning capabilities may provide smarter thread selection and may be adaptive based on, for example, historical data and / or patterns being collected.

[0155] In some embodiments, there may be more than one thread with similar events. In some embodiments, in the case where there is a tie between threads, a priority scheme may be used. For example, tie-breaking may be performed by random selection, selecting a lower numbered thread, selecting a higher numbered thread, and / or selecting alternating threads.

[0156] Fig.14 is a flow chart showing a method for an algorithmic SMT feature that can be executed by a processor according to an embodiment. As shown in 1401, the method may include determining whether a competitive shared resource in a pipeline is available. As shown in 1402, the method may further include prioritizing threads. For example, if there is more than one event, the threads may be prioritized. As shown in 1403, the method may further include selecting the highest priority event or marker. For example, the highest priority event or marker may be selected based on an allocation algorithm. As shown in 1404, the method may further include allocating resources to threads. For example, resources may be allocated to the most desired thread based on a priority algorithm.

[0157] Fig.15 is a block diagram illustrating algorithmic SMT features that may be included in a processor according to an embodiment. Fig.15 The algorithm priority block is used to assign threads such as thread T0 to competing shared resources. Fig.14 The block 1401 in the example determines that a resource 1501 that is being competed for is available. The algorithm priority block 1502 may be configured to prioritize the resource when there are more than one event, such as event Evt1 and event Evt2, for example, based on Fig.14 The algorithm priority block 1502 may also be based on, for example, Fig.14 Block 1403 in picks the highest priority event or token based on the allocation algorithm. Algorithm priority block 1502 may also allocate resources such as 1501 to the largest disabled thread, such as T0, based on the priority algorithm.

[0158] In some embodiments, the priority algorithm may include an integer renaming algorithm and / or a floating point renaming algorithm. The priority algorithm may include event-based determinations based on events such as cores, clears, and interrupts. The priority algorithm may include performance counters that may count occurrences such as instruction retirements and code misses. The priority algorithm may include limiting physical registers using deadlock prevention, and / or determining cache misses. The priority algorithm may include determining instruction types and categories. The priority algorithm may include allocating registers, such as allocating more floating point registers for floating point word lines. The priority algorithm may include managing priorities through software. For example, the priority algorithm may allow an operating system and / or a virtual machine manager to provide priorities. The priority algorithm may include, for example, hardware-managed priorities based on dynamic behavior.

[0159] In some embodiments, the priority algorithm may include a branch predictor algorithm. In some embodiments, the branch predictor algorithm may control the action of a branch target buffer (BTB) based on one or more of: clear frequency (e.g., JE clear and CR clear), branch frequency (e.g., all, taken, not taken), properties other than branches (e.g., instruction retirement, L2 / L3 miss). The priority algorithm may include managing priorities through software. For example, the priority algorithm may allow an operating system and / or a virtual machine manager to provide priorities. The priority algorithm may include, for example, hardware-managed priorities based on dynamic behavior. Fig.16 A block diagram of an implementation of a branch predictor priority algorithm according to an exemplary embodiment is shown. Partition logic 1602 may receive inputs 1603 such as clear frequency (e.g., JE clear and CR clear), branch frequency (e.g., all, taken, not taken), properties other than branches (e.g., instruction retirement, L2 / L3 miss), etc. Partition logic 1602 may allocate entries of a branch target buffer (BTB) 1601 based on input 1603.

[0160]

[0161] Embodiments may include a processor configured to identify an available contended shared resource; select a thread based at least in part on a priority algorithm; and assign the selected thread to the available contended shared resource.

[0162] In some embodiments, one or more of the following apply. In some embodiments, the processor may be further configured to competitively share branch predictions and use a priority algorithm to perform entry allocation. In some embodiments, the processor may be further configured to allocate a second thread based on a priority algorithm. In some embodiments, the processor may be further configured to allocate the most efficient thread to the available resources in the pipeline to increase at least one of instructions per clock (IPC) and pipeline throughput. In some embodiments, the processor may be further configured to provide a best known algorithm for prioritizing thread allocation to available resources. In some embodiments, the processor may be further configured to prioritize when two or more events are detected. In some embodiments, the processor may be further configured to select at least one of the highest priority event and tag based on an allocation algorithm.

[0163] In some embodiments, the processor may include an event detection block, a performance counter marking block, a deadlock prevention block, and an instruction type / category block. In some embodiments, the event detection block may detect at least one of a core, a clear frequency, a BR frequency, an interrupt, and a cache miss. In some embodiments, the performance counter marking block may count at least one of instruction retirement, code miss, and L2 / L3 miss. In some embodiments, the deadlock prevention block may prevent a deadlock state. In some embodiments, the instruction type / category block may allow floating point instructions to retire. In some embodiments, the processor may be further configured to allow at least one of an operating system (OS) and a virtual machine manager (VMM) to set a priority. In some embodiments, the priority algorithm may have at least one learning capability. In some embodiments, at least one learning capability may be adaptive based on at least one of historical data and a workload pattern.

[0164] In some embodiments, the priority algorithm may include at least one of an integer renaming algorithm and a floating point renaming algorithm. The priority algorithm may include event-based determinations. The event-based determinations may include one or more of cores, clears, and interrupts. The priority algorithm may include performance counters. The performance counters may count occurrences. The occurrences may be one or more of instruction retirements and code misses. The priority algorithm may include limiting physical registers, using deadlock prevention, and determining cache misses. The priority algorithm may include determining instruction types and categories. The priority algorithm may include allocating registers. Allocating registers may include allocating more floating point registers for floating point word lines. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based on dynamic behavior.

[0165] In some embodiments, the priority algorithm may include a branch predictor algorithm. In some embodiments, the branch predictor algorithm may control the action of the branch target buffer (BTB) based at least in part on one or more of the following: clear frequency, branch frequency, and properties other than branches. Clearing may include one or more of JE clearing and CR clearing. Branch frequency may include one or more of all, adopted, and not adopted. Properties other than branches may include one or more of instruction retirement and L2 / L3 misses. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based at least in part on dynamic behavior. The priority algorithm may include receiving inputs using partitioning logic. The inputs may include one or more of clear frequency, branch frequency, and properties other than branches. The partitioning logic may allocate entries of the branch target buffer (BTB) based on the inputs.

[0166] Embodiments may include a method comprising: identifying an available contention-shared resource; selecting a thread based at least in part on a priority algorithm; and assigning the selected thread to the available contention-shared resource.

[0167] In some embodiments, one or more of the following apply. In some embodiments, the method may further include competitively sharing branch predictions and using a priority algorithm to allocate entries. In some embodiments, the method may further include allocating a second thread based on a priority algorithm. In some embodiments, the method may further include allocating the most efficient thread to available resources in the pipeline to increase at least one of instructions per clock (IPC) and pipeline throughput. In some embodiments, the method may further include providing a best known algorithm for prioritizing thread allocation to available resources. In some embodiments, the method may further include prioritizing when two or more events are detected. In some embodiments, the method may further include selecting at least one of the highest priority event and the tag based on the allocation algorithm.

[0168] In some embodiments, the method may further include an event detection block, a performance counter marking block, a deadlock prevention block, and an instruction type / category block. In some embodiments, the method may further include using an event detection block to detect at least one of a core, a clear frequency, a BR frequency, an interrupt, and a cache miss. In some embodiments, the method may further include using a performance counter marking block to count at least one of instruction retirement, code miss, and L2 / L3 miss. In some embodiments, the method may further include using a deadlock prevention block to prevent a deadlock state. In some embodiments, the method may further include using an instruction type / category block to allow floating point instructions to retire. In some embodiments, the method may further include allowing at least one of an operating system (OS) and a virtual machine manager (VMM) to set a priority. In some embodiments, the priority algorithm may have at least one learning capability. In some embodiments, at least one learning capability may be adaptive based on at least one of historical data and a workload pattern.

[0169] In some embodiments, the priority algorithm may include at least one of an integer renaming algorithm and a floating point renaming algorithm. The priority algorithm may include event-based determinations. The event-based determinations may include one or more of cores, clears, and interrupts. The priority algorithm may include performance counters. The performance counters may count occurrences. The occurrences may be one or more of instruction retirements and code misses. The priority algorithm may include limiting physical registers, using deadlock prevention, and determining cache misses. The priority algorithm may include determining instruction types and categories. The priority algorithm may include allocating registers. Allocating registers may include allocating more floating point registers for floating point word lines. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based on dynamic behavior.

[0170] In some embodiments, the priority algorithm may include a branch predictor algorithm. In some embodiments, the branch predictor algorithm may control the action of a branch target buffer (BTB) based at least in part on one or more of: clear frequency, branch frequency, and properties other than branches. Clearing may include JE clearing. Branch frequency may include one or more of all, adopted, and not adopted. Properties other than branches may include one or more of instruction retirements and L2 / L3 misses. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based at least in part on dynamic behavior. The priority algorithm may include receiving inputs using partition logic. The inputs may include one or more of clear frequency, branch frequency, and properties other than branches. The partition logic may allocate entries of a branch target buffer (BTB) based on the inputs.

[0171] An embodiment may include a non-transitory machine-readable medium storing at least one instruction that, when executed by a processor, causes the processor to perform a method comprising: identifying an available contention-shared resource; selecting a thread based at least in part on a priority algorithm; and assigning the selected thread to the available contention-shared resource.

[0172] In some embodiments, one or more of the following apply. In some embodiments, the method may further include competitively sharing branch predictions and using a priority algorithm to allocate entries. In some embodiments, the method may further include allocating a second thread based on a priority algorithm. In some embodiments, the method may further include allocating the most efficient thread to available resources in the pipeline to increase at least one of instructions per clock (IPC) and pipeline throughput. In some embodiments, the method may further include providing a best known algorithm for prioritizing thread allocation to available resources. In some embodiments, the method may further include prioritizing when two or more events are detected. In some embodiments, the method may further include selecting at least one of the highest priority event and the tag based on the allocation algorithm.

[0173] In some embodiments, the method may further include an event detection block, a performance counter marking block, a deadlock prevention block, and an instruction type / category block. In some embodiments, the method may further include using an event detection block to detect at least one of a core, a clear frequency, a BR frequency, an interrupt, and a cache miss. In some embodiments, the method may further include using a performance counter marking block to count at least one of instruction retirement, code miss, and L2 / L3 miss. In some embodiments, the method may further include using a deadlock prevention block to prevent a deadlock state. In some embodiments, the method may further include using an instruction type / category block to allow floating point instructions to retire. In some embodiments, the method may further include allowing at least one of an operating system (OS) and a virtual machine manager (VMM) to set a priority. In some embodiments, the priority algorithm may have at least one learning capability. In some embodiments, at least one learning capability may be adaptive based on at least one of historical data and a workload pattern.

[0174] In some embodiments, the priority algorithm may include at least one of an integer renaming algorithm and a floating point renaming algorithm. The priority algorithm may include event-based determinations. The event-based determinations may include one or more of cores, clears, and interrupts. The priority algorithm may include performance counters. The performance counters may count occurrences. The occurrences may be one or more of instruction retirements and code misses. The priority algorithm may include limiting physical registers, using deadlock prevention, and determining cache misses. The priority algorithm may include determining instruction types and categories. The priority algorithm may include allocating registers. Allocating registers may include allocating more floating point registers for floating point word lines. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based on dynamic behavior.

[0175] In some embodiments, the priority algorithm may include a branch predictor algorithm. In some embodiments, the branch predictor algorithm may control the action of the branch target buffer (BTB) based at least in part on one or more of the following: clear frequency, branch frequency, and properties other than branches. Clearing may include one or more of JE clearing and CR clearing. Branch frequency may include one or more of all, adopted, and not adopted. Properties other than branches may include one or more of instruction retirement and L2 / L3 misses. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based at least in part on dynamic behavior. The priority algorithm may include receiving inputs using partitioning logic. The inputs may include one or more of clear frequency, branch frequency, and properties other than branches. The partitioning logic may allocate entries of the branch target buffer (BTB) based on the inputs.

[0176] Embodiments may include a system including a memory and a processor configured to identify an available contended shared resource; select a thread based at least in part on a priority algorithm; and assign the selected thread to the available contended shared resource.

[0177] In some embodiments, the priority algorithm may include at least one of an integer renaming algorithm and a floating point renaming algorithm. The priority algorithm may include event-based determinations. The event-based determinations may include one or more of cores, clears, and interrupts. The priority algorithm may include performance counters. The performance counters may count occurrences. The occurrences may be one or more of instruction retirements and code misses. The priority algorithm may include limiting physical registers, using deadlock prevention, and determining cache misses. The priority algorithm may include determining instruction types and categories. The priority algorithm may include allocating registers. Allocating registers may include allocating more floating point registers for floating point word lines. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based on dynamic behavior.

[0178] In some embodiments, the priority algorithm may include a branch predictor algorithm. In some embodiments, the branch predictor algorithm may control the action of the branch target buffer (BTB) based at least in part on one or more of the following: clear frequency, branch frequency, and properties other than branches. Clearing may include one or more of JE clearing and CR clearing. Branch frequency may include one or more of all, adopted, and not adopted. Properties other than branches may include one or more of instruction retirement and L2 / L3 misses. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based at least in part on dynamic behavior. The priority algorithm may include receiving inputs using partitioning logic. The inputs may include one or more of clear frequency, branch frequency, and properties other than branches. The partitioning logic may allocate entries of the branch target buffer (BTB) based on the inputs.

[0179] In some embodiments, one or more of the following apply. In some embodiments, the processor may be further configured to competitively share branch predictions and use a priority algorithm to perform entry allocation. In some embodiments, the processor may be further configured to allocate a second thread based on a priority algorithm. In some embodiments, the processor may be further configured to allocate the most efficient thread to the available resources in the pipeline to increase at least one of instructions per clock (IPC) and pipeline throughput. In some embodiments, the processor may be further configured to provide a best known algorithm for prioritizing thread allocation to available resources. In some embodiments, the processor may be further configured to prioritize when two or more events are detected. In some embodiments, the processor may be further configured to select at least one of the highest priority event and tag based on an allocation algorithm.

[0180] In some embodiments, the processor may include an event detection block, a performance counter marking block, a deadlock prevention block, and an instruction type / category block. In some embodiments, the event detection block may detect at least one of a core, a clear frequency, a BR frequency, an interrupt, and a cache miss. In some embodiments, the performance counter marking block may count at least one of instruction retirement, code miss, and L2 / L3 miss. In some embodiments, the deadlock prevention block may prevent a deadlock state. In some embodiments, the instruction type / category block may allow floating point instructions to retire. In some embodiments, the processor may be further configured to allow at least one of an operating system (OS) and a virtual machine manager (VMM) to set a priority. In some embodiments, the priority algorithm may have at least one learning capability. In some embodiments, at least one learning capability may be adaptive based on at least one of historical data and a workload pattern.

[0181] In some embodiments, the priority algorithm may include at least one of an integer renaming algorithm and a floating point renaming algorithm. The priority algorithm may include event-based determinations. The event-based determinations may include one or more of cores, clears, and interrupts. The priority algorithm may include performance counters. The performance counters may count occurrences. The occurrences may be one or more of instruction retirements and code misses. The priority algorithm may include limiting physical registers, using deadlock prevention, and determining cache misses. The priority algorithm may include determining instruction types and categories. The priority algorithm may include allocating registers. Allocating registers may include allocating more floating point registers for floating point word lines. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based on dynamic behavior.

[0182] In some embodiments, the priority algorithm may include a branch predictor algorithm. In some embodiments, the branch predictor algorithm may control the action of the branch target buffer (BTB) based at least in part on one or more of the following: clear frequency, branch frequency, and properties other than branches. Clearing may include one or more of JE clearing and CR clearing. Branch frequency may include one or more of all, adopted, and not adopted. Properties other than branches may include one or more of instruction retirement and L2 / L3 misses. The priority algorithm may include managing priorities through software. The priority algorithm may allow one or more of an operating system and a virtual machine manager to provide priorities. The priority algorithm may include hardware-managed priorities. The hardware-managed priorities may be based at least in part on dynamic behavior. The priority algorithm may include receiving inputs using partitioning logic. The inputs may include one or more of clear frequency, branch frequency, and properties other than branches. The partitioning logic may allocate entries of the branch target buffer (BTB) based on the inputs.

[0183] Thread Switching

[0184] According to an embodiment of the present invention, a processor core may support an SMT thread switching feature. In a processor core that implements SMT using shared resources, SMT may involve selecting which of two or more threads to select at each level in the processor issue / execution pipeline. It may be desirable that an embodiment of the present invention including an SMT thread switching feature provide such a selection affected by the priority between performance, fairness, and other factors (e.g., improving performance, reducing power consumption, and implementing power saving features, as well as improving fairness, minimum performance guarantees, throughput, instructions per clock (IPC), instructions per unit time, quality of service, time and / or memory efficiency, just to list some applicable criteria). For example, in the issue / execution pipeline of the processor core 900, arbitration may be used to select the thread on which the branch predictor 911 will start predicting, the thread that finds the prediction in the i-TLB 916, the thread that finds the i-TLB conversion in the i-cache 913, the thread that decodes the byte from the i-cache 913 in the decoder 914, the thread that reads from the op cache 912, the thread that reads from the micro-operation queue 915, etc.

[0185] Fig.17 1 is a block diagram illustrating an arbitration circuit 1700 for an SMT thread switching feature that may be included in a processor according to an embodiment of the present invention. The arbitration circuit 1700 may include circuitry, structures, and / or hardware for selecting which of two or more threads to advance at any of the various stages in the processor issue / execution pipeline. A processor or processor core may include multiple instances of one or more embodiments of the arbitration circuit 1700, each instance for any one or more pipeline stages or resources, each instance including Fig.17 Any one or more of the blocks shown in the block, and each instance is used to implement any one or more methods or combinations of methods described below. In addition, all or part of any instance of arbitration circuit 1700 can be included in, integrated in, or incorporated into other circuit systems, structures, and / or hardware of a processor or processor core, such as resource allocation, scheduling, or sharing circuit systems.

[0186] Arbitration circuit 1700 may include simple round-robin circuit 1710, high throughput round-robin circuit 1720, dynamic round-robin circuit 1730, and software controllable round-robin circuit 1740, as well as any other circuitry desired to implement any other round-robin or other scheme(s).

[0187] Simple loop circuit 1710 may include circuitry, structure and / or hardware for executing a simple loop scheme to select threads. For example, the simple loop circuit may implement a scheme in which selections are continuously alternated between selections; i.e., thread 0, then thread 1, then thread 0, then thread 1, etc.; or thread 0, thread 1, thread 2, thread 0, thread 1, thread 2, etc.; etc.

[0188] The high-throughput round-robin circuitry 1720 may include circuitry, structure, and / or hardware for executing a modified round-robin scheme to select threads based on a desire for prioritized throughput rather than other possible factors (such as fairness). For example, the high-throughput round-robin circuitry may implement a simple round-robin scheme (e.g., as described above) as long as each thread has available work at a thread switch point, otherwise it may select a thread with available work. In embodiments with more than two threads to select from, the high-throughput round-robin circuitry may discard any thread without available work from the simple round-robin scheme.

[0189] Dynamic loop circuitry 1730 may include circuitry, structures, and / or hardware for executing a dynamically modifiable looping scheme to select threads based on the dynamic behavior of the threads. Dynamic loop circuitry 1730 may include and / or use performance counters, other hardware counters, or other structures (any of which is represented as 1732) to provide information (e.g., heuristics) on which decisions are based. The ratio or other criteria on which thread selection is based to prioritize threads and the indication that dynamic behavior metrics are to be used may be fixed (e.g., hard-wired), configurable (e.g., by hardware or firmware), or programmable (e.g., by software). For example, a first thread may be prioritized or selected at a ratio of 2:1 to a second thread (e.g., thread 0, thread 0, thread 1, thread 0, thread 0, thread 1, etc.). Examples of factors or criteria for determining preference of one thread over another are: misprediction rate, instructions per cycle, cache miss rate, etc.)

[0190] Software controllable loop circuit 1740 may include circuitry, structures, and / or hardware for executing a modified loop scheme to select threads based on priorities provided by software (e.g., and an operating system or virtual machine monitor), which may have more information about desired system behavior than would otherwise be available to software. Indications, as well as the ratio of the preferred selections and / or any other information about which scheme to use or how to implement the scheme (e.g., whether and how to combine software controllable loops with dynamic and / or modifiable loops) may be provided in a programmable storage location or register 1742 within or accessible by arbitration circuit 1700.

[0191] In embodiments, combinations of approaches are possible. For example, software may provide (e.g., using circuitry and / or techniques for software controllable loops) hints about which threads to prioritize, and hardware (e.g., circuitry or techniques for dynamic loops) may determine the ratios by which to prioritize the threads based on thread behavior and / or heuristics.

[0192]

[0193] An embodiment of the present invention may include a processor, the processor including an arbitration circuit. The arbitration circuit may include a first loop circuit and a second loop circuit. The first loop circuit may be used to implement a simple loop thread switching scheme. The second loop circuit may be used to implement a dynamically modified loop thread switching scheme.

[0194] Deadlock Avoidance

[0195] According to an embodiment of the present invention, the processor core can support SMT deadlock avoidance features. In some cases, resource sharing may cause threads to progress slowly due to lack of one or more resources, due to being unable to advance (e.g., retirement instructions) and no progress and / or any other deadlock type situation. Therefore, the user experience may include significantly slower performance or errors, failures, or crashes. It may be expected that the embodiments of the present invention including deadlock avoidance features reduce deadlock type situations and improve user experience. Other benefits of these embodiments may include, for example, improving performance, reducing power consumption and implementing power saving features and improving fairness, minimum performance guarantees, throughput, instructions per clock (IPC), instructions per unit time, quality of service, time and / or memory efficiency, only listing some applicable standards.

[0196] Fig.18 is a block diagram illustrating deadlock avoidance hardware 1800 that may be included in a processor in accordance with an embodiment of the present invention. Deadlock avoidance hardware 1800 may include circuitry, structures, and / or hardware for influencing the allocation and usage of core circuits, structures, units, and resources, and portions thereof, to reduce the occurrence of deadlock-type situations. In an embodiment, deadlock avoidance hardware 1800 may be implemented to avoid deadlocks involving a single resource and / or multiple resources. In either case, a processor or processor core may include multiple instances of one or more embodiments of deadlock avoidance hardware 1800, each instance for any one or more resources, each instance including Fig.18 Any one or more of the blocks shown in , and each instance is used to implement any one or more methods or combinations of methods described below. In addition, all or part of any instance of deadlock avoidance hardware 1800 can be included in, integrated in, or incorporated into other circuit systems, structures, and / or hardware of a processor or processor core, such as resource allocation, scheduling, or sharing circuit systems.

[0197] Deadlock avoidance hardware 1800 may include allocator circuit 1810, which may include circuitry, structure, and / or hardware for allocating resources to threads. Embodiments or examples of embodiments of allocator circuit 1810 may represent or correspond to Fig.12 An embodiment or an example of an embodiment of the distributor circuit 1240 in.

[0198] The deadlock avoidance hardware 1800, the allocator circuit CGA10, and / or any other portion of the processor or processor core may include circuitry, structures, and / or hardware for dynamically disabling, blocking, or otherwise preventing the allocator circuit CGA10 from allocating a resource or a portion of a divisible resource to any one or more specific threads. For example, in embodiments including any type of round-robin scheme for selecting or arbitrating between or among thread requests, such as those described above, blocking a particular thread from using a resource may be implemented by temporarily dropping the thread from the round-robin scheme. An embodiment may include an AND gate having as an input a thread request signal (e.g., 1240A, 1240B) and a complement of a thread blocking signal (e.g., generated by the circuitry based on a resource usage counter 1820 or any other information, state, or signal as described below), such that the output of the AND gate may indicate whether a thread is to be allocated a resource or is to be considered a candidate thread for which a resource is to be allocated.

[0199] The deadlock avoidance hardware 1800 may also include a resource usage counter 1820. In an embodiment, the resource usage counter 1820 may be a per-thread hardware counter that counts the number of portions (e.g., entries) of a divisible resource (e.g., a buffer, a queue, a scheduler, a reservation station) that a particular thread is occupying or using. For a particular resource, an instance of the resource usage counter 1820 for a particular thread may be incremented in response to the allocator circuit 1810 allocating an entry to the thread, decremented in response to the entry being deallocated or removed, and cleared in response to a resource being flushed. The allocator circuit 1810 may be dynamically disabled or blocked (e.g., as described above) from allocating entries to the thread in response to the thread's count reaching or exceeding a threshold.

[0200] The threshold value may be selected to be less than the total number of entries in the resource to prevent any single thread from using all entries simultaneously, which could result in a deadlock type situation. The threshold value may also be selected or adjusted based on other factors or criteria, including factors or criteria related to tolerance for approaching a deadlock type situation and / or a desire to prioritize other metrics or factors of throughput or performance. The threshold value may be fixed (e.g., hardwired), configurable (e.g., by hardware or firmware), or programmable (e.g., by software).

[0201] In an embodiment, the divisible resource may be logically partitioned for specific threads and thread groups. For example, in a divisible resource having N entry groups, a subset of N1 entries (where N1 is less than N) may be reserved for use by only the first thread, a subset of N2 entries (where N2 is less than N) may be reserved for only one second, and the remaining subset of N-(N1+N2) entries may be allocated to any thread. In an embodiment, this approach may be enforced by one or more instances of the allocator circuit 1810.

[0202] In embodiments where completion of a load is dependent upon reading data from a cache, each cache entry may include a bit to indicate that the entry is locked by the thread that included the load from the entry. Use of the indicator bit set may be prevented from replacing the entry until a combination of the load completion clears the bit or the thread experiences a pipeline flush event (e.g., a mispredicted branch). In embodiments, this approach may be enforced by one or more instances of allocator circuit 1810.

[0203] In an embodiment, resource usage counter 1820 may be a per-thread hardware counter that counts the number of clock cycles that the oldest entry in the retirement queue for a particular thread (the stalled thread) has been waiting for indivisible resource dispatching (the condition involves the retirement queue because the thread requires a dispatch slot and a write-back slot). In response to the stalled thread count reaching or exceeding a threshold, allocator circuit 1810 may be dynamically disabled or blocked (e.g., as described above) so as not to dispatch operations from different threads to the scheduler of the indivisible resource. Alternatively, dispatching any operations to the indivisible resource may be disabled or blocked for a given number of clock cycles.

[0204] These methods can prevent deadlock type situations by using indivisible resources such as execution units that can perform different operations that consume a series of clock cycles. For example, it can allow operations that can be completed in a single cycle to use resources that might otherwise be busy completing a series of multi-cycle operations.

[0205] The threshold value may be fixed (e.g., hardwired), configurable (e.g., by hardware or firmware), or programmable (e.g., by software). The threshold value may be selected and / or dynamically adjusted based on various factors or criteria, including factors or criteria related to throughput and factors or criteria related to fairness. For example, if fairness is a priority, the threshold value may be gradually lowered to more aggressively allow each thread to make progress; if throughput is a priority, it may be gradually increased to more aggressively allow threads that are making progress to continue without interruption.

[0206]

[0207] Embodiments of the present invention may include a processor including deadlock avoidance hardware and resources. The deadlock avoidance hardware may include an allocator circuit and a resource usage counter. The allocator circuit may determine whether to allocate resources to a thread based on an output from the resource usage counter.

[0208] Data Path Characteristics

[0209] A processor core according to an embodiment of the present invention may include various features for supporting an instruction set architecture (ISA) having a data path narrower than that provided by the ISA. A plurality of such features are described individually using the following non-limiting examples, but embodiments may include any combination of these features.

[0210] The processor core may support features that allow operations to be performed on operands of larger sizes (e.g., load / store / arithmetic operations on internal 256-bit operands) by breaking the operations into multiple micro-operations (μops) that operate on smaller operands (e.g., multiple μops that operate on internal 128-bit values). Such a feature may be desirable for a variety of reasons: for example, a processor may support an instruction set architecture involving larger operand sizes, but may use a microarchitecture based on smaller operand sizes. Additionally or alternatively, a processor may support an instruction set architecture involving larger operand sizes and have a register file that includes such larger sized registers, but may include execution units that may only handle data in smaller blocks. Additionally or alternatively, a processor may have a larger sized register file, execution units, and load / store ports, but may need to execute μops using smaller sized operands for purposes such as power savings or scheduling. Other potential benefits of a processor including the features described below include, but are not limited to, improved performance, reduced power consumption and implementation of power saving features, as well as improved fairness, minimum performance guarantees, throughput, instructions per clock (IPC), instructions per unit time, quality of service, time and / or memory efficiency, to name just a few applicable criteria.

[0211] 256-bit to 128-bit data path loads and stores

[0212] According to an embodiment of the present invention, the processor core may support a feature that allows 256-bit loads and stores to be performed using 128-bit micro-operations (μops). In some embodiments, the processor may support a 256-bit instruction set architecture, but may use a 128-bit micro-architecture including a 128-bit register file. In some embodiments, the processor may have a 256-bit instruction set architecture and a 256-bit register file, but may include load and / or storage ports that may only handle data in 128-bit chunks.

[0213] Fig.19 1 is a diagram showing the use of a pair of 128-bit μops to load 256 bits into a 256-bit register file according to some embodiments. Memory 1901 includes a series of 256-bit values ​​such as the value stored in memory location 1902. The first μop 1903 retrieves the lower half of the value stored in memory location 1902, and the second μop 1904 retrieves the upper half of the value stored in memory location 1902. The two halves of the value stored in memory location 1902 are mixed together (1905), and the result of the mixed operation is placed in a 256-bit register file 1906.

[0214] Fig. 20 is a flow chart showing the above reference according to some embodiments Fig.19 The process described. During the process of decoding the instruction (2001), if a 256-bit load is detected, three μops including a first load μop, a second load μop, and a mixed μop are generated (box 2002). The μops are scheduled to be executed, and for each μop, the processor can wait until the data to be loaded / mixed is ready (2003). When the first add μop is executed, the processor can retrieve the lower half of the value stored in the memory location 1902, as shown in box 2004. When the second load μop is executed, the processor can retrieve the upper half of the value stored in the memory location 1902, as shown in box 2004. When the mixed μop is executed, the two retrieved halves of the value stored in the memory location 1902 are merged and placed in the 256-bit register file, as shown in box 2004. Finally, the decoded instruction is retired after completion, as shown in box 2005.

[0215] In some embodiments, a 128-bit μop may be used to store values ​​from a 256-bit register file into memory. Fig.212104. 256-bit register file 2101 includes 256-bit wide registers such as register 2102. A first storage μop 2103 retrieves the lower half of the value stored in register 2102 and stores it in the lower half of memory location 2104. A second storage μop 2105 retrieves the upper half of the value stored in register 2102 and stores it in the upper half of memory location 2104.

[0216] Fig. 22 is a flow chart showing the above reference according to some embodiments Fig.21 The process described. During the process of decoding the instruction (2201), if a 256-bit store is detected, 2 μops including a first store μop and a second store μop are generated (box 2202). The μops are scheduled to be executed, and for each micro-operation, the processor can wait until the data to be stored is ready (2203). When the first store μop is executed, as shown in box 2204, the processor can retrieve the lower half of the value stored in register 2102 and write it to the lower half of memory location 2104. When the second store μop is executed, as shown in box 2204, the processor can retrieve the upper half of the value stored in register 2102 and write it to the upper half of memory location 2104. Finally, the decoded instruction retires after completion, as shown in box 2205.

[0217] In some embodiments, a 256-bit load instruction may load a 256-bit value into two 128-bit registers by executing two μops, a first μop being used to load the lower half of the 256-bit value into the first 128-bit register, and a second μop being used to load the upper half of the 256-bit value into the second 128-bit register.

[0218] In some embodiments, loads are accomplished using a single μop that is a "double pump" - i.e., executed twice, once to load the lower half of a value from memory, and a second time to load the upper half of a value from memory. In some embodiments, stores are accomplished using a single μop that is a "double pump" - i.e., executed once to store the lower half of a register to memory, and once to store the upper half of a register to memory. In some embodiments, the μops used to implement 256-bit loads and / or stores may be scheduled according to a vector scheduling algorithm. In some embodiments, multiple μops involved in a load and / or store may be scheduled to execute on separate execution units using group scheduling techniques.

[0219] The load / store features described above are not limited to using any particular size memory, load port, or register file to perform loads and / or stores. For example, the techniques described above can be used to perform 512-bit loads and / or stores using underlying hardware that operates 256 bits at a time.]

[0220] 256-bit to 128-bit datapath execution

[0221] According to an embodiment of the present invention, the processor core may support 256-bit arithmetic operations that allow the use of 128-bit micro-operations (μops). In some embodiments, the processor may support a 256-bit instruction set architecture, but may use a 128-bit micro-architecture including a 128-bit register file. In other embodiments, the processor may have a 256-bit instruction set architecture and a 256-bit register file, but may include an execution unit that can handle data in 128-bit chunks. In some embodiments, the processor may have a 256-bit register file, an execution unit, and a load / store port, but for purposes such as power saving or scheduling, it may be desirable to use multiple 128-bit μops to implement 256-bit arithmetic operations.

[0222] Fig.23 This process according to some embodiments is shown. A 256-bit instruction 2301 is decoded by breaking it into two 128-bit μops 2302 and 2303, which are then independently scheduled for execution on one or more 128-bit execution units 2304, 2305. Fig.23 In the embodiment shown in FIG. 1 , the first 128-bit μop 2302 can use the lower half of the 256-bit operand provided to the 256-bit arithmetic instruction to execute the instruction, and the processor can then store the result in the lower half of the 256-bit destination register. The second 128-bit μop 2303 can use the upper half of the 256-bit operand provided to the 256-bit arithmetic instruction to execute the instruction, and the processor can then store the result in the upper half of the 256-bit destination register.

[0223] According to some embodiments, a 256-bit instruction is partitioned into a pair of 128-bit μops such that the lower half of the result is based only on the lower half of the operands of the 256-bit instruction, and the upper half of the result is based only on the upper half of the operands of the 256-bit instruction (i.e., "in-lane" operations). In these in-lane scenarios, the two 128-bit μops can be scheduled independently of each other because the result of the 256-bit instruction can be represented as two independent results of two independent 128-bit μops.

[0224] In some embodiments, each of the 128-bit μops represents the same instruction (e.g., an ADD instruction), and a 256-bit instruction can be implemented using a single 128-bit micro-op that is "double pumped" - i.e., executed twice, once to compute the lower half of the result, and once to compute the upper half of the result. In some embodiments, a 256-bit instruction can be "split" into two different micro-ops that are independently scheduled and executed on one or more execution units. In some embodiments, a 256-bit instruction can be executed simultaneously using two execution units, each executing a 128-bit μop (this process is sometimes referred to in the art as "group scheduling").

[0225] The in-channel execution features described above are not limited to using any particular size of memory value, load port, execution unit, or register file to execute instructions. For example, the techniques described above can be used to perform 512-bit operations using underlying hardware that operates 256 bits at a time, or to perform 1024-bit operations using underlying hardware that operates 512 bits at a time.

[0226] 256-bit to 128-bit data path executed across channels

[0227] In some embodiments, the 256-bit instruction to be executed cannot be partitioned into two completely independent 128-bit μops because the lower half of the result depends on the value stored in the upper half of the operand, and / or the upper half of the result depends on the value stored in the lower half of the operand (i.e., a “cross-lane” operation).

[0228] Cross-lane operations may be performed using temporary storage areas to store partial results, which are then combined into a final result and stored in a destination register. Fig.24 This process according to some embodiments of this feature is shown. A cross-lane 256-bit instruction QJA01 is decoded by splitting it into two 128-bit μops QJA02 and QJA03, which are then independently scheduled to execute on one or more 128-bit execution units QJA06, QJA07. A temporary storage area QJA04 is used to store partial results generated by μops QJA02 and QJA03. These temporary results are used by a third μop QJA05 to generate the final result.

[0229] In some embodiments, each of the 128-bit μops QJA02 and QJA03 represents the same instruction and can be implemented using a single 128-bit μop that is "double pumped" - that is, executed twice, once to calculate a first partial result stored in temporary storage area QJA04, and once to calculate a second partial result stored in temporary storage area QJA04. In some embodiments, the 256-bit instruction can be "split" into two different μops that are independently scheduled and executed on one or more execution units, with partial results of the μops stored in a temporary storage area. In some embodiments, the 256-bit instruction can be executed simultaneously using two execution units, each executing a 128-bit μop (this process is sometimes referred to in the art as "group scheduling"). In some embodiments, a "special" execution unit with 256-bit capability can be used to execute the 256-bit μop, thereby eliminating the need for a temporary storage area (e.g., temporary storage area QJA04).

[0230] The cross-lane execution features described above are not limited to using any particular size of memory value, load port, execution unit, or register file to execute instructions. For example, the techniques described above can be used to perform 512-bit operations using underlying hardware that operates 256 bits at a time, or to perform 1024-bit operations using underlying hardware that operates 512 bits at a time.

[0231] Additional standalone and composable features

[0232] A processor core according to an embodiment of the present invention may include various additional features for supporting increased performance and / or reduced power consumption. A number of such features are described individually using the following non-limiting examples, but embodiments may include any combination of these features.

[0233] Micro-operation cache

[0234] According to an embodiment, the processor core may support micro-operation cache features. According to some embodiments, the micro-operation cache features may include allocation, replacement strategies and different structural types (e.g., physical, virtual, etc.). The intelligent allocation in the micro-operation cache features may detect the type of instruction, such as a loop stream or a complex instruction with a microcode sequencer (MS) stream, rather than a simple instruction, and allocate accordingly. The micro-operation cache features may also include adding a sacrifice cache for potential future reuse and / or for determining how many micro-operations each cache line has for allocation. In some embodiments, the micro-operation cache may be used to store decoded instructions (micro-operations) in a micro-operation buffer so that the decoded instructions are reused later. In some embodiments, the use of the micro-operation buffer may shorten the pipeline by avoiding multiple (e.g., at least two) cycles of the instruction cache lookup and decoding stage. It may also save power by using already available micro-operations and decoding in the micro-operation buffer. In some embodiments, there may be more than one thread with similar events (e.g., micro-operation type, micro-operation decoding difficulty, micro-operation usage pattern), and a priority scheme may be used to allocate resources to the micro-operation cache when there is a connection between threads. In some embodiments, the micro-op cache feature may provide intelligent allocation, replacement policy, and / or configuration for the micro-op cache to achieve the highest IPC and / or instruction throughput in the pipeline.

[0235] Fig.252 is a block diagram showing a micro-operation cache feature that can be included in a processor according to an embodiment. The micro-operation cache feature can include one or more of the following: an instruction decoder 2501, an intelligent allocation and replacement block 2502, and a micro-operation cache 2503. The intelligent allocation and replacement block 2502 can receive instructions from the instruction decoder 2501. The instruction decoder 2501 can also be omitted, and the intelligent allocation and replacement block 2502 can receive instructions that have been decoded. The intelligent allocation and replacement block 2502 can algorithmically determine the type of instruction to be allocated, such as complex instructions (e.g., with MS flow), loop flow. The intelligent allocation and replacement block 2502 can determine where to allocate instructions in the micro-operation cache KQA03 and can allocate instructions in the determined position. In some embodiments, the intelligent allocation and replacement block 2502 can, for example, algorithmically determine the type of instruction to be allocated based on one or more of the following: historical usage patterns, usage frequency, decoding difficulty, and decoding time of instructions. The smart allocation and replacement block can determine where to store instructions in the micro-operation cache, for example, based on one or more of the following parameters: least recently used instruction information, historical usage patterns of instructions, usage frequency, decoding difficulty, whether the instruction is part of a loop and whether to store other instructions from the loop, and the decoding time of the instructions stored in the micro-operation cache. For example, these parameters can be stored in the smart allocation and replacement block, in the micro-operation cache, and / or elsewhere (e.g., in a separate table).

[0236] Fig.26 26 is a flow chart illustrating a method for a micro-operation cache feature that can be performed by a processor according to an embodiment. The method may include receiving instructions as shown in block 2601. As shown in block 2602, the method may further include algorithmically determining the type of instruction to be allocated, such as complex instructions, loop flow, etc. As shown in block 2603, the method may further include determining where to allocate instructions in the micro-operation cache. As shown in block 2604, the method may further include allocating instructions in the determined location of the micro-operation cache.

[0237] Fig. 27 2701, a micro-operation cache feature may be included in a processor according to an embodiment. The micro-operation cache feature may include one or more of a branch prediction unit (BPU) 2701, an instruction cache tag 2702, a micro-operation tag 2703, an instruction cache 2704, a micro-operation cache 2705, a decoder 2706, and a micro-operation queue 2707. The BPU 2701 may perform branch prediction (e.g., to determine whether to execute a conditional operation). Fig. 27As shown on the left side of , instruction cache tag 2702 can receive instruction tags from BPU 2701 and determine the instruction associated with the instruction tag. The instruction can be retrieved from instruction cache 2704 and decoded by decoder 2706. Micro-operation queue 2707 can then receive the decoded instruction from decoder 2706. Fig.28 As shown on the right, micro-op tags 2703 may receive instruction tags from BPU 2701 and determine the associated micro-op tags. Micro-op cache 2705 may then be checked to determine if the micro-op associated with the micro-op tag is stored in micro-op cache 2705 and the micro-op may be retrieved from micro-op cache 2705. The micro-op may be decoded and stored in micro-op cache 2705, for example, as described above in conjunction with Fig.25 and Fig.26 The micro-operation cache features may be physical and / or virtual. The micro-operation cache features may include pipeline shortening. For example, Fig. 27 , in the case where the micro-operations have been previously decoded and stored in the micro-operation cache, the pipeline on the right is shorter than the pipeline on the left, because when the micro-operations have been stored in the micro-operation cache, it may not be necessary to perform the decoding operation. The micro-operation cache feature may include a next row prediction in the micro-operation cache 2705. The micro-operation cache feature may store the MS stream in the micro-operation cache 2705. The micro-operation cache feature may use a replacement strategy to determine which micro-operations are to be stored in the cache and which micro-operations are replaced with new micro-operations. The micro-operation cache feature may determine the type of instruction to be allocated to the micro-operation cache 2705, for example, a loop stream and / or a complex instruction. The micro-operation cache feature may prioritize micro-operations. The micro-operation cache feature may include a victim cache (not shown). The victim cache may store instructions for potential reuse such as instructions that are difficult to decode.

[0238] Fig.28 2 is a block diagram showing micro-operation cache features that may be included in a processor according to an embodiment. The micro-operation cache features may include one or more of a physical micro-operation cache 2801 and a virtual micro-operation cache 2802. The physical micro-operation cache 2801 may, for example, store micro-operations in a physical memory using a physical address space. The virtual micro-operation cache may, for example, store micro-operations in a virtual memory using a virtual address space. The physical micro-operation cache 2801 and / or the virtual micro-operation cache 2802 may be flushed, for example, based on a context and / or mode switch. The physical micro-operation cache 2801 and / or the virtual micro-operation cache 2802 may be competitively shared.

[0239]

[0240] Embodiments may include a processor configured to algorithmically determine a type of instruction to be assigned to a micro-op cache; determine a location in the micro-op cache to assign instructions of the determined type; and assign the instructions to the determined location.

[0241] In some embodiments, one or more of the following apply. In some embodiments, the processor is further configured to cause the intelligent allocation and replacement block to receive instructions from the instruction decoder. In some embodiments, the determined instruction type is at least one of a complex instruction and a loop stream. In some embodiments, the processor may include one or more of a branch prediction unit (BPU), an instruction cache tag, a micro-operation tag, an instruction cache, a micro-operation cache and a decoder, and a micro-operation queue. In some embodiments, the micro-operation cache may include a next line prediction. In some embodiments, the processor is configured to store the MS stream in the micro-operation cache. In some embodiments, the processor is configured to prioritize micro-operations. In some embodiments, the processor includes a victim cache. In some embodiments, the micro-operation cache includes at least one of a physical micro-operation cache and a virtual micro-operation cache. In some embodiments, the at least one of the physical micro-operation cache and the virtual micro-operation cache may be competitively shared. In some embodiments, determining the type of instruction assigned to the micro-operation cache may be based at least in part on one or more of the following: historical usage patterns, frequency of use, decoding difficulty, and decoding time. In some embodiments, determining the location to allocate the determined type of instruction to the micro-operation cache can be based on one or more of the following: least recently used instruction information, historical usage patterns of instructions, usage frequency, decoding difficulty, loop state information, and decoding time of instructions stored in the micro-operation cache.

[0242] An embodiment may include a method comprising algorithmically determining an instruction type to be allocated to a micro-op cache; determining a location in the micro-op cache to allocate instructions of the determined type; and allocating the instructions to the determined locations.

[0243] In some embodiments, one or more of the following apply. In some embodiments, the method may further include causing the intelligent allocation and replacement block to receive instructions from an instruction decoder. In some embodiments, the determined instruction type is at least one of a complex instruction and a loop stream. In some embodiments, the method may further include using one or more of a branch prediction unit (BPU), an instruction cache tag, a micro-operation tag, an instruction cache, a micro-operation cache and a decoder, and a micro-operation queue. In some embodiments, the micro-operation cache may include a next line prediction. In some embodiments, the method may further include storing the MS stream in the micro-operation cache. In some embodiments, the method may further include prioritizing micro-operations. In some embodiments, the method may further include using a victim cache. In some embodiments, using the micro-operation cache includes using at least one of a physical micro-operation cache and a virtual micro-operation cache. In some embodiments, the method may further include competitively sharing at least one of a physical micro-operation cache and a virtual micro-operation cache. In some embodiments, determining the type of instruction assigned to the micro-operation cache may be based at least in part on one or more of the following: historical usage patterns, frequency of use, decoding difficulty, and decoding time. In some embodiments, determining the location to allocate the determined type of instruction to the micro-operation cache can be based on one or more of the following: least recently used instruction information, historical usage patterns of instructions, usage frequency, decoding difficulty, loop state information, and decoding time of instructions stored in the micro-operation cache.

[0244] An embodiment may include a non-transitory machine-readable medium storing at least one instruction that, when executed by a processor, causes the processor to perform a method comprising algorithmically determining a type of instruction to allocate to a micro-operation cache; determining a location to allocate instructions of the determined type to the micro-operation cache; and allocating the instruction to the determined location.

[0245] In some embodiments, one or more of the following apply. In some embodiments, the method may further include causing the intelligent allocation and replacement block to receive instructions from an instruction decoder. In some embodiments, the determined instruction type is at least one of a complex instruction and a loop stream. In some embodiments, the method may further include using one or more of a branch prediction unit (BPU), an instruction cache tag, a micro-operation tag, an instruction cache, a micro-operation cache and a decoder, and a micro-operation queue. In some embodiments, the micro-operation cache may include a next line prediction. In some embodiments, the method may further include storing the MS stream in the micro-operation cache. In some embodiments, the method may further include prioritizing micro-operations. In some embodiments, the method may further include using a victim cache. In some embodiments, using the micro-operation cache includes using at least one of a physical micro-operation cache and a virtual micro-operation cache. In some embodiments, the method may further include competitively sharing at least one of a physical micro-operation cache and a virtual micro-operation cache. In some embodiments, determining the type of instruction assigned to the micro-operation cache may be based at least in part on one or more of the following: historical usage patterns, frequency of use, decoding difficulty, and decoding time. In some embodiments, determining the location to allocate the determined type of instruction to the micro-operation cache can be based on one or more of the following: least recently used instruction information, historical usage patterns of instructions, usage frequency, decoding difficulty, loop state information, and decoding time of instructions stored in the micro-operation cache.

[0246] An embodiment may include a system comprising a system of memory and a processor, the processor being configured to algorithmically determine a type of instruction to be assigned to a micro-operation cache; determine a location in the micro-operation cache to assign instructions of the determined type; and assign the instruction to the determined location.

[0247] In some embodiments, one or more of the following apply. In some embodiments, the processor is further configured to cause the intelligent allocation and replacement block to receive instructions from the instruction decoder. In some embodiments, the determined instruction type is at least one of a complex instruction and a loop stream. In some embodiments, the processor may include one or more of a branch prediction unit (BPU), an instruction cache tag, a micro-operation tag, an instruction cache, a micro-operation cache and a decoder, and a micro-operation queue. In some embodiments, the micro-operation cache may include a next line prediction. In some embodiments, the processor is configured to store the MS stream in the micro-operation cache. In some embodiments, the processor is configured to prioritize micro-operations. In some embodiments, the processor includes a victim cache. In some embodiments, the micro-operation cache includes at least one of a physical micro-operation cache and a virtual micro-operation cache. In some embodiments, the at least one of the physical micro-operation cache and the virtual micro-operation cache may be competitively shared. In some embodiments, determining the type of instruction assigned to the micro-operation cache may be based at least in part on one or more of the following: historical usage patterns, frequency of use, decoding difficulty, and decoding time. In some embodiments, determining the location to allocate the determined type of instruction to the micro-operation cache can be based on one or more of the following: least recently used instruction information, historical usage patterns of instructions, usage frequency, decoding difficulty, loop state information, and decoding time of instructions stored in the micro-operation cache.

[0248] Mobile elimination

[0249] According to an embodiment of the present invention, the processor core can support a move elimination feature. For many processors, executing a move instruction typically involves moving a value from one register to another register, or moving an immediate value to a register. Due to the frequency of such move instructions, if the move instructions are processed efficiently, the processor performance may be improved.

[0250] Most instructions operate on several source operands and produce a result. They explicitly name or indirectly name the source and destination locations from which values ​​are read or written. The names can be logical (architectural) registers or locations in memory.

[0251] Typically, the number of physical registers available to a processor exceeds the number of logical registers, making it possible to use register renaming to improve performance. Specifically, for out-of-order processors, register renaming allows instructions to execute outside of their original program order. Thus, for many out-of-order processors, move instructions are renamed such that the logical register named in the original move instruction is renamed to a physical register.

[0252] Renaming logical registers involves mapping logical registers to physical registers. These mappings can be stored in a register alias table (RAT). The RAT maintains the latest mapping for each logical register. The RAT is indexed by the logical register and provides the mapping to the corresponding physical register.

[0253] Fig.29 2900, an active list (AL) 2902, and a free list (FL) 2904. For each logical register specified by a rename instruction, an unused physical register from the FL 2904 is allocated and the RAT 2900 is updated with this new mapping. Once a physical register is no longer referenced by instructions in the current instruction window, the physical register can be freed for reuse (i.e., reclaimed).

[0254] based on Fig.29 One method of register reclamation is to reclaim physical registers only when the instruction that evicts them from the RAT 110, i.e., the instruction that creates a new mapping to the physical register, retires. Thus, whenever a new mapping updates the RAT 2900, the evicted old mapping is pushed into the AL 2902. (An AL entry is associated with each instruction in the instruction window.) When an instruction retires, the physical registers in the AL 2902 that record the old mapping, if any, are reclaimed and pushed into the FL 2904. Fig.29 This cycle is depicted in .

[0255] For many instructions, one of the source registers is also used as the destination register. If a subsequent (in program order) instruction requires the value stored in this source register, a register move instruction may be inserted before the subsequent instruction to copy the source operand in the source register to another logical location so that the operand can be accessed by the subsequent instruction.

[0256] Another reason to insert register move instructions is to set parameter values ​​in the appropriate registers before a procedure call.

[0257] Therefore, the number of register move instructions may be quite significant.It may therefore be desirable to provide efficient execution of register move instructions through an efficient register renaming and recycling scheme.

[0258] exist Figure 1B In FIG. 1 , the register renaming functional unit is indicated as the renaming / allocator unit 152 and the physical registers are indicated as the physical register file unit 158. Figure 3, the register renaming functional units are indicated as integer renaming unit 321 and FP renaming unit 331, and the physical registers are indicated by integer physical register file 323 and FP register file 333. Each logical register has a mapping to a physical register, where the mapping is stored as an entry in RAT 2900. The entries in RAT 2900 are indexed by logical registers and contain pointers to physical registers.

[0259] During a rename instruction, the current entry in the RAT provides the mapping required for the source logical register(s) of the rename instruction, and a new mapping is created for the destination logical register of the instruction. This new mapping evicts the old mapping in the RAT, and the RAT is updated with the new mapping.

[0260] Table 1 shows an example of register renaming. In Table 1, four instructions in original program order are provided in the first column. The renamed instructions are indicated in the second column. Immediately following each rename is the current entry in the RAT after the instruction is renamed. The last column provides the mapping evicted by the instruction rename. For simplicity, only three logical registers LRa, LRb, and LRb are considered. The physical register is represented by PRi, where i is an integer. The first entry in Table 1 provides the current state of the RAT before renaming the first listed instruction.

[0261] For example, in Table 1, the first instruction LRa+2→LRa (indicating that the immediate value 2 is added to the value in the logical register LRa and the result is stored in the logical register LRa) is renamed to PR1+2→PR2, where it is assumed that the physical register PR2 is available. For this instruction, a new mapping LRa→PR2 is created and the old mapping LRa→PR1 is evicted from the RAT.

[0262] It should be noted that the second instruction and the fourth instruction have real dependencies on the first instruction, and the third instruction has a real dependency on the second instruction. However, register renaming has removed the output dependency between the second instruction and the fourth instruction, and the anti-dependency between the third instruction and the fourth instruction, so that the second instruction, the third instruction, and the fourth instruction can be executed out of order, provided that the execution order follows the various real dependencies.

[0263]

[0264] Table 1

[0265] The rename instruction is placed in the instruction window buffer. The entry in the instruction window buffer contains the opcode of the rename instruction, as well as other fields that will be described later. For this embodiment, the result of the instruction is not stored in the instruction window buffer, but resides in the physical register file.

[0266] The instruction window buffer allows for instruction retirement in the original program order. For a complex instruction set computer (CISC) architecture, a complex instruction is retired when all of the microinstructions that make up the complex instruction retire together. The instruction window buffer operates as a circular buffer, where a first pointer points to the next instruction to retire, and a second pointer points to the next available entry for a newly decoded instruction. Incrementation of the pointer is done in an algorithm modulo N, where N is the number of available entries in the buffer. When an instruction retires, the first pointer is incremented. The pointer is incremented by one for each decoded instruction in a reduced instruction set computer (RISC) architecture, and the pointer can be incremented by more than one for a CISC architecture.

[0267] For store instructions that write their results to a memory location, the data cache is updated when the instruction retires. For instructions that write their results to a logical register, there is no register dedicated to use as a logical register, so no writing is required on retirement. For such instructions, the physical register file has the results of the retired instruction in the physical register to which the destination logical register is mapped when the instruction is renamed.

[0268] The scheduler dispatches instructions to the execution units for execution. For example, the scheduling function may be implemented by a reservation station that implements the Tomasulo algorithm (or a variant thereof). The execution units may retrieve data from or send data to a data cache or a physical register file, depending on the instruction (or microinstruction) to be executed.

[0269] In other embodiments of the present invention, the information content contained in the data structures of the physical register file and the instruction window buffer can be implemented by different functional units. For example, the reorder buffer can replace the instruction window buffer and the physical register file, so that the results are stored in the reorder buffer, and in addition, the registers in the register file are dedicated as logical registers. For this type of embodiment, the results of the instructions that specify writing to the logical registers are written to the logical registers when the instructions retire.

[0270] We now distinguish two types of move instructions: register-to-register move and immediate-to-register move. In a register-to-register move, a value is moved from one register, the source logical register, to another register, the destination logical register. In an immediate-to-register move, an immediate value is moved to a logical register.

[0271] In an embodiment of the present invention, a move instruction is executed by mapping more than one logical register to the same physical register. Execution of a register-to-register move instruction is performed by mapping a destination logical register of the move instruction to a physical register mapped by a source logical register of the move instruction.

[0272] The execution of the immediate to register move instruction may be performed by accessing a value match cache. Entries in the value match cache are indexed by values, wherein the cache entry associates a value with a physical register storing the value. The value match cache may have fewer entries than the number of physical registers. If there is a hit in the value match cache, the destination logical register of the move instruction is mapped to the physical register indicated by the value match cache. If there is no hit, the move execution is performed as in the prior art architecture, and the value match cache is updated.

[0273] The physical register file itself can be used as a function of the value match cache, so that the value match cache is not needed. In this case, the register file will need additional ports to perform parallel tag matching, where the tag is the value stored in the physical register.

[0274] As discussed above, register-to-register move instructions and immediate-to-register move instructions (assuming there is a hit in the value match cache for the latter type of move) are executed by creating multiple mappings in which more than one logical register is mapped to the same physical register. Effectively, such move instructions are "eliminated" in the sense that they are no longer executed by the execution unit. Instead, move elimination is performed during the rename stage. These instructions are retained in the instruction buffer window ready for retirement. Since instructions that depend on such move instructions depend directly on the actual generator, the dependency graph is collapsed (dependencies are redirected). It is also possible to reduce the need for physical registers and to reduce writes to the register file.

[0275] The idiom elimination mechanism similarly affects instruction operations without passing them down the traditional out-of-order pipeline. Idioms are instances of general instructions that are encoded to achieve a specific effect, usually in a more optimized manner than explicit instructions. Move idioms include any instruction constructed to place the contents of a source register in a destination register without other effects, such as R1=ADD R0, #0. Similarly, the zero idiom is a general instruction encoded to set a register to zero, such as R0=XOR R0, R0. No operation (NOP) is an instruction defined as having no effect on the architectural state, including explicit NOP opcodes and NOP idioms, such as R0=ADD R0, #0.

[0276] Embodiments of the present invention may be expected to improve upon existing move elimination techniques and idiom elimination techniques by preserving micro-op renaming / allocation bandwidth, improving performance, reducing power consumption and implementing power-saving features, as well as improving fairness, minimum performance guarantees, throughput, instructions per clock (IPC), instructions per unit time, quality of service, time and / or memory efficiency, and extending the coverage of move elimination to more instruction types.

[0277] In an embodiment, the results of on-the-fly move elimination and idiom elimination operations on the instruction stream may be cached in a decoded micro-op cache, such as micro-op cache 133 or 312. Thus, rediscovering necessary conditions and repeatedly eliminating the original instruction from the pipeline may be avoided.

[0278] The eliminated instruction can be replaced with metadata stored in the micro-operation cache that achieves the same effect as the eliminated instruction. When writing to the micro-operation cache, the result of the move elimination or idiom elimination is converted into metadata so that the micro-operation can be removed from the micro-operation cache and thus optimized from the delivered micro-operation stream. Since the instruction elimination mechanism in operation has completed the work of identifying opportunities, the micro-operation cache construction can be modified to scan and remove the affected micro-operations. The metadata includes the information required to perform the rename operation plus relevant architectural information, such as the existence of event boundaries and the effect of performance monitoring counters. For example, metadata can indicate how many instructions are eliminated, and / or for CISC architectures, how many micro-operations are eliminated for each instruction, and / or the end of the macro instruction occurs after the instruction is eliminated. Metadata can be stored in a field in the entry of the micro-operation before and / or after the micro-operation is eliminated.

[0279] In an embodiment, move elimination can be extended to include zero-extension and sign-extension operations. For example, R0=MOV.ZER1 can be move eliminated even though it is not a simple move.

[0280] In an embodiment, RAT 3000 may be configured as follows: Fig.30 The extension shown in includes zero idiom, sign extension, and zero extension. The RAT is extended with the following three bits: Z, when set, the rest of the RAT entry is ignored and the logical register is treated as zero; SE, when set, the value of the logical register is a sign-extended version of the physical register file identifier (PRF ID) stored in the entry; and ZE, when set, the value of the logical register is a zero-extended version of the PRF ID stored in the entry.

[0281] Then, if Fig.31As shown in , the Z bit, SE bit, and ZE bit can be read during register renaming and passed down the pipeline using a micro-operation that reads the register. The bits are interpreted prior to the operation of the ALU 3120 to create the correct result. Fig.31 , the left source path is conceptually enhanced to include interpretation of the Z bit, SE bit, and ZE bit by multiplexer 3110. Based on these bits, the source from the bypass network or physical register file is used unmodified, replaced with zeros, used after sign extension, or used after zero extension.

[0282]

[0283] Embodiments of the present invention may include a processor including a micro-operation cache, the micro-operation cache including a plurality of entry locations. At least one entry location may include a first field and a second field. The first field may be used to store a first micro-operation. The second field may be used to store metadata to indicate that a second micro-operation is eliminated from a micro-operation stream to be decoded from an instruction stream, wherein the second micro-operation is generated by decoding of a move instruction.

[0284] Embodiments of the present invention may include a processor, the processor includes a register alias table, the register alias table includes a plurality of entries. At least one entry may include a field storing one of a zero indicator, a sign extension indicator, and a zero extension indicator. The zero indicator is used to indicate that a source operand will be replaced with zero. The sign extension indicator is used to indicate that a source operand is used after sign extension. The zero extension indicator is used to indicate that a source operand is used after zero extension.

[0285] Virtual register renaming

[0286] According to an embodiment, the processor core can support virtual register renaming. In some embodiments, the 256-bit operand ymmi can be stored in a 128-bit register file. The upper half of the 256-bit operand can be stored in the 128-bit register file as a 128-bit operand ymmihigh. By virtually renaming the lower half of the 256-bit operand, the lower half of the 256-bit operand can be stored in the 128-bit register file as a 128-bit operand xmmi (ymmilow). In some embodiments, this feature advantageously allows a wider ISA to be implemented on a smaller physical register by renaming half of the instruction. In some embodiments, using smaller physical registers improves the computer system by providing greater flexibility, power saving, and better performance, because, for example, parts of the instruction can be accessed separately. In some embodiments, instructions and registers of other sizes can be used (for example, 512-bit operands with 256-bit registers). In some embodiments, the operand can be divided into smaller pieces, for example, three equal parts, four equal parts, eight equal parts, sixteen equal parts. For example, the virtual register renaming feature may be used, for example, to keep a 512-bit operand into eight portions to be stored in a 64-bit register file.

[0287] Fig.32 is a block diagram illustrating a virtual register renaming feature that may be included in a processor according to an embodiment. The virtual register renaming feature may include an operand 3201 such as a 256-bit operand ymmi. The virtual register renaming feature may further include a 128-bit register file 3201. The 256-bit operand ymmi 3201 may be stored in a 128-bit register file 3202. An upper half of the 256-bit operand 3201 may be stored in the 128-bit register file 3202 as a 128-bit operand ymmihigh. By virtually renaming a lower half of the 256-bit operand, the lower half of the 256-bit operand 3201 may be stored in the 128-bit register file 3202 as a 128-bit operand xmmi(ymmilow).

[0288] Fig.333301, the method includes storing the lower half of the operand in a register file. As shown in 3302, the method further includes virtually renaming the upper half of the operand. The method further includes storing the virtually renamed upper half of the operand in the register file. In further embodiments, other modifications are possible. For example, instead of or in addition to the virtually renamed upper half, the lower half of the operand can be virtually renamed. In addition, the operations can be performed in a different order. For example, storing the non-virtually renamed half can be performed before or after virtually renaming and / or storing the virtually renamed half. In addition, the virtually renamed half can be virtually renamed and then stored or vice versa.

[0289]

[0290] An embodiment may include a processor configured to store a first half of an operand in a register file; virtually rename a second half of the operand; and store the virtually renamed second half of the operand in the register file. In some embodiments, one or more of the following apply. The operand may be a 256-bit operand. The register file may be a 128-bit register file.

[0291] An embodiment may include a method comprising storing a first half of an operand in a register file; virtually renaming a second half of the operand; storing the virtually renamed second half of the operand in the register file. In some embodiments, one or more of the following apply. The operand may be a 256-bit operand. The register file may be a 128-bit register file.

[0292] An embodiment may include a non-transitory machine-readable medium storing at least one instruction that, when executed by a processor, causes the processor to perform a method comprising storing a first half of an operand in a register file; virtually renaming a second half of the operand; storing the virtually renamed second half of the operand in a register file. In some embodiments, one or more of the following apply. The operand may be a 256-bit operand. The register file may be a 128-bit register file.

[0293] An embodiment may include a system comprising a memory and a processor configured to store a first half of an operand in a register file; virtually rename a second half of the operand; and store the virtually renamed second half of the operand in the register file. In some embodiments, one or more of the following apply. The operand may be a 256-bit operand. The register file may be a 128-bit register file.

[0294] FMA Split and Merge

[0295] According to an embodiment of the present invention, the processor core may support the splitting and fusion of multiplication-addition instructions and operations. In various embodiments, the processor core may support an instruction set with any one or more addition, multiplication, fused multiplication-addition (FMAD) and / or fused multiplication-accumulation (FMAC) instructions (where FMAD and / or FMAC may be referred to as FMA) that operate on FP values. Such a core may include any one or more of an adder circuit, a multiplier circuit and / or an FMA circuit for performing FP addition, multiplication and / or FMA operations in response to these instructions. Separate instructions and / or circuit systems may be provided to operate on integer values ​​(e.g., FMAC) and FP values ​​(e.g., FMAD), and embodiments may be described with reference to one or the other (integer or FP); however, various embodiments of the present invention may include either or both.

[0296] Embodiments of the present invention provide for converting FMA instructions / operations into addition and multiplication instruction / operation pairs (splitting) and / or converting addition and multiplication instruction / operation pairs into FMA instructions / operations (fusion) between and / or within various stages in an instruction issue / execution pipeline. This feature may generally be referred to as FMA split / fusion or dynamic FMA split / fusion.

[0297] Embodiments of the present invention including FMA split / fusion may be desirable for a variety of reasons, including: providing the ability to execute FMA instructions and / or perform FMA operations in a core having adder circuitry and multiplier circuitry but without FMA circuitry; providing the ability to execute multiplication instructions and addition instructions using FMA operations to increase throughput through one or more core resources; providing the ability to dynamically split FMA instructions or operations into multiplication operations and addition operations to reduce critical paths in loops and increase instructions per cycle; and providing for optimizing FMA-capable pipelines on a stage-by-stage basis to achieve a desired combination of performance, complexity, and power (e.g., improving performance, reducing power consumption, and implementing power-saving features, as well as improving fairness, minimum performance guarantees, throughput, instructions per clock (IPC), instructions per unit time, quality of service, time, and / or memory efficiency, to name just a few applicable criteria).

[0298] Fig.34 is a block diagram showing an issue / execution pipeline 3400 that may be implemented in a processor core supporting the FMA split / fusion feature according to an embodiment of the present invention. Fig.34, pipeline 3400 includes instruction fetch stage 3401, instruction decode stage 3402, rename / allocate stage 3403, schedule stage 3404, execute stage 3405, and retire / commit stage 3406. Pipeline 3400 is provided for illustrative purposes and may be implemented and / or modified in various ways in various embodiments of the present invention. Therefore, the following description of pipeline 3400 may refer to the various blocks shown in other figures described in this specification.

[0299] For example, instruction fetch stage 3401 may include using instruction fetch circuitry (e.g., 138, 400) to identify (e.g., using next PC register 410) an instruction to be fetched or a memory location of an instruction to be fetched and fetching the instruction from an i-cache (e.g., 134, 313, 470, 913) or other memory location; instruction decode stage 3402 may include using instruction decode circuitry (e.g., 140, 314, 500, 914) to decode (e.g., using decoder 530) the instruction; rename / allocate stage 3403 may include using rename / allocator circuitry (e.g., 152, 331, 931) to rename register operands and / or allocate storage locations and / or tags for register renaming; schedule stage 3404 may include using scheduler circuitry (e.g., 156, 332, 932) to schedule operations and / or micro-operations associated with the instruction (e.g., from decoders 140, 314, 530, or 614 or micro-operation caches 133, 312, 540, or 912) for execution; the execution stage 3405 may include using execution circuits (e.g., 162, 334, 335, 770, 780, 934, 935) to execute operations and / or micro-operations associated with the instruction (e.g., from decoders 140, 314, 530, or 614 or micro-operation caches 133, 312, 540, or 912); and the retirement / commit stage 3406 may include using retirement circuits (e.g., 154, 730, 960) to retire instructions and / or commit their results to physical register files (e.g., 158, 333, 750, 933) or memory. In various embodiments, Fig.34 Each stage shown in may represent one or more stages and / or clock cycles.

[0300] Fig.34Also shown are fused paths 3410 and split paths 3420, each representing an embodiment of a path through pipeline 3400. Fused paths 3410 may include circuits, structures, and / or hardware for processing, performing, and / or executing FMA instructions, operations, and / or micro-operations as fused instructions, operations, and / or micro-operations, as described below using illustrative embodiments. Split paths 3420 may include circuits, structures, and / or hardware for processing, performing, and / or executing multiplication and addition instructions, operations, and / or micro-operations as separate instructions, operations, and / or micro-operations, as described below using illustrative embodiments. In addition, the split path 3420 may include circuits, structures and / or hardware for processing, performing and / or executing FMA instructions, operations and / or micro-operations as multiplication and addition instructions, operations and / or micro-operations; and the fused path 3410 may include circuits, structures and / or hardware for processing, performing and / or executing multiplication and addition instructions, operations and / or micro-operations as fused instructions, operations and / or micro-operations.

[0301] therefore, Fig.34 Conceptually, a set of core resources that can be used to process, perform, and / or execute fused and / or separate multiplication and addition instructions, operations, and micro-operations are shown. Various embodiments may include various subsets of these resources to support various capabilities, as will be further described below. Furthermore, embodiments may include Fig.34 Various additional resources not shown in the figure may be provided and / or configured to practice various embodiments of the present invention.

[0302] Fig.34Also shown is an FMA split / fusion controller 3430, which may represent a programmable, configurable, or hardwired controller or control structure, including one or more control circuits and / or software programmable or hardware configuration registers, for generating control signals for directing the flow of instructions, operations, micro-operations, operands, values, and / or other data through or between the fused path 3410 and / or the split path 3420. These control signals may be provided to one or more paths through the pipeline 3400 including a combination of resources in the fused path 3410 and the split path 3420. These control signals may provide for implementing dynamic FMA split / fusion by causing FMA instructions, operations, and / or micro-operations to be processed, performed, and / or executed as fused instructions, operations, and / or micro-operations in response to a first condition and as separate multiplication and addition instructions, operations, and / or micro-operations in response to a second condition and / or causing separate multiplication and addition instructions, operations, and / or micro-operations to be processed, performed, and / or executed as fused instructions, operations, and / or micro-operations in response to a third condition and as separate multiplication and addition instructions, operations, and / or micro-operations in response to a fourth condition.

[0303] For example, hardware in fused path 3410 may fetch an FMA instruction, and controller 3430 may generate one or more control signals for routing the instruction to hardware in split path 3420 for decoding the instruction into two separate micro-operations, namely a multiplication micro-operation and an addition micro-operation. Fig.34 34 is shown as a separate box, but in various embodiments, controller 3430 may be integrated or included within another control structure in the processor core or may be omitted entirely (e.g., in embodiments where the core, examples of which are described below, provides only one possible path).

[0304] exist Fig.34 In the figure, the fusion path 3410 includes an extractor 3411, a decoder 3412, a renamer 3413, a scheduler 3414, a fused multiplier-adder 3415, and a reorder buffer / retirement queue (ROB / RQ) 3416; and the split path 3420 includes an extractor 3421, a decoder 3422, a renamer 3423, a scheduler 3424, a multiplier 3425A and an adder 3425B, and a reorder buffer / retirement queue (ROB / RQ) 3426.

[0305] The fetcher 3411 may include a processor for fetching FMA instructions (e.g., AVX (defined below) instructions, such as VFMADD132PS, VFMADD213PS, VFMADD231PS, VFMADD132PD, VFMADD213PD, VFMADD231PD, VFMADD132SS, VFMADD213SS, VFMADD231SS, VFMADD132SD, VFMADD213SD, VFMADD231SD, VFMSUB132PS, VFMSUB213PS, VFMADD231PD, VFMADD132SS, VFMADD213SS, VFMADD231SS, VFMADD132SD, VFMADD213SD, VFMADD231SD, VFMSUB132PS, VFMSUB213PS, VFMADD231 MSUB231PS, VFMSUB132PD, VFMSUB213PD, VFMSUB231PD, VFMSUB132SS, VFMSUB213SS, VFMSUB231SS, VFMSUB132SD, VFMSUB213 SD, VFMSUB231SD, VFNMADD132PS, VFNMADD213PS, VFNMADD231PS, VFNMADD132PD, VFNMADD213PD, VFNMADD231PD, VFNMADD132S S, VFNMADD213SS, VFNMADD231SS, VFNMADD132SD, VFNMADD213SD, VFNMADD231SD, VFNMSUB132PS, VFNMSUB213PS, VFNMSUB231 PS, VFNMSUB132PD, VFNMSUB213PD, VFNMSUB231PD, VFNMSUB132SS, VFNMSUB213SS, VFNMSUB231SS, VFNMSUB132SD, VFNMSUB213 SD, VFNMSUB231SD, VFMADDSUB132PS, VFMADDSUB213PS, VFMADDSUB231PS, VFMADDSUB132PD, VFMADDSUB213PD, VFMADDSUB231PD, VFMSUBADD132PS, VFMSUBADD213PS, VFMSUBADD231PS, VFMSUBADD132PD, VFMSUBADD213PD or VFMSUBADD231PD).

[0306] The FMA instruction fetched by the fetcher 3411 may have three operands. For example, the VFMADD231PS instruction may have a first operand (xmm1 or ymm1), a second operand (xmm2 or ymm2), and a third operand (xmm3 or ymm3), wherein the xmm and ymm registers that may be specified by these operands are described below. These registers may hold scalar or packed values, and for convenience in describing the embodiments, the letter 'd' may be used to refer to a source / destination register or a portion of a register specified by an xmm1 operand and / or a value stored or to be stored in this register or a portion of this register; the letter 'a' may be used to refer to a source register or a portion of a register specified by an xmm2 operand and / or a value stored or to be stored in this register or a portion of this register; and the letter 'b' may be used to refer to a source register or a portion of a register specified by an xmm3 operand and / or a value stored or to be stored in this register or a portion of this register. Thus, the concept of the operation performed in response to the VFMADD231PS instruction is represented as d=a*b+d, where a, b, and d may also be referred to as operands. In addition, although this description refers to operands as registers, embodiments may use memory locations rather than register locations for any or all operands.

[0307] The fetcher 3421 may include circuitry, structures, and / or hardware for fetching multiplication instructions (e.g., SSE (Streaming Single Instruction Multiple Data Extensions) instructions such as MULPS, MULPD, MULSS, or MULSD) and addition instructions (e.g., SSE instructions such as ADDPS, ADDPD, ADDSS, or ADDSD), each having two operands. For example, a MULPS instruction may have a first operand (xmm1) and a second operand (xmm2), and an ADDPS instruction may have a first operand (xmm1) and a second operand (xmm2), wherein, typically, each of the MULPS xmm1, MULPS xmm2, ADDPS xmm1, and ADDPS xmm2 operands may be a different register. However, in an embodiment of the present invention, when it is determined that the ADDPS instruction depends on the MULPS instruction (i.e., the MULPS result is an input to the ADDPS), the fetcher 3421 may pair the MULPS instruction with the ADDPS instruction. For example, in the case where 'a' is used as a MULPS xmm1 operand and 'b' is used as a MULPS xmm2 operand, the corresponding multiplication operation is a=a*b, and if a is subsequently used as an ADDPS xmm2 operand and 'd' is used as an ADDPS xmm1 operand, the corresponding addition operation is d=d+a, and the fetcher 3421 may pair the MULPS instruction with the ADDPS instruction. In an embodiment, pairing and / or determining whether a pairing condition is satisfied may be performed in response to a control signal from the controller 3430.

[0308] Extractor 3411 may be coupled or connected to decoder 3412 as indicated by arrow 3432A and / or coupled and / or connected to decoder 3422 as indicated by arrow 3432B. Extractor 3421 may be coupled or connected to decoder 3412 as indicated by arrow 3432C and / or coupled and / or connected to decoder 3422 as indicated by arrow 3432D. In various embodiments, the coupling or connection and / or decoder operation may be static (e.g., hardwired) or dynamic (e.g., dependent on a control signal from 3430).

[0309] Decoder 3412 may include circuitry, structure, and / or hardware for decoding FMA instructions received from fetcher 3411 into FMA micro-operations having three operands (e.g., d, a, and b). Alternatively or additionally, decoder 3412 may include circuitry, structure, and / or hardware for decoding paired multiplication and addition instructions received from fetcher 3421 into FMA micro-operations having three operands (e.g., d, a, and b).

[0310] The decoder 3422 may include circuitry, structures, and / or hardware for decoding the FMA instruction received from the fetcher 3411 into a multiplication micro-operation with two operands and an addition micro-operation with two operands. Alternatively or additionally, the decoder 3422 may include circuitry, structures, and / or hardware for decoding the paired multiplication and addition instructions from the fetcher 3421 into a multiplication micro-operation with two operands and an addition micro-operation with two operands. For example, the multiplication micro-operation may be represented as t=a*b, and the addition micro-operation may be represented as d=d+t, where a new operand 't' may be introduced to serve as a destination for the multiplication operation and a source for the addition operation.

[0311] Decoder 3412 may be coupled or connected to renamer 3413 as indicated by arrow 3433A and / or coupled or connected to renamer 3423 as indicated by arrow 3433B. Decoder 3422 may be coupled or connected to renamer 3413 as indicated by arrow 3433C and / or coupled or connected to renamer 3423 as indicated by arrow 3433D. In various embodiments, the coupling or connection and / or renamer operation may be static (e.g., hardwired) or dynamic (e.g., dependent on a control signal from 3430).

[0312] Renamers 3413 and / or 3423 may include storage locations and / or tags for renaming register operands and / or assigning register renaming, such as a reorder buffer, for example, circuit systems, structures, and / or hardware to accommodate out-of-order processing. In an embodiment, to eliminate register conflicts (e.g., for a, b, t, and / or d), renamer 3413 may rename operands of FMA operations (e.g., to a', b', and / or d'); and / or renamer 3423 may rename operands of multiplication operations (e.g., to a' and / or b') and operands of addition operations (e.g., to t' and / or d').

[0313] Renamer 3413 may be coupled or connected to scheduler 3414 as indicated by arrow 3434A and / or coupled or connected to scheduler 3424 as indicated by arrow 3434B. Renamer 3423 may be coupled or connected to scheduler 3414 as indicated by arrow 3434C and / or coupled or connected to scheduler 3424 as indicated by arrow 3434D. In various embodiments, the coupling or connection and / or scheduler operation may be static (e.g., hardwired) or dynamic (e.g., dependent on a control signal from 3430).

[0314] Scheduler 3414 and / or 3424 may include circuit systems, structures and / or hardware such as reservation stations for scheduling operations and / or micro-operations for execution. In an embodiment, scheduler 3414 may schedule an FMA operation to be performed on operands a, b, and d in a reservation station of the FP execution circuit, and / or scheduler 3424 may schedule a multiplication operation to be performed on operands a and b and an addition operation to be performed on operands t and d in a reservation station of the FP execution circuit.

[0315] Scheduler 3414 may be coupled or connected to fused multiplier / adder 3415 as shown by arrow 3435A and / or coupled or connected to multiplier 3425A or both multiplier 3425A and adder 3425B as shown by arrow 3435B. Scheduler 3424 may be coupled or connected to fused multiplier / adder 3415 as shown by arrow 3434C and / or coupled or connected to multiplier 3425A or both multiplier 3425A and adder 3425B as shown by arrow 3434D. In various embodiments, the coupling or connection and / or scheduler operation may be static (e.g., hard-wired) or dynamic (e.g., depending on a control signal from 3430).

[0316] Fusion multiplication / adder 3415, multiplier 3425A and adder 3425B can respectively include circuit systems, structures and / or hardware for performing fusion multiplication-addition operation, multiplication operation and addition operation. In an embodiment, multiplier 3425A can be coupled to a reservation station to receive two inputs (e.g., a and b) for multiplication operation and can be coupled to adder 3425B for providing its output (e.g., t), and the output will be used as one of the two inputs (e.g., t and d) for addition operation. In this embodiment, the precision of a dedicated fusion multiplication-adder can be obtained by sending the unrounded multiplication result to the adder (e.g., according to IEEE Standard 754). In another embodiment, multiplier 3425A can be coupled to a reservation station to receive two inputs (e.g., a and b) for the multiplication operation generating output (e.g., t), and adder 3425A can be coupled to a reservation station to receive two inputs (e.g., t and d) for addition operation. In this embodiment, the precision of the dedicated fused multiply-adder may be achieved by increasing the width of the internal storage locations for the intermediate results (eg, t) or by providing special handling using microcode assists or traps.

[0317] Fused multiplier-adder 3415 may be coupled or connected to ROB / RQ 3416 as indicated by arrow 3436A and / or coupled or connected to ROB / RQ 3426 as indicated by arrow 3436B. Adder 3425B may be coupled or connected to ROB / RQ 3416 and / or adder 3425B as indicated by arrow 3436C or both multiplier 3425A and adder 3425B may be coupled or connected to ROB / RQ 3426 as indicated by arrow 3436D. In various embodiments, the coupling or connection and / or scheduler operation may be static (e.g., hardwired) or dynamic (e.g., dependent on control signals from 3430).

[0318] ROB / RQ 3416 and / or ROB / RQ 3426 may include circuit systems, structures and / or hardware such as reorder buffers and / or retirement queues for retiring instructions and / or submitting results. In an embodiment, ROB / RQ 3416 may retire FMA instructions and submit their results (e.g., xmm1). In an embodiment, ROB / RQ 3426 may retire multiplication instructions and addition instructions and submit their results (e.g., MULPS xmm1, ADDPS xmm1, respectively). In an embodiment, as long as the result of a separate multiplication operation is not expected (e.g., according to the instruction set architecture expectation), ROB / RQ 3416 may submit the result of the FMA operation created by fusing separate multiplication and separate addition instructions. In an embodiment, ROB / RQ 3426 may submit the result of the addition operation created by splitting the FMA instruction as the result of the FMA instruction. In a processor core according to an embodiment of the present invention, the result of the addition instruction will be the same as the result of the corresponding FMA instruction.

[0319] like Fig.34As shown, an embodiment can provide for FMA splitting or fusion at each level of the release / execution pipeline. In an embodiment, the splitting at the decode stage 3402 can be specified to perform fusion multiplication-addition instructions in a core without a dedicated fusion multiplication-adder. In an embodiment, the fusion at the decode stage 3402, the rename / allocation stage 3403, the scheduling stage 3404, the execution stage 3405 and / or the retirement stage 3406 can provide a larger throughput (one instruction / operation / micro-operation, rather than two instructions / operations / micro-operations) through hardware resources. In an embodiment, the splitting at the rename / allocation stage 3403 can provide a reduced renaming hardware complexity by limiting the number of operands to two rather than three. In an embodiment, the fusion at the rename / allocation stage 3403 and / or the scheduling stage 3404 can provide fewer entries in renaming, reordering and / or scheduling storage to allow a deeper out-of-order execution window and / or find higher instruction-level parallelism. In an embodiment, the split at the scheduling stage 3404 can provide reduced hardware complexity by limiting the number of out-of-order wakeup sources to two per entry instead of three. In an embodiment, the split at the scheduling stage 3404 and / or the execution stage 3405 can provide reduced latency by allowing separate portions of the FMA operation to be executed at different times to limit the critical path to the path of the slowest portion rather than the sum of the two portions. In an embodiment, the fusion at the execution stage 3405 can provide enhanced performance, increased precision, and / or reduced power by using a dedicated fused multiply-adder.

[0320] Fig.35 is a flow chart illustrating a method for FMA split / merge that may be performed by a processor according to an embodiment. Fig.35 In block 3510 of method 3500, instruction fetch circuitry (e.g., 138, 400) may fetch instructions from an i-cache (e.g., 134, 313, 470, 913) or other memory location. For example, the instruction may be an instance of an FMA instruction such as VFMADD231PS having a first operand ('d'), a second operand ('a'), and a third operand ('b'), and the processor responds to the FMA instruction by performing an FMA operation (e.g., d=a*b+d).

[0321] In block 3520, instruction decoding circuitry or decoders (e.g., 140, 314, 500, 914) that are hardwired, configured, or programmed to perform splitting of the FMA instruction may decode the instruction into a plurality of different micro-operations, multiplication micro-operations, and addition micro-operations. The decoder may select particular operands from the FMA instruction and / or from another micro-operation, assign one or more of the operands to one or more of the different micro-operations, and / or create new operands for one or more of the different micro-operations. For example, the decoder may select the 'a' and 'b' operands of the FMA instruction as source operands for a multiplication micro-operation and create the 't' operand as a destination operand for the multiplication micro-operation, and the processor responds to the multiplication micro-operation by executing the multiplication operation t=a*b; and the decoder may select the 'd' operand of the FMA instruction and the 't' operand of the multiplication micro-operation as source operands for an addition micro-operation and select the 'd' operand of the FMA instruction as a destination operand for the addition micro-operation, and the processor responds to the addition micro-operation by executing the addition operation t=a*b.

[0322] In box 3530, the register renaming circuit (e.g., 152, 331, 931) can rename any of the operands, allocate a storage location and / or tag for the register renaming (e.g., in a reorder buffer), and / or implement assigning the output of the multiplication micro-operation (e.g., 't') as an input to the addition micro-operation.

[0323] In block 3540, the scheduler circuit (e.g., 156, 332, 932) may schedule different micro-operations for execution, for example, in a reservation station of the FP unit. In an embodiment, multiple different micro-operations decoded from the same instance of an instruction (e.g., a multiplication micro-operation and an addition micro-operation decoded from an FMA instruction) may be scheduled in a reservation station for dispatch in a particular order (e.g., an addition micro-operation may be scheduled for dispatch only after a multiplication micro-operation is dispatched and / or completed).

[0324] In block 3550, the execution circuit (e.g., 162, 334, 770, 934) may execute one of the different micro-operations. For example, FP multiplier 334A, 334B, 770A, 770B, 934A, or 934B may execute a multiplication micro-operation.

[0325] In block 3552, the execution circuit (e.g., 162, 335, 780, 935) may execute other micro-operations of different micro-operations. For example, FP adder 335A, 335B, 780A, 780B, 935A, or 935B may execute an addition micro-operation.

[0326] In block 3560, the retirement circuitry (e.g., 154, 730, 960) may retire the instruction and / or commit its result to a physical register file (e.g., 158, 333, 750, 933) or memory. In an embodiment, block 3560 may include retiring only one of the different micro-operations decoded from the instruction. For example, an FMA instruction may be retired and / or have its result committed by retiring the corresponding addition micro-operation from the reorder buffer and committing its result (e.g., d).

[0327]

[0328] Embodiments of the present invention may include a processor including a plurality of circuits arranged in a pipeline. The plurality of circuits may include a decoder for decoding a fused multiply-add instruction into at least two different micro-operations. The plurality of circuits may also include a multiplier for operating on a first of the two different micro-operations and an adder for operating on a second of the two different micro-operations.

[0329] Specific processor architecture

[0330] Fig.36 is a block diagram of a processor 3600 that may have more than one core, may have an integrated memory controller, and may have integrated graphics in accordance with an embodiment of the present invention. Fig.36 The solid line box in the figure shows a processor 3600 having a single core 3602A, a system agent 3610, a set of one or more bus controller units 3616, while the optional addition of the dashed line box shows an alternative processor 3600 having multiple cores 3602A to 3602N, a set of one or more integrated memory controller units 3614 in the system agent unit 3610, and dedicated logic 3608.

[0331] Thus, different implementations of processor 3600 may include: 1) a CPU, where dedicated logic 3608 is integrated graphics and / or scientific (throughput) logic (which may include one or more cores), and cores 3602A to 3602N are one or more general purpose cores (e.g., general purpose in-order cores, general purpose out-of-order cores, combinations of both); 2) a coprocessor, where cores 3602A to 3602N are a large number of dedicated cores intended primarily for graphics and / or science (throughput); and 3) a coprocessor, where cores 3602A to 3602N are a large number of general purpose in-order cores. Thus, processor 3600 may be a general purpose processor, a server processor or processing element for a server environment, a coprocessor (e.g., a security coprocessor), a high throughput MIC processor, a GPGPU, an accelerator (such as, for example, a graphics accelerator or a digital signal processing (DSP) unit, a cryptographic accelerator, a fixed function accelerator, a machine learning accelerator, a networking accelerator, or a computer vision accelerator), a field programmable gate array, or any other processor or processing device. The processor may be implemented on one or more chips. Processor 3600 may be part of and / or implemented on one or more substrates using any of a variety of processing technologies such as, for example, BiCMOS, CMOS, or NMOS.

[0332] The memory hierarchy includes one or more levels of cache within the core, a set or one or more shared cache units 3606, and external memory (not shown) coupled to the set of integrated memory controller units 3614. The set of shared cache units 3606 may include one or more mid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, a last level cache (LLC), and / or combinations thereof. Although in one embodiment, a ring-based interconnect unit 3612 interconnects the integrated graphics logic 3608 (the integrated graphics logic 3608 is an example of dedicated logic and is also referred to herein as dedicated logic), the set of shared cache units 3606, and the system agent unit 3610 / (multiple) integrated memory controller units 3614, alternative embodiments may use any number of known techniques for interconnecting such units. In one embodiment, coherency is maintained between the one or more cache units 3606 and the cores 3602A to 3602N.

[0333] In some embodiments, one or more of the cores 3602A to 3602N are capable of multithreading. The system agent 3610 includes those components that coordinate and operate the cores 3602A to 3602N. The system agent unit 3610 may include, for example, a power control unit (PCU) and a display unit. The PCU may be or include logic and components required for regulating the power state of the cores 3602A to 3602N and the integrated graphics logic 3608. The display unit is used to drive one or more externally connected displays.

[0334] The cores 3602A-3602N may be homogeneous or heterogeneous with respect to the architectural instruction set; that is, two or more of the cores 3602A-3602N may be capable of executing the same instruction set, while other cores may be capable of executing only a subset of the instruction set or a different instruction set.

[0335] Fig.37 is a block diagram of an illustrative central processor unit (CPU) complex that may be included in a processor according to an embodiment of the present invention. In an embodiment, the L3 cache is an 8MB 16-way cache that is divided across a quad-core module (referred to as a CPU complex or CCX), with each core providing a 2MB "slice" of the L3 cache. However, the L3 cache slices in the CCX are implemented so that the L3 cache is a shared cache. Multiple CCXs may be included in a single processor (e.g., two CCXs form a 16MB L3 cache). The 8MB cache on each CCX is different, so it acts as a last-level cache for each quad-core module, with the appropriate cache hooking into the other L3 caches to determine if data is needed (protocols involved in the L3 cache design allow each core to access the L3 cache of each other core). Therefore, these L1, L2, and L3 caches are coherent caches, with L3 cache slices within and between CCXs connected by a cache coherent interconnect (also referred to as a cache coherent fabric).

[0336] Fig.38 is a block diagram of an illustrative cache hierarchy that may be included in a processor according to an embodiment of the present invention. Fig.38, the cache hierarchy 3800 includes an L1i cache 3810A and an L1d cache 3810B (collectively referred to as L1 cache 3810), an L2 instruction and date cache 3820, and a level 3 (L3) instruction and data cache 3830. In an embodiment, both the L1 cache 3810 and the L2 cache 3820 are private / local write-back caches, while the L3 cache 3830 is a victim cache. In an embodiment, the L1i cache 3810A is a 64KB 4-way cache, the L1d cache 3810B is a 32KB 8-way cache, the L2 cache 3820 is a 512KB 8-way cache, and the level 3 (L3) cache 3830 is an 8MB 16-way cache.

[0337] Memory organization characteristics

[0338] Processor cores, processors and systems according to embodiments of the present invention may include various features related to the organization and use of memory. A number of such features are described individually using the following non-limiting examples, but embodiments may include any combination of these features.

[0339] Cache line zeroing

[0340] Some embodiments include an instruction, the execution of which causes a cache line sized zero write at a memory address. Such an instruction may be referred to as a cache line zero instruction, a CLZERO instruction, a CLZEROING instruction, a cache line initialization instruction, a CLINIT instruction, etc. In one embodiment, the cache line zero instruction is a macroinstruction executed by a core such as core 190 and / or core 5300. Specifically, decoder 140 and / or decoder 5314 will be implemented to decode such a macroinstruction into one or more relatively low-level instructions or control signals (e.g., one or more microinstructions, micro-operations (micro-ops), microcode entry points, decoded instructions or control signals), which cause memory access unit(s) 164 and / or address generation unit(s) 325 / load-store unit 340 to perform operations, respectively.

[0341] The cache line zeroing instruction has the advantage of being a faster and more deterministic way to zero a cache line because it does not require the use of a request for ownership (RFO) operation or at least does not require data to be rolled back or returned. The RFO operation is an operation in the cache coherence protocol that combines a read and invalid broadcast (a read operation with a write to the memory address) and therefore causes all other coherent caches to set the state of such a cache line to the cache coherence protocol state "invalid". For example, an RFO operation is typically issued by a processor attempting to write to a cache line that is in the Shared (S) or Invalid (I) state of the MESI protocol. The MESI protocol uses the cache coherence protocol states "Modified", "Exclusive", "Shared" and "Invalid". In contrast, an implementation of the cache line zeroing instruction does not require the line to be read and returned to the issuing agent because it zeroes the data; in fact, in some embodiments, the issuing agent does not need to have ownership of the data.

[0342] Different embodiments may implement cache line zeroing instructions to indicate memory addresses in different ways. For example, cache line zeroing instructions may be implemented to indicate address information explicitly (e.g., via an immediate value, one or more fields), indirectly (e.g., by specifying one or more registers storing address information), and / or implicitly (e.g., one or more specified registers). The memory address information may be a memory address or information used in combination with other information (e.g., information from a segment register, etc.) to generate a memory address. Although in some embodiments, memory addresses are aligned on cache line boundaries, alternative embodiments may also support memory addresses between cache line boundaries and be considered to indicate cache lines between those boundaries. The address information may represent absolute memory address information or relative memory address information, which may indicate a memory location or other memory location relative to a base memory address. In addition, different indirect memory addressing modes may be optionally used. As a specific example, an instruction may implicitly indicate a register (e.g., a general register) for storing relative memory address information, which may be combined with additional memory address information stored in another implicit register (e.g., a code, data, or extended segment register) to generate a final memory address for identifying a memory address. This is just one example. Other forms of address information are possible.

[0343] Different embodiments may implement cache lines of different sizes (e.g., 32 bytes, 64 bytes) and / or a given embodiment may implement more than one cache line size. For example, an embodiment may support a cache line zeroing instruction that: 1) is implemented for a specific cache line size (and thus it does not require the cache line size to be specified); 2) is implemented to use the current cache size, where different types of cores have different cache line sizes (e.g., the current cache size may be indicated via a value in a register); or 3) is implemented to have a field for indicating the cache line size. In some embodiments, the instruction allows for the indication of a size parameter that indicates one or more cache lines (i.e., multiple cache line sizes). In some embodiments, there is additionally or alternatively a ZERO instruction that allows a size parameter to be indicated that is not associated with a cache line size (e.g., only indicates a number of bytes), as this allows software to not be aware of the cache line size (if the size is not a multiple of the cache line size (e.g., specified in bytes and the number of bytes is 112, even if the cache line size is 64 bytes), embodiments may zero the entire cache line or only issue RFOs to the remaining data in the last line).

[0344] In some embodiments, the cache line zeroing instruction is atomic. Therefore, either the entire cache line with zeros will be stored in its entirety, or no cache line, not just a portion, will be stored (i.e., to complete the atomicity guarantee). Atomicity can also ensure that the zeros written by the cache line zeroing instruction will not be interleaved with data stored by other storage devices. Atomicity can be about other accesses, so that any such access will observe all data in the data stored in its entirety or not observe any data in the stored data, not just a portion. Atomicity can also be about power outages, system crashes, reboots, or other such events, so that even in the face of such events, all zeros are stored, or no zeros, not just a portion, are stored. There are various possible uses of such atomic operations. An example of such use is to atomically update a piece of data in a database. Another example of such use is to atomically update a piece of shared data in a multiprocessing environment. Yet another example of such use is to atomically store data to a location in order to replace locks, semaphores, update shared variables, synchronization, coordination, etc. Still other uses of such atomic storage operations are expected and will be apparent to those skilled in the art, and have the benefit of the present disclosure.

[0345]

[0346] Fig.391 is a block diagram illustrating a memory hierarchy in which a cache line zeroing instruction may be implemented according to embodiments of the present invention. The illustrated memory hierarchy may be implemented in conjunction with various processor cores, core clusters, CCXs, processors, computer architectures, and the like. By way of specific example, the implementation of the cache line zeroing instruction will be described with reference to Fig.39 The memory hierarchy is combined with Figure 3 , Figure 8 , Fig.38 and Fig.37 This is for illustrative purposes, and the cache zeroing instructions may be implemented in different memory hierarchies and / or in conjunction with different cores, core clusters, etc.

[0347] Fig.39 Consistency agent 3900 and consistency agent 3901 are shown, as well as the possibility of other consistency agents represented by "..." and consistency agent 3902 using a dashed box. Fig.39 The memory hierarchy in includes a coherent cache 3904A, an interconnect 3920, and a downstream memory 3930. Different embodiments may implement different numbers of caches and cache levels as part of the coherent cache 3904A. The coherent agent and the coherent cache are part of a cache coherence domain in which cache coherence is maintained using a cache coherence protocol (e.g., the MESI protocol that uses cache coherence protocol states "modified," "exclusive," "shared," and "invalid"; the MESIF protocol that adds a cache coherence protocol state "forwarded"; the MOESI protocol that adds a cache coherence protocol state "owned"; and other such cache coherence protocols).

[0348] Coherence agent 3900 is coupled to interconnect 3920 through one or more caches at successively lower levels of a cache hierarchy. The cache hierarchy includes: a cache at the highest level of the cache hierarchy and coupled to coherence agent 3900; a cache (e.g., L3 cache 3915) at the lowest level of the cache hierarchy and coupled to interconnect 3920 (and therefore, this cache is referred to as a lowest level cache or last level cache (LLC)); and zero or more caches (e.g., L2 cache 3910) at the middle level(s) of the cache hierarchy, coupled to one of the caches at the higher level and one of the caches at the lower level (e.g., L2 cache 3910) (e.g., L3 cache 3915) at the lowest level of the cache hierarchy and coupled to interconnect 3920. Fig.39 A coherence agent 3900 is shown coupled to an L1 cache 3905, which is coupled to an L2 cache 3910, which is coupled to an L3 cache 3915, which is coupled to an interconnect 3920).

[0349] The coherence agent 3901 is also coupled to the interconnect through one or more levels of cache. Fig.39 Coherence agent 3901 is shown coupled to optional L1 cache 3906, which is coupled to optional L2 cache 3911, which is coupled to L3 cache 3915. In addition, diagram 3902 also shows that optional coherence agent 3902 can be directly coupled to interconnect 3920 (i.e., no coherence cache is required).

[0350] In addition to or in lieu of connections including a coherence agent coupled to interconnect 3920 through successive levels of cache, certain embodiments implement other connections to allow direct or more direct communication (e.g., coupling coherence agent 3900 directly to interconnect 3920, coupling coherence agent 3900 directly to L2 cache 3910, coupling L1 cache 3905 directly to interconnect 3920, and / or coupling L2 cache 3910 directly to interconnect 3920, as shown by dashed lines 3935, 3936, 3937, and 3938, respectively).

[0351] The interconnect 3920 is coupled to downstream memory 3930 (e.g., through a set of one or more memory controllers (not shown)). The downstream memory 3930 is at a lower level of the memory hierarchy than the coherent cache 3904 and may include one or more types of memory and / or memory hierarchy (e.g., volatile memory and / or non-volatile memory, main memory, memory mapped input / output (MMIO), memory side cache (multiple), secondary memory (2LM), DRAM, flash memory, phase change memory, 3D Xpoint, etc.). tm ).

[0352] The interconnect 3920 (also referred to as a cache coherent interconnect, fabric, interconnect, a portion of an uncore, an interconnect network, interconnect unit(s)) includes a snoop controller 3925 for issuing snoops to and receiving any responses from the coherent cache 3904. The snoop controller 3925 includes a snoop generator 3926 for issuing snoops, and in some embodiments, a snoop responder 3927 for receiving any responses. Additionally, the snoop controller 3925 includes, in certain embodiments, a write generator 3929 (for efficiently generating cache line sized all-zero writes) and / or a write converter QOS 28 (for efficiently converting a cache line of data received in response to a snoop to all zeros). Additionally, while in one embodiment, the interconnect 3920 is shown as being located between the L3 cache 3915 and the downstream memory 3930, alternative embodiments may implement the interconnect 3920 in another location (e.g., between the L2 cache and the L3 cache, with one or more memory controllers from the interconnect 3920 (e.g., such as a home agent) to the downstream memory 3930 or between the L3 cache 3915 and the downstream memory 3930). The interconnect 3920 (e.g., as part of the snoop controller 3925) may include other items, such as snoop filters (not shown).

[0353] Different embodiments may be implemented with different numbers of consistency agents, such as a general-purpose core (also referred to as a central processing unit (CPU)). For example, in some embodiments, consistency agent 3900 is a core, consistency agent 391 is a core, there are zero or more additional consistency agents that are cores, and there are zero or more additional consistency agents that are other types of agents (e.g., general-purpose processors, server processors or processing elements for use in a server environment, coprocessors (e.g., security coprocessors), high-throughput MIC processors, GPGPUs, accelerators (such as, for example, graphics accelerators or digital signal processing (DSP) units, cryptographic accelerators, fixed-function accelerators, machine learning accelerators, networking accelerators, or computer vision accelerators), field programmable gate arrays, or any other type of processor or processing device, to name a few).

[0354] In some embodiments, the consistency agent and the consistency cache 3904 are as follows Fig.38 and Fig.373915 is implemented as in . For example, in a CCX, there are 4 coherence agents, the coherence agents are cores, per-core private / local L1 cache, per-core private / local L2 cache, and a shared L3 cache; and there may be multiple CCXs coupled together in a single processor. The L1 and L2 caches are write-back caches, the L2 cache is an inclusive cache, and the L3 cache is a victim cache. In addition, the L3 cache 3915 is sliced ​​between multiple coherence agents within a module (CCX) (e.g., 2MB per core within 4 cores, 8MB total) and optionally between one or more such modules (e.g., two CCXs, 8MB each, forming a 16MB L3 cache). Fig.39 This is illustrated with L3 cache slice 3916 of coherence agent 3900 and L3 cache slice 3917 of coherence agent 3901. Interconnect 3920 may represent, for example: 1) interconnect only within a CCX; 2) interconnect within a CCX and between CCXs; 3) separate interconnects within different CCXs, and interconnect(s) between CCXs. Different embodiments may implement interconnect 3920 differently, including one or more of a ring, multiple rings, point-to-point links, shared bus(es), etc. In embodiments implementing home agents and caching agents, interconnect 3920 is considered to include the caching agent.

[0355] Fig.39 One or more or all of the coherence agents in may be implemented to execute cache line zeroing instructions (see possible cache line zeroing instruction issuing agent 3903 identified as any of coherence agents 3900, 3901, and 3902). A coherence agent that currently executes a cache line zeroing instruction is an "issuing agent," "issuing coherence agent," or "first agent," and its cache is referred to as the issuing agent's Lx cache (where x may be 1, 2, or 3; and where the L3 cache is implemented with a slice, which is the issuing agent's L3 cache slice). In the following discussion, this will be coherence agent 3900. A coherence agent that does not currently execute a cache line zeroing instruction is referred to as a "coherence but non-issuing agent," "non-issuing agent," "non-issuing coherence agent," or "second agent" (as discussed above, there may be multiple second agents, but for simplicity one will be discussed below), and its cache is referred to as the second agent's Lx cache (where x may be 1, 2, or 3; and where the L3 cache is implemented with a slice, which is the second agent's L3 cache slice). In the following discussion, this will be consistency agent 391.

[0356]

[0357] Fig.40is a block diagram illustrating a cache implementing a cache line zeroing instruction in a processor according to an embodiment of the present invention. Fig.40 An Lx cache 4050 is included, where x indicates a level (e.g., 1, 2, 3) in a cache hierarchy. The Lx cache 4050 includes a cache controller 4051 for controlling the operation of the cache, including detecting hits / misses, causing writes / reads to cache lines, receiving snoops (and thus, in some embodiments, the cache controller 4051 includes a snoop interface, and in some embodiments, a snoop controller 4043), etc. The cache controller includes a tag array 4055 having entries 4060 (which includes entries sometimes referred to as "tag states"), and the Lx cache 4050 includes a data array 4056 with corresponding cache lines 4070. Each of the entries 4060 includes a tag field 4061 for storing a tag, the tag being used to determine whether a given address hits or misses the data in the corresponding cache line in the cache line 4070. In addition, each of entries 4060 includes a set of one or more attribute fields 4062 (sometimes referred to as "tag states") for storing attributes of data stored in a corresponding cache line in cache line 4070. Attribute field(s) 4062 include a cache coherence protocol state field 4065 for storing data indicating the current cache coherence protocol state of the data stored in the corresponding cache line in cache line 4070. Attribute field(s) 4062 may optionally include other fields, such as a zero-line field 4066, a poison field 4067, an error correction code field (not shown). Although Fig.40 Attribute field(s) 4062 are shown in the tag array, but alternative embodiments may implement these fields in a separate state array (not shown). In one embodiment, a given cache line may have multiple taint indications in taint field 4067 (e.g., two 32-byte chunks for a 64-byte cache line). Although Fig.40 A separate pollution field 4067 is shown, but alternative embodiments may encode the pollution indication into another field (e.g., an error correction code (ECC) field or a cache coherence protocol status field).

[0358] In response to a hit in the cache (e.g., based on the tag in tag field 4061), cache controller 4051 includes circuitry (e.g., cache coherence protocol state circuitry or other circuitry) for responding to a cache coherence protocol state in cache coherence protocol state field 4056 for the hit (e.g., a cache coherence protocol state field 4056 corresponding to tag field 4061 that matches the tag); the response varies between embodiments and is based on various factors (e.g., whether the cache lookup was initiated in response to a write command, a read command, a snoop (and possibly the type of snoop)). For example, in some embodiments, the response is used to determine whether the cache coherence protocol state is a state that grants cache rights to modify a cache line (e.g., a "modified" or "exclusive" state) in response to a write command and / or certain types of snoops, as discussed in more detail below. In some embodiments, the cache controller 4051 includes: 1) a hit-miss circuit system (not shown) for determining whether there is a hit or a miss in the cache in response to a command (e.g., a write command, a read command, a snoop command); 2) a snoop controller 4043 coupled to a snoop interface (not shown) to receive snoops and transmit response messages to the snoops; and 3) a cache row read circuit system (not shown) and a cache row write circuit system (not shown).

[0359]

[0360] Although some embodiments are implemented to configure a cache line to indicate all zeros by overwriting the data in the cache line with zeros (a first technique), alternative embodiments may use other techniques to configure the cache line to indicate all zeros (the second to fourth techniques described below are examples). Such other techniques may be implemented for various reasons, such as the size of a cache line is generally larger than the width of some buses / structures within the core (e.g., intermediate buffers such as the load queue 810, the store queue 820, the write-combining buffer (WCB) 860) and / or overwriting the data in the cache line with zeros consumes power and increases the complexity of the cache.

[0361] The second technique is to invalidate the cache line in the way of the cache in which the cache line currently resides and write the cache line with zeros to a different way of the cache.

[0362] The third and fourth techniques involve changing the tag state rather than the data in the data array 4056, and these can be used in one or more of the cache levels and / or in the interconnect. The third technique is to implement a field (referred to as the zero row field 4066) for each of the cache lines (e.g., in the (multiple) attribute fields 4062), and the value in this field (which may be a single bit) indicates: 1) the cache line should be considered to have the value of the data stored in the cache line; or 2) the cache line should be considered all zeros (regardless of the actual data stored in the cache line). In such an embodiment, a read (including an eviction) of the cache line will cause the value of the zero row field 4066 to be passed to another structure that supports such a zero row field or convert the data to zero. The data will also be converted before it is used for reading by one of the consistency agents (e.g., consistency agent 3900). Although in some such embodiments, the data is also converted before being written to the downstream memory QO30, alternative embodiments also implement zero row fields in the downstream memory 3930 or an alternative memory structure managed by the memory controller.

[0363] A fourth technique implements new encodings in existing attribute fields of attribute field(s) like the third technique (eg, new encodings in a cache coherence protocol status field or an error correction code (ECC) check subfield), rather than implementing separate fields.

[0364] Certain embodiments may implement a cache to modify the cache coherence protocol state of the cache line to "modified" or "owned" as part of configuring the cache line to indicate all zeros (or to a zero line state in the case of using a new encoding in the cache coherence state field to indicate a zero line) and cause any (multiple) tainted indications to be ignored (data is no longer tainted) or cleared. Thus, another advantage of the cache line zeroing instruction is that it can be used to consistently clear tainted lines.

[0365] In this regard, a mechanism for forcing cache lines to zero may be implemented only in certain cache levels (e.g., a subset of the L1 cache, L2 cache, and L3 cache, such as only in the L1 cache and not in the L2 or L3 caches), and a given cache level lacking such a mechanism may be implemented to configure the cache line to indicate all zeros by sending the cache line to a different cache level that has the mechanism (e.g., a higher cache level (e.g., L1 cache) is implemented to configure the cache line to indicate all zeros by evicting data to a lower cache level (e.g., L2 cache) where zeroing can be performed; a lower cache level (e.g., L2 cache) is implemented to configure the cache line to indicate all zeros by forwarding the cache line to a higher level cache (e.g., L1 cache) where zeroing can be performed). As described in more detail below, different embodiments may implement zeroing of cache lines in response to writes and / or snoops. In embodiments where zeroing of cache lines is implemented in response to both writes and snoops, a given cache level may be implemented to perform zeroing in response to only one of a write or a snoop (but not both), and data may be pushed / evicted or forwarded to a lower or higher level cache that may perform zeroing in response to the other of a write and a snoop.

[0366]

[0367] Regardless of the technique implemented in the cache for configuring a cache line to indicate all zeros (see above), triggering the cache to configure the cache line to indicate all zeros may be in response to a message sent from the interconnect to one of the caches, either by the publishing agent itself or by the publishing agent in response to a message sent from the interconnect.

[0368] In the case where the issuing agent (itself or in response to a message from the interconnect) triggers the cache to configure the cache line to indicate all zeros, different embodiments may use different techniques, including techniques for implementing atomic cache line zeroing instructions when the cache line is wider (e.g., 32 bytes, 64 bytes) than the natively supported data width (e.g., 32 bits, 64 bits, 128 bits, 256 bits, 512 bits, 1024 bits) of the issuing agent. In different embodiments, the natively supported data width may manifest itself in different ways. In some embodiments, the natively supported data width may represent the width of the widest set of registers and / or the width of the operand(s) to be operated on by the instruction in bits. In some embodiments, the natively supported data width may represent the width of an arithmetic and / or logic execution unit (e.g., when the width is the same width as the operand indicated by the instruction so that multiple portions of the operand are pumped through the width in sequence (double pumping or more)). In some embodiments, the natively supported data width may represent the width of a bus (e.g., a load pipeline). The amount of data that can be stored atomically may be limited by the width of one or more internal structures (eg, buses, intermediate buffers) of the issuing agent.

[0369] Thus, in some embodiments where the issue agent (either itself or in response to a message from the interconnect) triggers the cache to configure a cache line to indicate all zeros, the issue agent: 1) implements a zero line field in other structures such as one or more of the intermediate buffers (e.g., store queue 820 and write-combining buffer (WCB) 860); or 2) implements a new command (e.g., micro-op, control signal, micro-instruction) that does not carry a cache line with zeros but indicates a cache line-sized write of zeros that may pass through the intermediate buffers (e.g., store queue 820 and write-combining buffer (WCB) 860). Thus, when the cache line size is wider than the data width natively supported by the issue agent (e.g., 32 bytes, 64 bytes), the cache line with zeros may be represented in these narrower structures. When a zero row (as indicated by a zero row field or a new command / micro-operation) is sent to a structure lower in the memory hierarchy and that does not support the zero row field or the new command, a conversion of the row with zeros is performed (e.g., a conversion of the row with zeros can be performed when the zero row is sent to the data cache 840 (which can perform another of the above techniques), sent from the write-merging buffer 8600, sent by the L3 cache to the interconnect, or sent by the interconnect (e.g., via a memory controller) to a downstream memory).

[0370] As another example, in some embodiments where the issuing agent (either by itself or in response to a message from the interconnect) triggers the cache to configure a cache line to indicate all zeros, the issuing agent writes smaller chunks of zeros sequentially (e.g., 16 bytes at a time, 32 bytes at a time) into an intermediate buffer (e.g., store queue 820, write-combining buffer (WCB) 860, a separate staging buffer (not shown)) that is not responsive to snoops (or is not responsive to snoops while chunks are being written) and is evicted in response to having written enough chunks to equal the size of the cache line (and no earlier) so that the chunks are being written simultaneously; thereby, atomically implementing a cache line zeroing instruction.

[0371]

[0372] Different embodiments may implement cache line zeroing instructions with different orderings (e.g., weak ordering, strong ordering, ordering weaker than weak ordering, ordering stronger than strong ordering). In the case of weakly ordered cache line zeroing instructions, embodiments may implement the instruction so that it is automatically evicted.

[0373] The cache line zeroing instruction may be implemented such that it will not configure the cache line to indicate all zeros until the instruction retires. In such an embodiment, there is a mechanism (e.g., a fence instruction, a lock instruction, an architecturally serializing instruction, a younger store being GO (strong ordering), a younger load being GO (stricter than strong ordering)) to ensure that the cache line zeroing instruction has completed and the cache line is configured to indicate all zeros for all reads.

[0374] The cache line zeroing instruction may be treated as a store for the purpose of a page table walk (including virtualization tables (e.g., Extended Page Tables (EPT) where the A and D bits will be updated), shadow page tables) and will fault if not writable.

[0375]

[0376] Fig.414 is a flow chart illustrating an embodiment of the present invention of first attempting to write to the cache of the issuing agent before using snooping. As discussed above, the first agent 3900 is used to decode and execute instructions, the execution of which is used to cause a cache line-sized zero write at a memory address (box 4110). In response to decoding and executing the instruction, the first agent is used to issue a write command for initiating a cache line-sized zero write at the memory address to one of the coherent caches (e.g., L1 cache 3905) coupled to the first agent (in this case, the first agent is also referred to as an issuing agent) (box 4112). In some embodiments, the first agent includes a decoding unit (e.g., decoder 140, decoder 314) for decoding instructions, the execution of which is used to cause a cache line-sized zero write at the memory address. The first agent also includes an execution unit (e.g., (multiple) memory access units 164, load-store unit 340), which issues a command for initiating a cache line-sized zero write at the memory address in response to the decoding unit.

[0377] When there is a hit on the cache line of the cache to which the command is issued (e.g., L1 cache 3905) (block 4114) and the cache coherence protocol state of the cache line is a state that grants the cache the right to modify the cache line without broadcasting to other caches (e.g., "modified" or "exclusive") (block 4116), the cache is configured to indicate all zeros and suppress snooping (block 4118). Different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros". In some embodiments, if there is a hit on the cache line of the cache to which the command is issued (e.g., L1 cache 3905) (block 4114), the cache line is still zeroed for one or more other cache coherence protocol states (e.g., one or more of "owned", "forwarded", or "shared"). For any state where this action is completed, control passes to block 4119; for any state where this action is not completed, control passes to block 4120. Thus, in embodiments where control passes to block 4119 for any state other than "modified," "exclusive," and "invalid," then block 4120 is not implemented; and vice versa. However, embodiments where control passes to either block 4119 or 4120 may be implemented depending on the state. In block 4119, the cache is configured to configure the cache line to indicate all zeros; from block 4119, control passes to block 4122 (described in more detail later herein) where the cache is configured to issue a write command to the interconnect (depending on the embodiment, to the next cache level or to the interconnect to issue a snoop (e.g., a write-update snoop (also known as a write-zero snoop or a write and zero snoop), a write-invalidate snoop (also known as an invalidate even if modified snoop), or a snoop indicating invalidate and write back (also known as a write back and invalidate snoop)). Possibly, the write command passed to the next cache level or interconnect will indicate a snoop with Rows with a state other than "modified" or "exclusive" are configured to indicate all zeros. One use of this modified write command is so that if a "shared" row is configured to all zeros and its state is changed to "modified" or "owned", then a write-update snoop will not be issued. In this case, the interconnect may issue different snoop types (e.g., write-invalidate snoop or write-back and invalidate snoop). In block 4120, the cache is used to change the cache coherence protocol state of the cache line to "invalid", and control passes to block 4122. If there is a cache miss (block 4114), control passes to block 4122.

[0378] By way of a specific example with respect to the forwarding or owning state, when the cache of the issuing agent has a cache line in the forwarding or owning state, the cache line may be in other caches in the shared state. Thus, if the cache line is zeroed in block 4119, a snoop may be sent to invalidate those other cache lines in the shared state or configure those other cache lines in the shared state to indicate all zeros. Alternatively, the cache line in the forwarding or owning state may be invalidated (or cleared, evicted and invalidated) (block 4120), and a new line modified and zeroed or owned and zeroed may be created. The new line that is zeroed may be inserted (filled into) the same cache as the cache line that is found to be in the forwarding or owning state (e.g., in a different set or way of the cache), or it may be inserted into a different cache (e.g., if a cache line in an L2 cache or an L3 cache is found to be in the forwarding or owning state, the cache line may be invalidated, and a new line modified and zeroed or owned and zeroed may be created in the L1 cache).

[0379] In block 4122, the cache is used to issue a write command to the interconnect. This write command may be issued directly to the interconnect 3920, or may be sent to one or more lower level caches of the first agent. By way of example: 1) in some embodiments, the write command is issued directly to the interconnect (i.e., skipping any caches at lower levels of the cache hierarchy - e.g., from the L1 cache 3905 directly to the interconnect 3920, skipping any lower level caches (e.g., L2 cache OQA10, L3 cache OQA15) - in which case the write command is for the data L1 cache of the first agent, while listening (described next) to the instruction L1 cache, L2 cache, and L3 cache (more specifically, L3 cache slice 3916, if implemented) for the first agent and the cache of the second agent); 2) in some embodiments, the write command is issued to the L2 cache 3910, which repeats the above and, if it does not configure the cache line to indicate all zeros, sends the write command directly to the L2 cache 3910. 3) in some embodiments, the write command is issued to the L2 cache 3910, which repeats the above and, if it does not configure the cache line to indicate all zeros, issues the write command to the L3 cache 3915 (more specifically, the L3 cache slice 3916, if implemented), and, if it does not configure the cache line to indicate all zeros, issues the write command to the interconnect 3920 - in this case, the write command is used for the cache of the first agent, and the snoop (described next) is used for the cache of the second agent. In some embodiments, the cache(s) to which the write command is issued include a cache controller that is implemented to determine whether there is a cache hit in response to the write command discussed above, configure the cache line to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring Cache Lines to Indicate All Zeros"), and issue the write command to the interconnect upon a cache miss. In one specific example, in response to a cache line hit, at the (issuing agent's) modified, exclusive, and / or owned L2 cache 3910, the L2 cache is implemented to configure the cache line to indicate all zeros by forwarding the task to the L1 cache.

[0380] Snoop controller 3925 of interconnect 3920 is implemented to initiate a snoop process (block 4190) in response to a write command to locate any cache that may be storing the cache line. To implement snoop process 4190, snoop controller 3925 is implemented (e.g., via snoop generator 3926) to issue snoops (block 4126) to those caches in the coherent cache that may be storing the cache line (in other words, those caches in the coherent cache for which a hit must be determined). In some embodiments, the coherent caches that may be storing the cache line are those in the coherent cache that: 1) have not previously issued a write command to them; and 2) in embodiments where a snoop filter (not shown) in interconnect 3920 is implemented, the caches indicated by the snoop filter that may contain the line (i.e., for which the snoop filter does not suppress snoops). This may include one or more levels of caches (e.g., L1 cache 3906, L2 cache 3911, L3 cache 3915) coupling the second agent 3901 to the interconnect 3920; and any of the following caches (e.g., L2 cache 3910, L3 cache 3915): the cache coupling the first agent 3900 (issuing agent) to the interconnect 3920, the cache that does not receive the write command (i.e., the skipped cache), and in embodiments where a snoop filter (not shown) in the interconnect 3920 is implemented, the cache indicated by the snoop filter that may contain the line (i.e., the snoop filter does not suppress the snoop). In embodiments where snoops are issued to one or more of the caches coupling the first agent to the interconnect, each such snoop may also be referred to as a back snoop. As part of the snoop process 4190, different embodiments may be implemented to issue different types of snoops, or only one type of snoop, depending on the situation. There are various possible snoop types that can be used (e.g., write-update snoop (also known as write-zero snoop or write-and-zero snoop), write-invalidate snoop (also known as invalidate even if modified snoop), snoop indicating invalidate and write-back (also known as write-back and invalidate snoop), snoop that writes out any cache line that hits but does not send the data back to the first agent and does not cause the data to be read from the downstream memory, prior art snoops (e.g., RFO)), as discussed in more detail later in this document. Specifically, when write-update snooping is used, as part of the snooping process 4190, the snooping controller 3925 is also implemented to determine whether a cache line-sized write is performed by one of the caches in response to one of the write-update snoops (as shown in the dashed box 4128); if so, the process is completed (box 4130); otherwise, control is passed to box 4132. Box 4128 is dashed because it is not used when the snooping process 4190 uses other types of snooping.

[0381] The write command and snoop operation are to handle the situation where there is a cache line in one or more of the caches that contains data to be zeroed. The cache line sized write of zeros may have been performed by one of the caches in response to the write command (as described above), or in embodiments that issue write-update snoops, by one of the caches in response to one of the write-update snoops, as described in more detail below. If a cache line sized zero write has not been performed by any of the caches, then in block 4132, the interconnect 3920 (e.g., via a write generator 3929 of the snoop controller 3925) or the first agent (publishing agent) causes a cache line in one or more of the coherent caches (e.g., L1 cache 3905, L2 cache 3910, L3 cache 3915) to be configured to indicate all zeros (different embodiments may implement the cache to configure a cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros") or causes a cache line sized zero write to be performed to a downstream memory at the memory address. As indicated above and as described in more detail below, in some embodiments, the snoop controller 3925 includes a snoop responder 3927 (and optionally a write translator 3928 and a write generator 3929) in response to this action. In some embodiments, the first agent (e.g., via an execution unit (e.g., memory access unit(s) 164, load-store unit 340), or other hardware structure) performs its roll (if any) in this action. In an alternative embodiment, the interconnect 3920 directs the memory controller to cause zero writes to downstream memory.

[0382] As described above in the section entitled "Triggering Cache to Configure Cache Line to Indicate All Zeros," different embodiments may variously implement the issuing agent to trigger the cache to configure the cache line to indicate all zeros (e.g., to ensure atomicity for cache lines wider than the natively supported data width of the issuing agent (e.g., 32 bytes, 64 bytes), implement a zero line field in other structures (e.g., an intermediate buffer), implement a new command that may pass through the intermediate buffer (which does not carry a cache line with zeros but indicates a cache line size write of zeros), or implement sequential writing of smaller chunks of zeros (e.g., 16 bytes at a time, 32 bytes at a time) to an intermediate buffer (e.g., store queue 8200, write-combining buffer (WCB) 8600, separate staging buffer (not shown)), which intermediate buffer is not responsive to snoops (or is not responsive to snoops when chunks are being written) and is evicted in response to having written enough chunks to equal the size of the cache line (and no earlier) so that the chunks are being written simultaneously).

[0383]

[0384] Fig.42 is a flow chart illustrating an embodiment of the present invention that relies on snooping of a coherent cache that does not first attempt to write to the cache of the issuing agent. As discussed above, the first agent 3900 decodes and executes an instruction, the execution of which causes a cache line-sized write of zeros to be performed at a memory address (block 4210). In response to decoding and executing the instruction, the first agent is operable to issue a command to the interconnect 3920 for initiating a cache line-sized write of zeros at the memory address (in this case, the first agent is also referred to as an issuing agent) (block 4212). In some embodiments, the first agent includes a decode unit (e.g., decoder 140, decoder 314) for decoding an instruction, the execution of which causes a cache line-sized write of zeros to be performed at the memory address. The first agent also includes an execution unit (e.g., memory access unit(s) 164, load-store unit 340) that issues a command to initiate a cache line-sized write of zeros at the memory address in response to the decode unit.

[0385] The command from the first agent / issuing agent 3900 is issued to the interconnect 3920 (block 4212), and the interconnect 3920 is implemented in response to the command to initiate a snoop process (block 4290) to locate any caches that may be storing the cache line. To implement the snoop process 4290, the interconnect 3920 (e.g., via the snoop controller 3925) is implemented (e.g., via the snoop generator 3926) to issue snoops (block 4226) to those of the coherent caches that may be storing the cache line (in other words, those of the coherent caches for which a hit must be determined). In some embodiments, the coherent caches that may be storing cache lines are those of the coherent caches that perform the following: 1) any of the coherent caches (e.g., L1 cache 3905, L2 cache 3910, L1 cache 3906, L2 cache 3911, L3 cache 3915) in embodiments that do not implement a snoop filter (not shown) in the interconnect 3920; or 2) in embodiments that do not implement such a snoop filter, those caches in the coherent caches that are indicated by a snoop filter (not shown) in the interconnect 3920 that may contain the line (i.e., the snoop filter does not suppress snoops). In embodiments where snoops are issued to one or more caches in the caches that couple the first agent to the interconnect, each such snoop may also be referred to as a backward snoop. As previously described, as part of the snoop process 4290, different embodiments may issue different types of snoops, or only issue one type of snoop, depending on the circumstances. There are various possible snoop types that may be used (e.g., write-update snoop (also known as write-zero snoop or write-and-zero snoop), write-invalidate snoop (also known as invalidate even if modified snoop), snoop indicating invalidate and write-back (also known as write-back and invalidate snoop), snoop that writes out any cache line that hits but does not send the data back to the first agent and does not cause the data to be read from the downstream memory, prior art snoops (e.g., RFO), as discussed in more detail later herein. Specifically, when write-update snooping is used, as part of the snooping process 4290, the snooping controller 3925 is also implemented to determine whether a cache line sized write is performed by one of the caches in response to one of the write-update snoops (as shown in dashed box 4228); if so, the process is complete (box 4230); otherwise, control is passed to box 4232. Box 4228 is dashed because it is not used when the snooping process 4290 uses other types of snoops.

[0386] In an alternative embodiment, box 4212 is replaced by a first agent that is implemented to issue snoop commands to those caches in the coherent cache that may be storing cache lines (in which case box 4226 does not exist and the process passes to box 4228 in an embodiment using write-update snooping, or to box 4232 in other cases).

[0387] Snoop operations are performed to handle the situation where there is a cache line containing data to be zeroed in one or more of the caches. In embodiments where write-update snoops are issued, a cache line-sized zero write may have been performed by one or more of the caches. If a cache line-sized zero write has not been performed by any of the caches, then in block 4232, the first agent itself, the interconnect 3920 (e.g., via the write generator 3929), or the first agent in response to a message from the interconnect 3920 causes a cache line in one or more of the caches (e.g., L1 cache 3905, L2 cache 3910, L3 cache 3915) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring Cache Lines to Indicate All Zeros") or causes a cache line-sized zero write to be performed to a downstream memory at the address. As indicated above and as described in more detail below, in some embodiments, the snoop controller 3925 includes a snoop responder 3927 (and optionally a write translator 3928 and a write generator 3929) for performing its rollover (if any) in this action. In some embodiments, the first agent (e.g., via an execution unit (e.g., memory access unit(s) 164, load-store unit 340), or other hardware structure) performs its rollover (if any) in this action. In an alternative embodiment, the interconnect 3920 directs the memory controller to cause zero writes to downstream memory.

[0388] As described above in the section entitled "Triggering Cache to Configure Cache Line to Indicate All Zeros," different embodiments may variously implement the issuing agent to trigger the cache to configure the cache line to indicate all zeros (e.g., to ensure atomicity for cache lines wider than the natively supported data width of the issuing agent (e.g., 32 bytes, 64 bytes), implement a zero line field in other structures (e.g., an intermediate buffer), implement a new command that may pass through the intermediate buffer (which does not carry a cache line with zeros but indicates a cache line size write of zeros), or implement sequential writing of smaller chunks of zeros (e.g., 16 bytes at a time, 32 bytes at a time) to an intermediate buffer (e.g., store queue 8200, write-combining buffer (WCB) 8600, separate staging buffer (not shown)), which intermediate buffer is not responsive to snoops (or is not responsive to snoops when chunks are being written) and is evicted in response to having written enough chunks to equal the size of the cache line (and no earlier) so that the chunks are being written simultaneously).

[0389]

[0390] As previously described, as part of the snoop process 4190 or the snoop process 4290, different embodiments may issue different types of snoops, or only issue one type of snoop, depending on the situation. There are various possible snoop types that can be used (e.g., write-update snoops (also known as write-zero snoops or write-and-zero snoops), write-invalidate snoops, snoops that indicate invalidation and write-back (also known as invalidate even if modified snoops), snoops that write out any cache line that hits but do not send data back to the first agent and do not cause data to be read from downstream memory, prior art snoops (e.g., RFOs)). As previously indicated, any of these different types of snoops may be combined with the above descriptions of the snooping process. Fig.41 and Fig.42 Any of the embodiments discussed may be used. More details on the different types of monitoring will now be described.

[0391] Write-Update Listener : Fig.43 4 is a flow chart illustrating an embodiment of the present invention using write-update snooping (also known as write-zero snooping or write and zero snooping) to implement the snooping process 4190 or 4290. Fig.41 and Fig.42In the context of , flow passes from block 4124 or block 4212, respectively, to block 4326, which performs block 4126 or block 4226 using write-update snooping. Interconnect 3920 (e.g., via snoop generator 3926 of snoop controller 3925) is implemented to issue write-update snoops (block 4326) to those caches in the coherent cache that may be storing the cache line (in other words, those caches in the coherent cache for which a hit must be determined). When there is a hit on a cache line of a cache to which a write-update snoop is issued (e.g., the L1 cache, L2 cache, and / or L3 cache slice of the first agent, and the L1 cache, L2 cache, and L3 cache slice of the second agent) (block 4340), the cache is used to: 1) if the cache coherence protocol state of the hit cache line is "modified" (and in some embodiments, one or more of "forwarded", "exclusive", "owned", and / or "shared") (block 4342), configure the cache line to indicate all zeros (block 4344) (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros") and issue a cache line indicating the return to the interconnect 3920; A response message indicating zero (in some embodiments supporting zeroing of a hit cache line in a shared state, the response message also distinguishes the state of the cache line - such as modified and zero or owned and zero and shared and zero (the latter indicating that the original state is "shared" and the cache has configured the cache line to indicate all zeros and its state is still "shared"); in an alternative embodiment supporting zeroing of a cache line in a shared state, when the original state is "shared" and the cache has configured the cache line to indicate all zeros and its state is still "shared", a response message indicating not zeroed is sent (as in box 4350)) (4346); and 2) otherwise, the cache coherence protocol state of the cache line is configured to "invalid" (box 4328) and a response message indicating not zeroed is issued to the interconnect (box 4350). When there is no hit on the cache line of the cache to which the write-update snoop is issued (box 4340), the cache issues a response message indicating not zeroed to the interconnect (box 4350). Thus, in some embodiments, a coherent cache may be implemented such that a write command or a write and zero snoop that hits a cache line in any of the Modified, Owned, Exclusive, and Forwarding states will cause the cache to configure the cache line to zero (and change its state to Modified (Modified and Zeroed) or Owned (Owned and Zeroed)).In an alternative embodiment, such a cache may do so only for a subset of the modified, owned, exclusive, and forwarding states; in this case, this will cause any hit cache line that is in the modified, owned, exclusive, or forwarding state and has not become modified and zeroed or owned and zeroed to become invalid in response to a write and zero snoop. Thus, in some embodiments, all or a subset of a coherent cache may be implemented to cause cache lines to be zeroed (and their states to be modified (modified and zeroed) or owned (owned and zeroed)) in response to a write command or write and update (i.e., write and zero) snoop that hits in the cache for all or a subset of the modified, exclusive, owned, or forwarding states. An embodiment that supports zeroing a hit cache line in a shared state and keeping it in a shared state will do so only when any modified, exclusive, owned, or forwarding line that hits in other caches becomes owned and zeroed or invalid instead of becoming modified and zeroed. In some embodiments, a cache implemented to respond to write-update snooping includes a cache controller 4051 (e.g., via snooping controller 4053) that is used to determine whether there is a cache hit in response to a write-update command, configure the hit cache line to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring Cache Lines to Indicate All Zeros"), and publish a response message to interconnect 3920.

[0392] After issuing a write-update snoop, interconnect 3920 (e.g., via snoop responder 3927 of snoop controller 3925) is implemented to track receipt of a corresponding response message (block 4352) (e.g., in one embodiment, snoop generator 3926 indicates information to snoop responder 3927 for it to track receipt of a corresponding response message). Control passes from block 4352 to block 4128 or block 4228, depending on Fig.41 still Fig.42An embodiment is being implemented. A cache line sized write of zeros may have been performed by one of the caches in response to one of the write-update snoops (however, in embodiments where zeroing of cache lines in a "shared" state is implemented and no response message reflects one of the cache lines being owned and zeroed or modified and zeroed, then a cache line write of zeros is not considered to have been performed by one of the caches in response to one of the write-update snoops). If a cache line sized write of zeros has not been performed by any of the caches (boxes 4128 and box 4228) (all response messages indicate no zeroing; or in embodiments where zeroing of cache lines in a "shared" state is implemented and no response message reflects one of the cache lines being owned and zeroed or modified and zeroed), then box 4132 or box 4232 is performed - that is, the interconnect 3920 (e.g., via the write generator 3929 of the snoop controller QO25) or the first agent (e.g., via an execution unit (e.g., ( Multiple) memory access units 164, load-store units 340) or other hardware structures) respond to a message from the interconnect 3920 to cause a cache line in one of the caches (e.g., L1 cache, L2 cache, L3 cache) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros") or cause a cache line-sized write of zeros to be performed to a downstream memory at the address.

[0393] As demonstrated above, the advantage of using a write-update snoop, as opposed to using an RFO operation, is that it does not require the line to be read and returned to the issuing agent and does not require the ownership of the data to be given to the issuing agent (when the conditions of 4340 and 4342 are met, the write-update snoop causes the cache line in the cache of another coherency agent to be zeroed). Thus, an advantage of embodiments using a write-update snoop is that it can directly update the local cache of another agent (e.g., a second agent / non-issuing agent). This allows, for example, relatively fast communication - such as updating a variable that another agent spins on.

[0394] As indicated previously, write-update listeners can be combined with Fig.41 and Fig.42 By way of example, the implementation of Fig.41A specific embodiment of write-update snooping in one of the embodiments of . In this specific embodiment, the issuing agent 3900 first attempts to write to the L1 cache 3905 of the issuing agent 3900; and if snooping is required, the interconnect 3920 issues write-update snoops to those caches in the coherent cache that may be storing the cache line as described above. Therefore, the L1 cache is implemented to respond to the write command as described above; the L1 cache, L2 cache, and L3 cache (more specifically, L3 cache slices, if implemented) are implemented to respond to write-update snooping as described above; the interconnect 3920 is implemented to issue write-update snoops in response to the write command as described above (e.g., via the snoop generator 3926 of the snoop controller 3925) and respond to the response message (e.g., via the snoop responder 3927 of the snoop controller 3925); and the interconnect 3920 (e.g., via the write generator 3929 of the snoop controller QO25) or the first agent (e.g., through the execution unit (e.g., (Multiple) memory access unit(s) 164, load-store unit 340) or other hardware structures) are implemented in response to a message from the interconnect to cause a cache line in one of the caches (e.g., the first agent's L1 cache 3905, L2 cache 3910, or L3 cache 3915 (more specifically, an L3 cache slice 3916, if implemented)) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros") or to cause a cache line-sized write of zeros to be performed to a downstream memory at a memory address.

[0395] Write-Invalid Listen : Fig.44 4 is a flow chart showing an embodiment of the present invention using write-invalidate snooping (also known as "invalidate even after modification snooping") to implement snooping process 4190 or 4290. Fig.41 and Fig.42In the context of , flow passes from block 4124 or block 4212, respectively, to block 4426, which performs block 4126 or block 4226 using a write-invalidate snoop. Interconnect 3920 (e.g., via snoop generator 3926 of snoop controller 3925) is implemented to issue write-invalidate snoops (block 4426) to those caches in the coherent cache that may be storing the cache line (in other words, those caches in the coherent cache for which a hit must be determined). When there is a hit in the cache line of the cache to which the write-invalidate snoop is issued (e.g., the L1 cache, L2 cache, and / or L3 cache slice of the first agent, and the L1 cache, L2 cache, and L3 cache slice of the second agent) (block 4440), the cache is used to cause the cache coherence protocol state to indicate "invalid" (even if the current state is "modified") (block 4448); the cache does not need to configure the cache line to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring Cache Lines to Indicate All Zeros") or issue a response message to the interconnect when the invalidation is completed within a fixed time (if the invalidation is not completed within a fixed time, one embodiment causes the snooped cache to send a response message indicating that the snoop is completed). When there is no hit in the cache line of the cache to which the write-invalidate snoop is issued (4440), the cache, in one embodiment, does not take any action (block 4430).

[0396] In addition, Fig.41 and Fig.42In the context of , flow passes from box 4124 or box 4212 to box 4132 or box 4232, respectively (boxes 4128 and box 4228 are not implemented when write-invalidate snooping is used). In box 4132 or box 4232, the first agent (e.g., by an execution unit (e.g., (multiple) memory access unit 164, load-store unit 340) or other hardware structure) itself, the interconnect 3920 (e.g., via the write generator 3929 of the snoop controller QO25), or the first agent (e.g., by an execution unit (e.g., (multiple) memory access unit 164, load-store unit 340) or other hardware structure) in response to a message from the interconnect causes a cache line in one of the caches (e.g., the first agent's L1 cache 3905, L2 cache 3910, or L3 cache 3915 (more specifically, L3 cache slice 3916, if implemented)) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring Cache Lines to Indicate All Zeros") or causes a cache line-sized write of zeros to be performed to the downstream memory at the address.

[0397] As demonstrated above, an advantage of using a write-invalidate snoop, as opposed to using an RFO operation, is that it does not require the cache line to be read or returned to the issuing agent since the issuing agent will zero the data.

[0398] As indicated previously, write-invalidate snooping can be combined with Fig.41 and Fig.42 By way of example, the implementation of Fig.413905 of the embodiment of the invention. In this particular embodiment, the issuing agent 3900 first attempts to write to the L1 cache 3905 of the issuing agent 3900; and if a snoop is required, the interconnect 3920 issues a write-invalidate snoop to those caches in the coherent cache that may be storing the cache line, as described above. Thus, the L1 cache is implemented to respond to the write command as described above; the L1 cache, L2 cache, and L3 cache (more specifically, the L3 cache slice, if implemented) are implemented to respond to the write-invalidate snoop as described above; the interconnect 3920 is implemented to issue a write-invalidate snoop in response to the write command; and the first agent (e.g., by the execution unit (e.g., (multiple) memory access unit 164, load-store unit 340) or other hardware structure) itself, the interconnect 3920 (e.g., via the write generator 3929 of the snoop controller QO25), or the first agent (e.g., by the execution unit (e.g., (multiple) memory access unit 164, load-store unit 340) or other hardware structure) issues a write-invalidate snoop to the L1 cache 3905 of the issuing agent 3900; and if a snoop is required, the interconnect 3920 issues a write-invalidate snoop to the coherent cache that may be storing the cache line, as described above. The memory access unit 164, the load-store unit 340) or other hardware structure) is implemented in response to a message from the interconnect to cause a cache line in one of the caches (e.g., the L1 cache 3905, the L2 cache 3910 or the L3 cache 3915 of the first agent (more specifically, the L3 cache slice 3916, if implemented)) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros") or to cause a cache line-sized write of zeros to be performed to a downstream memory at a memory address.

[0399] Invalidate and write back listeners : Fig.45 4 is a flow chart illustrating an embodiment of the present invention of implementing a snooping process 4190 or 4290 using invalidation and write-back snooping (also referred to as "write-back and invalidation snooping"). Fig.41 and Fig.42In the context of , flow passes from block 4124 or block 4212, respectively, to block 4526, which performs block 4126 or block 4226 using write-back and invalidate snoops (invalidate and write-back snoops). Interconnect 3920 (e.g., via snoop generator 3926 of snoop controller 3925) is implemented to issue write-back and invalidate snoops (block 4526) to those caches in the coherent cache that may be storing the cache line (in other words, those caches in the coherent cache for which a hit must be determined). When there is a hit on the cache line of the cache to which such a snoop is issued (e.g., the L1 cache, L2 cache, and / or L3 cache slice of the first agent, and the L1 cache, L2 cache, and L3 cache slice of the second agent) (block 4540), the cache is used to: 1) write the cache line back to the interconnect 3920 (block 4544) if the cache coherence protocol state of the cache line is "modified" (block 4542) (and in some embodiments, "clear-evicted"); and in any case 2) make the cache coherence protocol state of the cache line indicate "invalid" (block 4548) (the cache does not need to configure the cache line to indicate all zeros). When there is no hit on the cache line of the cache to which the snoop is issued (block 4540), the cache, in one embodiment, does not take any action (control passes to block 4552). In some embodiments, a cache implemented to respond to such snooping includes a cache controller 4051, which is used to determine whether there is a cache hit in response to such snooping, write back modified cache lines (e.g., those cache lines that hit and have a cache consistency protocol state of "modified") to the interconnect 3920, and modify the cache consistency protocol state of the cache lines to "invalid".

[0400] After issuing the snoop, the interconnect 3920 (e.g., via the snoop responder 3927 of the snoop controller 3925) is implemented to track the receipt of any corresponding response messages (block 4552) (e.g., in one embodiment, the snoop generator 3926 indicates information to the snoop responder 3927 for it to track the receipt of any corresponding response messages). If the response message is received with data (i.e., data from the modified cache line) (block 4560), the interconnect 3920 is optionally implemented to effectively convert the data to zeros (block 4562) (e.g., via the write converter 3928 of the snoop controller 3925). Otherwise, the interconnect 3920 is optionally implemented to effectively create a zero row (block 4564) (e.g., via the write generator 3929 of the snoop controller 3925). Control passes from block 4562 and block 4564 to block 4132 or block 4232 (blocks 4128 and 4228 are not implemented when invalidation and writeback snooping are used), depending on the implementation. Fig.41 still Fig.42 In block 4132 or block 4232, the first agent (e.g., by an execution unit (e.g., memory access unit(s) 164, load-store unit 340), or other hardware structure) itself, the interconnect 3920 (e.g., snoop controller QO25), or the first agent (e.g., by an execution unit (e.g., memory access unit(s) 164, load-store unit 340), or other hardware structure) causes a cache line in one of the caches (e.g., L1 cache, L2 cache, L3 cache) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring Cache Lines to Indicate All Zeros") in response to a message from the interconnect 3920, or causes a cache line-sized zero write to a downstream memory at the address. In one embodiment, blocks 4560 and 4562 are not implemented, and block 4564 is always executed. In another embodiment, block 4562 is not performed, the write-back data is sent to the first agent, and the first agent zeroes the data. In another embodiment, blocks 4560, 4562, and 4564 are not performed, and the first agent zeroes the data.

[0401] As demonstrated above, the advantage of using invalidate and write-back snoops, as opposed to using RFO operations, is that it does not require the cache line to be read or returned to the issuing agent since the issuing agent will zero the data.

[0402] As previously described, the above is in response to the first agent issuing a command to initiate a cache line sized write of zeros at an address aligned on a cache line boundary (e.g., block 4112 or block 4212). As previously described, this command can take the form of a write command (e.g., block 4112 or block 4212). In other embodiments, this command may be a read command (e.g., block 4212); in this case, a cache line in one of the caches (e.g., L1 cache, L2 cache, L3 cache) is configured to indicate all zeros by: 1) the interconnect 3920 (e.g., snoop controller 3925) being implemented to respond to a write command from the first agent, the write command having a response to the first agent indicating a zero line (the line will have its cache coherence protocol state set to modified or exclusive); and 2) the first agent being implemented to place the result of its read command into the cache (causing the cache (e.g., L1 cache 3905) to configure the cache line to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros"), but not into the first agent's architectural register file.

[0403] As indicated previously, the listeners that indicate invalidation and writeback can be combined Fig.41 and Fig.42 By way of example, the implementation of Fig.41A specific embodiment of such a snoop in one of the embodiments of the invention. In this specific embodiment, the issuing agent 3900 first attempts to write to the L1 cache 3905 of the issuing agent 3900; and if a snoop is required, the interconnect 3920 issues a snoop to those caches in the coherent cache that may be storing the cache line, as described above. Thus, the L1 cache is implemented to respond to the write command as described above; the L1 cache, L2 cache, and L3 cache (more specifically, the L3 cache slice, if implemented) are implemented to respond to the snoop as described above; the interconnect 3920 is implemented to issue a snoop in response to the write command, optionally implemented to effectively convert to zeroing any received data in response to the snoop (e.g., via a write converter 3928 of a snoop controller 3925), and optionally implemented to effectively create a zero line when no data is received in response to the snoop (e.g., a write generator 3929 of the snoop controller 3925; and the first agent (e.g., by an execution unit (e.g., memory access unit(s) 164, load-store unit 340), or other hardware structure) itself, the interconnect 3920, ... The interconnect 3920 (e.g., via snoop controller QO25) or the first agent (e.g., by an execution unit (e.g., memory access unit(s) 164, load-store unit 340), or other hardware structure) is implemented in response to a message from the interconnect to cause a cache line in one of the caches (e.g., the first agent's L1 cache 3905, L2 cache 3910, or L3 cache 3915 (more specifically, L3 cache slice 3916, if implemented)) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros") or to cause a cache line-sized write of zeros to be performed to a downstream memory at a memory address.

[0404] Any write that hits but does not send data back to the first agent and does not cause data to be read from downstream memory A snoop on a cache line, or a prior art snoop on a line that is normally written out (RFO) : Fig.46 4 is a flow chart illustrating an embodiment of the present invention using a snoop to implement a snoop process 4190 or 4290 that snoops write-out hits without sending the data back to the first agent and without causing any cache lines of data to be read from downstream memory (or a prior art snoop that writes out the line normally - e.g., an RFO operation). Fig.41 and Fig.42In the context of , flow passes from block 4124 or block 4212, respectively, to block 4526, which executes block 4126 or block 4226 using such snooping. The interconnect 3920 (e.g., via the snoop generator 3926 of the snoop controller 3925) is implemented to issue such snooping (block 4626) to those caches in the coherent cache that may be storing the cache line (in other words, those caches in the coherent cache for which a hit must be determined). When there is a hit for the cache line of the cache to which such snooping is issued (e.g., the L1 cache, L2 cache, and / or L3 cache slice of the first agent, and the L1 cache, L2 cache, and L3 cache slice of the second agent) (block 4640), the cache is configured to respond to the snoop (4644). In some embodiments, the cache is implemented to respond to such snooping when the prior art cache would normally respond according to the implemented cache coherence protocol. Although in some embodiments, new types of snoops are used, in other embodiments prior art snoops (e.g., RFO operations) are used - in this case, incorporating cache line zeroing instructions into existing processor designs requires no or minimal modification to the caches (see the section entitled "Triggering Caches to Configure Cache Lines to Indicate All Zeros" above). When there is no hit on the cache line of the cache to which the snoop is issued (4640), the cache, in one embodiment, does nothing (control passes to block 4652).

[0405] After issuing the snoop, the interconnect 3920 (e.g., via the snoop responder 3927 of the snoop controller 3925) is implemented to track the receipt of any corresponding response messages (e.g., in one embodiment, the snoop generator 3926 indicates information to the snoop responder 3927 for it to track the receipt of any corresponding response messages). If the response message is received with data (e.g., data from a modified cache line) (block 4660), the interconnect 3920 (e.g., via the snoop responder 3927 of the snoop controller 3925) is implemented to not send the data to the issuing agent or any of the issuing agent's caches (block 4662). If the response message is not received with data (4660), the interconnect 3920 (e.g., via the snoop responder 3927 of the snoop controller 3925) is implemented to not read the data from the downstream memory because it is not needed (block 4664).

[0406] Control passes from block 4662 and block 4664 to block 4132 or block 4232 (blocks 4128 and 4228 are not implemented when such monitoring is used), depending on the implementation. Fig.41 still Fig.42In block 4132 or block 4232, the first agent (e.g., through an execution unit (e.g., memory access unit(s) 164, load-store unit 340) itself (block 4232 only), the interconnect 3920 (e.g., snoop controller QO25), or the first agent (e.g., through an execution unit (e.g., memory access unit(s) 164, load-store unit 340) or other hardware structure) causes a cache (e.g., L1 cache, L2 cache, L3 cache) to be opened in response to a message from the interconnect 3920. 4664 (downstream memory is accessed and data is returned to the first agent), then the first agent zeroes the data.

[0407] As described above, even though RFO operations are used, an advantage of the illustrated embodiment is that it works with existing cache designs that support RFO operations with no or little modification required.

[0408] As indicated previously, the three types of monitoring can be combined Fig.41 and Fig.42 By way of example, the implementation of Fig.42A specific embodiment of such a snoop in one of the embodiments of . In this specific embodiment, the publishing agent 3900 is used to directly issue a command to initiate a cache line sized zero write at a memory address (skipping the publishing agent / first agent's cache) to the interconnect 3920, and the interconnect 3920 (e.g., via the snoop generator 3926 of the snoop controller 3925) issues the snoop as described above to those caches in the coherent cache that may be storing the cache line; if the response message is received with data (e.g., data from a modified cache line), the interconnect 3920 (e.g., via the snoop responder 3927 of the snoop controller 3925) is optionally implemented to not send the data to the publishing agent or any cache of the publishing agent; If a response message is not received with the data, the interconnect 3920 (e.g., via a snoop responder 3927 of a snoop controller 3925) is optionally implemented to not read the data from the downstream memory because it is not needed; and the publishing agent (first agent) itself or the first agent, in response to the message from the interconnect, causes a cache line in one of the caches (e.g., L1 cache, L2 cache, L3 cache) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring a Cache Line to Indicate All Zeros") or causes a cache line-sized write of zeros to be performed to the downstream memory at the address. Thus, in some embodiments, the L1 cache, L2 cache, and L3 cache (more specifically, the L3 cache slice, if implemented) are implemented to respond to snoops as described above; the interconnect 3920 is implemented to issue snoops in response to commands as described above (e.g., via the snoop generator 3926 of the snoop controller 3925) and to respond to response data from the caches (e.g., via the snoop responder 3927 of the snoop controller 3925); the issuing agent is implemented to send a command directly to the interconnect 3920 to initiate a cache line-sized write of zeros at a memory address; and the issuing agent (the first agent) itself or the first agent causes a cache line in one of the caches (e.g., the L1 cache, the L2 cache, the L3 cache) to be configured to indicate all zeros (different embodiments may implement the cache to configure the cache line to indicate all zeros, as previously described in the section entitled "Techniques for Configuring Cache Lines to Indicate All Zeros") or causes a cache line-sized write of zeros to be performed to a downstream memory at the address. In one particular embodiment, the issuing agent (first agent) itself causes a cache line in one of the caches (eg, L1 cache, L2 cache, L3 cache) to be configured to indicate all zeros.

[0409]

[0410] As previously described, interconnect 3920 may represent, for example: 1) interconnects within a CCX only; 2) interconnects within a CCX and between CCXs; 3) separate interconnects within different CCXs, as well as interconnect(s) between CCXs. As discussed herein, a system may be implemented with one or more of the above processors (each including one or more CCXs) (see the section entitled "Exemplary Computer Architecture" below). Such a system may include one or more sockets (referred to as CPU sockets or CPU slots), each of which includes one or more mechanical components that provide mechanical and electrical connections. In a system with multiple sockets (e.g., a server), the sockets are connected by a set of one or more interconnects (also referred to as socket-to-socket interconnects). Different embodiments may implement the set of socket-to-socket connections in different ways, including rings, multiple rings, point-to-point links (e.g., point-to-point links such as Quick Path Interconnect (QPI), Ultra Path Interconnect (UPI), HyperTransport (HP), etc.), (multiple) shared buses, etc. This set of socket-to-socket interconnects may be considered part of interconnect 3920 or separate depending on the embodiment. In some embodiments, this set of interconnects is implemented to support the same communications (write commands, snoops, response messages, etc.) discussed above with respect to interconnect 3920; wherein each of these communications may have the same or different formats when sent over a socket-to-socket interconnect. In other embodiments, one or more of these communications (e.g., one or more of the snoop type and / or response messages) are converted when sent socket-to-socket. For example, some embodiments may use write-update snoops within a processor(s) in a single socket, but convert such snoops to write-invalidate or write-back and invalidate snoops when sending them to another socket. An advantage of these embodiments is that the decision whether to generate a new zeroed cache line is only within the socket (thus, no "zeroed" or "not zeroed" indication from other sockets is required).

[0411]

[0412] One embodiment of the present invention may include a processor comprising a first coherence agent, a second coherence agent, and an interconnect. The first agent is coupled to the interconnect via a cache of the first agent. The second agent is coupled to the interconnect via a cache of the second agent. The first agent is used to decode and execute instructions, the execution of which is used to cause a cache line-sized zero write at a memory address. The first agent is used to issue a write command to the cache of the first agent to initiate a cache line-sized zero write at the memory address. When there is a cache line hit in response to receiving the write command and the cache coherence protocol state of the cache line is a modified state or an exclusive state, the cache of the first agent is used to configure the cache line to indicate all zeros. When there is a cache miss in response to receiving the write command, the cache of the first agent issues the write command to the interconnect. In response to receiving the write command, the interconnect issues a snoop to the cache of the second agent. The interconnect is operable or the first agent is operable, in response to a message from the interconnect, to cause a cache line in the cache of the first agent to be configured to indicate all zeros when the write command and the snooping do not cause a write of zeros of the cache line size to be performed.

[0413] Additionally, the following may apply: in some embodiments, when there is a cache line hit in response to receiving the write command and the cache coherence protocol state of the cache line is not the modified state or the exclusive state, the cache of the first agent causes the cache coherence protocol state of the cache line to be an invalid state and issues the write command to the interconnect.

[0414] Another embodiment of the present invention may include a processor comprising a decoder for decoding an instruction for zeroing a cache line. The processor also includes an execution unit, the execution unit coupled to the decoder and for issuing a write command for initiating a cache line sized zero write at a memory address in response to the decoding of the instruction. The processor also includes a coherent cache coupled to the execution unit, the coherent cache for receiving the write command, for determining whether there is a hit in the coherent cache in response to the write command, for determining whether the cache coherence protocol state of the hit cache line is a modified state or an exclusive state, for configuring the cache line to indicate all zeros when the cache coherence protocol state is a modified state or an exclusive state, and for issuing the write command to an interconnect in response to receiving the write command when there is a miss. The interconnect issues a snoop to each of a plurality of other coherent caches for which a hit must be determined in response to receiving the write command. The interconnect is operable, or the execution unit is operable, in response to a message from the interconnect, to cause a cache line in one of the coherent caches to be configured to indicate all zeros when the write command and the snooping do not cause the cache line zero write to be performed.

[0415] Additionally, the following may apply: In some embodiments, the coherent cache is further configured to cause a cache coherence protocol state of the cache line to be an invalid state and to issue the write command to the interconnect when the cache coherence protocol state of the hit cache line is not the modified state or the exclusive state. In some embodiments, the decoder and the execution unit are part of a first core, and the plurality of coherent caches include a coherent cache of a second core.

[0416] Another embodiment of the present invention may include a processor, the processor including a first core, the first core for issuing a write command in response to execution of a cache line zeroing instruction. The first core also includes a level 1 (L1) cache coupled to perform the following operations: receiving the write command; determining whether there is a hit or a miss in the cache in response to the write command; and determining whether the cache coherence protocol state of the hit cache line is a state that grants the cache the right to modify the cache line without broadcasting to other caches in response to the hit. The L1 cache is configured to indicate all zeros in response to the hit when the cache coherence protocol state of the hit cache line is a state that grants the cache the right to modify the cache line without broadcasting to other caches. The L1 cache is configured to issue the write command to the interconnect in response to the miss. The interconnect is coupled to the first core and is configured to issue a snoop to a cache of a plurality of other caches for which a hit must be determined in response to the write command. The first core is for, the interconnect is for, or the first core is responsive to a message from the interconnect for causing a cache line in the cache or one of the plurality of other caches to be configured to indicate all zeros when the write command and the snooping do not cause the cache line zero write to be performed.

[0417] In addition, the following may apply: In some embodiments, the L1 cache may also invalidate the cache coherence protocol state and issue the write command to the interconnect when the cache coherence protocol state of the hit cache line is not a state that grants the cache a right to modify the cache line without broadcasting to other caches. In some embodiments, in response to the snooping, each of the plurality of other caches may also be implemented to determine whether there is a hit or a miss in the other cache and, in response to the hit, determine whether the cache coherence protocol state of the hit cache line in the other cache is a state that grants the cache a right to modify the cache line without broadcasting to other caches. Each of the plurality of other caches is configured to: configure a cache line in the cache to indicate all zeros and issue a response message indicating zeroing in response to the hit when the cache coherence protocol state of the cache line that hits in the cache is a state that grants the cache the right to modify the cache line that hits in the cache without broadcasting to other caches; and issue a response message indicating not zeroing in response to the miss or in response to the hit when the cache coherence protocol state of the cache line that hits in the cache is not a state that grants the cache the right to modify the cache line that hits in the cache. The interconnect is configured to track receipt of the response message to determine whether the snooping causes one of the plurality of other caches to be configured to indicate all zeros.

[0418] Another embodiment of the present invention may include a processor comprising a first coherence agent, a second coherence agent, and an interconnect. The first agent is coupled to the interconnect via a cache of the first agent. The second agent is coupled to the interconnect via a cache of the second agent. The first agent is configured to decode and execute instructions, the execution of the instructions being configured to cause a cache line sized zero write to be performed at a memory address. The first agent is configured to issue a command to the interconnect. The interconnect is configured to issue a snoop to the cache of the first agent and the cache of the second agent in response to receiving the command. The first agent is configured, the interconnect is configured, or the first agent is configured in response to a message from the interconnect to cause a cache line in the cache of the first agent to be configured to indicate all zeros when the snoop does not cause the cache line zero write to be performed.

[0419] Another embodiment of the present invention may include a processor comprising a decoder for decoding an instruction for zeroing a cache line. The processor also includes an execution unit coupled to the decoder to issue a command in response to the decoding of the instruction. The interconnect issues a snoop to each of a plurality of coherent caches for which a hit must be determined in response to receiving the command. The execution unit itself is configured, the interconnect is configured, or the execution unit is configured in response to a message from the interconnect to cause a cache line in one of the plurality of coherent caches coupled to the execution unit to be configured to indicate all zeros when the snoop does not cause the cache line zero write to be executed.

[0420] Another embodiment of the present invention may include a processor, the processor including a first core, the first core being used to issue a command in response to execution of a cache line zeroing instruction. The processor also includes an interconnect coupled to a shared level 3 (L3) cache, a level 2 (L2) cache of the first core, and a level 1 (L1) cache of the first core, the interconnect being used to issue a snoop to a coherent cache of a plurality of coherent caches for which a hit must be determined in response to the command. In some embodiments, the plurality of coherent caches include the L1 cache of the first core, the L2 cache of the first core, the L3 cache, the L1 cache of the second core, and the L2 of the second core. The first core itself is used, the interconnect is used, or the first core is used in response to a message from the interconnect to cause a cache line in one of the plurality of coherent caches coupled to the first core to be configured to indicate all zeros.

[0421] PTE Merger

[0422] According to some exemplary embodiments, the processor core may support a page table merge feature, thereby allowing multiple smaller memory pages to be merged into a single effective larger memory page. In some embodiments, for example, eight 4KB memory pages may be merged into a single 32KB memory page. In other embodiments, 16 4KB memory pages may be merged into a single 64KB memory page.

[0423] Current computer architectures allow for virtual memory pages of various sizes. For example, the x86 architecture allows for pages of 4KB, 2MB, and 1GB. Processors implementing this architecture can provide a translation lookaside buffer (TLB) for each of these page sizes, thereby providing a mapping of virtual addresses to physical addresses. When attempting to convert a virtual address to a physical address, the processor can search each of the applicable TLBs to determine whether any of them contains an entry corresponding to the virtual address. If an entry is found (i.e., a "TLB hit"), the entry is retrieved from the TLB where the entry is found, and a conversion from a virtual address to a physical address is performed.

[0424] If an entry corresponding to the virtual address is not found in any of the TLBs present on the processor (i.e., a "TLB miss"), the processor may attempt to locate an entry corresponding to the virtual address in the page table. If an entry is found (i.e., a "page table hit"), the entry is retrieved from the page table and inserted into the appropriate TLB. The translation from the virtual address to the physical address may then be retried, resulting in a TLB hit.

[0425] If no entry corresponding to the virtual address is found in the page table (i.e., a "page table miss"), this may indicate that there is currently no physical address in memory corresponding to the provided virtual address. In this case, the processor may cause a page corresponding to the virtual address to be loaded from another storage device (e.g., disk) into memory at the particular physical address, and may insert a mapping from the provided virtual address to this physical address into the page table. Subsequent attempts to translate the provided virtual address will result in a page table hit, which will cause the corresponding entry to be added to the appropriate TLB.

[0426] A difficulty with some current processor architectures is the lack of granularity in the allowable page sizes. For example, as explained above, some processor architectures allow pages of 4KB, 2MB, and 1GB, providing a relatively "coarse" range between page sizes.

[0427] According to some embodiments, this difficulty can be solved by merging multiple smaller pages, thereby producing an intermediate page size of, for example, greater than 4KB but less than 2MB. In some embodiments, this can be achieved by merging, for example, eight 4KB pages at a time to create a single valid 32KB page under certain conditions. In some embodiments, these eight 4KB pages must be aligned to 32KB address boundaries.

[0428] In some embodiments, the eight 4KB pages must be contiguous in one or both of (a) the virtual address space; and (b) the physical address space. For example, some embodiments may require that bits 12 to 14 of the virtual address VA and the physical address PA be equal to each other. That is, in some embodiments, smaller pages are merged into larger pages only when VA[14:12] == PA[14:12] for each of the smaller pages.

[0429] In some embodiments, smaller pages are merged into larger pages only if each of the smaller pages has the same permission bits. In some embodiments, when smaller pages are merged into larger pages, the operating system may combine the accessed / dirty bits corresponding to each of the smaller pages into a single value, for example by performing a logical OR operation on the accessed / dirty bits of all the smaller pages. In some embodiments, when smaller pages are merged into larger pages, the operating system may only set the appropriate 4KB page dirty / accessed bits, thereby tracking the portions of the larger page that have been accessed and / or dirty.

[0430] Fig.47 4700 is a diagram illustrating a page merging feature that may be included in a processor according to some embodiments. Box 4700 represents a portion of a page table containing eight entries 4701 to 4708, each entry corresponding to a page of size 4KB. Fig.47 As shown, the eight entries 4701 to 4708 have consecutive addresses, wherein bits 12 to 14 of the eight addresses take consecutive values ​​000, 001, 010, 011, 100, 101, 110, and 111. According to some embodiments, Fig.47 As shown, these eight 4KB pages can be combined into a valid 32KB page 4709.

[0431] In some embodiments, valid 32KB pages 4709 may be represented by including an additional bit in each page table entry (PTE) indicating that the eight 4KB pages should be considered valid 32KB pages. In some embodiments, valid 32KB pages 4709 may be represented by an additional bit in the page directory entries corresponding to page table entries 4701 to 4708 indicating that the eight 4KB pages should be considered valid 32KB pages. In some embodiments, each time one of the eight 4KB pages is accessed, the consecutive aligned addresses of the eight 4KB pages may be detected by hardware and considered valid 32KB pages.

[0432] Various methods can be used to implement the detection of whether multiple smaller pages meet the criteria for merging into a valid larger page. For example, Fig.484802. 4803. 4804. 4805. 4806. 4807. 4808. 4809. 4810. 4811. 4812. 4813. 4814. 4815. 4816. 4817. 4818. 4819. 4820. 4821. 4822. 4823. 4824. 4825. 4826. 4827. 4828. 4829. 4830. 4831. 4832. 4833. 4834. 4835. 4836. 4837. 4838. 4839. 4840. 4841. 4842. 4843. 4844. 4845. 4846. 4847. 4848. 4849. 4850. 4851. 4852. 4853. 4854. 4855. 4856. 4857. 4858. 4859. 4860. 4861. 4862.

[0433] When retrieving multiple page table entries in a cache line, the processor may test whether the page table entry corresponds to a page that meets the merge requirement, as shown in 4804. For example, the processor may test whether the address of the page is continuous in virtual memory and / or physical memory. In some embodiments, the processor may further test whether the values ​​of the permission bits of the page are the same. In some embodiments, the processor may determine whether the address of the page is aligned with a 32KB boundary.

[0434] If the multiple page table entries in the cache line meet the criteria for being merged into a single combined page (e.g., a valid 32KB page), the entry corresponding to the combined page may be placed in the appropriate TLB (e.g., a 32KB TLB), and the entries in the cache line that were combined into the single entry may be invalidated, as shown in block 4805. If the multiple page table entries do not meet the criteria for being merged into a single combined page, the virtual address to physical address translation may generally continue by allocating an entry in the TLB corresponding to a smaller (e.g., 4KB) TLB, as shown in block 4806.

[0435] In some embodiments, the processor may determine whether to merge multiple smaller pages based on the contents of the relevant TLB. For example, after a 4KB TLB miss, the processor may detect whether the corresponding 4KB page can be merged with additional entries present in the TLB (e.g., seven other TLB entries corresponding to the 4KB page). If the entry corresponding to the provided address can be combined with other entries to create a valid larger page (e.g., a valid 32KB page), the existing TLB entry to be combined is invalidated, and an entry corresponding to the valid larger page is created in the appropriate TLB (e.g., in the TLB corresponding to the 32KB page). In some embodiments, a separate TLB corresponding to the combined effective page size is not used, and instead information related to the virtual address to physical address conversion of the combined page is stored in a TLB corresponding to a smaller page size (e.g., a 4KB page TLB). In some embodiments, this information can be encoded in a TLB corresponding to a smaller page size using additional bits reserved for this purpose.

[0436] In some embodiments, the above features can be used in conjunction with an operating system that allocates pages using an algorithm optimized for page merging, as described above. Existing operating systems have algorithms designed to allocate, for example, 4KB, 2MB, and / or 1GB pages. An operating system that can be used in conjunction with some embodiments can use additional algorithms designed to allocate combined pages (e.g., 32KB valid pages).

[0437] The page merge feature described above is not limited to combining a specific number of pages of a specific size, but can be used to merge various numbers of pages of various sizes. For example, some embodiments can merge 16 4KB pages to form a valid combined page of 64KB. Some embodiments can additionally support valid combined pages of multiple sizes (e.g., a combined page of 32KB and 64KB). In some embodiments, pages of multiple sizes (e.g., pages of 4KB and 32KB) can be combined into a single valid page (e.g., a valid 64KB page).

[0438] Exemplary Computer Architecture

[0439] Figures 49 to 52 It is a block diagram of an exemplary computer architecture. It is known in the art that other system designs and configurations for laptop computers, desktop computers, handheld PCs, personal digital assistants, engineering workstations, servers, network devices, network hubs, switches, embedded processors, digital signal processors (DSPs), general-purpose processors, server processors or processing elements for server environments, coprocessors (e.g., security coprocessors) high-throughput MIC processors, GPGPUs, accelerators (such as, for example, graphics accelerators, cryptographic accelerators, fixed-function accelerators, machine learning accelerators, networking accelerators or computer vision accelerators), field programmable gate arrays or any other processors or processing devices, graphics devices, video game devices, set-top boxes, microcontrollers, cellular phones, portable media players, handheld devices, and various other electronic devices are also suitable. In general, a variety of systems or electronic devices that can incorporate processors and / or other execution logics as disclosed herein are generally suitable.

[0440] Reference now Fig.49, a block diagram of a system 4900 according to one embodiment of the present invention is shown. The system 4900 may include one or more processors 4910, 4915 coupled to a controller hub 4920. In one embodiment, the controller hub 4920 includes a graphics memory controller hub (...

Claims

1. A processor for clearing a cache line, include: a decoder for decoding an instruction for zeroing a cache line; an execution unit coupled to the decoder and operable to issue a write command for initiating a cache line sized write of zeros at a memory address in response to the decoding of the instruction; a coherent cache coupled to the execution unit to receive the write command, to determine whether there is a hit in the coherent cache in response to the write command, to determine whether a cache coherence protocol state of the hit cache line is a modified state or an exclusive state, to configure the cache line to indicate all zeros when the cache coherence protocol state is the modified state or the exclusive state, and to issue the write command to an interconnect in response to a miss for the received write command; The interconnect is configured to issue a snoop to each of a plurality of other coherent caches for which a hit must be determined in response to receiving the write command, wherein the interconnect is configured or the execution unit is configured in response to a message from the interconnect to cause a cache line in one of the coherent caches to be configured to indicate all zeros when the write command and the snoop do not cause a zero write of the cache line size to be executed.

2. The processor according to claim 1, It is characterized in that The coherent cache is further configured to cause a cache coherence protocol state of the cache line to be an invalid state and to issue the write command to the interconnect when the cache coherence protocol state of the hit cache line is not the modified state or the exclusive state.

3. The processor according to claim 1, It is characterized in that The decoder and the execution unit are part of a first core, and wherein the plurality of other coherent caches comprises a coherent cache of a second core.

4. The processor according to claim 1, It is characterized in that The cache line is configured to indicate all zeros by overwriting data in the cache line with zeros.

5. The processor according to claim 1, It is characterized in that The cache line is configured to indicate all zeros by invalidating the cache line in a way of the cache in which the cache line currently resides and writing a cache line with zeros into a different way of the cache.

6. The processor of claim 1, It is characterized in that The cache line is configured to indicate all zeros by changing the tag state instead of the data.

7. The processor of claim 1, It is characterized in that The cache line is configured to indicate all zeros when triggered by sending a zero line to the intermediate buffer.

8. The processor of claim 1, It is characterized in that The cache line is used to indicate a cache line sized write of zeros by the write command but the write command does not carry a cache line with zeros and is triggered to be configured to indicate all zeros.

9. The processor of claim 1, It is characterized in that The cache line is configured to be triggered to indicate all zeros by writing a chunk of zeros smaller than the cache line into an intermediate buffer and simultaneously writing the chunk into the cache line.

10. The processor of claim 1, It is characterized in that Execution of the instruction does not include a request ownership operation.

11. The processor of claim 1, It is characterized in that Execution of the instruction does not include returning data from the cache line.

12. The processor of claim 1, It is characterized in that Execution of the instructions will be weakly ordered.

13. A processor for clearing a cache line, include: a decoder for decoding an instruction for zeroing a cache line; an execution unit, coupled to the decoder, for issuing commands in response to the decoding of the instruction; An interconnect for issuing a snoop to each of a plurality of coherent caches for which a hit must be determined in response to receiving the command, wherein the execution unit itself is configured, the interconnect is configured, or the execution unit is configured in response to a message from the interconnect to cause a cache line in one of the plurality of coherent caches coupled to the execution unit to be configured to indicate all zeros when the snoop does not cause the cache line zero write to be performed.

14. The processor of claim 13, It is characterized in that The execution unit is configured to make the cache coherence protocol state of the hit cache line an invalid state when the cache coherence protocol state of the hit cache line is not a modified state or an exclusive state.

15. A method for clearing a cache line, include: decoding, by the first agent, an instruction to zero a cache line; executing the instructions by the first agent, wherein executing the instructions is used to include issuing a write command causing a cache line sized write of zeros at a memory address to a first coherent cache coupled to the first agent; determining, by the first agent, whether there is a hit in a cache line of the coherent cache; determining, by the first agent in response to determining that there is a hit, whether a coherence protocol state of the hit cache line is modified or exclusive; configuring, by the first agent, in response to determining that the coherence protocol state of the hit cache line is a modified or exclusive cache line, the cache line to indicate all zeros and suppress snooping; issuing, by the first agent, the write command to the interconnect in response to determining that there is no hit; as well as A snoop is issued by the interconnect in response to the write command to each of a plurality of other coherent caches for which a determination must be made as to whether a hit exists.

16. The method of claim 15, It is characterized in that Further comprising, in response to the interconnect issuing a snoop in response to the write command to each of a plurality of other coherent caches for which a hit must be determined, determining whether one of the write command and the snoop caused a zero write of the cache line size to be performed.

17. The method of claim 15, It is characterized in that Further comprising causing, by the interconnect or the first agent in response to a message from the interconnect, cache lines in one or more of the other coherent caches to be configured to indicate all zeros when the write command and the snooping do not cause a zero write of the cache line size to be performed.

18. The method of claim 15, It is characterized in that Further comprising causing, by the interconnect or the first agent in response to a message from the interconnect, a cache line sized write of zeros to a downstream memory at the memory address when the write command and the snooping do not cause the cache line sized write of zeros to be performed.

19. The method of claim 15, It is characterized in that Further included determining, by the first agent in response to determining that the coherence protocol state of the hit cache line is not a modified or exclusive cache line, to invalidate a cache coherence protocol state of the cache line.