Claims
- 1. A method, comprising:
normalizing operands a, b, and c for a floating-point operation; predicting whether result d of said floating-point operation on said a, b, c might be tiny; if so, then scaling said a, b, c to form a′, b′, c′; calculating result d′ of said floating-point operation on said a′, b′, c′; determining whether said d is tiny based upon said result d′; if so, then calculating said d using software; and if not, then calculating said d using hardware.
- 2. The method of claim 1, wherein if said b or said c is zero, then said scaling sets said a′=a, said b′=b, and said c′=c.
- 3. The method of claim 2, wherein said determining includes determining said d is tiny when ed′ is less than emin.
- 4. The method of claim 1, wherein if said a is zero, then said scaling sets said b′=b*2−eb and said c′=c*2−ec.
- 5. The method of claim 4, wherein said determining includes determining said d is tiny when ed′ is less than emin−eb−ec.
- 6. The method of claim 5, wherein said scaling sets said a′=a*2−ea, said b′=b*2−eb+└(eb+ec−ea)/2┘and said c′=c*2−ec+┌(eb+ec−ea)/2┐.
- 7. The method of claim 5, wherein said determining includes determining said d is tiny when ed′ is less than emin−ea.
- 8. The method of claim 1, wherein said floating point operation on said operands a, b, c is a+b*c.
- 9. The method of claim 1, wherein said floating point operation on said operands a, b, c is a−b*c.
- 10. The method of claim 1, wherein said floating point operation on said operands a, b, and c is −a+b*c.
- 11. A system, comprising:
a processor including a prediction unit to predict whether a result d of a floating-point operation on operands a, b, c might be tiny, also including a normalizer to normalize said a, b, c, also including a hardware floating-point module; and a memory to contain a floating-point software assist module, said floating-point software assist module to include a scaling module to scale said operands a, b, c to a′, b′, c′, and a tiny-ness determination module to determine whether said d might be tiny.
- 12. The system of claim 11, wherein said scaling module sets said a′=a, said b′=b, and said c′=c when said b or said c is zero.
- 13. The system of claim 12, wherein said tiny-ness determination module determines said d is tiny when ed′ is less than emin.
- 14. The system of claim 11, wherein said scaling module sets said b′=b*2−eb and said c′=c*2−ec when said a is zero.
- 15. The system of claim 14, wherein said tiny-ness determination module determines d is tiny when ed′ is less than emin−eb−ec.
- 16. The system of claim 11, wherein said scaling module sets said a′=a*2−ea, said b′=b*2−eb+└(eb+ec−ea)/2┘, and said c′=c*2−ec+┌(eb+ec−ea)/2┐.
- 17. The system of claim 16, wherein said tiny-ness determination module determines said d is tiny when ed′ is less than emin−ea.
- 18. A computer readable media including program instructions which when executed by a processor perform the following:
normalizing operands a, b, and c for a floating-point operation; utilizing the results of a hardware prediction unit predicting
whether result d of said floating-point operation on said a, b, c might be tiny; if so, then scaling said a, b, c to form a′, b′, c′; calculating result d′ of said floating-point operation on said a′, b′, c′; determining whether said d is tiny based upon said result d′; if so, then calculating said d using software; and if not, then calculating said d using hardware.
- 19. The computer readable media of claim 18, wherein if said b or said c is zero, then said scaling sets said a′=a, said b′=b, and said c′=c.
- 20. The computer readable media of claim 19, wherein said determining includes determining said d is tiny when ed′ is less than emin.
- 21. The computer readable media of claim 18, wherein if said a is zero, then said scaling sets said b′=b*2−eb and said c′=c*2−ec.
- 22. The computer readable media of claim 21, wherein said determining includes determining said d is tiny when ed′ is less than emin−eb−ec.
- 23. The computer readable media of claim 18, wherein said scaling sets said a′=a*2−ea, said b′=b*2−eb+└(eb+ec−ea)/2┘, and said c=c*2−ec+┌(eb+ec−ea)/2┐.
- 24. The computer readable media of claim 23, wherein said determining includes determining said d is tiny when ed′ is less than emin−ea.
- 25. The computer readable media of claim 18, wherein said floating point operation on said operands a, b, c is a+b*c.
- 26. The computer readable media of claim 18, wherein said floating point operation on said operands a, b, c is a−b*c.
- 27. The computer readable media of claim 18, wherein said floating point operation on said operands a, b, and c is −a+b*c.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] The present application is related to the U.S. patent application by the same inventor, entitled “Methods and Apparatus for Predicting an Underflow Condition Associated with a Floating-Point Multiply-Add Operation”, filed 8 Apr. 2002, and assigned Ser. No. 10/118,348, and that issued as U.S. patent number ______.