Patent Description:
Modern processors often use out-of-order execution with physical register renaming. Previous systems have used physical register renaming to remove write-after-write and write-after-read hazards by allocating a new destination register for each result produced.

In some processors (e.g., Motorola <NUM> and RISC-V Zfinx option), an architectural register can hold different types of data at different times. For example, a single register can hold an integer value or a floating-point value. In some conventional processors, where the instruction set architecture allows multiple data types to be held in the same architectural register, a unified physical register file has been used to hold the different data types with routing to a variety of functional units processing the different data types.

Two-dimensional structures for matrix computations (e.g., systolic arrays) are very efficient because the operands are located in the array and only need to shift a small amount to work with the data. However, these two-dimensional structures for matrix computations are hardwired and generally used in fixed function machines. Because the operands are distributed it is very specialized and microcode is written to do the right thing. In a different context of a general-purpose central processing unit (CPU) those advantages are lost and there are very different timings to access registers vs. cache vs. memory.

<CIT> describes matrix (tile) operations. For example, decode circuitry to decode an instruction having fields for an opcode and a memory address, and execution circuitry to execute the decoded instruction to store configuration information about usage of storage for two-dimensional data structures at the memory address.

<CIT> describes instruction issue logic that assesses register availability. The issue logic comprises register scoreboard logic that includes destination register storage elements to identify destination registers of instructions queued for issue. An arbiter selects instructions for issue during a machine cycle from the queued instructions. Register-clean wires associated with each register are driven in response to the corresponding destination storage elements and the arbiter. These wires are used to identify the read-availability of registers. Specifically, such a logic system is capable of reflecting freed registers on the subsequent machine cycle so that previously issued instructions do not hinder queuing of new instructions, unless they require multiple cycles to complete. To increase speed of operation, single NMOS devices bridge the register-clean wires and the issue signal from the arbiter. Addition speed increase may be achieved by dividing the register scoreboard logic into odd and even register scoreboard arrays on either side of the arbiter.

Disclosed herein are implementations of register renaming for power conservation.

In a first aspect, the subject matter described in this specification can be embodied in integrated circuit for executing instructions that include a first cluster including a first set of physical registers and a first execution resource circuit configured to perform operations that take contents of one or more registers of the first set of physical registers as input, wherein the inputs for operations of the first execution resource circuit are of a first data type; a second cluster including a second set of physical registers and a second execution resource circuit configured to perform operations that take contents of one or more registers of the second set of physical registers as input, wherein the inputs for operations of the second execution resource circuit are of a second data type that is different than the first data type; and a register renaming circuit configured to: determine a data type prediction for a result of a first instruction that will be stored in a first logical register; and, based on the data type prediction matching the first data type, rename the first logical register to be stored in a physical register of the first set of physical registers.

In a second aspect, the subject matter described in this specification can be embodied in methods that include determining a data type prediction for a result of a first instruction that will be stored in a first logical register; and, based on the data type prediction matching a first data type, renaming the first logical register to be stored in a physical register of a first cluster chosen from among a plurality of clusters, wherein the plurality of clusters includes: a first cluster including a first set of physical registers and a first execution resource circuit configured to perform operations that take contents of one or more registers of the first set of physical registers as input, wherein the inputs for operations of the first execution resource circuit are of the first data type; and a second cluster including a second set of physical registers and a second execution resource circuit configured to perform operations that take contents of one or more registers of the second set of physical registers as input, wherein the inputs for operations of the second execution resource circuit are of a second data type that is different than the first data type.

In a third aspect, the subject matter described in this specification can be embodied in integrated circuits for executing instructions that include an execution resource circuit configured to execute instructions on operands stored in physical registers, a set of physical registers including a first subset of physical registers located in proximity to the execution resource circuit and a second subset of physical registers that are located further from the execution resource circuit than the registers in the first subset of physical registers, and a register renaming circuit configured to: detect a sequence of instructions stored in an instruction decode buffer, the sequence of instructions including multiple sequential references to a first logical register with true dependency; and, based on detection of the sequence of instructions, rename the first logical register to be stored in a physical register of the first subset of physical registers and rename another logical register referenced in the sequence of instructions to be stored in a physical register of the second subset of physical registers.

These and other aspects of the present disclosure are disclosed in the following detailed description, the appended claims, and the accompanying figures.

Storage and processing of the different data types can be improved using specialized physical structures. For example, one such structure is a cluster comprising a combination of a physical register file and functional units closely coupled using local datapaths. One benefit of this approach is that the representation of data values in each register file can be optimized for the dynamic data type. currently present in each architectural register. A second benefit may be that sequences of computations involving the same data types are localized to the same cluster, improving energy efficiency and reducing circuit delays.

Some implementations described herein may provide the benefits of providing separate localized processing of different data types in optimized clusters, even when the instruction set architecture requires that all data types are held and processed from a unified set of architectural registers. For example, a scalar processor with a unified architectural register file can provide two clusters, one for integer and one for floating-point data types. A method described here dynamically allocates values to clusters and performs computations in the
appropriate cluster based on data type.

For example, some implementations determine which cluster to execute instruction in based on instruction opcode. Allocate destination in that cluster if space is available and update map table (otherwise stall decode). Check map table to see if sources are in correct cluster. If so, dispatch instruction to cluster. If sources are in wrong cluster (e.g., loaded into integer register file, but now processed as a float), insert additional micro-ops to move data from one cluster to another, potentially reformatting data as part of the conversion.

When the destination format is not clear from opcode (e.g., load from memory), a prediction can be made. For example, some options for prediction include: <NUM>) same as last type for the same architectural register. The observation is that in many codes, especially loops, the same architectural registers are used to hold the same types repeatedly. Software can improve the performance of this scheme if the software is made aware of this prediction policy. <NUM>) look ahead in an instruction buffer to see if a following opcode indicates the use of this source. <NUM>) randomly generate a data type prediction. <NUM>) based on program counter (PC) plus instruction encoding. Where encoding is sufficient to determine result type, ignore the program counter, otherwise use some portion of the program counter to index into prediction table. For example, the same architectural register could be used twice in the same loop to hold different types of data
<IMG>.

<NUM>) combinations of the above may used to determine a data type prediction for a result of an instruction that will be stored in a destination register.

For example, some extensions include: <NUM>) Processors often provide operations on Boolean values. For example, a comparison instruction that may return either a <NUM> or <NUM>. These are often used as inputs to a branch instruction or additional logic operations. A specialized cluster for predicate values can be provided to improve performance of these instructions. The physical storage for these single-bit values is much less than for full-width physical registers, and processing these values requires much less energy than for full-width physical registers. In the case of logical operations (e.g., AND, OR, XOR), the instruction encoding plus the source data types are used to determine which cluster to use. Branch execution is often on the critical path in a processor and isolating Booleans into a separate cluster can reduce circuit delay for branch resolution. <NUM>) Half-width scalars (e.g., <NUM>-bit width in <NUM>-bit scalars) may be used to obtain more capacity by reusing physical registers. A separate cluster for packed-SIMD values in scalar registers may provide so as to reduce critical path for non-packed-SIMD values. This may improve packed-SIMD cluster for energy with longer circuit delay. ) Vector Regfiles.

Systems and methods for register renaming are disclosed. An integrated circuit (e.g., a processor or microcontroller) may decode and execute instructions of an instruction set architecture (ISA) (e.g., a RISC V instruction set). This approach for integrated circuit design uses register renaming to get some of the benefits of a fixed function machine with two-dimensional structures for matrix computations (e.g., systolic arrays) within a general purpose CPU. For example, consider a multiply-add. Multiply and add matrices. If the source and destination are the same (c <- c * a+b) then the c matrix could stay "put" in the array and one of the others (e.g., a, and then b is the only thing flowing in potentially).

Register renaming has been done previously with a different goal. Previously the goal was to remove false dependencies, such as write-after-read and write-after-write (WAR and WAW). Here though, we allocate a new physical register for each result that is writing. So contrast: rc2 = rc1 + ra1 * rb1. Now rc2 is in a different physical register instead of rc1. But what we want to do is have c1 stay in place by overwriting it, e.g. rc1 = rc1 + ra1 * rb1.

Another difference is that renaming is performed based on the physical location in the chip (e.g., closeness to the arithmetic logic units (ALUs)). Prior techniques were usually using registers that were all in a central registry file, but here renaming may be performed to force one of the inputs to the ALU to be physically proximate to the ALU, which may reduce the power required to transfer the value to the ALU for execution of a subsequent instruction. These power savings can be particularly significant for vector or matrix operations. For example, consider the instruction C = A + B, where A, B, and C are vectors. In this example, C may be re-allocated to a standard one-dimensional vector. For example, consider the instruction F = D + E, where D, E, and F are matrices. In this example, F would be a two-dimensional structure next to the ALUs. The shape/size of the allocated register may be changed based on the type of data and operation.

As used herein, the term "circuit" refers to an arrangement of electronic components (e.g., transistors, resistors, capacitors, and/or inductors) that is structured to implement one or more functions. For example, a circuit may include one or more transistors interconnected to form logic gates that collectively implement a logical function.

<FIG> is block diagram of an example of a system <NUM> for executing instructions with register renaming based on data type prediction. The system <NUM> includes an integrated circuit <NUM> for executing instructions (e.g., RISC-V instructions or x86 instructions). The integrated circuit <NUM> includes: a first cluster <NUM> configured to performs operations on one or more inputs of a first data type; a second cluster <NUM> configured to performs operations on one or more inputs of a second data type; and a register renaming circuit <NUM> configured to rename logical registers to map to physical registers in a cluster chosen from amongst a set of clusters based on a data type prediction for a result of an instruction (e.g., a load instruction, an add instruction, or an xor instruction). The integrated circuit <NUM> may include additional clusters (not shown inf <FIG>) that execute instructions taking inputs of additional different data types. In some implementations, the integrated circuit <NUM> may include additional clusters (not shown inf <FIG>) that execute instructions taking inputs of the first data type or the second data type and register renaming may be based on additional considerations, such as true dependency among a sequence of instructions, when selecting among multiple clusters using a same data type for register renaming. The integrated circuit <NUM> includes an instruction buffer <NUM> that stores instructions that are expected to be executed in the near future. For example, integrated circuit <NUM> may be microprocessor or a microcontroller.

The integrated circuit <NUM> includes a first cluster <NUM> including a first set of physical registers <NUM>, <NUM>, and <NUM> and a first execution resource circuit <NUM> configured to perform operations that take contents of one or more registers of the first set of physical registers <NUM>, <NUM>, and <NUM> as input. The inputs for operations of the first execution resource circuit <NUM> are of a first data type (e.g., integer, float, Boolean, scalar, vector, or matrix). For example, the execution resource circuit <NUM> may include an arithmetic logic unit (ALU). For example, the execution resource circuit <NUM> may include a floating point unit (FPU). The cluster may include datapaths that enable the execution resource circuit <NUM> to access the registers of the first set of physical registers <NUM>, <NUM>, and <NUM> as a source register holding an input argument and/or as a destination register to hold a result. For example, the first cluster <NUM> may be used to execute an instruction (e.g., an addition instruction) taking a value stored in the physical register <NUM> a value stored in the physical register <NUM> as input arguments and output a result to the physical register <NUM>. For example, the first set of physical registers <NUM>, <NUM>, and <NUM> may be in close proximity to the first execution resource circuit <NUM>.

The integrated circuit <NUM> includes a second cluster <NUM> including a second set of physical registers <NUM>, <NUM>, and <NUM> and a second execution resource circuit <NUM> configured to perform operations that take contents of one or more registers of the second set of physical registers as input. The inputs for operations of the second execution resource circuit <NUM> are of a second data type that is different than the first data type. For example, the first data type may be float and the second data type may be integer. For example, the first data type may be integer and the second data type may be float. In some implementations, the first data type is Boolean and registers of the first set of physical registers are a single bit size. For example, the first execution resource circuit <NUM> may be configured to execute branch instructions. Branch execution is often on the critical path in a processor and isolating Booleans into a separate cluster may reduce circuit delay for branch resolution. In some implementations, the first data type is scalar (e.g., a <NUM>-bit scalar) and the second data type is half-width scalar (e.g., a <NUM>-bit scalar). In some implementations, the first data type is packed-SIMD (Single Instruction, Multiple Data) and the second data type is non-packed-SIMD. Providing a separate cluster may reduce critical path for non-packed-SIMD values. For example, a packed-SIMD cluster may be tailored for energy conservation with longer circuit delay. For example, the execution resource circuit <NUM> may include an arithmetic logic unit (ALU). For example, the execution resource circuit <NUM> may include a floating point unit (FPU). The cluster may include datapaths that enable the execution resource circuit <NUM> to access the registers of the first set of physical registers <NUM>, <NUM>, and <NUM> as a source register holding an input argument and/or as a destination register to store a result. For example, the second cluster <NUM> may be used to execute an instruction (e.g., a multiplication instruction) taking a value stored in the physical register <NUM> a value stored in the physical register <NUM> as input arguments and output a result to the physical register <NUM>. For example, the second set of physical registers <NUM>, <NUM>, and <NUM> in close proximity to the second execution resource circuit <NUM>.

The integrated circuit <NUM> includes a register renaming circuit <NUM>. The register renaming circuit <NUM> maintains a rename table <NUM> that stores data associates a logical register of an instruction set (e.g., a RISC-V register) with one or more respective physical registers where a value of the logical register is or will be stored. The register renaming circuit <NUM> includes a data type predictor circuit <NUM> that is configured to generate data type predictions for results of an instruction that will be stored in a destination register.

The register renaming circuit <NUM> is configured to determine a data type prediction for a result of a first instruction that will be stored in a first logical register. The first logical register may be allowed to store data of different data types (e.g., integer or float) under an applicable instruction set. For example, the data type predictor circuit <NUM> may be used to determine the data type prediction. For example, the first logical register may be a vector with at least two elements and the physical register of the first set of physical registers stores the vector. For example, the first logical register may be a matrix with multiple rows and multiple columns of elements and the physical register of the first set of physical registers may store the matrix. In some implementations, the data type prediction is determined based on an opcode of the first instruction. For example, where the first instruction is a floating point add, the data type prediction may be biased toward being a float. Although, other factors may be considered to predict reinterpretation or type casting of the result by later instructions that depend on the result. In some implementations, the first instruction is an untyped transfer instruction (e.g., a load instruction), thus the opcode of the first instruction may lack information about the data type of the result.

For example, the register renaming circuit <NUM> may look ahead in the instruction buffer <NUM> to detect a second instruction that will access the result of the first instruction in the first logical register and use information about this consuming instruction to determine the data type prediction. For example, the data type prediction may be determined based on an opcode of a queued instruction that will access the result of the first instruction. The queued instruction may be stored in the instruction buffer <NUM>. For example, the first instruction may be stored as a next instruction <NUM> for issue in the instruction buffer, and the register renaming circuit <NUM> may scan the instruction buffer to detect a second instruction <NUM> that will next accesses the first logical register as source register. The data type prediction may then be determined based on the opcode of the second instruction <NUM>.

For example, the data type prediction may be determined based on a current data type of data currently stored in the first logical register. The observation is that in many codes, especially loops, the same architecture registers are used to hold the same types repeatedly. Software can improve the performance of this scheme if software developers are made aware of this prediction policy. For example, the first instruction may be a load instruction, which may provide no inherent information about the data type of its result (i.e., the value retrieved from a memory system), but a consistent use of an architectural register by software may provide the needed hints to accurately predict the data type of the data loaded from memory.

For example, the data type prediction may be determined based on a value of a program counter (e.g., the program counter value associated with the first instruction). In some implementations, the data type predictor circuit <NUM> may maintain a prediction table of prediction counters that is indexed by program counter value.

For example, the data type prediction may be determined based on based on combinations of the factors described above.

The register renaming circuit <NUM> is configured to, based on the data type prediction matching the first data type, rename the first logical register to be stored in a physical register of the first set of physical registers <NUM>, <NUM>, or <NUM>. For example, renaming the first logical register ma include updating an entry of the rename table <NUM> to associate the first logical register to be with the physical register of the first set of physical registers <NUM>, <NUM>, or <NUM>. Renaming the first logical register may cause the result of the first instruction to be stored in the physical register of the first set of physical registers <NUM>, <NUM>, or <NUM>. If the data type prediction is accurate, then when a second, later instruction accesses the first logical register to access the result, the second instruction can be executed efficiently using the first cluster <NUM>.

If the data type prediction turns out not to be accurate, then a misprediction has occurred. For example, a misprediction may be addressed by inserting an additional micro-op before the second instruction to move the result of the first instruction to a physical register in a proper cluster for the second instruction. In some implementations, the register renaming circuit <NUM> is configured to detect a misprediction, where a second instruction, to be executed after the first instruction, will access the first logical register as an input of the second data type; and, responsive to the misprediction, issue a micro-op before the second instruction. The micro-op copies a value of the first logical register stored in a physical register of the first set of physical registers to a physical register of the second set of physical registers. For example, the micro-op may be a microarchitectural move instruction. In some implementations, the micro-op may also cause an update of a rename table <NUM> to reflect the move of the result of the first instruction.

The integrated circuit includes an instruction buffer <NUM>. For example, the instruction buffer <NUM> may be a decode buffer of the integrated circuit <NUM>. For example, the instruction buffer <NUM> may be an issue buffer of the integrated circuit <NUM>. For example, the instruction buffer <NUM> may be a cache line of an instruction cache of the integrated circuit <NUM>.

<FIG> is block diagram of an example of a system <NUM> for executing instructions with register renaming based data type prediction and an alternate datapath between clusters that can be used to recover from a misprediction. The system <NUM> includes an integrated circuit <NUM> for executing instructions (e.g., RISC-V instructions or x86 instructions). The integrated circuit <NUM> includes: the first cluster <NUM> configured to performs operations on one or more inputs of a first data type; the second cluster <NUM> configured to performs operations on one or more inputs of a second data type; and a register renaming circuit <NUM> configured to rename logical registers to map to physical registers in a cluster chosen from amongst a set of clusters based on a data type prediction for a result of an instruction (e.g., a load instruction, an add instruction, or an xor instruction). The integrated circuit <NUM> may include additional clusters (not shown inf <FIG>) that execute instructions taking inputs of additional different data types. In some implementations, the integrated circuit <NUM> may include additional clusters (not shown inf <FIG>) that execute instructions taking inputs of the first data type or the second data type and register renaming may be based on additional considerations, such as true dependency among a sequence of instructions, when selecting among multiple clusters using a same data type for register renaming. The integrated circuit <NUM> includes the instruction buffer <NUM> that stores instructions that are expected to be executed in the near future. For example, integrated circuit <NUM> may be microprocessor or a microcontroller.

A difference between the integrated circuit <NUM> and the integrated circuit <NUM> of <FIG> is that the integrated circuit <NUM> includes an alternate datapath <NUM> from a physical register <NUM> of the first set of physical registers <NUM>, <NUM>, and <NUM> to the second execution resource circuit <NUM>. The alternate datapath <NUM> enables the second execution resource circuit <NUM> to directly access a value stored in the physical register <NUM>, rather than having to wait for other resources of the integrated circuit <NUM> to move a result stored in the physical register <NUM> to a physical register of the second set of physical registers <NUM>, <NUM>, and <NUM>. For example, the register renaming circuit <NUM> may be configured to: detect a misprediction where a second instruction, to be executed after the first instruction, will access the first logical register as an input of the second data type; and, responsive to the misprediction, cause the second execution resource circuit <NUM> to access a value of the first logical register using the alternate datapath <NUM>. Using the alternate datapath <NUM> may consume more power to access the data from a greater distance, but may save time relative to inserting a micro-op to copy the data between clusters.

<FIG> is flow chart of an example of a process <NUM> for register renaming based on data type prediction. The process <NUM> includes determining <NUM> a data type prediction for a result of a first instruction that will be stored in a first logical register; and, based on the data type prediction matching a first data type, renaming <NUM> the first logical register to be stored in a physical register of a first cluster chosen from among a plurality of clusters. For example, the process <NUM> may be implemented using the integrated circuit <NUM> of <FIG>. For example, the process <NUM> may be implemented using the integrated circuit <NUM> of <FIG>.

The process <NUM> includes determining <NUM> a data type prediction for a result of a first instruction that will be stored in a first logical register. The first logical register may be allowed to store data of different data types (e.g., integer, float, Boolean, scalar, vector, or matrix) under an applicable instruction set (e.g., a RISC-V instruction set or an x86 instruction set).

In some implementations, the data type prediction is determined <NUM> based on an opcode of the first instruction. For example, a destination register for a logical AND instruction may be predicted to be of a Boolean data type based on the opcode of the instruction that is producing the result to be stored in the destination register. For example, where the first instruction is a floating point add, the data type prediction may be biased toward being a float. However, other factors may be considered to predict reinterpretation or type casting of the result by later instructions that depend on the result.

For example, the first instruction may be an untyped transfer instruction (e.g., a load instruction). In this case opcode of the first instruction may lack information about how the result will be used, so other techniques may be used to determine <NUM> a data type prediction for a result of a first instruction.

For example, a look ahead in an instruction buffer may serve to identify a future instruction that is likely to access the result in the first logical register, and thus provide useful information about what data type the result should be given. In some implementations, the data type prediction is determined <NUM> based on an opcode of a queued instruction that will access the result of the first instruction. The queued instruction may be stored in an instruction buffer. For example, the instruction buffer may be a decode buffer. For example, the instruction buffer may be a cache line of an instruction cache. For example, the instruction buffer may be an issue buffer.

For example, the data type prediction may be determined <NUM> based on a current data type of data currently stored in the first logical register. The observation is that in many code segments, especially loops, the same architecture registers are used to hold the same types repeatedly. Software can improve the performance of this scheme if software developers are made aware of this prediction policy. For example, the first instruction may be a load instruction, which may provide no inherent information about the data type of its result (i.e., the value retrieved from a memory system), but a consistent use of an architectural register by software may provide the needed hints to determine <NUM> an accurate data type prediction for the data loaded from memory.

For example, the data type prediction may be determined <NUM> based on a value of a program counter (e.g., the program counter value associated with the first instruction). In some implementations, a prediction table of prediction counters that are indexed by program counter value may be maintained. In some implementations, the data type prediction may be determined <NUM> randomly.

For example, the data type prediction may be determined <NUM> based on based on combinations of the factors described above, such as opcode of the first instruction, look ahead for an opcode of a later consuming instruction, a current data type of the first logical register, and/or a program counter value.

The process <NUM> includes, based on the data type prediction matching a first data type, renaming <NUM> the first logical register to be stored in a physical register of a first cluster chosen from among a plurality of clusters. The first cluster may include a first set of physical registers and a first execution resource circuit configured to perform operations that take contents of one or more registers of the first set of physical registers as input. The inputs for operations of the first execution resource circuit may be of the first data type. The plurality of clusters may include a second cluster including a second set of physical registers and a second execution resource circuit configured to perform operations that take contents of one or more registers of the second set of physical registers as input. The inputs for operations of the second execution resource circuit may be of a second data type that is different than the first data type. For example, the first data type may be float and the second data type may be integer. For example, the first data type may be integer and the second data type may be float. In some implementations, the first data type is Boolean and registers of the first set of physical registers are a single bit size. For example, the first execution resource circuit may be configured to execute branch instructions. In some implementations, the first logical register is a vector with at least two elements and the physical register of the first set of physical registers stores the vector. In some implementations, the first logical register is a matrix with multiple rows and multiple columns of elements and the physical register of the first set of physical registers stores the matrix. In some implementations, the first data type is scalar (e.g., a <NUM>-bit scalar) and the second data type is half-width scalar (e.g., a <NUM>-bit scalar). In some implementations, the first data type is packed-SIMD (Single Instruction, Multiple Data) and the second data type is non-packed-SIMD. Providing a separate cluster may reduce critical path for non-packed-SIMD values.

If the data type prediction turns out to be inaccurate, then a misprediction has occurred. In some implementations, a misprediction may be addressed by inserting an additional micro-op before the second instruction to move the result of the first instruction to a physical register in a proper cluster for the second instruction. For example, the process <NUM> of <FIG> may be implemented to handle mispredictions of the data type of a result. In some implementations, a misprediction may be addressed by using an alternate datapath in the integrated circuit to access the result from one cluster in a different cluster associated with a different data type. For example, the process <NUM> of <FIG> may be implemented to handle mispredictions of the data type of a result.

<FIG> is flow chart of an example of a process <NUM> for recovering from a data type misprediction by inserting a micro-op to move data to a correct cluster. The process <NUM> includes detecting <NUM> a misprediction where a second instruction, to be executed after the first instruction, will access the first logical register as an input of the second data type; and, responsive to the misprediction, issuing <NUM> a micro-op before the second instruction, to copy a value of the first logical register stored in a physical register of a cluster to a physical register of a second cluster. For example, the process <NUM> may be implemented using the integrated circuit <NUM> of <FIG>. For example, the process <NUM> may be implemented using the integrated circuit <NUM> of <FIG>.

The process <NUM> includes detecting <NUM> a misprediction where a second instruction, to be executed after the first instruction, will access the first logical register as an input of the second data type. For example, a misprediction may be detected <NUM> when the second instruction is sitting in an issue buffer by scanning the issue buffer for instructions with the first logical register as a source register. Detecting <NUM> a misprediction may also include checking for intervening overwrites of the result of the first instruction in the logical register. Detecting <NUM> a misprediction may include, when a second instruction is found that accesses the result in the first logical register, checking whether the data type of the first logical register as source register for the second instruction matches the data type prediction for the result of the first instruction and/or whether the result is currently stored in a proper cluster for executing the second instruction.

The process <NUM> includes, responsive to the misprediction, issuing <NUM> a micro-op before the second instruction. The micro-op copies a value of the first logical register stored in a physical register of the first set of physical registers (i.e., of the first cluster) to a physical register of the second set of physical registers (i.e., of the second cluster). For example, the micro-op may be a microarchitectural move instruction. In some implementations, the micro-op may also cause an update of a rename table (e.g., the rename table <NUM>) to reflect the move of the result of the first instruction. After the result of the first instruction has been copied to the second cluster, the second cluster may be used to execute the second instruction, efficiently accessing the result of the first instruction and treating it as data of the second data type associated with the second cluster.

<FIG> is flow chart of an example of a process <NUM> for recovering from a data type misprediction by using an alternate datapath between clusters. The process <NUM> includes detecting <NUM> a misprediction where a second instruction, to be executed after the first instruction, will access the first logical register as an input of the second data type; and, responsive to the misprediction, causing <NUM> a second execution resource circuit (e.g., the second execution resource circuit <NUM>) to access a value of the first logical register using an alternate datapath (e.g., the alternate datapath <NUM>) from a physical register of the first set of physical registers (e.g., of the first cluster <NUM>) to the second execution resource circuit. For example, the process <NUM> may be implemented using the integrated circuit <NUM> of <FIG>.

The process <NUM> includes, responsive to the misprediction, causing <NUM> the second execution resource circuit to access a value of the first logical register using an alternate datapath from a physical register of the first set of physical registers (i.e., of the first cluster) to the second execution resource circuit. An integrated circuit (e.g., the integrated circuit <NUM>) includes an alternate datapath from a physical register of the first set of physical registers to the second execution resource circuit. The alternate datapath enables the second execution resource circuit to directly access a value stored in the physical register of the first set of physical registers, rather than having to wait for other resources of the integrated circuit to move a result stored in the physical register to a physical register of the second set of physical registers. Using the alternate datapath may consume more power to access the data from a greater distance, but may save time relative to inserting a micro-op to copy the data between clusters.

<FIG> is block diagram of an example of a system <NUM> for executing instructions from an instruction set with register renaming. The system <NUM> includes an integrated circuit <NUM> configured to execute the instructions. For example, the integrated circuit <NUM> may be a processor or a microcontroller. The integrated circuit <NUM> includes a renaming table <NUM>, a central register file <NUM>, and an execution resource unit <NUM>. The renaming table <NUM> includes entries (e.g., entry <NUM>, <NUM>, and <NUM>) that map logical registers supported by an assembly instruction set (e.g., a RISC V instruction set, an x86 instruction set, or an ARM instruction set) to physical registers of the integrated circuit <NUM>. The central register file <NUM> includes physical registers, such as the physical register <NUM> and the physical register <NUM>. The execution resource unit <NUM> includes an execution resource circuit <NUM> and physical registers <NUM>, <NUM>, and <NUM> in close proximity to execution resource circuit <NUM>.

A feature of the integrated circuit <NUM> is that it includes a renaming table <NUM> mapping to physical registers in different locations on the integrated circuit <NUM>. In some implementations, the physical registers may be of different types. For example, physical registers <NUM>, <NUM>, and <NUM> may be vectors while in the physical register <NUM> may store a scalar. The physical registers <NUM>, <NUM>, and <NUM> are in close proximity to the arithmetic logical unit (ALU) <NUM>, which may result in higher speed, power savings, and/or smaller area.

In some implementations, the renaming table <NUM> may enable the use of a heterogeneous set of physical registers in proximity to execution resource circuits. For example, an instruction set architecture (ISA) may encode the shape (e.g., scalar, vector, or matrix) of a logical register. In some implementations, each logical register name of the ISA may encode the shape of the logical register. During fetch, decode, execute, the shape of the operands (e.g., sources and the destination) may be known. This may enable the use of different types (e.g., scalar, vector, and matrix) of registers for different parts of an equation implemented with instructions of the ISA. In some implementations, two types of vectors, one for row vectors another for column vectors, may be supported to better handle two-dimensional matrix operations. See <FIG> for an example of potential physical register types near a matrix functional unit.

<FIG> is block diagram of an example of a system <NUM> for executing instructions from an instruction set with register renaming. The system <NUM> includes an integrated circuit <NUM> configured to execute the instructions. For example, the integrated circuit <NUM> may be a processor or a microcontroller. The integrated circuit <NUM> includes a renaming table <NUM>, a metric, a matrix execution unit <NUM>, a scalar execution unit <NUM>, a vector execution unit <NUM>, and physical registers <NUM>, <NUM>, <NUM>, and <NUM>. The renaming table <NUM> includes entries (e.g., <NUM>, <NUM>, and <NUM>) that map logical registers supported by an assembly instruction set (e.g., a RISC V instruction set, an x86 instruction set, or an ARM instruction set) to physical registers of the integrated circuit <NUM>. The matrix execution unit <NUM> includes an execution resource circuit <NUM> and a physical register <NUM> that stores a matrix in close proximity to execution resource circuit <NUM>. The scalar execution unit <NUM> includes an execution resource circuit <NUM> and physical registers <NUM>, <NUM>, and <NUM> that store scalars in close proximity to execution resource circuit <NUM>. The vector execution unit <NUM> includes an execution resource circuit <NUM> and physical registers <NUM>, <NUM>, and <NUM> that store vectors in close proximity to execution resource circuit <NUM>.

The integrated circuit <NUM> includes four types of physical registers. Note that some of the physical registers (<NUM>, <NUM>, <NUM>, and <NUM>) for one-dimensional vectors do not have functional units because those feed the matrix functional units. For example, the physical registers <NUM>, <NUM>, <NUM>, and <NUM> may store column vectors. In contrast, the, scalar, and matrix, has functional units in proximity for operations. In some implementations (not shown in <FIG>), the integrated circuit <NUM> could include one or more execution resource circuits proximal to the physical registers <NUM>, <NUM>, <NUM>, and <NUM> for one-dimensional vectors (e.g., column vectors). The example architecture of <FIG> may be more efficient for an ISA in which vectors are designated as subject to matrix transformations or elementwise operations. Although not shown in <FIG>, there could be multiple physical matrix registers.

For example, a simple path is: input all type1, Output all type1 → allocate type1 registers (e.g., all scalar, or all one-dimensional vector (e.g., row vectors), or load matrix). If there are no physical registers available, then an instruction may be delayed to schedule execution when an appropriate physical register is available.

For example, a slightly more complex path is: picking best type of physical register for each input/output according to the ISA or the hints in the register names.

For example, an advanced path/more complex embodiment is: apply branch prediction-type heuristics to track how results are used and pick the right type of register for the outputs. For example, in <FIG> we may have two types of one-dimensional vectors, row and column. Inefficiencies may arise if results are often stored in row vectors, but the results are needed for use in column vectors for a later matrix operations. And vice versa, inefficiencies may arise if results are often stored in column vector registers, but the results are needed for performing operations directly that needs a move. Thus on this path, tracking the most recent use of that operand can inform future placement. Most loops would support this with a simple predictor consisting of a buffer that tracks what type of register was used in the previous occurrence. So you would track something like this for the renaming table:.

Where usage prediction is just what happened last to that case previously. Thus, the predictions produced by the predictor may be dependent on the last path.

Another issue beyond physical geography, is what happens if you have integer ALUs and another ALU that does floating point calculations. Thus, the types of physical registers available may also vary by the precision format of the one or elements of the register. For example, the renaming table may be extended to track or predict element type for a logical register, which may result in the renaming table:.

Register renaming may be associated with out-of-order execution in processors. This approach may be used with both.

For example, an integrated circuit <NUM> for executing instructions includes an execution resource circuit <NUM> configured to execute instructions on operands stored in physical registers, a set of physical registers including a first subset of physical registers <NUM>, <NUM>, and <NUM> located in proximity to the execution resource circuit and a second subset of physical registers (e.g., the central register file <NUM>) that are located further from the execution resource circuit <NUM> than the registers in the first subset of physical registers <NUM>, <NUM>, and <NUM>, and a register renaming circuit configured to: detect a sequence of instructions stored in an instruction decode buffer, the sequence of instructions including multiple sequential references to a first logical register with true dependency; and, based on detection of the sequence of instructions, rename the first logical register to be stored in a physical register of the first subset of physical registers <NUM>, <NUM>, and <NUM> and rename another logical register referenced in the sequence of instructions to be stored in a physical register of the second subset of physical registers <NUM>, <NUM>, and <NUM>. For example, the first logical register may be a vector with at least two elements and the physical register of the first subset of physical registers stores the vector. For example, the first logical register may be a matrix with multiple rows and multiple columns of elements and the physical register of the first subset of physical registers stores the matrix. In some implementations, the sequence of instructions accumulates a sum in the first logical register.

Claim 1:
An integrated circuit (<NUM>) for executing instructions comprising:
a first cluster (<NUM>) including a first set of physical registers (<NUM>, <NUM>, <NUM>) and a first execution resource circuit (<NUM>) configured to perform operations that take contents of one or more registers of the first set of physical registers as input, wherein the inputs for operations of the first execution resource circuit are of a first data type;
a second cluster (<NUM>) including a second set of physical registers (<NUM>, <NUM>, <NUM>) and a second execution resource circuit (<NUM>) configured to perform operations that take contents of one or more registers of the second set of physical registers as input, wherein the inputs for operations of the second execution resource circuit are of a second data type that is different than the first data type; and
a register renaming circuit comprising a data type predictor circuit (<NUM>) configured to predict a data type prediction for a result of a first instruction that will be stored in a first logical register, the register renaming circuit (<NUM>) configured to:
based on the data type prediction matching the first data type, rename the first logical register to be stored in a physical register (<NUM>) of the first set of physical registers.