Intel Pentium Floating-Point Flaw (ia32 only)

Certain versions of the Intel (ia32) Pentium 586 processor have a flaw in rare floating-point division operations, which can also manifest itself in floating-point TAN, ATAN, and MOD operations. Since the number of input cases that cause this problem is very small and the associated error in the results is also very small, it is unlikely that you will ever see a problem due to this flaw. It has been estimated that only 1 out of 9 billion operations will produce even the slightest inaccuracy.

To request a check for a flawed Pentium chip, you can use the default compiler option /check:flawed_pentium option on code you suspect demonstrates the Pentium flaw, such as the code shown below. This compiler option generates run-time calls to the run-time routine FOR_CHECK_FLAWED_PENTIUM. The default, /check:flawed_pentium, does issue a run-time error message for this condition and stops program execution. To allow program execution to continue when this condition occurs, set the environment variable FOR_RUN_FLAWED_PENTIUM to true and rerun the program (see Run-Time Environment Variables).

Visual Fortran does not include a software workaround for the flawed Pentium problems, and these operations could produce incorrect results on a flawed Pentium processor.

To determine if you have a flawed Pentium, you can run the following program with the /check:flawed_pentium compiler option:

   PROGRAM go
   REAL(8) op1, op2
   COMMON /divide_check/ op1, op2
   DATA op1 /3145727.0/, op2 /4195835.0/
   IF( op2/op1 > 1.3338 ) THEN
      PRINT *,'This computer always divides correctly.'
   ELSE
      PRINT *,'This computer can have divide problems.'
   ENDIF
   END

If you compile and run this program without any compiler options (the default is /check:flawed_pentium), a run-time error occurs when it is run on a flawed Pentium system.

Your operating system can also work around flawed Pentium processors by using software emulation for floating-point operations. Refer to your operating system documentation for more information. If the operating system has been configured for software emulation, then all floating-point operations in Visual Fortran will always operate correctly, including the above program. Note that the performance cost of an operating system fix can be very high, and if your program is run on another machine without the same operating system fix, it will execute incorrectly.

If you distribute software that is susceptible to the floating-point problems of a flawed Pentium, and want your program to halt if it is run on a system with such a processor, you can check the processor when your application starts. To do this, convert the program above into a simple subroutine, call the subroutine at the start of your application, and use the STOP statement to stop the application before it begins if a flawed Pentium processor is detected. If you distribute your software, you should compile it with the /check:flawed_pentium compiler option.

All the run-time libraries that come with Visual Fortran have been compiled to be safe with respect to the Pentium divide and MOD problems.

For more information on the Intel Pentium flaw, or to request a replacement Pentium processor, you can contact Intel in the United States at 1-800-628-8686.