[PATCH, testsuite]: PR 58757: Check for FP denormal values without triggering denormal exceptions

Marc Glisse marc.glisse@inria.fr
Wed Sep 24 12:26:00 GMT 2014

On Wed, 24 Sep 2014, Uros Bizjak wrote:

> However, alpha *does* support all IEEE features, the only problem is
> in its default model, which is for some reason "High-Performance
> IEEE-Format Arithmetic" (please see alpha AHB [1], section
> This model "does not require the overhead of an operating system
> completion handler and can be the fastest of the three IEEE models.".
> Unfortunately, this model also "notifies applications of all
> exceptional floating-point operations". Denormals are considered
> non-finite IEEE values, so they trap.
> When the target is in certain "high-speed" mode, it is up to the user
> to obey all the limitations, in this particular case, that only IEEE
> finite numbers are provided. This is not the case with the original
> testcase, so I'd say that the test is out of specs. It beats me, why
> -mieee is not the default on alpha, since current default suits
> -ffast-math more, but it looks that we have to live with this mess.

(I believe -mieee is the default on some alpha platforms, maybe debian 
or bsd?)

> To avoid traps on denormals, -mieee has to be specified. This option
> enables FP software completion that completes denormal handling, so
> there is no need to "notify application ...". IMO, instead of XFAILing
> the test, we should simply provide "-mieee". __*_DENORM_MIN__ should
> indeed apply to the underlying FP format, not to sme target-dependent
> model and its implementation details.
> [1] http://www.compaq.com/cpq-alphaserver/technology/literature/alphaahb.pdf

In, I see: "Underflow results are set to zero." so this is a 
functional model without denormals. According to the C11 standard, this 
means DBL_HAS_SUBNORM should be 0 and DBL_TRUE_MIN should be the same as 
DBL_MIN. The same is probably true on x86 with -ffast-math.

Giving DBL_TRUE_MIN an unusable value (zero or trapping) is not very 
useful, while providing the real usable minimum lets users do something 
meaningful with it.

The main issue is using incompatible flags in different objects or at 
link time...

Marc Glisse

More information about the Gcc-patches mailing list