This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: Why Special float.h Files? (Was: Re: PATCH: XFAIL c99-float-1.c...)


On Wed, Jan 31, 2001 at 06:09:59PM +0000, Joseph S. Myers wrote:
> On Wed, 31 Jan 2001, Jeffrey Oldham wrote:
> 
> > 1) How do we ensure that gcc's float.h are consistent with the
> >    underlying system since the underlying system can change without
> >    warning us?  Do I just guess correct values?
> 
> You don't guess values.  The ISO C standard defines the contents of this
> header; you read the specification, and the specification of the floating
> point format for your architecture (either in the CPU manual, or deferred
> to IEEE 754 / IEC 60559), and compute the correct values and enter them in
> the file.  enquire.c may generate the non-C99 parts of the file, but the
> results should still be checked - including making sure that the binary
> value compiled for decimal constants in the source file has the exact bits
> the minimal / maximal normalized floating point values should have.
> 
> For many systems (those using only 32-bit and 64-bit IEEE format),
> float-i64.h suffices - someone with the IEEE floating point standard
> should add the C99 values to it.

But it should be noted that there are systems that don't use standard IEEE
format (due to having switches that control how big double is, systems that use
IEEE format but don't use NaNs/infinities, non-IEEE formats), which is why all
of the other float-*.h exist.

-- 
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]