US20170344373A1 - Distance-based branch prediction and detection - Google Patents
Distance-based branch prediction and detection Download PDFInfo
- Publication number
- US20170344373A1 US20170344373A1 US15/440,383 US201715440383A US2017344373A1 US 20170344373 A1 US20170344373 A1 US 20170344373A1 US 201715440383 A US201715440383 A US 201715440383A US 2017344373 A1 US2017344373 A1 US 2017344373A1
- Authority
- US
- United States
- Prior art keywords
- branch
- return
- target
- distance
- computer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Abandoned
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/32—Address formation of the next instruction, e.g. by incrementing the instruction counter
- G06F9/322—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
- G06F9/324—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address using program counter relative addressing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3005—Arrangements for executing specific machine instructions to perform operations for flow control
- G06F9/30058—Conditional branch instructions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/30021—Compare instructions, e.g. Greater-Than, Equal-To, MINMAX
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3005—Arrangements for executing specific machine instructions to perform operations for flow control
- G06F9/30054—Unconditional branch instructions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30098—Register arrangements
- G06F9/3012—Organisation of register space, e.g. banked or distributed register file
- G06F9/30134—Register stacks; shift registers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/34—Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline, look ahead
- G06F9/3802—Instruction prefetching
- G06F9/3804—Instruction prefetching for branches, e.g. hedging, branch folding
- G06F9/3806—Instruction prefetching for branches, e.g. hedging, branch folding using address prediction, e.g. return stack, branch history buffer
Definitions
- the present disclosure relates to branch prediction and, in particular, to distance-based branch prediction and detection.
- Branch prediction attempts to identify the location of branches in an instruction stream that is being executed by a processor to improve performance. Accuracy is important to avoid costly branch wrong restart penalties. Branch prediction can predict both the direction and target instruction address of a branch. Alternatively, without branch prediction, the pipeline would have to wait for branch resolution before proceeding along the taken or not taken path.
- BTB branch target buffer
- CTB changing target buffer
- An example computer-implemented method may include: determining, by a processing system, a potential return instruction address (IA) by determining whether a relationship is satisfied between a first target IA and a first branch IA; storing a second branch IA as a return when a target IA of a second branch matches a potential return IA for the second branch; and applying the potential return IA for the second branch as a predicted target IA of a predicted branch IA stored as a return.
- IA potential return instruction address
- FIG. 1 illustrates a block diagram of a processing system implementing distance-based branch prediction and detection according to examples of the present disclosure
- FIG. 2 illustrates an environment implementing distance-based branch prediction and detection in a program according to examples of the present disclosure
- FIG. 3 illustrates a flow diagram of a method for branch detection and prediction according to examples of the present disclosure
- FIG. 4 illustrates a flow diagram of a method for branch detection according to examples of the present disclosure
- FIG. 5 illustrates a flow diagram of a method for branch prediction according to examples of the present disclosure.
- FIG. 6 illustrates a block diagram of a processing system for implementing the techniques described herein according to examples of the present disclosure.
- a call-return stack can be utilized to predict the target of the branch that ends a routine. This may be achieved with an instruction set that includes a call and return type instruction that tells the branch predictor when to “push” and “pop” target instruction addresses from a stack structure.
- the present techniques provide for target instruction address prediction when a branch whose target instruction address is returning from a function.
- the present techniques enable identifying branches that exhibit call-like characteristics to determine return IA's, and identify branches that exhibit return-like characteristics to apply accurate target IA prediction without architectural changes to the underlying code. This improves the functioning of the underlying processing system by preventing errors and extending functionality to existing (i.e., legacy) programs. For example, a simple call-return stack can be implemented without having to add new call or return type instructions to an instruction set.
- FIG. 1 illustrates a block diagram of a processing system 100 implementing distance-based branch prediction and detection according to examples of the present disclosure.
- the various components, modules, engines, etc. described regarding FIG. 1 may be implemented as instructions stored on a computer-readable storage medium, as hardware modules, as special-purpose hardware (e.g., application specific hardware, application specific integrated circuits (ASICs), as embedded controllers, hardwired circuitry, etc.), or as some combination or combinations of these.
- the engine(s) described herein may be a combination of hardware and programming.
- the programming may be processor executable instructions stored on a tangible memory, and the hardware may include a processing device for executing those instructions.
- a system memory can store program instructions that when executed by processing system 100 implement the engines described herein.
- Other engines may also be utilized to include other features and functionality described in other examples herein.
- Processing system 100 may include a branch detection module 110 and a branch prediction module 112 .
- the processing system 100 may include dedicated hardware, such as one or more integrated circuits, Application Specific Integrated Circuits (ASICs), Application Specific Special Processors (ASSPs), Field Programmable Gate Arrays (FPGAs), or any combination of the foregoing examples of dedicated hardware, for performing the techniques described herein.
- ASICs Application Specific Integrated Circuits
- ASSPs Application Specific Special Processors
- FPGAs Field Programmable Gate Arrays
- the branch detection module 110 performs a branch detection process to determine call-like and return-like branch instructions, for example, at completion time (i.e., past branch instruction execution time). That is, the branch detection method occurs at the point where a branch is known to be actually taken or not (i.e., a non-speculative point) as well as its correct target IA. For every completed branch taken, first, a distance D between the branches' branch instruction address (IA) and its target IA are compared. The distance may be a number of bytes, halfwords, etc. This may be done as an exact or imprecise compare.
- the next sequential IA (NSIA) of the branch instruction is saved in a completion_NSIA side register and marked as valid as a potential call so the return point is known.
- the target IA of each successive branch is compared with the saved and valid completion_NSIA side register.
- Some implementations might include the distance D comparison at this step. If the values match, a possible return type branch is indicated.
- the completion_NSIA side register is marked as invalid, completing the call-return pair, and the possible return is recorded in a branch prediction table. If the values do not match, a possible return type branch is not indicated. It is important to note that in this example implementation, only return-like branches are marked in a branch prediction table. Call-like branches can be marked too in other examples to further improve design and implementation efficiency.
- the branch prediction module 112 performs a branch prediction process whenever a predicted branch is taken.
- the distance D between the branch IA and the target IA is compared.
- the distance may be a number of bytes, halfwords, etc. This may be done as an exact or imprecise compare. If the distance D is greater than a threshold T, the NSIA is saved in a prediction_NSIA side register and marked as valid.
- the value for the target IA stored in the prediction_NSIA side register is used as the target IA prediction if the prediction_NSIA side register is marked as valid.
- the prediction_NSIA side register is marked as invalid, completing the call-return pair. Otherwise, existing target prediction structures are used. It is important to note that since only return-like branches are marked in the branch prediction tables, call-like branches continue to be predicted by existing branch predictors.
- FIG. 2 illustrates an environment 200 implementing distance-based branch detection in a program 202 according to examples of the present disclosure.
- the environment 200 implements techniques as disclosed herein to detect and predict likely branch pairs that exhibit call-return characteristics. Although illustrated as a one-entry deep queue, the present techniques apply to stacks with depth larger than one. In a stack implementation, there could be multiple instances of NSIA registers and valid bits.
- FIG. 2 illustrates the program 202 and a function 204 .
- a target instruction address (IA) of Branch X i.e., “call” function 204 ) occurs at a particular IA (e.g., 0100) which is a distance D bytes away from Branch X's IA (e.g., 0000). If the distance D is greater than the distance threshold T, a next sequential instruction address (NSIA) (e.g., 0002) after the IA for branch X is saved.
- the target IA of Branch A i.e., taken branch A 206 ) is a distance a′ bytes away from Branch A's IA.
- the target IA of branch B (i.e., taken branch B 208 ) is a distance b′ bytes away from branch B's IA.
- both the distances a′ and b′ are less than the distance threshold T, and therefore, the completion_NSIA after branch X is not replaced.
- the targets of branches A and B do not match the NSIA (i.e., 0002) following branch X; however, the target of branch Y (i.e., “return” 210 with IA 0002) does match the NSIA after branch X. This indicates a likely call-return pair.
- FIG. 3 illustrates a flow diagram of a method 300 for branch detection and prediction according to examples of the present disclosure.
- the method 300 may be performed, for example, by the processing system 100 of FIG. 1 or by another suitable processing system such as the processing system 20 of FIG. 6 .
- the method 300 starts at block 302 and continues to block 304 .
- the method 300 includes determining, by a processing system, a potential return instruction address (IA) by determining whether a relationship is satisfied between a first target IA and a first branch IA. 4 .
- the method 300 includes storing a second branch IA as a return when a target IA of a second branch matches a potential return IA for the second branch.
- the method 300 includes applying the potential return IA for the second branch as a predicted target IA of a predicted branch IA stored as a return. The method continues to block 310 and ends.
- FIGS. 4 and 5 Additional details of the branch detection and prediction are disclosed below with reference to FIGS. 4 and 5 respectively. Additional processes also may be included, and it should be understood that the processes depicted in FIG. 3 represent illustrations, and that other processes may be added or existing processes may be removed, modified, or rearranged without departing from the scope and spirit of the present disclosure.
- FIG. 4 illustrates a flow diagram of a method 400 for branch detection according to examples of the present disclosure.
- the method 400 may be performed, for example, by the processing system 100 of FIG. 1 or by another suitable processing system such as the processing system 20 of FIG. 6 .
- the method 400 starts at block 402 and continues to block 404 .
- the method 400 includes monitoring instructions and, at block 406 , detecting that a branch (e.g., branch Z) was taken and is completed.
- decision block 408 it is determined whether Z's target IA is equal to the value stored in a completion_NSIA register and whether the completion_NSIA register is valid (i.e., whether a potential return is found). If so, at block 410 , the method 400 indicates that a return capable branch is found and, at block 412 , Z is marked as return capable and the completion_NSIA register is set as invalid. Marking Z as return capable may include marking Z's metadata as return capable, for example, in a branch prediction table.
- the method 400 continues to block 420 and terminates in some examples. In other examples, the method 400 continues back to monitor additional instructions at block 404 .
- the method 400 continues to decision block 414 where the target IA for Z is compared to a threshold distance. If the target IA for Z is greater than the threshold distance away from branch Z's IA, a possible caller branch is indicated at block 416 . It should be appreciated that, in examples, the distance between the target IA and branch Z's IA is determined using an absolute value function.
- the completion_NSIA is set to equal branch Z's IA plus an instruction length code (e.g., 2 bytes, 4 bytes, 6 bytes, 8 bytes, etc.) and the completion_NSIA is set as valid.
- the method 400 continues to block 420 and terminates in some examples. In other examples, the method 400 continues back to monitor additional instructions at block 404 .
- the method 400 continues back to search monitor instructions at block 404 .
- FIG. 5 illustrates a flow diagram of a method 500 for branch prediction according to examples of the present disclosure.
- the method 500 may be performed, for example, by the processing system 100 of FIG. 1 or by another suitable processing system such as the processing system 20 of FIG. 6 .
- the method 500 starts at block 502 and continues to block 504 .
- the method 500 includes performing a branch prediction logic (BPL) search.
- BPL branch prediction logic
- a taken branch Y is predicted.
- decision block 508 it is then determined whether branch Y is return capable and whether a predicted_NSIA side register is valid. If so, at block 510 , the method 500 includes setting the predicted_NSIA side register as the target IA for branch Y, and setting the predicted_NSIA side register as invalid at block 512 .
- the method 500 continues to block 520 and terminates in some examples. In other examples, the method 500 continues back to search the BPL at block 504 .
- branch Y is not return capable and/or that the predicted_NSIA side register is invalid
- the method 500 continues to decision block 514 . If at decision block 514 it is determined that the target IA for Y is greater than a threshold distance away from branch Y's IA, a possible caller branch is found at block 516 . It should be appreciated that, in examples, the distance between the target IA and branch Y's IA is determined using an absolute value function.
- the predicted_NSIA side register is then set equal to the IA for Y plus an instruction length code and the predicted_NSIA side register is set as valid, as shown at block 518 .
- a return capable branch can only use the predicted_NSIA side register's value if the predicted branch had previously taken a wrong target (i.e., in a previous prediction, the same branch's target IA was incorrect).
- the method 500 continues to block 520 and terminates in some examples. In other examples, the method 500 continues back to search the BPL at block 504 .
- the method 500 continues back to search the BPL at block 504 .
- each branch stored In addition to typical metadata stored in each branch prediction entry, such as a branch direction history, etc., each branch stored also saves its instruction length code, indicating the length of the instruction (e.g., in bytes). This may not be necessary for some architectures with fixed instruction lengths or configurations where the branch is represented in the branch prediction entry by its ending instruction address—for example the last byte address of the instruction.
- FIG. 6 illustrates a block diagram of a processing system 20 for implementing the techniques described herein.
- processing system 20 has one or more central processing units (processors) 21 a , 21 b , 21 c , etc. (collectively or generically referred to as processor(s) 21 and/or as processing device(s)).
- processors 21 may include a reduced instruction set computer (RISC) microprocessor.
- RISC reduced instruction set computer
- processors 21 are coupled to system memory (e.g., random access memory (RAM) 24 ) and various other components via a system bus 33 .
- RAM random access memory
- ROM Read only memory
- BIOS basic input/output system
- I/O adapter 27 may be a small computer system interface (SCSI) adapter that communicates with a hard disk 23 and/or a tape storage drive 25 or any other similar component.
- I/O adapter 27 , hard disk 23 , and tape storage device 25 are collectively referred to herein as mass storage 34 .
- Operating system 40 for execution on processing system 20 may be stored in mass storage 34 .
- a network adapter 26 interconnects system bus 33 with an outside network 36 enabling processing system 20 to communicate with other such systems.
- a display (e.g., a display monitor) 35 is connected to system bus 33 by display adaptor 32 , which may include a graphics adapter to improve the performance of graphics intensive applications and a video controller.
- adapters 26 , 27 , and/or 32 may be connected to one or more I/O busses that are connected to system bus 33 via an intermediate bus bridge (not shown).
- Suitable I/O buses for connecting peripheral devices such as hard disk controllers, network adapters, and graphics adapters typically include common protocols, such as the Peripheral Component Interconnect (PCI).
- PCI Peripheral Component Interconnect
- Additional input/output devices are shown as connected to system bus 33 via user interface adapter 28 and display adapter 32 .
- a keyboard 29 , mouse 30 , and speaker 31 may be interconnected to system bus 33 via user interface adapter 28 , which may include, for example, a Super I/O chip integrating multiple device adapters into a single integrated circuit.
- processing system 20 includes a graphics processing unit 37 .
- Graphics processing unit 37 is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display.
- Graphics processing unit 37 is very efficient at manipulating computer graphics and image processing, and has a highly parallel structure that makes it more effective than general-purpose CPUs for algorithms where processing of large blocks of data is done in parallel.
- processing system 20 includes processing capability in the form of processors 21 , storage capability including system memory (e.g., RAM 24 ), and mass storage 34 , input means such as keyboard 29 and mouse 30 , and output capability including speaker 31 and display 35 .
- system memory e.g., RAM 24
- mass storage 34 e.g., RAM 24
- input means such as keyboard 29 and mouse 30
- output capability including speaker 31 and display 35 .
- a portion of system memory (e.g., RAM 24 ) and mass storage 34 collectively store an operating system such as the AIX® operating system from IBM Corporation to coordinate the functions of the various components shown in processing system 20 .
- the present techniques may be implemented as a system, a method, and/or a computer program product.
- the computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.
- the computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device.
- the computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
- a non-exhaustive list of more specific examples of the computer readable storage medium includes the following: 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), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing.
- RAM random access memory
- ROM read-only memory
- EPROM or Flash memory erasable programmable read-only memory
- SRAM static random access memory
- CD-ROM compact disc read-only memory
- DVD digital versatile disk
- memory stick a floppy disk
- a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon
- a computer readable storage medium is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
- Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network.
- the network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers.
- a network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
- Computer readable program instructions for carrying out operations of the present disclosure may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages.
- the computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
- the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
- electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
- These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
- These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
- the computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
- each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s).
- the functions noted in the block may occur out of the order noted in the figures.
- two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
- This application is a continuation of U.S. patent application Ser. No. 15/165,395, entitled “DISTANCE-BASED BRANCH PREDICTION AND DETECTION,” filed May 26, 2016, the disclosure of which is incorporated by reference herein in its entirety.
- The present disclosure relates to branch prediction and, in particular, to distance-based branch prediction and detection.
- Branch prediction attempts to identify the location of branches in an instruction stream that is being executed by a processor to improve performance. Accuracy is important to avoid costly branch wrong restart penalties. Branch prediction can predict both the direction and target instruction address of a branch. Alternatively, without branch prediction, the pipeline would have to wait for branch resolution before proceeding along the taken or not taken path.
- One current solution for predicting the target instruction address is to use a branch target buffer (BTB). The BTB stores what the target instruction address was for a branch the last time the branch was encountered. This approach works well for branches whose target instruction addresses are not a function of the path taken to arrive at the branch. However, for branches whose target instruction addresses are a function of the path taken to arrive at the branch, history based structures may be used, such as a changing target buffer (CTB).
- According to examples of the present disclosure, techniques including methods, systems, and/or computer program products for distance-based branch prediction are provided. An example computer-implemented method may include: determining, by a processing system, a potential return instruction address (IA) by determining whether a relationship is satisfied between a first target IA and a first branch IA; storing a second branch IA as a return when a target IA of a second branch matches a potential return IA for the second branch; and applying the potential return IA for the second branch as a predicted target IA of a predicted branch IA stored as a return.
- Additional features and advantages are realized through the techniques of the present disclosure. Other aspects are described in detail herein and are considered a part of the disclosure. For a better understanding of the present disclosure with the advantages and the features, refer to the following description and to the drawings.
- The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other features, and advantages thereof, are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
-
FIG. 1 illustrates a block diagram of a processing system implementing distance-based branch prediction and detection according to examples of the present disclosure; -
FIG. 2 illustrates an environment implementing distance-based branch prediction and detection in a program according to examples of the present disclosure; -
FIG. 3 illustrates a flow diagram of a method for branch detection and prediction according to examples of the present disclosure; -
FIG. 4 illustrates a flow diagram of a method for branch detection according to examples of the present disclosure; -
FIG. 5 illustrates a flow diagram of a method for branch prediction according to examples of the present disclosure; and -
FIG. 6 illustrates a block diagram of a processing system for implementing the techniques described herein according to examples of the present disclosure. - Various implementations are described below by referring to several examples of distance-based branch prediction. For code with well-defined call and return instructions, a call-return stack (CRS) can be utilized to predict the target of the branch that ends a routine. This may be achieved with an instruction set that includes a call and return type instruction that tells the branch predictor when to “push” and “pop” target instruction addresses from a stack structure.
- Implementing a call-return stack in hardware that is based on an instruction set architecture (ISA) that does not have call and return instructions well defined is difficult due to the cost of accurately identifying call-like and return-like instructions. Even if an ISA is enriched with call-return type instructions, the full benefit of a call-return stack is not realized. It is often the case that code is not routinely recompiled if an instruction set is enriched with new instructions, such as call-return type instructions. Furthermore, only select modules of code may be recompiled, leading to cases where some code has either the new call-return instruction but the module it links does not have the corresponding paired instruction. Old code is not able to exploit a new call-return stack prediction mechanism if it requires the use of the new instruction.
- In some implementations, the present techniques provide for target instruction address prediction when a branch whose target instruction address is returning from a function. The present techniques enable identifying branches that exhibit call-like characteristics to determine return IA's, and identify branches that exhibit return-like characteristics to apply accurate target IA prediction without architectural changes to the underlying code. This improves the functioning of the underlying processing system by preventing errors and extending functionality to existing (i.e., legacy) programs. For example, a simple call-return stack can be implemented without having to add new call or return type instructions to an instruction set.
- Moreover, existing code can exploit the branch prediction techniques described herein without being recompiled, saving processing and memory resources to the benefit of the processing system. This increases the performance of the processing system implementing the code because the code does not have to be recompiled and because the likelihood of corresponding instructions being unpaired is reduced. Additionally, the present techniques may accurately predict call-return like pairs that a traditional branch target buffer or changing target buffer fails to distinguish. These and other advantages will be apparent from the description that follows.
-
FIG. 1 illustrates a block diagram of aprocessing system 100 implementing distance-based branch prediction and detection according to examples of the present disclosure. The various components, modules, engines, etc. described regardingFIG. 1 may be implemented as instructions stored on a computer-readable storage medium, as hardware modules, as special-purpose hardware (e.g., application specific hardware, application specific integrated circuits (ASICs), as embedded controllers, hardwired circuitry, etc.), or as some combination or combinations of these. In examples, the engine(s) described herein may be a combination of hardware and programming. The programming may be processor executable instructions stored on a tangible memory, and the hardware may include a processing device for executing those instructions. Thus, a system memory can store program instructions that when executed byprocessing system 100 implement the engines described herein. Other engines may also be utilized to include other features and functionality described in other examples herein. -
Processing system 100 may include abranch detection module 110 and abranch prediction module 112. Alternatively or additionally, theprocessing system 100 may include dedicated hardware, such as one or more integrated circuits, Application Specific Integrated Circuits (ASICs), Application Specific Special Processors (ASSPs), Field Programmable Gate Arrays (FPGAs), or any combination of the foregoing examples of dedicated hardware, for performing the techniques described herein. - The
branch detection module 110 performs a branch detection process to determine call-like and return-like branch instructions, for example, at completion time (i.e., past branch instruction execution time). That is, the branch detection method occurs at the point where a branch is known to be actually taken or not (i.e., a non-speculative point) as well as its correct target IA. For every completed branch taken, first, a distance D between the branches' branch instruction address (IA) and its target IA are compared. The distance may be a number of bytes, halfwords, etc. This may be done as an exact or imprecise compare. If the distance is greater than a threshold T, the next sequential IA (NSIA) of the branch instruction is saved in a completion_NSIA side register and marked as valid as a potential call so the return point is known. Next, the target IA of each successive branch is compared with the saved and valid completion_NSIA side register. Some implementations might include the distance D comparison at this step. If the values match, a possible return type branch is indicated. The completion_NSIA side register is marked as invalid, completing the call-return pair, and the possible return is recorded in a branch prediction table. If the values do not match, a possible return type branch is not indicated. It is important to note that in this example implementation, only return-like branches are marked in a branch prediction table. Call-like branches can be marked too in other examples to further improve design and implementation efficiency. - Similar to the branch detection process described above, the
branch prediction module 112 performs a branch prediction process whenever a predicted branch is taken. The distance D between the branch IA and the target IA is compared. The distance may be a number of bytes, halfwords, etc. This may be done as an exact or imprecise compare. If the distance D is greater than a threshold T, the NSIA is saved in a prediction_NSIA side register and marked as valid. Next, for every predicted taken branch marked as a return in the branch prediction tables, the value for the target IA stored in the prediction_NSIA side register is used as the target IA prediction if the prediction_NSIA side register is marked as valid. The prediction_NSIA side register is marked as invalid, completing the call-return pair. Otherwise, existing target prediction structures are used. It is important to note that since only return-like branches are marked in the branch prediction tables, call-like branches continue to be predicted by existing branch predictors. -
FIG. 2 illustrates anenvironment 200 implementing distance-based branch detection in aprogram 202 according to examples of the present disclosure. Theenvironment 200 implements techniques as disclosed herein to detect and predict likely branch pairs that exhibit call-return characteristics. Although illustrated as a one-entry deep queue, the present techniques apply to stacks with depth larger than one. In a stack implementation, there could be multiple instances of NSIA registers and valid bits. - In particular,
FIG. 2 illustrates theprogram 202 and afunction 204. A target instruction address (IA) of Branch X (i.e., “call” function 204) occurs at a particular IA (e.g., 0100) which is a distance D bytes away from Branch X's IA (e.g., 0000). If the distance D is greater than the distance threshold T, a next sequential instruction address (NSIA) (e.g., 0002) after the IA for branch X is saved. The target IA of Branch A (i.e., taken branch A 206) is a distance a′ bytes away from Branch A's IA. Similarly, the target IA of branch B (i.e., taken branch B 208) is a distance b′ bytes away from branch B's IA. In this example, both the distances a′ and b′ are less than the distance threshold T, and therefore, the completion_NSIA after branch X is not replaced. The targets of branches A and B do not match the NSIA (i.e., 0002) following branch X; however, the target of branch Y (i.e., “return” 210 with IA 0002) does match the NSIA after branch X. This indicates a likely call-return pair. -
FIG. 3 illustrates a flow diagram of amethod 300 for branch detection and prediction according to examples of the present disclosure. Themethod 300 may be performed, for example, by theprocessing system 100 ofFIG. 1 or by another suitable processing system such as theprocessing system 20 ofFIG. 6 . Themethod 300 starts atblock 302 and continues to block 304. - At
block 304, themethod 300 includes determining, by a processing system, a potential return instruction address (IA) by determining whether a relationship is satisfied between a first target IA and a first branch IA. 4. Atblock 306, themethod 300 includes storing a second branch IA as a return when a target IA of a second branch matches a potential return IA for the second branch. Atblock 308, themethod 300 includes applying the potential return IA for the second branch as a predicted target IA of a predicted branch IA stored as a return. The method continues to block 310 and ends. - Additional details of the branch detection and prediction are disclosed below with reference to
FIGS. 4 and 5 respectively. Additional processes also may be included, and it should be understood that the processes depicted inFIG. 3 represent illustrations, and that other processes may be added or existing processes may be removed, modified, or rearranged without departing from the scope and spirit of the present disclosure. -
FIG. 4 illustrates a flow diagram of amethod 400 for branch detection according to examples of the present disclosure. Themethod 400 may be performed, for example, by theprocessing system 100 ofFIG. 1 or by another suitable processing system such as theprocessing system 20 ofFIG. 6 . - The
method 400 starts atblock 402 and continues to block 404. Atblock 404, themethod 400 includes monitoring instructions and, atblock 406, detecting that a branch (e.g., branch Z) was taken and is completed. Atdecision block 408, it is determined whether Z's target IA is equal to the value stored in a completion_NSIA register and whether the completion_NSIA register is valid (i.e., whether a potential return is found). If so, atblock 410, themethod 400 indicates that a return capable branch is found and, atblock 412, Z is marked as return capable and the completion_NSIA register is set as invalid. Marking Z as return capable may include marking Z's metadata as return capable, for example, in a branch prediction table. Themethod 400 continues to block 420 and terminates in some examples. In other examples, themethod 400 continues back to monitor additional instructions atblock 404. - However, if at
decision block 408, it is determined that Z's target IA is not equal to the value stored in a completion_NSIA register and/or it is determined that the completion_NSIA register is invalid, themethod 400 continues to decision block 414 where the target IA for Z is compared to a threshold distance. If the target IA for Z is greater than the threshold distance away from branch Z's IA, a possible caller branch is indicated atblock 416. It should be appreciated that, in examples, the distance between the target IA and branch Z's IA is determined using an absolute value function. Atblock 418, the completion_NSIA is set to equal branch Z's IA plus an instruction length code (e.g., 2 bytes, 4 bytes, 6 bytes, 8 bytes, etc.) and the completion_NSIA is set as valid. Themethod 400 continues to block 420 and terminates in some examples. In other examples, themethod 400 continues back to monitor additional instructions atblock 404. - If at
decision block 414, the target IA for Z is not greater than the threshold distance away from branch Z's IA, themethod 400 continues back to search monitor instructions atblock 404. - Additional processes also may be included, and it should be understood that the processes depicted in
FIG. 4 represent illustrations, and that other processes may be added or existing processes may be removed, modified, or rearranged without departing from the scope and spirit of the present disclosure. -
FIG. 5 illustrates a flow diagram of amethod 500 for branch prediction according to examples of the present disclosure. Themethod 500 may be performed, for example, by theprocessing system 100 ofFIG. 1 or by another suitable processing system such as theprocessing system 20 ofFIG. 6 . - The
method 500 starts atblock 502 and continues to block 504. Atblock 504, themethod 500 includes performing a branch prediction logic (BPL) search. Atblock 506, a taken branch Y is predicted. Atdecision block 508, it is then determined whether branch Y is return capable and whether a predicted_NSIA side register is valid. If so, atblock 510, themethod 500 includes setting the predicted_NSIA side register as the target IA for branch Y, and setting the predicted_NSIA side register as invalid atblock 512. Themethod 500 continues to block 520 and terminates in some examples. In other examples, themethod 500 continues back to search the BPL atblock 504. - However, if at
decision block 508, it is determined that branch Y is not return capable and/or that the predicted_NSIA side register is invalid, themethod 500 continues todecision block 514. If atdecision block 514 it is determined that the target IA for Y is greater than a threshold distance away from branch Y's IA, a possible caller branch is found atblock 516. It should be appreciated that, in examples, the distance between the target IA and branch Y's IA is determined using an absolute value function. The predicted_NSIA side register is then set equal to the IA for Y plus an instruction length code and the predicted_NSIA side register is set as valid, as shown atblock 518. Similar to other auxiliary target IA prediction structures like the CTB, a return capable branch can only use the predicted_NSIA side register's value if the predicted branch had previously taken a wrong target (i.e., in a previous prediction, the same branch's target IA was incorrect). Themethod 500 continues to block 520 and terminates in some examples. In other examples, themethod 500 continues back to search the BPL atblock 504. - If at
decision block 514, the target IA for Y is not greater than the threshold distance away from branch Y's IA, themethod 500 continues back to search the BPL atblock 504. - In addition to typical metadata stored in each branch prediction entry, such as a branch direction history, etc., each branch stored also saves its instruction length code, indicating the length of the instruction (e.g., in bytes). This may not be necessary for some architectures with fixed instruction lengths or configurations where the branch is represented in the branch prediction entry by its ending instruction address—for example the last byte address of the instruction.
- Additional processes also may be included, and it should be understood that the processes depicted in
FIG. 6 represent illustrations, and that other processes may be added or existing processes may be removed, modified, or rearranged without departing from the scope and spirit of the present disclosure. - It is understood in advance that the present disclosure is capable of being implemented in conjunction with any other type of computing environment now known or later developed. For example,
FIG. 6 illustrates a block diagram of aprocessing system 20 for implementing the techniques described herein. In examples,processing system 20 has one or more central processing units (processors) 21 a, 21 b, 21 c, etc. (collectively or generically referred to as processor(s) 21 and/or as processing device(s)). In aspects of the present disclosure, each processor 21 may include a reduced instruction set computer (RISC) microprocessor. Processors 21 are coupled to system memory (e.g., random access memory (RAM) 24) and various other components via asystem bus 33. Read only memory (ROM) 22 is coupled tosystem bus 33 and may include a basic input/output system (BIOS), which controls certain basic functions ofprocessing system 20. - Further illustrated are an input/output (I/O)
adapter 27 and acommunications adapter 26 coupled tosystem bus 33. I/O adapter 27 may be a small computer system interface (SCSI) adapter that communicates with ahard disk 23 and/or atape storage drive 25 or any other similar component. I/O adapter 27,hard disk 23, andtape storage device 25 are collectively referred to herein asmass storage 34.Operating system 40 for execution onprocessing system 20 may be stored inmass storage 34. Anetwork adapter 26interconnects system bus 33 with anoutside network 36 enablingprocessing system 20 to communicate with other such systems. - A display (e.g., a display monitor) 35 is connected to
system bus 33 bydisplay adaptor 32, which may include a graphics adapter to improve the performance of graphics intensive applications and a video controller. In one aspect of the present disclosure,adapters system bus 33 via an intermediate bus bridge (not shown). Suitable I/O buses for connecting peripheral devices such as hard disk controllers, network adapters, and graphics adapters typically include common protocols, such as the Peripheral Component Interconnect (PCI). Additional input/output devices are shown as connected tosystem bus 33 via user interface adapter 28 anddisplay adapter 32. Akeyboard 29,mouse 30, andspeaker 31 may be interconnected tosystem bus 33 via user interface adapter 28, which may include, for example, a Super I/O chip integrating multiple device adapters into a single integrated circuit. - In some aspects of the present disclosure,
processing system 20 includes a graphics processing unit 37. Graphics processing unit 37 is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display. In general, graphics processing unit 37 is very efficient at manipulating computer graphics and image processing, and has a highly parallel structure that makes it more effective than general-purpose CPUs for algorithms where processing of large blocks of data is done in parallel. - Thus, as configured herein,
processing system 20 includes processing capability in the form of processors 21, storage capability including system memory (e.g., RAM 24), andmass storage 34, input means such askeyboard 29 andmouse 30, and outputcapability including speaker 31 anddisplay 35. In some aspects of the present disclosure, a portion of system memory (e.g., RAM 24) andmass storage 34 collectively store an operating system such as the AIX® operating system from IBM Corporation to coordinate the functions of the various components shown inprocessing system 20. - The present techniques may be implemented as a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.
- The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: 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), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
- Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
- Computer readable program instructions for carrying out operations of the present disclosure may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some examples, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
- Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to aspects of the present disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
- These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
- The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
- The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various aspects of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.
- The descriptions of the various examples of the present disclosure have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described techniques. The terminology used herein was chosen to best explain the principles of the present techniques, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the techniques disclosed herein.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US15/440,383 US20170344373A1 (en) | 2016-05-26 | 2017-02-23 | Distance-based branch prediction and detection |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US15/165,395 US10908902B2 (en) | 2016-05-26 | 2016-05-26 | Distance based branch prediction and detection of potential call and potential return instructions |
US15/440,383 US20170344373A1 (en) | 2016-05-26 | 2017-02-23 | Distance-based branch prediction and detection |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/165,395 Continuation US10908902B2 (en) | 2016-05-26 | 2016-05-26 | Distance based branch prediction and detection of potential call and potential return instructions |
Publications (1)
Publication Number | Publication Date |
---|---|
US20170344373A1 true US20170344373A1 (en) | 2017-11-30 |
Family
ID=60417936
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/165,395 Active 2036-07-25 US10908902B2 (en) | 2016-05-26 | 2016-05-26 | Distance based branch prediction and detection of potential call and potential return instructions |
US15/440,383 Abandoned US20170344373A1 (en) | 2016-05-26 | 2017-02-23 | Distance-based branch prediction and detection |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/165,395 Active 2036-07-25 US10908902B2 (en) | 2016-05-26 | 2016-05-26 | Distance based branch prediction and detection of potential call and potential return instructions |
Country Status (1)
Country | Link |
---|---|
US (2) | US10908902B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200264887A1 (en) * | 2019-02-19 | 2020-08-20 | International Business Machines Corporation | Call/return stack branch target predictor to multiple next sequential instruction addresses |
US11663126B1 (en) | 2022-02-23 | 2023-05-30 | International Business Machines Corporation | Return address table branch predictor |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5974543A (en) * | 1998-01-23 | 1999-10-26 | International Business Machines Corporation | Apparatus and method for performing subroutine call and return operations |
US6385720B1 (en) * | 1997-07-14 | 2002-05-07 | Matsushita Electric Industrial Co., Ltd. | Branch prediction method and processor using origin information, relative position information and history information |
US20020157000A1 (en) * | 2001-03-01 | 2002-10-24 | International Business Machines Corporation | Software hint to improve the branch target prediction accuracy |
US20080126770A1 (en) * | 2006-11-28 | 2008-05-29 | Michael William Morrow | Methods and apparatus for recognizing a subroutine call |
US7441110B1 (en) * | 1999-12-10 | 2008-10-21 | International Business Machines Corporation | Prefetching using future branch path information derived from branch prediction |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5313634A (en) | 1992-07-28 | 1994-05-17 | International Business Machines Corporation | Computer system branch prediction of subroutine returns |
US5574871A (en) | 1994-01-04 | 1996-11-12 | Intel Corporation | Method and apparatus for implementing a set-associative branch target buffer |
US6289444B1 (en) | 1999-06-02 | 2001-09-11 | International Business Machines Corporation | Method and apparatus for subroutine call-return prediction |
US6704877B2 (en) * | 2000-12-29 | 2004-03-09 | Intel Corporation | Dynamically changing the performance of devices in a computer platform |
US7200740B2 (en) | 2001-05-04 | 2007-04-03 | Ip-First, Llc | Apparatus and method for speculatively performing a return instruction in a microprocessor |
US6874081B2 (en) | 2001-05-17 | 2005-03-29 | Broadcom Corporation | Selection of link and fall-through address using a bit in a branch address for the selection |
US7082520B2 (en) | 2002-05-09 | 2006-07-25 | International Business Machines Corporation | Branch prediction utilizing both a branch target buffer and a multiple target table |
US9952869B2 (en) * | 2009-11-04 | 2018-04-24 | Ceva D.S.P. Ltd. | System and method for using a branch mis-prediction buffer |
US8943299B2 (en) | 2010-06-17 | 2015-01-27 | International Business Machines Corporation | Operating a stack of information in an information handling system |
US10534611B2 (en) | 2014-07-31 | 2020-01-14 | International Business Machines Corporation | Branch prediction using multi-way pattern history table (PHT) and global path vector (GPV) |
-
2016
- 2016-05-26 US US15/165,395 patent/US10908902B2/en active Active
-
2017
- 2017-02-23 US US15/440,383 patent/US20170344373A1/en not_active Abandoned
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6385720B1 (en) * | 1997-07-14 | 2002-05-07 | Matsushita Electric Industrial Co., Ltd. | Branch prediction method and processor using origin information, relative position information and history information |
US5974543A (en) * | 1998-01-23 | 1999-10-26 | International Business Machines Corporation | Apparatus and method for performing subroutine call and return operations |
US7441110B1 (en) * | 1999-12-10 | 2008-10-21 | International Business Machines Corporation | Prefetching using future branch path information derived from branch prediction |
US20020157000A1 (en) * | 2001-03-01 | 2002-10-24 | International Business Machines Corporation | Software hint to improve the branch target prediction accuracy |
US20080126770A1 (en) * | 2006-11-28 | 2008-05-29 | Michael William Morrow | Methods and apparatus for recognizing a subroutine call |
Non-Patent Citations (4)
Title |
---|
Lopes, Branch Prediction, Oct 31 2014, 37 pages, [retrieved from the internet on 1/25/2018], retrieved from URL <web.njit.edu/~rlopes/Mod5.3.pdf> * |
Losq, Subroutine Return Address Stack, Dec 1 1981, TDB 12-81, 4 pages, [retrieved from the internet on 1/26/2018], retrieved from URL <ip.com/IPCOM/000048093> * |
StackOverFlow How do I find the difference between two values without knowing which is larger, Nov 28 2012, 5 pages, [retrieved from the internet on 1/24/2018], retrieved from URL <stackoverflow.com/questions/13602170/how-do-i-find-the-difference-between-two-values-without-knowing-which-is-larger> * |
Webb, Subroutine Call/Return Stack, April 1 1988, TDB 04-88, 6 pages, [retrieved from the internet on 1/25/2018], retrieved from URL <ip.com/IPCOM/000057277> * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200264887A1 (en) * | 2019-02-19 | 2020-08-20 | International Business Machines Corporation | Call/return stack branch target predictor to multiple next sequential instruction addresses |
US10990405B2 (en) * | 2019-02-19 | 2021-04-27 | International Business Machines Corporation | Call/return stack branch target predictor to multiple next sequential instruction addresses |
US11663126B1 (en) | 2022-02-23 | 2023-05-30 | International Business Machines Corporation | Return address table branch predictor |
Also Published As
Publication number | Publication date |
---|---|
US20170344371A1 (en) | 2017-11-30 |
US10908902B2 (en) | 2021-02-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10467010B2 (en) | Method and apparatus for nearest potential store tagging | |
US10740107B2 (en) | Operation of a multi-slice processor implementing load-hit-store handling | |
US10031757B2 (en) | Operation of a multi-slice processor implementing a mechanism to overcome a system hang | |
US9715377B1 (en) | Behavior based code recompilation triggering scheme | |
US11086748B2 (en) | Packet flow tracing in a parallel processor complex | |
US10908902B2 (en) | Distance based branch prediction and detection of potential call and potential return instructions | |
US9495138B1 (en) | Scheme for verifying the effects of program optimizations | |
US10282207B2 (en) | Multi-slice processor issue of a dependent instruction in an issue queue based on issue of a producer instruction | |
US10740104B2 (en) | Tagging target branch predictors with context with index modification and late stop fetch on tag mismatch | |
US10127047B2 (en) | Operation of a multi-slice processor with selective producer instruction types | |
US20170228234A1 (en) | Parallel dispatching of multi-operation instructions in a multi-slice computer processor | |
US20160125017A1 (en) | Detection of data replication consistency | |
US10467008B2 (en) | Identifying an effective address (EA) using an interrupt instruction tag (ITAG) in a multi-slice processor | |
US9652245B2 (en) | Branch prediction for indirect jumps by hashing current and previous branch instruction addresses | |
US10990405B2 (en) | Call/return stack branch target predictor to multiple next sequential instruction addresses | |
US11157281B2 (en) | Prefetching data based on register-activity patterns | |
US10528353B2 (en) | Generating a mask vector for determining a processor instruction address using an instruction tag in a multi-slice processor | |
US20180004516A1 (en) | Administering instruction tags in a computer processor | |
US11138050B2 (en) | Operation of a multi-slice processor implementing a hardware level transfer of an execution thread | |
US10977034B2 (en) | Instruction completion table with ready-to-complete vector | |
US20150234968A1 (en) | Pipeline depth exploration in a register transfer level design description of an electronic circuit | |
US10248421B2 (en) | Operation of a multi-slice processor with reduced flush and restore latency | |
US10310860B2 (en) | Starting and stopping instruction dispatch to execution unit queues in a multi-pipeline processor | |
US20230063079A1 (en) | Speculative resolution of last branch-on-count at fetch | |
US10120683B2 (en) | Supporting even instruction tag (‘ITAG’) requirements in a multi-slice processor using null internal operations (IOPs) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:BONANNO, JAMES J.;CADIGAN, MICHAEL J., JR;COLLURA, ADAM B.;AND OTHERS;SIGNING DATES FROM 20160524 TO 20160525;REEL/FRAME:041358/0813 |
|
AS | Assignment |
Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y Free format text: CORRECTIVE ASSIGNMENT TO CORRECT THE THIRD INVENTOR'S EXECUTION DOC. DATE PREVIOUSLY RECORDED AT REEL: 041358 FRAME: 0813. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT;ASSIGNORS:BONNANO, JAMES J.;CADIGAN, MICHAEL J., JR;COLLURA, ADAM B.;AND OTHERS;SIGNING DATES FROM 20160524 TO 20160526;REEL/FRAME:041941/0952 |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: DOCKETED NEW CASE - READY FOR EXAMINATION |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: NON FINAL ACTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: RESPONSE TO NON-FINAL OFFICE ACTION ENTERED AND FORWARDED TO EXAMINER |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: FINAL REJECTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: ADVISORY ACTION MAILED |
|
STCB | Information on status: application discontinuation |
Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION |