This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- From: "N.M. Maclaren" <nmm1 at cam dot ac dot uk>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: 22 Aug 2009 10:51:09 +0100
- Subject: Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- References: <4A8EC93A.4080605@gmail.com> <4A8ED4B2.3010503@net-b.de> <4A8F037D.1020903@gmail.com>
On Aug 21 2009, Uros Bizjak wrote:
On 08/21/2009 07:09 PM, Tobias Burnus wrote:
It is not nice to upset FP hardware of various target architectures by
generating denormalized single-precision FP numbers [1] in the
testsuite. ...
For interested readers, here is what happens when IEEE single denormals
are loaded in alpha, see section 2.2.6.1, S_Floating from "Alpha
Lastly, note that the latest
Architecture Handbok, v4" [1]:
It's not just single precision, it's not just denormalised numbers, it's
not just the Alpha, and it's not just hardware.
Most HPC systems use hard underflow, because it is faster. [Aside: it's
numerically as good, too, but that is another matter. ] It's asking for
trouble to load a denormalised number into software that isn't designed
to handle it (even if the hardware does) and often causes a surprising
amount of chaos.
For similar reasons, infinities and NaNs shouldn't be generated for hardware
or software that does not support them, even if they are representable.
The resulting chaos will startle most programmers. And note that the Alpha
and perhaps some other systems have the concept of invalid numbers, which
are a much, much stronger concept than a NaN.
While systems that have the concept of unnormalised numbers (e.g.
System/370) are probably dead, IEEE 754 has now introduced them (under the
concept of cohorts) into its decimal floating-point representation. God
alone knows what conventions will arise on how that is used, if indeed it
is used and does not simply go down like a lead balloon.
Regards,
Nick Maclaren.