Data Structure Abandonment
The use of abandonment instructions to mark unused storage circuits in data processing devices enhances efficiency by reducing data dependency impacts and context switch times, facilitating speculative execution and context switch optimization.
Patent Information
- Application Number
- JP2021555375
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-08-05
- Filing Date
- 2020-03-25
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-03-25
AI Technical Summary
Data processing devices face inefficiencies due to the presence of unused data values in storage circuits, which can cause stalls during speculative branch execution and prolong context switch times.
Implementing abandonment instructions to mark unused storage circuits, allowing future instructions to be executed efficiently by indicating which storage circuits are no longer in use, and inhibiting unnecessary evacuation during context switches.
Improves execution efficiency by reducing the impact of data dependencies and context switch times, while minimizing memory requirements and enabling speculative execution without stalling.
Smart Images

Figure 0007590336000001 
Figure 0007590336000002 
Figure 0007590336000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to data processing. The present disclosure may relate to data processing devices that store data using memory circuits such as registers, for example. Summary of the Invention
[0002] A data processing apparatus may include one or more storage circuits, such as registers, used to store data values during processing. Such data values may be operated on by instructions. However, at a given time, some of the data values are no longer used. However, the presence of such data values may affect the execution of future instructions. For example, if a branch is speculatively executed and an instruction attempts to use a register as a destination register, a stall may occur until it can be determined whether the branch was correctly speculatively executed. This is because an instruction at the destination of the branch that is not executed may use the register as a source, and if the value in the register is overwritten, it may not be possible to "unwind" the speculatively executed branch. On the other hand, a context switch saves the state of the registers so that those registers can be used by different processes. However, the presence of each register increases the time it takes for a context switch to occur, as each register may have to be saved. It is desirable to improve the efficiency of such data processing apparatus.
[0003] Looking at a first exemplary configuration, a data processing apparatus is provided, the data processing apparatus comprising a plurality of storage circuits for storing data, and an execution circuit for performing one or more operations using the storage circuits in response to instructions, the instructions including a relinquish instruction, the execution circuit adapted to respond to the relinquish instruction by indicating that at least one of the plurality of storage circuits is an unused storage circuit, and the execution circuit adapted to affect execution of future instructions based on the unused storage circuit after executing the relinquish instruction.
[0004] Turning to a second exemplary configuration, a method of data processing is provided, the method including storing data in a plurality of storage circuits; in response to instructions including a relinquish instruction, performing one or more operations using the storage circuits; in response to the relinquish instruction, indicating at least one of the plurality of storage circuits is an unused storage circuit; and affecting execution of future instructions based on the unused storage circuit after executing the relinquish instruction.
[0005] Turning to a third exemplary configuration, a data processing apparatus is provided comprising: means for storing data in a plurality of storage circuits; means for performing one or more operations using the storage circuits in response to an instruction including a relinquish instruction; means for indicating, in response to the relinquish instruction, that at least one of the plurality of storage circuits is an unused storage circuit; and means for affecting execution of future instructions based on the unused storage circuit after executing the relinquish instruction. [Brief description of the drawings]
[0006] The invention will be further described, by way of example only, with reference to embodiments thereof illustrated in the accompanying drawings, in which: [Figure 1] FIG. 1 illustrates a schematic diagram of a data processing apparatus according to some embodiments. [Figure 2A] FIG. 2A illustrates three different implementations of a relinquishment order, according to some embodiments. [Figure 2B] FIG. 2B illustrates three different implementations of a relinquishment command, according to some embodiments. [Figure 2C] FIG. 2C illustrates three different implementations of a relinquishment command, according to some embodiments. [Diagram 3] FIG. 3 shows a flowchart illustrating a method of speculative execution according to some embodiments. [Figure 4] FIG. 4 shows an example of how discarding memory circuits can aid inference, according to some embodiments. [Diagram 5]FIG. 5 shows a flowchart illustrating a method for recovering from erroneous speculative execution in accordance with some embodiments. [Figure 6] FIG. 6 illustrates an example of saving context during a context switch when storage circuitry, such as registers, is being relinquished, according to some embodiments. [Figure 7] FIG. 7 provides an example of saving registers where some registers are discarded as part of a context switch, according to some embodiments. [Figure 8] FIG. 8 illustrates an example of loading context during a context switch when registers are being relinquished, according to some embodiments. [Figure 9] FIG. 9 shows a flow chart illustrating a method of data processing according to some embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0007] Before discussing the embodiments with reference to the accompanying drawings, the following embodiments are described.
[0008] According to some example configurations, a data processing apparatus is provided, the data processing apparatus comprising a plurality of storage circuits for storing data; and an execution circuit for performing one or more operations using the storage circuits in response to instructions, the instructions including a relinquish instruction, the execution circuit adapted to respond to the relinquish instruction by indicating that at least one of the plurality of storage circuits is an unused storage circuit, and the execution circuit adapted to affect execution of future instructions based on the unused storage circuit after executing the relinquish instruction.
[0009] In the above exemplary configuration, a relinquish instruction is used to indicate that a value stored in a particular storage circuit (e.g., a data value stored in that storage circuit) is no longer in use. This "not in use" state persists until the storage circuit is next accessed (e.g., written to), at which point the value changes and the storage circuit's state becomes "in use" again. In some embodiments, there may be an explicit instruction provided to indicate that the storage circuit is now "in use". In any event, the execution of at least some future instructions is affected (e.g., modified) based on the storage circuit having such a state. Note that the future instructions may actually appear earlier in the program, for example, due to a branch instruction or other control flow instruction. The relinquish instruction need not be a dedicated instruction, but may instead be a regular instruction that performs the function of relinquishing the storage circuit. In this manner, storage circuits that are no longer in use may be so indicated, and thus future instructions may be more efficient in execution by taking such storage circuits into account. The process of determining whether a given storage circuit is no longer in use may be performed by a compiler and / or by a programmer. Considering that during compilation / programming, the entire program can be analyzed to determine whether a given value is used any more, it is possible to provide such information as part of the program of the data processing apparatus.
[0010] According to some example configurations, the data processing apparatus includes a context save circuit that saves a set of storage circuits in response to a context switch, and the future instructions include one or more context switch instructions that perform the context switch. The context save circuit may be used, for example, during a context switch, when the data processing apparatus switches from executing one application to another application. During a context switch, contents associated with the set of storage circuits need to be saved (e.g., to main memory) so that a subsequent application can use those storage circuits without losing data currently in those storage circuits.
[0011] In some embodiments, the context saving circuitry is adapted to inhibit saving of unused storage circuits. By inhibiting saving of unused storage circuits, less data is stored, which can result in a faster process of performing context saving. Thus, it not only improves the efficiency of the context saving process, but also reduces the amount of storage required to store the current context.
[0012] In some embodiments, the context save circuitry is adapted to save a plurality of storage circuits other than the unused storage circuits, in such embodiments, a set of storage circuits excluding the unused storage circuits is saved.
[0013] In some embodiments, the context save circuit is adapted to save the identity of either the unused storage circuits or the storage circuits other than the unused ones. As a result, the identity of the unused storage circuits is saved or the identity of the used storage circuits is saved. In either case, it is possible to determine how and where to insert the saved values back into the storage circuits when the application is resumed. If there are multiple unused storage circuits, the identity of each of the unused storage circuits may be stored so that each saved value can be restored to the correct position of the saved value. As an initial step in the restoration process, the current values of the set of storage circuits may be reset, thereby erasing the storage circuits that are not restored. As a result, data used by the application being switched out cannot be read by the application being switched in, even in the case of unexpected behavior.
[0014] In some embodiments, the data processing apparatus comprises an issue circuit that receives instructions in stream order and issues the instructions to the execution circuit in a modified order other than the stream order. The issue circuit can be used to execute instructions out of order. In particular, the issue circuit can receive instructions in stream order and then provide the instructions (or their corresponding operations / control signals) to a queue that can be executed in any order depending on data dependencies between the instructions. In this way, when there are multiple execution circuits, the instructions can be executed in parallel. Furthermore, by executing instructions out of order, the effect of data dependencies between instructions can be limited, so that execution of instructions does not have to be stalled as a result of data dependencies between other instructions.
[0015] In some embodiments, the stream order is a relinquish instruction followed by a branch instruction followed by a producer instruction, where the branch instruction is predicted as executed and the producer instruction stores the second data value in an unused storage circuit, and the modified order causes the producer instruction to be issued before the branch is completed. In these embodiments, the relinquish instruction is used to indicate that the storage circuit that holds the first data value is no longer in use. As a result, it is possible for the producer instruction (at the branch target) to begin execution while the branch is still speculative (e.g., not completed). This is because the relinquish instruction indicates that the storage circuit that stores the first data value is no longer in use. As a result, the storage circuit that holds that data may be used by the producer instruction that stores the second data value. Typically, when the control flow is uncertain (e.g., due to a conditional branch), the processor cannot speculatively execute the producer instruction because if the branch was mispredicted, there may still be a consumer instruction in the correct program flow that reads the old value. The relinquish mechanism allows to declare that this is not the case, and thus allows the speculation to proceed. In some embodiments, a consumer instruction that reads a first data value from an unused storage circuit precedes the relinquish instruction. A consumer instruction may be considered to be an instruction that uses a particular data value (as opposed to a producer instruction, which may be considered to be an instruction that provides a data value used by the consumer instruction). Thus, if a consumer instruction precedes a relinquish instruction, the producer instruction is executed after the consumer instruction finishes reading the register that is the subject of the relinquish instruction.
[0016] In some embodiments, the consumer instruction executes over multiple processor cycles. When the consumer instruction executes over multiple processor cycles, the ability to execute other instructions, such as producer instructions, before the consumer instruction completes allows other operations to be executed without stalling until the consumer instruction completes.
[0017] In some embodiments, the consumer instruction is a matrix operation instruction. Other examples of instructions that are executed over multiple processor cycles may include division instructions and memory access instructions.
[0018] In some embodiments, each of the multiple storage circuits is simultaneously addressable. As a result of multiple storage circuits being simultaneously addressable, any of the storage circuits can be accessed at any one time. This can be useful for some algorithms, such as matrix multiplication, where the efficiency can be improved by adding addressable storage circuits. This is not always possible in all architectures. In particular, a particular architecture may have a huge number of storage circuits available, only a subset of which can be addressed at any one time. This allows the data processing device to create the illusion of increased availability of storage circuits. For example, if multiple instructions store data in register (storage circuit) R3, multiple copies of register R3 can be provided, so that for each speculative flow, a new R3 register can be allocated. If a speculation proves to be incorrect, the previous copy of R3 can be "restored". Such a technique is known as renaming. Renaming requires a large number of resources to be available and can be considered impractical, especially for large registers, due to the amount of circuitry required. By providing more addressable storage rather than using the same storage space to provide renaming registers, the efficiency of algorithms such as matrix multiplication can be improved, and by being able to "throw away" unused registers, the number of registers that need to be saved during a context switch can be reduced.
[0019] In some embodiments, each of the plurality of storage circuits is adapted to store a plurality of data values, and each of the plurality of storage circuits is adapted to store a plurality of data values. By providing storage circuits adapted to store a plurality of data values, complex data structures can be accommodated. For example, such storage circuits may be configured to store all data values associated with a matrix, thereby allowing operations to be performed on an entire matrix at once.
[0020] In some embodiments, each of the plurality of storage circuits has a capacity of at least 1 KiB. In other words, each of the plurality of storage circuits may have a capacity of 1024 bytes. Such a storage circuit may be used to store a plurality of data values. In particular, the size of each data value may vary. For example, 1024 8-bit values may be stored, or 256 32-bit values may be stored.
[0021] In some embodiments, the execution circuitry is adapted to respond to the relinquish instruction by executing at least some of the one or more operations and to indicate one of the plurality of storage circuits as an unused storage circuit. Thus, the relinquish instruction can perform several different purposes. For example, the relinquish instruction can be a regular instruction that uses one or more data values stored in the storage circuits and indicates that one or more of these storage circuits are no longer in use. In this way, it is not necessary to provide a dedicated relinquish instruction as part of the instruction set. Furthermore, a program can be made more efficient by allowing the relinquishment of a storage circuit as part of another instruction.
[0022] There are many ways to indicate that a particular instruction is to be used to perform a relinquish operation. However, in some embodiments, at least some of the instructions include a field that indicates whether the instruction is a relinquish instruction. The instructions may be compiled into machine instructions that are created from an instruction code that identifies the instruction to be executed and one or more parameters. In these embodiments, one or more of the parameters is a single bit associated with a storage circuit (e.g., a register) reference that indicates whether the storage circuit is to be marked as unused. As a result of one or more of these fields in the machine instruction being set, the instruction is recognized as a relinquish instruction and the particular storage circuit is relinquished.
[0023] In some embodiments, the data processing apparatus includes a track circuit that identifies one or more unused storage circuits, including unused storage circuits. Thus, the track circuit may be used to indicate the identity of the unused storage circuit(s). If only a single storage circuit may be marked as unused, the mask circuit may simply encode the ID of that storage circuit. In other embodiments, if the number of unused storage circuits may be greater than one, a mask may be provided to encode the storage circuits that are used (e.g., using a bitwise encoding). In either case, the relinquish instruction may be used to update a value stored in the track circuit. Similarly, the value stored in the track circuit may also be updated to indicate that a particular register is used as a result of its value of that storage circuit being changed.
[0024] In some embodiments, the storage circuit is a register and the unused storage circuit is an unused register within the register.
[0025] Specific embodiments will now be described with reference to the drawings.
[0026] FIG. 1 illustrates a schematic diagram of a data processing apparatus 100 according to some embodiments. The apparatus 100 includes a fetcher 110 responsible for fetching instructions, for example from either a main memory or an instruction cache. The fetched instructions are accessed by a decoder 120, which decodes the fetched instructions into one or more control signals representing individual operations. The operations are passed to an issue logic 130, which is responsible for issuing and scheduling the operations that make up the instructions. From here, the instructions are issued to one or more execution circuits 170. In this example, the execution units 170 include an arithmetic logic unit (ALU) 170a, a second arithmetic unit (ALU) 170b, a floating point unit (FPU) 170c, a load / store unit 170d, a branch unit 170e, a context save unit 170f, and a matrix operation unit 170g. The apparatus 100 includes register files 140a, 140b. The register file is composed of two parts, a first part 140a containing general purpose registers 150a and a second part 140b containing specific registers 150b reserved in this case for matrix operations, where registers 150b are an example of a claimed memory circuit. During execution of an instruction, data from general purpose registers 150a in register file 140a may be passed to any of execution units 170. However, data from specific registers 150b can only be accessed by load / store unit 170d and matrix operations unit 170g.
[0027] One or more of the execution units 170, such as matrix operation unit 170g, execute operations corresponding to the relinquish instructions in the instructions fetched by fetcher 110. The relinquish instructions are used to indicate that one or more particular registers 150b in register file 140b are no longer needed. Such lack of requirement persists until such time that a new data value is stored in that register. The relinquish instructions executed by one of the execution circuits 170 cause a usage mask 160 maintained in register file 140b to be updated. The usage mask 160 indicates the set of particular registers 150b that are currently being used (i.e., not being relinquished). Of course, in other embodiments, the usage mask 160 can be used to indicate those particular registers 150b that are being relinquished. In this embodiment, the usage mask 160 is also made available to issue logic 130 for speculation purposes, as described below.
[0028] 2A shows one embodiment of a relinquish instruction 280. In this case, the relinquish instruction takes the form of a matrix multiply instruction. That is, the matrix multiply instruction has a relinquish function and is therefore an embodiment of a relinquish instruction, even though the instruction actually performs the further operation of a matrix multiplication. In this embodiment, instruction 280 first references register MC1, register MA P and the second reference to register MB Q2, and the third reference to the instruction 280. In this instruction 280, the last two references can be suffixed with a special symbol (^), which indicates that the registers are to be discarded once the values stored in those registers have been used. A machine form 200 of this instruction 280 is also shown in FIG. 2A. Specifically, the instruction is created from an instruction code 210 that uniquely identifies a particular instruction, and three register references 230, 250, and 270 that can each identify a register by a binary value (one of the registers 230 is the destination for the result of the operation, and the other two register references 250, 270 are the sources of inputs for the operation). The instruction 200 also includes two discard bits 240, 260, each associated with one of the source register references 250, 270. A value of '1' for one of these bits means that the corresponding register is to be discarded once the instruction has been issued and data has been extracted from that register. On the other hand, a value of '0' indicates that the data value is used and the register is not discarded. P 250, and a second register reference MB Q The setting of the second discard bit 260 associated with 270 is not done by the following instruction: MATMUL MC1,MA P ^,MB Q Corresponds to.
[0029] 2B illustrates another embodiment of a relinquish instruction. In this embodiment, relinquish instruction 290 takes the form of an explicit relinquish instruction that has no further computational purpose. Here, instruction 290 includes an explicit register reference MA0. As a result, register MA0 is relinquished when this instruction is executed.
[0030] 2C shows a third example of a relinquish instruction. In this example, instruction 295 includes a mask that can be used to identify multiple different registers. In this example, the mask is 00110111. This mask can be interpreted to mean that register numbers 0, 1, 2, 4, and 5 are immediately relinquished, but registers 3, 6, and 7 are not relinquished.
[0031] It will be appreciated that other forms of relinquish instructions may also be used without departing from the present technology. Additionally, the use of a particular bit value (such as 1) to indicate that a particular register is to be relinquished may be inverted to instead indicate that the register should not be relinquished.
[0032] 3 shows a flowchart 300 illustrating a method for using speculative execution in combination with a set of abandoned registers, according to some embodiments. The process begins at step 310 where a (potentially) speculative execution instruction is fetched. At step 320, it is determined whether the destination register of the instruction (e.g., the register to which the result is written) is a renamed register. For example, this may correspond to general purpose register 150a. If the destination register is a renamed register, at step 330, a new physical register is allocated to serve as the destination register of the instruction, and at step 340, the speculative operation is performed based on the instruction using the allocated physical register.
[0033] However, the technique also allows speculation to be performed when the destination register is not a renamed register, i.e., when the register is one of the particular registers 150b. Specifically, if it is determined in step 320 that the destination register is not a renamed register, then in step 350 it is determined whether the destination register is an abandoned register. If not, then in step 360 the instruction cannot be executed speculatively and must be executed non-speculatively. Alternatively, if it is determined in step 350 that the register is an abandoned register, then the process proceeds to step 340 where the speculative operation corresponding to the instruction can be executed. Since the abandoned register is no longer being used by the application, it is possible to execute the speculative operation using the abandoned register. As a result, the application can safely return the register to the abandoned state without losing data in the case of a misspeculation, since there is no current association with the register.
[0034] FIG. 4 shows an example of how discarding registers can aid in speculation, according to some embodiments. Specifically, FIG. 4 shows an example of a program in which a series of matrix multiplications are performed. In lines 1 and 2, data values (e.g., a matrix) are loaded into registers MA0 and MB0. A loop then begins between instructions 3 and 12. Within this loop, in instruction 3, a further data value (e.g., a matrix) is loaded into register MB1. In instruction 4, a matrix multiplication is performed by multiplying the matrix stored in MA0 by the matrix stored in MB0, and the result is stored in register MC0. In instruction 5, a new matrix is loaded into register MA0, and in instruction 6, a matrix multiplication MA0×MB1=MC1 is performed. A further load into register MA0 is performed in instruction 7. In instruction 8, a further matrix multiplication MA1×MB0=MC2 is performed. In instruction 9, a matrix is loaded into register MB0. In instruction 10, a further matrix multiplication of MA1×MB1=MC3 is performed. At instruction 11, the value of the variable "count" is decremented by one. At line 12, a test is made to see if the value of "count" has reached zero as a result of the decrement performed at instruction 11. If not, the process returns to the loop labeled between instructions 2 and 3. If not, the remainder of the program (not shown) continues.
[0035] The matrix multiplication instruction is expected to require a large number of processor cycles to execute. To prevent stalls, during the execution of instruction 10, the remaining instructions may be executed with the prediction made in relation to the outcome of branch instruction 12. However, this creates a potential problem when instruction 3 is executed. Specifically, instruction 3 overwrites the value stored in register MB1. Thus, if the prediction is incorrect, the value stored in register MB1 is lost. This is clearly unacceptable since several instructions after the loop may read MB1. To some extent, this can be solved using register renaming (mentioned above). This assigns different registers to conflicting instructions, such as instruction 3. Thus, if the branch is mispredicted, it is only necessary to discard the contents of the physical registers supplied to that particular invocation of instruction 3 in the loop. However, register renaming requires that multiple copies of the registers be provided. In situations (such as this one) where large registers are provided, register renaming is prohibited. Thus, one must usually choose between providing a large number of large registers or stalling the branch instruction.
[0036] The use of relinquish instructions can be used to inhibit such stalls without resorting to an increase in the number of registers. Specifically, by inserting a relinquish instruction between instructions 11 and 12 to specifically indicate that register MB1 is no longer required, instruction 3 can be executed without any problems. Specifically, when it is determined that the branch is not taken and the contents of register MB1 are overwritten by instruction 3, the contents of register MB1 can simply be erased. This is because the contents of MB1 can be set to any value since it is no longer required by the program. In practice, such information is typically available to the compiler and / or programmer or program. This is because the compiler / programmer has a complete picture of the program and can determine which instructions will be executed later. Of course, it is important that after register MB1 is indicated as no longer required, the program does not attempt to read from it until a further write to it has been made (thereby indicating that the register has been relinquished).
[0037] FIG. 5 illustrates a flow chart 500 of a method for recovering from an incorrectly made speculative execution according to some embodiments. Specifically, in FIG. 5, assume that the speculation occurred as a result of, for example, an incorrect branch prediction. In step 510, it is determined that the speculation was made incorrectly. In step 520, it is determined whether the register referenced in the incorrectly executed instruction is a renamed register. If so, in step 540, the old mapping of logical registers to physical registers is restored. That is, the old value of the register is remapped as the current value of the register. In step 550, the speculative register that was then used to store the value is freed (e.g., re-added to the pool of available physical registers). In step 520, if the register is not a renamed register, then in step 530, the abandoned bit is restored. That is, if the register was written, thereby clearing the abandoned bit, the abandoned bit is restored to indicate that the register is still abandoned. For example, in the embodiment of FIG. 4, the abandoned bit of register MB1 is set between instructions 11 and 12. If a misspeculation occurs and the look is incorrectly re-executed, then instruction 3 clears the abandoned bit by setting the value in register MB1. If it is then detected that the speculation was incorrect, the abandoned bit must be restored because the register is still abandoned and has not been written to since it was abandoned.
[0038] The abandon instruction can also be used to assist in a context switch, which occurs when an active thread or application running on a system is switched. This requires storing the current values of registers and storing back into registers the stored values of registers associated with the thread or application being switched in, so that execution can resume from the point where the stopped thread (now being switched in) left off.
[0039] FIG. 6 illustrates an example of how context can be saved during a context switch when a register is being relinquished, according to some embodiments. Specifically, in instruction 1, a value of usage mask 160 indicating the set of relinquished registers is stored in register x0. In instruction 2, the value of register x0 is then stored in context_ptr, the location in memory where the current values of the registers are stored. The exclamation mark "!" indicates that the value of context_ptr is then incremented. Instruction 3 determines whether a value of 1 is indicated in usage mask 160. In other words, instruction 3 determines whether register 1 is being relinquished. If register 1 (MA0) is being relinquished, execution jumps to label not_ma0. Otherwise, instruction 4 stores the data stored in register MA0 in context_ptr, which is then incremented. In either case, in instruction 5, it is determined whether a second register (MA1) is indicated by usage mask 160. If so, the program jumps to not_ma1. Otherwise, in instruction 6, the value of register MA1 is stored in context_ptr and context_ptr is incremented. In either case, in instruction 7, it is determined whether a third register (MB0) is indicated by the usage mask 160. If so, the process jumps to label not_mb0. If not, in instruction 8, the value of register MB0 is stored in context_ptr, which is then incremented. This process is repeated for each register that may be indicated by the usage mask 160. In effect, each register is tested in the usage mask 160. If the register is listed (indicating that the register is abandoned and therefore not used), the evacuation of that register is skipped. Otherwise, the evacuation of that register is performed in context_ptr. In addition to this, the usage mask 160 itself is saved, so that the identity of the saved value is known in the future.
[0040] FIG. 7 shows an example of saved registers as data in memory. The first item stored is a mask 160 containing four bytes. In this example, the mask is the value 00011010, indicating that registers MA0, MB0, MC1, MC2, and MC3 are obsolete and therefore will not be saved. The next item in the queue is the first saved register, MA1. This is followed by the second saved register, MB1. This is followed by the third saved register, MC0. Collectively, a total of 3076 bytes are saved (each of registers MA1, MB1, MC1 occupies 1024 bytes). This therefore produces a substantial savings in terms of both time and space. Specifically, space is saved because not all of the registers (many of which are obsolete and therefore not used) are saved. Furthermore, because not all registers are saved, the process of saving and loading registers is sped up. By saving the registers in this manner, the data can be read and the correct registers restored.
[0041] FIG. 8 illustrates an example of loading a context during a context switch when a register is being abandoned. Specifically, the first instruction kill_all clears all registers. This is performed to prevent data from being unintentionally transported from one thread (or application) to another thread (or application) as a result of a register by an incoming thread being abandoned. The second instruction then loads the data in context_ptr into register x0 and increments the context pointer. As shown in FIG. 7, this content is the previous value of mask 160 that was saved. In this example, the previous value of mask 160 is not directly restored, but instead is restored as a result of the "kill_all" instruction, followed by restoring the valid registers. Instruction 3 tests the mask to see if the first register is abandoned. If the register is abandoned, the process jumps to not_ma0. Otherwise, instruction 4 loads the data in context_ptr into register MA0 and increments context_ptr. In either case, in instruction 5, the mask is tested to see if the second register (MA1) is abandoned. If so, the process jumps to label not_ma1. If not, in instruction 6, the data stored in context_ptr is loaded into register MA1. Then context_ptr is incremented. This process continues for each of the registers, testing whether the particular register should be loaded or not, and if appropriate (e.g., the register is not abandoned according to the mask), the load is performed. As previously mentioned, abandoned registers mean that less data is transferred, which may reduce the time it takes to perform the transfer.
[0042] FIG. 9 shows a flowchart illustrating a method of data processing, according to some embodiments. Flowchart 900 begins at step 910 where data is stored in one or more registers. At step 920, an operation is performed using one or more of those registers. At step 930, a relinquish instruction is used to indicate that one or more of those registers are not currently being used. At step 940, execution of future instructions is performed by indicating that some of those registers are not being used. For example, this can take the form of a context switch that is executed more efficiently or using less space as a result of the registers being relinquished. Another example of this is the ability to speculatively execute instructions (even without the presence of renaming circuitry) as a result of some of those registers being relinquished.
[0043] In this application, the term "configured to" is used to mean that an element of an apparatus has a configuration that can perform a defined operation. In this context, "configuration" refers to an arrangement or method of interconnection of hardware or software. For example, an apparatus may have dedicated hardware that provides the defined operation, or a processor or other processing device may be programmed to perform the function. "Configured to" does not imply that an apparatus element must be modified in any way to provide the defined operation.
[0044] Although exemplary embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it should be understood that the invention is not limited to those precise embodiments, and various changes, additions, and modifications can be made by those skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims. For example, various combinations of the features of the dependent claims can be made with the features of the independent claims without departing from the scope of the invention.
Claims
1. A plurality of memory circuits for storing data; an execution circuit that performs one or more operations using the storage circuit in response to instructions; an issue circuit for receiving the instructions in stream order and issuing the instructions to the execution circuit in a permuted order other than the stream order; A data processing device comprising: The order includes a waiver order; the execution circuitry is adapted to respond to the relinquish command by storing a storage indication that at least one of the plurality of storage circuits is an unused storage circuit; the execution circuitry is adapted to affect execution of future instructions based on the storage indication that at least one of the plurality of storage circuits is the unused storage circuit after executing the relinquish instruction; the stream order being the abandon instruction, followed by a branch instruction, followed by a producer instruction; the branch instruction is predicted as executed; the producer instruction stores a second data value in the unused storage circuit; The modified order causes the producer instruction to issue before the branch instruction has completed.
2. 2. A data processing apparatus as claimed in claim 1, wherein a consumer instruction that reads a first data value from said unused storage circuit is executed over a number of processor cycles.
3. 2. The data processing apparatus of claim 1, wherein the consumer instruction that reads a first data value from said unused storage circuit is a matrix operation instruction.
Citation Information
Patent Citations
Information processing device and vector information processing device
JP2011018120A
Maintaining operand activity information within a computer system
JP2015501019A
Mechanism for freeing registers on processors that perform dynamic out-of-order execution of instructions using renaming registers
US20010004755A1
