Patent ID: 6367076
Filing Date: 2002-04-02
Classification: G06F

Abstract:
A compiling method for compiling a source program into an object program for a CPU having multiple functional units that allow for concurrent operations and having a function of executing an instruction only when there is a predetermined relationship between an execution mode indicated by a value in a specific field in an instruction code and an execution mode managed within the CPU, the compiling method comprising the steps (a)-(d) of:(a) analyzing said source program and generating intermediate codes; (b) making an analysis of said intermediate codes; (c) allocating instructions from said intermediate codes based on said analysis; and (d) generating said object program from said allocated instructions, wherein the step (c) includes the steps (i)-(iv) of: (i) allocating an execution mode setting instruction to set the execution mode managed within the CPU; (ii) allocating instructions, such that whether the instructions are to be executed or not depends on the execution mode set by the execution mode setting instruction; (iii) finding an ending part of each of a plurality of blocks, in which its last instruction is allocated, said each of a plurality of blocks comprising one or more instructions of said allocated instructions that are identical in specific field value; and a block differing from another block in specific field value; and (iv) when an ending part of a certain block is to be earlier in said object program than an ending part of another block, allocating an unconditional branch instruction identical in specific field value to the instructions in the certain block, either to be executed in the ending part of the certain block or to be executed as soon as possible after the ending part of the block.