Branch prediction method and device, electronic equipment and storage medium

By randomly transforming the local predictor, global predictor and selection predictor of TournamentBP, local historical index, global historical index and selection historical index are generated, which solves the problem of too large number of table items and alias in TournamentBP, and reduces the area and power consumption and improves the accuracy of the branch predictor.

CN120371403APending Publication Date: 2025-07-25SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510489793.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

Among the existing TournamentBP branch predictors, the number of table entries of the local predictor, global predictor and selection predictor is large, resulting in excessive area and power consumption and serious aliases.

Method used

The local predictor, global predictor and selection predictor are based on the local history mask, global history mask and selection history mask respectively, and randomly transform the branch address or global history of the prediction instruction to generate local history index, global history index and selection history index to reduce the possibility of index overlap and reduce the number of table entries.

Benefits of technology

The size and power consumption of local predictors, global predictors and selection predictors is significantly reduced, and the accuracy and efficiency of branch prediction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371403A_ABST
    Figure CN120371403A_ABST
Patent Text Reader

Abstract

The invention provides a branch prediction method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the steps of obtaining a to-be-predicted instruction; performing random transformation on the branch address of the instruction to be predicted based on the local historical mask through a local predictor to obtain a local historical index, and determining a local prediction result based on the local historical index; performing random transformation on the global history of the thread where the instruction to be predicted is located through a global predictor based on the global history mask to obtain a global history index, and determining a global prediction result based on the global history index; and performing random transformation on the global history of the thread where the to-be-predicted instruction is located through the selection predictor based on the selection history mask to obtain a selection history index, and determining a branch prediction result corresponding to the to-be-predicted instruction based on the selection history index. According to the invention, the size and power consumption of the local predictor, the global predictor and the selection predictor can be significantly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a branch prediction method, apparatus, electronic device, and storage medium. Background Art

[0002] In a high-performance superscalar processor, there are usually more than ten or even more than twenty pipeline depths. In order to ensure the processing efficiency of the superscalar processor in such a deep pipeline design, it is necessary to perform branch prediction on instructions. The branch prediction technology first performs branch direction prediction by a branch direction predictor to determine whether a jump occurs at the current branch address. If no jump occurs, instructions are fetched sequentially; if a jump occurs, the branch address predictor predicts the jump address of the branch instruction. Among them, the branch direction predictor includes a 2-bit (bit) branch predictor, a tournament branch predictor (TournamentBP), a branch predictor based on tagged geometric history length (TAGE), a perceptron-based branch predictor (Perceptron Predictor), and the like.

[0003] For TournamentBP, it combines the global branch jump history and the local branch jump history through the cooperation of the local predictor, the global predictor, and the selector predictor, and can obtain a relatively high branch prediction accuracy. When performing branch prediction based on TournamentBP, the local predictor, the global predictor, and the selector predictor directly intercept a part of the global or local branch jump history as the corresponding index value, read the value of the corresponding saturation counter based on the index value, and determine their own output results based on the value of the saturation counter. However, this method will cause a relatively serious alias problem, that is, the same index value will point to multiple results. To alleviate the alias problem, in TournamentBP, the number of table entries used by the local predictor, the global predictor, and the selector predictor is usually large, resulting in an excessive overall area and power consumption of TournamentBP. Summary of the Invention

[0004] The present disclosure provides a branch prediction method, apparatus, electronic device, and storage medium to at least solve the above technical problems existing in the prior art.

[0005] According to a first aspect of the present disclosure, there is provided a branch prediction method, including: obtaining an instruction to be predicted; randomly transforming the branch address of the instruction to be predicted based on a local history mask by a local predictor to obtain a local history index, and determining a local prediction result based on the local history index; the local prediction result indicating whether the instruction to be predicted jumps; randomly transforming the global history of the thread where the instruction to be predicted is located based on a global history mask by a global predictor to obtain a global history index, and determining a global prediction result based on the global history index; the global prediction result indicating whether the instruction to be predicted jumps; randomly transforming the global history of the thread where the instruction to be predicted is located based on a selection history mask by a selection predictor to obtain a selection history index, and determining a branch prediction result corresponding to the instruction to be predicted based on the selection history index; the branch prediction result being the local prediction result or the global prediction result.

[0006] In an implementable embodiment, the randomly transforming the branch address of the instruction to be predicted based on the local history mask includes: performing a subtraction operation on the number of entries in the local history table to obtain the local history mask; performing a shift operation on the branch address of the instruction to be predicted to obtain a shifted address; performing an AND operation on the shifted address and the local history mask to obtain a local history intermediate index; and randomly transforming the local history intermediate index to obtain the local history index.

[0007] In an implementable embodiment, the randomly transforming the local history intermediate index to obtain the local history index includes: performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and the shifted address to obtain the local history index; or performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a random number to obtain the local history index.

[0008] In an implementable embodiment, the determining the local prediction result based on the local history index includes: reading a corresponding first saturation counter value in a local saturation counter table based on the local history index; comparing the first saturation counter value with a local threshold to obtain a first comparison result; and determining the local prediction result based on the first comparison result.

[0009] In an implementable embodiment, the randomly transforming the global history of the thread where the instruction to be predicted is located based on the global history mask includes: performing an AND operation on the global history and the global history mask to obtain a global history intermediate index; and randomly transforming the global history intermediate index to obtain the global history index.

[0010] In one possible implementation, the random transformation of the global history intermediate index to obtain the global history index includes: performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and the global history to obtain the global history index; or, performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and a random number to obtain the global history index.

[0011] In one possible implementation, the determination of the global prediction result based on the global history index includes: reading a corresponding second saturation counter value from a global saturation counter table based on the global history index; comparing the second saturation counter value with a global threshold to obtain a second comparison result; and determining the global prediction result based on the second comparison result.

[0012] In one possible implementation, the random transformation of the global history of the thread where the instruction to be predicted is located based on the selection history mask includes: performing an AND operation on the global history and the selection history mask to obtain a selection history intermediate index; and performing a random transformation on the selection history intermediate index to obtain the selection history index.

[0013] In one possible implementation, the random transformation of the selection history intermediate index to obtain the selection history index includes: performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and the global history to obtain the selection history index; or, performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and a random number to obtain the selection history index.

[0014] In one possible implementation, the determination of the branch prediction result corresponding to the instruction to be predicted based on the selection history index includes: reading a corresponding third saturation counter value from a selection saturation counter table based on the selection history index; comparing the third saturation counter value with a selection threshold to obtain a third comparison result; and determining the branch prediction result corresponding to the instruction to be predicted based on the third comparison result.

[0015] In one possible implementation, the determination of the branch prediction result corresponding to the instruction to be predicted based on the third comparison result includes: in response to the third comparison result indicating that the third saturation counter value is greater than the selection threshold, determining the global prediction result as the branch prediction result corresponding to the instruction to be predicted; and in response to the third comparison result indicating that the third saturation counter value is not greater than the selection threshold, determining the local prediction result as the branch prediction result corresponding to the instruction to be predicted.

[0016] According to a second aspect of the present disclosure, there is provided a branch prediction apparatus, including: an acquisition module configured to acquire an instruction to be predicted; a random transformation module configured to randomly transform a branch address of the instruction to be predicted based on a local history mask by a local predictor to obtain a local history index; a determination module configured to determine a local prediction result based on the local history index; the local prediction result indicating whether the instruction to be predicted jumps; the random transformation module is further configured to randomly transform a global history of the thread where the instruction to be predicted is located based on a global history mask by a global predictor to obtain a global history index; the determination module is further configured to determine a global prediction result based on the global history index; the global prediction result indicating whether the instruction to be predicted jumps; the random transformation module is further configured to randomly transform the global history of the thread where the instruction to be predicted is located based on a selection history mask by a selection predictor to obtain a selection history index; the determination module is further configured to determine a branch prediction result corresponding to the instruction to be predicted based on the selection history index; the branch prediction result being the local prediction result or the global prediction result.

[0017] In an implementable manner, the random transformation module is further configured to: perform a decrement operation on the number of entries in a local history table to obtain the local history mask; perform a shift operation on the branch address of the instruction to be predicted to obtain a shifted address; perform an AND operation on the shifted address and the local history mask to obtain a local history intermediate index; and randomly transform the local history intermediate index to obtain the local history index.

[0018] In an implementable manner, the random transformation module is further configured to: perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and the shifted address to obtain the local history index; or perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a random number to obtain the local history index.

[0019] In an implementable manner, the determination module is further configured to: read a corresponding first saturation counter value in a local saturation counter table based on the local history index; compare the first saturation counter value with a local threshold to obtain a first comparison result; and determine the local prediction result based on the first comparison result.

[0020] In an implementable manner, the random transformation module is further configured to: perform an AND operation on the global history and the global history mask to obtain a global history intermediate index; and randomly transform the global history intermediate index to obtain the global history index.

[0021] In one implementable manner, the random transformation module is further configured to: perform at least one of an OR operation, an exclusive OR operation, a permutation operation, and an addition operation on the global historical intermediate index and the global history to obtain the global history index; or, perform at least one of an OR operation, an exclusive OR operation, a permutation operation, and an addition operation on the global historical intermediate index and a random number to obtain the global history index.

[0022] In one implementable manner, the determining module is further configured to: read a corresponding second saturation counter value from the global saturation counter table based on the global history index; compare the second saturation counter value with a global threshold to obtain a second comparison result; and determine the global prediction result based on the second comparison result.

[0023] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0024] at least one processor; and

[0025] a memory communicatively connected to the at least one processor; wherein,

[0026] the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method described in the present disclosure.

[0027] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method described in the present disclosure.

[0028] A branch prediction method, apparatus, electronic device, and storage medium according to the present disclosure perform a random transformation on the branch address of a to-be-predicted instruction based on a local history mask by a local predictor to obtain a local history index, and determine a local prediction result based on the local history index; perform a random transformation on the global history of the thread where the to-be-predicted instruction is located based on a global history mask by a global predictor to obtain a global history index, and determine a global prediction result based on the global history index; perform a random transformation on the global history of the thread where the to-be-predicted instruction is located based on a selection history mask by a selection predictor to obtain a selection history index, and determine a branch prediction result corresponding to the to-be-predicted instruction based on the selection history index. Thus, in the process of the TournamentBP determining the local history index, global history index, and selection history index, a random transformation will be respectively performed on the branch address or global history of the to-be-predicted instruction based on the local history mask, global history mask, and selection history mask, so that the possibility of overlap of the obtained local history index, global history index, and selection history index is greatly reduced, and the number of table entries used by the local predictor, global predictor, and selection predictor can be significantly reduced, thereby significantly reducing the size and power consumption of the local predictor, global predictor, and selection predictor.

[0029] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] By referring to the drawings and reading the following detailed description, the above and other objects, features, and advantages of the exemplary embodiments of the present disclosure will become easily understood. In the drawings, several embodiments of the present disclosure are shown in an exemplary rather than restrictive manner, where:

[0031] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0032] Figure 1 The flowchart of a branch prediction method according to an embodiment of the present disclosure is shown Figure 1 ;

[0033] Figure 2 The flowchart of a branch prediction method according to an embodiment of the present disclosure is shown Figure 2 ;

[0034] Figure 3 The flowchart of a branch prediction method according to an embodiment of the present disclosure is shown Figure 3 ;

[0035] Figure 4 The flowchart of a branch prediction method according to an embodiment of the present disclosure is shown Figure 4 ;

[0036] Figure 5 Shows a scenario schematic of a branch prediction method according to an embodiment of the present disclosure Figure 1 ;

[0037] Figure 6 Shows a scenario schematic of a branch prediction method according to an embodiment of the present disclosure Figure 2 ;

[0038] Figure 7 Shows a scenario schematic of a branch prediction method according to an embodiment of the present disclosure Figure 3 ;

[0039] Figure 8 Shows a structural schematic diagram of a branch prediction device according to an embodiment of the present disclosure;

[0040] Figure 9 Shows a composition structural schematic diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners

[0041] To make the objectives, features, and advantages of the present disclosure more obvious and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present disclosure.

[0042] Figure 1 Shows a flow schematic of a branch prediction method according to an embodiment of the present disclosure Figure 1 , such as Figure 1 shown, a branch prediction method includes:

[0043] Step S101, obtain an instruction to be predicted.

[0044] In this embodiment, a branch prediction method can be applied to TournamentBP, and the instruction to be predicted is a branch instruction, which can be generated by conditional judgment statements, loop statements, etc. In one example, the front-end instruction fetch unit will send branch instructions to TournamentBP in sequence for direction prediction of branch instructions.

[0045] Step S102, randomly transform the branch address of the instruction to be predicted based on a local history mask by a local predictor to obtain a local history index, and determine a local prediction result based on the local history index.

[0046] In this embodiment, the local predictor in TournamentBP mainly uses the local historical information of the branch instruction itself to predict the branch direction, that is, it uses the past jump behavior of the current branch instruction to predict the branch direction; the bit width of the local history mask is usually related to the size of the local history table, and its function is to intercept specific bits in the branch address of the instruction to be predicted, so as to generate a local history index based on the intercepted specific bits; the branch address of the instruction to be predicted is the program counter (PC, Program Counter) address of the instruction to be predicted, and the PC address is used to locate the position of the branch instruction in the memory. In TournamentBP, the PC address is used as the key value to look up the branch history record, and the historical jump behavior of each branch instruction is usually recorded and indexed according to its PC address.

[0047] In this embodiment, the local predictor can randomly transform the branch address of the instruction to be predicted based on the local history mask to obtain a local history index. Among them, the random transformation can be realized by a combination of various arithmetic operations, and the random transformation can reduce the possibility of local history index overlap. In an example, the local history mask and the branch address can be subjected to an AND operation, and the values at any position in the result of the AND operation can be exchanged to obtain a local history index.

[0048] In this embodiment, the local prediction result can be determined based on the local history index, and the local prediction result indicates whether the instruction to be predicted jumps. In an example, the historical jump behavior of the instruction to be predicted can be determined based on the local history index, and whether the instruction to be predicted jumps can be determined based on the historical jump behavior of the instruction to be predicted.

[0049] Step S103, the global predictor randomly transforms the global history of the thread where the instruction to be predicted is located based on the global history mask to obtain a global history index, and determines the global prediction result based on the global history index.

[0050] In this embodiment, the global predictor in TournamentBP mainly uses the global history of the thread where the instruction to be predicted is located to predict the branch direction, that is, it uses the historical jump behaviors of all branch instructions in the thread where the instruction to be predicted is located to predict the branch direction; the bit width of the global history mask is usually related to the size of the global history table, and its function is to intercept specific bits from the global history to generate a global history index based on the intercepted specific bits.

[0051] In this embodiment, the global predictor can perform a random transformation on the global history of the thread where the instruction to be predicted is located based on the global history mask, so as to obtain a global history index. Among them, the random transformation can be implemented through a combination of various arithmetic operations, and the random transformation can reduce the possibility of overlapping global history indexes. In one example, an AND operation can be performed on the global history mask and the global history, and the values at any position in the result of the AND operation can be exchanged to obtain the global history index.

[0052] In this embodiment, the global prediction result can be determined based on the global history index, and the global prediction result indicates whether the instruction to be predicted jumps. In one example, the corresponding global history jump behavior can be determined based on the global history index, and whether the instruction to be predicted jumps can be determined based on the global history jump behavior.

[0053] Step S104: The selection predictor performs a random transformation on the global history of the thread where the instruction to be predicted is located based on the selection history mask to obtain a selection history index, and determines the branch prediction result corresponding to the instruction to be predicted based on the selection history index.

[0054] In this embodiment, the selection predictor in TournamentBP is mainly used to dynamically select the local prediction result or the global prediction result; the bit width of the selection history mask is usually related to the size of the selection history table, and its function is to intercept specific bits from the global history to generate a selection history index based on the intercepted specific bits.

[0055] In this embodiment, the selection predictor can perform a random transformation on the global history of the thread where the instruction to be predicted is located based on the selection history mask, so as to obtain a selection history index. Among them, the random transformation can be implemented through a combination of various arithmetic operations, and the random transformation can reduce the possibility of overlapping selection history indexes. In one example, an AND operation can be performed on the selection history mask and the global history, and the values at any position in the result of the AND operation can be exchanged to obtain the selection history index.

[0056] In this embodiment, the branch prediction result corresponding to the instruction to be predicted can be determined based on the selection history index, and the branch prediction result is the local prediction result or the global prediction result. In one example, the corresponding selection history information can be determined based on the global history index, and whether the branch prediction result is the local prediction result or the global prediction result can be determined based on the selection history information.

[0057] In the present disclosure, during the process of the TournamentBP determining the local history index, the global history index, and the selection history index, the branch address or the global history of the instruction to be predicted is randomly transformed based on the local history mask, the global history mask, and the selection history mask respectively, so as to greatly reduce the possibility of overlap of the obtained local history index, global history index, and selection history index. The number of entries used by the local predictor, the global predictor, and the selection predictor can be significantly reduced, thereby significantly reducing the size and power consumption of the local predictor, the global predictor, and the selection predictor.

[0058] Figure 2 The flowchart of a branch prediction method according to an embodiment of the present disclosure is shown Figure 2 , as Figure 2 shown, the "randomly transforming the branch address of the instruction to be predicted based on the local history mask" in step S102 includes:

[0059] Step S201, perform a decrement operation on the number of entries in the local history table to obtain the local history mask.

[0060] In this embodiment, the purpose of generating the local history mask is to limit the local history index within the range of entries. Therefore, a decrement operation needs to be performed on the number of entries in the local history table to obtain the local history mask. For example, if the size of the local history table (LHT, Local History Table) is 1024 entries, then the local history mask is 1023.

[0061] Step S202, perform a shift operation on the branch address of the instruction to be predicted to obtain the shifted address.

[0062] In this embodiment, after obtaining the branch address of the instruction to be predicted, a shift operation is performed on it. The number of shift bits is usually determined according to actual requirements. For example, the branch address can be shifted right by 2 bits. The purpose of the shift operation is to remove some inefficient bits in the branch address and align the bit width of the entry address.

[0063] Step S203, perform an AND operation on the shifted address and the local history mask to obtain the local history intermediate index.

[0064] In this embodiment, an AND operation is performed on the shifted address and the local history mask to obtain the local history intermediate index. For example, if the shifted address is 0x1234 and the local history mask is 0x03FF, then the local history intermediate index obtained after the bitwise AND operation is 0x0234.

[0065] Step S204, randomly transform the local history intermediate index to obtain the local history index.

[0066] In this embodiment, in order to reduce the alias problem, it is also necessary to perform a random transformation on the local history intermediate index. The random transformation can be implemented through various arithmetic operations, such as at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation.

[0067] In an implementable manner, performing a random transformation on the local history intermediate index to obtain a local history index includes: performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a shift address to obtain the local history index; or, performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a random number to obtain the local history index. Among them, the permutation operation represents exchanging the values at any position in the local history intermediate index and the shift address or the random number. For example, exchanging the values of the lower 5 bits of the local history intermediate index and the lower 5 bits of the shift address; the random number can be generated based on a pseudo-random number generator.

[0068] In the present disclosure, first performing an AND operation on the shift address and the local history mask to obtain a local history intermediate index, and then performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and the shift address to obtain a local history index, or performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a random number to obtain a local history index can reduce the possibility of overlap of the local history index, improve the utilization rate of the local history table, and the accuracy of prediction.

[0069] In another embodiment, "determining a local prediction result based on the local history index" in step S102 includes:

[0070] Based on the local history index, reading a corresponding first saturation counter value in the local saturation counter table; comparing the first saturation counter value with a local threshold to obtain a first comparison result; and determining a local prediction result based on the first comparison result.

[0071] In this embodiment, the local saturation counter table (LCT, Local Saturation Counter Table) stores the saturation counter values corresponding to each branch address, and the saturation counter values reflect the jump tendency of the branch in the historical execution.

[0072] In this embodiment, based on the local history index, the corresponding first saturation counter value can be read from the local saturation counter table, the read first saturation counter value is compared with the local threshold, and the local prediction result is determined based on the first comparison result. In one example, if the local threshold is set to 2, when the first saturation counter value is greater than 2, it is considered that the branch tends to jump, and the local prediction result is jump; conversely, if the first saturation counter value is less than or equal to 2, it is considered that the branch does not tend to jump, and the local prediction result is no jump.

[0073] Figure 3 The flowchart of a branch prediction method according to an embodiment of the present disclosure is shown Figure 3 , as Figure 3 shown, "randomly transform the global history of the thread where the instruction to be predicted is located based on the global history mask" in step S103 includes:

[0074] Step S301, perform an AND operation on the global history and the global history mask to obtain a global history intermediate index.

[0075] Step S302, randomly transform the global history intermediate index to obtain a global history index.

[0076] In this embodiment, perform a bitwise AND operation on the global history of the thread where the instruction to be predicted is located and the global history mask to obtain a global history intermediate index. For example, assume the global history is 0b101011110011010 and the global history mask is 0b000011111111111, then the global history intermediate index obtained after the bitwise AND operation is 0b000011110011010. Then, randomly transform the global history intermediate index. The random transformation can be implemented through various arithmetic operations, such as at least one of OR operation, XOR operation, permutation operation, and addition operation, so as to reduce the alias problem.

[0077] In an implementable manner, randomly transforming the global history intermediate index to obtain a global history index includes: performing at least one of OR operation, XOR operation, permutation operation, and addition operation on the global history intermediate index and the global history to obtain a global history index; or, performing at least one of OR operation, XOR operation, permutation operation, and addition operation on the global history intermediate index and a random number to obtain a global history index. Among them, the permutation operation represents exchanging the values at any position in the global history intermediate index and the global history or the random number. For example, exchange the values of the lower 5 bits of the global history intermediate index and the lower 5 bits of the global history; the random number can be generated based on a pseudo-random number generator.

[0078] In the present disclosure, an AND operation is performed on the global history and the global history mask to obtain a global history intermediate index, and then at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation is performed on the global history intermediate index and the global history to obtain a global history index, or at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation is performed on the global history intermediate index and a random number to obtain a global history index, which can reduce the possibility of global history index overlap and improve the utilization rate of the global history table and the prediction accuracy.

[0079] In another embodiment, "determining a global prediction result based on the global history index" in step S103 includes:

[0080] Based on the global history index, read the corresponding second saturation counter value in the global saturation counter table; compare the second saturation counter value with the global threshold to obtain a second comparison result; determine the global prediction result based on the second comparison result.

[0081] In this embodiment, the global saturation counter table (GHT, Global History Table) records the jump tendencies of branches under different global history conditions.

[0082] In this embodiment, based on the global history index, the corresponding second saturation counter value can be read in the global saturation counter table, the read second saturation counter value is compared with the global threshold, and the global prediction result is determined based on the second comparison result. In one example, if the global threshold is set to 3, when the second saturation counter value is greater than 3, it is considered that the branch tends to jump, and the global prediction result is jump; conversely, if the second saturation counter value is less than or equal to 3, it is considered that the branch does not tend to jump, and the global prediction result is no jump.

[0083] Figure 4 Shows the flow schematic of a branch prediction method according to an embodiment of the present disclosure Figure 4 , such as Figure 4 shown, "randomly transforming the global history of the thread where the instruction to be predicted is located based on the selection history mask" in step S104 includes:

[0084] Step S401, perform an AND operation on the global history and the selection history mask to obtain a selection history intermediate index.

[0085] Step S402, randomly transform the selection history intermediate index to obtain a selection history index.

[0086] In this embodiment, a bitwise AND operation is performed on the global history of the thread where the instruction to be predicted is located and the selection history mask to obtain a selection history intermediate index. For example, if the current global history is 0b101011110011010 and the selection history mask is 0b11111111111, the selection history intermediate index obtained after the bitwise AND operation is 0b000011110011010. Then, a random transformation is performed on the selection history intermediate index, and the random transformation can be implemented through various arithmetic operations, such as at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation, so as to reduce the aliasing problem.

[0087] In an implementable manner, performing a random transformation on the selection history intermediate index to obtain a selection history index includes: performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and the global history to obtain a selection history index; or, performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and a random number to obtain a selection history index. Among them, the permutation operation represents exchanging the values at any position in the selection history intermediate index and the global history or the random number. For example, exchanging the values of the lower 5 bits of the selection history intermediate index and the lower 5 bits of the global history; the random number can be generated based on a pseudo-random number generator.

[0088] In the present disclosure, performing an AND operation on the global history and the selection history mask to obtain a selection history intermediate index, and then performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and the global history to obtain a selection history index, or performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and a random number to obtain a selection history index can reduce the possibility of overlap of the selection history index, improve the utilization rate of the selection history table, and the accuracy of prediction.

[0089] In another embodiment, "determining the branch prediction result corresponding to the instruction to be predicted based on the selection history index" in step S104 includes:

[0090] Based on the selection history index, reading the corresponding third saturation counter value in the selective saturation counter table; comparing the third saturation counter value with a selection threshold to obtain a third comparison result; determining the branch prediction result corresponding to the instruction to be predicted based on the third comparison result.

[0091] In this embodiment, the selective saturation counter table (SCT, Selective Saturation Counter Table) records the tendency to select global prediction results or local prediction results under different selection history conditions.

[0092] In this embodiment, based on the selected history index, the corresponding third saturation counter value can be read from the selection saturation counter table, the read third saturation counter value is compared with the selection threshold, and the branch prediction result corresponding to the instruction to be predicted is determined based on the third comparison result.

[0093] In an implementable manner, determining the branch prediction result corresponding to the instruction to be predicted based on the third comparison result includes: in response to the third comparison result indicating that the third saturation counter value is greater than the selection threshold, determining the global prediction result as the branch prediction result corresponding to the instruction to be predicted; in response to the third comparison result indicating that the third saturation counter value is not greater than the selection threshold, determining the local prediction result as the branch prediction result corresponding to the instruction to be predicted. In an example, if the selection threshold is set to 2, when the third saturation counter value is greater than 2, it is considered that the global prediction result should be preferentially selected under the current selected history condition, that is, the global prediction result is determined as the final branch prediction result; conversely, if the third saturation counter value is less than or equal to 2, it is considered that the local prediction result should be preferentially selected, that is, the local prediction result is determined as the final branch prediction result.

[0094] Figure 5 The scenario of a branch prediction method according to an embodiment of the present disclosure is shown Figure 1 , as Figure 5 shown, the local predictor of TournamentBP performs a shift operation on the branch address of the instruction to be predicted to obtain a shifted address, and performs a decrement operation on the number of entries in the local history table to obtain a local history mask, and then performs an AND operation on the shifted address and the local history mask to obtain a local history intermediate index, and performs an XOR operation on the local history intermediate index and the shifted address to obtain a local history index. Finally, based on the local history index, the corresponding first saturation counter value is read from the local saturation counter table, and the first saturation counter value is compared with the local threshold. If the first saturation counter value is greater than the local threshold, the local prediction result is jump; if the first saturation counter value is not greater than the local threshold, the local prediction result is not jump.

[0095] Figure 6 The scenario of a branch prediction method according to an embodiment of the present disclosure is shown Figure 2 , as Figure 6As shown, the global predictor of TournamentBP performs an AND operation on the global history and the global history mask to obtain the global history intermediate index, then performs an XOR operation on the global history intermediate index and the global history to obtain the global history index. Finally, based on the global history index, the corresponding second saturation counter value is read from the global saturation counter table, and the second saturation counter value is compared with the global threshold. If the second saturation counter value is greater than the global threshold, the global prediction result is a jump; if the second saturation counter value is not greater than the global threshold, the global prediction result is no jump.

[0096] Figure 7 The scenario schematic of a branch prediction method according to an embodiment of the present disclosure is shown Figure 3 , such as Figure 7 As shown, the selection predictor of TournamentBP performs an AND operation on the global history and the selection history mask to obtain the selection history intermediate index, then performs an XOR operation on the selection history intermediate index and the global history to obtain the selection history index. Finally, based on the selection history index, the corresponding third saturation counter value is read from the selection saturation counter table, and the third saturation counter value is compared with the selection threshold. If the third saturation counter value is greater than the selection threshold, the global prediction result is determined as the branch prediction result corresponding to the instruction to be predicted; if the third saturation counter value is not greater than the selection threshold, the local prediction result is determined as the branch prediction result corresponding to the instruction to be predicted.

[0097] Figure 8 The structural schematic diagram of a branch prediction device according to an embodiment of the present disclosure is shown, such as Figure 8 As shown, a branch prediction device includes:

[0098] An acquisition module 10, configured to acquire an instruction to be predicted;

[0099] A random transformation module 11, configured to randomly transform the branch address of the instruction to be predicted based on a local history mask through a local predictor to obtain a local history index;

[0100] A determination module 12, configured to determine a local prediction result based on the local history index; the local prediction result indicates whether the instruction to be predicted jumps;

[0101] The random transformation module 11 is further configured to randomly transform the global history of the thread where the instruction to be predicted is located based on a global history mask through a global predictor to obtain a global history index;

[0102] The determination module 12 is further configured to determine a global prediction result based on the global history index; the global prediction result indicates whether the instruction to be predicted jumps;

[0103] The random transformation module 11 is further configured to perform a random transformation on the global history of the thread where the instruction to be predicted is located based on the selection history mask by means of a selector predictor, so as to obtain a selection history index;

[0104] The determination module 12 is further configured to determine a branch prediction result corresponding to the instruction to be predicted based on the selection history index; the branch prediction result is a local prediction result or a global prediction result.

[0105] In an implementable manner, the random transformation module 11 is further configured to: perform a decrement operation on the number of entries in the local history table to obtain a local history mask; perform a shift operation on the branch address of the instruction to be predicted to obtain a shifted address; perform an AND operation on the shifted address and the local history mask to obtain a local history intermediate index; perform a random transformation on the local history intermediate index to obtain a local history index.

[0106] In an implementable manner, the random transformation module 11 is further configured to: perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and the shifted address to obtain a local history index; or, perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a random number to obtain a local history index.

[0107] In an implementable manner, the determination module 12 is further configured to: read a corresponding first saturation counter value in the local saturation counter table based on the local history index; compare the first saturation counter value with a local threshold to obtain a first comparison result; determine a local prediction result based on the first comparison result.

[0108] In an implementable manner, the random transformation module 11 is further configured to: perform an AND operation on the global history and the global history mask to obtain a global history intermediate index; perform a random transformation on the global history intermediate index to obtain a global history index.

[0109] In an implementable manner, the random transformation module 11 is further configured to: perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and the global history to obtain a global history index; or, perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and a random number to obtain a global history index.

[0110] In an implementable manner, the determination module 12 is further configured to: read a corresponding second saturation counter value in the global saturation counter table based on the global history index; compare the second saturation counter value with a global threshold to obtain a second comparison result; determine a global prediction result based on the second comparison result.

[0111] In an implementable manner, the random transformation module 11 is further configured to: perform an AND operation on the global history and the selection history mask to obtain a selection history intermediate index; perform a random transformation on the selection history intermediate index to obtain a selection history index.

[0112] In an implementable manner, the random transformation module 11 is further configured to: perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and the global history to obtain a selection history index; or, perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and a random number to obtain a selection history index.

[0113] In an implementable manner, the determination module 12 is further configured to: read a corresponding third saturation counter value from the selection saturation counter table based on the selection history index; compare the third saturation counter value with a selection threshold to obtain a third comparison result; determine a branch prediction result corresponding to the to-be-predicted instruction based on the third comparison result.

[0114] In an implementable manner, the determination module 12 is further configured to: in response to the third comparison result indicating that the third saturation counter value is greater than the selection threshold, determine the global prediction result as the branch prediction result corresponding to the to-be-predicted instruction; in response to the third comparison result indicating that the third saturation counter value is not greater than the selection threshold, determine the local prediction result as the branch prediction result corresponding to the to-be-predicted instruction.

[0115] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device and a readable storage medium.

[0116] Figure 9 FIG. shows a schematic block diagram of an exemplary electronic device 800 that can be used to implement the embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0117] As Figure 9As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to computer programs stored in a read-only memory (ROM) 802 or computer programs loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0118] Multiple components in device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disc, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0119] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 executes the various methods and processes described above, such as a branch prediction method. For example, in some embodiments, a branch prediction method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of a branch prediction method described above can be executed. Alternatively, in other embodiments, the computing unit 801 can be configured to execute a branch prediction method by any other appropriate means (e.g., by means of firmware).

[0120] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0121] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.

[0122] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input received from the user can be in any form (including acoustic input, speech input, or tactile input).

[0124] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.

[0125] A computer system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client - server relationship is created by computer programs running on the respective computers and having a client - server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating blockchain.

[0126] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. No limitation is made herein.

[0127] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this disclosure, "a plurality" means two or more unless otherwise specifically defined.

[0128] As described above, it is only the specific implementation manner of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present disclosure can easily think of changes or substitutions, which should all be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claimed rights.

Claims

1. A branch prediction method, characterized in that, The method includes: Obtaining an instruction to be predicted; Randomly transforming the branch address of the instruction to be predicted based on a local history mask by a local predictor to obtain a local history index, and determining a local prediction result based on the local history index; the local prediction result indicates whether the instruction to be predicted jumps; Randomly transforming the global history of the thread where the instruction to be predicted is located based on a global history mask by a global predictor to obtain a global history index, and determining a global prediction result based on the global history index; the global prediction result indicates whether the instruction to be predicted jumps; Randomly transforming the global history of the thread where the instruction to be predicted is located based on a selection history mask by a selection predictor to obtain a selection history index, and determining a branch prediction result corresponding to the instruction to be predicted based on the selection history index; the branch prediction result is the local prediction result or the global prediction result.

2. The method according to claim 1, wherein The randomly transforming the branch address of the instruction to be predicted based on the local history mask includes: Performing a decrement operation on the number of entries in the local history table to obtain the local history mask; Performing a shift operation on the branch address of the instruction to be predicted to obtain a shifted address; Performing an AND operation on the shifted address and the local history mask to obtain a local history intermediate index; Randomly transforming the local history intermediate index to obtain the local history index.

3. The method according to claim 2, wherein The randomly transforming the local history intermediate index to obtain the local history index includes: Performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and the shifted address to obtain the local history index; or, Performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a random number to obtain the local history index.

4. The method according to claim 1, wherein The determining the local prediction result based on the local history index includes: Reading a corresponding first saturation counter value in a local saturation counter table based on the local history index; Comparing the first saturation counter value with a local threshold to obtain a first comparison result; Determining the local prediction result based on the first comparison result.

5. The method according to claim 1, wherein The randomly transforming the global history of the thread where the instruction to be predicted is located based on the global history mask includes: Performing an AND operation on the global history and the global history mask to obtain a global history intermediate index; Randomly transforming the global history intermediate index to obtain the global history index.

6. The method according to claim 5, characterized in that, The randomly transforming the global history intermediate index to obtain the global history index includes: Performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and the global history to obtain the global history index; or, Performing at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and a random number to obtain the global history index.

7. The method according to claim 1, wherein The determining the global prediction result based on the global history index includes: Read a corresponding second saturation counter value from a global saturation counter table based on the global history index; Compare the second saturation counter value with a global threshold to obtain a second comparison result; Determine the global prediction result based on the second comparison result.

8. The method according to claim 1, wherein The random transformation of the global history of the thread where the instruction to be predicted is located based on the selection history mask includes: Perform an AND operation on the global history and the selection history mask to obtain a selection history intermediate index; Perform a random transformation on the selection history intermediate index to obtain the selection history index.

9. The method according to claim 8, wherein The performing a random transformation on the selection history intermediate index to obtain the selection history index includes: Perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and the global history to obtain the selection history index; or Perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the selection history intermediate index and a random number to obtain the selection history index.

10. The method according to claim 1, characterized in that, The determining the branch prediction result corresponding to the instruction to be predicted based on the selection history index includes: Read a corresponding third saturation counter value from a selection saturation counter table based on the selection history index; Compare the third saturation counter value with a selection threshold to obtain a third comparison result; Determine the branch prediction result corresponding to the instruction to be predicted based on the third comparison result.

11. The method according to claim 10, wherein The determining the branch prediction result corresponding to the instruction to be predicted based on the third comparison result includes: In response to the third comparison result indicating that the third saturation counter value is greater than the selection threshold, determine the global prediction result as the branch prediction result corresponding to the instruction to be predicted; In response to the third comparison result indicating that the third saturation counter value is not greater than the selection threshold, determine the local prediction result as the branch prediction result corresponding to the instruction to be predicted.

12. A branch prediction device, characterized in that, The apparatus includes: An acquisition module, configured to acquire an instruction to be predicted; A random transformation module, configured to perform a random transformation on a branch address of the instruction to be predicted through a local predictor based on a local history mask to obtain a local history index; A determination module, configured to determine a local prediction result based on the local history index; the local prediction result indicates whether the instruction to be predicted jumps; The random transformation module is further configured to perform a random transformation on the global history of the thread where the instruction to be predicted is located through a global predictor based on a global history mask to obtain a global history index; The determination module is further configured to determine a global prediction result based on the global history index; the global prediction result indicates whether the instruction to be predicted jumps; The random transformation module is further configured to perform a random transformation on the global history of the thread where the instruction to be predicted is located through a selection predictor based on a selection history mask to obtain a selection history index; The determination module is further configured to determine the branch prediction result corresponding to the instruction to be predicted based on the selection history index; the branch prediction result is the local prediction result or the global prediction result.

13. The device according to claim 12, characterized in that, The random transformation module is further configured to: Decrement the number of entries in the local history table to obtain the local history mask; Perform a shift operation on the branch address of the instruction to be predicted to obtain a shifted address; Perform an AND operation on the shifted address and the local history mask to obtain a local history intermediate index; Perform a random transformation on the local history intermediate index to obtain the local history index.

14. The device according to claim 13, wherein The random transformation module is further configured to: Perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and the shifted address to obtain the local history index; or, Perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the local history intermediate index and a random number to obtain the local history index.

15. The device according to claim 12, characterized in that, The determination module is further configured to: Read a corresponding first saturation counter value in the local saturation counter table based on the local history index; Compare the first saturation counter value with a local threshold to obtain a first comparison result; Determine the local prediction result based on the first comparison result.

16. The device according to claim 12, characterized in that, The random transformation module is further configured to: Perform an AND operation on the global history and the global history mask to obtain a global history intermediate index; Perform a random transformation on the global history intermediate index to obtain the global history index.

17. The device according to claim 16, characterized in that, The random transformation module is further configured to: Perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and the global history to obtain the global history index; or, Perform at least one of an OR operation, an XOR operation, a permutation operation, and an addition operation on the global history intermediate index and a random number to obtain the global history index.

18. The device according to claim 12, characterized in that, The determination module is further configured to: Read a corresponding second saturation counter value in the global saturation counter table based on the global history index; Compare the second saturation counter value with a global threshold to obtain a second comparison result; Determine the global prediction result based on the second comparison result.

19. An electronic device, characterized in that, Comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-11.

20. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause a computer to execute the method according to any one of claims 1-11.