pmor
pmor

Reputation: 6276

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

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:

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

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.

Upvotes: 1

Views: 84

Answers (0)

Related Questions