Patent ID: 7222227
Filing Date: 2007-05-22
Classification: G06F

Abstract:
1. A control device for speculative instruction execution, comprising: an instruction fetch unit configured to fetch an instruction to be executed by a processor; a value prediction unit configured to predict a value to be obtained as an execution result of a target instruction for prediction in the case where the instruction fetched by the instruction fetch unit is the target instruction for prediction; a branch instruction insertion unit configured to generate and dynamically insert a virtual branch instruction subsequent to the target instruction for prediction for which a value is predicted by the value prediction unit, the virtual branch instruction comparing the predicted value of the target instruction with the execution result of the target instruction to determine whether a branch is to be taken or not; an instruction issuing unit configured to hold a fetched instruction and speculatively issue an instruction subsequent to the target instruction for prediction to an execution unit without waiting for an execution result for the target instruction for prediction using the value predicted by the value prediction unit; an execution unit configured to execute an instruction issued from the instruction issuing unit; a branch prediction control unit configured to predict a branch destination for the virtual branch instruction and compare the predicted branch destination with the execution result of the virtual branch instruction after executing the virtual branch instruction; and a commit unit configured to commit each instruction executed by the execution unit, and, in a case that the predicted value and execution result of the target instruction turn out not to match by determining whether the predicted branch destination is correct or not, to invalidate and re-execute a speculatively executed instruction, wherein the branch instruction insertion unit sets the branch destination of the virtual branch instruction either to an instruction immediately after the target instruction for prediction or to the target instruction for prediction itself.