Moonchild
Moonchild

Reputation: 560

Does ieee 754 account for x86's DAZ mode?

X86 has two interesting flags that can be set in the dynamic floating-point environment which affect treatment of subnormals. FTZ (flush-to-zero) says that in any case when a subnormal result would be produced, 0 is produced instead. DAZ (denormals-are-zero) says that all subnormal operands are treated as though they were 0.

I think §8.2 of ieee 754 accounts for FTZ:

Associating a resuming alternate exception handling attribute with a block means: handling the implied exceptions according to the resuming attribute specified, and resuming execution of the associated block. Implementations should support these resuming attributes:

...

substitute(x)

Specifiable for any exception: replace the default result of such an exceptional operation with a variable or expression x. The timing and scope in which x is evaluated is language-defined.

...

abruptUnderflow

When underflow is signaled because a tiny non-zero result is detected, replace the default result with a zero of the same sign or a minimum normal rounded result of the same sign, raise the underflow flag, and signal the inexact exception.

(I don't remember the behaviour of FTZ in directed rounding modes, but one of the above should cover it.)

Is any allowance made for DAZ? I didn't see any.

Upvotes: 1

Views: 85

Answers (0)

Related Questions