Patent ID: 6460177
Filing Date: 2002-10-01
Classification: G06F

Abstract:
A method for transforming a first set of program code into a second set of program code, each of said first and second sets of program code having been coded in an object-oriented programming language having definable classes and operator overloading capability, the first set of program code comprising one or more floating-point arithmetic operations to be performed on one or more floating-point variables defined therein, the second set of program code having one or more fixed-point arithmetic operations having been substituted for said one or more floating-point arithmetic operations, the method comprising the steps of:(a) modifying said first set of program code to produce an intermediate set of program code, said modifying of said first set of program code comprising (i) defining within said first set of program code one or more first added class definitions, each of said first added class definitions comprising a corresponding first added data type and a corresponding set of overloaded assignment operators associated therewith. each of said overloaded assignment operators defined so as to capture dynamic range information associated with variables of said corresponding first added data type upon execution of said intermediate set of program code, and (ii) changing type definitions of said one or more floating-point variables within said first set of program code to one of said first added data types: (b) compiling and executing said intermediate set of program code, thereby capturing dynamic range information associated with one or more of said variables of said first added data types; and (c) modifying said intermediate set of program code to produce said second set of program code, said modifying of said intermediate set of program code comprising (i) defining within said intermediate set of program code one or more second added class definitions, each of said second added class definitions comprising a corresponding second added data type and one or more member functions associated therewith, each of said second added data types defining a corresponding format for a fixed-point representation of a floating-point variable, each of said associated member functions defined so as to convert between one of said fixed-point representation formats and floating-point values, and (ii) changing type definitions of variables of one of said first added data types within said intermediate set of program code to one of said second added data types based upon said captured dynamic range information associated therewith, wherein said one or more first added class definitions are specified in a first header file, and wherein said step of modifying said first set of program code comprises inserting additional program code to include said first header file therein.