Patent ID: 7530061

Claim:
A method for enabling programmatic access to the widest mode floating-point arithmetic supported by a processor, wherein the processor transfers data between memory and its floating-point registers without loss of range or precision, the method comprising the steps of: (a) defining a floating-point data type having floating-point objects whose memory representations are as wide as at least one of said floating-point registers, wherein the floating-point data type is named “fpreg”; (b) declaring selected operands of floating-point arithmetic expressions in source code to be of the floating-point data type, wherein the source code is in the C programming language; (c) compiling the source code into corresponding object code; (d) executing the object code; (e) performing said floating-point arithmetic, said step (e) including the substep of transferring said data between said floating-point registers and said memory; and (f) converting data types according to type promotion rules when said floating-point arithmetic combines operands having different data types including fpreg, the promotion rules including hierarchical rules regarding conversion between data types to create data type compatibility between a pair of source operands, the promotion rules including, in order of precedence: (1) if one source operand is of data type fpreg, convert the other source operand to data type fpreg; (2) if one source operand is of data type long double, convert the other source operand to data type long double; and (3) if one source operand is of data type double, convert the other source operand to data type double.