Bonum Certa Men Certa

x86 Lowered the Standards of Hardware Products

posted by Roy Schestowitz on Aug 14, 2024

Claromeco Argentina sunset beach

2 days ago: x86 is Beyond Redemption, We Need Lean Software and Hardware That We Can Understand

THE other day we recalled some old x86 tales, including the above.

In a nutshell, x86 is a disaster and even Linus Torvalds is willing to name some of the chronic problems (he once worked for a rival of x86, not shill for it). A lot of it is just hacks and cheats that help fake performance and cause a lot of defect to manifest or reveal themselves. The endless complexity makes that unfixable, or only possible to bypass at a huge cost/toll.

After publishing the lengthier piece (the other day) an associate reminded us of this bug many of us forgot about because it was 30 years ago. "A long tradition," he called it, as he recalled articles from those days. Those of us who are over 40 still remember that fiasco; it was a big deal at the time and it resulted by mass recall of Intel chips. I still remember that very well.

Well, now they use microcode updates to avoid accepting returns of damaged goods. "Microcode to hide and misdirect," as the associate has put it...

Since the original article is now offline, just like about 90% of the Web, and the Internet Archive at existential risk, we're reproducing it below.

The Truth Behind the Pentium Bug

An error in a lookup table created the infamous bug in Intel's latest processor

Tom R. Halfhill

Anyone who doesn't rely on a computer or an accountant to handle their income taxes is all too familiar with the final ritual of paging through the tax table in the back of the 1040 book. ``If your taxable income is greater than x but less than y, then your tax is z....'' The 1040 tax table is a classic example of a lookup table: a matrix of precomputed values that saves you the trouble (and potential pitfalls) of doing the arithmetic yourself. Programs often contain lookup tables to avoid executing lengthy calculations at run time. As long as the values in the table are correct, the final results will be accurate.

It was this quest for speed and accuracy that led Intel to embed a lookup table in the Pentium's FPU, its fifth-generation x86 microprocessor. Stung by the superior floating-point performance of competing RISC processors, Intel wanted to endow the Pentium with an FPU significantly faster than that of any other x86 chip. This would allow Intel to promote the Pentium as a CPU for scientific and engineering applications, as well as the best engine for mainstream software that relies primarily on integer operations.

Genesis of an Error

Intel's goal was to boost the execution of floating-point scalar code by 3 times and vector code by 5 times, compared to a 486DX chip running at the same clock speed. To achieve that, the Pentium engineers had to improve on the 486's traditional shift-and-subtract division algorithm, which can generate only one quotient bit per cycle. They settled on a new method called the SRT algorithm that can generate two quotient bits per cycle.

Named after three scientists who independently conceived it at almost the same time, the SRT algorithm uses a lookup table to calculate the intermediate quotients that are necessary for iterative floating-point divisions. As implemented in the Pentium, the SRT lookup table is a matrix of 2048 cells, although only 1066 of these cells actually contain values. For those that do, the values are integer constants ranging from -2 to +2. The algorithm uses the bit pattern of the divisor as an index into the table.

So far, so good. But here is where things went horribly wrong. An engineer prepared the lookup table on a computer and wrote a script in C to download it into a PLA (programmable logic array) for inclusion in the Pentium's FPU. Unfortunately, due to an error in the script, five of the 1066 table entries were not downloaded. To compound this mistake, nobody checked the PLA to verify the table was copied correctly.

These five cells are distributed along a boundary of the matrix and should contain the constant +2 . Instead, the cells are empty. When the FPU accesses one of these cells, it fetches a zero. This throws off the calculation and results in a number that is always slightly less precise than the correct answer.

Because the SRT algorithm is recursive, the shortfall can accumulate during successive iterations of a division operation. At its worst, the error can rise as high as the fourth significant digit of a decimal number (but not the fourth digit to the right of the decimal point, as is commonly believed; the decimal point can be positioned anywhere in the binary floating-point number format). However, the chance of this happening randomly is only about 1 in 360 billion. Usually, the error appears around the 9th or 10th decimal digit. The chance of this happening randomly is about 1 in 9 billion.

Because the bit patterns of certain divisors lead to the corruption of quotients derived from certain numerators, the bug occurs only with certain pairs of divisors and numerators--no particular divis or always triggers the bug. The ``buggy pairs'' can be identified, however, and they always result in a wrong answer on any Pentium chip manufactured before the bug was fixed.

Furthermore, the bug potentially afflicts any instruction that references the lookup table or calls FDIV, the basic floating-point division instruction . Related instructions include FDIVP, FDIVR, FDIVRP, FIDIV, FIDIVR, FPREM, and FPREM1. The transcendental instructions FPTAN and FPATAN are also susceptible, though no actual errors have surfaced. The transcendental instructions FYL2X, FYL2XP1, FSIN, FCOS, and FSINCOS were once suspect but are now considered safe.

Assessing the Damage

The basic facts about the Pentium bug are not in dispute, though they are often misunderstood. For instance, the Pentium does not suffer from a hardware defect in the same sense as a defective appliance or automobile. This is a software bug that's encoded in hardware, and it's the sort of bug any progra mmer can sympathize with. Users who tolerate a certain level of bugs in their applications and system software should recognize that the same kinds of flaws are inevitable in microprocessors. Unlike memory chips, which are little more than vast arrays of transistors, logic chips can contain complex software mechanisms--such as the FDIV algorithm--that are delivered on silicon instead of on floppy disks.

What's different about the Pentium bug is that it doesn't crash your computer--it yields wrong answers so subtle you might never notice anything amiss. But this raises another important issue, which is that binary floating-point math inherently lacks the precision of integer arithmetic. Although computers are still regarded as math machines, they are not really comfortable with floating-point decimal operations. The conversions between binary and decimal, coupled with inherent limits on precision, always result in small errors that are usually ignored.

Still, Pentium owners paid for a CPU that's supposed to perform floating-point math to IEEE standards, and that's not what they got. Instead, controversy has raged around additional issues: Intel's dismal customer relations and the wildly conflicting claims of how often the Pentium bug might bite a typical (nonscientific) user.

The court of public opinion has ruled on the former subject, but it's not so easy to judge the latter. Intel says a typical spreadsheet user might encounter the bug once in 27,000 years; IBM, which yanked its Pentium systems out of stores in December, says it could happen once every 24 days. Who's right?

Unfortunately, this argument will never be resolved to everyone's satisfaction because it hinges on key assumptions about users' behavior. How large are their typical spreadsheets? How often do they recalculate? How many FDIVs are executed? How often do buggy pairs occur?

Intel's 27,000-year estimate assumes that the average spreadsheet user will execute 1000 FDIVs per day and that buggy pairs happen random ly. IBM's 24-day estimate assumes 4.2 million FDIVs per day and that buggy pairs happen more often than random chance would suggest.

To back up its claims, Intel analyzed 510 spreadsheets from its internal departments (finance, sales/marketing, planning, treasury, product engineering, production control, and tax/customs). A special profiler counted floating-point operations during recalculations and also trapped for divisors containing the telltale bit patterns. Intel says the results confirmed its earlier estimates.

IBM insists that buggy pairs crop up more frequently than Intel claims because of a phenomenon dubbed ``integer bruising'' by Vaughan Pratt, a computer scientist at Stanford University. Pratt builds a formidable argument that common integers--distorted into slightly inaccurate values by seemingly innocuous floating-point operations--can lead to nonrandom frequencies of buggy pairs. (See ``How to Bruise an Integer.'')

To settle this dispute empirically, an independent party w ould have to replicate Intel's experiment across a statistically valid sample of spreadsheets obtained from a representative selection of companies. Even if such a party could get permission to examine hundreds of proprietary spreadsheets and record users' behavior, the data would take months to gather and analyze. By then, it would be of interest mainly to historians and lawyers.

So the ultimate question, ``How serious is the bug, really?'' will likely go unanswered forever. To paraphrase Albert Einstein, we'll probably never know if God plays dice with the Pentium.

BYTE

Other Recent Techrights' Posts

[Video] IBM Shakes Hands of Prince Mohammed bin Salman
handshake of loyalty
The SLAPPs From Microsofters Distract From Serious Copyright Infringement by Microsoft and Apparent Business Crimes
Aside from other issues, such as strangling women
Trolls With LLM Slop Are Disrupting Communications About Mass Layoffs at IBM
LLM slop to drown out the signal
 
Gemini Links 16/05/2025: "Repairing Our Way out of Commodity Fetishism" and Pre-librebooted Computers
Links for the day
The Microsofters Have Just Shared Privileged Trial Data With Microsoft
There are serious ramifications for liability accountability as Microsoft salaries sponsor these SLAPPs
Enshittification is Everywhere: You Pay More, the Services Get Worse
"Enshittification" is a term coined by an online friend; I increasingly use this term to describe what's happening even outside the realm of technology (which it was adopted to describe)
Microsoft Reduces Office Space Ahead of More Waves of Mass Layoffs
"The Gerstnerisation of Microsoft"
Anti-Linux FUD Produced by Microsoft LLMs to Blame "Linux" for Microsoft's Own Failures
We call out some of the worst culprits
Gemini Links 16/05/2025: Hoking GPS, Grabovac, and Tanana
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, May 15, 2025
IRC logs for Thursday, May 15, 2025
Microsoft WARN Notices Proliferate in the United States
From what we've seen, this wave was more than 3% (a lot more) and the next wave/s will be even bigger (possible as imminent as weeks from now), based on insider leaks
Links 15/05/2025: Google Betrays Publishers Again, Openwashing by Sysdig
Links for the day
Richard Stallman Still Respected by Many in the Libre Graphics Community
Richard Stallman and Professor Moglen never harmed anyone
If You Read Techrights, Then You Probably Want to Read Tux Machines as Well
That site is more active than this one
Gemini Links 15/05/2025: Forced Music in Publicly Accessible Space and ~silv is Online
Links for the day
Links 15/05/2025: KOSA Censorship (USA Becomes More Like KSA) and More National Cuts
Links for the day
Bing Might Shut Down - Just Like Skype Did - Some Time in the Coming Months/Years (Parts of It Already Shut Down)
they try to bring the losses under control
Your Real Ally Would Not Defend the Company of SLAPP and Strangling of Women
who's left to tell us what's true?
Breakdown of Microsoft Layoffs Shows It's About Cost, Not Performance or Hype (Like "AI")
MSN (Microsoft) reposted this with some unnecessary spin
The Lawyers Working for the Serial Strangler From Microsoft on SLAPPing Techrights Have Apparently Lost Their Voice
the moment we mentioned that their media lawyer is leaving they went all quiet in social control media
At IBM, Relocation Can be a Trick or a Trap (IBM Gets Rid of Staff Under the Guise of "Relo")
IBM is not being honest with employees
Microsoft Rumours: This Week's Scale of Layoffs "Higher Than Reported" and More Coming Soon ("A Lot More Severe" Than May's)
The "3%" figure is false
Slopwatch: Sloppy Brian, Brittany Slop, and General Observations
Creative people don't need slop; there's just nothing good about it, slop appeals to lazy people careless about quality
Over at Tux Machines...
GNU/Linux news for the past day
Beyond Mass Layoffs at Microsoft: Entire Units Shut Down for Good
And it's far from over
Links 15/05/2025: Crikvenica, Analog Computer, and Slop 'Hallucinations'
Links for the day
IRC Proceedings: Wednesday, May 14, 2025
IRC logs for Wednesday, May 14, 2025
Links 14/05/2025: Fentanylware (TikTok) Harms Kids, Russia Refuses to Defuse
Links for the day
Gemini Links 15/05/2025: Poseur Nerds and Mennonites
Links for the day
VS Code Is Not FOSS, And Neither Is the Site "It's FOSS"
VS Code is proprietary spyware of Microsoft, yet this site keeps promoting it like it's FOSS
No, Microsoft Didn't Lay Off So Many People Because of "AI" "Innovation" or "Efficiency" or "Era" or "Revolution" Etc.
Debunking one very common lie
What We Do When We Say "GNU/Linux" to People
It talks about "Linux", "GNU", and what it means to say "GNU/Linux"
Links 14/05/2025: Facebook And Instagram Risk Nationwide Bans, Microsoft Subsidiaries Have Mass Layoffs Too
Links for the day
Canonical Will Give You Money Only If You Work for Microsoft!
Only if you are servicing (being a slave to) proprietary forges that Microsoft and the NSA control while violating the GPL will Canonical give you money
If Microsoft Staff That Strangles Woman Pays You to Write Lies, It Will Not End Well
The past couple of years were our most productive ever
Gemini Links 14/05/2025: "Writing My Story with Inspiration from Notable Lives" and People Start Shovelling Up LLM Slop Onto Geminispace,
Links for the day
Microsoft is Very Highly Stressed About Adoption of GNU/Linux at Windows' Expense (on Former "Vista 10" PCs)
What does this tell us?
Slopwatch: BetaNoise (BetaNews), LinuxSecurity, and Slopfarms Still Promoted by Google News
The primary goal is to demonstrate the problem persists
Links 14/05/2025: Google Agrees to $1.3 Billion Settlement After Spying, China Tariffs Don't Work
Links for the day
There Are Also Loads of Microsoft LinkedIn Layoffs Today (Keep Track of the Subsidiaries They Keep Out of Headlines)
Perhaps lost in the smokescreen
There Are Bigger Rounds of Microsoft Layoffs Coming, a Cull of 10% Implemented in Waves (the "3%" Figure is Misleading, Face-Saving)
Last night we said they might do the layoffs in three or at least two waves
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, May 13, 2025
IRC logs for Tuesday, May 13, 2025