Yes, the x87 FPU is deterministic for the basic operations +
, -
, *
, /
, sqrt
. For instance, in its default state (full-width significand and round-to-nearest-even mode), the result of x + y
is exactly the nearest representable 80-bit floating-point value to the result of the mathematical sum of x
and y
.
Makers of compatible chips have implemented the exact same definition for the operations above.
The x87's instruction set, in pure CISC tradition, also contains high-level instructions to compute mathematical functions, say, an approximation of the sine (FSIN
). The results of these instructions have varied over brands and models of processors. In your emulator, you probably need only to provide something as good as one of the worst implementations of these instructions still in use. No-one should complain if you use the result of the sinl()
function from the math library of your host language, which is typically better than FSIN
(by virtue of being implemented with explicit argument reduction and polynomial approximation, and not a call to FSIN
).