IP Library Granted Patent US 7,293,161
Granted Patent B1
US 7,293,161 · App. 11/106,180 · Granted Nov 6, 2007

Deferring loads and stores when a load buffer or store buffer fills during execute-ahead mode

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,293,161
App. No.
11/106,180
Granted
Nov 6, 2007
Kind
B1
Abstract

One embodiment of the present invention provides a system that facilitates deferring execution of instructions with unresolved data dependencies as they are issued for execution in program order. During a normal execution mode, the system issues instructions for execution in program order. Upon encountering an unresolved data dependency during execution of an instruction, the system generates a checkpoint that can subsequently be used to return execution of the program to the point of the instruction. Next, the system executes the instruction and subsequent instructions in an execute-ahead mode, wherein instructions that cannot be executed because of an unresolved data dependency are deferred, and wherein other non-deferred instructions are executed in program order. Upon encountering a store during the execute-ahead mode, the system determines if the store buffer is full. If so, the system prefetches a cache line for the store, and defers execution of the store.

Claims (87)

1. A method for deferring a store and generating a prefetch when a store buffer in a processor becomes full during program execution in an execute-ahead mode, comprising:

issuing instructions for execution in program order during a normal execution mode;

upon encountering an unresolved data dependency during execution of an instruction,

generating a checkpoint that can subsequently be used to return execution of the program to the point of the instruction, and

executing the instruction and subsequent instructions in the execute-ahead mode, wherein instructions that cannot be executed because of an unresolved data dependency are deferred, and wherein other non-deferred instructions are executed in program order;

upon encountering a store during the execute-ahead mode,

determining if the store buffer is full,

if the store buffer is full,

prefetching a cache line for the store, and

deferring execution of the store, and

if the store buffer is not full, executing the store; and

upon encountering a non-data-dependent stall condition in normal execution mode,

generating a checkpoint that can subsequently be used to return execution of the program to the point of the non-data-dependent stall condition;

entering a scout mode, wherein instructions are speculatively executed to prefetch future loads, but wherein results are not committed to the architectural state of the processor; and

when the non-data-dependent stall condition that caused the processor to move out of normal execution mode is finally resolved, using the checkpoint to resume execution in normal execution mode from the instruction that originally encountered the stall condition.

2. The method of claim 1 , wherein deferring the store involves inserting the store into a deferred queue, which contains deferred instructions in program order.

3. The method of claim 2 , wherein after a store is deferred into the deferred queue during execute-ahead mode, if a load is subsequently encountered, the method further comprises:

prefetching a cache line for the load, and

deferring execution of the load to prevent a possible read-after-write (RAW) hazard.

4. The method of claim 1 , wherein while executing the instruction and subsequent instructions in an execute-ahead mode, the store buffer is gated so that stores that enter the store buffer during execute-ahead mode remain in the store buffer until the processor leaves the execute-ahead mode.

5. The method of claim 1 , wherein upon encountering a load during the execute-ahead mode, the method further comprises:

determining if a load buffer is full;

if the load buffer is full,

prefetching a cache line for the load,

deferring execution of the load, and

marking a destination register for the load to indicate that the value in the destination register is subject to an unresolved data dependency; and

if the load buffer is not full, executing the load.

6. The method of claim 1 , wherein if a non-data-dependent stall condition that is not a load buffer full condition or a store buffer full condition is encountered in execute-ahead mode, the method further comprises:

entering a scout mode, wherein instructions are speculatively executed to prefetch future loads, but wherein results are not committed to the architectural state of the processor; and

when the unresolved data dependency or the non-data-dependent stall condition that originally caused the processor to move out of normal execution mode is finally resolved, using the checkpoint to resume execution in normal execution mode from the instruction that originally encountered the stall condition.

7. The method of claim 1 , wherein if the unresolved data dependency is resolved during execute-ahead mode, the method further comprises:

executing deferred instructions in a deferred mode; and

upon all deferred instructions being executed, returning to the normal execution mode to resume normal program execution from the point where the execute-ahead mode left off.

8. The method of claim 7 , wherein executing deferred instructions in the deferred mode involves:

issuing deferred instructions for execution in program order;

deferring execution of deferred instructions that still cannot be executed because of unresolved data dependencies; and

executing other deferred instructions that are able to be executed in program order.

9. The method of claim 8 , wherein if some deferred instructions are deferred again, the method further comprises returning to execute-ahead mode at the point where execute-ahead mode left off.

10. The method of claim 1 , wherein executing instructions involves keeping track of data dependencies to facilitate determining if a given instruction is subject to an unresolved data dependency.

11. The method of claim 10 , wherein keeping track of data dependencies involves maintaining state information for each register, which indicates whether or not a value in the register depends on an unresolved data-dependency.

12. An apparatus that defers a store and generates a prefetch when a store buffer in a processor becomes full during program execution in an execute-ahead mode, comprising:

an execution mechanism configured to issue instructions for execution in program order during a normal execution mode;

wherein upon encountering an unresolved data dependency during execution of an instruction, the execution mechanism is configured to,

generate a checkpoint that can subsequently be used to return execution of the program to the point of the instruction, and to

execute the instruction and subsequent instructions in the execute-ahead mode, wherein instructions that cannot be executed because of an unresolved data dependency are deferred, and wherein other non-deferred instructions are executed in program order;

wherein upon encountering a store during the execute-ahead mode, the execution mechanism is configured to,

determine if the store buffer is full,

if the store buffer is full, to

prefetch a cache line for the store, and

defer execution of the store, and

if the store buffer is not full, to execute the store; and

wherein upon encountering a non-data-dependent stall condition in normal execution mode, the execution mechanism is configured to,

generate a checkpoint that can subsequently be used to return execution of the program to the point of the non-data-dependent stall condition;

enter a scout mode, wherein instructions are speculatively executed to prefetch future loads, but wherein results are not committed to the architectural state of the processor; and

when the non-data-dependent stall condition that caused the processor to move out of normal execution mode is finally resolved, to use the checkpoint to resume execution in normal execution mode from the instruction that originally encountered the stall condition.

13. The apparatus of claim 12 , wherein deferring the store involves inserting the store into a deferred queue, which contains deferred instructions in program order.

14. The apparatus of claim 13 , wherein after a store is deferred into the deferred queue during execute-ahead mode, if a load is subsequently encountered, the execution mechanism is configured to:

prefetch a cache line for the load, and to

defer execution of the load to prevent a possible read-after-write (RAW) hazard.

15. The apparatus of claim 12 , wherein while executing the instruction and subsequent instructions in an execute-ahead mode, the store buffer is gated so that stores that enter the store buffer during execute-ahead mode remain in the store buffer until the processor leaves the execute-ahead mode.

16. The apparatus of claim 12 , wherein upon encountering a load during the execute-ahead mode, the execution mechanism is configured to:

determine if a load buffer is full;

if the load buffer is full, to

prefetch a cache line for the load,

defer execution of the load, and to

mark a destination register for the load to indicate that the value in the destination register is subject to an unresolved data dependency; and

if the load buffer is not full, to execute the load.

17. The apparatus of claim 12 , wherein if a non-data-dependent stall condition that is not a load buffer full condition or a store buffer full condition is encountered in execute-ahead mode, the execution mechanism is configured to:

enter a scout mode, wherein instructions are speculatively executed to prefetch future loads, but wherein results are not committed to the architectural state of the processor; and

when the unresolved data dependency or the non-data-dependent stall condition that originally caused the processor to move out of normal execution mode is finally resolved, to use the checkpoint to resume execution in normal execution mode from the instruction that originally encountered the stall condition.

18. A computer system that defers a store and generates a prefetch when a store buffer in a processor becomes full during program execution in an execute-ahead mode, comprising:

the processor;

a memory

an execution mechanism within the processor, which is configured to issue instructions for execution in program order during a normal execution mode;

wherein upon encountering an unresolved data dependency during execution of an instruction, the execution mechanism is configured to,

generate a checkpoint that can subsequently be used to return execution of the program to the point of the instruction, and to

execute the instruction and subsequent instructions in the execute-ahead mode, wherein instructions that cannot be executed because of an unresolved data dependency are deferred, and wherein other non-deferred instructions are executed in program order;

wherein upon encountering a store during the execute-ahead mode, the execution mechanism is configured to,

determine if the store buffer is full,

if the store buffer is full, to

prefetch a cache line for the store, and

defer execution of the store, and

if the store buffer is not full, to execute the store; and

wherein upon encountering a non-data-dependent stall condition in normal execution mode, the execution mechanism is configured to,

generate a checkpoint that can subsequently be used to return execution of the program to the point of the non-data-dependent stall condition;

enter a scout mode, wherein instructions are speculatively executed to prefetch future loads, but wherein results are not committed to the architectural state of the processor; and

when the non-data-dependent stall condition that caused the processor to move out of normal execution mode is finally resolved, to use the checkpoint to resume execution in normal execution mode from the instruction that originally encountered the stall condition.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037302/0869 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 31, 2005
From: CHAUDHRY, SHAILENDER; CAPRIOLI, PAUL; TREMBLAY, MARC
To: SUN MICROSYSTEMS, INC.
Reel/Frame 016625/0769 →