# 奔腾FDIV缺陷

**奔腾FDIV缺陷**是早期英特尔奔腾处理器浮点运算单元（FPU）中的一处硬件缺陷，于1994年首次被发现，它会使某些浮点除法运算返回结果的精度远低于[IEEE 754](https://www.edgepedia.org/zh/ieee-754)双精度标准的要求。这一事件导致英特尔历史上第一次CPU召回，计提4.75亿美元损失，并成为硬件验证与企业危机应对领域被广泛研究的案例。<sup>[1](https://www.tomshardware.com/pc-components/cpus/intel-released-its-first-pentium-chip-on-this-day-33-years-ago-came-packing-3-1-million-transistors-fifth-gen-x86-chip-built-on-an-800nm-process)</sup>

| 关键事实 | 详情 |
|---|---|
| 故障所在 | FPU的基-4 SRT除法查找表：1,066个表项中有五个未被下载到可编程逻辑阵列中，导致FPU在本应为+2的位置取到了0<sup>[2](https://www.cs.earlham.edu/~dusko/cs63/fdiv.html)</sup> |
| 发现 | 弗吉尼亚州林奇堡学院数学教授托马斯·R·奈斯利（Thomas R. Nicely）于1994年6月注意到结果不一致，并于1994年10月24日向英特尔报告了该缺陷<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup> |
| 著名示例 | 在有缺陷的奔腾上，4195835 / 3145727返回1.333739068902，而非1.333820449136，相对误差为6.1 × 10<sup>−14</sup><sup> • </sup><sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup> |
| 发生频率 | 在随机操作数下，约每九十亿次双精度除法中有一次产生的误差超出正常双精度舍入误差；约每四百亿次中有一次超出单精度误差<sup>[4](https://www5.in.tum.de/~huckle/anapentium)</sup> |
| 英特尔最初的估计 | 普通用户平均每27,000年才会遇到一次该错误<sup>[4](https://www5.in.tum.de/~huckle/anapentium)</sup> |
| 解决 | 1994年12月：英特尔宣布无条件终身更换计划，并在1994年第四季度计提4.75亿美元税前损失<sup>[5](https://www.intc.com/filings-reports/all-sec-filings/content/0000050863-96-000002/0000050863-96-000002.pdf)</sup><sup> • </sup><sup>[6](https://www.ardent-tool.com/CPU/Intel/fdiv/fdiv.html)</sup> |

## 发现

托马斯·R·奈斯利当时正在计算孪生素数（即两个都是素数的连续奇数）的倒数之和，以收紧一个精确值未知的和式的上下界。1994年3月，他将一台基于奔腾的机器加入了自己的计算机阵列；同年6月，他注意到自己为1/824633702441这类倒数（其中p与p+2均为素数）所得到的值出现不一致。尽管他使用的是双精度，结果却仅精确到大致单精度的水平。他起初怀疑是自己的程序，随后又怀疑编译器、操作系统、总线和主板；到10月下旬，他确信故障出在芯片本身。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup>

**与英特尔联系。** 1994年10月24日，奈斯利致电英特尔技术支持（通话编号51270），据他所说，对方未予理会。<sup>[7](https://www.mackido.com/History/History_PentBug.html)</sup><sup> • </sup><sup>[8](https://www.washingtonpost.com/archive/politics/1994/12/16/hello-mr-chips-va-teacher-who-found-intels-flaw/ced85f09-9d7e-4b45-9b6c-f4c1eca8debf/)</sup> 10月30日，他向其他有条件使用奔腾系统的人发送了一封宣布这一发现的电子邮件；其中一位收件人将其发到了[CompuServe](https://www.edgepedia.org/zh/compuserve)上，《电子工程时报》记者亚历山大·沃尔夫（Alexander Wolfe）在那里看到了它，并转发给了奥斯陆挪威海德鲁公司的程序员特耶·马蒂森（Terje Mathisen）。马蒂森在数小时内证实了奈斯利的示例，编写了一个简短的汇编语言测试程序，并于11月3日在新闻组comp.sys.intel上发起了一系列帖子，标题为“奔腾中显眼的FDIV缺陷！”。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup>

## 技术原因

奔腾使用SRT算法计算浮点除法，该方案最早于1958年被提出，是将长除法适配到硬件上的一种方法。奔腾采用的是基-4版本，每个机器周期产生商的两个二进制位，这使其在相同时钟频率下的除法速度是早期英特尔芯片的两倍。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup> 每一步都通过查表来选择下一位商，用除数和部分余数的高位作为索引。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup>

查找表共有1,066个表项，但当该算法在硅片上实现时，有五个表项未被下载到可编程逻辑阵列（PLA）中。当FPU访问这些缺失的单元时，它取到的是0而不是数值+2，从而破坏了余数的更新，产生的商精度不足。<sup>[2](https://www.cs.earlham.edu/~dusko/cs63/fdiv.html)</sup> 这些错误仅取决于操作数的尾数，而与其指数无关，相对误差最大可达2<sup>−14</sup>。<sup>[4](https://www5.in.tum.de/~huckle/anapentium)</sup>

**演示案例。** Vitesse半导体公司的FPU设计师蒂姆·科（Tim Coe）根据安德烈亚斯·凯泽（Andreas Kaiser）发布的一份错误倒数列表构建了该缺陷的模型，并用它预测出一对最坏情况的操作数：4195835 / 3145727。真实商为1.33382044...，但有缺陷的奔腾返回1.33373906...，仅精确到14个二进制位，相对误差为6.1 × 10<sup>−5</sup>。这比单精度舍入误差还差，比双精度应有的水平差了十个数量级以上。科在没有奔腾的情况下完成了分析，并在当地一家电脑商店的演示机上验证了这一预测。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup> 残差4195835 − (4195835/3145727) × 3145727在奔腾上为256，而非0。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup>

科与邓炳德（Ping Tak Peter Tang）后来的分析证明了一个精确的刻画：每一个能触发该缺陷的除数，都在第5至第10位（将第0位视为最高有效位）上具有六个连续的1。这一结果为针对未更换芯片系统的编译器级软件补丁提供了依据。<sup>[9](https://www.researchgate.net/publication/3612504_It_takes_six_ones_to_reach_a_flaw_Pentium_processor)</sup>

## 缺陷范围

该缺陷并不限于FDIV指令。任何引用查找表或调用FDIV的指令都受到影响，包括FDIVP、FDIVR、FDIVRP、FIDIV、FIDIVR、FPREM和FPREM1，超越函数指令FPTAN和FPATAN也易受影响。<sup>[2](https://www.cs.earlham.edu/~dusko/cs63/fdiv.html)</sup> 该缺陷是确定性的：如果某个计算出错一次，那么它每次都会出错。<sup>[10](https://jacobfilipp.com/DrDobbs/articles/DDJ/1995/9552/9552a/9552a.htm)</sup>

随机操作数命中该缺陷的概率很小。英特尔于1994年12月初发布的白皮书估计，普通电子表格用户平均每27,000年才会遇到一次错误。<sup>[4](https://www5.in.tum.de/~huckle/anapentium)</sup> 斯坦福大学计算机科学教授沃恩·普拉特（Vaughan Pratt）表明，这一比率很大程度上取决于数据：将小整数“擦伤”——即减去百万分之一——后相除，每400次除法中就有一次产生至少百万分之一的相对误差；而从常数1开始的运算可能每隔几分钟就出错。<sup>[4](https://www5.in.tum.de/~huckle/anapentium)</sup>

## 公众反应与英特尔的应对

[感恩节](https://www.edgepedia.org/zh/thanksgiving)那一周，相关报道登上了各大报纸头版；《纽约时报》使用科的那组比值刊登了一篇题为“接近，但还不够接近”的侧栏文章，《波士顿环球报》则在“抱歉，号码错了”的标题下用电子表格演示了这一错误。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup> 据估计，上一年售出的个人电脑中有400万台安装了该芯片，IBM暂停销售配备该缺陷芯片的机器。<sup>[8](https://www.washingtonpost.com/archive/politics/1994/12/16/hello-mr-chips-va-teacher-who-found-intels-flaw/ced85f09-9d7e-4b45-9b6c-f4c1eca8debf/)</sup>

**从筛选到公开更换。** 英特尔最初尝试了一种有针对性的补救措施，只向能够证明该缺陷对其工作有影响的客户提供更换，而公司保留判定权。极少数用户能满足这些含糊的要求，这一做法招致的是愤怒而非安心。<sup>[7](https://www.mackido.com/History/History_PentBug.html)</sup><sup> • </sup><sup>[11](https://postmortem.io/incidents/intel--1994-10-30--fdiv-bug/)</sup> 1994年12月，英特尔宣布对受影响的60–100 MHz奔腾处理器实施终身无条件更换计划，其1994年第四季度业绩中计提了4.75亿美元损失，主要计入销售成本，用于覆盖更换费用、更换材料以及存货减记。<sup>[6](https://www.ardent-tool.com/CPU/Intel/fdiv/fdiv.html)</sup><sup> • </sup><sup>[5](https://www.intc.com/filings-reports/all-sec-filings/content/0000050863-96-000002/0000050863-96-000002.pdf)</sup> 这是英特尔首次不得不召回CPU。<sup>[1](https://www.tomshardware.com/pc-components/cpus/intel-released-its-first-pentium-chip-on-this-day-33-years-ago-came-packing-3-1-million-transistors-fifth-gen-x86-chip-built-on-an-800nm-process)</sup> 尽管代价高昂，市场对奔腾的需求依然强劲，1994年仍是该公司销售业绩强劲的一年。<sup>[12](https://timeline.intel.com/1994/financial-year-1994)</sup>

## 变通方案

特耶·马蒂森和The MathWorks创始人[克利夫·莫勒](https://www.edgepedia.org/zh/cleve-moler)（Cleve Moler）开发了一种软件变通方案，它检测有风险的除数，并在相除前将两个操作数同乘以15/16，使其移出危险区域；有了这一预防措施，奔腾即使在中间步骤中也绝不会执行错误的除法。<sup>[4](https://www5.in.tum.de/~huckle/anapentium)</sup> 有风险的除数落在五个子区间内，每个子区间为2的幂之间间隔的1/256，其十六进制前导小数位分别为1F、4F、7F、AF和DF；快速检测除数的高位即可判断是否需要进行缩放。<sup>[3](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)</sup> MATLAB发布了一个带有此保护措施的版本，其他厂商则提供禁用FPU并用软件模拟浮点的选项，但性能代价显著。<sup>[13](https://www.mathworks.com/company/technical-articles/a-tale-of-two-numbers.html)</sup><sup> • </sup><sup>[10](https://jacobfilipp.com/DrDobbs/articles/DDJ/1995/9552/9552a/9552a.htm)</sup>

## 后续影响

这一事件成为硬件验证领域的标准案例研究。分析人士得出结论，穷举仿真不可能发现该缺陷，因为没有任何测试数据会去触及那些被认为不可达的表项，而缺失的表项很可能被任何人工构造的测试集所忽略。<sup>[4](https://www5.in.tum.de/~huckle/anapentium)</sup> 英特尔随后将形式化验证应用于算术电路，用新方法复现了奔腾FDIV和P6 IDIV缺陷，并验证了修改后电路的正确性。<sup>[14](https://www.cs.cmu.edu/~emc/papers/Conference%20Papers/FormallyVerifyingArithmeticCircuits-AvoidingThePENTIUM-FDIVBug.pdf)</sup> 浮点算法后来在HOL Light证明助手中得到了形式化验证，这一投入被认为正是该缺陷所促成的。<sup>[15](https://cw.fel.cvut.cz/b191/_media/courses/lup/lup1.pdf)</sup> 2024年，硬件逆向工程师肯·希里夫（Ken Shirriff）在原始奔腾芯片裸片上定位到了造成该缺陷的确切晶体管。<sup>[16](https://www.tomshardware.com/pc-components/cpus/30-year-old-pentium-fdiv-bug-tracked-down-in-the-silicon-ken-shirriff-takes-the-microscope-to-intels-first-ever-recall)</sup>

## References

1. [Tom's Hardware: Intel released its first Pentium chip 33 years ago](https://www.tomshardware.com/pc-components/cpus/intel-released-its-first-pentium-chip-on-this-day-33-years-ago-came-packing-3-1-million-transistors-fifth-gen-x86-chip-built-on-an-800nm-process)
2. [Bugs in the Intel Microprocessors (Earlham College)](https://www.cs.earlham.edu/~dusko/cs63/fdiv.html)
3. [Cleve Moler, "Pentium Division Bug Revisited", MathWorks Cleve's Corner (2013)](https://blogs.mathworks.com/cleve/2013/04/29/pentium-division-bug/?s_tid=blogs_rc_3)
4. [Vaughan Pratt, "Anatomy of the Pentium Bug" (TUM mirror)](https://www5.in.tum.de/~huckle/anapentium)
5. [Intel 1995 Form 10-K, Management's Discussion and Analysis](https://www.intc.com/filings-reports/all-sec-filings/content/0000050863-96-000002/0000050863-96-000002.pdf)
6. [Pentium Processor Replacement (FDIV), Ardent Tool](https://www.ardent-tool.com/CPU/Intel/fdiv/fdiv.html)
7. [MacKiDo: History of the Pentium Bug](https://www.mackido.com/History/History_PentBug.html)
8. [The Washington Post, "Hello, Mr. Chips" (December 16, 1994)](https://www.washingtonpost.com/archive/politics/1994/12/16/hello-mr-chips-va-teacher-who-found-intels-flaw/ced85f09-9d7e-4b45-9b6c-f4c1eca8debf/)
9. [Tim Coe and Ping Tang, "It takes six ones to reach a flaw", 12th IEEE Symposium on Computer Arithmetic (1995)](https://www.researchgate.net/publication/3612504_It_takes_six_ones_to_reach_a_flaw_Pentium_processor)
10. [Dr. Dobb's Journal, "Pentium Crosses the Great Divide" (1995)](https://jacobfilipp.com/DrDobbs/articles/DDJ/1995/9552/9552a/9552a.htm)
11. [postmortem.io: Intel FDIV Bug incident record](https://postmortem.io/incidents/intel--1994-10-30--fdiv-bug/)
12. [Intel Timeline: Financial Year 1994](https://timeline.intel.com/1994/financial-year-1994)
13. [The MathWorks, "A Tale of Two Numbers"](https://www.mathworks.com/company/technical-articles/a-tale-of-two-numbers.html)
14. [Intel, "Formally Verifying Arithmetic Circuits: Avoiding the Pentium FDIV Bug"](https://www.cs.cmu.edu/~emc/papers/Conference%20Papers/FormallyVerifyingArithmeticCircuits-AvoidingThePENTIUM-FDIVBug.pdf)
15. [CTU Prague course notes: Pentium FDIV bug and formal verification](https://cw.fel.cvut.cz/b191/_media/courses/lup/lup1.pdf)
16. [Tom's Hardware: 30-year-old Pentium FDIV bug tracked down in the silicon](https://www.tomshardware.com/pc-components/cpus/30-year-old-pentium-fdiv-bug-tracked-down-in-the-silicon-ken-shirriff-takes-the-microscope-to-intels-first-ever-recall)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Processors & processor engineering › Microarchitecture & implementation › Intel microarchitectures

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/pentium-fdiv-bug

English original: https://www.edgepedia.org/pentium-fdiv-bug
