Apparatus for automatically converting numeric data to a processor efficient format for performing arithmetic operations
First Claim
1. A computer program product for producing computer programming code, comprising:
- a plurality of executable instructions recorded on a recordable type media, wherein said instructions, when executed by a digital computing device, cause the device to perform the steps of;
receiving source code, said source code containing a plurality of operations, each on a respective at least one operand in a fixed point representation;
generating transformed code from said source code, said step of generating transformed code comprising;
(a) automatically making a respective selective determination, for each of a plurality of said operations, whether to execute the respective operation in a floating point representation comprising the steps of;
(i) automatically generating a first relative execution performance cost associated with a first code version containing said code converting the respective at least one operand in said fixed point representation to a corresponding at least one operand in a floating point representation, said code performing a corresponding operation on the corresponding at least one operand in said floating point representation, and said code re-converting at least one result of said corresponding operation on the corresponding at least one operand in said floating point representation to said fixed point representation;
(ii) automatically generating a second relative execution performance cost associated with a second code version containing code performing the respective operation on the respective at least one operand in said fixed point representation; and
(iii) automatically selecting one of said first code version and said second code version for inclusion in said transformed code based on a comparison of said first relative execution performance cost with said second relative execution performance cost;
(b) with respect to each operation for which said step of automatically making a selective determination determines to execute the respective operation in said floating point representation;
(i) automatically generating code converting the respective at least one operand in said fixed point representation to a corresponding at least one operand in said floating point representation;
(ii) automatically generating code performing a corresponding operation on the corresponding at least one operand in said floating point representation, said corresponding operation on the corresponding at least one operand in said floating point representation corresponding to the respective operation on at least one operand in said fixed point representation; and
(iii) automatically generating code re-converting at least one result of said corresponding operation on the corresponding at least one operand in said floating point representation to said fixed point representation; and
(c) with respect to each operation for which said step of automatically making a selective determination determines not to execute the respective operation in said floating point representation, automatically generating code performing the respective operation on the respective at least one operand in said fixed point representation.
0 Assignments
0 Petitions
Accused Products
Abstract
A compiler (or interpreter) detects source language instructions performing arithmetic operations using a fixed point format (preferably packed decimal). Where the operation can be performed without loss of precision or violation of other constraints of the source language, the compiler automatically converts the operands to a floating point format (preferably Decimal Floating Point (DFP)) having hardware support, and re-converts results to the original fixed point format. Preferably, the compiler may combine multiple operations and instructions in an expression tree, analyze the tree, and selectively convert where possible. The compiler preferably performs a heuristic cost judgment in determining whether to use a particular conversion.
24 Citations
11 Claims
-
1. A computer program product for producing computer programming code, comprising:
-
a plurality of executable instructions recorded on a recordable type media, wherein said instructions, when executed by a digital computing device, cause the device to perform the steps of; receiving source code, said source code containing a plurality of operations, each on a respective at least one operand in a fixed point representation; generating transformed code from said source code, said step of generating transformed code comprising; (a) automatically making a respective selective determination, for each of a plurality of said operations, whether to execute the respective operation in a floating point representation comprising the steps of; (i) automatically generating a first relative execution performance cost associated with a first code version containing said code converting the respective at least one operand in said fixed point representation to a corresponding at least one operand in a floating point representation, said code performing a corresponding operation on the corresponding at least one operand in said floating point representation, and said code re-converting at least one result of said corresponding operation on the corresponding at least one operand in said floating point representation to said fixed point representation; (ii) automatically generating a second relative execution performance cost associated with a second code version containing code performing the respective operation on the respective at least one operand in said fixed point representation; and (iii) automatically selecting one of said first code version and said second code version for inclusion in said transformed code based on a comparison of said first relative execution performance cost with said second relative execution performance cost; (b) with respect to each operation for which said step of automatically making a selective determination determines to execute the respective operation in said floating point representation; (i) automatically generating code converting the respective at least one operand in said fixed point representation to a corresponding at least one operand in said floating point representation; (ii) automatically generating code performing a corresponding operation on the corresponding at least one operand in said floating point representation, said corresponding operation on the corresponding at least one operand in said floating point representation corresponding to the respective operation on at least one operand in said fixed point representation; and (iii) automatically generating code re-converting at least one result of said corresponding operation on the corresponding at least one operand in said floating point representation to said fixed point representation; and (c) with respect to each operation for which said step of automatically making a selective determination determines not to execute the respective operation in said floating point representation, automatically generating code performing the respective operation on the respective at least one operand in said fixed point representation. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer system for developing computer programming code, comprising:
-
at least one processor; a memory; a computer programming code generator embodied as a plurality of instructions addressable in said memory and executable on said processor, said computer programming code generator generating transformed code from source code, said source code containing a plurality of operations, each on a respective at least one operand in a fixed point representation; wherein said computer programming code generator; (a) automatically makes a respective selective determination, for each of a plurality of said operations, whether to execute the respective operation in a floating point representation comprising the steps of; (i) automatically generating a first relative execution performance cost associated with a first code version containing said code converting the respective at least one operand in said fixed point representation to a corresponding at least one operand in a floating point representation, said code performing a corresponding operation on the corresponding at least one operand in said floating point representation, and said code re-converting at least one result of said corresponding operation on the corresponding at least one operand in said floating point representation to said fixed point representation; (ii) automatically generating a second relative execution performance cost associated with a second code version containing code performing the respective operation on the respective at least one operand in said fixed point representation; and (iii) automatically selecting one of said first code version and said second code version for inclusion in said transformed code based on a comparison of said first relative execution performance cost with said second relative execution performance cost; (b) with respect to each operation for which said computer programming code generator determines to execute the respective operation in said floating point representation, generates transformed code containing; (i) at least one conversion operation converting the respective at least one operand in said fixed point representation to a corresponding at least one operand in said floating point representation; (ii) at least one operation on the corresponding at least one operand in said floating point representation which corresponds to the respective operation on at least one operand in said fixed point representation, and (iii) at least one re-conversion operation re-converting at least one result of the corresponding at least one operation on the corresponding at least one operand in said floating point representation to said fixed point representation; and (c) with respect to each operation for which said computer programming code generator determines not to execute the respective operation in said floating point representation, generating transformed code performing the respective operation on the respective at least one operand in said fixed point representation. - View Dependent Claims (9, 10, 11)
-
Specification