Don wrote:
I'm not even sure how that should work. On x86, there are two completely independent FPU rounding modes and exception masks: one for x87, and one for SSE. Additionally, some of these may have rounding modes which aren't support by the others (almost all CPUs other than x87 have a flush-subnormals-to-zero mode; and in the IEEE spec, decimal floating point has two extra rounding modes that binary doesn't have).

What this means, I think, is that the D-supplied mechanism for controlling rounding mode and exceptions needs to be general enough to support them all.

The D functions to get/set the modes should set both of them to the same value. Exception flag readers should OR the two together. This is because the compiler/library will likely mix & match using the SSE and x87 as convenient.

Unsupported modes should throw an exception on attempting to set them.

Reply via email to