Compiler, compiler apparatus and compilation method
First Claim
1. A compiler that translates a source program into a machine language program, including operation definition information in which operation that corresponds to a machine language instruction specific to a target processor is defined, comprising:
- a parser step of analyzing the source program;
an intermediate code conversion step of converting the analyzed source program into intermediate codes;
an optimization step of optimizing the converted intermediate codes; and
a code generation step of converting the optimized intermediate codes into machine language instructions, wherein the intermediate code conversion step includes;
a detection sub-step of detecting whether or not any of the intermediate codes refer to the operation defined in the operation definition information; and
a substitution sub-step of substituting the intermediate code with a corresponding machine language instruction, when the intermediate code is detected, and in the optimization step, the intermediate codes are optimized, the intermediate codes including the machine language instruction substituted in the substitution sub-step.
3 Assignments
0 Petitions
Accused Products
Abstract
An operator definition file 102 and the like included in a source program 101 and a compiler 100 that translates the source program 101 into a machine language program 105 are provided. The operator definition file 102 includes definitions of various fixed point type operators by class definitions. The compiler 100 can generate effectively advanced and specific instructions that a processor executes and make improvements through expanding functions and the like without repeating frequently upgrading of the version of the compiler itself. The compiler 100 is made up of an intermediate code generation unit 121 that generates intermediate codes, a machine language instruction substitution unit 122 that substitutes the intermediate codes referring to classes defined by the operator definition file 102 with machine language instructions and an optimization unit 130 that performs optimization targeting the intermediate codes including the substituted machine language instructions.
57 Citations
41 Claims
-
1. A compiler that translates a source program into a machine language program, including operation definition information in which operation that corresponds to a machine language instruction specific to a target processor is defined, comprising:
-
a parser step of analyzing the source program;
an intermediate code conversion step of converting the analyzed source program into intermediate codes;
an optimization step of optimizing the converted intermediate codes; and
a code generation step of converting the optimized intermediate codes into machine language instructions, wherein the intermediate code conversion step includes;
a detection sub-step of detecting whether or not any of the intermediate codes refer to the operation defined in the operation definition information; and
a substitution sub-step of substituting the intermediate code with a corresponding machine language instruction, when the intermediate code is detected, and in the optimization step, the intermediate codes are optimized, the intermediate codes including the machine language instruction substituted in the substitution sub-step. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
-
-
37. A computer-readable recoding medium on which a header file included in a source program to be compiled is recorded,
wherein operation definition information in which operation that corresponds to a machine language instruction specific to a target processor is defined is a header file included in the source program, in the header file, the operation is defined by a class made up of data and a method.
-
38. A computer-readable recoding medium on which a class library included in a source program to be compiled is recorded,
wherein the compiler further comprises a class library to substitute a machine language instruction used in the operation definition information with a machine language instruction of a second processor that is different from a first processor that said compiler targets.
-
39. A computer-readable recording medium on which a source program to be compiled including at least one of a header file or a class library is recorded,
wherein operation definition information in which operation that corresponds to a machine language instruction specific to a target processor is defined is a header file included in the source program, in the header file, the operation is defined by a class made up of data and a method, and the compiler further comprises a class library to substitute a machine language instruction used in the operation definition information with a machine language instruction of a second processor that is different from a first processor that said compiler targets.
-
40. A compiler apparatus that translates a source program into a machine language program, the compiler apparatus comprising:
-
a unit operable to hold operation definition information in which operation that corresponds to a machine language instruction specific to a target processor is defined in advance;
a parser unit operable to analyze the source program;
an intermediate code conversion unit operable to convert the analyzed source program into intermediate codes;
an optimization unit operable to optimize the converted intermediate codes;
a code generation unit operable to convert the optimized intermediate codes into machine language instructions, wherein the intermediate code conversion unit includes;
a detection unit operable to detect whether or not any one of the intermediate codes that refer to the operation defined in the operation definition information;
a substitution unit operable to substitute an intermediate code with a corresponding machine language instruction, when the intermediate code is detected, and the optimization unit performs optimization with the intermediate codes including the machine language instruction substituted in the substitution unit.
-
-
41. A compilation method for translating a source program into a machine language program comprising,
a parser step of analyzing the source program; -
an intermediate code conversion step of converting the analyzed source program into intermediate codes;
an optimization step of optimizing the converted intermediate codes; and
a code generation step of converting the optimized intermediate codes into machine language instructions, and wherein the intermediate code conversion step includes;
a detection sub-step of detecting whether or not any one of the intermediate code refer to the operation defined in operation definition information in which operation that corresponds to a machine language instruction specific to a target processor is defined in advance;
a substitution sub-step of substituting an intermediate code with a corresponding machine language instruction when the intermediate code is detected, and in the optimization step, the intermediate codes are optimized, the intermediate codes including the machine language instruction substituted for the intermediate code in the substitution sub-step.
-
Specification