HAS_SUBNORM is 0: FTZ (flush to zero) shall be done before tininess detection or after tininess detection?

85 Views Asked by At

Consider 1.1754944E-38f - 1.1754945E-38f (both are normals).

If HAS_SUBNORM is 1, then the answer is -1E-45f (subnormal) and no exceptions are raised.

If HAS_SUBNORM is 0, then the answer is -0.0f (subnormal -1E-45f was flushed to zero). Question: shall Underflow and Inexact be raised?

IEEE 754-2008, 7.5 Underflow:

The underflow exception shall be signaled when a tiny non-zero result is detected.

The tininess is detected:

  • after rounding, or
  • before rounding.

However, at which step FTZ (flush to zero) logic shall be executed:

  • before tininess detection, or
  • after tininess detection?

Reason of the question: some hardware does not support subnormal numbers, but does raise Underflow and Inexact in the example above. Meaning that such hardware does FTZ after tininess detection. I am wondering whether it is a correct behavior.

0

There are 0 best solutions below