# US 2005/0097523 A1 · System for compiling source programs into machine language programs, a computer implemented method for the compiling and a computer program product for the compiling within the computer system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2005/0097523 A1
- Document ID: US20050097523A1
- Status: Published application
- Kind: A1
- Application number: 10/747,210
- Filed: 2003-12-30
- Published: 2005-05-05
- Earliest claimed: 2003-11-05
- Assignees: Kabushiki Kaisha Toshiba
- Inventors: Katsuya Uchida
- Web page: https://patentgrep.com/patent/US20050097523A1

## CPC

- G06F 8/41: Compilation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system for compiling source programs into machine language programs, comprising: a data type information processing module configured to analyze a definition statement of a fixed-point data type in a source program, acquire data type information of the fixed-point data type; a type-information storage; a variable information processing module configured to analyze a variable declaration statement of the fixed-point data type, acquire variable information; a variable storage; and a code generating module configured to read arithmetic expression data, acquire the type number, acquire the data type information, convert the arithmetic expression data.

## Claims

### Claim 1

A system for compiling source programs into machine language programs, comprising:
a data type information processing module configured to analyze a definition statement of a fixed-point data type in a source program, acquire data type information of the fixed-point data type, including at least one of a type number, a data type, a sign, a data size, a number of bits in the integral part and fractional part;
a type-information storage unit configured to store the data type information;
a variable information processing module configured to analyze a variable declaration statement of the fixed-point data type, acquire variable information including a variable name and the type number as an analysis result;
a variable storage unit configured to store the variable information; and
a code generating module configured to read arithmetic expression data including the variable in the source program, acquire the type number corresponding to the variable from the variable storage unit, acquire the data type information corresponding to the type number from the type-information storage unit, convert the arithmetic expression data including the data type information into machine language of the function calling instruction or the fixed point arithmetic instruction installed in a processor.

### Claim 2 (depends on 1)

The system of claim 1, wherein the definition statement of the fixed-point data type is described by at least one of a compiler directive, a compiler option, or the variable declaration in the source program.

### Claim 3 (depends on 1)

The system of claim 1, wherein the code generating module
compares operand types of the first fixed-point data and the second fixed-point data which are included in the arithmetic expression before converting the arithmetic expression of the fixed-point data type into a machine language;
generates a new fixed-point data operand type which is adjusted to the greater bit-number integral part and the greater bit-number fractional part within the operand types, when the integral part of one operand (A) is bigger than that of the other operand (B) and the fractional part of the operand B is bigger than that of the operand A, or the integral part of the operand B is bigger than that of the operand A and the fractional part of the operand A is bigger than that of the operand B; and
converts the operand types into the new fixed-point data operand type.

### Claim 4 (depends on 1)

The system of claim 1, wherein the definition statement of the fixed-point data type can be added as the debugging information in object codes which are compiled by the source program.

### Claim 5 (depends on 1)

The system of claim 1, wherein the integral part bit number and the fractional part bit number of the fixed-point data type are passed as parameters for run-time routines for the fixed-point data in a run-time library.

### Claim 6 (depends on 1)

The system of claim 1, wherein the definition statement of the fixed-point data type can be mix of a default fixed-point data type and the user-defined fixed-point data type which is defined by at least one of the compiler directive, the compiler option, and the variable declaration in the source program.

### Claim 7

A computer implemented method for compiling source programs into machine language programs, comprising:
analyzing a definition statement of a fixed-point data type in a source program, acquiring data type information of the fixed-point data type including at least one of a type number, a data type, a sign, a data size, a number of bits in the integral part and fractional part, and storing the data type information in a type-information storage unit;
analyzing a variable declaration statement of the fixed-point data type, acquiring variable information including a variable name and the type number as a result of the analyzing, and store the variable information in a variable storage unit; and
reading arithmetic expression data including the variable in the source program, acquiring the type number corresponding to the variable from the variable storage unit, acquiring the data type information corresponding to the type number from the type-information storage unit, converting the arithmetic expression data including the data type information into machine lauguage of a function calling instruction or the fixed point arithmetic instruction installed in a processor.

### Claim 8 (depends on 7)

The method of claim 7, wherein the definition statement of the fixed-point data type describes at least one of a compiler directive, a compiler option or the variable declaration in the source program.

### Claim 9 (depends on 7)

The method of claim 7, wherein the code generating module compares operand types of the first fixed-point data and the second fixed-point data which are included in the arithmetic expression before converting the arithmetic expression of the fixed-point data type into a machine language;
generates a new fixed-point data operand type which is adjusted for the greater bit-number integral part and the greater bit-number fractional part within the operand types, when the integral part of one operand (A) is bigger than that of the other operand (B) and the fractional part of the operand B is bigger than that of the operand A, or the integral part of the operand B is bigger than that of the operand A and the fractional part of the operand A is bigger than that of the operand B; and
converts the operand types into the new fixed-point data operand type.

### Claim 10 (depends on 7)

The method of claim 7, wherein the definition statement of the fixed-point data type can be added as the debugging information in object codes which are compiled by the source program.

### Claim 11 (depends on 7)

The method of claim 7, wherein the integral part bit number and the fractional part bit number of the fixed-point data type are passed as parameters for run-time routines for the fixed-point data in a run-time library.

### Claim 12 (depends on 7)

The method of claim 7, wherein the definition statement of the fixed-point data type can be mix of a default fixed-point data type and the user-defined fixed-point data type which is defined by at least one of the compiler directive, the compiler option, and the variable declaration in the source program.

### Claim 13

A computer program product configured to compile source programs into machine language programs within a computer system, the computer program product comprising:
an instruction configured to analyze a definition statement of a fixed-point data type in a source program, acquire data type information of the fixed-point data type, including at least one of a type number, a data type, a sign, a data size, a number of bits in the integral part and fractional part, and store the data type information in a type-information storage unit;
an instruction configured to analyze a variable declaration statement of the fixed-point data type, acquire variable information including a variable name and the type number as a result of the analyzing, and store the variable information in a variable storage unit; and
an instruction configured to read arithmetic expression data including the variable in the source program, acquire the type number corresponding to the variable from the variable storage unit, acquire the data type information corresponding to the type number from the type-information storage unit, convert the arithmetic expression data including the data type information into machine language of a function calling instruction or the fixed point arithmetic instruction installed in a processor.

### Claim 14 (depends on 13)

The product of claim 13, wherein the definition statement of the fixed-point data type is described by at least one of a compiler directive, a compiler option or the variable declaration in the source program.

### Claim 15 (depends on 13)

The product of claim 13, wherein the code generating module configured to
compare operand types of the first fixed-point data and the second fixed-point data which are included in the arithmetic expression before converting the arithmetic expression of the fixed-point data type into a machine language;
generate a new fixed-point data operand type which is adjusted for the greater bit-number integral part and the greater bit-number fractional part within the operand types, when the integral part of one operand (A) is bigger than that of the other operand (B) and the fractional part of the operand B is bigger than that of the operand A, or the integral part of the operand B is bigger than that of the operand A and the fractional part of the operand A is bigger than that of the operand B; and
convert both operand types into the new fixed-point data operand type.

### Claim 16 (depends on 13)

The product of claim 13, wherein the definition statement of the fixed-point data type can be added as the debugging information in object codes which are compiled by the source program.

### Claim 17 (depends on 13)

The product of claim 13, wherein the integral part bit number and the fractional part bit number of the fixed-point data type are passed as parameters for run-time routines for the fixed-point data in a run-time library.

### Claim 18 (depends on 13)

The product of claim 13, wherein the definition statement of the fixed-point data type can be mix of a default fixed-point data type and the user-defined fixed-point data type which is defined by at least one of the compiler directive, the compiler option, and the variable declaration in the source program.
