IP Library Granted Patent US 7,299,170
Granted Patent B2
US 7,299,170 · App. 10/726,858 · Granted Nov 20, 2007

Method and apparatus for the emulation of high precision floating point instructions

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,299,170
App. No.
10/726,858
Granted
Nov 20, 2007
Kind
B2
Abstract

A high precision floating point emulator and associated method for emulating subject program code on a target machine where the subject machine base operands possess a different precision than the target machine. The high precision floating point emulator is provided for the emulation of subject program code instructions having a higher precision than that supported by the target machine architecture by utilizing intermediate calculations having values with a higher precision than that supported by the target machine.

Claims (61)

1. A method of performing high precision emulation of program code instructions for a subject machine on a target machine including floating point hardware and integer hardware, the method comprising:

determining that operands in instructions of the program code for the subject machine require a higher precision than provided for by the hardware of the target machine; and

applying a floating point emulation algorithm to perform intermediate calculations on the operands of the instructions at a higher precision than the precision supported by the hardware of the target machine to produce intermediate values;

wherein at each stage, the intermediate values are tested to determine whether the intermediate values have reached a point at which the hardware of the target machine has enough precision to finish the calculation without loss of accuracy, such that when it is determined based upon the intermediate calculations that the floating point hardware of the target machine provides sufficient precision to finish the calculations required by the instructions without loss of accuracy, the floating point hardware on the target machine is utilized to finish the calculations; and the integer hardware on the target machine is utilized to perform calculations not selected to be performed by the floating point hardware.

2. The method of claim 1 , wherein the program code instructions are accumulated instructions that are calculated at a higher precision than the operands capable of being handled by the target machine.

3. The method of claim 2 , wherein the program code instructions are floating point accumulated instructions of the form: d=±(a*b±c),

wherein a, b, c and d are operands expressible as floating point numbers.

4. The method of claim 3 , further comprising identifying whether any of the operands (a, b, or c) are special values having a known result that all compatible hardware will produce regardless of the level of precision of said compatible hardware.

5. The method of claim 4 , wherein said special values include either zero, infinity, or NaN (not a number), wherein the floating point hardware is utilized to calculate the result of the accumulated instructions when any of the operands (a, b, or c) are identified as special values.

6. The method of claim 3 , wherein said floating point emulation algorithm further comprises:

determining whether the exponent for the result of the multiplication of (a*b) overlaps with the exponent of c; and

utilizing the floating point hardware to calculate the result of the accumulated instructions when the exponent for the result of the multiplication of (a*b) fails to overlap with the exponent of c.

7. The method of claim 6 , wherein, when the exponent for the result of the multiplication of (a*b) overlaps with the exponent of c, said floating point emulation algorithm further comprising:

determining whether the mantissa for the result of the multiplication (a*b) requires more mantissa bits than provided for by said floating point hardware; and

utilizing the floating point hardware to calculate the result of the accumulated instructions when the result of the multiplication (a*b) does not require more mantissa bits than provided for by the floating point hardware.

8. The method of claim 7 , said floating point emulation algorithm further comprising computing the full calculation of a*b using the integer hardware when mantissa for the result of the multiplication (a*b) requires more mantissa bits than provided for by the floating point hardware.

9. The method of claim 8 , said floating point emulation algorithm further comprising:

determining whether the final resulting mantissa of the mantissa(a*b)−the mantissa (c) equals zero;

utilizing the floating point hardware to make the result of the calculation of a*b+c equal to zero when the resulting mantissa is equal to zero; and

calculating the remaining parts of the calculation of a*b+c using the integer hardware when the final resulting mantissa is not equal to zero.

10. A computer-readable storage medium having software resident thereon in the form of computer-readable code executable by a computer to perform the following steps in the high precision emulation of program code instructions for a subject machine on a target machine including floating point hardware and integer hardware:

determining that operands in instructions of the program code for the subject machine require a higher precision than provided for by the hardware of the target machine; and

applying a floating point emulation algorithm to perform intermediate calculations on the operands of the instructions at a higher precision than the precision supported by the hardware of the target machine to produce intermediate values;

wherein at each stage, the intermediate values are tested to determine whether the intermediate values have reached a point at which the hardware of the target machine has enough precision to finish the calculation without loss of accuracy, such that when it is determined based upon the intermediate calculations that the floating point hardware of the target machine provides sufficient precision to finish the calculations required by the instructions without loss of accuracy, the floating point hardware on the target machine is utilized to finish the calculations; and the integer hardware on the target machine is utilized to perform calculations not selected to be performed by the floating point hardware.

11. The computer-readable storage medium of claim 10 , wherein the program code instructions are accumulated instructions that are calculated at a higher precision than the operands capable of being handled by the target machine.

12. The computer-readable storage medium of claim 11 , wherein the program code instructions are floating point accumulated instructions of the form: d=±(a*b+c), wherein a, b, c and d are operands expressible as floating point numbers.

13. The computer-readable storage medium of claim 12 , said computer-readable code further executable for identifying whether any of the operands (a, b, or c) are special values having a known result that all compatible hardware will produce regardless of the level of precision of said compatible hardware.

14. The computer-readable storage medium of claim 13 , wherein said special values include either zero, infinity, or NaN (not a number), wherein the floating point hardware is utilized to calculate the result of the accumulated instructions when any of the operands (a, b, or c) are identified as special values.

15. The computer-readable storage medium of claim 12 , wherein said floating point emulation algorithm further comprises:

determining whether the exponent for the result of the multiplication of (a*b) overlaps with the exponent of c; and

utilizing the floating point hardware to calculate the result of the accumulated instructions when the exponent for the result of the multiplication of (a*b) fails to overlap with the exponent of c.

16. The computer-readable storage medium of claim 15 , wherein, when the exponent for the result of the multiplication of (a*b) overlaps with the exponent of c, said floating point emulation algorithm further comprises:

determining whether the mantissa for the result of the multiplication (a*b) requires more mantissa bits than provided for by said floating point hardware; and

utilizing the floating point hardware to calculate the result of the accumulated instructions when the result of the multiplication (a*b) does not require more mantissa bits than provided for by the floating point hardware.

17. The computer-readable storage medium of claim 16 , said floating point emulation algorithm further comprising computing the full calculation of a*b using the integer hardware when mantissa for the result of the multiplication (a*b) requires more mantissa bits than provided for by the floating point hardware.

18. The computer-readable storage medium of claim 17 , said floating point emulation algorithm further comprising:

determining whether the final resulting mantissa of the mantissa(a*b)−the mantissa (c) equals zero;

utilizing the floating point hardware to make the result of the calculation of a*b+c equal to zero when the resulting mantissa is equal to zero; and

calculating the remaining parts of the calculation of a*b+c using the integer hardware when the final resulting mantissa is not equal to zero.

19. A system for providing a target computing environment comprising:

a target processor including floating point hardware and integer hardware; and

translator code for performing high precision emulation of program code instructions for a subject machine on a target machine, said translator code comprising code executable by said target processor for performing the following steps:

determining that operands in instructions of the program code for the subject machine require a higher precision than provided for by the hardware of the target machine; and

applying a floating point emulation algorithm to perform intermediate calculations on the operands of the instructions at a higher precision than the precision supported by the hardware of the target machine to produce intermediate values;

wherein at each stage, the intermediate values are tested to determine whether the intermediate values have reached a point at which the hardware of the target machine has enough precision to finish the calculation without loss of accuracy, such that when it is determined based upon the intermediate calculations that the floating point hardware of the target machine provides sufficient precision to finish the calculations required by the instructions without loss of accuracy, the floating point hardware on the target machine is utilized to finish the calculations; and the integer hardware on the target machine is utilized to perform calculations not selected to be performed by the floating point hardware.

20. The system of claim 19 , wherein the program code instructions are accumulated instructions that are calculated at a higher precision than the operands capable of being handled by the target machine.

21. The system of claim 20 , wherein the program code instructions are floating point accumulated instructions of the form: d=±(a*b±c),

wherein a, b, c and d are operands expressible as floating point numbers.

22. The system of claim 21 , wherein said floating point emulation algorithm comprises identifying whether any of the operands (a, b, or c) are special values having a known result that all compatible hardware will produce regardless of the level of precision of said compatible hardware.

23. The system of claim 22 , wherein said special values include either zero, infinity, or NaN (not a number), wherein the floating point hardware is utilized to calculate the result of the accumulated instructions when any of the operands (a, b, or c) are identified as special values.

24. The system of claim 21 , wherein said floating point emulation algorithm further comprises:

determining whether the exponent for the result of the multiplication of (a*b) overlaps with the exponent of c; and

utilizing the floating point hardware to calculate the result of the accumulated instructions when the exponent for the result of the multiplication of (a*b) fails to overlap with the exponent of c.

25. The system of claim 24 , wherein, when the exponent for the result of the multiplication of (a*b) overlaps with the exponent of c, said floating point emulation algorithm further comprises:

determining whether the mantissa for the result of the multiplication (a*b) requires more mantissa bits than provided for by said floating point hardware; and

utilizing the floating point hardware to calculate the result of the accumulated instructions when the result of the multiplication (a*b) does not require more mantissa bits than provided for by the floating point hardware.

26. The system of claim 25 , said floating point emulation algorithm further comprising computing the full calculation of a*b using the integer hardware when mantissa for the result of the multiplication (a*b) requires more mantissa bits than provided for by the floating point hardware.

27. The system of claim 26 , said floating point emulation algorithm further comprising:

determining whether the final resulting mantissa of the mantissa(a*b)−the mantissa (c) equals zero;

utilizing the floating point hardware to make the result of the calculation of a*b+c equal to zero when the resulting mantissa is equal to zero; and

calculating the remaining parts of the calculation of a*b+c using the integer hardware when the final resulting mantissa is not equal to zero.

Assignments (4)
CORRECTIVE ASSIGNMENT TO CORRECT THE ASSIGNEE NAME PREVIOUSLY RECORDED ON REEL 022928 FRAME 0190. ASSIGNOR(S) HEREBY CONFIRMS THE RECEIVING PARTY. Recorded Aug 26, 2013
From: IBM UNITED KINGDOM LIMITED
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 031085/0824 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 7, 2009
From: IBM UNITED KINGDOM LIMITED
To: IBM CORPORATION
Reel/Frame 022928/0190 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 16, 2009
From: TRANSITIVE LIMITED
To: IBM UNITED KINGDOM LIMITED
Reel/Frame 022824/0715 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 2, 2003
From: WALKER, PAUL
To: TRANSITIVE LIMITED
Reel/Frame 014765/0039 →