Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - a subtle problem was detected in the fdiv instruction of intel's original http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
A subtle problem was detected in the FDIV instruction of Intel's original
Pentium CPU.  In certain rare cases, the result of a floating-point divide
could have less precision than it should.  Contact Intel directly for more
information on the issue.
As a result, the run-time system startup code has been modified to test for
a faulty Pentium.  If the FDIV instruction is found to be flawed, the low
order bit of the run-time system variable __chipbug will be set.


     extern unsigned __near __chipbug;

If the FDIV instruction does not show the problem, the low order bit will be
clear.  If the Pentium FDIV flaw is a concern for your application, there
are two approaches that you could take:

 1. You may test the __chipbug variable in your code in all floating-point
    and memory models and take appropriate action (such as display a warning
    message or discontinue the application).

 2. Alternately, you can use the "fpd" option when compiling your code.
     This option directs the compiler to generate additional code whenever
    an FDIV instruction is generated which tests the low order bit of
    __chipbug and, if on, calls the software workaround code in the math
    libraries.  If the bit is off, an in-line FDIV instruction will be
    performed as before.

If you know that your application will never run on a defective Pentium CPU,
or your analysis shows that the FDIV problem will not affect your results,
you need not use the "fpd" option.  The macro __SW_FPD will be predefined if
"fpd" is selected.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson