# Intel's 8087 chip hides a surprisingly complex secret in its simplest instruction

Original title: Microcode in Intel's 8087 floating-point chip: the scale instruction

> Hacker News story 49673580 · language: en · submitted 2026-09-12
> Web version: https://zeli.app/story/49673580
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 126 · by [pwg](<https://news.ycombinator.com/user?id=pwg>) · 💬 46
[original](<https://www.righto.com/2026/09/8087-microcode-reverse-engineering-fscale.html>) · [HN discussion](<https://news.ycombinator.com/item?id=49673580>)

## Summary

The 8087 floating-point coprocessor, introduced in 1980, set the standard for modern floating-point arithmetic. Ken Shirriff, part of the Opcode Collective, reverse-engineers the microcode for the FSCALE instruction—expected to be trivial—and finds it uses over 140 micro-instructions and three levels of subroutine calls to handle special cases. The analysis reveals the chip's internal datapath and a hidden feature.

## Key quote

> I figured that FSCALE was a simple, almost trivial instruction that would be straightforward to understand and explain. Spoiler: it is not simple.

## HN discussion (46 comments)

### [garganzol](<https://news.ycombinator.com/item?id=49674893>)

> 100x speed improvement of math operations by 8087 is not an overestimation. The difference for apps relying on math was crazy back then. I experienced this first-hand on my 80286 machine, where it was 3-second vs 300-second calculation results.
>
> One neat feature of 8087 instruction set is that it can be interspersed with x86 instructions in the code stream, giving you a simultaneous access to two processor chips working in parallel. This combo forms a real asymmetrical multi-processor system with certain opportunities for hardware-assisted code parallelization. If a thoughtful instruction scheduling is used, floating operations executed by 8087 work in parallel with the usual integer x86 code.

### [cogman10](<https://news.ycombinator.com/item?id=49674574>)

> x87 is such a weird architecture.  It was designed the same way you'd design a chip for a scientific calculator.  Heck, It's almost a perfect fit for an HP RPN calculator.
>
> But for a compiler to target, it's just so painful.  It's so different from almost all other ways CPUs work.  There's a reason both CPU and compilers prefer to avoid x87 when possible and use regular SIMD (SSE/AVX) instead.
>
> Also, the arbitrary "Oh, and the registers are 80 bits wide" is also just one of those weird "Where did that number come from?".

### [kens](<https://news.ycombinator.com/item?id=49673781>)

> Author here for your 8087 questions...

### [finn888](<https://news.ycombinator.com/item?id=49679172>)

> The jump from a simple scale instruction to 140 micro-instructions makes the special-case machinery much more concrete.

---

## Cite

- Page: https://zeli.app/story/49673580
- Date: 2026-09-12
- Source: righto.com (https://www.righto.com/2026/09/8087-microcode-reverse-engineering-fscale.html)
- Hacker News: https://news.ycombinator.com/item?id=49673580

## Other languages

- zh: https://zeli.app/zh/story/49673580 · markdown: https://zeli.app/zh/story/49673580.md
- ja: https://zeli.app/ja/story/49673580 · markdown: https://zeli.app/ja/story/49673580.md
- ko: https://zeli.app/ko/story/49673580 · markdown: https://zeli.app/ko/story/49673580.md
- de: https://zeli.app/de/story/49673580 · markdown: https://zeli.app/de/story/49673580.md
- es: https://zeli.app/es/story/49673580 · markdown: https://zeli.app/es/story/49673580.md
- ru: https://zeli.app/ru/story/49673580 · markdown: https://zeli.app/ru/story/49673580.md
