Processor and computer system

The processor design addresses the challenge of implementing fewer physical registers by using virtual registers and dynamic management, allowing efficient instruction processing and maintaining software compatibility, thus overcoming the limitations of existing architectures.

WO2024185295A1PCT designated stage expired Publication Date: 2024-09-12SONY GROUP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/000624
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-09
Filing Date
2024-01-12
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

Existing processor architectures face challenges in implementing registers defined by an instruction set with fewer registers without significant changes, requiring new instructions and control circuits, which complicates software compatibility and maintenance.

Method used

A processor design that uses a register with a predetermined number of entries and virtual registers with more entries, incorporating an instruction processing unit, register access control unit, and control information to manage virtual registers, allowing for the execution of instructions using fewer physical registers by reading values from memory when needed, and dynamically managing register allocation to maintain software compatibility.

Benefits of technology

Enables efficient processing of instructions using fewer physical registers while minimizing changes to the processor architecture, maintaining software compatibility, and reducing development costs by leveraging existing memory and instruction sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024000624_12092024_PF_FP_ABST
    Figure JP2024000624_12092024_PF_FP_ABST
Patent Text Reader

Abstract

According to the present invention, registers defined in an instruction set are implemented using fewer registers, without a significant change in processor architecture. In the present invention, a register has a prescribed number of entries. An instruction processing unit executes an instruction that specifies, as an operand, a virtual register having more than the prescribed number of entries. A register access control unit determines whether or not the value of an entry in the virtual register specified as an operand in a specific instruction exists in the register. If it is detected that the value of the entry in the virtual register specified as the operand in the specific instruction does not exist in the register, an instruction control unit controls the instruction processing unit to read the entry value into the register from memory that stores the entry value.
Need to check novelty before this filing date? Find Prior Art

Description

Processor and Computer System

[0001] The present technology relates to processors, and more particularly to processors and computer systems that execute instructions that specify registers as operands.

[0002] Many processors specify registers defined in an instruction set as operands. These registers are implemented as high-speed, small-capacity storage units. Typically, the number of registers defined in an instruction set is equal to the number of implemented registers. On the other hand, in microprocessors with limited resources, such as those for embedded systems, it may be desirable to implement the registers defined in the instruction set with fewer registers. As a register virtualization technique for this type of processor, for example, a technique has been proposed in which a data memory consisting of multiple memory lines and a depth register that stores addresses corresponding to the memory lines are provided, and multiple register sets are used accordingly (see, for example, Patent Document 1).

[0003] Japanese Patent Application Publication No. 10-240525

[0004] In the above-mentioned conventional technology, multiple register sets are used by providing depth registers. However, this conventional technology requires the introduction of new dedicated processor instructions and control circuits to virtualize the registers, which not only entails a significant change in processor architecture but also makes it difficult to maintain software compatibility.

[0005] This technology was developed in light of these circumstances, and aims to implement registers defined in an instruction set with fewer registers without significantly changing the processor architecture.

[0006] The present technology has been made to solve the above-mentioned problems, and a first aspect thereof is a processor including an instruction processing unit that executes an instruction specifying, as an operand, a register having a predetermined number of entries and a virtual register having more than the predetermined number of entries, a register access control unit that determines whether the value of the entry of the virtual register specified as the operand in the specific instruction is present in the register, and an instruction control unit that controls the instruction processing unit to read the value of the entry from a memory that stores the entry into the register when it is detected that the value of the entry of the virtual register specified as the operand in the specific instruction is not present in the register, and a computer system including the processor. This brings about the effect of processing instructions using a register having a number of entries fewer than the number of entries of the virtual register.

[0007] In addition, in this first aspect, when it is detected that the value of the entry of the virtual register specified as the operand in the specific instruction is not present in the register, the instruction control unit may interrupt the specific instruction, execute an instruction to read the value of the entry from the memory to the register, and then execute the specific instruction again. This brings about the effect of reading a value required when processing an instruction using a register having fewer entries than the number of entries of the virtual register from the memory to the register.

[0008] In addition, in this first aspect, the instruction processing unit may include an instruction pipeline that sequentially executes the instructions through a plurality of pipeline stages, and when it is detected that the value of an entry of the virtual register specified as the operand in the specific instruction is not present in the register, the instruction control unit may temporarily flush the instruction pipeline including the specific instruction, insert an instruction into the instruction pipeline to read the value of the entry from the memory to the register, and then execute the specific instruction again. This provides the effect of reading a value required when processing an instruction through the instruction pipeline using a register having fewer entries than the number of entries of the virtual register from the memory to the register.

[0009] In addition, in this first aspect, the instruction processing unit may store in the memory a value of an entry of the virtual register that is not held in the register. In this case, when the instruction control unit detects that the value of the entry of the virtual register specified as the operand in the specific instruction is not present in the register, the instruction control unit may interrupt the specific instruction, execute a swap instruction that exchanges the value of the entry stored in the memory with the value held in the register, and then execute the specific instruction again. This provides the effect of reading a value required when processing an instruction using a register having fewer entries than the number of entries of the virtual register from the memory to the register using the swap instruction.

[0010] In addition, in this first aspect, the register access control unit may include control information indicating which entry of the virtual register is held for each entry of the register, and may determine whether or not the value of the entry of the virtual register specified as the operand is present in the register based on the control information. In this case, the register access control unit may manage the virtual registers by dividing them into a plurality of sets, and the control information may indicate which of the set of virtual registers is held for each entry of the register. This provides the effect of identifying a register entry when processing an instruction using a register having fewer entries than the number of entries of the virtual register.

[0011] In this first aspect, the register access control unit may include an entry conversion table that specifies entries that can be held in the virtual register for the virtual register, and may determine in which entry of the register the value of the entry of the virtual register specified as the operand exists, thereby achieving the effect of setting the entry corresponding to the virtual register and the register.

[0012] In this first aspect, the register access control unit may manage the register by dividing it into a plurality of indexes, and the entry conversion table may specify the index that can be held in the register for the virtual register, thereby providing an effect of facilitating management of entries in the register.

[0013] In addition, in this first aspect, the register access control unit may include history information for managing access frequency for each entry of the register, and may refer to the history information when selecting an entry of the register that holds the value of the entry of the virtual register, thereby achieving the effect of using an entry of a register that is less frequently accessed.

[0014] In this first aspect, the register access control unit may manage some entries of the virtual register so that they are always held in the register, thereby achieving the effect of making the values ​​of some entries of the virtual register resident in the register.

[0015] In addition, in this first aspect, the instruction processing unit may execute an instruction that specifies multiple types of virtual registers as operands, and a specific entry of the register may alternatively hold one of the values ​​of different types of virtual registers among the multiple types of virtual registers, thereby providing the effect of allowing the multiple types of virtual registers to share the register entry.

[0016] 1 is a block diagram showing an example of a configuration of a computer system according to an embodiment of the present technology. FIG. 2 is a diagram showing an example of a configuration of a memory 200 according to an embodiment of the present technology. FIG. 3 is a diagram showing an example of a relationship between a register 120 and a virtual register according to a first embodiment of the present technology. FIG. 4 is a diagram showing an example of control information 131 according to the first embodiment of the present technology. FIG. 5 is a diagram showing a first specific example of a relationship between a register 120 and a virtual register according to the first embodiment of the present technology. FIG. 6 is a diagram showing a second specific example of a relationship between a register 120 and a virtual register according to the first embodiment of the present technology. FIG. 7 is a flowchart showing an example of a register read operation of a computer system according to the first embodiment of the present technology. FIG. 8 is a time chart showing an example of a register read operation of a computer system according to the first embodiment of the present technology. FIG. 9 is a diagram showing an example of an entry conversion table 132 according to a second embodiment of the present technology. FIG. 10 is a diagram showing a first specific example of a relationship between a register 120 and a virtual register according to the second embodiment of the present technology. FIG. 11 is a diagram showing a second specific example of a relationship between a register 120 and a virtual register according to the second embodiment of the present technology. FIG. 12 is a diagram showing an example of history information 133 according to the second embodiment of the present technology. FIG. 13 is a flowchart showing an example of a process of changing entry allocation of a register 120 according to the second embodiment of the present technology. 10 is a diagram showing a specific example of a relationship between a register 120 and a virtual register in a third embodiment of the present technology; FIG. 11 is a diagram showing a first specific example of a relationship between a register 120 and a virtual register in a fourth embodiment of the present technology; FIG. 12 is a diagram showing a second specific example of a relationship between a register 120 and a virtual register in a fourth embodiment of the present technology;

[0017] Hereinafter, modes for carrying out the present technology (hereinafter referred to as embodiments) will be described. The description will be given in the following order: 1. First embodiment (an example in which a virtual register is held in a corresponding entry of a register) 2. Second embodiment (an example in which a corresponding entry of a register is dynamically changed) 3. Third embodiment (an example in which some entries of a register are used as resident entries) 4. Fourth embodiment (an example in which a register is shared by multiple types of virtual registers)

[0018] 1. First Embodiment Configuration of Computer System Fig. 1 is a block diagram showing an example of the configuration of a computer system according to an embodiment of the present technology. The computer system includes a processor 100 and a memory 200.

[0019] The processor 100 is a processing unit that executes instructions that specify a register as an operand, and includes an instruction pipeline 110, a register 120, a register access control unit 130, and an instruction control unit 140.

[0020] The instruction pipeline 110 is an instruction processing unit that sequentially executes each instruction in a program through multiple pipeline stages. This instruction pipeline 110 has four pipeline stages: a fetch unit (FE: Instruction Fetch) 111, a decode unit (DE: Instruction Decode) 112, an execution unit (EX: Execute) 113, and a write back unit (WB: Write Back) 114. The instruction pipeline 110 is an example of the instruction processing unit described in the claims.

[0021] The fetch unit 111 is a stage that reads instructions from the memory 200. The decode unit 112 is a stage that decodes the instructions read by the fetch unit 111 and, if necessary, reads values ​​of virtual registers designated as operands from the register 120. The execution unit 113 is a stage that executes instructions using the values ​​read by the decode unit 112. The write-back unit 114 is a stage that writes back the values ​​resulting from execution by the execution unit 113 to the register 120.

[0022] The register 120 is a physical register implemented in the processor 100. In this embodiment, the physical register implemented in the processor 100 is referred to as the register 120, and the virtual register defined in the instruction set is referred to as the virtual register.

[0023] The register access control unit 130 is a control unit that controls access to the register 120. In response to a request from the instruction pipeline 110, the register access control unit 130 determines whether or not the value of an entry of a virtual register specified as an operand in a specific instruction exists in the register 120. For this purpose, the register access control unit 130 is provided with control information, which will be described later.

[0024] The instruction control unit 140 is a control unit that controls the execution of instructions in the instruction pipeline 110 in response to instructions from the register access control unit 130. When the register access control unit 130 detects that the value of an entry in a virtual register does not exist in the register 120, the instruction control unit 140 controls the instruction pipeline 110 to read the value of the entry from the memory 200 that stores the value to the register 120.

[0025] FIG. 2 is a diagram showing an example of the configuration of the memory 200 according to the embodiment of the present technology.

[0026] The memory 200 is generally a memory that stores instructions, data, and the like required for program processing. In this embodiment, the memory 200 further stores virtual register values ​​not held in the register 120 in a reserved area 210. A start address 211 of this reserved area 210 is managed by the register access control unit 130 and is used when accessing between the register 120 and the memory 200. The value of the start address 211 of the reserved area 210 is determined, for example, when the processor is implemented. In this case, the value is described in the processor specifications or the like. Alternatively, a special register may be added and the value of the start address 211 may be stored in that register. In this case, the value of the start address 211 can be changed even after the processor is implemented.

[0027] [Relationship Between Register and Virtual Register] FIG. 3 is a diagram showing an example of the relationship between the register 120 and the virtual register in the first embodiment of the present technology.

[0028] In this example, the virtual registers are divided into two sets, and the values ​​of entries in one of the sets are held in the corresponding entries of the register 120. On the other hand, the values ​​of entries in the set that are not held are stored in the reserved area 210 of the memory 200.

[0029] For example, the 32-entry virtual register is divided into a first half set (0th to 15th entries) and a second half set (16th to 31st entries), which correspond to the respective entries of the 16-entry register 120. That is, either the 0th or 16th entry of the virtual register is held in the 0th entry of the register 120, and the other is stored in the 0th entry of the reserved area 210 of the memory 200. Also, either the 1st or 17th entry of the virtual register is held in the first entry of the register 120, and the other is stored in the first entry of the reserved area 210 of the memory 200. Similarly, either the 2nd to 15th or 18th to 31st entries of the virtual register are held in the 2nd to 15th entries of the register 120, respectively, and the other is stored in the 2nd to 15th entries of the reserved area 210 of the memory 200, respectively.

[0030] That is, in this example, for each entry of register 120, the relative entry within each set of virtual registers is fixed, and once the set to be held is identified, it is uniquely determined which entry of the virtual register it corresponds to.

[0031] When the instruction pipeline 110 detects that the value of an entry in a virtual register designated as an operand does not exist in the register 120, the instruction is suspended and the value of that entry stored in the reserved area 210 of the memory 200 is swapped with the value held in the register 120. For this purpose, a swap instruction can be used that swaps the value of a specific entry in the register 120 with the value stored in the memory 200. If such an instruction is not provided in the processor instruction set, a combination of general load / store instructions between the memory 200 and the register 120 may be used.

[0032] FIG. 4 is a diagram illustrating an example of the control information 131 according to the first embodiment of the present technology.

[0033] The control information 131 indicates which entry of the virtual register is held for each entry of the register 120. In other words, each entry of the register 120 selectively holds an entry of the virtual register. Therefore, in a broad sense, it is also possible to directly specify the entry number of the virtual register using the control information 131. However, in that case, for a 32-entry virtual register, 5-bit control information 131 is required for each of the 16 entries. Therefore, in the following specific example, the virtual register is divided into two sets as in the above example, and the order of the entries within a set is treated as fixed. As a result, the control information 131 only needs to have a 1-bit flag for each of the 16 entries.

[0034] The control information 131 may be provided in the register access control unit 130, for example, or may be implemented as an attachment to the register 120.

[0035] FIG. 5 is a diagram showing a first specific example of the relationship between the register 120 and the virtual register in the first embodiment of the present technology.

[0036] In this example, the virtual registers are divided into two sets, and a 1-bit flag is provided for each of the 16 entries as control information 131 to indicate which set of virtual registers is held in each entry. Specifically, if the value held in control information 131 is "0," it indicates that the value of the first half of the set of virtual registers is held in the corresponding entry in register 120, and if the value is "1," it indicates that the value of the second half of the set of virtual registers is held in the corresponding entry in register 120. The value of the other set is stored in the corresponding entry in reserved area 210 of memory 200.

[0037] For example, if the value of the 0th entry of the control information 131 is "1," then "data

[16] " of the 16th entry of the latter set of virtual registers is held in the 0th entry of the register 120. In this case, "data

[00] " of the 0th entry of the first set of virtual registers is stored in the 0th entry of the reserved area 210 of the memory 200.

[0038] At this time, when the 16th entry of the virtual register is accessed in the instruction pipeline 110, reading and writing are performed in the 0th entry of the register 120. On the other hand, when the 0th entry of the virtual register is accessed in the instruction pipeline 110, a process of exchanging values ​​between the 0th entry of the register 120 and the 0th entry of the reserved area 210 of the memory 200 is performed, and then a read is performed from the 0th entry of the register 120.

[0039] FIG. 6 is a diagram showing a second specific example of the relationship between the register 120 and the virtual register in the first embodiment of the present technology.

[0040] In this example, the virtual registers are divided into four sets, and the control information 131 has 2-bit information for each of the eight entries, indicating which set of virtual registers is held in each entry. Specifically, if the value held in the control information 131 is "00," it indicates that the values ​​of the 0th set of virtual registers are held in the corresponding entry of the register 120; if it is "01," it indicates that the values ​​of the 1st set of virtual registers are held in the corresponding entry of the register 120; if it is "10," it indicates that the values ​​of the 2nd set of virtual registers are held in the corresponding entry of the register 120; and if it is "11," it indicates that the values ​​of the other sets are stored in the corresponding three entries of the reserved area 210 of the memory 200.

[0041] For example, if the value of the 0th entry of the control information 131 is "10," then "data

[16] " of the 16th entry of the second set of virtual registers is held in the 0th entry of the register 120. In this case, "data

[00] " of the 0th entry of the 0th set of virtual registers is stored in the 0th entry of the reserved area 210 of the memory 200, "data

[08] " of the 0th entry of the first set of virtual registers is stored in the 8th entry of the reserved area 210 of the memory 200, and "data

[24] " of the 0th entry of the third set of virtual registers is stored in the 24th entry of the reserved area 210 of the memory 200.

[0042] At this time, when the 16th entry of the virtual register is accessed in the instruction pipeline 110, reading and writing are performed in the 0th entry of the register 120. On the other hand, when the 8th entry of the virtual register is accessed in the instruction pipeline 110, a process of exchanging values ​​between the 0th entry of the register 120 and the 8th entry of the reserved area 210 of the memory 200 is performed, and then a read is performed from the 0th entry of the register 120.

[0043] 7 is a flowchart showing an example of a register read operation of the computer system according to the first embodiment of the present technology. Note that the same operation is possible for a register write operation.

[0044] When a read access to a virtual register designated as an operand occurs in the instruction pipeline 110 (step S911), the control information 131 of the corresponding entry is referenced (step S912). Then, based on the referenced control information 131, it is determined whether the value of the virtual register exists in the register 120 (step S913).

[0045] As a result, if it is determined that the value of the virtual register does not exist in the register 120 (step S913: No), the instruction control unit 140 suspends the instruction involving the read access and inserts a swap instruction into the instruction pipeline 110 (step S914). As a result, the instruction pipeline 110 executes the swap instruction to swap the values ​​of corresponding entries between the register 120 and the reserved area 210 of the memory 200 (step S915). Note that if it is determined that the value of the virtual register exists in the register 120 (step S913: Yes), such a swap instruction is not executed.

[0046] Then, the instruction pipeline 110 resumes the interrupted instruction involving the read access and executes the read access to the register 120 (step S916).

[0047] FIG. 8 is a time chart showing an example of a register read operation of the computer system according to the first embodiment of the present technology.

[0048] Assume the four pipeline stages described above. Instructions are executed one by one in sequence starting from clock cycle "01," and instruction X is input to the fetch unit 111 at clock cycle "03." For this instruction X, at clock cycle "04," the decode unit 112 attempts to read the value of the virtual register specified as an operand.

[0049] In this example, it is assumed that the value of the virtual register specified as the operand of instruction X is not present in the register 120. Therefore, in clock cycle "05", the instruction control unit 140 temporarily flushes the instruction pipeline 110. As a result, the processing of instruction X and the next instruction, instruction Y, is canceled. Then, the instruction control unit 140 dynamically inserts a swap instruction into the instruction pipeline 110. Following this swap instruction, in clock cycle "06", the instruction X that was previously flushed is input again into the instruction pipeline 110. However, instruction X remains in the fetch unit 111 until the target value of instruction X is prepared in the register 120.

[0050] When the swap instruction writes its result to register 120 in clock cycle "08", instruction X reads the value of the virtual register specified as an operand of instruction X from register 120 in clock cycle "09". Instruction Y, which is the next instruction after instruction X, is also processed by fetch unit 111 in clock cycle "09". In this way, the subsequent instructions are executed sequentially.

[0051] As described above, in the first embodiment of the present technology, values ​​that are not held in the registers 120 are stored in the reserved area 210 of the memory 200, and virtual registers that exceed the size of the registers 120 are treated as an instruction set. To this end, control information 131 indicating which entry of the virtual register is held is provided for each entry of the register 120. This makes it possible to implement virtual registers defined by an instruction set with a smaller number of registers 120 without significantly changing the processor architecture.

[0052] That is, in this first embodiment, by using the existing memory 200 and memory operation instructions, it is possible to virtualize the register 120 while minimizing additional control circuitry. Also, by dynamically inserting the swap instruction into the instruction pipeline 110, it is not necessary to change the existing software or instruction set, so software compatibility can be maintained and software development costs can be reduced.

[0053] 2. Second Embodiment In the first embodiment described above, the arrangement of virtual register entries in the register 120 was fixed. In contrast, in the second embodiment, an entry conversion table is provided to dynamically change the arrangement in the register 120. Note that the basic configuration of the computer system is the same as in the first embodiment described above, so detailed description will be omitted.

[0054] [Entry Conversion Table] FIG. 9 is a diagram showing an example of the entry conversion table 132 according to the second embodiment of the present technology.

[0055] The entry conversion table 132 specifies entries that can be held in the register 120 in correspondence with the entries of the virtual register. Therefore, in a broad sense, it is also possible to directly specify the entry number of the register 120. In that case, however, in the above example, a 4-bit wide entry conversion table 132 is required for each of the 32 entries of the 16-entry register 120. Therefore, in the following specific example, the register 120 is divided into four indexes, each with four entries, and the virtual register is also configured so that an index of the register 120 is specified for each of the four entries.

[0056] The entry conversion table 132 is provided in, for example, the register access control unit 130 , and the register access control unit 130 identifies the corresponding entry in the register 120 based on the entry conversion table 132 .

[0057] [Relationship Between Registers and Virtual Registers] FIG. 10 is a diagram showing a first specific example of the relationship between the registers 120 and virtual registers in the second embodiment of the present technology.

[0058] In this example, the register 120 is divided into four indexes, each with four entries, and the virtual register is also configured so that every four entries specify an index of the register 120. That is, in this first specific example, the entry conversion table 132 has eight 2-bit entries that specify an index of the register 120.

[0059] This allows the virtual register to specify the placement in the register 120 for every four entries. However, the order within the index is uniquely fixed. For example, "data

[00] " of the zeroth entry of the virtual register is placed in the zeroth entry of the register 120 if the index is #0, the fourth entry of the register 120 if the index is #1, the eighth entry of the register 120 if the index is #2, and the twelfth entry of the register 120 if the index is #3.

[0060] FIG. 11 is a diagram showing a second specific example of the relationship between the register 120 and the virtual register in the second embodiment of the present technology.

[0061] In this example, entry conversion is not performed on the first half of the virtual register, and entry conversion is performed only on the second half of the virtual register. Therefore, in this second specific example, the entry conversion table 132 only needs to have four 2-bit entries that specify the index of the register 120, and an entry conversion table 132 that is half the size of the first specific example described above will suffice.

[0062] In this way, in the second embodiment, the entry conversion table 132 is provided, thereby making it possible to specify the placement in the register 120. In order to dynamically change the allocation of entries using this mechanism, history information can be used as follows.

[0063] [History Information] FIG. 12 is a diagram showing an example of the history information 133 according to the second embodiment of the present technology.

[0064] The history information 133 manages the access frequency for each entry in the register 120. The value of this history information 133 can be, for example, a 1-bit flag, which can hold "1" if an access occurs to each entry in the register within a predetermined time period, and "0" otherwise. Alternatively, for example, the number of accesses to each entry in the register 120 within a predetermined period can be counted.

[0065] The history information 133 is provided in, for example, the register access control unit 130. The register access control unit 130 refers to the history information 133 to replace it with another index. If a 1-bit flag is assumed as the value of the history information 133, the register access control unit 130 refers to the value of the history information 133 to select the first entry found that has not been accessed for a predetermined period of time and replace it with another index. If the value of the history information 133 is assumed to be a count of the number of accesses, the register access control unit 130 selects an entry of the register 120 that is accessed less frequently and replaces it with another index.

[0066] FIG. 13 is a flowchart showing an example of a process for changing the entry allocation of the register 120 according to the second embodiment of the present technology.

[0067] When a data exchange process occurs between the register 120 and the reserved area 210 of the memory 200 (step S921: Yes), the index value of the entry conversion table 132 corresponding to the register 120 on which the exchange process was performed is retained as IDX1 (step S922).

[0068] Next, the target entry is searched for by referencing the history information 133 of each entry (step S923). At this time, if the value of the history information 133 is, for example, a 1-bit flag, then an entry that has not been accessed within a certain period of time is searched for. Furthermore, if the value of the history information 133 is, for example, a count of the number of accesses, then the entry with the lowest access frequency is searched for. If a target entry is found (step S924: Yes), then the index value of that entry is stored as IDX2 (step S925). Note that entries with the same access frequency do not need to be swapped, and therefore do not qualify as the target entry.

[0069] The values ​​stored in the entries of the entry conversion table 132 corresponding to the IDX1 and IDX2 obtained in this way are swapped (step S926). Then, the values ​​stored in the entries of the register 120 corresponding to the entries of the entry conversion table 132 are swapped (step S927). The processing of step S927 can be realized by dynamically inserting an instruction to swap the data in the entries of the register 120 into the instruction pipeline.

[0070] By repeatedly executing the above-described replacement algorithm, the allocation of entries is maintained in an optimal state that reflects the characteristics of the program, and conflicts between entries in the register 120 can be avoided.

[0071] As described above, according to the second embodiment, contention in the register 120 can be avoided by dynamically changing the arrangement in the register 120 using the entry conversion table 132 based on the history information 133 .

[0072] 3. Third Embodiment In an instruction set architecture, when special registers such as stack pointers and return addresses are defined as virtual registers, they are frequently used in programs, which may increase the frequency of entry conflicts. Additionally, if a register with a high usage frequency is known in advance, it is desirable to prevent the entry of that virtual register from being shared with other entries. Therefore, in this third embodiment, it is assumed that only some of the entries in the register 120 are shared between virtual registers. The basic configuration of the computer system is the same as that of the first embodiment, and therefore a detailed description thereof will be omitted.

[0073] [Relationship Between Register and Virtual Register] FIG. 14 is a diagram showing a specific example of the relationship between the register 120 and the virtual register in the third embodiment of the present technology.

[0074] In this example, the virtual registers are divided into a first half (0th to 15th entries) and a second half (16th to 31st entries), and the second half is further divided into two sets (16th to 23rd entries and 24th to 31st entries). In addition, the registers 120 are provided as fixed registers with 16 entries and shared registers with 8 entries.

[0075] The first half of the virtual register is fixedly allocated to a fixed register in the register 120 and is not shared with other virtual registers. This allows the value of the entry in the first half of the virtual register to be managed so that it is always held in the fixed register in the register 120. In other words, the fixed register in the register 120 is used as a permanent resident for the entry in the first half of the virtual register.

[0076] On the other hand, the latter half of the virtual register is alternatively held in the shared register of the register 120. Therefore, the control information 131 is provided only for the shared register of the register 120, and is not necessary for the fixed register of the register 120. Note that the control information 131 used for the shared register of the register 120 is the same as that in the first embodiment described above, and therefore a detailed description thereof will be omitted.

[0077] In this way, according to the third embodiment, by implementing the registers 120 that are frequently used in a program so as not to be shared, it is possible to avoid contention of virtual register entries.

[0078] 4. Fourth Embodiment Some processors assume multiple types of registers as part of their instruction set. For example, there are cases where integer operation registers (GPRs) and vector operation registers (VRs) are separately provided. In this fourth embodiment, it is assumed that these multiple different types of registers are assigned to the register 120 as virtual registers and shared. Note that the basic configuration of the computer system is the same as that of the first embodiment, and therefore a detailed description thereof will be omitted.

[0079] [Relationship Between Register and Multiple Types of Virtual Registers] FIG. 15 is a diagram showing a first specific example of the relationship between the register 120 and virtual registers according to the fourth embodiment of the present technology.

[0080] In this example, each entry of the 32-entry register 120 holds the value of a corresponding entry in either the 32-entry virtual general-purpose registers or the 32-entry virtual vector registers. That is, the register 120 is shared by the virtual general-purpose registers and the virtual vector registers. This allows the register 120 to be efficiently shared for program execution when the usage rate of entries for multiple types of registers, such as the virtual general-purpose registers and the virtual vector registers, is not high.

[0081] FIG. 16 is a diagram showing a second specific example of the relationship between the register 120 and the virtual register in the fourth embodiment of the present technology.

[0082] In this example, the first half of the virtual general-purpose registers and the first half of the virtual vector registers (entries 0 to 15) do not share entries but are provided as separate registers 120. On the other hand, the second half of the virtual general-purpose registers and the first half of the virtual vector registers (entries 16 to 31) share the register 120. In other words, it is possible to share part of the register 120 in this way.

[0083] As described above, according to the fourth embodiment, by sharing the entries of the register 120 by a plurality of types of virtual registers, it is possible to execute a program while reducing hardware resources and maintaining execution performance.

[0084] Note that the above-described embodiment shows an example for realizing the present technology, and the matters in the embodiment and the matters specifying the invention in the claims correspond to each other. Similarly, the matters specifying the invention in the claims and the matters in the embodiment of the present technology having the same name correspond to each other. However, the present technology is not limited to the embodiment, and can be realized by applying various modifications to the embodiment within the scope of the gist thereof.

[0085] The processing procedures described in the above embodiments may be considered as a method having a series of these procedures, or as a program for causing a computer to execute the series of procedures, or as a recording medium for storing the program. Examples of such a recording medium include a CD (Compact Disc), an MD (MiniDisc), a DVD (Digital Versatile Disc), a memory card, and a Blu-ray (registered trademark) Disc.

[0086] The effects described in this specification are merely examples and are not limiting, and other effects may also be present.

[0087] The present technology may also be configured as follows: (1) A processor comprising: a register having a predetermined number of entries; an instruction processing unit that executes an instruction specifying, as an operand, a virtual register having more than the predetermined number of entries; a register access control unit that determines whether the value of the entry of the virtual register specified as the operand in a specific instruction is present in the register; and an instruction control unit that controls the instruction processing unit to read the value of the entry from a memory that stores the entry into the register when it is detected that the value of the entry of the virtual register specified as the operand in the specific instruction is not present in the register. (2) The processor according to (1), wherein, when it is detected that the value of the entry of the virtual register specified as the operand in the specific instruction is not present in the register, the instruction control unit interrupts the specific instruction and executes an instruction to read the value of the entry from the memory to the register, and then executes the specific instruction again. (3) The processor according to (1), wherein the instruction processing unit includes an instruction pipeline that sequentially executes the instructions through a plurality of pipeline stages, and when it is detected that the value of the entry of the virtual register specified as the operand in the specific instruction does not exist in the register, the instruction control unit temporarily flushes the instruction pipeline including the specific instruction, inserts an instruction into the instruction pipeline that reads the value of the entry from the memory to the register, and then executes the specific instruction again. (4) The processor according to any of (1) to (3), wherein the instruction processing unit stores, in the memory, a value of the entry of the virtual register that is not held in the register. (5) The processor according to (4), wherein, when it is detected that the value of the entry of the virtual register specified as the operand in the specific instruction does not exist in the register, the instruction control unit interrupts the specific instruction, executes a swap instruction that swaps the value of the entry stored in the memory with the value held in the register, and then executes the specific instruction again.(6) The processor according to any one of (1) to (5), wherein the register access control unit comprises control information indicating which entry of the virtual register is held for each entry of the register, and determines whether the value of the entry of the virtual register specified as the operand is present in the register based on the control information. (7) The processor according to (6), wherein the register access control unit manages the virtual registers by dividing them into a plurality of sets, and the control information indicates which of the set of the virtual registers is held for each entry of the register. (8) The processor according to any one of (1) to (7), wherein the register access control unit comprises an entry conversion table that specifies, for each virtual register, entries that can be held in the register, and determines in which entry of the register the value of the entry of the virtual register specified as the operand is present. (9) The processor according to (8), wherein the register access control unit manages the registers by dividing them into a plurality of indexes, and the entry conversion table specifies the indexes that can be held in the register for each virtual register. (10) The processor according to (8) or (9), wherein the register access control unit includes history information for managing access frequency for each entry of the register, and refers to the history information when selecting an entry of the register that holds a value of the entry of the virtual register. (11) The processor according to any of (1) to (10), wherein the register access control unit manages some entries of the virtual register so that they are always held in the register. (12) The processor according to any of (1) to (11), wherein the instruction processing unit executes an instruction that specifies multiple types of virtual registers as operands, and a specific entry of the register selectively holds a value of one of different types of virtual registers from the multiple types of virtual registers.(13) A computer system comprising: a register having a predetermined number of entries; an instruction processing unit that executes an instruction that specifies, as an operand, a virtual register having more than the predetermined number of entries; a memory that stores a value of a specific entry of the virtual register; a register access control unit that determines whether the value of the entry of the virtual register specified as the operand in the specific instruction exists in the register; and an instruction control unit that controls the instruction processing unit to read the value of the entry from the memory that stores it into the register when it is detected that the value of the entry of the virtual register specified as the operand in the specific instruction does not exist in the register.

[0088] 100 Processor 110 Instruction pipeline 111 Fetch unit (FE: Instruction Fetch) 112 Decode unit (DE: Instruction Decode) 113 Execute unit (EX: Execute) 114 Write back unit (WB: Write Back) 120 Register 130 Register access control unit 131 Control information 132 Entry conversion table 133 History information 140 Instruction control unit 200 Memory 210 Reserved area 211 Start address of reserved area

Claims

1. A processor comprising: a register having a predetermined number of entries; an instruction processing unit that executes an instruction that specifies as an operand a virtual register having more than the predetermined number of entries; a register access control unit that determines whether the entry value of the virtual register specified as the operand in a specific instruction is present in the register; and an instruction control unit that controls the instruction processing unit to read the entry value from a memory that stores the entry value into the register when it is detected that the entry value of the virtual register specified as the operand in the specific instruction is not present in the register.

2. A processor as described in claim 1, wherein when the instruction control unit detects that the value of an entry of the virtual register specified as the operand in the specific instruction is not present in the register, it interrupts the specific instruction, executes an instruction to read the value of the entry from the memory to the register, and then executes the specific instruction again.

3. The processor of claim 1, wherein the instruction processing unit includes an instruction pipeline which sequentially executes the instructions through a plurality of pipeline stages, and when the instruction control unit detects that the value of an entry of the virtual register specified as the operand in the specific instruction is not present in the register, the instruction control unit flushes the instruction pipeline including the specific instruction once, inserts an instruction into the instruction pipeline to read the value of the entry from the memory to the register, and then re-executes the specific instruction.

4. The processor according to claim 1, wherein said instruction processing unit stores in said memory, among the values ​​of the entries of said virtual register, values ​​of entries that are not held in said register.

5. A processor as described in claim 4, wherein when the instruction control unit detects that the value of an entry of the virtual register specified as the operand in the specific instruction is not present in the register, it interrupts the specific instruction, executes a swap instruction that exchanges the value of the entry stored in the memory with the value held in the register, and then executes the specific instruction again.

6. The processor according to claim 1, wherein the register access control unit has control information indicating which entry of the virtual register is held for each entry of the register, and determines whether or not the value of the entry of the virtual register specified as the operand is present in the register based on the control information.

7. The processor according to claim 6, wherein the register access control unit manages the virtual registers by dividing them into a plurality of sets, and the control information indicates, for each entry of the register, which of the sets of the virtual registers is held.

8. The processor according to claim 1, wherein the register access control unit includes an entry conversion table that specifies entries that can be held in the virtual register for the virtual register, and determines in which entry of the register the value of the entry of the virtual register specified as the operand exists.

9. The processor according to claim 8, wherein the register access control unit manages the register by dividing it into a plurality of indexes, and the entry translation table specifies the index that can be held in the register for the virtual register.

10. The processor according to claim 8, wherein the register access control unit includes history information for managing the access frequency for each entry of the register, and refers to the history information when selecting an entry of the register that holds the value of the entry of the virtual register.

11. The processor according to claim 1, wherein said register access control unit manages some of the entries of said virtual register so that they are always held in said register.

12. The processor according to claim 1, wherein the instruction processing unit executes an instruction that specifies multiple types of virtual registers as operands, and a specific entry of the register selectively holds one of the values ​​of different types of virtual registers among the multiple types of virtual registers.

13. A computer system comprising: a register having a predetermined number of entries; an instruction processing unit that executes an instruction specifying as an operand a virtual register having more than the predetermined number of entries; a memory that stores a value of a specific entry of the virtual register; a register access control unit that determines whether the entry value of the virtual register specified as the operand in the specific instruction is present in the register; and an instruction control unit that controls the instruction processing unit to read the entry value from the memory that stores it into the register when it is detected that the entry value of the virtual register specified as the operand in the specific instruction is not present in the register.

Citation Information

Patent Citations

  • Information processor

    JP1990118729A

  • System and method for using a virtual vector register file

    JP2019519843A