Dismiss
There will be a system update on Friday, May 5th, 6 PM ET. You may experience a brief service interruption.
Browse Prior Art Database

Method for accurate and unified techniques for speculation and recovery code generation

IP.com Disclosure Number: IPCOM000007549D
Publication Date: 2002-Apr-04

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method for accurate and unified techniques for speculation and recovery code generation. Benefits include improved performance.

This text was extracted from a Microsoft Word document.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 19% of the total text.

Method for accurate and unified techniques for speculation and recovery code generation

Disclosed is a method for accurate and unified techniques for speculation and recovery code generation. Benefits include improved performance.

Background

              Control and data speculation, which are two new features supported by 64-bit architecture, can fully exploit the instruction-level parallelism (ILP) of application programs. Speculation is one of the primary mechanisms for a compiler to exploit statistical ILP by overlapping and, therefore, tolerating the latencies of operations.

Control speculation

              Control speculation is the execution of an operation before the branch that guards it (see Figure 1). Consider the code sequence on the left-hand ­side. If the load were to be executed prior to the determination of (a>b), it is control speculative with respect to the controlling condition. If the new control speculative load causes an exception, the exception should only be serviced if (a>b) is true. The check verifies whether an exception has occurred and if so it branches to recovery code as shown at the right-hand side.

Data speculation

              Data speculation is the execution of a memory load prior to a store that precedes it and that may potentially alias with it (see Figure 2). Consider the code sequence on the left-hand side. If al and a2 cannot be disambiguated and if the load is performed prior to the store, the load is data speculative with respect to the store. Analogous to control speculation, the check verifies whether an overlap of memory references has occurred. If so, the program branches to recovery code as shown on the right-hand side. Control and data speculation may occur simultaneously. In 64-bit architecture, this situation is represented by ld.sa. Misspeculation is checked by chk.a.

Recovery code

              To preserve the original semantics of a program, both types of speculation need recovery code to recover the program state in case of misspeculation. Recovery code plays a big role in supporting control and data speculation. For control speculation, recovery code is used to handle the deferred exceptions that are generated by speculatively executed instructions. For data speculation, recovery code is used to recompute the values of advanced instructions when aliasing occurs. Recovery code is to recover the state of a sequence of speculated instructions that starts at the speculative load and is followed by its dependent instructions executed before the corresponding check instruction. This instruction sequence is also called speculative chain. Instructions on speculative chains should be recoverable. That is, they should not modify the architectural state other than general registers, floating point registers, and predicate registers. Speculative chains should not signal a register NaT consumption fault. The unrecoverable instructions should not be scheduled across the corresponding check instruction.

Cascaded speculation

              Two control speculative loads...