comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com
Subject: Re: Code portability question
Date: 1999/01/25
Date: 1999-01-25T00:00:00+00:00	[thread overview]
Message-ID: <78iikh$52p$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 36ABE8BF.FFBD087F@rocketmail.com

In article <36ABE8BF.FFBD087F@rocketmail.com>,
  Corey Ashford <yeroca@rocketmail.com> wrote:

> Assuming the machine they ended up on was SPARC, the
> precision of float, long_float etc. may well be different
> (they aren't different on the Rational Ada compiler, but
> probably are on GNAT).

Most certainly GNAT follows the implementation requirement
of RM B.2(10):

   10  Floating point types corresponding to each floating
       point format fully supported by the hardware.

Since the ia32 hardware supports 80-bit floating-point, but
the SPARC hardware only supports 64-bit hardware, the RM
*requires* that the two implementations are different in
this respect. Are you really saying that Rational does not
follow this requirement? That would be rather surprising,
this is not an optional requirement, since this part of
annex B is required to be implemented in any conforming
compiler.

In GNAT, the relevant declarations are:

   --  Floating point types. We assume that we are on an
   --  IEEE machine, and that the types Short_Float and
   --  Long_Float in Standard refer to the
   --  32-bit short and 64-bit long IEEE forms.
   --  Furthermore, if there is
   --  an extended float, we assume that it is available as
   --  Long_Long_Float.

   --  Note: it is harmless, and explicitly permitted, to

   --  include additional
   --  types in interfaces, so it is not wrong to have
   --  IEEE_Extended_Float
   --  defined even if the extended format is not
   --  available.

   type IEEE_Float_32       is new Short_Float;
   type IEEE_Float_64       is new Long_Float;
   type IEEE_Extended_Float is new Long_Long_Float;

The decision to provide the type Long_Long_Float in
Standard is of course NOT required, and is a (permissible,
and we think desirable) implementation choice.

However, providing full support of the 80-bit form in
Interfaces is clearly required by the RM, and indeed
was quite deliberate. During the design, we felt it was
important to ensure support for all available hardware
floating-point formats.

Robert Dewar
Ada Core Technologies


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1999-01-25  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-22  0:00 Code portability question Mike Werner
1999-01-23  0:00 ` Corey Ashford
1999-01-23  0:00   ` bill_1
1999-01-24  0:00   ` Mike Werner
1999-01-24  0:00     ` Corey Ashford
1999-01-25  0:00       ` robert_dewar
1999-01-25  0:00         ` Corey Ashford
1999-01-25  0:00           ` dewar [this message]
1999-01-23  0:00 ` bill_1
1999-01-24  0:00   ` Mike Werner
1999-01-23  0:00 ` Tucker Taft
1999-01-24  0:00   ` Mike Werner
1999-01-31  0:00     ` Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox