This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: don't try to compare IEEE NaN's


On Wed, Jun 06, 2001 at 09:15:58AM +0300, Eli Zaretskii wrote:
> > From: Jim Blandy <jimb@zwingli.cygnus.com>
> > Date: Tue,  5 Jun 2001 22:41:45 -0500 (EST)
> > 
> > !   testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */
> > !   float_resultval     = float_func ();		
> > !   testval.double_testval = 3.14159265358979323846; /* float_checkpoint */
> > !   double_resultval    = double_func ();		
> 
> I think it is better to initialize the integral members of the union
> with an explicit bit pattern, just not a pattern which gets
> interpreted as a NaN of an Inf.  With initialization such as above,
> you risk losing due to subtleties of compile-time conversion of a
> literal constant to a floating-point value.  This is a GDB test suite,
> so we are not interested in testing the compiler.

Which means the test suite will break if you ever run it on a machine that
doesn't have IEEE floating point, such as the VAX if anybody still builds gdb
for that machine.  There are also mixed endian machines, where the bytes are
ordered one way, but the order of the words is different.  In supporting
embedded processors, we occasionally run into machines with weird floating
point formats, or that use IEEE formats, but don't support infinities,
denormals, or nans.  Also, there are a number of embedded targets that only
have single precision hardware floating point, and want sizeof(float) ==
sizeof(double).

-- 
Michael Meissner, Red Hat, Inc.  (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]