|
|
|
|
|
by watersb
53 days ago
|
|
> Because the 8086 had no facility for emulating an FPU (unlike the 80286 and later processors), the emulation mechanism was somewhat complex and required tight cooperation of assemblers/compilers, linkers, and run-time libraries. The article goes into some detail on the extra effort required to implement FPU hardware emulation on a platform that did not especially support it. Modern implementation of FPU emulation might be more straightforward. I haven't worked with FPU emulation on microcontrollers, which is probably the most common use case these days. |
|
Most 32-bit designs throw an exception on an invalid instruction so it can be caught and handled at runtime. Even basic ARM Cortex-M0 chips throw a catchable exception on illegal instructions.
So one option is to just issue the FPU instructions as if the FPU exists, and then catch and emulate.
This is how operating systems emulated FPUs on processors like the 68020, the 386 and early RISC machines, if they didn't have an FPU.