A method and system for renaming instructions related to fixed constants

MYUI2022006161UUndetermined Publication Date: 2022-09-22GUANGDONG STARFIVE TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
MYUI2022006161
Authority / Receiving Office
MY · MY
Patent Type
Utility models
Current Assignee / Owner
Priority Date
2021-06-30
Filing Date
2021-11-04
Publication Date
2022-09-22
Estimated Expiration
2041-11-04

AI Technical Summary

Technical Problem

Existing microprocessors cannot classify instructions for execution, resulting in all instructions being unified to the execution unit for execution, failing to eliminate the execution of invalid instructions, and affecting CPU performance.

Method used

Through a renaming method of instructions related to fixed constants, the decoder classifies instructions, filters out instructions with fixed constants, and maps their source registers and destination registers to different fixed constant physical registers in the renaming stage, updating the registers Rename the mapping table and release the physical register corresponding to the fixed constant, thereby realizing the function of the instruction without entering the execution unit for execution.

Benefits of technology

It implements classification processing of instructions, and fixed constant instructions do not need to enter the execution unit for execution, which improves instruction execution efficiency, saves physical register resources, and improves CPU performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure UI2022006161_DRAWING_001
    Figure UI2022006161_DRAWING_001
  • Figure UI2022006161_DRAWING_002
    Figure UI2022006161_DRAWING_002
  • Figure UI2022006161_DRAWING_003
    Figure UI2022006161_DRAWING_003
Patent Text Reader

Abstract

The invention relates to the technical field of microprocessors, in particular to a renaming method and system of fixed constant related instructions. The invention classifies the instructions in the decoder according to the characteristics of the instructions, and selects the instructions with fixed constants. In the renaming stage, the invention maps the source register and the destination register of such instructions to different fixed constant physical registers according to different fixed constants, updates the register renaming mapping tables SPEC_MAP and ARCH_MAP, and releases the physical registers corresponding to the fixed constant when the instruction is submitted, thereby realizing the function of the instruction. It solves the problem that the existing microprocessor can not classify the instructions, all the instructions are unified to the execution unit, and the execution of invalid instructions can not be eliminated. The invention classifies the instruction, and the fixed constant instruction does not need to enter the execution unit, but realizes the execution of the instruction through the renaming method, and the instruction execution efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

A method and system for renaming fixed constant related instructions Technical Field

[0001] The present invention relates to the technical field of microprocessors, and in particular to a method and system for renaming fixed constant related instructions. Background Art

[0002] Microprocessors have undergone over 50 years of development, and their architecture has undergone rapid evolution alongside semiconductor technology. From single-core to physical and logical multi-core; from in-order to out-of-order execution; from single-issue to multi-issue... Especially in the server sector, processor performance is constantly being pursued. As data centers and scientific computing requirements become increasingly demanding, the performance requirements for division and remainder instructions are also increasing, and their proportion in the instruction set is also gradually increasing. Division and remainder instructions have relatively long execution cycles, and their execution cycle is also data-dependent and variable. These factors significantly impact CPU performance.

[0003] Existing microprocessors cannot classify and execute instructions. All instructions are uniformly executed by the execution unit, and the execution of invalid instructions cannot be eliminated.

[0004] Summary of the Invention

[0005] In response to the deficiencies of the prior art, the present invention discloses a method and system for renaming fixed constant related instructions, which is used to solve the problem that the existing microprocessor cannot classify and execute instructions, all instructions are unified to the execution unit for execution, and the execution of invalid instructions cannot be eliminated.

[0006] The present invention is achieved through the following technical solutions:

[0007] In a first aspect, the present invention discloses a method for renaming fixed constant related instructions, comprising the following steps:

[0008] The S1 decoder classifies instructions according to their characteristics and filters out instructions with fixed constants;

[0009] In the renaming phase, S2 maps the source and destination registers of the filter instructions in S1 to different fixed constant physical registers according to different fixed constants;

[0010] S3 updates the register renaming mapping tables SPEC_MAP and ARCH_MAP, and releases the physical registers corresponding to fixed constants when the instruction is submitted;

[0011] The S4 instruction reads the physical register file according to the physical register of the source register or obtains the source operand through the instruction execution result of the forward channel of the execution unit;

[0012] When the S5 instruction is completed in the execution unit, it writes the physical register file according to the physical register of the destination register;

[0013] S6 sends the result of the Forward instruction execution to the pipeline, and obtains the result of the instruction execution by the dependent instruction, thereby realizing the function of the instruction.

[0014] Furthermore, in the method, each instruction obtains the physical register corresponding to the source operand and the physical register of the destination register in the renaming stage. The physical register of the source register is obtained from the renaming mapping table or the free physical register queue according to the relevance of the instruction, and the physical register of the destination register is a newly allocated free physical register, obtained from the free physical register queue.

[0015] Furthermore, in the method, before register renaming, based on the characteristics of the instruction, it is determined whether the source operand or destination register of the instruction is a fixed constant, and whether the fixed constant value 0, constant value 1, constant value, constant value e, and the logarithm Loge(2) with the constant e as the base 2 frequently appear in the instruction.

[0016] Furthermore, in the method, it is assumed that fixed constant determination is performed simultaneously on instructions inst0, inst1, inst2, and inst3 in the renaming phase to determine whether the source operand and destination operand of inst0 are fixed constants CONST0, CONST1, CONST2, ..., CONSTN-1. When R1_0 or R2_0 in inst0 is a fixed constant, the physical register of R1_0 or R2_0 is mapped to the location of the fixed constant.

[0017] Assume that when R1_0 is a fixed constant CONST0, the value of the physical register is 0;

[0018] Assume that when R1_0 is a fixed constant CONST1, the value of the physical register is 1;

[0019] Assume that when R1_0 is a fixed constant CONST2, the value of the physical register is 2;

[0020] Assume that when R1_0 is a fixed constant CONSTN-1, the value of the physical register is N-1.

[0021] Furthermore, in the method, R2_0 is judged. If it can be determined that the execution result of inst0 is a fixed constant, inst0 does not need to apply for a new free physical register. inst0 maps the SPEC_MAP and ARCH_MAP of RD_0 to the position of the fixed constant, and releases the physical register of RD_0 that is retired in ARCH_MAP; when it is determined that the execution result of inst0 is a constant, the physical register of RD_0 is mapped to the physical register of this fixed constant. When implementing a specific instruction set, it is determined whether the source operand of the instruction, that is, the destination register, is a fixed constant based on the characteristics of the instruction.

[0022] Furthermore, in the method, it is determined whether the source operands and destination operations of inst1, inst2, and inst3 are fixed constants CONST0, CONST1, CONST2, ..., CONSTN-1. If R1_1 or R2_1 is a fixed constant, R1_1 or R2_1 is mapped to the corresponding fixed constant. When R1_1 is a fixed constant 0 and R2_1 is not a fixed constant, if inst1 is a MOV instruction at this time, and R2_1 is exactly equal to RD_0, and RD_0 is mapped to a fixed constant, then the physical register of inst1 is RD_1 is also mapped to the fixed constant mapped by RD_0. RD_0 and RD_1 are mapped to the same fixed constant. The architectural registers of RD_0 and R2_1 are mapped to the physical register addresses of the fixed constants. The mapping relationship between RD_0 and R2_1 in SPEC_MAP and ARCH_MAP is updated. The judgment process of Inst2 is exactly the same as that of inst0 and inst. It needs to judge whether inst2 has the same fixed constant as inst0 and inst1. Inst3 also needs to judge whether inst3 has the same fixed constant as inst0, inst1 and inst2.

[0023] Furthermore, in the method, the instruction includes source operands and destination registers. Before the instruction enters the execution unit for execution, all source operands need to be obtained. After the operands of the instruction in the reservation station are prepared, it is sent to the execution unit for execution. After the execution is completed, the execution result is written to the destination register and submitted in order.

[0024] In a second aspect, the present invention discloses a renaming system for fixed constant related instructions, which is used to execute the renaming method for fixed constant related instructions described in the first aspect, and includes a register, a decoder, and an execution unit.

[0025] Furthermore, the registers include architectural registers and physical registers. In the renaming stage, the architectural register of the instruction destination register is mapped to a physical register and updated to the renaming mapping table SPEC_MAP. After the instruction is executed, it is submitted in order in the reorder cache, and the architectural register mapping of the instruction destination register is updated to ARCH_MAP.

[0026] The beneficial effects of the present invention are:

[0027] The present invention classifies and processes instructions, and instructions with fixed constants do not need to enter an execution unit, but are executed by a renaming method, thereby achieving high instruction execution efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] FIG1 is a diagram illustrating an instruction format definition according to an embodiment of the present invention;

[0030] FIG2 is a register renaming map according to an embodiment of the present invention;

[0031] FIG3 is a register constant mapping diagram according to an embodiment of the present invention;

[0032] FIG4 is a flowchart illustrating an embodiment of the present invention in which the destination register is a fixed constant;

[0033] FIG5 is a diagram showing a dependency relationship between constant-related instructions according to an embodiment of the present invention;

[0034] FIG6 is a physical register mapping diagram of a RISC V instruction instance according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0036] Example 1

[0037] This embodiment discloses a new method for implementing instructions with fixed constants through renaming. The decoder classifies instructions based on their characteristics, screening out instructions with fixed constants. During the renaming phase, the source and destination registers of these instructions are mapped to different physical registers with fixed constants based on the different fixed constants. The register renaming mapping tables SPEC_MAP and ARCH_MAP are updated, and the physical registers corresponding to the fixed constants are released when the instruction is submitted, thereby implementing the instruction's functionality.

[0038] Different instruction sets define different instruction formats. Regardless of the instruction set, the register-related instruction format is shown in Figure 1. An instruction consists of source operands src0, src1, ..., and destination registers rd1, rd2, .... Before an instruction enters the execution unit, all source operands must be available. After the operands in the reservation station are prepared, the instruction is dispatched to the execution unit for execution. After execution is complete, the result is written to the destination register and committed in order.

[0039] In a processor architecture that supports out-of-order execution, each instruction obtains the physical register corresponding to the source operand and the destination register in the renaming stage. The physical register of the source register is obtained from the renaming mapping table or the free physical register queue based on the relevance of the instruction. The physical register of the destination register is a newly allocated free physical register, that is, obtained from the free physical register queue. The instruction obtains the source operand by reading the physical register stack according to the physical register of the source register or through the instruction execution result of the forward channel of the execution unit. When the instruction is executed in the execution unit, it writes to the physical register stack according to the physical register of the destination register, and at the same time, the execution result of the forward instruction is sent to the pipeline, and the instruction execution result is obtained by the dependent instruction.

[0040] Assume that the architectural registers for the instructions are r0, r1, r2, r3, ..., r31. During the renaming phase, the architectural register of the instruction's destination register is mapped to a physical register and updated to the renaming map table SPEC_MAP. After the instruction is executed, it is committed in order to the reorder buffer, and the architectural register mapping of the instruction's destination register is updated to ARCH_MAP, as shown in Figure 2.

[0041] In Figure 2, the mapping table SPEC_MAP in the renaming phase stores the latest physical register mappings for architectural registers r0, r1, r2, ..., r31. This mapping table must be restored when an instruction misprediction or exception flush occurs. ARCH_MAP stores the physical register mappings for r0, r1, r2, ..., r31 after instruction submission. When the reorder cache handles an exception, the ARCH_MAP contents are updated to the SPEC_MAP, restoring the SPEC_MAP to its state before the exception flush. When a branch instruction misprediction occurs, the SPEC_MAP is restored based on the reorder cache.

[0042] Before register renaming, the characteristics of the instruction can be used to determine whether the source operand or destination register of the instruction is a fixed constant. For example, fixed constant values ​​0, 1, 2, e, and the logarithm of 2 (Loge(2)) with e as the base of constant e often appear in instructions. This paper proposes allocating N physical registers in the physical register stack specifically for storing constants. The constants in the physical register stack are CONST0, CONST1, CONST2, ..., CONSTN-1, as shown in Figure 3.

[0043] When the source operand of an instruction is a fixed constant, the physical register of the source register is mapped to the location of the fixed constant. If the execution result of an instruction is a constant, then the instruction does not need to be executed. Instead, the physical register of the destination register is mapped to the physical register of the fixed constant. At the same time, this instruction does not need to allocate a new physical register. Regardless of the function of the instruction, because it can be determined that the result of this instruction is a fixed constant, the instruction does not need to be executed. Instead, the instruction is executed through the renaming mapping operation, as shown in Figure 4. The fixed constant renaming mechanism not only saves physical register resources, but also eliminates the need for instruction execution, greatly improving instruction execution efficiency.

[0044] Example 2

[0045] This embodiment discloses a method for renaming fixed constant-related instructions. Its implementation is not limited to any instruction set. To illustrate the principle, the instruction formats listed in Table 1 are two source operands and one destination register. This is also not limited to any processor architecture, and the instruction processing bandwidth is assumed to be four instructions per clock cycle.

[0046] Table 1 Instruction judgment fixed constants

[0047] Inst0R1_0R2_0RD_0Inst1R1_1R2_1RD_1Inst2R1_2R2_2RD_2Inst3R1_3R2_3RD_3

[0048] Assume that the four instructions inst0, inst1, inst2 and inst3 perform fixed constant judgment at the same time in the renaming stage:

[0049] 1. First, determine whether the source operand and destination operand of inst0 are fixed constants CONST0, CONST1, CONST2, ..., CONSTN-1. In Figure 3, assume that CONST0, CONST1, CONST2, ..., CONSTN-1 are located at positions 0, 1, 2, 3, ..., N-1 in the physical register stack. When R1_0 or R2_0 in inst0 is a fixed constant, the physical register of R1_0 or R2_0 is mapped to the location of the fixed constant. If R1_0 is the fixed constant CONST0, the value of the physical register is 0; if R1_0 is the fixed constant CONST1, the value of the physical register is 1; if R1_0 is the fixed constant CONST2, the value of the physical register is 2; if R1_0 is the fixed constant CONSTN-1, the value of the physical register is N-1. Similarly, a similar determination is required for R2_0. If it can be determined that the execution result of inst0 is a fixed constant, which is CONST0, CONST1, CONST2, ..., CONSTN-1, then inst0 does not need to apply for new free physical registers. In other words, inst0 only needs to map the SPEC_MAP and ARCH_MAP of RD_0 to the location of the fixed constants and release the physical registers of RD_0 that were retired in ARCH_MAP.

[0050] If the result of inst0 is a constant, the physical register RD_0 is mapped to the physical register of this fixed constant. For example, if inst0 is an XOR instruction and R1_0 is equal to R_2_0, then, while the specific values ​​of R1_0 and R_2_0 do not need to be known and the physical register stack does not need to be read, the instruction result is 0 and the physical address mapped to RD_0 is 0. Similarly, if inst0 is an integer division instruction DIV, executing RD_0 / RD_1, the instruction result is 1 as long as R1_0 is equal to R_2_0 and the value of RD_1 is not 0.

[0051] When implementing a specific instruction set, similar optimizations are achieved by determining whether the source operand (i.e., the destination register) of the instruction is a fixed constant, based on the characteristics of the instruction. The data ready bit corresponding to an operand whose source operand is a fixed constant is also valid, meaning that the instruction's data ready bit remains valid at the reservation station and is only issued to the execution unit once other non-fixed constant source operands are ready. The physical register addresses of R1_0 and R2_0 are R1_0_phy_reg and R2_0_phy_reg, respectively. R1_0_phy_reg and R2_0_phy_reg can be either fixed constant or non-constant physical registers.

[0052] 2. Then, determine whether the source operand and destination operand of inst1 are fixed constants CONST0, CONST1, CONST2, ..., CONSTN-1. If R1_1 or R2_1 is a fixed constant, R1_1 or R2_1 is mapped to the corresponding fixed constant. When R1_1 is the fixed constant 0 and R2_1 is not a fixed constant, if inst1 is a MOV instruction and R2_1 is equal to RD_0 and RD_0 is mapped to a fixed constant, then the physical register RD_1 of inst1 is also mapped to the fixed constant mapped by RD_0, that is, RD_0 and RD_1 are mapped to the same fixed constant. In this case, RD_0 and RD_1 do not need to apply for physical register allocation. Instead, the architectural registers of RD_0 and R2_1 are mapped to the physical register addresses of the fixed constants, that is, the mapping relationship between RD_0 and R2_1 in SPEC_MAP and ARCH_MAP is updated.

[0053] As shown in Figure 3, different architectural registers are mapped to the same fixed-constant physical register. If R2_1 is not equal to RD_0 and the result of R2_1 is also a constant, then R2_1 is mapped to a different fixed-constant physical register address. Inst1 performs a similar check as inst0 to obtain various possible fixed-constant physical register addresses for the source operand and destination register.

[0054] 3. Next, determine whether the source operands and destination operands of inst2 and inst3 are fixed constants CONST0, CONST1, CONST2, ..., CONSTN-1. The determination process for inst2 is exactly the same as for inst0 and inst, except that it determines whether inst2 shares the same fixed constants with inst0 and inst1. Similarly, for inst3, it determines whether inst3 shares the same fixed constants with inst0, inst1, and inst2. The specific determination process is not repeated here.

[0055] Example 3

[0056] This embodiment uses the RISC-V integer instruction set as an example. RISC V integer instructions include 32 architectural registers: x0, x1, ..., x31. The value of x0 is fixed to 0. Assuming the processor bandwidth is 4 instructions per clock cycle, renaming renames 4 instructions per clock cycle.

[0057] Table 2 RISC V instruction examples

[0058]

[0059]

[0060] Figure 5 shows the dependency relationships between instructions 0 through 7. According to the normal process, dependent instructions must obtain data before they can execute; otherwise, they remain in the "no-ready" state. By determining whether the instruction execution result is a constant and renaming the fixed constant, some of the instruction dependencies can be eliminated. The fixed constant renaming method then completes the instruction execution process.

[0061] The SUB instruction (number 2) performs a subtraction operation, subtracting the second source operand from the first. Since both operands are x11, the result of the SUB instruction is 0, regardless of the specific value of x11. The SUB instruction removes the dependency between the SUB and ADD instructions by renaming them, as shown in Figure 5. Furthermore, the SUB destination register x1 does not require a physical register allocation. The physical register mapped to x1 in the SPEC_MAP table is updated to CONST0, and the SUB execution completion signal in the reorder buffer is set to 1.

[0062] When SUB is committed in the reorder cache, the physical register address of x1 in ARCH_MAP is released and the physical register address of x1 in ARCH_MAP is updated to x0. The MUL instruction number 3 performs a multiplication operation. Since the execution result of the SUB instruction in the current cycle is the constant CONST0, the result of the MUL instruction is also the constant CONST0. The mapping relationship of the MUL destination register x29 in SPEC_MAP is updated to the physical register address of CONST0. Furthermore, MUL does not need to enter the multiplication execution unit for execution. Instead, it directly updates the execution completion signal in the reorder cache and waits for submission.

[0063] When this MUL instruction is committed to the reorder cache, the mapping of architectural register x29 is updated to x0, and the physical register before x29 is released. The multiplication instruction numbered 5 also releases its dependency on the LOAD instruction numbered 4, and the instruction execution result is also CONST0. Therefore, the processing flow of the multiplication instruction numbered 5 is similar to that of the multiplication instruction numbered 3 and is not further described. The atomic operation instruction AMOSWAP.W numbered 6 can also obtain the value of the second source register x31 as CONST0. The set instruction SLTU numbered 7 can also determine that the instruction execution result is 0 because both source operands are x24. Regardless of the value of x24, the instruction execution result is 0. Therefore, SLTU does not need to be executed, but instead updates the mapping of x30 in SPEC_MAP to x0, that is, CONST0, as shown in Figure 6.

[0064] These instructions mapped to the constant CONST0 not only do not require the allocation of new physical registers, but also do not need to be dispatched to reservation stations or execution units, thereby greatly improving instruction execution efficiency and allowing the processor to accommodate more instructions. In particular, for instructions with long execution times, such as MUL, LOAD, and AMO, instructions that depend on these instructions can be renamed.

[0065] The floating-point instruction register defined by the X86 instruction set is a stack with a depth of 8 and a width of 80. The stack is represented by ST, with the top of the stack being ST(0). Writing to the stack is a PUSH operation. Table 3 lists the constant-related instructions defined by the X86.

[0066] Table 3 X86 floating-point constant instructions

[0067]

[0068] The width of constants in X86 floating-point instructions depends on the processor mode. If these constants were pipelined with the instructions, they would consume significant hardware resources. Using the renaming method proposed in this article not only reduces hardware resources but also conserves physical registers and improves instruction execution efficiency. The specific implementation is completely similar to the RISC V instruction set example and will not be further described.

[0069] Example 4

[0070] This embodiment discloses a renaming system for fixed constant-related instructions, including registers, a decoder, and an execution unit. The registers include architectural registers and physical registers. During the renaming phase, the architectural register of the instruction's destination register is mapped to a physical register and updated to the renaming map table SPEC_MAP. After the instruction is executed, it is committed in order to the reorder cache, and the architectural register mapping of the instruction's destination register is updated to ARCH_MAP.

[0071] In summary, the present invention classifies and processes instructions, and instructions with fixed constants do not need to enter the execution unit, but are executed through a renaming method, resulting in high instruction execution efficiency.

[0072] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for renaming fixed constant-related instructions, characterized in that, The method includes the following steps: S1. The decoder classifies the instructions according to the characteristics of the instructions and filters out the instructions with fixed constants; S2. In the renaming stage, according to different fixed constants, map the source registers and destination registers of the filtered instructions in S1 to different physical registers of fixed constants; S3. Update the register renaming mapping tables SPEC_MAP and ARCH_MAP, and release the physical registers corresponding to the fixed constants when the instructions are committed; S4. The instruction reads the physical register file according to the physical register of the source register or obtains the source operand through the instruction execution result of the Forward channel of the execution unit; S5. When the instruction is executed and completed in the execution unit, write to the physical register file according to the physical register of the destination register; S6. Forward the instruction execution result to the pipeline, and the dependent instructions obtain the instruction execution result, thereby realizing the function of the instruction.

2. The method for renaming fixed constant-related instructions according to claim 1, characterized in that, In the method, each instruction obtains the physical register corresponding to the source operand and the physical register of the destination register in the renaming stage. The physical register of the source register is obtained from the renaming mapping table or the free physical register queue according to the correlation of the instruction. The physical register of the destination register is a newly allocated free physical register and is obtained from the free physical register queue.

3. The method for renaming fixed constant-related instructions according to claim 1, characterized in that, In the method, before register renaming, according to the characteristics of the instruction, judge whether the source operand or the destination register of the instruction is a fixed constant, and judge whether the fixed constant values 0, 1, e, and the logarithm Loge(2) with base e of 2 often appear in the instruction.

4. The method for renaming fixed constant-related instructions according to claim 1, characterized in that, In the method, assume that the instructions inst0, inst1, inst2, and inst3 in the renaming stage perform fixed constant judgment simultaneously. Judge whether the source operand and the destination operand of inst0 are fixed constants CONST0, CONST1, CONST2,..., CONSTN-1. When R1_0 or R2_0 in inst0 is a fixed constant, map the physical register of R1_0 or R2_0 to the position of the fixed constant; Assume that when R1_0 is the fixed constant CONST0, the value of the physical register is 0; Assume that when R1_0 is the fixed constant CONST1, the value of the physical register is 1; Assume that when R1_0 is the fixed constant CONST2, the value of the physical register is 2; Assume that when R1_0 is the fixed constant CONSTN-1, the value of the physical register is N-1.

5. The method for renaming fixed constant-related instructions according to claim 4, characterized in that, In the said method, judge R2_0. If it can be judged that the execution result of inst0 is a fixed constant, then inst0 does not need to apply for a new idle physical register. inst0 maps the SPEC_MAP and ARCH_MAP of RD_0 to the position of the fixed constant, and releases the physical register replaced by RD_0 in the ARCH_MAP. When it is judged that the execution result of inst0 is a constant, the physical register of RD_0 is mapped to the physical register of this fixed constant. When implementing a specific instruction set, according to the characteristics of the instruction, judge whether the source operand, i.e., the destination register, of the instruction is a fixed constant.

6. The method for renaming fixed constant-related instructions according to claim 4, characterized in that, In the said method, judge whether the source operands and destination operations of inst1, inst2, and inst3 are fixed constants CONST0, CONST1, CONST2, ……, CONSTN-1. If R1_1 or R2_1 is a fixed constant, then R1_1 or R2_1 is mapped to the corresponding fixed constant. When R1_1 is a fixed constant 0 and R2_1 is not a fixed constant, if inst1 is a MOV instruction at this time and exactly satisfies that R2_1 is equal to RD_0, and RD_0 is mapped to a fixed constant, then the physical register RD_1 of inst1 is also mapped to the fixed constant mapped by RD_0. RD_0 and RD_1 are mapped to the same fixed constant. Map the architecture registers of RD_0 and R2_1 to the physical register address of the fixed constant, and update the mapping relationship of RD_0 and R2_1 in the SPEC_MAP and ARCH_MAP. The judgment process of Inst2 is completely similar to that of inst0 and inst. It needs to judge whether inst2 has the same fixed constant as inst0 and inst1. inst3 also needs to judge whether inst3 has the same fixed constant as inst0, inst1, and inst2.

7. The method for renaming fixed constant-related instructions according to claim 1, characterized in that, In the said method, an instruction includes source operands and a destination register. Before the instruction enters the execution unit for execution, all source operands need to be obtained. After the operands of the instruction in the reservation station are all prepared, it is issued to the execution unit for execution. After the execution is completed, the execution result is written to the destination register, and it is submitted in order.

8. A system for renaming fixed constant-related instructions, the system being used to execute the method for renaming fixed constant-related instructions according to any one of claims 1-7, characterized in that, It includes registers, a decoder, and an execution unit.

9. The system for renaming fixed constant-related instructions according to claim 8, characterized in that, The said registers include architecture registers and physical registers. In the renaming stage, the architecture register of the instruction destination register is mapped to a physical register and updated to the renaming mapping table SPEC_MAP. After the instruction execution is completed, it is submitted in order in the reorder buffer, and the architecture register of the instruction destination register is updated to the ARCH_MAP.