Subject: Re: CCL:DEFECTIVE PENTIUM FPU'S (2nd try)

From: [email-masked] (Walter E. Reiher III)
Date: Wed, 23 Nov 1994 13:56:51 -0800 (PST)

Yikes!  The attachment wasn't there when I got my copy of the following
message I posted a little while ago...it really WAS there when I sent
it!  Trying again:
========================================================================

Thanks to John McKelvey for informing us of this disturbing problem.

I just took a look at comp.sys.intel to learn more about this problem
with Pentium chips.  There's a lot of flaming going on over there, but
to summarize briefly:
. It looks like some folks (outside of Intel) have known about this
  problem for a couple of weeks now.
  . There are reports of problems with both single- and double-precision
    division.
. Intel has known about it for a while and hasn't told anyone.  They
  have supposedly fixed the problem but did not mark the chips so we can
  easily tell a chip has the fix just by looking.
  . I have not seen a report of anyone who actually has CPU with the fix.
. The problem was reported on CNN yesterday (I didn't see it).
  . Reportedly, an Intel spokesman said on CNN that they will NOT simply
    replace all defective CPUs in the field because they do not consider
    the problem to be significant.  They will replace chips on a case-
    by-case basis.  It looks like THEY will decide if it's important to
    YOU whether floating point calculations are right or wrong in your
    Pentium.
. Some folks have reported success with reaching Intel Microprocessor
  Support at 800-628-8686.  (I haven't tried yet.)
  . A statement attributed to Intel (I can't verify this) said:
    "Concerned users doing extensive floating point operations requiring
    extraordinary precision who desire further details can call Intel at
    408-765-8914."

Terje Mathisen of Hydro Data, Norsk Hydro posted a very small program
which tells you if your system has the problem.  It's pretty obvious...
mine says (sigh):
     "It has the FDIV bug:
      (1.0/824633702449.0)*824633702449.0 is not equal to 1.0!"
He posted his uuencoded program to comp.sys.intel with assembly source.
That message is attached.
     For convenience, I have decoded the program and uploaded the binary
file to ftp.ccl.net/incoming/p87test.zip.  Download it by binary FTP and
use either Info-ZIP's or PKZIP's unzippers to decompress.

Wally
========================================================================
Walter E. Reiher III, Ph.D.                            [email-masked]
Consultant in Computational Chemistry
P.O. Box 61056                                        voice 408-720-0240
Sunnyvale, CA 94088                                     fax 408-720-0378

>From netcom.com!ix.netcom.com!howland.reston.ans.net!pipex!sunic!trane.uninett.no!eunet.no!nuug!telepost.no!hydro.com!usenet Wed Nov 23 11:20:39 1994
>From: [email-masked] (Terje Mathisen)
Newsgroups: comp.sys.intel
Subject: FDIV bug: Attempted summary and new p87test
Date: 13 Nov 1994 14:39:59 GMT
Organization: Hydro Data, Norsk Hydro (Norway)
Reply-To: [email-masked] (Terje Mathisen)

Since I started this thread, I'd like to summarize my current views
on this bug:

- *If* Intel have know about this problem for several months, and *decided*
  not to warn users about it, those responsible for that decision should
  be fired.  There is no excuse for knowing about a silent bug like this,
  and not tell about it.

- An error that results in a hardware crash is much less serious than this
  one which returns wrong answers.

- Since the bit-pattern that fails seems to be about 18 bits long
  (..11110111000001...), the odds of hitting it should be about 1/2^18,
  or 1/6E7.  With 8 significant digits in the answer, this means that the
  average (for truly random data) precision on a Pentium is less than 16
  digits.

- I have nothing against x86 cpu's, rather the opposite, since I love
  writing asm code for them.  The company I work for will still buy new
  Pentium machines, but as soon as I first heard and verified the problem,
  I specified that new machines would only be aquired from dealers who
  promized to exchange the cpus as soon as Intel makes the fixed p5s
  available.

Since I first posted p87test, I've gotten email from people who tell me that
it thinks their Pentium-90 is a 386.  This will happen if you are running
under a V86 monitor which virtualizes the eflags register and disallow
toggling the AlignmentControl (bit #18) and/or CPUID (bit #21).

The new version will perform the test for FDIV precision independently of
cpu version, as long as a numeric coprocessor seems to be present.

I have also found a bug in the program, where I demanded that the result
after FDIV/FMUL should be identical to 1.0.  I have changed this to
allow a small ulp error.

To make the program more useful, it will now also report (and document) the
'secret' CPUID feature bits, on a Pentium or new-model 486.

-Terje Mathisen (include std disclaimer) <[email-masked]>
"almost all programming can be viewed as an exercise in caching"

PS. I someone wants to make p87test.zip available on an ftp site, that
would probably be the best solution.