System and method for processing instructions with wide immediate operands

By using a common immediate lookup table and hardware circuits to store wide immediate operands in the processor system, the performance problem of the processor system when processing wide immediate operands is solved, and more efficient instruction processing and execution are achieved.

CN114430822BActive Publication Date: 2024-10-29MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202080066451.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-19
Publication Date
2024-10-29
Estimated Expiration
2040-06-19

AI Technical Summary

Technical Problem

Existing processor systems have a large overhead when processing instructions with wide immediate operands, resulting in extended execution time of program binary files and reduced performance.

Method used

By introducing a common immediate lookup table (CILT) and a hardware circuit (HCILT) in the processor system, the immediate operands are indexed into a table of wide immediate values ​​to realize the storage and replacement of the wide immediate operands, thereby converting the wide immediate operands into a table with wide immediate values. Instructions are represented as single instructions with dual semantics, reducing static code size and increasing instruction fetch bandwidth.

Benefits of technology

Significantly improves the performance of the processor system, reduces the static size of program binary files and instruction fetch bandwidth, reduces dependence on memory loading, and improves execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114430822B_ABST
    Figure CN114430822B_ABST
Patent Text Reader

Abstract

The processor element in the system based on the processor is configured to obtain one or more instructions associated with the program binary file, wherein the one or more instructions include instructions with immediate operands.The processor element is configured to determine whether the immediate operand is a reference to a wide immediate operand.In response to determining that the immediate operand is a reference to a wide immediate operand, the processor element is configured to retrieve the wide immediate operand from the public intermediate lookup table (CILT) in the program binary file, wherein the wide immediate operand in the immediate operand index CILT.Then, the processor element is configured to process the instruction with the immediate operand so that the immediate operand is replaced by the wide immediate operand from the CILT.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to processor-based systems and methods for operating a processor-based system that accommodates the use of immediate operands that are larger than the instruction size defined by an instruction set architecture (ISA) with minimal overhead. Background Art

[0002] The instruction set architecture (ISA) defines the instructions that the processor can execute. Most ISAs have a relatively small instruction size (e.g., four bytes). In some cases, it is necessary to use an immediate value (i.e., a value stored as part of the instruction itself, rather than a pointer to a memory location or register) that is larger than the instruction size defined by the ISA. For example, in an ISA with a four-byte instruction length, for a move immediate value instruction (e.g., "movi register, immediate", where "movi" is the opcode of the instruction, "immediate" is an immediate operand that specifies an immediate value, and "register" is a register operand that specifies a register to be updated with an immediate value), one byte is reserved for the opcode, one byte is reserved for the register operand, and only two bytes are left for the immediate operand. In this example, an immediate value longer than two bytes cannot be stored in the instruction itself. As another example, in the same ISA with a four-byte instruction length, for a branch to an immediate offset instruction (e.g., "bri immediate," where "bri" is the opcode of the instruction and "immediate" is the immediate operand that specifies the offset value to jump to), one byte is reserved for the opcode, leaving only three bytes for the immediate operand. In this example, an immediate value longer than three bytes cannot be stored in the instruction itself. In the case where an immediate value is too large to be stored in the instruction because it is too large to fit in the allocated space provided by the instruction as specified by the ISA, such an immediate value is defined herein as a wide immediate value.

[0003] Instructions that include wide immediate operands are typically handled by software. For example, in one method for a move immediate instruction with a wide immediate operand, the wide immediate operand is embedded into the program binary file, and the instruction with the wide immediate operand is replaced with a load instruction. Thus, a move immediate instruction such as the following move immediate instruction can be changed:

[0004] movi r0, 0xBADDF00DDEADCAFE

[0005] , so that the wide immediate operand is stored in the program binary (in this example, at memory location 0xF9 when the binary is loaded into memory), and the move immediate instruction becomes:

[0006] ldr r0, [0xF9]

[0007] This can be done explicitly by the program developer or by the compiler at compile time. It is important to note that any instructions that rely on move immediate operands must wait for the wide immediate operands to be loaded from memory before they can be processed. This can take several processing cycles, therefore increasing the execution time of the program binary.

[0008] In another method for a move immediate instruction with a wide immediate operand, the instruction is replaced by an instruction sequence including a shift left instruction (sh1) and an add immediate instruction (addi). Accordingly, the same move immediate instruction as above:

[0009] movi r0, 0xBADDF00DDEADCAFE

[0010] Can be changed to:

[0011] movi r0, 0xBADDF00D

[0012] shl r0,32

[0013] addi r0, 0xDEADCAFE

[0014] Again, this can be done explicitly by the program developer, or by the compiler at compile time.

[0015] As another example, in one approach for branch-to-immediate-offset instructions with wide immediate operands, multiple branches may be chained together to ultimately reach an offset indicated by the wide immediate operand, each branch having an immediate operand sized within the instruction length of the ISA. This approach results in multiple control flow redirections, consuming additional processor resources. In another approach for branch-to-immediate-offset instructions with wide immediate operands, indirect branches may be used to reach the offset indicated by the wide immediate operand. Indirect branches take up space in the branch prediction circuitry of the processor, and in the current case where there is one target that is 100% predictable, it is wasteful to take up that space in the branch prediction circuitry.

[0016] In all of the examples discussed above, there is a relatively large overhead incurred to process instructions with wide immediate operands, thereby reducing the performance of binary execution. Therefore, there is a need for improved systems and methods for processing instructions with wide immediate operands. Summary of the invention

[0017] Exemplary aspects of the present disclosure relate to improved systems and methods for processing instructions with wide immediate values. In this regard, in an exemplary aspect, a processor element in a processor-based system is configured to obtain one or more instructions associated with a program binary file, wherein the one or more instructions include instructions with immediate operands. The processor element is configured to determine whether the immediate operand is a reference to a wide immediate operand. In response to determining that the immediate operand is a reference to a wide immediate operand, the processor element is configured to retrieve the wide immediate operand from a public immediate lookup table (CILT) in the program binary file, wherein the immediate operand indexes the wide immediate operand in the CILT. Then, the processor element is configured to process instructions with immediate operands so that the immediate operands are replaced by wide immediate operands from the CILT. By allowing instructions with immediate operands to reference wide immediate operands in the CILT, instructions with wide immediate values ​​can be represented as single instructions with dual semantics in the program binary file. Compared with traditional methods, this can reduce the static size of the program binary file and improve instruction acquisition bandwidth, which can improve the performance of the processor-based system.

[0018] In another exemplary aspect, the processor element in the system based on the processor includes a hardware circuit (HCILT) and an instruction processing circuit system. The HCILT includes a hardware storage device (e.g., a memory or a register) configured to store a table that indexes an immediate value as a wide immediate value. The instruction processing circuit system is configured to obtain one or more instructions associated with a program binary file from an instruction memory, and the instruction includes an instruction with an immediate operand. The instruction processing circuit system is configured to determine whether the immediate operand is a reference to a wide immediate operand. In response to determining that the immediate operand is a reference to a wide immediate operand, the instruction processing circuit system is configured to search for a wide immediate operand indexed by an immediate operand in the HCILT, and in response to finding a wide immediate operand in the HCILT to process the instruction, the immediate operand is replaced by the wide immediate operand from the HCILT. If the wide immediate operand is not found in the HCILT, it is retrieved from the CILT as described above. If the immediate operand is not a reference to a wide immediate operand, the instruction will be processed as usual. Using HCILT to store and retrieve wide immediate operands avoids having to load wide immediate operands from memory, which can significantly improve the performance of processor-based systems.

[0019] Those skilled in the art will understand the scope of the present disclosure and recognize additional aspects thereof after reading the following detailed description of the preferred embodiments in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings incorporated in and forming a part of this specification illustrate several aspects of the disclosure, and together with the description serve to explain the principles of the disclosure.

[0021] Figure 1 is a block diagram illustrating an exemplary processor-based system, the system including a processor configured to process an instruction including a wide immediate operand such that the wide immediate operand is obtained from a common immediate lookup table (CILT) or a hardware CILT (HCILT);

[0022] Figure 2 It is shown Figure 1 A block diagram of exemplary details of a processor in a processor-based system processing an instruction including a wide immediate operand such that the wide immediate operand is fetched from a CILT or an HCILT;

[0023] Figure 3 is a flow chart illustrating an exemplary process for processing an instruction that may include an immediate operand that references a wide immediate operand stored in a CILT or HCILT;

[0024] Figure 4 is a flow chart illustrating an exemplary process for processing a move immediate instruction that may include an immediate operand that references a wide immediate operand stored in a CILT or HCILT;

[0025] Figure 5 is a flow chart illustrating an exemplary process of filling a HCILT from a CILT;

[0026] Figure 6 is a block diagram illustrating an exemplary compilation system for compiling source code into a program binary file including a CILT;

[0027] Figure 7 is a flow chart illustrating an exemplary process for generating a program binary file including a CILT from source code;

[0028] Figure 8 is a block diagram illustrating an exemplary processor-based system, the exemplary system including a processor configured to process an instruction including a wide immediate operand such that the wide immediate operand is obtained from a CILT or an HCILT; and

[0029] Fig. 9 is a flow chart illustrating an exemplary process for handling an HCILT miss, where a wide immediate operand is not found in the HCILT. DETAILED DESCRIPTION

[0030] Exemplary aspects of the present disclosure relate to improved systems and methods for processing instructions with wide immediate values. In this regard, in an exemplary aspect, a processor element in a processor-based system is configured to obtain one or more instructions associated with a program binary file, wherein the one or more instructions include instructions with immediate operands. The processor element is configured to determine whether the immediate operand is a reference to a wide immediate operand. In response to determining that the immediate operand is a reference to a wide immediate operand, the processor element is configured to retrieve the wide immediate operand from a public immediate lookup table (CILT) in the program binary file, wherein the immediate operand indexes the wide immediate operand in the CILT. Then, the processor element is configured to process instructions with immediate operands so that the immediate operands are replaced by wide immediate operands from the CILT. By allowing instructions with immediate operands to reference wide immediate operands in the CILT, instructions with wide immediate values ​​can be represented as single instructions with dual semantics in the program binary file. Compared with traditional methods, this can reduce the static size of the program binary file and improve instruction acquisition bandwidth, which can improve the performance of the processor-based system.

[0031] In another exemplary aspect, the processor element in the system based on the processor includes a hardware circuit (HCILT) and an instruction processing circuit system. The HCILT includes a hardware storage device (e.g., a memory or a register) configured to store a table that indexes an immediate value as a wide immediate value. The instruction processing circuit system is configured to obtain one or more instructions associated with a program binary file from an instruction memory, and the instruction includes an instruction with an immediate operand. The instruction processing circuit system is configured to determine whether the immediate operand is a reference to a wide immediate operand. In response to determining that the immediate operand is a reference to a wide immediate operand, the instruction processing circuit system is configured to search for a wide immediate operand indexed by an immediate operand in the HCILT, and in response to finding a wide immediate operand in the HCILT to process the instruction, the immediate operand is replaced by the wide immediate operand from the HCILT. If the wide immediate operand is not found in the HCILT, it is retrieved from the CILT as described above. If the immediate operand is not a reference to a wide immediate operand, the instruction will be processed as usual. Using HCILT to store and retrieve wide immediate operands avoids having to load wide immediate operands from memory, which can significantly improve the performance of processor-based systems.

[0032] Figure 11 is a schematic diagram of an exemplary processor-based system 100, which may include improvements thereto for more efficiently processing instructions with wide immediate operands. The processor-based system 100 includes a plurality of processor blocks 102(1)-102(M), where "M" in the exemplary embodiment is equal to any desired number of processor blocks 102. Each processor block 102 includes a plurality of processor elements 104(1)-104(N), where "N" in the exemplary embodiment is equal to any desired number of processors. The processor elements 104 in each processor block 102 may be microprocessors (μPs), vector processors (vPs), or any other type of processor. In addition, each processor block 102 includes a shared level 2 (L2) cache 106 for storing cache data used by any processor element 104 or shared between each processor element 104. A shared level 3 (L3) cache 108 is also provided for storing cache data used by any processor block 102 or shared between each processor block 102. An internal bus system 110 is provided that allows each processor block 102 to access a shared L3 cache 108 as well as other shared resources, such as a memory controller 112 for accessing main, external memory (MEM), one or more peripheral devices 114 (including input / output devices, networking devices, etc.), and memory 116.

[0033] In operation, one or more processor elements 104 in one or more processor blocks 102 cooperate with memory controller 112 to fetch instructions from memory, execute the instructions to perform one or more operations and generate results, and optionally store the results back to memory or provide the results to another consumer instruction for consumption.

[0034] Figure 2 Details of a processor element 104 in a processor block 102 of a processor-based system 100 according to an exemplary embodiment of the present disclosure are shown. The processor element 104 includes an instruction processing circuit 200. The instruction processing circuit 200 includes an instruction fetch circuit 202 configured to fetch instructions 204 from an instruction memory 206. For example, the instruction memory 206 may be disposed in or as part of a system memory in the processor-based system 100. An instruction cache 208 may also be provided in the processor element 104 to cache instructions 204 fetched from the instruction memory 206, thereby reducing latency in the instruction fetch circuit 202. The instruction fetch circuit 202 in this example is configured to provide the instruction 204 as a fetch instruction 204F to one or more instruction pipelines 10-1 before the fetch instruction 204F reaches the execution circuit 212 to be executed. NInstruction pipeline I0-I N Different processing circuits or processing stages across the instruction processing circuitry 200 are provided to pre-process and process the fetch instruction 204F in sequential steps prior to execution in the execution circuitry 212, which steps may be performed concurrently to increase throughput.

[0035] A control flow prediction circuit 214 (e.g., a branch prediction circuit) is also provided in the instruction processing circuit 200 in the processor element 104 to speculate or predict the target address of a control flow fetch instruction 204F, such as a conditional branch instruction. The instruction fetch circuit 202 uses the prediction of the target address by the control flow prediction circuit 214 to determine the next fetch instruction 204F to be fetched based on the predicted target address. The instruction processing circuit 200 also includes an instruction decoding circuit 216, which is configured to decode the fetch instruction 204F fetched by the instruction fetch circuit 202 into a decoded instruction 204D to determine the required instruction type and action, which can also be used to determine which instruction pipeline 10-11 the decoded instruction 204D should be placed in. N Then, the decoded instruction 204D is placed in the instruction pipeline I0-I N and subsequently provided to register access circuit 218.

[0036] The register access circuitry 218 is configured to access physical registers 220(1)-220(X) in a physical register file (PRF) 222 to retrieve the generated values ​​of the executed instruction 204E from the execution circuitry 212. The register access circuitry 218 is further configured to provide the retrieved generated values ​​of the executed instruction 204E as source register operands of a decoded instruction 204D to be executed. The instruction processing circuitry 200 also includes a dispatch circuitry 224 configured to dispatch the decoded instruction 204D to the execution circuitry 212 for execution when all source register operands of the decoded instruction 204D are available. For example, the dispatch circuitry 224 is responsible for ensuring that necessary values ​​for operands of a decoded consumer instruction 204D are available before dispatching the decoded consumer instruction 204D to the execution circuitry 212 for execution. Operands of a decoded instruction 204D may include intermediate values, values ​​stored in memory, and generated values ​​from other decoded instructions 204D that would be considered producer instructions to a consumer instruction.

[0037] It is noteworthy that, in addition to PRF 222, HCILT 226 is arranged in the figure, or as shown in the figure. In this example, HCILT 226 includes a set of HCILT registers 228 (1)-228 (Y), wherein "Y" is any desired number, dedicated to storing wide immediate values, so that wide immediate values ​​are indexed by immediate values ​​of size within the instruction size of the ISA of processor element 104. As discussed in detail below, HCILT registers 228 may include support registers for implementing the functions of HCILT 226. When there is an instruction (as indicated by the semantics of the immediate operand by the opcode or as described below) that references a wide immediate operand, the wide immediate operand can be searched in HCILT 226 so that register access circuit 218 replaces the immediate operand with the wide immediate operand from HCILT 226. This can significantly improve the performance of program binary file execution by bypassing loading wide immediate operands from memory, otherwise processing instructions with wide immediate values ​​will require such loading to occur. More details about the functions of HCILT 226 are discussed below. It is worth noting that although HCILT 226 is shown above as a set of registers, in various embodiments, the HCILT may be implemented as any type of dedicated hardware storage device, such as a hardware memory.

[0038] The execution circuit 212 is configured to execute the decoded instruction 204D received from the dispatch circuit 224. As described above, the execution of the instruction 204E may generate a generated value to be consumed by other instructions. In this case, the write circuit 230 writes the generated value to the PRF 222 so that they can be consumed by the consumer instruction later.

[0039] Figure 31 is a flow chart illustrating a method for operating a processor element 104 to process instructions with wide immediate operands according to an exemplary embodiment of the present disclosure. First, an instruction associated with a program binary is obtained from the instruction memory 206, or if cached, from the instruction cache 208 (block 300). It is noteworthy that, as discussed in detail below, the program binary includes a CILT, which is a table storing wide immediate operands, and the wide immediate operands are indexed by immediate operands of a size within the instruction size of the ISA of the processor element 104. The instruction includes an instruction with an immediate operand. As described above, the immediate operand is a value stored as part of the instruction itself, rather than as a pointer to a memory location or register. Determine whether the immediate operand is a reference to a wide immediate operand (block 302). Determining whether the immediate operand is a reference to a wide immediate operand can be accomplished in several ways. In an exemplary embodiment, the ISA of the processor element 104 can specify that the immediate operand includes a reserved bit, and the reserved bit specifies whether the immediate operand is a reference to a wide immediate operand. For example, if the most significant bit of the immediate operand is set, the ISA can specify that the immediate operand is a reference to a wide immediate operand, and the immediate operand can be stored in a CILT or an HCILT, as described below. If the most significant bit of the immediate operand is not set, the ISA can specify that the immediate operand is not a reference to a wide immediate operand. In another exemplary embodiment, the ISA of the processor element 104 can specify a custom opcode, and the custom opcode specifies that the immediate operand following the custom opcode is a reference to a wide immediate operand.

[0040] If the immediate operand is not a reference to a wide immediate operand, the instruction is processed conventionally by the execution circuit 212 (block 304). If the immediate operand is a reference to a wide immediate operand, it is determined whether the processor element 104 includes an HCILT 226 (block 306). As described above, the HCILT 226 is a hardware structure that includes one or more registers for storing a table that stores wide immediate operands referenced by immediate operands that are within the instruction size of the ISA of the processor element 104. The HCILT 226 is a hardware corollary of the CILT and is intended to further speed up the processing of instructions with wide immediate operands compared to a separate CILT. Determining whether the processor element 104 includes the HCILT 226 may include reading a register of the processor element 104. Instructions for determining whether the processor element 104 includes the HCILT 226 may be included in the ISA of the processor element 104. If the processor element 104 does not include the HCILT 226, the wide immediate operand may be retrieved from the CILT in the program binary file (block 308). Retrieving wide immediate operands from the CILT in the program binary file can include obtaining wide immediate operands from a memory location indexed by an immediate value. The immediate operand can directly point to a memory location that includes a wide immediate value (e.g., via an offset value from the starting memory address of the CILT), or the CILT can be a mapping, in which the immediate value is hashed to obtain the actual index of the wide immediate value. It is noteworthy that, in either manner, the processor element 104 executes loading wide immediate values ​​from memory in response to encountering an instruction with an immediate operand that references a wide immediate operand (due to the dual semantics of the immediate operand or due to a custom opcode), so that loading from memory in the instruction associated with the program binary file is not explicit. The difference is represented below with pseudo code, where it was originally represented as:

[0041] A=load X / / X is a wide immediate value

[0042] B=Y+A / / Depends on the previous load instruction

[0043] The addition operation can be reconfigured as:

[0044] B=Y+A' / / A' is an immediate operand with dual semantics

[0045] As shown, two instructions for processing instructions with wide immediate values ​​can be compressed into a single instruction, where the loading of the wide immediate value is handled by the processor according to the dedicated ISA specification. This not only reduces the static code size of the program binary file, but also reduces the instruction fetch bandwidth, which may improve the performance of the processor element 104.

[0046] Process this instruction then, make the immediate operand be replaced by the wide immediate operand from CILT (frame 310).If processor element 104 includes HCILT 226, then determine whether the wide immediate operand quoted by the immediate operand is in HCILT 226 (frame 312). HCILT 226 size may not be enough to accommodate each wide immediate operand in program binary file.That is to say, HCILT 226 can be less than CILT, therefore in HCILT 226, can only have a part in wide immediate operand.If the wide immediate operand quoted by the immediate operand is not in HCILT 226, then fetch wide immediate operand (frame 314) from CILT in program binary file, this is completed by the dynamic loading started by processor element 104 as mentioned above.Process this instruction then, make the immediate operand be replaced by the wide immediate operand from CILT (frame 316).Alternatively, also can the wide immediate operand be copied to HCILT 226 (frame 318) from CILT, make in future processing cycle, can visit wide immediate operand more easily. One or more cache rules may dictate whether wide immediate operands not found in HCILT 226 should be added to HCILT 226 after the wide immediate operands are fetched from the CILT as described below.

[0047] If a wide immediate operand is found in the HCILT 226, the wide immediate operand is retrieved from the HCILT 226 (block 320). As discussed above with respect to the CILT, the wide immediate operand may be retrieved from the HCILT 226 using the immediate operand as a direct index or a hash index. The instruction is then processed such that the immediate operand is replaced by the wide immediate operand from the HCILT 226 (block 322).

[0048] To support the aforementioned operations, a number of system registers may be added to the processor element 104 to provide support for using CILT alone or CILT with HCILT. The following table describes the additional registers and their functions:

[0049]

[0050] It is worth noting that these registers are only an exemplary implementation of ISA support for CILT and HCILT for improved processing of instructions with wide immediate operands. In one or more alternative embodiments, dedicated instructions in the ISA are provided to load wide immediate operands from CILT, so that one or more registers discussed above may be unnecessary and therefore not included.

[0051] Figure 44 is a flow chart illustrating the application of the above process to a specific instruction (movi instruction) to be processed by the processor element 104. The move immediate instruction includes a register operand (REGISTER) and an immediate operand (IMMEDIATE) (block 400). The instruction moves the immediate operand to the register when it is processed. The processor element 104 determines whether the immediate operand is a reference to a wide immediate operand (block 402). As described above, determining whether the immediate operand is a reference to a wide immediate operand may include determining whether a reserved bit in the immediate operand is set. If the immediate operand is not a reference to a wide immediate operand, the register is set to the immediate operand (block 404), and the move immediate instruction is completed (block 406). If the immediate operand is a reference to a wide immediate operand, the processor element 104 determines whether it includes an HCILT 226 (block 408). If the processor element 104 includes an HCILT 226, the register is set to the value in HCILT_table[immediate] (block 410). As shown in the figure, the wide immediate operand in the immediate operand index HCILT 226.Then complete the move immediate number instruction (frame 406).If processor element 104 does not include HCILT 226, then processor element 104 injects load register instruction (" ldr register, [CILT_base_address+immediate] ") to load wide immediate operand (frame 412) from CILT, and this wide immediate operand is stored in memory from CILT_base_address.Equally, immediate operand is used to index the wide immediate operand in CILT.Before using immediate value as index (for example, offset) to retrieve wide immediate operand, any reserved bit for determining whether immediate operand is a reference to wide immediate operand can be stripped from immediate value.Then complete the move immediate number instruction (frame 406).

[0052] Figure 52 is a flow chart showing how to fill the HCILT 226 in the processor element 104 from the CILT during a context switch according to an exemplary embodiment of the present disclosure. The filling of the HCILT 226 occurs in response to a context switch in a program binary file (block 500). The processor element 104 determines whether the number of entries in the HCILT 226 is greater than or equal to the number of entries in the CILT (block 502). As described above, the HCILT 226 includes a plurality of registers. The size of the register determines how many entries can be stored in the HCILT 226 (where each entry stores a wide immediate operand), thereby determining how many entries there are. As described above, the number of entries in the HCILT 226 can be provided in the register HCILT_entries, in which case, determining whether the number of entries in the HCILT 226 is greater than or equal to the number of entries in the CILT can be a simple read of the register and a comparison is performed. If the number of entries in the HCILT 226 is greater than or equal to the number of entries in the CILT, all CILT entries are copied to the HCILT (block 504). For example, for a CILT having 32 entries and an HCILT 226 having 32 or more entries, the following example instructions may be executed to fill the HCILT 226 from the CILT:

[0053] wsr HCILT_active_entry, 0

[0054] wsr HCILT_table wide_immediate_0

[0055] wsr HCILT_active_entry, 1

[0056] wsr HCILT_table wide_immediate_1

[0057] wsr HCILT_active_entry, 2

[0058] wsr HCILT_table wide_immediate_2

[0059] …

[0060] wsr HCILT_active_entry, 31

[0061] wsr HCILT_Table wide_immediate_31

[0062] Where "wsr register, immediate" is a write system register instruction that writes "immediate" to "register", and "wide_immediate_x" is a wide immediate operand "x" stored in CILT. As shown, writing HCILT_active_entry is to update the index of HCILT_table before each write to HCILT_table. However, in some embodiments, the processing of the HCILT_table index can be opaque, so that it is automatically incremented and decremented (e.g., similar to a stack). The context is then switched (block 506).

[0063] If the number of entries in the HCILT 226 is less than the number of entries in the CILT, only a subset of the CILT entries are copied to the HCILT 226 (block 508). For example, for a CILT with 32 entries and an HCILT with 4 entries, the following exemplary instructions may be executed to populate the HCILT 226 from the CILT:

[0064] wsr HCILT_active_entry, 0

[0065] wsr HCILT_table wide_immediate_0

[0066] wsr HCILT_active_entry, 1

[0067] wsrHCILT_table wide_immediate_4

[0068] wsr HCILT_active_entry, 2

[0069] wsrHCILT_table wide_immediate_12

[0070] wsr HCILT_active_entry, 3

[0071] wsr HCILT_table wide_immediate_29

[0072] Entries 0, 4, 12, and 29 of the CILT are copied to the HCILT 226. The context is then switched (block 506). When the number of entries in the HCILT 226 is insufficient to store all of the entries in the CILT, any number of different strategies may be provided to determine which entries from the CILT are copied to the HCILT 226. In addition, a cache strategy may be implemented as described above such that when a wide immediate operand is not found in the HCILT 226 (i.e., the HCILT 226 misses) and the wide immediate operand must be retrieved from the CILT, the wide immediate operand is copied to the HCILT 226 at that time.

[0073] The instructions associated with the program binary file that are fetched, decoded and executed by the processor element 104 as described above are generated by the compiler so that they include the CILT. Figure 6 An exemplary compiler system 600 is shown. The compiler system 600 includes a memory 602 and a processing circuit system 604. The memory 602 and the processing circuit system 604 are connected via a bus 606. As described below, the memory 602 stores instructions that, when executed by the processing circuit system 604, cause the compiler system 600 to retrieve or receive source code, generate an intermediate representation of the source code, apply one or more compiler optimizations to the intermediate representation of the source code, and provide the optimized intermediate representation of the source code as machine code suitable for execution by a processor in a processor-based system. The compiler system 600 may also include an input / output circuit 608 that may be connected to a memory 610 for storing and retrieving source code and / or machine code. For purposes of discussion, the operation of the compiler system 600 will be described as it relates to compiling source code into machine code for a processor element 104 in a processor-based system 100. However, the compiler system 600 may more generally compile source code into machine code suitable for any processor in any processor-based system, including several different processors for several different processor-based systems. According to various embodiments of the present disclosure, memory 602 may include instructions that, when executed by processing circuit system 604, cause compiler system 600 to generate machine code including a CILT and one or more instructions having an immediate value that references a wide immediate value stored in the CILT, as discussed in detail below.

[0074] Figure 76 is a flowchart showing a method for operating a compiler system 600 to generate a program binary file including a CILT according to an exemplary embodiment of the present disclosure. First, the compiler system 600 receives source code (box 700). The source code can be a code written in a high-level programming language such as C, Rust, Go, Swift, etc. Alternatively, the source code can be a low-level language (i.e., directly written in machine code) assembled only by the compiler system 600, as described below. The compiler system 600 identifies wide immediate operands in the source code (box 702). Wide immediate operands can be identified by static code analysis according to one or more rules. For example, wide immediate operands can be identified based on their length, but additional requirements may also need to be met, such as appearing a certain number of times in the source code. The compiler system 600 can identify wide immediate operands after converting the source code into an intermediate representation suitable for analysis. The compiler system 600 provides the identified wide immediate value in the CILT (box 704), as described above, the CILT is a data structure, specifically a table, which indexes wide immediate operands as immediate values ​​whose size is within the instruction length of the ISA of the processor element 104. The compiler system 600 may perform one or more additional steps, such as code optimization, before providing machine code based on the source code (block 706). As described above, the CILT data structure and the updated ISA for the processor element 104 may improve the performance of binary file execution, and the updated ISA allows immediate operands to reference wide immediate operands stored in the CILT and the optional HCILT 226.

[0075] Figure 8 10 is a block diagram of an exemplary processor-based system 800 including a processor 802 configured to support execution of compiler-optimized machine code based on runtime information about the processor 802. For example, the processor 802 in FIG. 10 may be Figure 2 The processor element 104 in the embodiment of the present invention and the processor-based system 800 can be used with Figure 1The processor-based system 800 is the same as the processor-based system 100 in , wherein additional and / or alternative details are shown. The processor-based system 800 can be one or more circuits included in an electronic board, such as a printed circuit board (PCB), a server, a personal computer, a desktop computer, a laptop computer, a personal digital assistant (PDA), a computing board, a mobile device, or any other device, and can represent, for example, a server or a user's computer. In this example, the processor-based system 800 includes a processor 802. The processor 802 represents one or more general-purpose processing circuits, such as a microprocessor, a central processing unit, etc. More specifically, the processor 802 can be an EDGE instruction set microprocessor or other processor that implements an instruction set that supports explicit consumer naming to pass the generated value generated by the execution of the producer instruction. The processor 802 is configured to execute the processing logic in the instruction to perform the operations and steps discussed here. In this example, the processor 802 includes an instruction cache 804 and an instruction processing circuit system 806 for temporary fast access memory storage of instructions. Instructions obtained or pre-obtained from a memory (e.g., from a system memory 808 via a system bus 810) are stored in the instruction cache 804. Instruction processing circuitry 806 is configured to process instructions fetched into instruction cache 804 and process the instructions for execution.

[0076] The processor 802 and the system memory 808 are coupled to a system bus 810 and may interconnect peripheral devices included in the processor-based system 800. As is well known, the processor 802 communicates with these other devices by exchanging address, control, and data information on the system bus 810. For example, the processor 802 may transmit a bus transaction request to a memory controller 812 in the system memory 808 as an example of a slave device. Although Figure 8 808, but multiple system buses 810 may be provided, each of which constitutes a different structure. In this example, a memory controller 812 is configured to provide memory access requests to a memory array 814 in the system memory 808. The memory array 814 is composed of an array of storage bit cells for storing data. As non-limiting examples, the system memory 808 may be a read-only memory (ROM), a flash memory, a dynamic random access memory (DRAM) (e.g., synchronous DRAM (SDRAM)), etc.), and a static memory (e.g., a flash memory, a static random access memory (SRAM), etc.).

[0077] Other devices may be connected to the system bus 810. Figure 8As shown, these devices may include, by way of example, system memory 808, one or more input devices 816, one or more output devices 818, a modem 820, and one or more display controllers 822. The input device(s) 816 may include any type of input device, including, but not limited to, input keys, switches, voice processors, etc. The output device(s) 818 may include any type of output device, including, but not limited to, audio, video, other visual indicators, etc. The modem 820 may be any device configured to allow data to be exchanged to and from a network 824. The network 824 may be any type of network, including, but not limited to, a wired or wireless network, a private or public network, a local area network (LAN), a wireless local area network (WLAN), a wide area network (WAN), a BLUETOOTH TM The modem 820 may be configured to support any type of communication protocol desired. The processor 802 may also be configured to access a display controller 822 via the system bus 810 to control information sent to one or more displays 826. The display 826 may include any type of display, including but not limited to a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, etc.

[0078] Figure 8 The processor-based system 800 in FIG. 8 may include an instruction set 828 to be executed by the processor 802 for any application desired according to the instructions. The instructions 828 may be stored in the system memory 808, the processor 802, and / or the instruction cache 804 as examples of non-transitory computer-readable media 830. The instructions 828 may also reside completely or at least partially within the system memory 808 and / or within the processor 802 during their execution. The instructions 828 may also be sent or received over the network 824 via the modem 820, so that the network 824 includes the computer-readable medium 830.

[0079] Although the computer-readable medium 830 is shown as a single medium in the exemplary embodiment, the term "computer-readable medium" shall include a single medium or multiple media (e.g., a centralized or distributed database, and / or associated caches and servers) that store one or more sets of instructions. The term "computer-readable medium" shall also be deemed to include any medium that is capable of storing, encoding, or carrying a set of instructions executed by a processing device and causing the processing device to perform any one or more methods of the embodiments disclosed herein. Therefore, the term "computer-readable medium" shall be deemed to include, but is not limited to, solid-state memories, optical media, and magnetic media.

[0080] Fig. 9is a flow chart according to one embodiment of the present disclosure, showing details of what happens if a wide immediate operand is not found in HCILT 226 (ie, HCILT miss). The process begins with the above reference Figure 3 Block 312 of the process in question, where a wide immediate operand (from Figure 3 312 of the no path). If the wide immediate operand is not found in HCILT226, it is determined whether the processor element 104 has back-end support for HCILT misses (frame 900). As discussed herein, back-end support for HCILT misses means that when the instruction to load the immediate operand from CILT is directly injected into the back-end and then processed without refreshing the pipeline, the pipeline (or the pipeline portion of the instruction currently executing the instruction with the immediate operand) can be blocked. If the processor element 104 has back-end support for HCILT misses, the pipeline is maintained (frame 902), and the instruction is reprocessed so that the immediate operand is replaced by the wide immediate operand from CILT (frame 904). It is then determined whether there is an unforeseen danger in the pipeline (frame 906). For example, if the instruction to replace the immediate operand with the wide immediate operand from CILT cannot obtain execution resources, there is a conversion error, etc. even when the pipeline is maintained, this may occur. If there is an unforeseen hazard in the pipeline, the pipeline is flushed (block 908), the instruction is re-fetched (block 910), the instruction is transformed so that the immediate operand is loaded as a wide immediate operand from CILT (block 912), and the transformed instruction is processed (block 914). It is worth noting that a pipeline flush is caused in the event of an unforeseen hazard, which increases the overhead of processing instructions with immediate operands.

[0081] If there is no unforeseen pipeline hazard (that is, if the reprocessing of the instruction makes the wide immediate operand replaced with the wide immediate operand from CILT after the pipeline is maintained without problem), then determine whether the wide immediate operand should be inserted into the strategy (frame 916) in the HCILT. As part of the support for processing wide immediate operands discussed here, the system 100 based on the processor may include a strategy for determining when the wide immediate operand not found in the HCILT 226 should be copied from the CILT to the HCILT 226. It is worth noting that this is only a problem when the size of the HCILT 226 is less than the number of entries in the CILT. In this case, the policy rules such as the HCILT misses of a specific number of wide immediate operands, the frequency of HCILT misses or any number of different events can provide that the wide immediate operand is added to the HCILT 226. If the policy indicates that the wide immediate operand should be inserted into the HCILT 226, the victim entry (frame 918) in the HCILT 226 is selected, and the victim entry (frame 920) is replaced with the wide immediate operand. The victim entry may similarly be selected by any number of policy rules, such as frequency of use.

[0082] Returning to block 900, if the processor element 104 does not have back-end support for HCILT misses, meaning that the instruction cannot be reprocessed so that the immediate operand is replaced by a wide immediate operand from the CILT without interrupting the pipeline, the pipeline is flushed (block 908), the instruction is re-fetched (block 910) and transformed so that the immediate operand is replaced by a wide immediate operand from the CILT (block 912), and the transformed instruction is processed (block 914). Likewise, the process may proceed to block 916, where it is determined whether the wide immediate should be added to the HCILT 226, and may be added or not based thereon.

[0083] The embodiments disclosed herein include various steps. The steps of the embodiments disclosed herein may be formed by hardware components, or may be embodied in machine executable instructions, which may be used to perform these steps using a general or special purpose processor programmed with instructions. Alternatively, these steps may be performed by a combination of hardware and software.

[0084] The embodiments disclosed herein may be provided as a computer program product or software, which may include a machine-readable medium (or computer-readable medium) having instructions stored thereon, and the instructions may be used to program a computer system (or other electronic device) to perform a process according to the embodiments disclosed herein. A machine-readable medium includes any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer). For example, a machine-readable medium includes: a machine-readable storage medium (e.g., a ROM, a random access memory ("RAM"), a disk storage medium, an optical storage medium, a flash memory device, etc.), etc.

[0085] Unless specifically noted otherwise and as is apparent from the foregoing discussion, it is to be understood that throughout this specification, discussions using terms such as "process," "compute," "determine," "display," etc. refer to the actions and processes of a computer system or similar electronic computing device that manipulates and transforms data represented as physical (electronic) quantities within a computer system's registers and memories into other data similarly represented as physical quantities within a computer system's memories or registers or other such information storage, transmission, or display devices.

[0086] The algorithms and displays presented herein are not themselves associated with any particular computer or other device. Various systems may be used with the program in accordance with the teachings herein, or it may prove convenient to construct more specialized equipment to perform the required method steps. The structures required for the various systems described above will appear in the above description. In addition, the embodiments described herein are not described with reference to any particular programming language. It will be appreciated that various programming languages ​​may be used to implement the teachings of the embodiments described herein.

[0087] Those skilled in the art will also recognize that the various illustrative logic blocks, modules, circuits, and algorithms described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, instructions stored in a memory or another computer-readable medium and executed by a processor or other processing device, or a combination of the two. As an example, the components of the distributed antenna system described herein may be used in any circuit, hardware component, integrated circuit (IC), or IC chip. The memory disclosed herein may be any type and size of memory and may be configured to store any type of information required. In order to clearly illustrate this interchangeability, various illustrative components, boxes, modules, circuits, and steps are described above generally in terms of their functions. How these functions are implemented depends on the specific application, design choices, and / or design constraints imposed on the entire system. A technician may implement the described functions in different ways for each specific application, but such implementation decisions should not be interpreted as causing a deviation from the scope of the present embodiment.

[0088] The various illustrative logical blocks, modules, and circuits described in conjunction with the embodiments disclosed herein may be implemented or performed with a processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. In addition, the controller may be a processor. The processor may be a microprocessor, but alternatively, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices (e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a DSP core, or any other such configuration).

[0089] The embodiments disclosed herein may be implemented in hardware and instructions stored in hardware, and may reside in, for example, RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disks, removable disks, CD-ROMs, or any other form of computer-readable medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Alternatively, the storage medium may be integrated into the processor. The processor and storage medium may reside in an ASIC. The ASIC may reside in a remote station. Alternatively, the processor and storage medium may reside in a remote station, a base station, or a server as discrete components.

[0090] It should also be noted that the operational steps described in any exemplary embodiment herein are described here to provide examples and discussions. The described operations can be performed in many different sequences except for the sequence shown. In addition, the operations described in a single operational step can actually be performed in a plurality of different steps. In addition, one or more operational steps discussed in the exemplary embodiment can be combined. It will also be understood by those skilled in the art that any of the various techniques and technologies can be used to represent information and signals. For example, data, instructions, commands, information, signals, bits, symbols, and chips that can be cited throughout the above description can be represented by voltage, current, electromagnetic waves, magnetic fields or particles, light fields or particles, or any combination thereof.

[0091] Unless otherwise stated, any method set forth herein should not be construed as requiring that its steps be performed in a specific order. Therefore, in the event that a method claim does not actually recite the order in which its steps are to be followed, or in the event that the claims or description do not otherwise explicitly state that the steps are to be limited to a specific order, no specific order is intended to be inferred.

[0092] It is obvious that those skilled in the art can make various modifications and changes without departing from the spirit or scope of the present invention. Since those skilled in the art may think of modifications, combinations, sub-combinations and variations of the disclosed embodiments that include the spirit and essence of the present invention, the present invention should be interpreted as including all contents within the scope of the attached claims and their equivalents.

Claims

1. A processor-based system comprising: The processing element is configured to: fetching one or more instructions associated with a program binary file from an instruction memory, the one or more instructions including an instruction having an immediate operand; determining that the immediate operand is a reference to a wide immediate operand; as well as In response to determining that the immediate operand is a reference to a wide immediate operand, Determining whether the processing element includes a hardware common intermediate lookup table HCILT; as well as In response to determining that the processing element does not include an HCILT: Retrieving the wide immediate operand from a common intermediate lookup table CILT in the program binary file, wherein the immediate operand indexes the wide immediate operand in the CILT; and The instruction having the immediate operand is processed such that the immediate operand is replaced by the wide immediate operand from CILT.

2. The processor-based system of claim 1 , wherein the processing element is further configured to: determining that the immediate operand is not a reference to a wide immediate operand; and In response to determining that the immediate operand is not a reference to a wide immediate operand, the instruction with the immediate operand is processed.

3. The processor-based system of claim 1 , wherein the processing element is further configured to determine that the immediate operand is a reference to a wide immediate operand by being configured to determine whether a reserved bit of the immediate operand is set.

4. The processor-based system of claim 1 , wherein the processing element is further configured to determine that the immediate operand is a reference to a wide immediate operand by being configured to examine an opcode of the instruction having the immediate operand.

5. The processor-based system of claim 1, wherein a wide immediate operand comprises an immediate operand that is larger than a maximum immediate length allowed by an instruction set architecture (ISA) of the processor.

6. A processor-based system comprising: Processing elements, including: Hardware Common Intermediate Lookup Table HCILT circuitry comprising registers configured to store a table indexing an immediate value to a wide immediate value; and The instruction processing circuit system is configured to: fetching one or more instructions associated with a program binary file from an instruction memory, the one or more instructions including an instruction having an immediate operand; determining that the immediate operand is a reference to a wide immediate operand; In response to determining that the immediate operand is a reference to a wide operand, determining whether the processing element includes an HCILT; and In response to determining that the processing element includes an HCILT, searching the HCILT for the wide immediate operand indexed by the immediate operand; and In response to finding the wide immediate operand indexed by the immediate operand in the HCILT, processing the instruction such that the immediate operand is replaced by the wide immediate operand from the HCILT.

7. The processor-based system of claim 6, wherein the processing element is further configured to: in response to not finding a wide immediate operand indexed by the immediate operand in the HCILT: Retrieving the wide immediate operand from a common intermediate lookup table CILT in the program binary file, wherein the immediate operand indexes the wide immediate operand in the CILT; and The instruction having the immediate operand is processed such that the immediate operand is replaced by the wide immediate operand from the CILT.

8. The processor-based system of claim 7, wherein the processing element is further configured to: in response to not finding the wide immediate operand indexed by the immediate operand in the HCILT, write the wide immediate operand retrieved from the CILT to the HCILT.

9. The processor-based system of claim 6, wherein the processing element is further configured to: determining that the immediate operand is not a reference to a wide immediate operand; and In response to determining that the immediate operand is not a reference to a wide immediate operand, the instruction with the immediate operand is processed.

10. The processor-based system of claim 6, wherein: The program binary file contains a common intermediate lookup table CILT, the CILT being a table that indexes immediate values ​​to wide intermediate values; and The processing element is further configured to write a plurality of entries in the CILT to the HCILT in response to a context switch of the program binary.

11. The processor-based system of claim 6, wherein the processing element is further configured to determine that the immediate operand is a reference to a wide immediate operand by being configured to determine whether a reserved bit of the immediate operand is set.

12. The processor-based system of claim 6, wherein the processing element is further configured to determine that the immediate operand is a reference to a wide immediate operand by being configured to examine an opcode of the instruction having the immediate operand.

13. The processor-based system of claim 6, wherein a wide immediate operand comprises an immediate operand that is larger than a maximum immediate length allowed by an instruction set architecture (ISA) of the processor.

14. A method for operating a processor element in a processor-based system, comprising: fetching one or more instructions associated with a program binary file from an instruction memory, the one or more instructions including an instruction having an immediate operand; determining that the immediate operand is a reference to a wide immediate operand; In response to determining that the immediate operand is a reference to a wide operand, determining whether the processor element includes a hardware common intermediate lookup table HCILT; as well as In response to determining that the processor element includes an HCILT, searching the HCILT for the wide immediate operand indexed by the immediate operand; and In response to finding the wide immediate operand indexed by the immediate operand in the HCILT, processing the instruction such that the immediate operand is replaced by the wide immediate operand from the HCILT.

15. The method according to claim 14, further comprising: determining that the processor element does not include an HCILT; In response to determining that the processor element does not include an HCILT: retrieving the wide immediate operand from a common intermediate lookup table CILT in the program binary file, wherein the immediate operand indexes the wide immediate operand in the CILT; as well as The instruction is processed such that the immediate operand is replaced by the wide immediate operand from the CILT.

16. The method according to claim 14, further comprising: In response to not finding the wide immediate operand referenced by the immediate operand in the HCILT: retrieving the wide immediate operand from a common intermediate lookup table CILT in the program binary file, wherein the immediate operand indexes the wide immediate operand in the CILT; as well as The instruction is processed such that the immediate operand is replaced by the wide immediate operand from the CILT.

17. The method according to claim 16, further comprising: In response to not finding the wide immediate operand indexed by the immediate operand in the HCILT, writing the wide immediate operand retrieved from the CILT to the HCILT.

18. The method of claim 14, wherein: The program binary file contains a common intermediate lookup table CILT, the CILT being a table that indexes immediate values ​​to wide intermediate values; and The method also includes writing a plurality of entries in the CILT to the HCILT in response to a context switch of the program binary.

19. The method according to claim 14, further comprising: determining that the immediate operand is not a reference to a wide immediate operand; as well as In response to determining that the immediate operand is not a reference to a wide immediate operand, the instruction with the immediate operand is processed.

20. The method of claim 14, wherein a wide immediate operand comprises an immediate operand that is larger than a maximum immediate length allowed by an instruction set architecture (ISA) of the processor.

Citation Information

Patent Citations

  • Device for symmetrically encoding 16 / 32-bit mixed instruction and device for decoding 16 / 32-bit mixed instruction

    CN102141903A

  • Processor with granular add immediates capability & methods

    CN104834503A