Ken Shirriff 逆向 Intel 8087:浮点加减法如何在硅片上快过 8086 百倍Ken Shirriff Reverse-Engineers Intel's 8087: How Floating-Point Addition Ran 100x Faster Than the 8086


AI free token/AI免费积分
Ken Shirriff 逆向 Intel 8087:浮点加减法如何在硅片上快过 8086 百倍

在任何 CPU 上用软件做浮点加减法都没问题,但专用硬件能带来数量级的速度提升。Intel 8087 正是第一款面向大众的主流浮点协处理器,Ken Shirriff 近期借助一块 8087 裸片逆向工程,揭示了这些基础运算在芯片内的实现方式。

实测中,即便是「两个浮点数相加」这样简单的操作,8087 相比 8086 CPU 也有约百倍加速——一旦开始认真使用电子表格,或是用 CAD 软件渲染 3D 场景、跑游戏,这个差距立刻变得切身相关。

细节里藏着魔鬼:棘手的无穷大与边界情况,恰恰是专用硅片最大的提速空间所在,此外还有占据大量电路的移位器。浮点运算的本质是按位对齐数值,因此移位电路加上对向上/向下溢出的检测,正是 8087 及其后继者让浮点运算在 PC 应用中真正实用的关键。

Ken 的文章详述了移位的工作原理以及 8087 电路如何实现它。这些逻辑有很大一部分由微码实现,微码清单也随文公布。从中可以清楚看出,看似简单的运算集实则相当复杂——即便是今天颇受诟病的 x87 指令集,也远优于全靠整数软件模拟的方案。

(信息来源:Hackaday,2026-10-22)

本文来源:https://hackaday.com/2026/10/22/floating-point-addition-and-subtraction-on-intels-8087/
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。

Although you can do basic floating point format operations like addition and subtraction just fine on any CPU, having specialized hardware for it can provide a significant speed boost. Here Intel's 8087 was the first mainstream floating-point coprocessor to provide this option to a wide audience, with Ken Shirriff recently reverse-engineering using an 8087 die how these basic operations were implemented.

The real-world speed-up of even simple operations like adding two floating point numbers compared to the 8086 CPU was on the order of a hundred times, which is very relevant the moment you start doing interesting things with spreadsheets, not to mention rendering 3D scenes in CAD software or even games.

As always, the devil is in the details, with sneaky infinities and edge cases also providing the biggest potential for speed-ups in dedicated silicon, along with the large circuitry spent on the shifter. With floating point values being very much about aligning values with shifting by a number of bits, this circuitry along with the detecting of over- and underflows is the key element why the 8087 and its successors were so crucial in making floating-point operations at all feasible in PC applications.

How this shifting works in theory is detailed in the article by Ken, along with how the 8087 implements it in its circuits. Naturally, a large part of this is implemented in microcode, the listing for which is also provided. From this it's quite clear how what seems like a simple set of operations is actually quite complex, making even the now much maligned x87 ISA an improvement over doing it all in integer-based software.

Ken Shirriff Reverse-Engineers Intel's 8087: How Floating-Point Addition Ran 100x Faster Than the 8086

暂无评论,快来发表第一条评论吧!No comments yet. Be the first!

📮 需求咨询📮 Inquiry