Patent ID: 7386844

Claim:
A computer-readable storage medium encoded with a compiler apparatus for generating a machine language program for a processor, the processor including a plurality of instruction issue units and a plurality of corresponding execution units, each instruction issue unit issuing instructions to a corresponding execution unit, and each instruction issue unit including instruction registers for storing the instructions issued to the corresponding execution unit, the compiler apparatus comprising: a parser unit operable to parse a source program by extracting, from the source program, a reserved word stored in a storage unit and by carrying out a lexical analysis of the source program; an intermediate code conversion unit operable to receive the parsed source program and convert each statement included in the parsed source program into intermediate codes according to a predetermined rule stored in the storage unit, the intermediate codes including instructions; an optimization unit operable to receive the intermediate codes and optimize scheduling of the instructions of the intermediate codes by: scheduling the instructions of the intermediate codes for each instruction cycle of a plurality of instruction cycles without changing dependencies between the instructions of the intermediate codes, each of the instruction cycles being an instruction cycle that executes instructions in parallel using the execution units; and scheduling the instructions of the intermediate codes to reduce a hamming distance between two instructions including (i) an instruction in a target instruction cycle, and (ii) an instruction in an instruction cycle that immediately precedes the target instruction cycle, the two instructions being instructions stored in instruction registers of the same instruction issue unit, the optimization unit being operable to schedule the instructions of the intermediate codes to reduce the hamming distance of instructions which are scheduled for each of the instruction cycles; and a code generation unit operable to receive the optimized intermediate codes and convert the optimized intermediate codes into machine language instructions according to a conversion table stored in the storage unit.