Browse Prior Art Database

High-Performance Workaround for the Pentium Division Flaw

IP.com Disclosure Number: IPCOM000116534D
Original Publication Date: 1995-Sep-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 2 page(s) / 57K

Publishing Venue

IBM

Related People

Bealkowski, R: AUTHOR [+2]

Abstract

Disclosed is a method for providing a high-performance software workaround for the Pentium* microprocessor division flaw. Various stepping levels of the Pentium microprocessor can generate incorrect results from certain division instructions.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 58% of the total text.

High-Performance Workaround for the Pentium Division Flaw

      Disclosed is a method for providing a high-performance software
workaround for the Pentium* microprocessor division flaw.  Various
stepping levels of the Pentium microprocessor can generate incorrect
results from certain division instructions.

      For a small set of numbers, Pentium division instructions
return single precision results instead of full precision results.
This results in reduced accuracy, but can also produce wrong values.
For example, using the following equations on the Pentium:
         x = 4,195,835.0;
         y = 3,145,727.0;
         z = x - ((x/y) * y);
  produces z = 256.  A proper answer would be 0.0, or some small
number
like 9.3 E-10.

      A standard solution would be to force software emulation of the
floating point unit.  Most systems do provide for software emulation
of the floating point unit since the math coprocessor can be
optional.  The problem with a software solution is that it runs
slower than the hardware math coprocessor.

      This disclosure uses built-in mechanisms of the Pentium
microprocessor to cause traps on all floating point instructions.
The math coprocessor is marked as not available by setting the EM bit
in CR0.  Setting the EM bit will cause all floating point
instructions to generate an exception.

      The processing of a floating point exception is shown in the
Figure.  When an exception occurs, the...