Ken Shirriff opened up an Intel 8087 with a microscope and reverse-engineered the microcode for FSCALE, the instruction that scales a floating-point number by a power of two by adding to its exponent. He expected something close to trivial. It is not: FSCALE runs 140+ micro-instructions and three levels of subroutine calls, almost all of it handling special cases.
What the chip has to cope with:
80-bit “temporary real” values: sign, 15-bit biased exponent, 64-bit significand Hidden tags per register — valid, special (inf/NaN/denorm), zero, empty Four rounding modes, signed zeros, projective/affine infinity, denorms, and an entire family of NaNs Exceptions that can be masked (keep computing, return best-effort value) or unmasked (interrupt) The actual work is small. The normal path is about 22 micro-instructions: bail if either argument is zero, convert the scale argument from float to integer by shifting right 0x403e - exponent bits (the exponent is biased by 16383, hence the constant from a dedicated exponent constant ROM), add that integer to the other operand’s exponent, then let the exponent converter check for overflow. Everything else is edge cases, and they are shared machinery:
...